/* TabGang app styles. Brand tokens: /workspace/tabgang-brand/tokens/tokens.css */
@font-face { font-family: "Inter"; src: url(/fonts/Inter-Regular.woff2?v=1718dbb752) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/Inter-SemiBold.woff2?v=f9e21d064d) format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/Inter-Bold.woff2?v=127c079d8c) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/Bricolage-Bold.woff2?v=fd58522330) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/Bricolage-ExtraBold.woff2?v=ed74e97e08) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light dark;
  --green: #0A7C66; --ink: #10231F; --cream: #FFF8EE; --coral: #FF6B4A; --lime: #2BB389; --yellow: #FFC845;
  --bg: var(--cream); --fg: var(--ink); --muted: #5B6B66; --line: #E8DFCF; --card: #FFFFFF; --soft: #F5EDE0;
  --accent: var(--green); --on-accent: #FFFFFF; --turn: #A8321F; --turn-bg: #FFE6DF; --get: #0A6B58; --get-bg: #DDF4EC;
  --pend-bg: #FFF1CC; --danger: #B3261E; --focus: #0A7C66; --bubble-mine: #E3F3EE;
  --display: "Bricolage Grotesque", system-ui, sans-serif; --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --pill: 999px; --shadow: 0 1px 2px rgba(16, 35, 31, .06), 0 4px 16px rgba(16, 35, 31, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10231F; --fg: #FFF8EE; --muted: #B5C4BF; --line: #2B4842; --card: #17302A; --soft: #1D3933;
    --accent: #2BB389; --on-accent: #10231F; --turn: #FF9478; --turn-bg: #3A2620; --get: #5FD3AD; --get-bg: #163F34;
    --pend-bg: #3B3420; --danger: #FF8A80; --focus: #FFC845; --bubble-mine: #1B4038; --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-weight: 800; font-size: clamp(2rem, 7vw, 3rem); }
h2 { font-weight: 700; font-size: 1.5rem; }
h3 { font-weight: 700; font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main:focus, section:focus, [tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--pill); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.doc-main { overflow-wrap: break-word; hyphens: auto; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.icon { width: 22px; height: 22px; flex: none; fill: currentColor; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: var(--pill); border: 2px solid transparent; font: 700 1rem/1.2 var(--text); text-decoration: none; cursor: pointer; transition: transform .08s ease, background-color .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-wa { background: #0E7A3F; color: #fff; }
.btn-danger { background: var(--danger); color: var(--bg); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; margin-right: auto; }
.btn-link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 12px 8px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: .95rem; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--accent); font: 600 .95rem/1 var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn .icon { width: 18px; height: 18px; }
label, legend { display: block; font-weight: 600; margin-bottom: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input, select, textarea { font: 400 1rem/1.4 var(--text); color: var(--fg); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%; min-height: 48px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--focus); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
.field { margin-bottom: 18px; }
.hint, .sub { color: var(--muted); font-size: .9rem; }
.field-error, .field-err, .form-error { color: var(--danger); font-weight: 600; font-size: .95rem; margin: 6px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.badge { display: inline-block; background: var(--yellow); color: var(--ink); font: 700 .75rem/1 var(--text); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--pill); }

/* Site header / footer */
.site-head { padding: 14px 0; }
.head-row, .foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; min-height: 44px; align-items: center; }
.lang { display: flex; align-items: center; gap: 8px; }
.lang label { margin: 0; font-weight: 500; font-size: .9rem; }
.lang select { width: auto; min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; color: var(--muted); font-size: .95rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 0; }
.foot-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--fg); }
.foot-tag { margin: 8px 0 0; }

/* Landing */
.hero { display: grid; gap: 28px; padding-top: 16px; padding-bottom: 32px; }
@media (min-width: 880px) { .hero { grid-template-columns: 1.05fr 1fr; align-items: start; padding-top: 48px; } }
.kicker { font: 700 .8rem/1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.lead { font-size: 1.15rem; line-height: 1.55; }
.note { color: var(--muted); font-weight: 600; }
.create-card { padding: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--soft); border-radius: var(--pill); padding-left: 14px; font-weight: 600; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: var(--fg); border-radius: var(--pill); cursor: pointer; }
.chip-x .icon { width: 16px; height: 16px; }
.add-row, .copy-row { display: flex; gap: 8px; }
.add-row input, .copy-row input { flex: 1; min-width: 0; }
.copy-row { flex-wrap: wrap; }
.copy-row input { flex: 1 1 100%; font-size: .95rem; }
.copy-row .btn { flex: 1 1 auto; }
.share h2 { font-size: 1.6rem; }
.share label { margin-top: 12px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.share-btns .btn { flex: 1 1 180px; }
.qr { margin: 8px 0 16px; display: flex; align-items: center; gap: 16px; }
.qr > div { width: 132px; height: 132px; background: #fff; padding: 6px; border-radius: 12px; flex: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr figcaption { color: var(--muted); font-size: .95rem; }
.admin-box { background: var(--pend-bg); border-radius: 12px; padding: 16px; margin: 16px 0; }
.admin-box h3 { font-size: 1.05rem; }
.share-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.how, .faq { padding-top: 32px; }
.steps { list-style: none; padding: 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.step-n { display: inline-flex; width: 36px; height: 36px; border-radius: var(--pill); background: var(--accent); color: var(--on-accent); align-items: center; justify-content: center; font: 800 1.1rem/1 var(--display); margin-bottom: 10px; }
.step p { color: var(--muted); margin: 0; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 44px; }
.faq-item p { color: var(--muted); }

/* Legal/doc */
.doc-main { max-width: 760px; padding-top: 8px; }
.doc-main h2 { font-size: 1.3rem; margin-top: 28px; }
.doc-main ul { padding-left: 1.2rem; }
.doc-main li { margin-bottom: 6px; }
.facts { list-style: none; padding: 0 !important; }
.center { text-align: center; padding-top: 18vh; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }

/* Trip */
.trip-page { padding-bottom: 120px; }
.trip-head { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 0; }
.trip-head-row { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; }
.trip-head-row.sub { min-height: 0; }
.brand-icon { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; }
.trip-title { flex: 1; min-width: 0; }
.trip-title h1 { font-size: 1.35rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-meta { margin: 0; color: var(--muted); font-size: .9rem; }
.who { background: none; border: 0; color: var(--fg); font: 500 .9rem/1.2 var(--text); padding: 6px 0; min-height: 44px; cursor: pointer; text-align: left; }
.who-change { color: var(--accent); text-decoration: underline; }
.tabs { display: flex; max-width: 720px; margin: 0 auto; }
.tabs [role="tab"] { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 6px 4px; overflow-wrap: break-word; hyphens: auto; line-height: 1.15; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; font-size: .95rem; font-family: var(--text); cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.conn-err { position: sticky; top: 0; margin: 0; background: var(--pend-bg); text-align: center; padding: 8px; font-weight: 600; }
#main { max-width: 720px; margin: 0 auto; padding: 16px; }
.loading { color: var(--muted); text-align: center; padding: 32px 0; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-radius: 12px; padding: 8px 8px 8px 16px; margin-bottom: 12px; font-weight: 700; }
.status p { margin: 0; }
.status.turn { background: var(--turn-bg); color: var(--turn); }
.status.get { background: var(--get-bg); color: var(--get); }
.status.square { background: var(--soft); }
.status .link-btn { color: inherit; }
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.day-h { font: 700 .8rem/1 var(--text); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; margin: 12px 0 2px; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 14px 6px; max-width: 92%; align-self: flex-start; box-shadow: var(--shadow); }
.bubble.mine .link-btn { color: var(--get); }
.bubble.mine { align-self: flex-end; background: var(--bubble-mine); border-radius: 18px 18px 6px 18px; }
.b-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.b-desc { font: 700 1rem/1.3 var(--text); margin: 0; overflow-wrap: anywhere; }
.b-amt { font: 800 1.2rem/1 var(--display); margin: 0; white-space: nowrap; }
.b-line { margin: 4px 0 0; font-weight: 600; }
.b-split { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.b-edit { margin-top: 2px; }
.empty { text-align: center; padding: 40px 12px; }
.empty-t { font: 700 1.2rem/1.3 var(--display); }
.empty-h { color: var(--muted); }
.composer-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.composer { display: flex; align-items: flex-end; gap: 6px; max-width: 720px; margin: 0 auto; }
.composer textarea { resize: none; border-radius: 24px; min-height: 48px; max-height: 140px; padding: 12px 16px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: var(--pill); border: 0; background: var(--soft); color: var(--fg); cursor: pointer; }
.icon-btn.send { background: var(--accent); color: var(--on-accent); }
.icon-btn.rec { background: var(--coral); color: var(--ink); }
.icon-btn:disabled { opacity: .55; }
.busy { max-width: 720px; margin: 0 auto; font-weight: 600; font-size: .9rem; color: var(--muted); }
.busy:empty { display: none; }
.is-busy .busy { padding-bottom: 6px; }
.locked-note { max-width: 720px; margin: 4px auto; text-align: center; color: var(--muted); font-weight: 600; }
.banner.closed { background: var(--get-bg); color: var(--get); border-radius: 12px; padding: 12px 16px; font-weight: 700; margin-bottom: 16px; }
.banner p { margin: 0; }
.settle-list, .bal-list, .rank { list-style: none; padding: 0; margin: 0; }
.settle { border-top: 1px solid var(--line); padding: 12px 0; }
.settle:first-child { border-top: 0; }
.settle.me { background: var(--soft); border-radius: 12px; padding: 12px; }
.settle-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.settle-main .icon { width: 18px; height: 18px; color: var(--muted); }
.settle-main .amt { margin-left: auto; font: 800 1.1rem/1 var(--display); }
.settle-state { margin: 4px 0; color: var(--muted); font-size: .9rem; }
.settle.done .settle-state { color: var(--get); font-weight: 600; }
.settle .hint { margin: 4px 0 8px; }
progress { width: 100%; height: 10px; accent-color: var(--accent); margin-bottom: 12px; }
.progress-t { font-weight: 700; }
.bal-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.bal-row:first-child { border-top: 0; }
.bal-row .name { font-weight: 600; }
.bal-row.pos .val { color: var(--get); font-weight: 700; }
.bal-row.neg .val { color: var(--turn); font-weight: 700; }
.bal-row.zero .val { color: var(--muted); }
.card.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.rank-row { display: flex; gap: 12px; padding: 10px 0; }
.rank-pos { font: 800 1.2rem/1.4 var(--display); color: var(--muted); width: 24px; flex: none; text-align: center; }
.rank-body { flex: 1; min-width: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 4px; font-weight: 600; }
.rank-top .amt { font-weight: 700; }
.bar { height: 8px; background: var(--soft); border-radius: var(--pill); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--lime); border-radius: var(--pill); width: 0; }
.rank-sub { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }

/* Dialogs */
.dialog { border: 0; border-radius: 20px; padding: 24px; width: min(92vw, 480px); max-height: 88vh; overflow: auto; background: var(--card); color: var(--fg); box-shadow: 0 12px 48px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(16, 35, 31, .55); }
.dialog h2 { font-size: 1.4rem; }
.dialog.sheet { width: min(100vw, 560px); }
@media (max-width: 560px) {
  .dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.picker-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.picker-list .btn { width: 100%; }
.pick.current { border-color: var(--accent); }
.privacy-note { font-size: .85rem; color: var(--muted); margin: 0; }
.heard { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-style: italic; }
.warnings { background: var(--pend-bg); border-radius: 12px; padding: 10px 12px 10px 30px; margin: 0 0 16px; font-size: .95rem; }
.checks { list-style: none; padding: 0; margin: 4px 0; }
.checks li { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); }
.checks li > label { flex: 1; margin: 0; font-weight: 500; padding: 12px 0; cursor: pointer; }
.custom-amt { width: 110px; }
.custom-amt input { min-height: 44px; padding: 8px 10px; text-align: right; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row label { margin: 0; font-weight: 500; padding: 10px 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: min(92vw, 480px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { padding: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .btn, .icon-btn, .chip, .status, .badge { border: 2px solid ButtonText; } .tabs [role="tab"][aria-selected="true"] { border-bottom-color: Highlight; text-decoration: underline; text-decoration-thickness: 3px; } }
