/* Theodore web app - design system v0.1 (Geist, ink-blue accent, WhatsApp green only for
   "came in on WhatsApp"). Light tokens on :root; dark follows the OS unless the person picks
   a theme (data-theme on <html>). Under 760px: tab bar, record cards, full-width panels. */
:root {
  --bg: #F4F5F7; --sf: #FFFFFF; --sf2: #F7F8FA; --sf3: #EEF0F3;
  --ink: #12161C; --mut: #536071; --line: #E0E4EA; --line2: #C7CED8;
  --acc: #2440C8; --acc-ink: #FFFFFF; --acc-soft: #E9EDFD;
  --good: #126B40; --good-bg: #E2F3E9; --att: #8A4A00; --att-bg: #FCEED6;
  --bad: #B42318; --bad-bg: #FDE7E4; --neu: #465060; --neu-bg: #ECEFF3;
  --wa: #E4F5EA; --wa-ink: #0E3B22;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 30px rgba(16,24,40,.10);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1217; --sf: #161A21; --sf2: #1B2029; --sf3: #222833;
    --ink: #E8EBF0; --mut: #9AA4B2; --line: #272D37; --line2: #39414E;
    --acc: #8EA0FF; --acc-ink: #0B0F1A; --acc-soft: #1F2752;
    --good: #63D497; --good-bg: #11301F; --att: #F3B655; --att-bg: #3A2A0C;
    --bad: #FF9289; --bad-bg: #3D1714; --neu: #B8C0CC; --neu-bg: #262C36;
    --wa: #15291D; --wa-ink: #D3F2DE;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1217; --sf: #161A21; --sf2: #1B2029; --sf3: #222833;
  --ink: #E8EBF0; --mut: #9AA4B2; --line: #272D37; --line2: #39414E;
  --acc: #8EA0FF; --acc-ink: #0B0F1A; --acc-soft: #1F2752;
  --good: #63D497; --good-bg: #11301F; --att: #F3B655; --att-bg: #3A2A0C;
  --bad: #FF9289; --bad-bg: #3D1714; --neu: #B8C0CC; --neu-bg: #262C36;
  --wa: #15291D; --wa-ink: #D3F2DE;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--acc); }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num, .n { font-variant-numeric: tabular-nums; }
.sr { position: absolute; left: -9999px; }
.strong { font-weight: 600; }
.mut { color: var(--mut); }
.sm { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* shell */
.app { display: flex; height: 100vh; height: 100dvh; }
.side { width: 248px; flex: none; background: var(--sf); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; }
.wordmark { font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.bizchip { margin: 0 12px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; display: flex; gap: 10px; align-items: center; background: var(--sf2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; border: 0; }
.ngroup { padding: 6px 12px; }
.nlabel { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); padding: 10px 10px 4px; }
.nitem { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; min-height: 38px; text-decoration: none; color: var(--ink); }
.nitem:hover { background: var(--sf3); color: var(--ink); }
.nitem.on { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.ncount { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--att-bg); color: var(--att); font-weight: 600; }
.sidefoot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: var(--sf); }
.top .crumb { font-size: 13px; color: var(--mut); }
.mtop { display: none; }
.content { flex: 1; overflow-y: auto; padding: 28px 32px 48px; }
.inner { max-width: 1180px; margin: 0 auto; }
.tabbar { display: none; }

/* type */
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.015em; margin: 0; font-weight: 650; text-wrap: balance; }
.h2 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.h3 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
.sub { color: var(--mut); margin: 6px 0 0; max-width: 680px; }
.eyebrow { font-size: 12.5px; color: var(--mut); margin: 0 0 4px; letter-spacing: .02em; }
.ph { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tagline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--sf3); color: var(--mut); font-weight: 500; vertical-align: middle; margin-left: 8px; font-family: var(--mono); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line2); background: var(--sf); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--sf3); color: var(--ink); }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger.arm { background: var(--bad); color: #fff; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.lnk { background: none; border: 0; padding: 4px 0; color: var(--acc); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 10px; cursor: pointer; min-height: 32px; color: var(--mut); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--acc-soft); color: var(--acc); font-weight: 600; }

/* cards & tiles */
.card { background: var(--sf); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card + .card { margin-top: 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tiles.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--sf); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile .big { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .lbl { color: var(--mut); font-size: 13px; margin-top: 4px; }
.tile.att { border-color: var(--att); background: var(--att-bg); }
.tile.att .big { color: var(--att); }
.tile.bad { border-color: var(--bad); background: var(--bad-bg); }
.tile.bad .big { color: var(--bad); }
.attn { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.acard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; background: var(--sf); border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; min-height: 150px; }
.acard:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.acard .abig { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.acard .atext { color: var(--mut); font-size: 13.5px; }
.acard .alink { margin-top: auto; color: var(--acc); font-weight: 500; font-size: 13.5px; }
.acard.hot { border-color: var(--att); }
.acard.bad { border-color: var(--bad); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-good { background: var(--good-bg); color: var(--good); }
.b-att { background: var(--att-bg); color: var(--att); }
.b-neu { background: var(--neu-bg); color: var(--neu); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-acc { background: var(--acc-soft); color: var(--acc); }
.prov { display: inline-flex; align-items: center; gap: 5px; color: var(--mut); font-size: 13px; white-space: nowrap; }

/* tables */
.tblwrap { background: var(--sf); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--mut); font-size: 12.5px; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--sf2); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--sf2); }
.tbl tr.sel td { background: var(--acc-soft); }
.tbl tfoot td { font-weight: 600; background: var(--sf2); border-top: 1px solid var(--line); }
.rowlink { background: none; border: 0; padding: 0; font-weight: 600; cursor: pointer; color: var(--ink); text-align: left; }
.rowlink:hover { color: var(--acc); text-decoration: underline; }
.out { color: var(--att); font-weight: 600; }
.cards { display: none; flex-direction: column; gap: 10px; }
.rcard { display: block; width: 100%; text-align: left; background: var(--sf); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; color: var(--ink); }
.rc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rc-amt { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 16px; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }

/* forms */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .flabel { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .help { font-size: 12.5px; color: var(--mut); }
.inp, .field input, .field select, .field textarea { min-height: 40px; border: 1px solid var(--line2); border-radius: 9px; background: var(--sf); padding: 8px 11px; width: 100%; }
.field input[type="file"] { padding: 6px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: var(--acc); }
.field.grow { flex: 1 1 220px; }
.field.w140 { flex: 0 1 150px; }
.field.w200 { flex: 0 1 210px; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; color: var(--mut); margin: 4px 0 12px; }
.summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.formgrid .span2 { grid-column: 1 / -1; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; border-top: 1px solid var(--line); background: var(--sf2); }
.err { color: var(--bad); font-size: 13.5px; margin: 8px 0 0; font-weight: 500; }
.okmsg { color: var(--good); font-size: 13.5px; margin: 8px 0 0; font-weight: 500; }
.note { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; margin: 12px 0; }
.note.att { background: var(--att-bg); color: var(--att); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.neu { background: var(--sf3); color: var(--mut); }
.note.acc { background: var(--acc-soft); color: var(--ink); }
.banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.banner.att { background: var(--att-bg); color: var(--att); border: 1px solid var(--att); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }

/* states */
.state { background: var(--sf); border: 1px dashed var(--line2); border-radius: 14px; padding: 36px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.state .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--wa); color: var(--good); display: grid; place-items: center; }
.state .ic.bad { background: var(--bad-bg); color: var(--bad); }
.say { display: inline-block; background: var(--wa); color: var(--wa-ink); padding: 8px 12px; border-radius: 12px 12px 12px 4px; font-size: 14px; max-width: 460px; }
.skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--sf3), var(--sf2), var(--sf3)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skrow { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; gap: 18px; padding: 16px; border-bottom: 1px solid var(--line); }

/* bars & feed */
.bars { display: flex; flex-direction: column; gap: 12px; }
.barrow { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; font-size: 13.5px; }
.bartrack { height: 10px; border-radius: 6px; background: var(--sf3); overflow: hidden; }
.barfill { display: block; height: 100%; border-radius: 6px; background: var(--acc); }
.barfill.good { background: var(--good); }
.bigpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.bigpair .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sechead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }

/* chat */
.chat { background: var(--sf); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.day { align-self: center; font-size: 12px; color: var(--mut); background: var(--sf3); padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; flex-direction: column; max-width: 72%; gap: 4px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.th { align-self: flex-start; }
.who { font-size: 12px; color: var(--mut); font-weight: 500; }
.bub { padding: 10px 13px; border-radius: 14px; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.me .bub { background: var(--wa); color: var(--wa-ink); border-bottom-right-radius: 4px; }
.th .bub { background: var(--sf3); border-bottom-left-radius: 4px; }
.bub .kind { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; opacity: .8; margin-bottom: 4px; }
.tapped { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; background: var(--sf); }
.pdfbub { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sf); }
.pdfic { width: 34px; height: 40px; border-radius: 5px; background: var(--bad-bg); color: var(--bad); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.rcardw { border: 1px solid var(--line); border-radius: 14px; background: var(--sf); overflow: hidden; min-width: 280px; }
.rcardw .rt { padding: 11px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.rcardw .rb { padding: 10px 14px; font-size: 14px; white-space: pre-line; }
.rcardw .rbtns { display: flex; border-top: 1px solid var(--line); }
.rcardw .rbtns span { flex: 1; text-align: center; padding: 9px; color: var(--acc); font-weight: 500; font-size: 13.5px; }
.rcardw .rbtns span + span { border-left: 1px solid var(--line); }
.trace { font-size: 12.5px; color: var(--mut); }
.trace summary { cursor: pointer; }
.tracelist { list-style: none; margin: 6px 0 0; padding: 8px 10px; border-left: 2px solid var(--line2); display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 12px; }

/* panel, sheet, toast */
.scrim { position: fixed; inset: 0; background: rgba(8,10,14,.45); z-index: 20; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); z-index: 21; display: flex; flex-direction: column; box-shadow: var(--shadow); border-left: 1px solid var(--line); }
.panel.wide { width: min(680px, 100%); }
.panelhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--sf); }
.panelbody { flex: 1; overflow-y: auto; padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 16px; }
.panelfoot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--sf); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; margin: 0; }
.facts dt { color: var(--mut); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.totals { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; font-size: 14px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .tt { font-weight: 650; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.fig3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fig3 > div { background: var(--sf); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fig3 .v { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 16px; }
.section { background: var(--sf); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.slipbox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.slipimg { width: 200px; max-width: 100%; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.18); background: #fff; }
.drop { flex: 1; min-width: 200px; border: 1.5px dashed var(--line2); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; align-items: flex-start; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 85%; overflow-y: auto; background: var(--sf); border-radius: 20px 20px 0 0; z-index: 31; padding: 8px 8px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheethandle { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); margin: 6px auto 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; background: #12161C; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: #63D497; flex: none; }
.toast.bad .dot { background: #FF9289; }

/* settings */
.svc { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; }
.switch { width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--line2); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--acc); }
.switch.on::after { left: 21px; }
.stabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.stab { background: none; border: 0; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--mut); white-space: nowrap; font-weight: 500; }
.stab.on { color: var(--ink); border-bottom-color: var(--acc); }
.layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lay { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--sf); text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.lay.on { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.lay[disabled] { opacity: .55; cursor: not-allowed; }
.mini { height: 90px; border-radius: 6px; background: #fff; border: 1px solid #E3E3E3; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.mini i { display: block; height: 5px; border-radius: 2px; background: #DADDE2; }
.mini .hd { display: block; height: 18px; background: #2440C8; border-radius: 3px; }
.mini .hd.cl { background: transparent; border-bottom: 2px solid #222; border-radius: 0; }
.mini .hd.own { background: #C4741D; }
.logo-prev { width: 120px; height: 56px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; background: #fff; color: #888; font-size: 13px; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.progress { height: 8px; border-radius: 5px; background: var(--sf3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 40%; background: var(--acc); border-radius: 5px; animation: prog 1.6s ease-in-out infinite; }
@keyframes prog { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* auth */
.authwrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.authcard { width: 100%; max-width: 420px; background: var(--sf); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.authlinks { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.authfoot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; text-align: center; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--acc); }

/* guide article */
.guide { min-height: 100vh; background: var(--bg); }
.gtop { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--sf); }
.article { max-width: 720px; margin: 0 auto; padding: 40px 24px 64px; font-size: 16px; line-height: 1.65; }
.article h1 { font-size: 34px; margin-bottom: 8px; }
.article h2 { font-size: 21px; margin: 36px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.article h3 { font-size: 17px; margin: 24px 0 6px; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 4px 0; }
.article code { background: var(--sf3); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 13px; }
.article pre { background: var(--sf); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; }
.article blockquote { margin: 10px 0; padding: 8px 12px; background: var(--wa); color: var(--wa-ink); border-radius: 12px 12px 12px 4px; display: inline-block; }
.article blockquote p { margin: 2px 0; }
.article table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* phone */
@media (max-width: 760px) {
  .side, .top { display: none; }
  .mtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); background: var(--sf); border-bottom: 1px solid var(--line); }
  .mtitle { font-weight: 650; font-size: 16px; }
  .content { padding: 18px 16px 28px; }
  .tabbar { display: flex; background: var(--sf); border-top: 1px solid var(--line); padding: 4px 4px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 8px 2px; font-size: 11px; color: var(--mut); cursor: pointer; min-height: 52px; border-radius: 10px; }
  .tabbar button.on { color: var(--acc); font-weight: 600; }
  h1 { font-size: 22px; }
  .ph { margin-bottom: 16px; }
  .desk { display: none; }
  .cards { display: flex; }
  .tiles, .tiles.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .big { font-size: 20px; }
  .attn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acard { min-height: 130px; padding: 14px; }
  .acard .abig { font-size: 19px; }
  .g2, .formgrid, .layouts { grid-template-columns: minmax(0, 1fr); }
  .formgrid .span2 { grid-column: auto; }
  .barrow { grid-template-columns: 100px 1fr 90px; font-size: 12.5px; }
  .msg { max-width: 88%; }
  .rcardw { min-width: 0; }
  .panel, .panel.wide { width: 100%; border-left: 0; }
  .facts { grid-template-columns: 110px 1fr; }
  .fig3 { grid-template-columns: minmax(0, 1fr); }
  .field.w140, .field.w200, .field.grow { flex: 1 1 140px; }
  .authcard { padding: 24px; border-radius: 16px; }
}

/* Continue with Facebook */
.author { display: flex; align-items: center; gap: 10px; color: var(--mut, #888); font-size: 12px; }
.author::before, .author::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn.fb:hover { background: #166fe5; color: #fff; }
