/* Paperless by Techro — dark brand theme (logo is white, so the app is dark-first). */
:root {
  --bg: #0B0E11;
  --bg-2: #10151a;
  --surface: #141a20;
  --surface-2: #1b232b;
  --line: #242e37;
  --text: #eef4f2;
  --muted: #8fa3a0;
  --mint: #03FBC8;
  --mint-2: #00D4AA;
  --teal: #008B70;
  --mint-soft: rgba(3, 251, 200, .12);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .12);
  --amber: #ffc857;
  --amber-soft: rgba(255, 200, 87, .12);
  --blue-soft: rgba(120, 170, 255, .12);
  --radius: 18px;
  --nav-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Heebo, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  padding-bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom));
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(0, 139, 112, .22), transparent 60%);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--red); font-size: 13px; min-height: 0; margin: 6px 0 0; }
.grow { flex: 1; min-width: 0; }
i[data-icon] { display: inline-flex; width: 20px; height: 20px; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: #33414c; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--mint); color: #04201a; border-color: var(--mint); box-shadow: 0 8px 24px rgba(3, 251, 200, .18); }
.btn.primary:hover { background: #4dffdc; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red-soft); border-color: transparent; color: #ffb3b3; }
.btn.block { width: 100%; padding: 14px; }
.btn i[data-icon] { width: 18px; height: 18px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
input {
  font: inherit; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s;
}
input:focus { border-color: var(--mint-2); }
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 46px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 14, 17, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(36, 46, 55, .6);
}
.topbar .logo { height: 26px; width: auto; }
.topbar .brandmark { height: 40px; margin-inline-end: auto; }
.topbar .product { font-weight: 600; color: var(--muted); padding-inline-start: 10px; border-inline-start: 1px solid var(--line); margin-inline-end: auto; }
main { max-width: 820px; margin: 0 auto; padding: 16px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px; margin-bottom: 14px;
  background: radial-gradient(420px 260px at 95% 20%, rgba(3, 251, 200, .20), transparent 70%), linear-gradient(160deg, #13302b, #10181c 55%);
  border: 1px solid rgba(3, 251, 200, .16);
}
.hero-text { position: relative; z-index: 1; max-width: 68%; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); font-weight: 700; }
.period { all: unset; cursor: pointer; display: flex; width: fit-content; align-items: center; gap: 6px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 14px; }
.period i[data-icon] { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.period.open i[data-icon] { transform: rotate(180deg); }
.range { margin: -4px 0 14px; }
.dates { display: flex; gap: 8px; }
.dates label { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--mint-2); }
.scan { padding: 13px 22px; font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.ghost-light { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); padding: 12px 16px; }
.filepick.slim { padding: 14px; grid-auto-flow: column; justify-content: center; }
.card-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card-sum div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.card-sum strong { display: block; font-size: 20px; }
.card-sum span { font-size: 12px; color: var(--muted); }
.card-sum .bad strong { color: var(--amber); }
.card-sum .good strong { color: var(--mint); }
.charges { display: grid; gap: 8px; }
.charges h3 { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.charge { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.charge.missing { border-color: rgba(255, 200, 87, .35); }
.charge .row1 .vendor { font-size: 15px; }
.charge-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.charge-actions .btn { padding: 7px 12px; font-size: 13px; }
.charge .match { font-size: 13px; color: var(--mint); }
.hero-octo { position: absolute; right: -18px; bottom: -40px; width: 170px; z-index: 0; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .4)); transition: transform .3s; }
.hero-octo.busy { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.progress { margin-top: 14px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--mint-2), var(--mint)); transition: width .4s; }
.bar.indeterminate span { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.progress p { margin: 6px 0 0; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { all: unset; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 2px; min-width: 0; transition: border-color .15s; }
.stat:hover { border-color: #33414c; }
.stat-n { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-l { font-size: 12px; color: var(--muted); }

/* ---------- tabs / bottom nav ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.tabs button i[data-icon] { width: 18px; height: 18px; }
.tabs button.active { background: var(--mint-soft); color: var(--mint); }
.tabs b { font-size: 12px; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 99px; background: var(--surface-2); color: var(--text); }
.tabs b:empty { display: none; }
@media (max-width: 760px) {
  .tabs {
    position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; justify-content: space-around;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom);
    background: rgba(16, 21, 26, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabs button { position: relative; flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; flex: 1; justify-content: center; text-align: center; }
  .tabs button i[data-icon] { width: 22px; height: 22px; }
  .tabs button.active { background: transparent; }
  .tabs b { position: absolute; top: 0; left: 50%; margin-left: 6px; font-size: 10px; min-width: 16px; padding: 0 4px; background: var(--mint); color: #04201a; }
}

/* ---------- bulk bar ---------- */
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.bulk:empty { display: none; }
.bulk .sum { margin-inline-end: auto; font-size: 14px; }
.bulk .sum strong { font-size: 18px; display: block; }

/* ---------- receipt cards ---------- */
.list { display: grid; gap: 10px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; animation: in .25s ease-out;
}
.card.leaving { animation: out .22s ease-in forwards; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
@keyframes out { to { opacity: 0; transform: translateX(30px); height: 0; padding-block: 0; margin: 0; border-width: 0; } }
.thumb { width: 52px; height: 64px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center;
  overflow: hidden; color: var(--muted); cursor: pointer; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ext { font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.thumb i[data-icon] { width: 22px; height: 22px; color: var(--mint-2); }
.card-main { min-width: 0; cursor: pointer; }
.row1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.vendor { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { font-weight: 800; font-size: 16px; white-space: nowrap; }
.sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--blue-soft); color: #bcd3ff; }
.tag.good { background: var(--mint-soft); color: var(--mint); }
.tag.bad { background: var(--red-soft); color: #ffb3b3; }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.reason { font-size: 13px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .error { grid-column: 1 / -1; font-size: 13px; color: #ffb3b3; background: var(--red-soft); padding: 8px 10px; border-radius: 10px; }
.card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.card-actions.one { grid-template-columns: 1fr auto; }
.card-actions .btn { padding: 10px; }
.btn.yes { background: var(--mint-soft); border-color: transparent; color: var(--mint); }
.btn.no { background: rgba(255,255,255,.04); color: var(--muted); }
.btn.more { width: 44px; padding: 0; }

.empty { text-align: center; padding: 28px 10px 10px; color: var(--muted); }
.empty img { width: 120px; opacity: .9; margin-bottom: 6px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 17px; }
.empty p { margin: 0; font-size: 14px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- FAB ---------- */
.fab {
  position: fixed; z-index: 16; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 18px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--mint); color: #04201a; font: inherit; font-weight: 800; box-shadow: 0 12px 30px rgba(3, 251, 200, .25), 0 4px 12px rgba(0,0,0,.4);
}
.fab i[data-icon] { width: 22px; height: 22px; }
@media (min-width: 761px) { .fab { bottom: 24px; right: 24px; } body { padding-bottom: 110px; } }

/* ---------- bottom sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; animation: up .25s ease-out;
}
.sheet.tall { max-height: 94vh; }
/* iPhone (WebKit) fix: a scrolling panel that slides in with a transform, over blurred bars, can be left
   half unpainted (a black area). So: size panels to the *visible* viewport (dvh), fade them in without a
   transform, give the scroll area its own layer, and switch off the blurred bars while a panel is open. */
@supports (height: 100dvh) {
  .sheet { max-height: 92dvh; }
  .sheet.tall { max-height: 94dvh; }
}
.sheet { animation-name: sheet-in; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateZ(0); }
@keyframes sheet-in { from { opacity: 0; } }
body.sheet-open { overflow: hidden; }
body.sheet-open .topbar, body.sheet-open .tabs { backdrop-filter: none; -webkit-backdrop-filter: none; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin-top: 4px; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; border-bottom: 1px solid var(--line); } .sheet::before { display: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

.setup-row { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.setup-row strong { display: block; margin-bottom: 2px; }
.setup-row .btn { margin-top: 8px; }
.setup-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.setup-ic.ok { background: var(--mint-soft); color: var(--mint); }
.setup-ic.todo { background: var(--amber-soft); color: var(--amber); }
.setup-ic i[data-icon] { width: 16px; height: 16px; }
.accounts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.accounts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.accounts li span { overflow: hidden; text-overflow: ellipsis; }
.accounts .acts { display: flex; gap: 4px; flex: none; }
.accounts .acts a, .accounts .acts button { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: underline; }

.filepick { display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px; border: 1.5px dashed #34444f; border-radius: var(--radius); cursor: pointer; color: var(--muted); background: var(--surface); }
.filepick:hover { border-color: var(--mint-2); }
.filepick input { display: none; }
.filepick i[data-icon] { width: 30px; height: 30px; color: var(--mint); }
.filepick img { max-height: 220px; max-width: 100%; border-radius: 12px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--mint-soft); border-color: var(--mint-2); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--mint); }

/* PDF thumbnails: canvas covers the icon once drawn */
.thumb { position: relative; }
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .2s; background: #fff; }
.thumb canvas.drawn { opacity: 1; }

/* detail sheet */
.preview { width: 100%; max-height: 50vh; border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
img.preview { object-fit: contain; background: var(--surface); height: 46vh; }
.pdfprev { display: grid; place-items: center; min-height: 160px; background: var(--surface); text-decoration: none; }
.pdfprev canvas { width: 100%; height: auto; display: block; background: #fff; }
.pdfprev canvas:not(.drawn) { display: none; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fact span { display: block; font-size: 11.5px; color: var(--muted); }
.fact strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.plan strong { display: block; font-size: 14px; }
.plan span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.plan.ok { background: var(--mint-soft); border-color: rgba(3, 251, 200, .3); }
.linkrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--amber-soft); }
.linkrow > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--amber); margin-inline-end: auto; }
.linkrow > span i[data-icon] { width: 16px; height: 16px; }
.linkrow .btn { padding: 7px 12px; font-size: 13px; }
.getreal { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--amber-soft); border: 1px solid rgba(255, 200, 87, .3); }
.getreal strong { color: var(--amber); }
.getreal span { font-size: 13px; color: var(--muted); }
.getreal .detail-links .btn { padding: 8px 12px; font-size: 13px; color: var(--text); }
.plan-bits { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.plan-bits bdi { font-size: 12.5px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.25); color: var(--text); }
.plan.ok > i { color: var(--mint); }
.plan.warn { background: var(--amber-soft); border-color: rgba(255, 200, 87, .3); }
.plan.warn > i { color: var(--amber); }
.facts.edit .fact { display: grid; gap: 4px; }
.facts.edit input, .facts.edit select { padding: 8px 10px; font-weight: 600; background: var(--bg-2); }
select { font: inherit; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--text); outline: none; }
select:focus { border-color: var(--mint-2); }
.tag.type { background: rgba(3, 251, 200, .07); color: var(--text); border: 1px solid rgba(3, 251, 200, .25); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { margin-top: 8px; }
.detail-meta { font-size: 13px; color: var(--muted); display: grid; gap: 2px; overflow-wrap: anywhere; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-links a { color: var(--mint); font-size: 14px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-actions .wide { grid-column: 1 / -1; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: radial-gradient(600px 400px at 50% 20%, #13302b, var(--bg) 70%); }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.login-octo { width: 130px; animation: bob 3s ease-in-out infinite; }
.login-logo { height: 52px; max-width: 100%; }
.login-card p { margin: -6px 0 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: #eef4f2; color: #0B0E11; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); animation: up .2s;
}
.toast button { font: inherit; font-weight: 800; color: var(--teal); background: none; border: 0; cursor: pointer; padding: 0; }
@media (min-width: 761px) { .toast { bottom: 100px; } }

@media (max-width: 420px) {
  .hero-octo { width: 130px; right: -22px; bottom: -30px; }
  .period { font-size: 22px; }
  .stat-n { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- accounts / settings (multi-customer) ---------- */
.login-card input { width: 100%; }
.login-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.login-links a { color: var(--mint); text-decoration: none; }
.banner { margin: 10px auto 0; max-width: 1100px; padding: 12px 16px; border-radius: var(--radius); background: var(--red-soft); color: #ffd0d0; font-size: 14px; }
.banner.trial { background: var(--mint-soft); color: var(--mint); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.banner .btn { padding: 8px 14px; }
.more-settings { display: block; }
.more-settings summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.more-settings summary::-webkit-details-marker { display: none; }
.grid-form { display: grid; gap: 8px; margin-top: 10px; }
.grid-form label { display: grid; gap: 4px; }
.grid-form select { min-height: 44px; }

/* ---------- loading feedback ---------- */
.loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; background: var(--mint); box-shadow: 0 0 10px var(--mint); opacity: 0; transition: opacity .2s; }
body.loading .loadbar { opacity: 1; width: 35%; animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.btn.busy, button.busy { position: relative; pointer-events: none; opacity: .85; }
.btn.busy::after, button.busy::after { content: ""; width: 16px; height: 16px; margin-inline-start: 8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; vertical-align: -3px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, .55); animation: fade .2s; }
.busy-card { display: grid; justify-items: center; gap: 6px; padding: 22px 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.busy-card img { width: 90px; animation: bob 1.2s ease-in-out infinite; }
.busy-card p { margin: 0; font-weight: 600; }
.notice { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; text-align: start; background: var(--mint-soft); color: var(--mint); width: 100%; }
.notice.warn { background: var(--red-soft); color: #ffd0d0; }
.login-card .notice { margin: 0; }
@media (max-width: 520px) {
  .sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .btn-row .btn { flex: 1 1 auto; }
  .banner { margin: 8px 12px 0; }
  .grid-form input, .grid-form select { font-size: 16px; } /* no iPhone zoom on focus */
}
.check { display: flex; gap: 10px; align-items: flex-start; text-align: start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--mint); flex: none; }
.check a, a.link { color: var(--mint); }
.sub-price { margin: 4px 0 0; font-size: 18px; }
.sub-points { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }

/* ---------- Settings screen ---------- */
.settings { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); animation: fade .15s; }
.settings.hidden { display: none; }
body.settings-open { overflow: hidden; }
.set-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.set-head h2 { flex: 1; margin: 0; font-size: 18px; }
.set-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; max-width: 1100px; width: 100%; margin: 0 auto; }
.set-nav { overflow-y: auto; padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); border-inline-end: 1px solid var(--line); display: grid; align-content: start; gap: 4px; -webkit-overflow-scrolling: touch; }
.set-panes { overflow-y: auto; padding: 22px 28px calc(32px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.set-group { margin: 14px 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; width: 100%; }
.set-item:hover { background: var(--surface); }
.set-item.active { background: var(--mint-soft); }
.set-item > i[data-icon] { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--mint); }
.set-item > i[data-icon] svg { width: 18px; height: 18px; }
.set-item > span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-item b { font-weight: 600; }
.set-item small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: transparent; }
.set-item .dot.ok { background: var(--mint); }
.set-item .dot.todo { background: #ffb547; box-shadow: 0 0 0 3px rgba(255, 181, 71, .18); }
.set-item::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; opacity: .7; }
.set-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 18px 8px 0; margin-top: 10px; border-top: 1px solid var(--line); }
.set-links .link, .set-links button.link { all: unset; cursor: pointer; color: var(--muted); font-size: 14px; }
.set-links .link:hover { color: var(--mint); }
.set-start { padding: 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(3, 251, 200, .10), rgba(3, 251, 200, .02)); border: 1px solid rgba(3, 251, 200, .25); margin-bottom: 6px; }
.set-start.hidden { display: none; }
.set-start-top { display: flex; justify-content: space-between; align-items: baseline; }
.set-progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); margin: 10px 0; overflow: hidden; }
.set-progress span { display: block; height: 100%; background: var(--mint); border-radius: 6px; transition: width .3s; }
.set-start ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.set-start li button { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; width: 100%; }
.set-start li .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--muted); color: var(--muted); flex: none; }
.set-start li.done .n { background: var(--mint); border-color: var(--mint); color: #04201a; }
.set-start li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.set-pane { display: none; max-width: 640px; gap: 16px; }
.set-pane.active { display: grid; animation: fade .15s; }
.pane-title { display: flex; gap: 14px; align-items: flex-start; }
.pane-title h3 { margin: 2px 0 4px; font-size: 22px; }
.pane-title p { margin: 0; }
.pane-card { display: grid; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.pane-card p { margin: 0; }
.pane-card.hidden { display: none; }
.danger-zone { border-color: rgba(255, 90, 90, .35); }
.row-title { display: flex; gap: 10px; align-items: center; }
.choice { display: grid; gap: 10px; }
.choice-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.choice-opt:has(input:checked) { border-color: var(--mint); background: var(--mint-soft); }
.choice-opt input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--mint); flex: none; }
.choice-opt span { display: grid; gap: 3px; }
.choice-opt small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.plan-status { margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.set-pane .accounts { margin: 0; }
#setBack { visibility: hidden; }
@media (max-width: 820px) {
  .set-body { grid-template-columns: 1fr; }
  .set-nav { border: 0; }
  .set-panes { display: none; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); }
  .settings.in-pane .set-nav { display: none; }
  .settings.in-pane .set-panes { display: block; }
  .settings.in-pane #setBack { visibility: visible; }
  .set-item.active { background: transparent; }
  .pane-title h3 { font-size: 20px; }
  .set-pane .btn-row .btn, .set-pane > .btn { width: 100%; justify-content: center; }
}
@media (max-width: 820px) { .pane-title h3 { display: none; } .pane-title p { font-size: 14px; } }
