/* Microfinish Order Entry — design system
   Brand: Microfinish blue #0094D9, ink #231F20, maroon #7C2E45 (from the logo). */
:root {
  --blue: #0094d9; --blue-600: #0080c6; --blue-700: #006aa8; --blue-50: #eef8fd; --blue-100: #d9effa;
  --ink: #1d2126; --ink-2: #414a55; --muted: #6a7482; --faint: #98a1ad;
  --line: #e3e8ee; --line-2: #eef1f5; --bg: #f5f7fa; --surface: #fff;
  --maroon: #7c2e45; --maroon-50: #f9eef2; --maroon-100: #f0d9e1;
  --amber: #9a6400; --amber-50: #fff6e0; --amber-100: #fbe6b3;
  --green: #17764d; --green-50: #e8f6ef; --green-100: #c9ead9;
  --violet: #5b4bb7; --violet-50: #f1effc;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, .05);
  --shadow: 0 1px 2px rgba(20, 30, 45, .04), 0 6px 20px rgba(20, 30, 45, .06);
  --shadow-lg: 0 12px 48px rgba(20, 30, 45, .18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 1.25; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 16px; } .stack.tight { gap: 8px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { padding: 20px 20px 14px; }
.side-brand img { width: 100%; max-width: 196px; display: block; }
.side-brand span { display: block; margin-top: 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.nav a .count { margin-left: auto; background: var(--maroon); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 600; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid var(--line-2); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); color: inherit; }
.me:hover { background: var(--bg); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-100); color: var(--blue-700); display: grid; place-items: center; font-weight: 650; font-size: 12.5px; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.me b { display: block; font-weight: 600; line-height: 1.2; } .me small { color: var(--muted); font-size: 12px; }
.icon-btn { border: 0; background: none; padding: 7px; border-radius: 8px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { background: var(--maroon-50); color: var(--maroon); }
.powered { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 6px; font-size: 11px; color: var(--faint); }
.powered img { height: 16px; opacity: .9; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 28px 36px 64px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--bg); text-decoration: none; border-color: #d3dae3; }
.btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(0, 106, 168, .3); }
.btn.primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn.maroon { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .kbd { margin-left: 4px; }
.kbd { font: 600 10.5px/1 var(--font); padding: 3px 5px; border-radius: 4px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3); }
.kbd.dark { background: var(--bg); border-color: var(--line); color: var(--muted); }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ---------- pills, chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--green-50); color: var(--green); }
.pill.done { background: var(--green); color: #fff; }
.pill.conflict { background: var(--maroon-50); color: var(--maroon); }
.pill.wording { background: var(--amber-50); color: var(--amber); }
.pill.question { background: var(--violet-50); color: var(--violet); }
.pill.user { background: var(--blue-50); color: var(--blue-700); }
.pill.busy { background: var(--blue-50); color: var(--blue-700); }
.pill.busy::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.muted { background: var(--line-2); color: var(--muted); }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.doc-chip.po { color: #0b5fa5; background: #e9f3fc; border-color: #c7e0f6; }
.doc-chip.offer { color: #0d6d62; background: #e5f6f3; border-color: #bfe7e0; }
.doc-chip.ds { color: #6a3fa0; background: #f3ecfb; border-color: #dccbf2; }
.doc-chip.spec { color: #8a5300; background: #fdf3e1; border-color: #f4dcae; }
.doc-chip.other { color: var(--ink-2); background: var(--line-2); border-color: var(--line); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .error, .form-error { font-size: 12.5px; color: var(--maroon); }
.form-error { background: var(--maroon-50); border: 1px solid var(--maroon-100); padding: 10px 14px; border-radius: var(--radius-sm); }
.form-error ul, .field .error ul { margin: 0; padding: 0; list-style: none; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d5dbe3; border-radius: 9px; background: #fff; font: inherit; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #bcc5d1; }
.input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 148, 217, .16); }
.input.is-invalid { border-color: var(--maroon); }
.input.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; }
.input.select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7482' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.input.sm { height: 32px; font-size: 13px; border-radius: 7px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search .input { padding-left: 38px; }
.check { width: 17px; height: 17px; accent-color: var(--blue-600); margin: 0; cursor: pointer; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.switch-row:hover { border-color: #cfd6df; }
.switch-row b { display: block; font-weight: 600; } .switch-row small { color: var(--muted); font-size: 12.5px; }
.switch-row .check { margin-top: 2px; }
.segmented { display: inline-flex; background: var(--line-2); padding: 3px; border-radius: 9px; gap: 2px; }
.segmented a, .segmented button { border: 0; background: none; padding: 6px 13px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented .on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented .n { font-size: 11px; background: var(--line-2); border-radius: 99px; padding: 0 6px; color: var(--muted); }
.segmented .on .n { background: var(--blue-50); color: var(--blue-700); }

/* ---------- tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius); } .table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover { background: #fafcfe; }
.table .title { font-weight: 600; color: var(--ink); }
.table .sub { color: var(--muted); font-size: 12.5px; }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }

/* ---------- toasts */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 80; max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: rise .25s ease-out; }
.toast.success .icon { color: #5fd6a0; } .toast.error .icon, .toast.warning .icon { color: #ffb4c4; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ---------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-art { background: linear-gradient(155deg, #0b2a3f 0%, #0a4f7a 48%, #0094d9 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -180px; bottom: -180px; width: 560px; height: 560px; border-radius: 50%; border: 90px solid rgba(255, 255, 255, .06); }
.login-art::before { content: ''; position: absolute; right: 60px; bottom: 60px; width: 220px; height: 220px; border-radius: 50%; border: 44px solid rgba(255, 255, 255, .07); }
.login-art .tag { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.login-art h1 { font-size: 38px; line-height: 1.15; margin-top: auto; max-width: 480px; letter-spacing: -.02em; }
.login-art p { margin-top: 16px; font-size: 16px; opacity: .85; max-width: 440px; }
.login-points { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; position: relative; z-index: 1; }
.login-points li { display: flex; gap: 12px; align-items: center; font-size: 14.5px; }
.login-points .icon { background: rgba(255, 255, 255, .16); border-radius: 50%; padding: 5px; width: 28px; height: 28px; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 56px 12%; }
.login-form img.logo { width: 260px; margin-bottom: 44px; }
.login-form h2 { font-size: 24px; } .login-form .sub { color: var(--muted); margin: 6px 0 28px; }
.login-foot { margin-top: 44px; display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.login-foot img { height: 20px; }

/* ---------- dashboard */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .t { font-weight: 600; margin-top: 2px; } .stat .d { font-size: 12.5px; color: var(--muted); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.stat.attention::before { background: var(--maroon); } .stat.busy::before { background: var(--blue); }
.stat.ready::before { background: #e0a100; } .stat.done::before { background: var(--green); }
.hero { background: linear-gradient(120deg, #0a3a5a, #0080c6); color: #fff; border-radius: 16px; padding: 26px 30px; display: flex; align-items: center; gap: 24px; margin-bottom: 20px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -90px; width: 300px; height: 300px; border-radius: 50%; border: 50px solid rgba(255, 255, 255, .07); }
.hero h1 { font-size: 24px; } .hero p { opacity: .85; margin-top: 4px; }
.hero .btn { position: relative; z-index: 1; border-color: #fff; background: #fff; color: var(--blue-700); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li:last-child { border: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-100); border: 2px solid var(--blue); margin-top: 6px; flex: none; }
.feed time { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- order workspace */
.order-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 20px 36px 0; }
.order-head .inner { max-width: 1248px; margin: 0 auto; }
.order-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.order-meta { display: flex; gap: 22px; color: var(--muted); font-size: 13px; margin-top: 6px; flex-wrap: wrap; }
.order-meta b { color: var(--ink-2); font-weight: 600; }
.steps { display: flex; gap: 4px; margin-top: 18px; }
.step { display: flex; align-items: center; gap: 10px; padding: 12px 18px 13px 4px; margin-right: 18px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; position: relative; }
.step:hover { text-decoration: none; color: var(--ink); }
.step .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--line-2); color: var(--muted); }
.step.done .num { background: var(--green-50); color: var(--green); }
.step.on { color: var(--ink); border-bottom-color: var(--blue); }
.step.on .num { background: var(--blue-600); color: #fff; }
.step .badge { background: var(--maroon); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; }

.progress-card { padding: 34px; text-align: center; }
.reader { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 20px; background: var(--blue-50); display: grid; place-items: center; color: var(--blue-600); position: relative; }
.reader::after { content: ''; position: absolute; inset: -6px; border-radius: 24px; border: 2px solid var(--blue); opacity: .0; animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { opacity: .5; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; max-width: 520px; margin: 18px auto 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), #35b6ee); transition: width .6s ease; }
.bar.thin { height: 5px; margin: 0; max-width: none; }
.bar.green i { background: var(--green); }

.doc-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 40px; height: 46px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff; background: #c2413b; flex: none; text-transform: uppercase; }
.doc-ico.sheet { background: #1f8a4c; } .doc-ico.text { background: #3b6fc2; } .doc-ico.image { background: #8a5cc2; }

/* ---------- upload */
.drop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.drop { border: 1.5px dashed #c5cdd8; border-radius: var(--radius); padding: 16px; background: #fbfcfd; cursor: pointer; transition: border-color .12s, background .12s; display: block; position: relative; min-height: 112px; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-50); }
.drop.has { border-style: solid; border-color: var(--green-100); background: #f6fcf9; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.drop-head .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.drop.has .drop-head .ico { background: var(--green-50); color: var(--green); }
.drop-hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.drop-files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; position: relative; }
.drop-files li { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.drop-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-files li small { color: var(--faint); white-space: nowrap; }

/* ---------- products step */
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit .input { height: 34px; font-weight: 600; border-color: transparent; background: transparent; padding: 0 8px; margin-left: -8px; }
.inline-edit .input:hover { border-color: var(--line); background: #fff; }
.inline-edit .input:focus { background: #fff; }
.saved-tick { color: var(--green); font-size: 12px; font-weight: 600; animation: fade 2.4s forwards; }
@keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.scope th.sec { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); text-align: center; white-space: normal; min-width: 130px; }
.scope td.c { text-align: center; }
.callout { display: flex; gap: 14px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); align-items: flex-start; }
.callout.ask { border-color: #d9d3f5; background: var(--violet-50); }
.callout.ask > .icon { color: var(--violet); margin-top: 2px; }
.callout.warn { border-color: var(--amber-100); background: var(--amber-50); } .callout.warn > .icon { color: var(--amber); margin-top: 2px; }
.callout.good { border-color: var(--green-100); background: var(--green-50); } .callout.good > .icon { color: var(--green); margin-top: 2px; }
.callout.bad { border-color: var(--maroon-100); background: var(--maroon-50); } .callout.bad > .icon { color: var(--maroon); margin-top: 2px; }
.callout b { display: block; }
.sticky-bar { position: sticky; bottom: 0; margin: 24px -36px -64px; padding: 14px 36px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; z-index: 5; }

/* ---------- review */
.review { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.queue { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.queue-list { overflow: auto; padding: 6px; }
.queue-group { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.queue-item:hover { background: var(--bg); text-decoration: none; }
.queue-item.on { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.queue-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.conflict { background: var(--maroon); } .dot.wording { background: #e0a100; } .dot.question { background: var(--violet); }
.queue-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-card { padding: 26px 28px; }
.review-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.review-card h1 { font-size: 24px; }
.review-card .for { color: var(--muted); margin-top: 4px; }
.smith-note { display: flex; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); margin: 18px 0 6px; font-size: 13.5px; }
.smith-note img { width: 22px; height: 22px; flex: none; }
.smith-note b { font-weight: 600; }
.options { display: grid; gap: 12px; margin-top: 18px; }
.option { display: block; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .12s, box-shadow .12s; position: relative; }
.option:hover { border-color: #b9c4d1; }
.option > input[type=checkbox] { position: absolute; opacity: 0; }
.option:has(> input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 148, 217, .14); }
.option-top { display: flex; gap: 14px; padding: 16px 18px 12px; align-items: flex-start; }
.option .radio { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c2cad5; flex: none; margin-top: 2px; display: grid; place-items: center; }
.option:has(> input:checked) .radio { border-color: var(--blue-600); background: var(--blue-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat; }
.option .value { font-size: 16px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.option .key { font: 600 11px/1 var(--font); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; margin-left: auto; flex: none; }
.sources { border-top: 1px solid var(--line-2); padding: 4px 18px 8px 52px; }
.source { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.source:last-child { border: 0; }
.source q { color: var(--ink-2); quotes: '“' '”'; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source .where { font-weight: 600; white-space: nowrap; font-size: 12.5px; }
.option.custom .option-top { align-items: center; padding-bottom: 16px; }
.review-actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.similar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--blue-50); border-radius: 10px; color: var(--blue-700); font-weight: 500; margin-top: 16px; cursor: pointer; }

/* ---------- production document */
.pd-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.pd-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 6px; }
.pd-nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink-2); }
.pd-nav a:hover { background: var(--bg); text-decoration: none; }
.pd-nav a.on { background: var(--blue-50); }
.pd-nav a b { display: block; font-weight: 600; color: var(--ink); font-size: 13px; }
.pd-nav a.on b { color: var(--blue-700); }
.pd-nav a small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-table td { vertical-align: top; padding: 11px 16px; }
.pd-table .no { color: var(--faint); font-variant-numeric: tabular-nums; width: 36px; }
.pd-table .fname { width: 230px; min-width: 180px; font-weight: 500; color: var(--ink-2); }
.pd-table .val { font-weight: 600; overflow-wrap: break-word; width: 46%; min-width: 260px; }
.pd-table .val.none { color: var(--faint); font-weight: 400; font-style: italic; }
.pd-table .val.open { color: var(--maroon); }
.pd-group td { background: #fafbfc; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 9px 16px; }
.src-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; cursor: pointer; color: var(--blue-700); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.src-link:hover { background: var(--blue-50); }
.matrix-wrap { overflow: auto; max-height: calc(100vh - 250px); border-radius: var(--radius); }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); min-width: 190px; max-width: 260px; vertical-align: top; text-align: left; background: #fff; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: #fafbfc; font-weight: 600; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; min-width: 210px; background: #fafbfc; font-weight: 600; color: var(--ink-2); }
.matrix thead th:first-child { z-index: 3; }
.matrix td.open { color: var(--maroon); font-weight: 600; } .matrix td.none { color: var(--faint); font-style: italic; }

/* ---------- drawer (evidence) */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 34, .42); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 94vw); background: #fff; box-shadow: var(--shadow-lg); transform: translateX(102%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); z-index: 61; display: flex; flex-direction: column; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { flex: 1; overflow: auto; background: #eef1f5; }
.ev-quote { background: #fff; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ev-quote blockquote { margin: 6px 0 0; padding: 10px 14px; border-left: 3px solid var(--blue); background: var(--blue-50); border-radius: 0 8px 8px 0; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.ev-page { padding: 18px; }
.ev-page img { width: 100%; display: block; background: #fff; box-shadow: 0 2px 14px rgba(20, 30, 45, .16); border-radius: 3px; min-height: 300px; }
.ev-cells { background: #fff; margin: 18px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.ev-cells table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ev-cells td { padding: 8px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.ev-cells td:first-child { color: var(--faint); width: 64px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ev-cells td:nth-child(2) { color: var(--muted); width: 38%; }
.ev-cells tr.hit td { background: #fff4c2; color: var(--ink); font-weight: 600; }
.ev-cells tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--blue); }

/* ---------- ask */
.ask-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100vh; }
.ask-side .field { min-width: 0; }
.ask-side { min-width: 0; border-right: 1px solid var(--line); background: #fff; padding: 22px 18px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.ask-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.ask-top { padding: 16px 28px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 14px; }
.thread { flex: 1; overflow: auto; padding: 28px; }
.thread-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--blue-600); color: #fff; border-radius: 16px 16px 4px 16px; padding: 10px 16px; max-width: 78%; white-space: pre-wrap; }
.msg .who { width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.msg .who img { width: 22px; }
.msg.smith .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 14px 18px; min-width: 0; flex: 1; box-shadow: var(--shadow-sm); }
.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.claims li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.cite { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--blue-50); color: var(--blue-700); font-size: 11px; font-weight: 700; border: 1px solid var(--blue-100); cursor: pointer; vertical-align: 2px; margin-left: 4px; }
.cite:hover { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.proofs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.proof { display: flex; gap: 10px; align-items: center; font-size: 12.5px; width: 100%; text-align: left; border: 1px solid var(--line-2); background: #fafbfc; border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.proof:hover { border-color: var(--blue); background: var(--blue-50); }
.proof .n { width: 20px; height: 20px; border-radius: 6px; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.proof q { color: var(--muted); quotes: '“' '”'; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.grounded { display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--green); margin-bottom: 10px; }
.typing { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.composer { padding: 16px 28px 22px; background: linear-gradient(transparent, var(--bg) 30%); }
.composer form { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; background: #fff; border: 1px solid #d5dbe3; border-radius: 16px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow); align-items: flex-end; }
.composer form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 148, 217, .14), var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; font-size: 15px; padding: 9px 0; max-height: 160px; background: none; }
.composer .note { max-width: 820px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--faint); }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.suggest button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.suggest button:hover { border-color: var(--blue); color: var(--blue-700); }
.pick-list { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.pick { display: block; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink); }
.pick:hover { border-color: var(--blue); text-decoration: none; }
.pick.on { border-color: var(--blue); background: var(--blue-50); }
.pick b { display: block; font-size: 13px; font-weight: 600; } .pick small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* voice */
.mic { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; flex: none; position: relative; transition: background .12s, color .12s, border-color .12s; }
.mic:hover { border-color: var(--blue); color: var(--blue-700); }
.mic .mic-live { display: none; }
.mic.recording { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.mic.recording .mic-idle { display: none; } .mic.recording .mic-live { display: inline; }
.mic.recording::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--maroon); animation: ring 1.4s ease-out infinite; }
.mic.busy { opacity: .55; pointer-events: none; }
.voice-lang { border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--muted); height: 38px; cursor: pointer; outline: 0; max-width: 84px; }
.voice-status { color: var(--maroon) !important; font-weight: 600; font-size: 12.5px !important; }
.voice-status.calm { color: var(--blue-700) !important; }
.msg-tools { margin-top: 12px; display: flex; gap: 8px; }
.speak { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.speak:hover { border-color: var(--blue); color: var(--blue-700); }
.speak.loading { opacity: .6; pointer-events: none; }
.speak.playing { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ---------- document viewer */
.viewer { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.viewer-page { background: #e9edf2; border-radius: var(--radius); padding: 20px; }
.viewer-page img { width: 100%; max-width: 980px; display: block; margin: 0 auto; background: #fff; box-shadow: 0 2px 14px rgba(20, 30, 45, .16); }
.toc a { display: block; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.toc a:hover { background: var(--bg); text-decoration: none; } .toc a.on { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.passage { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; white-space: pre-wrap; font-size: 13px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { padding: 12px 16px; } .side-brand img { max-width: 150px; } .side-brand span, .nav-label, .powered { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 6px; } .side-foot { margin: 0 0 0 auto; border: 0; padding: 6px 12px; }
  .page, .order-head { padding-left: 18px; padding-right: 18px; }
  .g4 { grid-template-columns: 1fr 1fr; } .split, .review, .pd-layout, .viewer, .g2, .drop-grid { grid-template-columns: 1fr; }
  .queue, .pd-nav { position: static; max-height: 320px; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .ask-layout { grid-template-columns: 1fr; height: auto; } .ask-main { height: 80vh; }
  .sticky-bar { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
}
@media print {
  .side, .order-head .steps, .no-print, .toasts, .pd-nav, .sticky-bar { display: none !important; }
  .shell, .pd-layout { display: block; } body { background: #fff; } .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; } .order-head { padding: 0 0 12px; border: 0; }
}
