:root {
  --ink: #241b35; --ink-2: #5b536b; --ink-3: #857f93;
  --paper: #f1f4ee; --card: #ffffff; --line: #dce1d5; --line-2: #c9cfc1;
  --haldi: #f4b400; --haldi-ink: #3b2a00; --haldi-soft: #fff1c4;
  --mehendi: #2f5d46; --mehendi-ink: #ffffff; --mehendi-soft: #e0ebe3;
  --rani: #b8174f; --rani-soft: #fbe4ec;
  --sky: #2d5d86; --sky-soft: #e3edf6;
  --r-card: 16px; --r-ctl: 11px; --r-sheet: 24px;
  --display: "Gloock", Georgia, serif;
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2.5px solid var(--mehendi); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
#app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); padding: calc(10px + var(--safe-t)) 18px 10px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font: 400 26px/1.1 var(--display); margin: 0; flex: 1; letter-spacing: -.005em; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--mehendi); color: #fff; font-weight: 600; font-size: 15px; }
main { padding: 4px 18px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 720px; margin: 0 auto; }

.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 500; position: relative; }
.tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 7px; width: 46px; height: 30px; border-radius: 15px; background: var(--haldi-soft); z-index: -1; }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--rani); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }

@media (min-width: 900px) {
  .tabbar { top: 0; right: auto; width: 96px; height: 100dvh; grid-template-columns: 1fr; grid-auto-rows: 76px; align-content: start; padding-top: 84px; border-top: 0; border-right: 1px solid var(--line); }
  .topbar, main { max-width: 820px; margin-left: calc(96px + max(0px, (100vw - 96px - 820px) / 2)); padding-left: 40px; padding-right: 40px; }
  main { padding-top: 8px; padding-bottom: 48px; }
  .fab { right: max(24px, calc((100vw - 96px - 820px) / 2 + 24px)) !important; bottom: 28px !important; }
}

/* ---------- segmented control ---------- */
.seg { display: flex; gap: 4px; background: #e4e8df; border-radius: 13px; padding: 4px; margin: 6px 0 16px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(36, 27, 53, .12); }
.seg.sm button { padding: 7px 10px; font-size: 13.5px; }

/* ---------- day card (the one bold element) ---------- */
.daycard { background: var(--haldi); color: var(--haldi-ink); border-radius: 22px; padding: 20px 20px 18px; margin: 6px 0 14px; position: relative; overflow: hidden; }
.daycard::after { content: ""; position: absolute; right: -28px; top: -28px; width: 150px; height: 150px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(59, 42, 0, .09) 0 10deg, transparent 10deg 20deg); }
.daycard .big { font: 400 64px/0.95 var(--display); letter-spacing: -.02em; }
.daycard .big small { font: 500 17px/1 var(--ui); letter-spacing: 0; margin-left: 6px; }
.daycard .lede { font-size: 15px; margin-top: 6px; }
.days3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.days3 a { text-decoration: none; color: inherit; background: rgba(255, 255, 255, .42); border-radius: 12px; padding: 9px 10px; }
.days3 b { display: block; font: 400 22px/1 var(--display); }
.days3 span { font-size: 12.5px; line-height: 1.25; display: block; margin-top: 3px; }
.nowcard .label { font-size: 13px; font-weight: 600; opacity: .8; }
.nowcard .what { font: 400 30px/1.1 var(--display); margin: 2px 0 2px; }
.nowcard .where { font-size: 14.5px; }
.nowcard .next { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(59, 42, 0, .2); position: relative; z-index: 1; }
.nowcard .next .what { font-size: 21px; }

