:root {
  --bg: #0b0b0d;
  --s1: #141418;
  --s2: #1b1b21;
  --s3: #24242c;
  --line: #2a2a33;
  --ink: #f4f4f6;
  --muted: #9a9aa6;
  --dim: #6c6c78;
  --accent: #ff5b2e;
  --accent-ink: #120700;
  --ok: #3ec7a0;
  --warn: #ffc23d;
  --bad: #ff4f5e;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 68px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
h1, h2, h3, .disp { font-family: "Space Grotesk", Inter, sans-serif; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- splash / login ---------- */
.splash { min-height: 100dvh; display: grid; place-items: center; }
.logo-mark { font: 700 34px "Space Grotesk", Inter, system-ui, sans-serif; letter-spacing: .12em; }
.logo-mark::after { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-left: 6px; }
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(30px + var(--safe-t)) 22px 40px; max-width: 420px; margin: 0 auto; }
.auth .logo-mark { margin-bottom: 6px; }
.auth p.lead { color: var(--muted); margin: 0 0 28px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--s1); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--s3); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); }
.pin { letter-spacing: .3em; font: 600 22px "Space Grotesk" !important; text-align: center; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--s2); border-radius: 14px; padding: 12px 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 11px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #4a2026; background: transparent; }
.btn[disabled] { opacity: .5; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--s1); display: grid; place-items: center; font-size: 18px; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11,11,13,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: calc(12px + var(--safe-t)) 18px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #17171c; }
.ev-chip { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; }
.ev-chip small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.ev-chip b { display: block; font: 700 19px "Space Grotesk", Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-chip b::after { content: " ▾"; color: var(--dim); font-size: 13px; }
main { padding: 16px 18px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1200px; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(15,15,18,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid #1d1d23;
  padding: 6px 6px calc(6px + var(--safe-b)); }
.nav button { border: 0; background: none; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--ink); }
.nav button.on svg { color: var(--accent); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

/* ---------- common ---------- */
.card { background: var(--s1); border: 1px solid #1f1f26; border-radius: var(--r); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; gap: 10px; }
.sec-h h2 { font-size: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--s1); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--s3); color: var(--muted); }
.tag.req { background: #3a1a12; color: #ff9b7d; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 11px Inter; color: #0b0b0d; flex: none; }
.avs { display: inline-flex; } .avs .av { margin-left: -7px; box-shadow: 0 0 0 2px var(--s1); } .avs .av:first-child { margin-left: 0; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--r); background: linear-gradient(135deg, #2a140c, #1a1a20); border: 1px solid #3b2016; }
.banner .ic { font-size: 22px; }
.banner div { flex: 1; font-size: 14px; }
.banner b { display: block; font-size: 15px; }
.offline { background: #2b2410; color: var(--warn); font-size: 13px; padding: 8px 18px; text-align: center; }

/* ---------- home ---------- */
.hello { font: 600 26px "Space Grotesk", Inter, system-ui, sans-serif; margin: 4px 0 2px; }
.hero { padding: 18px; margin-top: 14px; position: relative; overflow: hidden; border: 1px solid #3b2016;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,91,46,.28), transparent 55%), var(--s1); }
.hero small { color: #ffb39c; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }
.hero h3 { font-size: 22px; margin: 6px 0 4px; }
.hero .when { font: 600 15px "Space Grotesk", Inter, system-ui, sans-serif; }
.count { font: 700 34px "Space Grotesk", Inter, system-ui, sans-serif; margin-top: 10px; }

/* ---------- slot list ---------- */
.day-h { font: 600 13px Inter; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 8px; }
.slot { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; padding: 14px 14px 14px 12px; margin-bottom: 8px; cursor: pointer; }
.slot .bar { border-radius: 4px; }
.slot .t { font: 600 14px "Space Grotesk", Inter, system-ui, sans-serif; color: var(--muted); }
.slot h4 { margin: 2px 0 4px; font: 600 16px "Space Grotesk", Inter, system-ui, sans-serif; }
.slot .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.slot.past { opacity: .5; }
.slot.now { border-color: var(--accent); }
.warn { color: var(--bad); font-weight: 600; font-size: 13px; }
.prog { font-size: 12.5px; color: var(--muted); }

/* ---------- planning grid ---------- */
.gridwrap { overflow: auto; border-radius: var(--r); max-height: calc(100dvh - 250px); border: 1px solid #1f1f26; background: var(--s1); }
.pgrid { display: grid; position: relative; min-width: 100%; }
.corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--s1); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.pcolh { position: sticky; top: 0; z-index: 3; background: var(--s1); border-bottom: 1px solid var(--line); border-left: 1px solid #1f1f26; padding: 10px; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13.5px; }
.pcolh small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.ptime { position: sticky; left: 0; z-index: 2; background: var(--s1); border-right: 1px solid var(--line); }
.ptime div { position: absolute; right: 6px; font-size: 11px; color: var(--dim); transform: translateY(-7px); }
.ptime div:first-child { transform: none; }
.pcol { position: relative; border-left: 1px solid #1f1f26; }
.hline { position: absolute; left: 0; right: 0; border-top: 1px solid #1f1f26; }
.hline.mid { border-top: 1px dashed #19191f; }
.nowline { position: absolute; left: 0; right: 0; border-top: 2px solid var(--accent); z-index: 1; pointer-events: none; }
.blk { position: absolute; z-index: 2; border-radius: 10px; padding: 6px 8px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 3px solid; }
.blk b { display: block; font-size: 12.5px; line-height: 1.25; }
.blk .tt { opacity: .75; font-size: 11px; }
.blk.conflict { box-shadow: inset 0 0 0 2px var(--bad); }
.blk.done { opacity: .45; }

/* ---------- prep ---------- */
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #1f1f26; }
.task:last-child { border-bottom: 0; }
.task.done .tt { text-decoration: line-through; color: var(--dim); }
.tt { font-weight: 600; }
.late { color: var(--bad); font-weight: 600; }
.check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); background: none; display: grid; place-items: center; flex: none; padding: 0; }
.check.on { background: var(--ok); border-color: var(--ok); color: #04140f; }
.progress { height: 6px; background: var(--s3); border-radius: 9px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* ---------- messages ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 70px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; background: var(--s2); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg .who { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.msg .at { font-size: 11px; opacity: .6; margin-top: 3px; text-align: right; }
.chat-day { text-align: center; font-size: 12px; color: var(--dim); margin: 12px 0 4px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 25; display: flex; gap: 8px; padding: 10px 14px;
  background: rgba(11,11,13,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid #17171c; }
.composer textarea { flex: 1; resize: none; height: 44px; max-height: 120px; background: var(--s1); border: 1px solid var(--line); border-radius: 22px; padding: 11px 16px; outline: none; font-size: 16px; }
.composer button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 18px; flex: none; }

/* ---------- team ---------- */
.member { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #1f1f26; }
.member:last-child { border-bottom: 0; }
.member .av { width: 42px; height: 42px; font-size: 14px; }
.member .info { flex: 1; min-width: 0; }
.member .info b { display: block; }
.member .info span { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 8px; }

/* ---------- sheet ---------- */
.ov { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.panel { background: var(--s1); width: min(640px, 100%); max-height: 92dvh; overflow: auto; border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); border: 1px solid #23232b; border-bottom: 0; animation: up .2s ease-out; }
.grab { width: 40px; height: 5px; background: var(--s3); border-radius: 3px; margin: 2px auto 14px; }
.panel h3 { font-size: 21px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 1px solid var(--line); background: var(--s2); border-radius: 999px; padding: 5px 12px 5px 5px; display: inline-flex; gap: 7px; align-items: center; font-weight: 600; font-size: 14px; }
.pick button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.types button { border: 1px solid var(--line); background: var(--s2); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.types button.on { color: var(--bg); }
.cl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cl-row input[type=text] { flex: 1; background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; font-size: 15px; }
.x { border: 0; background: none; color: var(--dim); font-size: 22px; padding: 0 6px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.detail-meta { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; color: var(--muted); }
.detail-meta b { color: var(--ink); font-weight: 600; }
.desc { white-space: pre-wrap; background: var(--s2); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.cl { list-style: none; padding: 0; margin: 0 0 14px; }
.cl li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #1f1f26; cursor: pointer; }
.cl li.ok span { text-decoration: line-through; color: var(--dim); }
.statuses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.statuses button { border: 1px solid var(--line); background: var(--s2); border-radius: 12px; padding: 9px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.statuses button.on { background: var(--ink); color: var(--bg); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--s1); box-shadow: 0 0 0 1px var(--line); }
.colors button.on { box-shadow: 0 0 0 2px var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: var(--s3); border: 0; position: relative; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 23px; }
.ev-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--s2); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.ev-list button.on { border-color: var(--accent); }
.ev-list small { display: block; color: var(--muted); }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 70px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; animation: up .2s; max-width: 90%; text-align: center; }

@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 900px) {
  .ov { align-items: center; }
  .panel { border-radius: 24px; border-bottom: 1px solid #23232b; }
  .grab { display: none; }
}

/* ================= v2 : accueil, infos, budget ================= */
.brand { font: 700 22px "Space Grotesk", Inter, system-ui, sans-serif; letter-spacing: .12em; }
.brand::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 5px; }
.back { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--s2); color: var(--ink); font-size: 26px; line-height: 1; display: grid; place-items: center; flex: none; padding-bottom: 3px; }
.top-title { flex: 1; min-width: 0; }
.top-title b { display: block; font: 700 18px "Space Grotesk", Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { color: var(--ink); padding: 0; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn img.av, .icon-btn .av { box-shadow: none !important; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
main.no-nav { padding-bottom: calc(40px + var(--safe-b)); }
main.chat-main { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 80px); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--s3); color: var(--muted); }
.pill.now { background: rgba(255,91,46,.16); color: #ff9b7d; }
.pill.soon { background: rgba(255,194,61,.12); color: var(--warn); }
.pill.msg { background: var(--s3); color: var(--ink); }
.ev-card { width: 100%; text-align: left; padding: 18px; margin-bottom: 10px; display: block; color: var(--ink); }
.ev-card.now { border-color: #4a2416; background: radial-gradient(120% 140% at 100% 0%, rgba(255,91,46,.16), transparent 55%), var(--s1); }
.ev-card.past { opacity: .6; }
.ev-card h3 { font-size: 21px; margin: 10px 0 2px; }
.ev-top { display: flex; gap: 6px; }
.ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; }
details.past { margin-top: 20px; }
details.past summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 8px 0; list-style: none; }
details.past summary::-webkit-details-marker { display: none; }
details.past summary::before { content: "› "; display: inline-block; transition: transform .15s; }
details.past[open] summary::before { transform: rotate(90deg); }
.member { cursor: pointer; }
.chev { color: var(--dim); font-size: 24px; }
.mission { background: var(--s1); border: 1px solid #1f1f26; border-left: 3px solid var(--accent); border-radius: 14px; padding: 12px 14px; margin-bottom: 4px; font-weight: 600; }
.mission small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg.mini { margin: 0; display: inline-grid; grid-template-columns: auto auto; }
.seg.mini button { padding: 8px 12px; font-size: 13.5px; }

.info-card { padding: 16px; margin-bottom: 12px; }
.info-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.info-h > b { font-size: 16px; }
.kv { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #1f1f26; flex-wrap: wrap; }
.kv > span { color: var(--muted); font-size: 13.5px; min-width: 96px; }
.kv > b { flex: 1; font-weight: 600; word-break: break-word; }
.kv.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.addr { font-weight: 600; white-space: pre-wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.note { white-space: pre-wrap; color: #d6d6dc; margin: 8px 0 0; line-height: 1.5; }
.sched { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sched th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px 6px 0; }
.sched td { padding: 7px 6px 7px 0; border-top: 1px solid #1f1f26; font-weight: 600; }
.contact { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #1f1f26; }
.contact:first-of-type { border-top: 0; }
.contact > div > b { display: block; }
.contact > div > span { display: block; color: var(--muted); font-size: 13px; }
.contact > div > b, .contact > div > span { overflow: hidden; text-overflow: ellipsis; }
.tasks-in .task { padding: 12px 0; }
.row-edit { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)) 30px; gap: 6px; margin-bottom: 6px; align-items: center; }
.row-edit input { background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; outline: none; min-width: 0; font-size: 14px; }
.row-edit.head span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mission-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.mission-row input { flex: 1; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; font-size: 15px; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 6px; }
.doc-tile { border: 1px solid var(--line); background: var(--s2); border-radius: 14px; overflow: hidden; padding: 0; text-align: left; color: var(--ink); }
.doc-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #222; }
.doc-tile span { display: block; padding: 8px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.viewer-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: rgba(20,20,24,.95); }
.viewer-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }
.viewer-body img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.viewer-body img.zoom { max-width: none; max-height: none; width: 260%; cursor: zoom-out; }
.viewer-hint { text-align: center; color: var(--dim); font-size: 12px; margin: 0; padding: 8px 0 calc(8px + var(--safe-b)); }

.budget-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; }
.budget-hero small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.budget-hero b { display: block; font: 700 19px "Space Grotesk", Inter, system-ui, sans-serif; margin-top: 2px; }
.bal-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 1.4fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #1f1f26; }
.bal-row:first-child { border-top: 0; }
.bal-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.bal-bar { position: relative; height: 8px; background: var(--s3); border-radius: 6px; }
.bal-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.bal-bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.exp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.exp-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--s2); display: grid; place-items: center; font-size: 19px; flex: none; }
.exp-main { flex: 1; min-width: 0; }
.exp-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-main span { display: block; color: var(--muted); font-size: 13px; }
.exp-amt { font: 700 16px "Space Grotesk", Inter, system-ui, sans-serif; }
.split { background: var(--s2); border-radius: 14px; padding: 4px 14px; margin-bottom: 8px; }
.split > div { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid #262630; gap: 10px; }
.split > div:first-child { border-top: 0; }
.split input { width: 110px; text-align: right; background: var(--s1); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; outline: none; font-size: 15px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.me { justify-content: flex-end; }
.msg-row .msg { max-width: 78%; }

a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--accent-ink); }
.member .info .pill { display: table; margin-top: 4px; }
