/* Zevi Apter Jobs — v3: simple, native-feeling */
@font-face { font-family: "InterVar"; src: url("/assets/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #F2F2F7; --card: #FFFFFF; --ink: #111114; --ink2: #3C3C43; --mute: #6E6E76; --faint: #A1A1AA;
  --line: #E5E5EA; --fill: #EFEFF4;
  --accent: #0A66E8; --accent-d: #0852BC; --accent-t: #E8F0FD;
  --green: #1A8F4A; --red: #D93025;
  --r: 16px; --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "InterVar", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--mute); } .small { font-size: 14px; } .muted { color: var(--mute); }
.pre { white-space: pre-wrap; }
:focus-visible { outline: 3px solid rgba(10,102,232,.35); outline-offset: 2px; border-radius: 8px; }

/* boot / brand */
.boot { min-height: 100vh; display: grid; place-items: center; }
.wordmark { display: inline-flex; flex-direction: column; line-height: 1.1; color: var(--ink); }
.wordmark b { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.wordmark span { font-size: 12px; color: var(--mute); font-weight: 500; }
.brand-logo { max-height: 36px; max-width: 170px; display: block; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-in { width: 100%; max-width: 360px; text-align: center; }
.login-icon { width: 76px; height: 76px; border-radius: 20px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; letter-spacing: -0.02em; margin: 0 auto 20px; box-shadow: 0 8px 24px -8px rgba(10,102,232,.55); }
.login h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
.login p { margin: 0 0 28px; }
.err { color: var(--red); font-size: 14px; min-height: 0; margin: 6px 2px; text-align: left; }
.err:empty { margin: 0; }
.field-solo input { width: 100%; height: 54px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; padding: 0 16px; font-size: 17px; outline: none; }
.field-solo input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-t); }
.login .btn { margin-top: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 16px; background: var(--fill); color: var(--ink); white-space: nowrap; transition: transform .08s, background .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.green { background: var(--green); color: #fff; }
.btn.tonal { background: var(--accent-t); color: var(--accent); }
.btn.plain { background: transparent; color: var(--accent); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-t { color: var(--red); }
.btn.big { height: 54px; font-size: 17px; border-radius: 14px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn.sm svg { width: 17px; height: 17px; }
.btn.block { display: flex; width: 100%; }
.textbtn { color: var(--accent); font-weight: 600; font-size: 16px; }
.roundbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink2); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.roundbtn.accent { background: var(--accent); color: #fff; box-shadow: 0 4px 12px -4px rgba(10,102,232,.6); }
.roundbtn svg { width: 22px; height: 22px; }

/* shell */
.shell { min-height: 100vh; }
.side { display: none; }
.main { padding: 0 16px calc(96px + var(--safe-b)); max-width: 680px; margin: 0 auto; }
.main.in { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(249,249,251,.92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid rgba(0,0,0,.08); padding: 6px 4px calc(6px + var(--safe-b)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: #8E8E93; font-size: 11px; font-weight: 600; letter-spacing: 0; }
.tabbar a svg { width: 26px; height: 26px; stroke-width: 1.7; }
.tabbar a.on { color: var(--accent); }

/* large title header */
.lt { padding: 18px 0 6px; }
body:not([data-page="home"]):not([data-page="jobs"]):not([data-page="invoices"]):not([data-page="clients"]) .lt { padding-top: 4px; }
.lt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lt h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.lt-r { display: flex; gap: 10px; align-items: center; }
.lt-sub { margin: 4px 0 0; color: var(--mute); font-size: 15px; }
.hello { margin: 0 0 16px; color: var(--mute); font-size: 17px; }

/* nav bar for inner pages */
.navbar { position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 52px; margin: 0 -16px; padding: 0 12px; background: rgba(242,242,247,.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); padding-top: env(safe-area-inset-top, 0px); }
.navbar.scrolled { border-bottom: 1px solid rgba(0,0,0,.07); }
.nb-back { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; font-weight: 500; justify-self: start; }
.nb-back svg { width: 24px; height: 24px; stroke-width: 2; margin-left: -4px; }
.nb-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar.scrolled .nb-title { opacity: 1; }
.nb-right { justify-self: end; }
.nb-link { font-size: 17px; font-weight: 500; }

/* cards & lists */
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.sec-h h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sec-h a, .sec-h .textbtn { font-size: 16px; font-weight: 500; }
.list { display: flex; flex-direction: column; gap: 10px; }
.jcard { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 14px 14px 14px 16px; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); min-height: 72px; transition: transform .08s, background .15s; }
.jcard:active { transform: scale(.99); background: #FAFAFC; }
.jc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jc-t { font-weight: 650; font-size: 17px; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-s { color: var(--mute); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-f { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.jc-when { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--mute); }
.jc-when svg { width: 15px; height: 15px; }
.jc-next { font-size: 14px; font-weight: 600; color: var(--accent); }
.jc-next::before { content: "→ "; }
.jc-next.wait { color: var(--mute); font-weight: 500; } .jc-next.wait::before { content: ""; }
.jc-end { display: flex; align-items: center; gap: 6px; color: #C4C4C9; }
.jc-end svg { width: 18px; height: 18px; stroke-width: 2; }
.jc-amt { color: var(--ink); font-weight: 600; font-size: 16px; }
.jc-endcol { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.note-card { display: flex; align-items: center; gap: 14px; padding: 18px 16px; color: var(--ink2); font-size: 15px; line-height: 1.4; }
.note-card > svg { width: 26px; height: 26px; color: var(--accent); }
.note-card b { color: var(--ink); font-size: 16px; }
.note-card > span { flex: 1; }

/* status pills — words, calm colour */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; letter-spacing: 0; background: #EEEEF2; color: #4A4A52; }
.pill.big { height: 34px; padding: 0 14px; font-size: 16px; }
.s-new { background: #EEEEF2; color: #4A4A52; }
.s-booked { background: #EFEBFF; color: #5B3FD0; }
.s-shot { background: #FFF2DB; color: #965A00; }
.s-editing { background: #FFEADF; color: #B8460B; }
.s-edited, .s-back_from_editor { background: #DFF5F2; color: #0E6E66; }
.s-delivered { background: #E3EEFF; color: #0A57C8; }
.s-invoiced { background: #ECEBFF; color: #3F3BC4; }
.s-paid, .i-paid { background: #E1F5E8; color: #17803F; }
.i-draft { background: #EEEEF2; color: #4A4A52; } .i-sent { background: #FFF2DB; color: #965A00; } .i-overdue { background: #FDE7E5; color: #C0261B; } .i-void { background: #EEEEF2; color: #8E8E93; }

/* home */
.owed { margin-bottom: 12px; }
.owed-in { display: flex; flex-direction: column; padding: 18px 18px 16px; color: var(--ink); }
.owed-l { font-size: 15px; font-weight: 600; color: var(--mute); }
.owed-v { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; margin-top: 2px; }
.owed-n { font-size: 15px; color: var(--mute); margin-top: 2px; }
.owed-n em { color: var(--red); font-style: normal; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--card); border-radius: var(--r); padding: 12px 12px 14px; display: flex; flex-direction: column; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); min-height: 108px; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.tile-ic svg { width: 19px; height: 19px; stroke-width: 1.8; }
.t-edit .tile-ic { background: #F2780C; } .t-deliver .tile-ic { background: #12A594; } .t-invoice .tile-ic { background: #5B53E0; }
.tile-v { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.tile-l { margin-top: auto; padding-top: 12px; font-weight: 650; font-size: 15px; }
.tile-n { font-size: 13px; color: var(--mute); }
.datebox { width: 48px; height: 52px; border-radius: 12px; background: var(--fill); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.datebox span { font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .02em; }
.datebox b { font-size: 21px; font-weight: 700; line-height: 1.05; }

/* jobs */
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: #E4E4EA; color: #8E8E93; margin: 10px 0 12px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--ink); min-width: 0; }
.search input::placeholder { color: #8E8E93; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; font-size: 15px; font-weight: 600; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.chip .n { color: var(--faint); font-weight: 600; }
.chip.on { background: var(--ink); color: #fff; } .chip.on .n { color: rgba(255,255,255,.6); }
.seg { display: inline-flex; background: #E4E4EA; border-radius: 10px; padding: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: var(--ink); }
.desk-only { display: none !important; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.col h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font-size: 14px; color: var(--mute); }
.col-b { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.bcard { background: #fff; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.05); font-size: 14px; }
.bcard b { font-size: 15px; } .bcard span { color: var(--mute); }
.col-empty { color: var(--faint); font-size: 14px; padding: 12px; border: 1.5px dashed #D8D8DE; border-radius: 12px; text-align: center; }

/* job page */
.job-h { padding: 6px 2px 16px; }
.job-meta { margin: 0 0 4px; color: var(--mute); font-size: 15px; font-weight: 500; }
.job-h h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.job-addr { display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: 16px; color: var(--ink2); }
.job-addr svg { color: var(--accent); margin-top: 1px; }
.status-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sc-top { display: flex; justify-content: space-between; align-items: center; }
.sc-l { font-size: 15px; font-weight: 600; color: var(--mute); }
.sc-st { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-step { font-size: 14px; color: var(--mute); }
.steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 4px; }
.steps i { height: 6px; border-radius: 3px; background: #E5E5EA; }
.steps i.done { background: var(--accent); } .steps i.cur { background: var(--accent); opacity: .45; }
.sc-hint { margin: -4px 0 0; text-align: center; font-size: 14px; color: var(--mute); }
.sc-hint b { color: var(--ink2); font-weight: 600; }
.done-note { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 14px; background: #E1F5E8; color: #17803F; font-weight: 650; font-size: 17px; }
.qas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.qa { background: var(--card); border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; font-size: 13px; font-weight: 600; color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.04); text-align: center; }
.qa > span { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-t); display: grid; place-items: center; }
.qa > span svg { width: 20px; height: 20px; }
.qas.acts { display: flex; } .qas.acts .qa { flex: 1; }
.qa.off { color: var(--faint); } .qa.off > span { background: var(--fill); }
.group { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.group > * + * { border-top: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; font-size: 16px; }
.kv > span:first-child { color: var(--mute); flex: none; }
.kv > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: flex-end; }
.kv small { color: var(--mute); font-size: 14px; }
.kv.stack { flex-direction: column; gap: 4px; } .kv.stack > span:last-child { text-align: left; align-items: flex-start; }
.gal { padding: 16px; }
.gal-h { display: flex; align-items: center; gap: 12px; }
.gal-ic { width: 44px; height: 44px; border-radius: 12px; background: #E3EEFF; color: #0061FE; display: grid; place-items: center; flex: none; }
.gal-ic svg { width: 24px; height: 24px; }
.gal-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gal-m b { font-size: 17px; font-weight: 650; }
.gal-m small { color: var(--mute); font-size: 14px; }
.gal-url { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 14px; }
.gal-form { display: flex; gap: 8px; margin-top: 14px; }
.gal-form input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; font-size: 16px; outline: none; }
.gal-form input:focus { border-color: var(--accent); background: #fff; }
.cell-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.cell-ic.grey { background: var(--fill); color: var(--ink2); } .cell-ic.blue { background: var(--accent); } .cell-ic.wa { background: #25D366; }
.hist { padding: 12px 16px 6px; }
.note-f { display: flex; gap: 8px; margin-bottom: 8px; }
.note-f input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 0; background: var(--bg); padding: 0 12px; font-size: 16px; outline: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.timeline li + li { border-top: 1px solid var(--line); }
.t-dot { width: 10px; height: 10px; border-radius: 50%; background: #C7C7CC; margin-top: 6px; flex: none; }
.t-dot.s-booked { background: #7B61FF; } .t-dot.s-shot { background: #E8A100; } .t-dot.s-editing { background: #F2780C; } .t-dot.s-edited, .t-dot.s-back_from_editor { background: #12A594; } .t-dot.s-delivered { background: var(--accent); } .t-dot.s-invoiced { background: #5B53E0; } .t-dot.s-paid { background: var(--green); }
.t-h { font-size: 15px; } .t-n { font-size: 14px; color: var(--mute); } .timeline time { font-size: 13px; color: var(--faint); }
.auto { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-t); padding: 1px 6px; border-radius: 6px; }
#del { margin-top: 20px; }

/* forms */
.form { display: block; }
.glabel { margin: 22px 16px 8px; font-size: 13px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .03em; }
.ghint { margin: 8px 16px 0; font-size: 13px; color: var(--mute); }
.form-group { margin-top: 12px; }
.glabel + .form-group, .glabel + .card { margin-top: 0; }
.fcell { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; font-size: 17px; }
.fcell > span:first-child { flex: none; width: 112px; color: var(--ink); font-weight: 500; }
.fcell input, .fcell select, .fcell textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; text-align: right; padding: 14px 0; color: var(--ink2); }
.fcell input::placeholder, .fcell textarea::placeholder { color: #B0B0B6; }
.fcell input[type=date], .fcell input[type=time] { -webkit-appearance: none; appearance: none; min-height: 50px; }
.fcell select { -webkit-appearance: none; appearance: none; direction: rtl; }
.fcell.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 12px; }
.fcell.stack > span:first-child { width: auto; font-size: 14px; color: var(--mute); }
.fcell.stack input, .fcell.stack textarea { text-align: left; padding: 6px 0 12px; }
.fcell textarea { resize: vertical; min-height: 60px; }
.prefix, .suffix { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; color: var(--mute); }
.prefix input, .suffix input { flex: 0 1 120px; }
.prefix i, .suffix i { font-style: normal; }
.typepick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.typepick label { position: relative; }
.typepick input { position: absolute; opacity: 0; }
.typepick span { display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 12px; background: #fff; font-weight: 600; font-size: 16px; color: var(--ink2); box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 2px solid transparent; }
.typepick input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-t); }
.typepick input:focus-visible + span { outline: 3px solid rgba(10,102,232,.35); }
.more { margin-top: 16px; }
.more summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fff; border-radius: var(--r); cursor: pointer; color: var(--accent); font-weight: 600; font-size: 16px; flex-wrap: wrap; }
.more summary::-webkit-details-marker { display: none; }
.more summary small { color: var(--mute); font-weight: 400; font-size: 14px; flex-basis: 100%; padding-left: 28px; margin-top: -4px; }
.more[open] summary svg { transform: rotate(45deg); }
.form-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; }
.switch-cell { justify-content: space-between; }
.switch-cell > span:first-child { width: auto; }
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw { width: 51px; height: 31px; border-radius: 16px; background: #E5E5EA; position: relative; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .sw { background: #34C759; }
.switch input:checked + .sw::after { transform: translateX(20px); }

/* invoices */
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 14px; }
.mt { padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink); }
.mt span { font-size: 14px; color: var(--mute); font-weight: 600; } .mt b { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.inv-head { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.ih-top { display: flex; justify-content: space-between; align-items: center; }
.ih-num { font-size: 15px; font-weight: 600; color: var(--mute); }
.ih-amt { font-size: 42px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; margin-top: 6px; }
.ih-sub { margin: 0; font-size: 16px; color: var(--ink2); }
.ih-due { margin: 0 0 10px; font-size: 15px; color: var(--mute); }
.inv-head .sc-hint { margin-top: 6px; }
.items .item { display: grid; grid-template-columns: 1fr 64px 96px 32px; gap: 8px; align-items: end; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.items textarea { grid-column: 1 / -1; border: 0; outline: none; resize: none; font-size: 17px; padding: 0; background: transparent; min-height: 26px; }
.items label { display: flex; flex-direction: column; gap: 2px; }
.items label small { font-size: 12px; color: var(--mute); font-weight: 600; }
.items label input { height: 38px; border: 0; border-radius: 10px; background: var(--bg); padding: 0 10px; font-size: 16px; outline: none; width: 100%; text-align: right; }
.it-q { grid-column: 2; } .it-u { grid-column: 3; }
.items .item > label.it-q { grid-column: 2; } 
.items .item { grid-template-areas: "d d d d" ". q u x"; }
.items textarea { grid-area: d; } .it-q { grid-area: q; } .it-u { grid-area: u; } .it-x { grid-area: x; }
.it-x { width: 32px; height: 38px; display: grid; place-items: center; color: var(--faint); }
.add-line { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 16px; color: var(--accent); font-weight: 600; font-size: 16px; border-top: 0 !important; }
.items-group { margin-top: 0; }
.totals { margin-top: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.totals > div { display: flex; justify-content: space-between; color: var(--mute); }
.totals .grand { color: var(--ink); font-weight: 750; font-size: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.form.locked { opacity: .6; pointer-events: none; }
.preview-wrap { background: var(--card); border-radius: var(--r); padding: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }

/* clients */
.client { padding: 14px 16px; }
.cl-top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; flex: none; }
.a0 { background: #5B8DEF; } .a1 { background: #F2780C; } .a2 { background: #12A594; } .a3 { background: #7B61FF; } .a4 { background: #E5484D; } .a5 { background: #3E9B4F; }
.owe { color: var(--red); font-size: 14px; font-weight: 600; }
.cl-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.logo-card { padding: 16px; } .logo-card .small { margin: 0; color: var(--ink2); line-height: 1.5; } .logo-card .dim.small { margin-top: 10px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bg); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; margin-top: 8px; white-space: pre-wrap; }

/* docs */
.docs { background: #fff; border-radius: var(--r); padding: 4px 16px 16px; font-size: 15px; line-height: 1.55; }
.docs h3 { font-size: 18px; margin: 20px 0 8px; } .docs code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.docs .code { overflow-x: auto; }

/* empty */
.empty { text-align: center; padding: 48px 20px; }
.empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-t); color: var(--accent); display: inline-grid; place-items: center; margin-bottom: 14px; }
.empty-ic svg { width: 30px; height: 30px; }
.empty h3 { font-size: 20px; margin: 0 0 6px; } .empty p { margin: 0 auto 18px; color: var(--mute); max-width: 300px; }

/* sheets */
#modal-root:empty { display: none; }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; animation: bgin .2s ease; }
@keyframes bgin { from { background: rgba(0,0,0,0); } }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 0 auto 14px; }
.modal h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin: 0 0 6px; text-align: center; }
.modal > p.muted, .modal form > p.muted { text-align: center; margin: 0 0 16px; font-size: 15px; }
.modal .group { margin: 12px 0; }
.sheet-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 4px auto 12px; }
.sheet-ic svg { width: 28px; height: 28px; }
.sheet-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.cell { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; color: var(--ink); background: #fff; }
.cell .cell-m { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cell .cell-m b { font-weight: 600; font-size: 17px; } .cell .cell-m small { color: var(--mute); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell > svg:last-child { color: #C4C4C9; width: 18px; height: 18px; stroke-width: 2; }
.msg-prev { background: #DCF8C6; border-radius: 16px 16px 4px 16px; padding: 12px 14px; font-size: 15px; line-height: 1.45; color: #111; margin: 0 0 4px auto; max-width: 92%; overflow-wrap: anywhere; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--fill); color: var(--mute); flex: none; }
.step-n.done { background: var(--accent); color: #fff; } .step-n.done svg { width: 16px; height: 16px; stroke-width: 2.4; }
.step-n.cur { background: var(--accent-t); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cur-tag { font-size: 13px; font-weight: 700; color: var(--accent); }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); background: rgba(28,28,30,.94); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.modal-bg) #toast { bottom: auto; top: calc(14px + env(safe-area-inset-top, 0px)); }

/* invoice paper */
.paper { background: #fff; border-radius: 10px; padding: 26px 22px; font-size: 11px; line-height: 1.5; color: #1a1a1a; border: 1px solid var(--line); }
.p-h { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.p-name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; } .p-logo { max-height: 40px; max-width: 150px; }
.p-dim { color: #86868B; margin-top: 4px; }
.p-r { text-align: right; } .p-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.p-num { font-size: 15px; font-weight: 700; margin-top: 2px; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.p-lbl { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #86868B; margin-bottom: 3px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #86868B; text-align: left; padding: 7px 0; border-bottom: 1px solid #1a1a1a; }
.paper td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.paper .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.p-tot { margin: 12px 0 0 auto; width: 60%; display: flex; flex-direction: column; gap: 3px; }
.p-tot div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: #48484A; }
.p-tot .g { font-size: 14px; font-weight: 700; color: #1a1a1a; border-top: 1px solid #1a1a1a; padding-top: 6px; margin-top: 4px; }
.p-gal { margin-top: 18px; } .p-gal a { overflow-wrap: anywhere; }
.p-pay { margin-top: 18px; background: #F5F5F7; padding: 10px 12px; border-radius: 8px; }
.p-pay > div:not(.p-lbl) { display: grid; grid-template-columns: 90px 1fr; } .p-pay span { color: #86868B; }
.p-pay > div.p-warn { display: block; color: #B8460B; }
.p-foot { margin-top: 16px; }

/* desktop */
@media (min-width: 1000px) {
  body { background: #F2F2F7; }
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: #fff; border-right: 1px solid var(--line); }
  .side-brand { padding: 4px 10px 6px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 16px; }
  .side-nav a svg { width: 22px; height: 22px; color: var(--mute); }
  .side-nav a:hover { background: var(--bg); }
  .side-nav a.on { background: var(--accent-t); color: var(--accent); } .side-nav a.on svg { color: var(--accent); }
  .side-foot { margin-top: auto; padding: 0 12px; font-size: 15px; }
  .tabbar { display: none; }
  .main { max-width: 1060px; width: 100%; padding: 12px 40px 60px; }
  .lt { padding-top: 28px; }
  .lt-r .roundbtn.accent { display: none; }
  .desk-only { display: inline-flex !important; }
  .navbar { margin: 0 -40px; padding: 0 28px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .owed-in { flex-direction: row; align-items: baseline; gap: 16px; flex-wrap: wrap; }
  .job-grid, .inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .inv-grid { grid-template-columns: 1fr 1.1fr; grid-template-areas: 'a p' 'f p'; column-gap: 28px; row-gap: 0; }
  .inv-a { grid-area: a; } .inv-f { grid-area: f; } .inv-p { grid-area: p; position: sticky; top: 64px; } .inv-p .sec { margin-top: 0; }
  .job-grid .job-col > .sec:first-child { margin-top: 0; }
  .modal-bg { align-items: center; }
  .modal { border-radius: 20px; padding: 24px; animation: pop .2s ease; }
  .modal .grab { display: none; }
  @keyframes pop { from { transform: scale(.96); opacity: 0; } }
  #toast { bottom: 32px; }
  .list.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) { body[data-page="clients"] #cl .list, body[data-page="home"] .sec .list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } }
@media (max-width: 360px) { .tiles { gap: 8px; } .tile-v { font-size: 24px; } .qa { font-size: 12px; } .fcell > span:first-child { width: 96px; } }
@media print {
  body { background: #fff; } .side, .tabbar, .navbar, .no-print, .inv-head, .qas, #toast { display: none !important; }
  .main { padding: 0; max-width: none; } .inv-grid { display: block; } .preview-wrap { box-shadow: none; padding: 0; } .paper { border: 0; padding: 0; }
  .sec-h { display: none; }
}

/* to shoot (v4) */
.shoot-cta { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; margin: 0 0 12px; color: var(--ink); }
.shoot-cta .tile-ic { background: #EAF2FF; color: var(--accent, #0A66E8); }
.pill-n { background: var(--accent, #0A66E8); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 13px; font-weight: 700; }
.add-shoot { margin: 4px 0 18px; }
.sh-row { padding-right: 10px; }
.sh-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.shot-btn { flex: none; white-space: nowrap; }
.datebox.late span { color: var(--red); }
.datebox.nodate span { color: var(--mute, #86837D); font-size: 9px; }
.datebox.nodate b { color: var(--mute, #86837D); }
.ih-part { margin: 6px 0 0; font-size: 14px; }
.ih-part b { color: var(--red); }
.ih-imp { margin: 4px 0 0; font-size: 12px; color: var(--mute, #86837D); }
.cl-addr { font-size: 12px; opacity: .8; }
.jc-end .owe.small { display: block; font-size: 12px; }
.late-note { color: var(--red); font-size: 13px; font-weight: 600; }
.typepick { grid-template-columns: repeat(3, 1fr); }
.typepick span { height: 44px; font-size: 14px; text-align: center; padding: 0 4px; line-height: 1.15; }
.sh-client { color: var(--ink); font-weight: 500; }

/* v5: five simple steps */
.steps-sum { margin: 0 0 14px; }
.step-row { min-height: 56px; }
.step-row .cell-m b { font-size: 17px; }
.step-row.zero .cell-m b, .step-row.zero .sum-n { color: var(--mute); font-weight: 500; }
.step-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.step-dot.s-new { background: #A1A1AA; } .step-dot.s-shot { background: #E69A1C; } .step-dot.s-editing { background: #E2652A; }
.step-dot.s-delivered { background: #2F7CF0; } .step-dot.s-invoiced { background: #5B57D9; }
.sum-n { font-size: 20px; font-weight: 700; color: var(--ink); min-width: 28px; text-align: right; }
.home-add { margin: 0 0 6px; }
.job-price { margin: 6px 0 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.ticks { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--fill); }
.tick { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px; text-align: left; background: #fff; border-top: 1px solid var(--line); -webkit-tap-highlight-color: transparent; }
.ticks .tick:first-child { border-top: 0; }
.tick-box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #C4C4C9; display: grid; place-items: center; flex: none; background: #fff; transition: background .15s, border-color .15s; }
.tick-box svg { width: 18px; height: 18px; stroke-width: 2.6; color: #fff; opacity: 0; }
.tick.on .tick-box { background: var(--green); border-color: var(--green); }
.tick.on .tick-box svg { opacity: 1; }
.tick-l { flex: 1; font-size: 17px; font-weight: 600; color: var(--ink); }
.tick.on .tick-l { color: var(--ink2); }
.tick-at { font-size: 13px; color: var(--mute); white-space: nowrap; }
.tick:active { background: var(--fill); }
.tick[disabled] { opacity: .6; }
.status-card .sc-top .pill { margin-left: auto; }
.board-note { text-align: center; color: var(--mute); font-size: 14px; margin: 14px 0; }
@media (min-width: 1000px) { .btn.home-add { display: none !important; } }
@media (min-width: 1000px) { body[data-page="clients"] #cl .list, body[data-page="home"] .sec .list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jcard, .jc-main { min-width: 0; }

/* v7: Back from editor, gallery ready, share, paid date */
.step-dot.s-back_from_editor { background: #12A594; }
.jc-gal { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; background: #DFF5F2; color: #0E6E66; white-space: nowrap; }
.jc-gal svg { width: 12px; height: 12px; }
.gal .gal-share { margin-top: 12px; }
.pd-field input[type=date] { width: 100%; min-height: 50px; font-size: 18px; font-family: inherit; }
.pd-quick { display: flex; gap: 8px; margin: 10px 0 4px; }
