/* Layout: one narrow working column (max 920px), sticky app bar, sticky action bar in the editor. Ship's-paperwork feel: cool paper, hull blue, lifeboat orange for the one primary action. */
:root {
  --bg: #edf1f0; --surface: #ffffff; --surface-2: #f5f8f7; --ink: #14222b; --muted: #5a6a72;
  --art-navy: #14315a; --art-navy-2: #0c2244; --art-sea: #2a8be8; --art-off: #ec6a22; --art-on: #2a8be8; --art-plus: #d99a00;
  --line: #d2dbda; --line-2: #e4eaea; --hull: #183c55; --hull-soft: #e3ecf2; --signal: #d24a1c; --signal-ink: #ffffff;
  --ok: #27704a; --ok-soft: #e2f1e8; --st-draft: #8a6d00; --st-draft-soft: #fdf3c4; --st-fill: #6b45b5; --st-fill-soft: #ece4fa; --st-exp: #b5470f; --st-exp-soft: #fde4d3; --st-sent: #1f5f9e; --st-sent-soft: #dfecfa; --st-done: #27704a; --st-done-soft: #dff1e5; --warn: #9a6512; --warn-soft: #fbf0d9; --bad: #b3352a; --bad-soft: #f9e3e0; --info-soft: #e3ecf2;
  --f-display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px; --r-sm: 7px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1418; --surface: #142028; --surface-2: #192832; --ink: #e2eaee; --muted: #93a3ab;
  --art-navy: #d6e4f2; --art-navy-2: #aac3dc; --art-sea: #5aaaf2; --art-off: #ff8a4a; --art-on: #5aaaf2; --art-plus: #e0a810;
  --line: #2b3b45; --line-2: #22313a; --hull: #8bbbd9; --hull-soft: #1d3342; --signal: #f0703f; --signal-ink: #1a0d07;
  --ok: #6cc597; --ok-soft: #173327; --st-draft: #f1d265; --st-draft-soft: #3a3110; --st-fill: #b79cf0; --st-fill-soft: #2c2142; --st-exp: #ff9a5c; --st-exp-soft: #3d2212; --st-sent: #8cc0f2; --st-sent-soft: #17304a; --st-done: #6cc597; --st-done-soft: #173327; --warn: #e8b35c; --warn-soft: #36290f; --bad: #f07e72; --bad-soft: #3a1c19; --info-soft: #1d3342;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --art-navy: #d6e4f2; --art-navy-2: #aac3dc; --art-sea: #5aaaf2; --art-off: #ff8a4a; --art-on: #5aaaf2; --art-plus: #e0a810;
  --bg: #0d1418; --surface: #142028; --surface-2: #192832; --ink: #e2eaee; --muted: #93a3ab;
  --line: #2b3b45; --line-2: #22313a; --hull: #8bbbd9; --hull-soft: #1d3342; --signal: #f0703f; --signal-ink: #1a0d07;
  --ok: #6cc597; --ok-soft: #173327; --st-draft: #f1d265; --st-draft-soft: #3a3110; --st-fill: #b79cf0; --st-fill-soft: #2c2142; --st-exp: #ff9a5c; --st-exp-soft: #3d2212; --st-sent: #8cc0f2; --st-sent-soft: #17304a; --st-done: #6cc597; --st-done-soft: #173327; --warn: #e8b35c; --warn-soft: #36290f; --bad: #f07e72; --bad-soft: #3a1c19; --info-soft: #1d3342;
  color-scheme: dark; }

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--ink); font: 400 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .pad { padding: 8px 2px; } .center { text-align: center; } .grow { flex: 1; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; text-wrap: balance; margin: 0; letter-spacing: 0.005em; }
:focus-visible { outline: 2px solid var(--hull); outline-offset: 2px; }
.ic { flex: none; }

