/* Tambira Command Centre: calm, Apple-like. Tokens first; components use tokens only. */
:root {
  --bg: #F2F2F7; --surface: #FFFFFF; --surface-2: #F7F7FA; --text: #1C1C1E; --text-2: #5C5C62; --text-3: #8A8A90;
  --line: rgba(60,60,67,.18); --accent: #1B2A4A; --on-accent: #FFFFFF; --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --ok: #1F8A4C; --warn: #B26A00; --bad: #C62828;
  --radius: 16px; --radius-sm: 12px; --tab-h: 56px; --top-h: 52px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --text: #F5F5F7; --text-2: #B4B4BA; --text-3: #8E8E93;
    --line: rgba(235,235,245,.18); --on-accent: #0B0B0C; --ok: #4CD27F; --warn: #F2B24C; --bad: #FF6B6B; }
}
/* Venture accents (dark mode uses lighter tints for contrast >= 4.5:1 on dark surfaces) */
[data-venture="TDA"] { --accent: #1B2A4A; } [data-venture="FFA"] { --accent: #0B5B35; } [data-venture="BEY"] { --accent: #073A4E; }
[data-venture="AGR"] { --accent: #8A5A12; } [data-venture="GDO"] { --accent: #6B3FA0; } [data-venture="DVG"] { --accent: #2F4FA8; }
[data-venture="TGS"] { --accent: #9A7410; } [data-venture="PRS"] { --accent: #475569; }
@media (prefers-color-scheme: dark) {
  [data-venture="TDA"] { --accent: #8FB0F0; } [data-venture="FFA"] { --accent: #5CC98C; } [data-venture="BEY"] { --accent: #5FC0E0; }
  [data-venture="AGR"] { --accent: #E2B25C; } [data-venture="GDO"] { --accent: #C3A0F0; } [data-venture="DVG"] { --accent: #9DB4F5; }
  [data-venture="TGS"] { --accent: #E6C75A; } [data-venture="PRS"] { --accent: #A9B6C8; }
  :root:not([data-venture]) { --accent: #8FB0F0; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 6px) 16px 6px; min-height: calc(var(--top-h) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.venture-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: 0; border-radius: 22px; background: var(--surface); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; }
main { flex: 1; padding: 4px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); max-width: 720px; width: 100%; margin: 0 auto; }
h1.large { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin: 8px 0 4px; font-weight: 700; }
.sub { color: var(--text-2); margin: 0 0 20px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 4px); border-top: .5px solid var(--line);
  background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 500; text-decoration: none; }
.tab[aria-current="page"] { color: var(--accent); }
.tab svg { transition: transform .18s var(--ease); }
.tab[aria-current="page"] svg { transform: scale(1.06); }

/* sheet (venture switcher) */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); animation: fade .18s var(--ease); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 720px; margin: 0 auto; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 12px); max-height: 80dvh; overflow: auto; animation: rise .22s var(--ease); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 8px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px; border: 0; background: none; text-align: left; border-radius: var(--radius-sm); }
.row:active { background: var(--surface-2); }
.row .grow { flex: 1; }
.row .check { color: var(--accent); }
@keyframes fade { from { opacity: 0 } } @keyframes rise { from { transform: translateY(24px); opacity: 0 } }

/* sign in */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 24px calc(env(safe-area-inset-bottom) + 24px); max-width: 420px; margin: 0 auto; }
.login img.brand { height: 48px; width: auto; border-radius: 12px; background: #fff; padding: 10px 14px; box-sizing: content-box; align-self: flex-start; margin-bottom: 22px; }
.login h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 6px; }
.login p { color: var(--text-2); margin: 0 0 22px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 6px 4px; }
.field input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 17px; }
.field input.code { text-align: center; letter-spacing: .5em; font-size: 24px; font-variant-numeric: tabular-nums; }
.btn { width: 100%; min-height: 52px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px; transition: transform .12s var(--ease), opacity .12s; }
.btn:active { transform: scale(.985); } .btn[disabled] { opacity: .55; }
.btn.ghost { background: none; color: var(--accent); margin-top: 6px; }
.msg { min-height: 22px; margin: 4px 4px 12px; font-size: 14px; color: var(--text-2); } .msg.err { color: var(--bad); }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sh 1.2s linear infinite; border-radius: var(--radius); height: 72px; margin-bottom: 12px; }
@keyframes sh { to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media (min-width: 900px) { main { padding-top: 16px; } }

/* ---------- Home ---------- */
h2.section { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 22px 4px 8px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; }
.sec-row h2.section { margin-right: auto; }
.muted { color: var(--text-2); font-size: 14px; } .over { color: var(--bad); font-weight: 500; }
.grow { flex: 1; min-width: 0; }
.card.empty p { color: var(--text-3); }
.card.timer { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.dot.live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35 } }
.item .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.item .proj { margin-bottom: 4px; }
.sumtext { color: var(--text) !important; font-size: 16px !important; line-height: 1.4; margin: 2px 0 10px !important; overflow-wrap: anywhere; }
pre.preview { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 260px; overflow: auto; }
details { margin: 0 0 10px; } details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }
.linkrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: none; }
.warnline { color: var(--warn) !important; font-size: 14px !important; margin: 4px 0 8px !important; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { width: auto; flex: 1 1 auto; min-height: 44px; padding: 0 16px; font-size: 16px; }
.btn.ghost-b { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.card.list { padding: 4px 16px; }
.li { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: .5px solid var(--line); padding: 8px 0; }
.li:last-child { border-bottom: 0; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text-3); background: none; flex: none; position: relative; }
.tick::after { content: ''; position: absolute; inset: -8px; } /* 44px touch area */
.tick:active { background: var(--accent-soft); border-color: var(--accent); }
.snooze { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--accent); font-weight: 600; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--accent); display: grid; place-items: center; }
.addrow input { flex: 1; min-height: 44px; border: 0; background: none; font-size: 16px; outline: none; }
.addrow input::placeholder { color: var(--text-3); }
.warn { color: var(--warn); }
textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; resize: vertical; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); z-index: 60; max-width: 520px; margin: 0 auto; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-size: 15px; animation: rise .2s var(--ease); }
.toast.bad { background: var(--bad); color: #fff; }

.sumtext.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.li[hidden] { display: none; }
.more { width: 100%; min-height: 48px; border: 0; background: none; color: var(--accent); font-weight: 600; }

/* ---------- Projects ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search input { width: 100%; min-height: 48px; padding: 0 16px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 17px; margin: 4px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 15px; }
.fchip b { font-weight: 600; opacity: .7; margin-left: 2px; }
.fchip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.proj-card { display: block; text-decoration: none; color: inherit; } .proj-card h3 { font-size: 17px; line-height: 1.3; margin: 6px 0 4px; letter-spacing: -.01em; }
.proj-card:active { background: var(--surface-2); }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--text-3) 18%, transparent); color: var(--text-2); white-space: nowrap; }
.st.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); } .st.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.st.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); } .st.info { background: var(--accent-soft); color: var(--accent); }
.prog { display: flex; align-items: center; gap: 10px; margin-top: 8px; } .prog .bar { flex: 1; }
.bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; } .bar i.bad { background: var(--bad); }
.flags { display: flex; gap: 8px; margin-top: 8px; } .flag { font-size: 13px; font-weight: 600; } .flag.warn { color: var(--warn); } .flag.bad { color: var(--bad); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: none; margin-left: -4px; }
h1.large.sm { font-size: 26px; margin: 6px 0 2px; }
.phead { margin-bottom: 12px; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow-x: auto; margin: 4px 0 14px; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.sm { margin: 0; display: inline-flex; } .toolrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.facts { display: grid; gap: 10px; } .facts div { display: flex; justify-content: space-between; gap: 16px; } .facts span { color: var(--text-2); font-size: 14px; } .facts b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.taskrow { border: 0; background: none; text-align: left; width: 100%; border-bottom: .5px solid var(--line); } .taskrow:last-child { border-bottom: 0; }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--text-3); } .sdot.ok { background: var(--ok); } .sdot.warn { background: var(--warn); } .sdot.bad { background: var(--bad); } .sdot.info { background: var(--accent); }
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; }
.col { flex: 0 0 82%; max-width: 340px; scroll-snap-align: start; background: color-mix(in srgb, var(--text) 5%, transparent); border-radius: var(--radius); padding: 12px; }
.col h3 { font-size: 14px; margin: 0 0 8px; color: var(--text-2); } .col h3 b { opacity: .7; }
.tcard { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: var(--surface); border: 0; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; min-height: 44px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; } .stats div { display: flex; flex-direction: column; } .stats b { font-size: 20px; letter-spacing: -.01em; } .stats span { color: var(--text-2); font-size: 13px; }
.pad { padding: 0 4px; } .pre-p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 4px 8px; }
.proj-card .meta, .phead .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.proj-card .meta { justify-content: space-between; }

/* ---------- Time ---------- */
.timerbig { text-align: center; } .timerbig .meta { display: flex; justify-content: space-between; align-items: center; text-align: left; }
.elapsed { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.amt { display: flex; flex-direction: column; align-items: flex-end; } .amt b { font-weight: 600; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 4px 12px; } .check input { width: 22px; height: 22px; accent-color: var(--accent); }
select, .field input[type="date"], .field input[type="number"] { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 17px; }
.row.picker { border: 1px solid var(--line); margin-bottom: 14px; }
.btn[disabled] { opacity: .5; }

/* ---------- Money ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; } .grid2 .card { margin: 0; }
.card.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; } .card.stat b { font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.25; }

/* ---------- Texts ---------- */
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.smsamt b { font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; } .smsamt b.in { color: var(--ok); } .smsamt b.out { color: var(--text); }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
