*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --panel: #fff;
  --text: #132238;
  --muted: #667587;
  --line: #e1e8ee;
  --brand: #102536;
  --accent: #167c78;
  --accent-dark: #0e605d;
  --soft: #eaf5f3;
  --success: #087443;
  --success-soft: #ecfdf3;
  --warn: #926412;
  --warn-soft: #fff8e8;
  --danger: #a22e39;
  --danger-soft: #fff0f2;
  --shadow: 0  10px 35px rgba(24, 44, 65, .045);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { margin:0; min-width:0; background:#f3f6f8; color:var(--text); font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
a { color:var(--accent-dark); text-decoration:none; }
a:hover { color:var(--accent); }
button,input,select,textarea { font:inherit; }
:focus-visible { outline:3px solid #65bcb6; outline-offset:3px; }
h1,h2,h3 { color:var(--text); line-height:1.2; }
.topbar { position:sticky; top:0; z-index:30; background:#102536; color:#fff; box-shadow:0 2px 16px rgba(11,30,46,.08); }
.topbar-inner { max-width:1340px; margin:auto; padding:14px 24px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:30px; }
.brand { color:#fff; font-size:24px; font-weight:850; letter-spacing:-.8px; white-space:nowrap; }
.brand:hover { color:#fff; }
.brand span { color:#6dd0bd; }
.primary-nav,.topbar nav { display:flex; align-items:center; gap:4px; min-width:0; overflow-x:auto; scrollbar-width:none; }
.primary-nav::-webkit-scrollbar { display:none; }
.topbar .nav-link,.topbar nav a { color:#cbd7e0; padding:9px 12px; border-radius:10px; font-size:13px; font-weight:600; white-space:nowrap; }
.topbar .nav-link:hover,.topbar nav a:hover { color:#fff; background:rgba(255,255,255,.07); }
.topbar .nav-link.active { color:#fff; background:#284453; }
.account-nav { display:flex; align-items:center; gap:10px; min-width:0; }
.account-name { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#aabcc9; font-size:12px; }
.topbar .logout-link { padding-right:0; font-weight:500; }
.wrap { width:100%; max-width:1340px; margin:30px auto; padding:0 24px; min-width:0; }
.hero { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin:4px 0 24px; }
.hero h1 { margin:0; font-size:32px; font-weight:780; letter-spacing:-1px; }
.hero p { margin:8px 0 0; color:var(--muted); }
.panel,.card { min-width:0; background:var(--panel); border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); }
.panel { padding:24px; }
.panel h2,.panel h3 { margin:0 0 14px; }
.panel h2 { font-size:20px; letter-spacing:-.4px; }
.panel h3 { font-size:16px; }
.panel+.panel { margin-top:18px; }
.cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.card { padding:22px; }
.card .label { color:var(--muted); font-size:13px; }
.card .big { margin-top:8px; font-size:30px; font-weight:800; overflow-wrap:anywhere; }
.grid2 { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr); gap:18px; margin-top:18px; }
.grid2>.panel+.panel { margin-top:0; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; max-width:100%; padding:11px 16px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--text); cursor:pointer; font:inherit; font-size:14px; font-weight:650; text-align:center; transition:background .15s,border-color .15s; }
.btn:hover { background:#f6f9fa; border-color:#cbd8df; color:var(--text); }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn.primary:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
.btn.soft { background:var(--soft); color:var(--accent-dark); }
.btn.danger { background:var(--danger-soft); border-color:#f0ccd2; color:var(--danger); }
.btn.small { padding:7px 11px; font-size:12px; }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.table-wrap { width:100%; max-width:100%; overflow-x:auto; }
.table { width:100%; border-collapse:collapse; min-width:680px; }
.table.compact { min-width:0; }
.table th,.table td { padding:14px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.table th { color:var(--muted); font-size:12px; font-weight:650; }
.table td { font-size:14px; }
.table tbody tr:last-child td { border-bottom:0; }
.table .num { text-align:right; white-space:nowrap; }
.table.compact th { width:42%; }
.muted { color:var(--muted); }
.tag { display:inline-flex; max-width:100%; align-items:center; background:#eef2f6; border:1px solid #dde5eb; border-radius:7px; padding:3px 7px; font-size:11px; color:#4c6174; white-space:normal; overflow-wrap:anywhere; }
.tag.ai { background:#f1edfc; border-color:#e2d8f8; color:#634795; }
.tag.qr { background:#eaf7ff; border-color:#d6eaf6; color:#17628b; }
.tag.ocr { background:#fff4e8; border-color:#f7e4cd; color:#9a5b13; }
.notice { padding:13px 16px; border-radius:12px; border:1px solid; overflow-wrap:anywhere; }
.notice.success { background:var(--success-soft); color:var(--success); border-color:#c8e8d5; }
.notice.warn { background:var(--warn-soft); color:var(--warn); border-color:#eeddb2; }
.notice.danger { background:var(--danger-soft); color:var(--danger); border-color:#f0cdd3; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.field { min-width:0; max-width:100%; }
.field label { display:block; margin-bottom:7px; color:var(--muted); font-size:13px; font-weight:550; }
.field input,.field select,.field textarea { display:block; width:100%; max-width:100%; min-width:0; padding:12px 13px; border:1px solid #d8e1e8; border-radius:10px; background:#fff; color:var(--text); font:inherit; font-size:16px; line-height:1.35; }
.field input:focus,.field select:focus,.field textarea:focus { border-color:var(--accent); outline:2px solid #d8eeeb; outline-offset:0; }
.field textarea { min-height:100px; resize:vertical; }
.field input[type=date],.field input[type=time],.field input[type=datetime-local] { width:100%; min-width:0; max-width:100%; min-height:46px; appearance:none; }
.field input::-webkit-date-and-time-value { text-align:left; min-width:0; }
.field input::-webkit-datetime-edit { min-width:0; padding:0; }
.field input[type=file] { overflow:hidden; padding:9px; font-size:13px; }
.field input[type=file]::file-selector-button { border:0; border-radius:6px; background:#edf4f5; color:var(--text); padding:7px 9px; margin-right:8px; font:inherit; cursor:pointer; }
input[type=checkbox] { width:17px; height:17px; accent-color:var(--accent); vertical-align:middle; }
.form-grid>*,.item-grid>*,.item-grid2>*,.preview-grid>* { min-width:0; }
.source-grid,.ai-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.source { min-width:0; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.source strong { display:block; margin-bottom:4px; font-size:13px; }
.source .muted { font-size:12px; }
.progress { height:7px; background:#e7edf1; border-radius:999px; overflow:hidden; }
.progress span { display:block; height:100%; background:var(--accent); width:0; }
.capture-preview { display:block; width:100%; max-width:100%; max-height:520px; object-fit:contain; border-radius:12px; border:1px solid var(--line); background:#f5f8fa; }
.preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.preview-card { min-width:0; border:1px solid var(--line); padding:14px; border-radius:14px; background:#fff; }
.preview-card h3 { font-size:13px; margin:0 0 10px; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.divider { height:1px; background:var(--line); margin:18px 0; }
.hidden { display:none!important; }
.item-card { min-width:0; border:1px solid var(--line); border-radius:15px; padding:18px; margin:14px 0; background:#f9fbfc; }
.item-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.item-head>div { min-width:0; }
.item-head strong { font-size:14px; }
.item-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,.6fr) minmax(0,.8fr) minmax(0,.8fr); gap:12px; }
.item-grid2 { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:14px; }
.toggle-row { display:flex; gap:14px 24px; flex-wrap:wrap; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.toggle-row label { display:flex; align-items:center; gap:7px; font-size:13px; }
.suggestion { font-size:12px; color:var(--muted); margin-top:6px; }
.suggestion:empty { display:none; }

/* Dashboard */
.dashboard-hero { position:relative; display:flex; justify-content:space-between; align-items:flex-start; gap:30px; padding:32px 36px; margin-bottom:20px; border-radius:22px; background:linear-gradient(115deg,#132f42,#1d4b57); color:#fff; overflow:hidden; }
.dashboard-hero::after { content:""; position:absolute; right:170px; top:-110px; width:300px; height:300px; border:1px solid rgba(158,220,218,.13); border-radius:50%; pointer-events:none; }
.dashboard-hero-copy { position:relative; z-index:1; max-width:670px; }
.eyebrow { display:block; color:#9dd1ca; text-transform:uppercase; letter-spacing:1.8px; font-size:10px; font-weight:750; margin-bottom:10px; }
.dashboard-hero h1 { color:#fff; margin:0; font-size:36px; letter-spacing:-1.2px; }
.dashboard-hero p { color:#c8dbdf; margin:10px 0 0; font-size:14px; }
.dashboard-actions { margin-top:24px; }
.btn.primary.light { background:#fff; border-color:#fff; color:#143642; }
.btn.primary.light:hover { background:#e4f5f1; }
.btn.glass { background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.25); color:#fff; }
.dashboard-filters { display:flex; flex-wrap:wrap; gap:12px; position:relative; z-index:1; }
.year-select { position:relative; z-index:1; min-width:130px; }
.currency-select { min-width:90px; }
.year-select label { display:block; font-size:11px; color:#bed3d8; margin-bottom:7px; }
.year-select select { width:100%; border:1px solid rgba(255,255,255,.25); color:#fff; border-radius:10px; padding:10px 12px; background:#244957; font-weight:650; font-size:16px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.metric-card { min-width:0; background:#fff; border:1px solid var(--line); border-radius:17px; padding:21px 23px; box-shadow:var(--shadow); }
.metric-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:18px; }
.metric-icon,.quick-icon { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; width:35px; height:35px; background:#e7f4ee; color:#287c5d; border-radius:10px; font-size:14px; font-weight:800; }
.metric-icon.blue,.quick-icon.blue { background:#e9f1fc; color:#3a68a1; }
.metric-icon.violet,.quick-icon.violet { background:#f0ecfb; color:#7955a5; }
.metric-icon.amber { background:#fff3de; color:#a77824; }
.metric-period { color:#8793a1; font-size:10px; text-align:right; }
.metric-label { color:#607084; font-size:12px; font-weight:600; }
.metric-value { margin-top:4px; font-size:27px; font-weight:790; letter-spacing:-1px; line-height:1.3; overflow-wrap:anywhere; }
.metric-value small { font-size:.5em; letter-spacing:0; font-weight:600; color:#8a97a6; }
.metric-meta { margin-top:6px; font-size:12px; color:#788798; }
.dashboard-grid { display:grid; gap:20px; margin-bottom:20px; align-items:start; }
.dashboard-grid-main { grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); }
.dashboard-grid-secondary { grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); }
.dashboard-grid>.panel+.panel { margin-top:0; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:22px; }
.section-head h2 { margin:4px 0 0; font-size:19px; }
.section-kicker { text-transform:uppercase; letter-spacing:1.3px; font-size:10px; color:#7c8b9b; font-weight:750; }
.section-total { font-size:15px; font-weight:700; white-space:nowrap; }
.text-link { font-size:12px; font-weight:650; white-space:nowrap; }
.month-chart { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px; height:220px; padding-top:10px; }
.month-column { display:flex; min-width:0; flex-direction:column; align-items:center; gap:10px; }
.month-bar-track { width:100%; height:178px; display:flex; align-items:flex-end; border-bottom:1px solid #dbe5e9; }
.month-bar-track span { display:block; width:100%; min-height:0; border-radius:5px 5px 0 0; background:linear-gradient(0deg,#167c78,#8ac8bb); }
.month-column small { color:#8b98a6; font-size:10px; }
.category-list { display:grid; gap:17px; }
.category-meta { display:flex; justify-content:space-between; gap:12px; margin-bottom:7px; font-size:12px; }
.category-meta span { min-width:0; overflow-wrap:anywhere; color:#5a6b7f; }
.category-meta strong { white-space:nowrap; font-size:11px; }
.category-track { height:5px; background:#edf2f5; border-radius:99px; overflow:hidden; }
.category-track span { display:block; height:100%; background:#84b8ad; border-radius:99px; }
.category-row:nth-child(2) .category-track span { background:#93afcb; }
.category-row:nth-child(3) .category-track span { background:#b2a1cf; }
.category-row:nth-child(4) .category-track span { background:#d4bd8d; }
.category-row:nth-child(5) .category-track span { background:#a7bdc6; }
.category-row:nth-child(6) .category-track span { background:#bdcba5; }
.dashboard-table { min-width:620px; }
.dashboard-table th,.dashboard-table td { padding:15px 8px; }
.dashboard-table td { font-size:12px; }
.merchant-link { color:#273e51; font-weight:650; }
.category-pill { display:inline-block; max-width:170px; font-size:10px; padding:4px 7px; background:#f1f5f7; color:#7a8999; border-radius:6px; }
.dashboard-side { min-width:0; display:grid; gap:20px; }
.dashboard-side>.panel+.panel { margin-top:0; }
.quick-list { display:grid; gap:16px; }
.quick-link { display:flex; align-items:center; gap:13px; color:var(--text); }
.quick-link>span:nth-child(2) { min-width:0; flex:1; }
.quick-link strong { display:block; font-size:14px; }
.quick-link small { display:block; color:#7c8b9b; font-size:12px; margin-top:3px; }
.quick-link b { color:#a9b6c1; font-size:15px; font-weight:400; }
.quick-icon { width:38px; height:38px; font-size:10px; }
.quick-link:first-child .quick-icon { font-size:22px; font-weight:400; }
.empty-state { color:#8a97a6; padding:30px 10px; text-align:center; font-size:13px; line-height:1.8; }
.empty-state strong { color:#617487; font-weight:550; }
.empty-state.compact { padding:12px 0 4px; text-align:left; font-size:12px; }
.warranty-list { display:grid; gap:14px; }
.warranty-item { display:flex; align-items:flex-start; gap:14px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.warranty-item>span { flex:1; min-width:0; }
.warranty-item strong { display:block; color:#374f61; font-size:12px; font-weight:600; }
.warranty-item small { display:block; margin-top:3px; color:#8a97a6; font-size:10px; }
.warranty-item time { color:#aa813a; font-size:10px; white-space:nowrap; padding-top:2px; }
.warranty-item:last-child { padding-bottom:0; border-bottom:0; }
.admin-links { display:flex; flex-wrap:wrap; gap:9px 16px; }
.admin-links a { font-size:12px; }
.version-number { font-size:44px; font-weight:800; letter-spacing:-2px; margin:4px 0 14px; }
.version-meta { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:22px; }
.release-list { margin:0; padding-left:20px; color:var(--muted); line-height:1.9; }

@media(max-width:1150px) {
  .topbar-inner { gap:18px; }
  .account-name { display:none; }
  .metric-value { font-size:24px; }
  .metric-card { padding:18px; }
  .dashboard-grid-secondary { grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); }
}
@media(max-width:900px) {
  .cards,.metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid2,.dashboard-grid-main,.dashboard-grid-secondary { grid-template-columns:minmax(0,1fr); }
  .item-grid,.item-grid2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-side { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .topbar-inner { gap:12px; padding:12px 20px; }
  .topbar .nav-link,.topbar nav a { padding:9px; font-size:12px; }
  .brand { font-size:22px; }
}
@media(max-width:680px) {
  .topbar-inner { grid-template-columns:minmax(0,1fr) auto; gap:8px 16px; padding:13px 16px 8px; }
  .brand { grid-column:1; grid-row:1; }
  .account-nav { grid-column:2; grid-row:1; }
  .primary-nav,.topbar nav { grid-column:1 / -1; grid-row:2; padding-bottom:4px; gap:4px; }
  .topbar .nav-link,.topbar nav a { font-size:12px; padding:8px 12px; }
  .topbar .logout-link { padding-right:0; }
  .wrap { padding:0 14px; margin-top:20px; }
  .hero { flex-direction:column; align-items:flex-start; gap:16px; }
  .hero h1 { font-size:28px; }
  .panel { padding:18px; border-radius:16px; }
  .form-grid,.source-grid,.preview-grid,.ai-status { grid-template-columns:minmax(0,1fr); }
  .item-grid,.item-grid2 { grid-template-columns:minmax(0,1fr); }
  .item-card { padding:14px; }
  .item-head { align-items:flex-start; }
  .toggle-row { flex-direction:column; gap:12px; }
  .dashboard-hero { padding:25px 22px; flex-direction:column; gap:22px; }
  .dashboard-hero h1 { font-size:31px; }
  .dashboard-hero p { font-size:12px; }
  .dashboard-actions { margin-top:18px; }
  .dashboard-filters { width:100%; }
  .year-select { width:100%; display:flex; align-items:center; gap:14px; }
  .year-select label { margin:0; flex:1; }
  .year-select select { width:110px; }
  .metric-grid { gap:10px; }
  .metric-card { padding:16px; border-radius:14px; }
  .metric-top { margin-bottom:14px; }
  .metric-icon { width:29px; height:29px; border-radius:8px; font-size:12px; }
  .metric-period { font-size:9px; }
  .metric-value { font-size:22px; letter-spacing:-.8px; }
  .metric-label { font-size:11px; }
  .metric-meta { font-size:11px; }
  .section-head { gap:10px; }
  .section-total { font-size:12px; }
  .section-head h2 { font-size:18px; }
  .month-chart { gap:7px; height:195px; }
  .month-bar-track { height:158px; }
  .month-column small { font-size:9px; }
  .dashboard-side { grid-template-columns:minmax(0,1fr); }
  .category-meta { font-size:11px; }
  .category-meta strong { font-size:10px; }
}
@media(max-width:380px) {
  .metric-grid { grid-template-columns:minmax(0,1fr); }
  .metric-top { margin-bottom:9px; }
  .dashboard-actions .btn { width:100%; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; transition:none!important; }
}

/* V0.9.9: capture camera and accessible four-corner editor */
.capture-dialog { width: min(94vw, 920px); max-height: 94vh; max-height: 94dvh; padding: 22px; border: 1px solid var(--border, #d9e2ef); border-radius: 18px; color: #17243b; background: #fff; overflow: auto; }
.capture-dialog::backdrop { background: rgba(9, 19, 37, .78); }
.capture-dialog h2 { margin: 0; }
.capture-dialog p { margin: 12px 0; }
.camera-stage, .crop-stage { position: relative; width: 100%; margin: 0 auto; line-height: 0; }
.camera-stage { background: #111b29; border-radius: 10px; overflow: hidden; min-height: 80px; }
.camera-stage video, .crop-stage canvas { display: block; width: 100%; height: auto; }
.camera-stage canvas, .crop-stage svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.crop-surround { padding: 24px; background: #e8edf5; border-radius: 12px; margin: 16px 0; }
.crop-stage canvas { box-shadow: 0 4px 20px rgba(0, 0, 0, .18); }
#cropShade, [data-doc-shade] { fill: rgba(5, 18, 39, .52); }
#cropPolygon, [data-doc-polygon] { fill: rgba(65, 163, 255, .05); stroke: #39bcff; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.crop-corner { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; min-width: 44px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: #066bd6; color: white; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); font-size: 16px; font-weight: 700; cursor: grab; touch-action: none; z-index: 2; }
.crop-corner:active { cursor: grabbing; }
.crop-corner:focus-visible { outline: 4px solid #17243b; outline-offset: 3px; }
.capture-dialog button:disabled { cursor: wait; opacity: .55; }
#cropStatus, #cameraStatus { min-height: 1.6em; font-weight: 600; }
#statusBox { margin-top: 16px; }
#continueWithoutOcrBtn { margin-top: 14px; }
.edit-item > .field, .edit-item > .form-grid, .edit-item > .category-pair { margin-bottom: 14px; }
.edit-item .item-head h3 { margin-top: 0; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.preview-card h4 { margin: 0 0 10px; }
.document-preview { max-height: 230px; margin: 12px 0; }
.document-upload { min-width: 0; }
.document-upload strong { overflow-wrap: anywhere; }
.review-main-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.item-details { margin-top: 12px; }
.item-details summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.excluded-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.excluded-line span { flex: 1; min-width: 170px; }
@media (max-width: 560px) { .review-main-fields { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .capture-dialog { width: 96vw; padding: 14px; }
  .crop-surround { padding: 23px; }
  .capture-dialog .btn-row { gap: 8px; }
  .capture-dialog .btn-row .btn { flex: 1 1 140px; }
}
.scanner-dialog { background:#111820; color:#f4f7fa; }
.scanner-dialog .muted { color:#c7d1dc; }
.scanner-dialog .btn:not(.primary) { background:#25313f; color:#f4f7fa; border-color:#415164; }
.scanner-dialog #cameraModeBtn[aria-pressed=true] { color:#facc15; border-color:#b5a23b; }
.scanner-dialog .camera-stage { min-height:140px; border:1px solid #415164; }
.scanner-dialog #cameraStatus { min-height:2.8em; }
.scan-progress { height:4px; background:#344151; border-radius:4px; margin:14px 0; overflow:hidden; }
.scan-progress span { display:block; width:0; height:100%; background:#facc15; transition:width .15s linear; }
.scan-result-image { display:block; width:100%; max-height:54vh; object-fit:contain; background:#18232f; border-radius:10px; }
.scanner-actions { justify-content:center; }
.scanner-actions .btn { min-height:48px; min-width:140px; }
.scanner-fallback { justify-content:center; margin-top:16px; }
#cancelAnalysisBtn { margin-top:14px; }
.with-action-dock { padding-bottom:220px; }
.action-dock { position:fixed; z-index:40; bottom:0; left:50%; transform:translateX(-50%); width:calc(100% - 24px); max-width:1180px; box-sizing:border-box; padding:14px 18px calc(14px + env(safe-area-inset-bottom)); background:#fff; border:1px solid #d8e2e9; border-radius:16px 16px 0 0; box-shadow:0 -6px 24px rgba(23,36,59,.12); max-height:40dvh; overflow:auto; }
.action-dock > .btn-row { margin:0; }
.action-dock .primary { margin-left:auto; }
.action-dock #statusText { margin:8px 0; }
.action-dock #statusBox { margin-top:8px; }
.site-footer { padding:24px 16px; text-align:center; color:#5b6877; font-size:13px; }
.footer-heart { color:#bd2854; font-weight:700; }
.icon-btn { min-width:44px; min-height:44px; font-size:23px; padding:6px; justify-content:center; }
.nowrap { flex-wrap:nowrap; }
.edit-item, #delete-receipt { scroll-margin-top:100px; }
.release-history summary { cursor:pointer; font-weight:700; padding:10px 0; }
.tag.pending { background:#fff1cc; color:#764b00; }
.tag.rejected { background:#fde5e5; color:#952b2b; }
.tax-total { font-variant-numeric:tabular-nums; }
.scanner-actions { position:sticky; bottom:0; padding:12px 0; background:#111820; z-index:3; }
@media (max-width:600px) {
  .action-dock { width:100%; border-radius:12px 12px 0 0; padding-left:12px; padding-right:12px; }
  .action-dock #capturePageSummary { flex:1 0 100%; font-size:13px; }
  .action-dock .btn { flex:1 1 auto; }
  .action-dock .primary { margin-left:0; }
}
@media (max-width:600px) {
  .scanner-dialog { width:100vw; max-width:100vw; min-height:90vh; max-height:100dvh; margin:auto; border-radius:0; padding:16px; }
  .scanner-dialog .item-head { align-items:center; }
  .scanner-dialog .item-head h2 { font-size:20px; }
}