/* ---------- stats (tappable numbers) ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 560px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 78px; }
.stat b { font: 400 28px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }
.stat.alert b { color: var(--rani); }
.stat.good b { color: var(--mehendi); }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list + .list, .group + .group { margin-top: 14px; }
.ghead { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 2px 8px; }
.ghead:first-child { margin-top: 2px; }
.ghead h2 { font-size: 15px; font-weight: 600; margin: 0; }
.ghead .meta { font-size: 13px; color: var(--ink-3); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.row:first-child { border-top: 0; }
button.row:active { background: #f6f8f3; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 500; overflow-wrap: anywhere; }
.row .s { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.row .end { text-align: right; font-size: 14px; white-space: nowrap; }
.row.done .t { text-decoration: line-through; color: var(--ink-3); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card); flex: 0 0 26px; display: grid; place-items: center; padding: 0; }
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.check[aria-checked="true"] { background: var(--mehendi); border-color: var(--mehendi); }
.check[aria-checked="true"] svg { opacity: 1; }
.empty { padding: 22px 16px; text-align: center; color: var(--ink-2); font-size: 14.5px; }
.empty button { margin-top: 10px; }

.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eceee8; color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--mehendi-soft); color: var(--mehendi); }
.pill.warn { background: var(--haldi-soft); color: #6b4d00; }
.pill.bad { background: var(--rani-soft); color: var(--rani); }
.pill.info { background: var(--sky-soft); color: var(--sky); }
.late { color: var(--rani) !important; font-weight: 600; }
.lock { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--ink-3); }
.lock svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- timeline ---------- */
.thread { position: relative; padding-left: 0; }
.ev { display: grid; grid-template-columns: 58px 18px 1fr; gap: 0 10px; width: 100%; background: none; border: 0; text-align: left; padding: 0; }
.ev .tm { font-size: 14px; font-weight: 600; text-align: right; padding-top: 14px; font-variant-numeric: tabular-nums; }
.ev .tm small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.ev .rail { position: relative; }
.ev .rail::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line-2); }
.ev:first-child .rail::before { top: 20px; }
.ev:last-child .rail::before { bottom: calc(100% - 20px); }
.ev .rail i { position: absolute; left: 2px; top: 15px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--mehendi); }
.ev.mine .rail i { background: var(--haldi); border-color: var(--haldi-ink); }
.ev.past { opacity: .55; }
.ev .box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; margin: 6px 0; }
.ev .box .t { font-weight: 600; }
.ev .box .s { font-size: 13.5px; color: var(--ink-2); }
.flag { margin-top: 7px; font-size: 13px; color: var(--rani); background: var(--rani-soft); border-radius: 8px; padding: 6px 9px; }

