:root {
  color-scheme: light;
  --ink: #242424;
  --muted: #727272;
  --line: #e2e2e2;
  --surface: #f4f4f4;
  --header-height: 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
button:focus-visible, input:focus-visible { outline: 2px solid #777; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
svg.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px max(32px, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 32px; min-width: 0; }
.brand-logo { width: 148px; height: 49px; flex: 0 0 auto; display: block; }
.brand-label { border-left: 1px solid var(--line); padding-left: 32px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; white-space: nowrap; }
.session { display: flex; align-items: center; gap: 24px; }
.session-time { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.session-time.expiring { color: #a02e36; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #fff; font-size: 14px; }
.text-button:hover, .icon-button:hover:not(:disabled) { background: var(--surface); }
#logoutBtn { border: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 44px; padding: 10px; background: transparent; border: 0; border-radius: 3px; color: var(--ink); }
.login { min-height: calc(100svh - var(--header-height)); display: grid; align-content: center; justify-items: center; padding: 64px 24px; }
.login-inner { width: 100%; max-width: 360px; padding-bottom: 56px; }
.eyebrow { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.login h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 40px; line-height: 1.2; margin-bottom: 16px; }
.login-copy { font-size: 16px; color: var(--muted); margin-bottom: 36px; }
label { display: block; font-size: 14px; margin-bottom: 10px; }
.password-field { display: flex; align-items: center; border: 1px solid #bcbcbc; border-radius: 3px; padding-right: 4px; }
.password-field:focus-within { border-color: var(--ink); }
input { font-size: 16px; min-width: 0; width: 100%; border: 0; padding: 13px 14px; color: var(--ink); background: transparent; }
.primary { width: 100%; min-height: 48px; background: #242424; border: 1px solid #242424; border-radius: 3px; color: #fff; padding: 12px 18px; margin-top: 18px; font-size: 16px; }
.primary:hover { background: #414141; }
.error { margin: 12px 0 0; min-height: 21px; color: #a02e36; font-size: 14px; }
.login-footer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin: 28px 0 0; padding-top: 20px; }
.workspace { width: 100%; }
.profile { max-width: 1184px; margin: 0 auto; padding: 20px 32px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
.profile h1 { font-family: inherit; font-size: 18px; font-weight: 500; line-height: 1.4; margin: 0; }
.profile-amount { margin: 0; font-size: 14px; color: var(--muted); }
.document-bar { position: sticky; top: var(--header-height); z-index: 20; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 24px; padding: 0 max(32px, calc((100% - 1120px) / 2)); border-top: 1px solid var(--line); border-bottom: 1px solid #d4d4d4; background: #fff; }
#docTabs { display: flex; align-self: stretch; gap: 26px; }
.doc-button { display: flex; align-items: center; gap: 9px; padding: 14px 0; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; min-height: 52px; font-size: 14px; white-space: nowrap; }
.doc-button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.doc-button:hover { color: var(--ink); }
.page-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.page-counter { min-width: 64px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.control-divider { width: 1px; height: 18px; margin: 0 10px; background: var(--line); }
.zoom-label { min-width: 45px; font-size: 13px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer { min-height: calc(100svh - 194px); background: var(--surface); padding-bottom: 1px; }
.document-scroll { width: 100%; padding: 30px 24px 48px; }
.page-stage { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.pdf-page { width: 100%; margin: 0; scroll-margin-top: calc(var(--header-height) + 80px); }
.page-pan { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.paper { margin: 0 auto; position: relative; overflow: hidden; background: #fff; box-shadow: 0 1px 5px #00000018; }
.paper canvas { display: block; }
.page-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.page-watermark { position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none; color: #00000012; font-size: 25px; transform: rotate(-30deg); text-align: center; }
.page-watermark small { display: block; font-size: 13px; }
.page-caption { text-align: center; color: var(--muted); margin: 12px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.viewer-message { max-width: 400px; margin: 0 auto; text-align: center; color: var(--muted); padding: 60px 20px; }
.viewer-message h2 { font-size: 20px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.viewer-message p { font-size: 14px; margin-bottom: 20px; }
.viewer-message .icon { width: 30px; height: 30px; margin-bottom: 16px; }
.page-error { margin: 0; padding: 24px; text-align: center; color: #a02e36; font-size: 14px; }
.admin { width: 100%; max-width: 760px; margin: 0 auto; padding: 44px 24px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.admin-head h1 { font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; margin: 0; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.code-row p { margin: 0; font-size: 14px; color: var(--muted); }
.code-value { display: flex; align-items: center; gap: 8px; }
.code-value code { font-size: 16px; }
.admin-status { margin-top: 22px; font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
  :root { --header-height: 70px; }
  .topbar { padding: 10px 18px; gap: 12px; }
  .brand-logo { width: 144px; height: 48px; }
  .brand-label { display: none; }
  .session { gap: 8px; }
  #logoutBtn .button-label { display: none; }
  #logoutBtn { padding: 10px; }
  .profile { padding: 17px 18px; }
  .profile h1 { font-size: 17px; }
  .profile-amount { font-size: 13px; }
  .document-bar { padding: 0 18px; display: block; }
  #docTabs { gap: 0; }
  .doc-button { flex: 1; justify-content: center; padding: 12px 6px; min-height: 44px; }
  .page-controls { justify-content: flex-end; min-height: 42px; }
  .page-counter { margin-right: auto; min-width: 0; text-align: left; }
  .control-divider { display: none; }
  .icon-button { min-width: 40px; min-height: 44px; }
  .viewer { min-height: calc(100svh - 216px); }
  .document-scroll { padding: 14px 8px 32px; }
  .page-stage { gap: 24px; }
  .pdf-page { scroll-margin-top: calc(var(--header-height) + 112px); }
  .page-caption { margin-top: 10px; }
  .page-watermark { font-size: 21px; }
  .page-watermark small { font-size: 12px; }
  .login { padding: 44px 28px; }
  .login-inner { padding-bottom: 40px; }
  .login h1 { font-size: 36px; }
  .admin { padding: 28px 20px; }
  .code-row { grid-template-columns: 1fr; gap: 8px; }
  .code-value { justify-content: space-between; }
}
@media print { body > * { display: none !important; } }