/* app bar */
.testbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 16px; background: var(--art-off); color: #fff; font-size: 13px; }
.testbar button { border: 1px solid rgba(255,255,255,.8); background: transparent; color: #fff; border-radius: 6px; padding: 5px 10px; font-weight: 600; cursor: pointer; min-height: 32px; }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in, .main { max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bar-in { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { flex: none; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.brand-mark { width: 48px; height: 48px; border-radius: 11px; flex: none; display: block; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font: 700 19px/1.1 var(--f-display); letter-spacing: 0.01em; }
.brand-txt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { margin-left: auto; display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.nav button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--muted); }
.nav button { white-space: nowrap; }
@media (max-width: 420px) { .nav button { padding: 6px 8px; font-size: 14px; } .brand-txt b { font-size: 17px; } }
.nav button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.main { padding-block: 18px calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.boot { min-height: 60vh; display: grid; place-content: center; gap: 12px; justify-items: center; color: var(--muted); }
.boot-mark { width: 64px; height: 64px; border-radius: 14px; display: block; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* generic */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sec { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hull); }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-family: var(--f-display); font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
p { margin: 0; }
a { color: var(--hull); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; min-height: 40px; }
.btn:hover:not(:disabled) { border-color: var(--hull); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); border-color: var(--signal); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 14px; }
.btn.big { padding: 12px 18px; min-height: 50px; font-size: 16px; flex: 1; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.toggled { background: var(--hull-soft); border-color: var(--hull); color: var(--hull); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--hull); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--hull); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; text-align: left; }
.confirm { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.lbl { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); padding: 9px 10px; font-size: 16px; min-height: 42px; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hull); background: var(--surface); box-shadow: 0 0 0 3px var(--hull-soft); }
input:disabled { opacity: .6; }
/* iPhone: date/time inputs otherwise keep a fixed width and stick out of the grid */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--hull); margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.grid.trip { grid-template-columns: 2fr 1.2fr 0.9fr; }
@media (max-width: 560px) { .grid.trip { grid-template-columns: 1fr 1fr; } .grid.trip > .field:nth-child(3n+1) { grid-column: 1 / -1; } }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; max-width: 100%; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.seg.small button { padding: 5px 12px; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.info { background: var(--info-soft); border-color: transparent; color: var(--hull); }
.tag { font: 700 12px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 7px 3px; border: 1.5px solid currentColor; border-radius: 4px; color: var(--hull); }
.tag-course { color: var(--ok); } .tag-extra { color: var(--warn); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--hull); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; flex: none; }
.spin.sm { width: 11px; height: 11px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
p.working { display: flex; justify-content: center; }

/* home */
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--hull-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.new { display: flex; flex-direction: column; gap: 8px; }
.new-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.new-btn { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: border-color .15s, box-shadow .15s, transform .15s; min-height: 64px; }
.new-btn:hover { border-color: var(--hull); box-shadow: 0 3px 10px rgba(0,0,0,.08); transform: translateY(-1px); }
.new-btn:active { transform: translateY(0); }
.new-ic { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--hull-soft); color: var(--hull); }
.new-btn.k-off .new-ic { background: var(--st-exp-soft); color: var(--st-exp); }
.new-btn.k-on .new-ic { background: var(--st-sent-soft); color: var(--st-sent); }
.new-btn.k-course .new-ic { background: var(--st-done-soft); color: var(--st-done); }
.new-btn.k-trip .new-ic { background: var(--st-draft-soft); color: var(--st-draft); }
.new-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.new-txt b { font: 700 19px/1.1 var(--f-display); letter-spacing: .01em; }
.new-txt small { color: var(--muted); font-size: 13px; }
.new-plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--signal); color: var(--signal-ink); flex: none; }
@media (max-width: 460px) { .new-row { grid-template-columns: 1fr 1fr; } .new-btn { flex-direction: column; align-items: flex-start; gap: 8px; position: relative; padding: 12px; } .new-plus { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; } .new-txt small { font-size: 12px; } }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.list-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.tot-row { flex: 1 1 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; max-width: 440px; }
.tot-tile { grid-column: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid; min-width: 0; font-size: 14px; }
.tot-tile.st-draft { border-left-color: var(--st-draft); } .tot-tile.st-sent { border-left-color: var(--st-sent); } .tot-tile.st-completed { border-left-color: var(--st-done); }
.tot-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .tot-tile.st-draft b { color: var(--st-draft); } .tot-tile.st-sent b { color: var(--st-sent); } .tot-tile.st-completed b { color: var(--st-done); }
.tot-tile .amount { white-space: nowrap; } .tot-tile .amount.conv { flex-direction: row; gap: 6px; }
.tot-info { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tot-row.one .tot-info { grid-row: 1; }
.swipe-st.st-info { color: inherit; background: var(--surface); }
.st-info { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin: 4px 12px 10px; }
.st-info dt { margin: 0; } .st-info dt .swipe-st { display: flex; min-height: 32px; min-width: 96px; cursor: default; } .st-info dd { margin: 0; font-size: 14.5px; }
.batch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--hull); border-radius: var(--r); }
.batch > span:first-child { font-weight: 600; margin-right: auto; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card.picked { border-color: var(--hull); box-shadow: 0 0 0 2px var(--hull-soft); }
.card .pick { margin: 0 0 0 14px; align-self: center; }
.card-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.card-main:hover .card-title { color: var(--hull); }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font: 700 20px/1.15 var(--f-display); overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.card-total { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; padding: 14px 16px; border-left: 1px solid var(--line-2); background: var(--surface-2); min-width: 120px; }
.card-total small { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.card-total .mono { font-size: 17px; }
@media (max-width: 520px) { .card-slide { flex-wrap: wrap; } .card-main { flex-basis: calc(100% - 40px); } .card-total { flex-basis: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; border-left: 0; border-top: 1px solid var(--line-2); padding: 8px 14px; } }
.empty-state { align-items: flex-start; }
.empty-state h3 { font-size: 22px; }
.empty-state p { max-width: 62ch; }
.howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 62ch; line-height: 1.45; }
.howto b { color: var(--ink); }

/* editor */
.ed-head { display: flex; flex-direction: column; gap: 6px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 0; font-size: 14px; color: var(--hull); cursor: pointer; font-weight: 600; }
.ed-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--hull); border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ed-title > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 200px; }
.ed-title h1 { font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.ed-total { display: flex; flex-direction: column; align-items: flex-end; gap: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 10px; }
.ed-total small { font: 600 10px/1.2 var(--f-body); letter-spacing: .1em; color: var(--muted); }
.ed-total .mono, .ed-total .amount.big > span .mono, .ed-total .amount.big:not(.conv) .mono { font-size: 17px; color: var(--hull); }
.tabs { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; flex: 1 0 auto; border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button.on { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.08), inset 0 -3px 0 var(--signal); }
.vessel-logo svg { width: 100%; height: 100%; display: block; }
.vessel-logo .vi-tile { fill: #ffffff; } .vessel-logo .vi-cut { fill: #ffffff; } .vessel-logo .vi-ink { stroke: #1c3550; }
.vessel-logo { filter: drop-shadow(0 1px 2px rgba(0,0,0,.08)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vessel-logo .vi-tile, :root:not([data-theme="light"]) .vessel-logo .vi-cut { fill: #0b1216; } :root:not([data-theme="light"]) .vessel-logo .vi-ink { stroke: #cfdbe6; } }
:root[data-theme="dark"] .vessel-logo .vi-tile, :root[data-theme="dark"] .vessel-logo .vi-cut { fill: #0b1216; } :root[data-theme="dark"] .vessel-logo .vi-ink { stroke: #cfdbe6; }
.bar-user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 46%; order: 4; margin-left: 8px; color: var(--ink); }
.bar-user { position: relative; }
.bu-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; border: 1px solid transparent; background: none; padding: 3px 8px 3px 3px; border-radius: 99px; cursor: pointer; text-align: left; color: inherit; }
.bu-btn:hover, .bu-btn[aria-expanded="true"] { border-color: var(--line); background: var(--surface-2); }
.bu-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 2px; }
.bu-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.bu-menu button:hover { background: var(--surface-2); }
.bar-user .bu-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hull-soft); color: var(--hull); font: 700 13px/1 var(--f-display); letter-spacing: .03em; }
.bar-user .bu-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.bar-user .bu-txt b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-user .bu-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.gate-grid > .wide { grid-column: 1 / -1; }
.adm-legal { display: flex; flex-direction: column; gap: 10px; }
.adm-legal textarea { font-size: 14px; min-height: 220px; }
.doc-part { font-size: 22px !important; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--hull); }
.doc-page h1 + .hint + .doc-part, .doc-page h1 + .doc-part { border-top: 0; padding-top: 0; margin-top: 0; }
.tabs button.na { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .6; }
.km-na { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.km-na input:disabled + span { opacity: .5; }
.tabs .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 6px; vertical-align: middle; }
.ed-body { display: flex; flex-direction: column; gap: 14px; }
.actionbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.actionbar-in { display: flex; align-items: center; gap: 8px; padding: 12px; flex-wrap: wrap; }
.actionbar-in > :first-child { margin-right: auto; }
@media (max-width: 420px) { .actionbar-in > :first-child { display: none; } .actionbar-in .btn { flex: 1; } }