/* ---------- compare grid ---------- */
.grid-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.cmp th, table.cmp td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: center; white-space: nowrap; }
table.cmp thead th { border-top: 0; font-size: 13px; font-weight: 600; vertical-align: bottom; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); white-space: normal; min-width: 140px; max-width: 200px; }
table.cmp td.yes { color: var(--mehendi); font-weight: 700; }
table.cmp td.no { color: var(--line-2); }
table.cmp tfoot td { font-weight: 600; background: #f7f9f5; }
table.cmp tfoot td:first-child { background: #f7f9f5; }
.combo { display: flex; align-items: center; gap: 12px; }
.combo .amt { font: 400 22px/1 var(--display); }

/* ---------- money ---------- */
.splitbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #e7eae2; margin: 8px 0 6px; }
.splitbar i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.bars { display: grid; gap: 10px; padding: 14px; }
.bars .b { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.bars .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: #eceee8; overflow: hidden; }
.bars .track i { display: block; height: 100%; background: var(--mehendi); border-radius: 4px; }
.bars .track i.paid { background: var(--mehendi); }

/* ---------- rooms ---------- */
.rooms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
@media (min-width: 560px) { .rooms { grid-template-columns: repeat(10, 1fr); } }
.room { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-2); padding: 2px; }
.room b { font: 400 19px/1 var(--display); color: var(--ink); }
.room.part { background: var(--haldi-soft); border-color: #f1d98a; }
.room.full { background: var(--mehendi); border-color: var(--mehendi); color: #d9e7dd; }
.room.full b { color: #fff; }
.room.over { background: var(--rani); border-color: var(--rani); color: #fff; }
.room.over b { color: #fff; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line-2); background: var(--card); border-radius: var(--r-ctl); padding: 10px 16px; font-weight: 600; font-size: 15px; min-height: 44px; }
.btn.pri { background: var(--mehendi); border-color: var(--mehendi); color: var(--mehendi-ink); }
.btn.danger { color: var(--rani); border-color: #efc2d2; }
.btn.armed { background: var(--rani); color: #fff; border-color: var(--rani); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--mehendi); padding-left: 8px; padding-right: 8px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.fab { position: fixed; z-index: 35; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--mehendi); color: #fff; box-shadow: 0 6px 18px rgba(47, 93, 70, .35); display: grid; place-items: center; }
.fab svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 14px; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-2); background: transparent; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.search { width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: var(--r-ctl); padding: 11px 14px; margin-bottom: 12px; font-size: 16px; }

/* ---------- sheet ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(28, 22, 40, .45); }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: up .22s cubic-bezier(.2, .8, .3, 1); }
  @keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: var(--r-sheet); max-height: 86dvh; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 9px auto 0; }
.sheet header { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px; }
.sheet header h2 { font: 400 23px/1.15 var(--display); margin: 0; flex: 1; }
.sheet .body { padding: 4px 18px 18px; overflow-y: auto; }
.sheet footer { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet footer .grow { flex: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 14.5px; margin: 0 0 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.note { background: #f6f8f3; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; white-space: pre-wrap; }

/* ---------- forms ---------- */
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.f > label, .f > .lbl { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.f input, .f select, .f textarea { width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: var(--r-ctl); padding: 11px 12px; font-size: 16px; min-height: 46px; }
.f textarea { min-height: 84px; resize: vertical; }
.f .hint { font-size: 12.5px; color: var(--ink-3); }
.f .err { font-size: 13px; color: var(--rani); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 13px; padding: 11px 12px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--mehendi); background: var(--mehendi-soft); }
.choice input { margin-top: 3px; accent-color: var(--mehendi); width: 18px; height: 18px; flex: 0 0 18px; }
.choice b { display: block; font-size: 15px; }
.choice span { font-size: 13px; color: var(--ink-2); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.picks label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
.picks label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.picks input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px calc(32px + var(--safe-b)); max-width: 420px; margin: 0 auto; }
.login .names { font: 400 46px/1.02 var(--display); letter-spacing: -.015em; margin: 0; }
.login .names span { display: block; }
.login .when { margin: 14px 0 34px; color: var(--ink-2); font-size: 16px; }
.login .marigold { width: 54px; height: 54px; border-radius: 50%; margin-bottom: 26px; background: repeating-conic-gradient(var(--haldi) 0 15deg, #e9a200 15deg 30deg); box-shadow: inset 0 0 0 9px var(--haldi); }
.login .msg { font-size: 14px; color: var(--ink-2); margin-top: 12px; min-height: 20px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 86px); transform: translateX(-50%) translateY(10px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 70; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- v2: drawer, header, misc ---------- */
.iconbtn { width: 40px; height: 40px; margin-left: -8px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; color: var(--ink); }
.iconbtn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.iconbtn:active { background: #e4e8df; }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; display: grid; place-items: center; flex: 0 0 46px; }
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(28, 22, 40, .45); opacity: 0; transition: opacity .2s; }
.scrim.open { opacity: 1; }
.drawer { position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: min(84vw, 320px); background: var(--card); padding: calc(18px + var(--safe-t)) 14px calc(16px + var(--safe-b)); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .3, 1); box-shadow: 8px 0 30px rgba(28, 22, 40, .18); }
.drawer.open { transform: none; }
.dhead { display: flex; gap: 12px; align-items: center; padding: 4px 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.dhead div:last-child { display: flex; flex-direction: column; min-width: 0; }
.dhead b { font-size: 16px; }
.dhead span { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ditem { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15.5px; border: 0; background: none; width: 100%; text-align: left; }
.ditem svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 22px; color: var(--ink-2); }
.ditem[aria-current="page"] { background: var(--haldi-soft); }
.ditem:active { background: #f1f4ee; }
.ditem.danger, .ditem.danger svg { color: var(--rani); }
.dmeta { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 600; color: var(--rani); }
.dsep { height: 1px; background: var(--line); margin: 8px 4px; }
.dfoot { font-size: 12.5px; color: var(--ink-3); margin: 10px 8px 0; }
.plain { background: none; border: 0; padding: 0; text-align: left; }
.hint-line { margin: -6px 2px 12px; color: var(--ink-3); font-size: 13.5px; }
.list.pad { padding: 12px 14px; }
.list .s, .kv .s, p.s { font-size: 13px; color: var(--ink-3); }
.settlecard { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 4px; border-left: 4px solid var(--rani); }
.settlecard .lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.settlecard .big { font: 400 30px/1.1 var(--display); margin: 2px 0; }
.settle-hero .big { font: 400 54px/1 var(--display); }
.settle-hero .label { font-size: 13px; font-weight: 600; opacity: .8; }
table.settle td, table.settle th { text-align: right; }
table.settle td:first-child, table.settle th:first-child { text-align: left; }
table.settle tr.sum td { font-weight: 600; background: #f7f9f5; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 2px 0 16px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--mehendi-soft); color: var(--mehendi); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.act svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
ul.gives { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
ul.gives li { margin: 2px 0; }
ul.gives.card { background: #f6f8f3; border-radius: 10px; padding: 10px 12px 10px 28px; margin: 0 0 14px; }
.row.top { align-items: flex-start; }
.vtag { color: var(--mehendi) !important; font-weight: 500; }
.checkline { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); }
.checkline input { width: 20px; height: 20px; accent-color: var(--mehendi); flex: 0 0 20px; }
table.cmp small { font-weight: 400; color: var(--ink-3); }
@media (min-width: 900px) { .iconbtn { display: none; } }
.daycard.settle-hero { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--rani); border-radius: 0 18px 18px 0; }
.daycard.settle-hero::after { display: none; }

/* ---------- v3: files, inspiration, risk ---------- */
.riskbar { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid #efc2d2; background: var(--rani-soft); color: var(--rani); border-radius: 14px; padding: 11px 14px; margin: 0 0 14px; font-weight: 600; font-size: 15px; text-align: left; }
.riskbar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.riskbar span { flex: 1; }
.riskbar em { font-style: normal; font-size: 13.5px; text-decoration: underline; }
.filebox { margin-top: 4px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.ftile { position: relative; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); min-height: 92px; display: flex; flex-direction: column; }
.ftile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ftile > span { font-size: 12px; color: var(--ink-2); padding: 5px 7px; line-height: 1.3; }
.ftile.doc a { display: flex; flex-direction: column; gap: 4px; padding: 10px; text-decoration: none; color: var(--ink); flex: 1; }
.ftile.doc b { font-size: 11px; color: #fff; background: var(--rani); border-radius: 6px; padding: 2px 6px; align-self: flex-start; }
.ftile.doc a span { font-size: 12.5px; overflow-wrap: anywhere; color: var(--ink-2); }
.ftile .fnote { font-size: 12.5px; padding: 10px; color: var(--ink-2); white-space: pre-wrap; }
.fdel { position: absolute; top: 5px; right: 5px; min-width: 26px; height: 26px; border-radius: 13px; border: 0; background: rgba(36, 27, 53, .7); color: #fff; font-size: 15px; line-height: 1; padding: 0 7px; }
.fdel.armed { background: var(--rani); font-size: 12px; }
.fbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fbtns label.btn { display: inline-flex; align-items: center; cursor: pointer; }
.sharebox { margin: 4px 0 6px; }
.note.sel { user-select: all; -webkit-user-select: all; color: var(--ink); word-break: break-all; }
button.act { border: 0; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.block-sm { margin: -4px 0 12px; }

/* ---------- v4: dated events, scope chips, plan map ---------- */
.dgroup { margin-bottom: 8px; }
.dhead2 { display: flex; align-items: center; gap: 10px; margin: 14px 2px 4px; }
.dhead2 b { font: 400 26px/1 var(--display); min-width: 34px; }
.dhead2 span { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.dhead2.wd b { color: #a77900; }
.dhead2.wd span { color: #6b4d00; }
.schips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.schip { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #eceee8; color: var(--ink-2); border: 1px solid #dfe3d8; }
.schip.quoting { background: var(--haldi-soft); color: #6b4d00; border-color: #f1d98a; }
.schip.booked { background: var(--mehendi-soft); color: var(--mehendi); border-color: #c4d9cb; }
.datebox { flex: 0 0 44px; text-align: center; border-radius: 10px; background: #f1f4ee; padding: 5px 0; }
.datebox b { display: block; font: 400 21px/1 var(--display); }
.datebox span { font-size: 11.5px; color: var(--ink-3); }
.fab.ext { width: auto; height: 54px; padding: 0 20px 0 16px; border-radius: 27px; gap: 6px; display: inline-flex; align-items: center; font-weight: 600; font-size: 16px; }
.fab.ext svg { width: 22px; height: 22px; }
.addscope { margin: 10px 0 4px; }

/* ---------- v4.1: expandable event cards, day add ---------- */
.ev { cursor: default; }
.evtop { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; }
.chev { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--mehendi); }
.chev::after { content: " ▾"; }
.box.open .chev::after { content: " ▴"; }
.box.open { border-color: var(--mehendi); }
.evin { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.evh { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 8px 0 2px; }
.evrow { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 8px 0; text-align: left; font-size: 14.5px; border-bottom: 1px solid #eef0ea; }
.evrow .grow { flex: 1; min-width: 0; text-align: left; }
.evrow .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.evnone { margin: 4px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #c9cfc1; flex: 0 0 10px; }
.dot.quoting { background: var(--haldi); }
.dot.booked { background: var(--mehendi); }
.check.sm { width: 22px; height: 22px; flex: 0 0 22px; }
.check.sm svg { width: 12px; height: 12px; }
.strike { text-decoration: line-through; color: var(--ink-3); }
.evbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.choice.big { display: grid; gap: 10px; }
.pickbtn { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); }
.pickbtn b { font-size: 16px; }
.pickbtn span { font-size: 13.5px; color: var(--ink-2); }
.pickbtn:disabled { opacity: .55; }

/* ---------- sheet scrolling fix (iPhone) ---------- */
html.noscroll, html.noscroll body { overflow: hidden; }
dialog.sheet { overflow: hidden; overscroll-behavior: contain; }
.sheet header, .sheet footer, .sheet .grab { flex: 0 0 auto; }
.sheet .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#theForm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
#theForm .f { grid-column: 1 / -1; min-width: 0; }
#theForm .f.half { grid-column: auto; }
.f input, .f select, .f textarea { max-width: 100%; min-width: 0; display: block; }
.f input[type="date"], .f input[type="time"] { -webkit-appearance: none; appearance: none; text-align: left; line-height: 22px; }
.f input[type="date"]::-webkit-date-and-time-value, .f input[type="time"]::-webkit-date-and-time-value { text-align: left; }

/* ---------- tree: date > event > scope > quotes/tasks ---------- */
.dhead2 { gap: 6px; }
.dtoggle { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 4px 0; text-align: left; color: inherit; }
.dtoggle b { font: 400 26px/1 var(--display); min-width: 30px; }
.dtxt { font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; }
.dhead2.wd .dtxt { color: #6b4d00; }
.dtxt small { font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.tw { width: 14px; flex: 0 0 14px; color: var(--ink-3); font-size: 13px; }
.dgroup:not(.open) { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.evrow.tree { padding: 9px 0; }
.branch { margin: 0 0 6px 24px; padding-left: 10px; border-left: 2px solid var(--line); }
.leafh { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 2px; }
.leaf { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 7px 0; text-align: left; font-size: 14px; border-bottom: 1px solid #eef0ea; }
.leaf .grow { flex: 1; min-width: 0; text-align: left; }
.leaf .num { font-size: 13.5px; font-weight: 600; }
.leaf .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.dhead2 .tw { flex: 0 0 14px; }
.dhead2 .dtxt { flex: 1; min-width: 0; }
.dhead2 .dtxt small { display: block; }
.branch { margin-left: 8px; padding-left: 10px; }
.leaf.more { color: var(--mehendi); font-weight: 600; font-size: 13.5px; }
.ev.isopen { grid-template-columns: 1fr; }
.ev.isopen .tm, .ev.isopen .rail { display: none; }
.ttime { display: block; font-size: 13px; font-weight: 600; color: var(--mehendi); margin-bottom: 2px; }

/* ---------- no sideways sliding: dropdowns, fitted tabs ---------- */
.seg { overflow: hidden; }
.seg button { flex: 1 1 0; min-width: 0; padding: 9px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; flex-wrap: wrap; }
.ddl { flex: 1 1 160px; min-width: 0; position: relative; }
.ddl select { width: 100%; -webkit-appearance: none; appearance: none; border: 1px solid var(--line-2); background: var(--card); border-radius: 12px; padding: 10px 36px 10px 14px; font-size: 15px; font-weight: 600; color: var(--ink); min-height: 42px; }
.ddl::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flagline { margin: -4px 2px 10px; font-size: 13.5px; font-weight: 600; color: var(--rani); }
main { overflow-x: hidden; }

/* ---------- guest groups ---------- */
.gbar { position: relative; display: flex; height: 10px; border-radius: 5px; background: #eceee8; margin: 8px 0 2px; overflow: visible; }
.gbar i { display: block; height: 100%; }
.gbar i:first-child { border-radius: 5px 0 0 5px; }
.gbar i.h { background: #2d5d86; } .gbar i.i { background: #b8174f; } .gbar i.d { background: var(--haldi); }
.gbar em { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.gcard h3 { margin: 0; font-size: 15px; }
.kvrow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid #eef0ea; font-size: 14px; }
.kvrow span { flex: 1; color: var(--ink-2); } .kvrow b { font-variant-numeric: tabular-nums; }
.side-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #2d5d86; }
.side-dot.i { background: #b8174f; }
.leaf .s { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.row .num { font-variant-numeric: tabular-nums; }
.leaf .grow { white-space: normal; overflow-wrap: anywhere; }

/* guests: day-by-day totals */
.cascade { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 8px; margin-bottom: 12px; }
.cday { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid #eef0ea; }
.cday:first-child { border-top: 0; }
.cday h4 { margin: 0; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.ctiles { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ct { min-width: 72px; }
.ct b { display: block; font: 400 21px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.ct span { font-size: 12px; color: var(--ink-3); }
.ct.over b { color: #b8174f; }
.cascade .hint-line { margin: 6px 0 0; }
