:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #161b23;
  background: #fff;
  font-synthesis: none;
  --muted: #656b76;
  --border: #d6d9de;
  --accent: #a44835;
  --canvas: #f7f8f9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; font-size: 14px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.site-header { height: 76px; padding: 0 40px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 18px; color: inherit; text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 32px; letter-spacing: -.8px; }
.brand-mark { width: 25px; height: 26px; border: 1.5px solid var(--accent); border-radius: 3px; }
.text-button { background: transparent; color: inherit; border: 0; padding: 10px 0; display: inline-flex; gap: 8px; align-items: center; justify-content: center; line-height: 1.4; }
.text-button:hover:not(:disabled) { color: var(--accent); }
.text-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.accent { color: var(--accent); }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 46px; line-height: 1.12; font-weight: 400; letter-spacing: -1.4px; }
.login-screen { min-height: calc(100svh - 76px); padding: 80px 24px; display: grid; place-items: center; }
.login-panel { width: min(100%, 420px); border: 1px solid var(--border); border-radius: 5px; padding: 36px 28px 25px; }
.login-panel h1 { font-size: 32px; line-height: 1.25; letter-spacing: -.9px; margin-bottom: 30px; }
form { display: flex; flex-direction: column; }
label { font-size: 13px; margin-bottom: 8px; }
input { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; background: #fff; color: inherit; margin-bottom: 20px; }
.primary-button { width: 100%; border: 1px solid var(--accent); border-radius: 4px; color: #fff; background: var(--accent); min-height: 44px; padding: 10px 16px; }
.primary-button:hover:not(:disabled) { background: #8d3d2d; }
.login-note { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5; }
.login-status { font-size: 13px; color: var(--muted); line-height: 1.6; min-height: 24px; margin: 16px 0; overflow-wrap: anywhere; }
.collection { max-width: 1760px; margin: 0 auto; padding: 32px 40px 28px; }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.collection-heading p { margin-top: 9px; font-size: 18px; color: var(--muted); line-height: 1.5; }
.request-controls { display: flex; gap: 24px; flex-shrink: 0; }
.status { font-size: 13px; color: var(--muted); min-height: 42px; display: flex; align-items: center; padding: 10px 0; line-height: 1.6; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 24px; font-size: 13px; color: var(--muted); }
.breadcrumbs:empty { display: none; }
.breadcrumbs > * { overflow-wrap: anywhere; text-align: left; }
.breadcrumbs > * + *::before { content: '/'; color: var(--border); margin-right: 12px; }
.breadcrumbs .text-button { font-size: inherit; padding: 4px 0; }
.breadcrumbs [aria-current] { color: #161b23; }
.folder-browser { margin-bottom: 28px; }
.folder-browser h2 { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.folder-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.folder-grid li { min-width: 0; }
.folder-card { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: inherit; }
.folder-card:hover:not(:disabled) { border-color: var(--accent); background: #fcf8f6; }
.folder-cover { width: 100%; aspect-ratio: 8 / 5; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--canvas); border-radius: 3px; }
.folder-thumbnail { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--canvas); }
.preview-controls { padding: 0 0 18px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }
.preview-actions .text-button { font-size: 13px; }
#preview-progress { display: block; margin-top: 10px; width: min(100%, 400px); height: 6px; accent-color: var(--accent); }
.folder-icon { position: relative; width: 35px; height: 25px; border: 1.5px solid var(--accent); border-radius: 3px; margin: 6px 0 8px; background: #faf1ee; }
.folder-icon::before { content: ''; position: absolute; width: 15px; height: 6px; top: -7px; left: -1.5px; border: 1.5px solid var(--accent); border-bottom: 0; border-radius: 3px 3px 0 0; background: #faf1ee; }
.folder-name { width: 100%; margin-top: 4px; font-size: 14px; font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-detail { margin-top: auto; color: var(--muted); font-size: 12px; line-height: 1.5; }
.folder-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 12px; color: var(--muted); }
.folder-pagination span { text-align: center; }
.folder-pagination .text-button { font-size: 13px; flex-shrink: 0; }
.empty-folder { border: 1px solid var(--border); padding: 36px 24px; color: var(--muted); line-height: 1.6; }
.collection-heading h1 { overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; height: max(480px, calc(100svh - 302px)); max-height: 980px; }
.file-panel { border: 1px solid var(--border); border-radius: 5px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.file-heading { padding: 17px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.file-heading h2 { font-size: 16px; font-weight: 500; }
.file-heading span { font-size: 12px; color: var(--muted); }
.file-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.file-list:empty { flex: 0; }
.file-list li + li { border-top: 1px solid #e7e9ec; }
.file-button { width: 100%; padding: 12px 18px; text-align: left; border: 0; color: inherit; background: #fff; display: grid; gap: 5px; line-height: 1.35; }
.file-button:hover:not(:disabled) { background: var(--canvas); }
.file-button[aria-current="true"] { background: #faf1ee; box-shadow: inset 3px 0 var(--accent); }
.file-name, .file-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name { font-size: 14px; }
.file-detail { color: var(--muted); font-size: 12px; }
.empty-list { padding: 20px 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.file-pagination { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px; border-top: 1px solid var(--border); }
.file-pagination .text-button, .file-pagination span { font-size: 12px; }
.file-pagination span { color: var(--muted); }
.viewer { border: 1px solid var(--border); border-radius: 5px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.canvas { background: var(--canvas); flex: 1; min-height: 0; display: grid; place-items: center; padding: 22px; overflow: hidden; }
.placeholder { text-align: center; max-width: 460px; padding: 24px 10px; color: var(--muted); }
.placeholder svg { margin-bottom: 20px; }
.placeholder h2 { font-family: Georgia, "Times New Roman", serif; font-size: 32px; line-height: 1.25; font-weight: 400; color: #161b23; letter-spacing: -.8px; }
.placeholder p { font-size: 17px; line-height: 1.6; margin-top: 12px; }
#preview { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.viewer-toolbar { min-height: 60px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 100px minmax(0, 1fr) 100px; align-items: center; gap: 16px; padding: 6px 24px; }
.viewer-toolbar .text-button:first-child { justify-self: start; }
.viewer-toolbar .text-button:last-child { justify-self: end; }
#caption { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 25px; }
@media (max-width: 760px) {
  .site-header { height: 66px; padding: 0 22px; }
  .brand { font-size: 27px; gap: 12px; }
  .brand-mark { width: 22px; height: 23px; }
  .login-screen { min-height: calc(100svh - 66px); padding: 44px 22px; }
  .login-panel { padding: 30px 24px 22px; }
  .login-panel h1 { font-size: 29px; }
  .collection { padding: 28px 22px 22px; }
  h1 { font-size: 36px; letter-spacing: -1px; }
  .collection-heading { align-items: start; flex-direction: column; gap: 10px; }
  .collection-heading p { font-size: 16px; margin-top: 8px; }
  .request-controls { gap: 22px; }
  .status { padding: 4px 0 16px; min-height: 30px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .folder-card { padding: 8px; }
  .folder-name { font-size: 13px; }
  .breadcrumbs { margin-bottom: 20px; }
  .workspace { grid-template-columns: minmax(0, 1fr); height: auto; max-height: none; gap: 18px; }
  .file-panel { height: 225px; }
  .file-heading { padding: 13px 16px; }
  .file-button { padding: 11px 16px; }
  .viewer { height: 450px; }
  .canvas { padding: 14px; }
  .placeholder h2 { font-size: 28px; }
  .placeholder p { font-size: 15px; }
  .viewer-toolbar { min-height: 62px; padding: 6px 14px; grid-template-columns: 80px minmax(0, 1fr) 60px; gap: 8px; }
  .viewer-toolbar .text-button { font-size: 12px; gap: 4px; }
  #caption { font-size: 12px; }
  footer { margin-top: 22px; }
}
@media (max-width: 480px) {
  .folder-grid { grid-template-columns: minmax(0, 1fr); }
  .folder-pagination { gap: 8px; font-size: 11px; }
  .folder-pagination .text-button { font-size: 12px; }
}
