:root {
  color-scheme: light;
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: #162239;
  background: #f3f6fa;
  font-synthesis: none;
  --ink: #162239;
  --muted: #647187;
  --line: #e1e7f0;
  --accent: #2459df;
  --accent-dark: #1646c0;
  --accent-wash: #eaf0ff;
  --nav: #152138;
  --green: #087554;
  --amber: #9b5a15;
  --shadow: 0 10px 26px #1730580b;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #70a4ff; outline-offset: 2px; }
button:disabled { cursor: default; opacity: .55; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button, strong { font-weight: 600; }
button { color: inherit; }
.loading { padding: 48px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stack { display: grid; gap: 12px; }
.row, .actions { display: flex; align-items: center; gap: 10px; }
.actions { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, .85fr); }
.auth-main { display: grid; place-items: center; padding: 40px 28px; }
.auth-box { display: grid; gap: 24px; width: min(100%, 420px); }
.auth-box h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.05em; margin-bottom: 6px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { justify-content: center; min-height: 46px; }
.auth-art { display: grid; align-content: center; padding: clamp(36px, 8vw, 110px); background: #152341; color: #fff; overflow: hidden; position: relative; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 100% 0%, #325cbe 0%, transparent 61%), repeating-linear-gradient(0deg, transparent 0 54px, #ffffff08 55px 56px), repeating-linear-gradient(90deg, transparent 0 54px, #ffffff08 55px 56px); }
.auth-art > * { z-index: 1; }
.auth-art h2 { font-size: clamp(1.7rem, 3vw, 2.8rem); line-height: 1.3; margin-bottom: 28px; }
.auth-art-list { background: #253754; border: 1px solid #435677; border-radius: 18px; box-shadow: 0 22px 50px #08142565; padding: 14px; }
.auth-art-list div { display: flex; gap: 14px; align-items: center; padding: 13px 10px; }
.auth-art-list div + div { border-top: 1px solid #41526f; }
.auth-art-list span:last-child { color: #acc1df; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 27px; background: var(--nav); color: #eaf1ff; padding: 24px 15px 15px; overflow: auto; z-index: 2; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; line-height: 1.2; font-weight: 750; }
.brand small { display: block; margin-top: 5px; color: #9eaecb; font-size: .75rem; font-weight: 500; }
.auth-box .brand small { color: var(--muted); }
.mark { flex: 0 0 38px; height: 38px; display: inline-grid; place-items: center; background: #2e65eb; color: #fff; border-radius: 11px; box-shadow: 0 4px 13px #2363d747; font-size: 1.4rem; }
.sidebar .brand { margin-left: 7px; }
.nav { display: grid; gap: 5px; }
.nav-label { color: #a4b3ce; font-size: .8rem; padding: 0 10px 7px; }
.nav button, .draft-link { border: 0; background: transparent; color: #b9c7de; text-align: left; border-radius: 8px; min-height: 41px; padding: 7px 10px; display: flex; gap: 10px; justify-content: flex-start; align-items: center; width: 100%; font-size: .9rem; }
.nav button:hover, .draft-link:hover, .nav button.current, .draft-link.current { background: #273a5a; color: white; }
.nav button.current { box-shadow: inset 3px 0 #6295ff; }
.nav .symbol { min-width: 22px; }
.draft-list { display: grid; gap: 4px; }
.draft-row { display: flex; align-items: center; min-width: 0; border-radius: 8px; }
.draft-row.current { background: #273a5a; }
.draft-row .draft-link { min-width: 0; flex: 1; }
.draft-link { min-height: 35px; font-weight: 500; }
.draft-link .truncate { min-width: 0; }
.draft-row .draft-delete, .draft-list .draft-trash { color: #b9c7de; }
.draft-delete { border: 0; background: transparent; border-radius: 6px; padding: 6px; flex-shrink: 0; font-size: .77rem; }
.draft-row .draft-delete:hover, .draft-list .draft-trash:hover { background: #384b6c; color: #f1f6ff; }
.draft-list .draft-trash { justify-content: flex-start; }
.deleted-draft + .deleted-draft { padding-top: 10px; border-top: 1px solid #e1e7f0; }
.deleted-draft strong { overflow-wrap: anywhere; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #34415a; padding-top: 13px; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: #30476b; color: #e0eaff; font-weight: 700; }
.sidebar-footer button { color: #b9c7de; background: transparent; border: 0; padding: 8px 2px; font-size: .85rem; }
.username { min-width: 0; flex: 1; font-size: .85rem; }

.content { min-width: 0; }
.topbar { min-height: 63px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px clamp(17px, 3vw, 38px); }
.crumb { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: .9rem; }
.crumb strong { color: #263652; }
.slash { color: #9eabbf; }
.topbar .state { flex-shrink: 0; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); }
.state::before { content: ""; width: 7px; height: 7px; background: #23a67e; border-radius: 50%; }
.state.busy::before { background: #bd7c36; }
.stage { padding: 28px clamp(17px, 3vw, 38px) 40px; max-width: 1760px; margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 23px; }
.hero h1 { font-size: clamp(1.65rem, 3vw, 2.12rem); letter-spacing: -.038em; line-height: 1.25; overflow-wrap: anywhere; }
.hero p { margin-top: 8px; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.guide-page { max-width: 1000px; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.guide-nav [aria-current="page"] { color: var(--accent-dark); background: var(--accent-wash); border-color: #b7cbf7; }
.guide-article { min-width: 0; }
.guide-article .panel-head { padding-inline: clamp(14px, 3vw, 28px); }
.guide-article .panel-head h2 { font-size: 1.18rem; }
.guide-article .panel-head a { flex: none; }
.guide-body { padding: 18px clamp(14px, 3vw, 28px) 25px; font-size: .93rem; line-height: 1.7; overflow-wrap: anywhere; }
.guide-body > * + * { margin-top: 10px; }
.guide-body h3 { color: #273e64; font-size: 1rem; margin-top: 19px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.guide-table th, .guide-table td { vertical-align: top; text-align: left; border: 1px solid var(--line); padding: 8px; }
.guide-table thead th { color: #294366; background: #edf3fb; }
.guide-table tbody th { color: #2b4164; background: #f7f9fc; min-width: 5em; }
.guide-source { color: var(--muted); font-size: .84rem; }
.guide-source a { text-decoration: underline; text-underline-offset: .16em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 8px 13px; border: 1px solid #d7e0ec; background: #fff; border-radius: 8px; font-size: .9rem; line-height: 1.22; white-space: nowrap; color: #283b59; text-decoration: none; }
.btn:hover { background: #f1f5fc; border-color: #b9c9de; }
.btn.primary { color: white; border-color: var(--accent); background: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.soft { color: #174dbf; background: #edf3ff; border-color: #d4e1fb; }
.btn.flat { border-color: transparent; background: transparent; color: var(--accent-dark); }
.btn.flat:hover { background: var(--accent-wash); }
.sidebar .nav-label .btn { color: #c0d2f6; }
.sidebar .nav-label .btn:hover { background: #273a5a; }
.btn.danger { color: #a62f39; }
.btn.compact { min-height: 32px; padding: 6px 8px; font-size: .82rem; }
.symbol { font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif; font-weight: 600; }
.segmented { display: inline-flex; gap: 3px; background: #edf1f7; border-radius: 9px; padding: 3px; }
.segmented button { border: 1px solid transparent; background: transparent; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: .86rem; white-space: nowrap; }
.segmented button[aria-selected="true"] { color: var(--accent-dark); background: #fff; border-color: #e4e9f2; box-shadow: 0 2px 5px #1a2b4d0c; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.metric { position: relative; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 15px 14px 14px; text-align: left; min-height: 88px; }
.metric:hover { border-color: #b7c9ea; }
.metric-title { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.metric strong { font-size: 1.48rem; line-height: 1.25; }
.metric .icon-tile { position: absolute; right: 12px; top: 15px; }
.icon-tile { display: inline-grid; place-items: center; min-width: 33px; height: 33px; border-radius: 8px; background: #eaf0fc; color: #2a5db4; font-size: .9rem; font-weight: 700; }
.icon-tile.good { background: #e8f7ef; color: var(--green); }
.icon-tile.warn { background: #fff4df; color: #9d621a; }
.icon-tile.lavender { background: #f0edfb; color: #6547ad; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.61fr) minmax(282px, 1fr); gap: 17px; align-items: start; }
.itinerary-overview { margin-bottom: 15px; }
.route-summary { display: grid; gap: 9px; }
.route-summary + .route-summary { border-top: 1px solid var(--line); padding-top: 12px; }
.route-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.route-chip { display: inline-flex; gap: 7px; align-items: center; padding: 6px 9px; font-size: .83rem; background: #f1f5fd; color: #234a91; border-radius: 7px; }
.route-chip time, .leg-section time { font-variant-numeric: tabular-nums; color: #566c8c; }
.trip-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .79rem; color: #82531f; }
.trip-status > span { width: 8px; height: 8px; border-radius: 50%; background: #da9b47; }
.trip-status.closed { color: var(--green); }
.trip-status.closed > span { background: #1caf7a; }
.leg-section { border-top: 1px solid #e7edf6; padding: 10px 12px 7px; }
.leg-section > h3 { display: flex; align-items: baseline; gap: 7px; font-size: .91rem; }
.direction-leg { margin-top: 10px; }
.direction-leg > h4 { color: #314a70; font-size: .83rem; font-weight: 600; }
.fee-type { margin: 8px 0 3px 3px; border-left: 2px solid #e3eafa; padding-left: 7px; }
.fee-type h4 { margin: 2px 0 4px 7px; font-size: .79rem; color: #596e8d; }
.fee-type .expense { border-radius: 7px; }
.fee-type .detail-box { margin: 4px 0 8px; }
.material-column { display: grid; gap: 15px; min-width: 0; }
.library-items { max-height: 210px; overflow: auto; padding-right: 2px; }
.has-preview .library-items { max-height: 96px; }
.upload-progress { width: 100%; height: 10px; accent-color: #3262e2; }
.material.active { background: #eef4ff; }
.inline-preview .badge { flex-shrink: 0; }
.inline-material { display: grid; place-items: center; min-height: 125px; background: #eaf0f9; border-radius: 8px; padding: 9px; }
.inline-material img { max-height: 500px; max-width: 100%; object-fit: contain; box-shadow: 0 3px 12px #223b6825; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { padding: 16px 16px 13px; border-bottom: 1px solid #ebeff5; }
.panel-head h2, .panel-head h3 { font-size: 1.04rem; }
.panel-body { padding: 15px 16px 17px; }
.panel-stack { display: grid; gap: 14px; }
.trip-block { border: 1px solid #e3eaf4; border-radius: 9px; overflow: hidden; }
.trip-head { padding: 11px 12px; background: #f6f8fc; }
.trip-head h3 { font-size: .95rem; overflow-wrap: anywhere; }
.trip-head p { font-size: .8rem; margin-top: 4px; color: var(--muted); }
.expense { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; padding: 12px; align-items: center; gap: 9px; border: 0; text-align: left; width: 100%; background: #fff; }
.expense + .expense { border-top: 1px solid #edf1f6; }
.expense:hover, .expense.active { background: #f0f5ff; }
.expense strong { display: block; font-size: .91rem; }
.expense .sub { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; font-weight: 450; }
.expense-end { display: grid; gap: 5px; justify-items: end; min-width: 0; }
.expense-end .amount { white-space: nowrap; font-size: .82rem; }
.badge { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: #eef2f7; color: #44556c; font-weight: 600; font-size: .74rem; line-height: 1.3; max-width: 100%; }
.badge.ok { background: #e7f6ef; color: var(--green); }
.badge.warning { background: #fff2de; color: var(--amber); }
.badge.blue { background: #eaf0ff; color: #2450b0; }
.drop { display: grid; gap: 7px; place-items: center; padding: 17px 7px; text-align: center; border: 1.5px dashed #9db7ec; background: #f6f9ff; border-radius: 10px; color: #2854aa; }
.drop:hover, .drop.dragover { background: #e9f1ff; border-color: #4b79db; }
.drop .symbol { font-size: 1.36rem; line-height: 1; }
.drop strong { font-size: .9rem; }
.drop span:last-child { color: #5c708e; font-size: .78rem; }
.materials { display: grid; gap: 1px; }
.material { width: 100%; border: 0; border-bottom: 1px solid #edf1f6; background: white; text-align: left; padding: 8px 2px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.material:hover { background: #f2f6ff; }
.material:last-child { border-bottom: 0; }
.material .icon-tile { min-width: 28px; height: 32px; font-size: .66rem; }
.material strong { display: block; font-size: .84rem; }
.material small { display: block; color: var(--muted); font-size: .74rem; margin-top: 3px; }
.empty { text-align: center; padding: 26px 16px; }
.empty h2, .empty h3 { margin: 7px 0; }
.empty p { color: var(--muted); line-height: 1.6; font-size: .9rem; }
.empty .actions { justify-content: center; margin-top: 15px; }
.main-empty { padding: 55px 20px; }
.empty-icon { display: inline-grid; place-items: center; background: #eaf1ff; color: #285bd2; width: 54px; height: 54px; border-radius: 15px; font-size: 1.6rem; }
.detail-box { border: 1px solid #e2e9f5; border-radius: 9px; padding: 12px; }
.detail-box h3 { font-size: .94rem; }
.check-line { font-size: .86rem; padding: 8px 0; color: #733f10; }
.check-line + .check-line { border-top: 1px solid #f2ebdf; }
.check-action { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.check-action .row { flex: none; }
.check-action.checked { color: var(--ink); }
.proof-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid #edf1f6; }
.proof-row > :first-child { flex: 1; min-width: 0; text-align: left; justify-content: flex-start; }
.attach-list { max-height: 50vh; overflow: auto; border: 1px solid #e1e7f0; border-radius: 8px; }
.attach-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 38%); gap: 8px; align-items: center; padding: 8px; }
.attach-row + .attach-row { border-top: 1px solid #edf1f6; }
.attach-row:has(input:checked) { background: #edf4ff; }
.attach-row .check span { overflow-wrap: anywhere; }
.attach-row .check small { display: block; font-size: .75rem; margin-top: 2px; }
.attach-row fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ghost-text { padding: 3px 0; font-size: .85rem; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; color: #344662; font-size: .85rem; min-width: 0; }
.field > span { font-weight: 650; }
.field input, .field select, .field textarea, .chat textarea, .control { width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid #cbd6e7; background: #fff; border-radius: 7px; color: var(--ink); font-size: .9rem; }
.field textarea, .chat textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.field.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.summary-card p { line-height: 1.65; white-space: pre-line; }
.summary-card .panel-head { background: #f9fbfe; border-radius: 13px 13px 0 0; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.summary-values { display: grid; gap: 10px; }
.summary-values div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 9px; font-size: .9rem; }
.summary-values strong { color: #53647f; }
.summary-values p { overflow-wrap: anywhere; }

.pdf-grid { display: grid; grid-template-columns: minmax(168px, .52fr) minmax(0, 1.65fr) minmax(170px, .58fr); gap: 14px; align-items: start; }
.page-list { max-height: 72vh; overflow: auto; display: grid; gap: 5px; padding: 9px; }
.page-list button { border: 1px solid transparent; background: white; padding: 8px; border-radius: 7px; text-align: left; display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 6px; font-size: .83rem; }
.page-list button:hover, .page-list button.active { border-color: #c7d8ff; background: #edf3ff; color: var(--accent-dark); }
.page-inset { background: #e5ebf4; padding: 14px; border-radius: 12px; display: grid; gap: 11px; align-content: start; min-height: 250px; min-width: 0; }
.page-spread { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
.page-spread.double { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-sheet { min-width: 0; }
.sheet-label { display: flex; width: 100%; justify-content: flex-start; align-items: center; gap: 8px; padding: 6px 7px; margin-bottom: 3px; border: 0; border-radius: 6px; color: #4e5f7a; background: transparent; font-size: .78rem; text-align: left; }
.sheet-label .mono { white-space: nowrap; }
.sheet-label.active { color: #184ab4; background: #f4f7ff; }
.paper { background: white; width: 100%; box-shadow: 0 8px 21px #2e44632d; position: relative; overflow: hidden; }
.paper-render { display: block; width: 100%; height: 100%; object-fit: contain; }
.placement { position: absolute; display: block; padding: 0; border: 0; background: transparent; outline: 1px dashed #779cde; cursor: grab; touch-action: none; }
.placement:active { cursor: grabbing; }
.placement.selected { outline: 2px solid #376de1; z-index: 1; }
.placement img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none; }
.pdf-side .field { margin-bottom: 10px; }
.pdf-side input[type="range"] { padding: 0; min-height: 24px; }
.pdf-side p { line-height: 1.55; overflow-wrap: anywhere; }
.drawer-shade { position: fixed; inset: 0; z-index: 4; background: #14244255; border: 0; width: 100%; }
.drawer { position: fixed; z-index: 5; top: 0; right: 0; height: 100dvh; width: min(100%, 420px); background: #fff; box-shadow: -10px 0 38px #142d533c; display: flex; flex-direction: column; }
.drawer .panel-head { padding: 20px; }
.chat-context { padding: 8px 17px; border-bottom: 1px solid var(--line); color: #344e77; font-size: .85rem; }
.chat-context .actions { flex: none; }
.chat { min-height: 0; padding: 17px; display: grid; gap: 12px; align-content: start; overflow: auto; }
.chat-bubble { background: #f1f5fc; border: 1px solid #e1e9f7; border-radius: 10px; padding: 12px; line-height: 1.6; font-size: .9rem; }
.chat-user, .chat-answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-user { justify-self: end; max-width: 95%; background: #eaf1ff; color: #153b82; }
.chat-answer { background: #f5f7fb; }
.chat-source { color: #536782; font-size: .75rem; margin-bottom: 5px; }
.chat .example { white-space: normal; text-align: left; justify-content: flex-start; }
.chat-note { color: #794620; background: #fff5e6; border-color: #f4dec1; }
.chat-form { margin-top: auto; padding: 15px 17px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 85px; }

dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100dvh - 30px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 26px 100px #0e214d55; padding: 0; }
dialog::backdrop { background: #12244278; }
dialog .panel-head { padding: 15px 17px; }
.dialog-body { padding: 16px 17px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 13px 17px; border-top: 1px solid var(--line); background: #f9fbfe; }
.material-preview { display: grid; min-height: 69px; padding: 10px; place-items: center; border-radius: 8px; background: #edf2fb; }
.material-preview img { max-width: 100%; max-height: 320px; width: auto; display: block; object-fit: contain; box-shadow: 0 3px 12px #223b6825; }
.ocr-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; background: #f1f5fa; border-radius: 7px; padding: 9px; font-size: .81rem; }
summary { cursor: pointer; color: #34568f; font-size: .88rem; }
.toasts { position: fixed; right: 17px; bottom: 17px; z-index: 20; display: grid; gap: 8px; width: min(420px, calc(100vw - 34px)); pointer-events: none; }
.toast { padding: 13px; color: #f6f9ff; background: #233653; box-shadow: 0 6px 25px #132c5255; border-radius: 9px; font-size: .9rem; line-height: 1.55; white-space: pre-line; }
.toast.error { background: #82353b; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .pdf-grid { grid-template-columns: minmax(140px, .65fr) minmax(0, 2fr); }
  .pdf-side { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { height: auto; align-items: center; padding: 10px 12px; gap: 8px; display: grid; grid-template-columns: 1fr auto; position: static; overflow: visible; }
  .sidebar .brand { margin: 0; }
  .sidebar .nav { display: flex; grid-column: 1 / -1; grid-row: 2; overflow: auto; }
  .sidebar .nav-label, .sidebar .draft-section > .nav-label, .sidebar .nav .symbol, .sidebar-footer .avatar { display: none; }
  .sidebar .nav button { width: auto; white-space: nowrap; flex: 1 0 auto; justify-content: center; min-height: 34px; padding-inline: 8px; }
  .sidebar-footer { grid-column: 2; grid-row: 1; border: 0; padding: 0; margin: 0; }
  .sidebar-footer .username { max-width: 90px; }
  .draft-section { grid-column: 1 / -1; overflow: auto; }
  .draft-list { display: flex; gap: 4px; min-width: max-content; }
  .draft-row { max-width: 190px; }
  .draft-link { min-height: 32px; }
  .work-grid { grid-template-columns: minmax(0, 1.45fr) minmax(245px, 1fr); }
}
@media (max-width: 650px) {
  .auth { grid-template-columns: 1fr; }
  .auth-main { min-height: 100dvh; }
  .auth-art { display: none; }
  .work-grid, .summary-grid { grid-template-columns: 1fr; }
  .material-column { grid-row: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 71px; padding: 10px; }
  .stage { padding-top: 18px; }
  .topbar { min-height: 47px; }
  .hero { align-items: flex-start; }
  .hero .actions { gap: 6px; }
  .pdf-grid { grid-template-columns: 1fr; }
  .page-list { display: flex; overflow: auto; width: 100%; }
  .page-list button { flex: 0 0 125px; }
  .pdf-side { grid-column: auto; }
  .paper { width: 100%; }
  .page-spread.double { grid-template-columns: minmax(0, 1fr); }
  .page-inset { padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