.route { display: flex; flex-direction: column; gap: 8px; }
.stops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stop { display: flex; align-items: center; gap: 4px; }
.stop input { width: 150px; min-height: 38px; padding: 7px 9px; }
.route-line { font-size: 14px; color: var(--muted); }

.drop { border-style: dashed; border-color: var(--line); }
.drop.dragging { border-color: var(--signal); background: var(--hull-soft); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.add-row.left { justify-content: flex-start; }
.receipts { display: flex; flex-direction: column; gap: 12px; }
.receipt { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.receipt.unchecked { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.r-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.r-no { font: 700 26px/1 var(--f-display); }
.thumb { position: relative; width: 150px; height: 200px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; padding: 0; display: grid; place-items: center; cursor: zoom-in; color: var(--muted); font-size: 12px; text-align: center; gap: 4px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; }
.thumb-zoom { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; background: rgba(20,34,43,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.thumb.pdf, .thumb.empty { align-content: center; padding: 8px; overflow-wrap: anywhere; }
.thumb.pdf small { color: var(--hull); font-weight: 600; }
.thumb.empty { cursor: default; }
.thumb.empty.tap { cursor: pointer; border-style: dashed; border-width: 2px; color: var(--hull); }
.thumb.empty.tap:hover, .thumb.empty.tap:active { background: var(--hull-soft); border-color: var(--hull); }
.thumb.empty.tap small { color: var(--muted); font-size: 12px; }
.thumb-add { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--hull); color: var(--surface); }
.r-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.r-flags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.r-flags:empty { display: none; }
.r-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 2px; }
.r-nok { font-size: 17px; }
.r-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line-2); padding-top: 10px; }
@media (max-width: 640px) { .r-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .receipt { grid-template-columns: 1fr; } .r-side { width: 100%; } .thumb { width: 100%; height: auto; min-height: 120px; max-height: 420px; aspect-ratio: 3 / 4; } }
.sumline { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; flex-direction: row; flex-wrap: wrap; }
.sumline .mono { font-size: 18px; }

.km-rows { display: flex; flex-direction: column; gap: 10px; }
.km-row { display: grid; grid-template-columns: 1.1fr 1.3fr 1.3fr 0.8fr auto 0.9fr auto; gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.km-ret { padding-bottom: 10px; }
.km-sum { display: flex; flex-direction: column; align-items: flex-end; padding-bottom: 9px; }
.km-sum small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 720px) { .km-row { grid-template-columns: 1fr 1fr; } .km-row > .field:nth-child(1) { grid-column: 1 / -1; } .km-sum { align-items: flex-start; } }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.tbl .num { text-align: right; white-space: nowrap; font-family: var(--f-mono); font-size: 13.5px; }
.tbl th.num { font-family: var(--f-body); }
.tbl tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line); }
.tbl tr.grand td { font-size: 16px; color: var(--hull); border-top: 2px solid var(--ink); }
.tbl td.bad { color: var(--bad); }
.tbl.small { font-size: 13px; }
.issues { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.issues li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 8px 10px; background: var(--warn-soft); border-radius: var(--r-sm); color: var(--ink); }
.ok-line, .bad-line { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.ok-line { color: var(--ok); } .bad-line { color: var(--bad); }

/* settings */
.settings { display: flex; flex-direction: column; gap: 16px; }
.home-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0 6px; }
.nav button.has-dot { position: relative; }
.red-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: #d93025; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.bu-av { position: relative; }
.av-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #d93025; border: 2px solid var(--surface); }
.vsel { display: flex; flex-direction: column; gap: 8px; }
.vsel-q { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.vsel-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 5px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: inherit; font: inherit; font-size: 13.5px; line-height: 1.2; cursor: pointer; text-align: center; min-width: 0; }
.vsel-opt b { font-weight: 600; overflow-wrap: anywhere; }
.vsel-opt small { color: var(--muted); font-size: 11.5px; }
.vsel-opt.on { border: 2px solid var(--hull); padding: 5px 3px; background: var(--info-soft); }
.set-group { margin: 14px 2px -6px; font: 700 13px/1.2 var(--f-display, inherit); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.settings > .set-group:first-child, .settings > .pend-note + .set-group { margin-top: 0; }
.pend-note { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; border: 1px solid var(--line); font: inherit; color: inherit; }
.pend-note > span:nth-child(2) { flex: 1; font-weight: 600; }
.fx-manual { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line-2, var(--line)); }
.rate-rows { display: flex; flex-direction: column; gap: 8px; }
.rate-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.rate-row.four { grid-template-columns: 1.6fr 1fr 1.4fr auto; }
@media (max-width: 560px) { .rate-row.four { grid-template-columns: 1fr 1fr; } .rate-row.four > .icon-btn { justify-self: start; } }
.cur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px 12px; }
.cur input { min-width: 0; }
@media (max-width: 560px) { .fx-tbl td.muted, .fx-tbl th.nm { display: none; } }
.cur { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 6px; }
.vgroup { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.vgroup > summary { cursor: pointer; padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; font-weight: 600; list-style: none; }
.vgroup > summary::-webkit-details-marker { display: none; }
.vgroup > summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.vgroup[open] > summary::before { transform: rotate(90deg); }
.vgroup > summary > span:first-child { flex: 1; }
.vgroup > .chiplist, .vgroup > .chiplist-wrap { padding: 0 12px 12px; }
.btn.r-add-btn.update { background: #f5c518; border-color: #dcae0c; color: #2a2200; }
.btn.r-add-btn.update:hover { background: #ffd23a; }
.btn.r-add-btn.update:disabled { opacity: .55; }
.btn.r-add-btn.draft { background: #f5c518; border-color: #dcae0c; color: #2a2200; min-height: 44px; font-size: 15px; }
.btn.r-add-btn.draft:hover { background: #ffd23a; }
.add-exp { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 12px 0 6px; }
.btn.r-add-btn.save { background: #2e8b57; border-color: #26774a; color: #fff; }
.btn.r-add-btn.save:hover { background: #33985f; }
.btn.r-add-btn.save:disabled { background: #2e8b57; opacity: .45; }
.btn.add-blue { background: #1f6fd1; border-color: #1a60b8; color: #fff; }
.btn.add-blue:hover { background: #2a7be0; }
.btn.add-blue:disabled { opacity: .5; }
.add-exp .btn.add-blue { min-height: 48px; padding-left: 22px; padding-right: 22px; }
.drop.dragging { outline: 2px dashed var(--hull); outline-offset: 4px; border-radius: 12px; }
@media (max-width: 520px) { .tabs { gap: 2px; padding: 3px; } .tabs button { flex: 1 1 auto; padding: 6px 5px; font-size: 13px; } .ed-title { padding: 9px 12px; flex-wrap: nowrap; align-items: flex-start; } .ed-title > div:first-child { flex: 1 1 0; } .ed-title h1 { font-size: 17px; } .ed-total { padding: 4px 8px; } .ed-total small { font-size: 9px; } .ed-total .mono, .ed-total .amount.big > span .mono, .ed-total .amount.big:not(.conv) .mono { font-size: 15px; } }
.edge-arrow { position: fixed; top: 45%; z-index: 80; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none; transition: background .12s, color .12s; }
.edge-arrow.ready { background: var(--hull); color: #fff; border-color: var(--hull); }
.sort-pick select { min-height: 32px; padding: 4px 28px 4px 10px; font-size: 13px; width: auto; border-radius: 8px; }
.ed-dates { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-dl { min-height: 32px; padding: 4px 10px; gap: 5px; font-size: 13px; white-space: nowrap; }
.r-add-draft { display: block; margin: 8px auto 0; font-size: 13px; }
.type-own { margin-top: 6px; width: 100%; }
.cur-src { grid-column: 2 / -1; font-size: 11px; color: var(--muted); margin-top: -2px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sec-head .sec { margin-bottom: 0; }
.sec-head + * { margin-top: 10px; }
.sec-stamp { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cur .lbl { font-family: var(--f-mono); font-size: 13px; color: var(--ink); }
.chiplist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.edit { padding: 4px 4px 4px 10px; font-size: 13.5px; color: var(--ink); font-weight: 500; }
.chip.edit button { border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.chip.edit button:hover { background: var(--line); color: var(--ink); }
.chiplist-wrap { display: flex; flex-direction: column; gap: 8px; }
.chip.edit { padding: 2px 4px 2px 2px; gap: 2px; touch-action: auto; user-select: none; -webkit-user-select: none; }
.chip-grip { display: grid; place-items: center; width: 24px; height: 30px; color: var(--muted); cursor: grab; touch-action: none; fill: currentColor; }
.chip.edit .chip-txt { width: auto; height: auto; border-radius: 6px; padding: 4px 4px; color: var(--ink); font: inherit; font-size: 13.5px; }
.chip.edit .chip-txt:hover { background: var(--line); }
.chip.edit.lifted { border-color: var(--hull); background: var(--info-soft); box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.chiplist.dragging { cursor: grabbing; }
.chip.edit.editing { padding: 2px; }
.chip.edit.editing input { min-height: 30px; padding: 3px 8px; font-size: 16px; width: 12em; }
.chip-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-add { display: inline-flex; gap: 6px; align-items: center; }
.chip-add input { width: 170px; min-height: 34px; padding: 5px 9px; font-size: 15px; }
.logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 42px; }
.logo-prev { max-height: 40px; max-width: 160px; background: #fff; border-radius: 4px; padding: 3px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.modal-bar { display: flex; align-items: center; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-note { padding: 8px 16px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.pv { flex: 1; overflow: auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pv-page { width: 100%; max-width: 820px; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); border-radius: 2px; }


/* export check dialog */
.overlay.sheet-overlay { place-items: end center; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(440px, 100%); padding: 8px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 12px 40px rgba(0,0,0,.25); animation: sheet-in .18s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.sheet-head b { font-size: 15px; }
.sheet-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; }
.sheet-btn:active, .sheet-btn:hover { background: var(--surface-2); }
.sheet-btn.cancel { justify-content: center; color: var(--muted); border-top: 1px solid var(--line-2); border-radius: 0 0 10px 10px; margin-top: 4px; }
.card-slide { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.overlay { position: fixed; inset: 0; z-index: 55; background: rgba(8, 16, 22, .45); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(560px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.dialog h2 { font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* receipt ordering */
.r-head { display: flex; align-items: center; gap: 8px; }
.grip { display: inline-grid; place-items: center; width: 30px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); cursor: grab; touch-action: none; padding: 0; }
.grip:hover { color: var(--ink); border-color: var(--hull); }
.receipts.sorting { user-select: none; -webkit-user-select: none; }
.receipts.sorting .grip { cursor: grabbing; }
.receipt.is-dragging { opacity: .45; border-style: dashed; }
.receipt.drop-before { box-shadow: 0 -4px 0 0 var(--signal); }
.drop-end { height: 4px; border-radius: 2px; background: var(--signal); }

/* crop editor */
.modal-note.subtle { background: var(--surface-2); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.crop-alt { white-space: nowrap; }
.crop-stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.crop-wrap { position: relative; max-width: 100%; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-wrap img { display: block; width: 100%; height: 100%; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; touch-action: none; outline: 1px solid rgba(0,0,0,.5); }
.crop-h { position: absolute; width: 26px; height: 26px; border: 3px solid var(--signal); background: rgba(255,255,255,.85); border-radius: 50%; touch-action: none; }
.crop-h.tl { left: -13px; top: -13px; cursor: nwse-resize; } .crop-h.br { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop-h.tr { right: -13px; top: -13px; cursor: nesw-resize; } .crop-h.bl { left: -13px; bottom: -13px; cursor: nesw-resize; }
.replace-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 150px; }
.replace-box .btn { flex: 1 1 auto; }
.replace-title { width: 100%; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.replace-btn { width: 150px; }
@media (max-width: 520px) { .replace-box, .replace-btn { width: 100%; } }
.r-listhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.receipt.compact { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px; }
.grip-space { width: 30px; flex: none; }
.r-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; color: var(--muted); }
.r-row .r-no { font-size: 20px; min-width: 26px; color: var(--ink); }
.mini { width: 40px; height: 52px; flex: none; border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.mini.empty, .mini.pdf { background: var(--surface-2); }
.mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.r-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.r-title { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.r-right .mono { color: var(--ink); font-size: 14px; }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.receipt.expanded { position: relative; }
.collapse-btn { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; z-index: 1; }
.collapse-btn:hover { color: var(--ink); border-color: var(--hull); }
@media (max-width: 380px) { .r-row .mini { display: none; } }
.r-add { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.r-add-btn { width: 100%; min-height: 48px; font-size: 16px; }
.r-add-btn.added { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); flex-wrap: wrap; row-gap: 0; }
.r-add-btn.added:hover { border-color: var(--ok); filter: brightness(0.97); }
.r-add-sub { width: 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.err-details { margin: 0; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); font: 12px/1.45 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; user-select: text; -webkit-user-select: text; }
.receipt.km-open { display: flex; flex-direction: column; gap: 12px; }
.km-open-head { display: flex; align-items: center; gap: 10px; }
.km-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .km-grid { grid-template-columns: 1fr 1.4fr 1.4fr 0.9fr; } }
.km-compact .r-row .r-no { min-width: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.card-wrap { display: flex; flex-direction: column; gap: 6px; }
.card { position: relative; }
.card-slide { position: relative; z-index: 1; display: flex; align-items: stretch; width: 100%; background: var(--surface); transition: transform .18s ease-out; }
.card.swiping .card-slide { transition: none; }
.card-main { touch-action: pan-y; }
.status-select { width: auto; min-height: 32px; padding: 4px 26px 4px 10px; font-size: 13.5px; font-weight: 600; border-radius: 99px; border: 1px solid var(--line); background-color: var(--surface); cursor: pointer; }
.total-line { display: flex; align-items: baseline; gap: 6px; }
.card-total { gap: 6px; }
.archive-ask { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--ok-soft); border-radius: var(--r); color: var(--ink); font-weight: 500; }
.archive-ask > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); }
.archive-ask-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.swipe-status { position: absolute; left: 0; top: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; background: var(--surface-2); align-content: center; }
.swipe-st { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-height: 40px; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 6px; }
.swipe-delete { position: absolute; right: 0; top: 0; bottom: 0; background: var(--bad); display: grid; }
.swipe-delete button { border: 0; background: none; color: #fff; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.card-main { cursor: pointer; }
.card-main:focus-visible { outline: 2px solid var(--hull); outline-offset: -2px; }
.card-top .status-select { min-height: 28px; padding-top: 2px; padding-bottom: 2px; }
.phone-only { display: none; }
.phone-block { display: none; }
.card-del { align-self: flex-end; margin-bottom: auto; }
.card-del:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
@media (pointer: coarse) { .desk-only { display: none; } .phone-only { display: inline-flex; } .phone-block { display: block; } }
.delete-ask { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--bad-soft); border-radius: var(--r); color: var(--ink); }
.pill.st-draft, .status-select.st-draft { color: var(--st-draft); background-color: var(--st-draft-soft); border-color: transparent; }
.pill.st-filled, .status-select.st-filled { color: var(--st-fill); background-color: var(--st-fill-soft); border-color: transparent; }
.pill.st-exported, .status-select.st-exported { color: var(--st-exp); background-color: var(--st-exp-soft); border-color: transparent; }
.pill.st-sent, .status-select.st-sent { color: var(--st-sent); background-color: var(--st-sent-soft); border-color: transparent; }
.pill.st-completed, .status-select.st-completed { color: var(--st-done); background-color: var(--st-done-soft); border-color: transparent; }
.swipe-st.st-draft { color: var(--st-draft); background: var(--st-draft-soft); border-color: transparent; }
.swipe-st.st-filled { color: var(--st-fill); background: var(--st-fill-soft); border-color: transparent; }
.swipe-st.st-exported { color: var(--st-exp); background: var(--st-exp-soft); border-color: transparent; }
.swipe-st.st-sent { color: var(--st-sent); background: var(--st-sent-soft); border-color: transparent; }
.swipe-st.st-completed { color: var(--st-done); background: var(--st-done-soft); border-color: transparent; }
.swipe-st.current { border: 2px solid currentColor; }
.prefs { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.office-select { max-width: 130px; }
.pref-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pref-lbl { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); line-height: 1; padding-left: 2px; }
.prefs .flag-btn, .prefs .cur-select { height: 32px; min-height: 32px; }
.flag { width: 22px; height: 15px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.lang { position: relative; }
.flag-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px; display: flex; flex-direction: column; }
.lang-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-weight: 500; }
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button.on { color: var(--hull); }
.lang-menu button .ic { margin-left: auto; }
.cur-select { width: auto; min-height: 36px; height: 36px; padding: 0 24px 0 9px; font-size: 13.5px; font-weight: 600; border-radius: 9px; background-color: var(--surface-2); }
.seg-flag { display: inline-flex; align-items: center; gap: 7px; }
.amount { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.amount > span { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.amount small.cur { display: inline; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .06em; }
.amount.conv { flex-direction: column; align-items: flex-end; gap: 0; }
.amount small.nok-sub { display: inline; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.amount small.nok-sub .mono { font-size: 11.5px; color: var(--muted); }
.amount.big > span .mono, .amount.big:not(.conv) .mono { font-size: 22px; color: var(--hull); }
.list-meta .amount.conv { flex-direction: row; align-items: baseline; gap: 6px; }
@media (max-width: 520px) { .bar-in { flex-wrap: wrap; gap: 8px 8px; padding-block: 8px; } .brand { min-width: 0; flex: 1 1 0; order: 0; } .bar-user { order: 1; margin-left: auto; } .prefs { margin-left: auto; gap: 6px; order: 2; } .nav { order: 3; width: 100%; margin-left: 0; } .nav button { flex: 1; } }
.fx-src { color: var(--ok); font-weight: 600; font-size: 12.5px; }
.fx-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fx-actions .hint { flex: 1; min-width: 200px; }
.fx-note { margin: 0; padding: 10px 12px; background: var(--ok-soft); border-radius: var(--r-sm); color: var(--ink); font-size: 14px; }
.uploads { display: flex; flex-direction: column; gap: 6px; }
.upload { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; flex-wrap: wrap; }
.upload .upload-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.upload .upload-stage { color: var(--muted); flex: 1; min-width: 0; }
.upload.failed { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.upload.failed .upload-stage { color: var(--ink); }
.upload.done { color: var(--ok); }
.pv.zoomed { align-items: flex-start; }
.pv.zoomed .pv-page.photo { width: 220%; max-width: none; }
.pv-page.photo { cursor: zoom-in; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: min(560px, calc(100% - 32px)); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 9px; font-size: 14.5px; box-shadow: 0 6px 24px rgba(0,0,0,.25); cursor: pointer; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
@media (prefers-reduced-motion: reduce) { .spin, .boot-mark { animation: none; } }

/* header prefs: one grouped box with three equal cells */
.prefs { display: grid; grid-auto-flow: column; gap: 0; margin-left: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.prefs .pref-item { padding: 6px 10px 4px; gap: 2px; border-left: 1px solid var(--line); min-width: 0; }
.prefs .pref-item:first-child { border-left: 0; }
.prefs .pref-lbl { padding-left: 0; font-size: 9.5px; }
.prefs .cur-wrap .pref-lbl { padding-left: 4px; }
.prefs .cur-select, .prefs .flag-btn { border: 0; background-color: transparent; height: 24px; min-height: 24px; padding-left: 0; box-shadow: none; font-size: 14px; }
.prefs .cur-select { padding-right: 22px; background-position: right 2px center; }
.prefs .cur-select:focus { box-shadow: none; }
.prefs .flag-btn { padding: 0; }
.prefs .lang { position: relative; }
@media (max-width: 520px) {
  .prefs { order: 2; width: 100%; margin-left: 0; grid-auto-flow: row; grid-template-columns: 1.25fr 1.25fr 1fr; }
  .prefs .cur-select { width: 100%; max-width: none; }
}
.sub { font-size: 13px; margin: 18px 0 4px; color: var(--ink); }
.icon-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-dark { display: block !important; } :root:not([data-theme="light"]) .icon-light { display: none !important; } }
:root[data-theme="dark"] .icon-dark { display: block !important; } :root[data-theme="dark"] .icon-light { display: none !important; }
.sec-panel { padding-top: 0; padding-bottom: 0; }
.sec-toggle { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 16px 0; cursor: pointer; text-align: left; color: inherit; }
.sec-toggle .sec { margin: 0; flex: 1; }
.sec-extra { font-size: 12px; color: var(--muted); }
.sec-chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.sec-panel.open .sec-chev { transform: rotate(90deg); }
.sec-body { padding-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.overlay.sheet-overlay.at-pointer { background: transparent; }
.at-pointer .sheet { animation: none; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.at-pointer .sheet-btn { min-height: 40px; font-size: 14px; }
.xl-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.xl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xl-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.route-line .route-end { color: var(--muted); }
.route-line .route-stop { color: var(--ink); font-weight: 600; }
.route-line .route-sep { color: var(--muted); }
.time-sel { display: flex; align-items: center; gap: 4px; }
.time-sel select { flex: 1; min-width: 52px; padding: 0 20px 0 8px; background-position: right 4px center; text-align: left; }
.time-colon { font-weight: 700; color: var(--muted); }
.r-missing-att{display:flex;gap:6px;align-items:flex-start;color:var(--warn);font-weight:600}
.r-missing-att svg{flex:none;margin-top:2px}
/* start, login and first-time setup */
.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 14px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; gap: 14px; }
.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.gate-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0 4px 0 0; color: var(--hull); font-weight: 600; font-size: 15px; cursor: pointer; min-height: 44px; }
.gate-lang button { padding: 6px 10px; }
.gate-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.gate-body.narrow { justify-content: flex-start; }
.gate-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.gate-card h1 { font-size: 30px; line-height: 1.08; }
.start-card { background: transparent; border: 0; padding: 8px 2px; gap: 12px; }
.gate-title { font-size: 40px !important; line-height: 1.02 !important; }
.gate-intro { font-size: 16px; line-height: 1.45; color: var(--muted); }
.gate-logo { display: block; width: 52px; height: 52px; }
.gate-logo.big { width: 76px; height: 76px; }
.gate-logo img { width: 100%; height: 100%; border-radius: 22%; display: block; }
.gate-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.gate-main, .gate-alt, .gate-demo { min-height: 52px; font-size: 17px; width: 100%; }
.gate-main { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.gate-main:hover:not(:disabled) { filter: brightness(1.05); border-color: var(--signal); }
.gate-alt { background: var(--surface); }
.gate-demo { border: 1px dashed var(--art-off); color: var(--ink); }
.demo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--art-off); }
.gate-trial { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--st-draft-soft); color: var(--st-draft); border: 1px solid color-mix(in srgb, var(--st-draft) 35%, transparent); }
.gate-trial b { color: var(--ink); font-weight: 600; }
.gate-info { padding: 10px 12px; border-radius: var(--r-sm); background: var(--hull-soft); color: var(--ink); font-size: 14px; }
.gate-err { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 500; }
.gate-foot { text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.settings .gate-foot { text-align: left; padding-top: 4px; }
.center-link { align-self: center; font-size: 14px; min-height: 36px; }
.center-card { align-items: flex-start; }
.gate-okmark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; }
@media (max-width: 480px) { .gate-grid { grid-template-columns: 1fr; } .gate-title { font-size: 36px !important; } }
.doc-rows { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); flex-wrap: wrap; }
.check.dim { opacity: .6; }
.doc-page { gap: 12px; }
.doc-page h2 { font-size: 18px; margin-bottom: 3px; }
.doc-page section p { line-height: 1.55; }
.doc-draft { align-self: flex-start; font: 600 12.5px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--st-draft); background: var(--st-draft-soft); padding: 4px 9px; border-radius: 5px; }
.doc-actions { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; }
.claim-box { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.claim-box ul { margin: 0; padding-left: 18px; }
/* first-time setup (green) */
.gate.setup { --setup: #27704a; }
:root[data-theme="dark"] .gate.setup { --setup: #3f9468; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gate.setup { --setup: #3f9468; } }
.setup-step { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: calc(100dvh - 90px); }
.setup-step.welcome { justify-content: space-between; }
.setup-top { display: flex; justify-content: flex-end; }
.setup-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.setup-foot { display: flex; flex-direction: column; gap: 10px; }
.setup-head { display: flex; flex-direction: column; gap: 8px; }
.setup-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.setup-app { font: 700 19px var(--f-display); }
.setup-prog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.setup-prog span { height: 5px; border-radius: 3px; background: var(--line); }
.setup-prog span.on { background: var(--setup); }
.setup-intro { display: flex; flex-direction: column; gap: 6px; }
.setup-intro h1 { font-size: 30px; line-height: 1.1; }
.setup-intro p { font-size: 15px; color: var(--muted); }
.setup-go { min-height: 52px; font-size: 17px; width: 100%; background: var(--setup); border-color: var(--setup); color: #fff; }
.setup-go:hover:not(:disabled) { filter: brightness(1.07); border-color: var(--setup); }
.setup-two { display: flex; gap: 10px; }
.setup-two .big { flex: 1; min-height: 52px; }
.setup-two .two { flex: 2; width: auto; }
.setup-form { gap: 12px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; cursor: pointer; }
.opt.on { border: 2px solid var(--hull); padding: 12px 14px; }
.opt input { width: 20px; height: 20px; accent-color: var(--hull); margin: 0; flex: none; }
.opt span { display: flex; flex-direction: column; gap: 1px; }
.opt b { font-size: 16px; }
.opt small, .who-txt small { font-size: 13px; color: var(--muted); }
.field.dim { opacity: .6; }
.who-card, .acct-who { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.acct-who { background: var(--surface-2); }
.who-av { width: 40px; height: 40px; border-radius: 50%; background: var(--hull-soft); color: var(--hull); display: grid; place-items: center; font: 700 16px var(--f-display); flex: none; }
.who-txt { display: flex; flex-direction: column; min-width: 0; }
.who-txt b { font-size: 16px; }
.setup-done { display: flex; align-items: center; gap: 12px; background: var(--ok-soft); color: var(--ok); border-radius: var(--r); padding: 12px 14px; }
.setup-done span { display: flex; flex-direction: column; }
.setup-done b { font-size: 16px; }
.setup-done small { font-size: 13px; color: var(--ink); opacity: .8; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.start-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 96px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.start-tile:hover { border-color: var(--hull); }
.start-tile span:last-child { display: flex; flex-direction: column; }
.start-tile b { font: 700 18px var(--f-display); }
.start-tile small { font-size: 12px; color: var(--muted); }
.tile-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.st-sent .tile-ic { background: var(--st-sent-soft); color: var(--st-sent); }
.st-exp .tile-ic { background: var(--st-exp-soft); color: var(--st-exp); }
.st-done .tile-ic { background: var(--st-done-soft); color: var(--st-done); }
.st-draft .tile-ic { background: var(--st-draft-soft); color: var(--st-draft); }
.good-know { gap: 8px; }
.good-know span { font-size: 14px; line-height: 1.4; }
/* settings: account, admin, locked company sections */
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.lockset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.lockset[disabled] input, .lockset[disabled] select, .lockset[disabled] textarea, .lockset[disabled] button { pointer-events: none; }
.lock-note { font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--line); }
.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.adm-row.off { opacity: .7; }
.adm-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-main small { color: var(--muted); font-size: 13px; }
.adm-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.adm-acts select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 14px; }
.adm-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.bad-txt { color: var(--bad) !important; font-weight: 600; }
.adm-price { display: flex; flex-direction: column; gap: 10px; }
.testbar-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.testbar .confirm .btn { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.testbar .tb-btn { border: 1px solid rgba(255,255,255,.8); background: transparent; color: #fff; border-radius: 6px; padding: 5px 10px; font-weight: 600; cursor: pointer; min-height: 32px; }

/* scanner */
.modal.scanner { background: #0f171c; color: #e8eef1; z-index: 60; }
.scanner .modal-bar { background: #142028; border-color: #24333d; color: #e8eef1; justify-content: space-between; }
.scanner .btn { background: #1b2a33; border-color: #33434d; color: #e8eef1; }
.scanner .btn.ghost { background: transparent; }
.scanner .btn:hover:not(:disabled) { border-color: #8bbbd9; }
.scanner .hint { color: #93a3ab; }
.scan-title { font: 700 18px/1.1 var(--f-display); letter-spacing: .01em; }
.scan-body { flex: 1; min-height: 0; width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); }
.scan-busy { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: #b9c6cd; }
.scan-help { font-size: 14px; color: #b9c6cd; text-align: center; }
.scan-stage-wrap { flex: 1; min-height: 160px; position: relative; display: grid; place-items: center; overflow: hidden; }
.scan-stage { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.scan-stage img { display: block; width: 100%; height: 100%; pointer-events: none; border-radius: 2px; }
.scan-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.scan-poly { fill: rgba(42, 139, 232, .16); stroke: #4fa3ff; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.scan-handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; background: none; padding: 0; cursor: grab; touch-action: none; display: grid; place-items: center; }
.scan-handle::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.92); border: 3px solid #4fa3ff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.scan-handle.drag::before, .scan-handle:focus-visible::before { width: 28px; height: 28px; background: #4fa3ff; border-color: #fff; }
.scan-handle:focus-visible { outline: none; }
.scan-loupe { position: absolute; width: 110px; height: 110px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.5); background-repeat: no-repeat; background-color: #000; pointer-events: none; z-index: 2; }
.scan-loupe i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #4fa3ff; border-radius: 50%; }
.scan-result { flex: 1; min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.scan-result img { display: block; flex: none; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.45); border-radius: 2px; }
.scan-updating { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(15,23,28,.8); color: #e8eef1; font-size: 13px; }
.scan-err { position: absolute; bottom: 8px; left: 8px; right: 8px; text-align: center; padding: 8px; border-radius: 8px; background: #3a1c19; color: #f7c4bd; font-size: 14px; }
.scan-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; justify-content: center; }
.scan-thumb { position: relative; flex: none; }
.scan-thumb > button:first-child { display: block; width: 46px; height: 60px; padding: 0; border: 2px solid #33434d; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; position: relative; }
.scan-thumb.on > button:first-child { border-color: #4fa3ff; }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-thumb small { position: absolute; left: 3px; bottom: 2px; font: 700 11px var(--f-display); color: #fff; text-shadow: 0 1px 2px #000; }
.scan-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #b3352a; color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.scan-actions { display: flex; flex-direction: column; gap: 10px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.scan-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.scanner .seg { background: #1b2a33; border-color: #33434d; }
.scanner .seg button { color: #b9c6cd; min-height: 36px; }
.scanner .seg button.on { background: #e8eef1; color: #14222b; }
.scanner .btn.scan-go { width: 100%; min-height: 52px; font-size: 17px; background: #1f6fd1; border-color: #1a60b8; color: #fff; }
.scanner .btn.scan-go:hover:not(:disabled) { background: #2a7be0; border-color: #2a7be0; }

/* course attendance email */
.rank-sel { display: flex; flex-direction: column; gap: 6px; }
.actionbar-in > .btn.cm-open { order: 9; flex: 1 1 100%; }
.cm-badge { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--st-fill-soft); color: var(--st-fill); }
.cm-modal { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.cm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cm-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font-size: 16px; text-align: left; cursor: pointer; }
.cm-box > span { min-width: 0; overflow-wrap: anywhere; }
.cm-box svg { flex: none; color: var(--muted); }
.cm-box.miss { color: var(--warn); border-style: dashed; }
.cm-ask { z-index: 70; }
.cm-manual { max-height: 90vh; overflow-y: auto; }
.cm-part { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2, var(--line)); }
.cm-part > span { display: flex; flex-direction: column; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.cm-part small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.cm-modal .modal-bar { position: sticky; top: 0; z-index: 2; justify-content: space-between; }
.cm-title { font-size: 16px; } .cm-sp { width: 64px; }
.cm-body { width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cm-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line-2, var(--line)); align-items: baseline; }
.cm-row .cm-lbl { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cm-row b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; } .cm-miss { color: var(--warn); }
.cm-chg { white-space: nowrap; }
.cm-dt { display: flex; flex-direction: column; gap: 5px; }
.cm-dt-in { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.cm-hdr { display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.cm-hdr small { display: inline-block; min-width: 58px; color: var(--muted); font-size: 12.5px; }
.cm-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.45 var(--f-body, inherit); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.cm-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 14px; }
.cm-warn { margin: 0; color: var(--warn); font-weight: 600; font-size: 14px; }
.cm-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; margin-top: auto; }
.cm-foot .btn { min-height: 48px; text-decoration: none; }
.cm-foot .btn.dim { opacity: .55; }
.btn.cm-draft { background: #f5c518; border-color: #dcae0c; color: #2a2200; }
.cm-copy { grid-column: 1 / -1; justify-self: center; }
.cm-keys { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.cm-keys code { color: var(--ink); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
