/* الفكرة: دفتر حسابات بجلد بني وختم ذهبي. فرقة بني في البداية، وكل اشتراك كارت مستقل بنفس الترتيب. */
:root {
  --paper: #F1E8D8; --card: #FCF8F0; --ink: #1A140D; --ink-2: #4A3926; --ink-3: #65523C; --line: #E0D2BA;
  --accent: #6B4423; --accent-ink: #FCF8F0; --accent-soft: #E9DDC7; --bar: #C39A3F; --gold: #EBC874;
  --note: #3A2413; --note-ink: #F8F0E0; --note-ink-2: #DCCBA9; --note-line: #D9B25F;
  --good: #1A140D; --good-bg: #EAD6A3; --warn: #6B4423; --warn-bg: #F0DFBC; --trial: #6B4423; --trial-bg: #FCF8F0;
  --off: #65523C; --off-bg: #E9DDC7; --near: #7D5A0B; --danger: #8E2A1B;
  --shadow: 0 10px 28px rgba(58, 36, 19, .22); --lift: 0 1px 2px rgba(58, 36, 19, .08);
  --display: 'Cairo', 'Segoe UI', Tahoma, sans-serif; --body: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --paper: #1A130C; --card: #261C13; --ink: #F5ECDC; --ink-2: #D4C4A8; --ink-3: #B6A488; --line: #40332A;
  --accent: #DDB765; --accent-ink: #1A130C; --accent-soft: #352A1C; --bar: #DDB765; --gold: #EBC874;
  --note: #33210F; --note-ink: #F8F0E0; --note-ink-2: #D8C6A3; --note-line: #C9A24B;
  --good: #1A130C; --good-bg: #DDB765; --warn: #F2D999; --warn-bg: #4A391C; --trial: #E8D092; --trial-bg: #261C13;
  --off: #D4C4A8; --off-bg: #40332A; --near: #E8C468; --danger: #F2A08F;
  --shadow: 0 10px 28px rgba(0, 0, 0, .5); --lift: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1A130C; --card: #261C13; --ink: #F5ECDC; --ink-2: #D4C4A8; --ink-3: #B6A488; --line: #40332A;
  --accent: #DDB765; --accent-ink: #1A130C; --accent-soft: #352A1C; --bar: #DDB765; --gold: #EBC874;
  --note: #33210F; --note-ink: #F8F0E0; --note-ink-2: #D8C6A3; --note-line: #C9A24B;
  --good: #1A130C; --good-bg: #DDB765; --warn: #F2D999; --warn-bg: #4A391C; --trial: #E8D092; --trial-bg: #261C13;
  --off: #D4C4A8; --off-bg: #40332A; --near: #E8C468; --danger: #F2A08F;
  --shadow: 0 10px 28px rgba(0, 0, 0, .5); --lift: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.65 var(--body); font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--card); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
dl { margin: 0; }
.nowrap { white-space: nowrap; }
[dir] .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.gutter { max-width: 860px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--ink-3); font-size: 13.5px; }

/* الشريط العلوي */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px; }
.brand { display: flex; align-items: center; gap: 7px; font: 800 21px/1 var(--display); color: var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink-2); flex: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.tabs { display: flex; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tab svg { flex: none; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 800; }
@media (max-width: 699px) {
  .tabs { position: fixed; z-index: 6; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--card); border-top: 1px solid var(--line); padding: 5px max(8px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tab { flex-direction: column; gap: 1px; font-size: 12px; padding: 4px 2px; justify-content: center; }
  .tab[aria-current="page"] { background: var(--accent-soft); font-weight: 800; }
}

#view { display: flex; flex-direction: column; gap: 20px; padding-block: 16px 112px; }
@media (max-width: 699px) { #view { padding-block-end: 150px; } }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--warn-bg); color: var(--ink); }
.banner p { flex: 1 1 220px; min-width: 0; }
.banner.neutral { background: var(--accent-soft); }

/* الملخص */
.note { position: relative; overflow: hidden; background: var(--note); color: var(--note-ink); border-radius: 14px; padding: 18px 20px; }
.note canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.note > div { position: relative; }
.note-label { color: var(--note-ink-2); font-size: 14px; }
.note-big { color: var(--gold); font: 800 clamp(40px, 11vw, 54px)/1.15 var(--display); margin-block: 2px 14px; }
.note-big small { font: 500 18px var(--body); color: var(--note-ink-2); margin-inline-start: 6px; }
.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-top: 1px solid rgba(235, 200, 116, .35); padding-top: 12px; }
.note-grid dt { font-size: 12.5px; color: var(--note-ink-2); }
.note-grid dd { margin: 0; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.note-foot { margin-top: 10px; font-size: 12.5px; color: var(--note-ink-2); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin-block-end: 10px; }
.section-head h2, .h2 { font: 700 18px/1.35 var(--display); }

/* خصومات قريبة */
.soon { display: flex; gap: 8px; overflow-x: auto; padding-block-end: 4px; scrollbar-width: thin; }
.soon-item { flex: 0 0 auto; min-width: 160px; max-width: 230px; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--lift); }
.soon-item:hover { border-color: var(--accent); }
.soon-item strong { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.when.near { color: var(--near); }
.when.now { color: var(--danger); }

/* الفلاتر */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-block-end: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 280px; min-width: 0; padding-block: 2px; scrollbar-width: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 3px 12px; font-size: 13.5px; font-weight: 500; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chip b { font-weight: 500; opacity: .75; margin-inline-start: 4px; }
.select-mini { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 8px; font-size: 13.5px; max-width: 170px; }

/* كارت الاشتراك: نفس الترتيب في كل كارت عشان العين تقارن بسرعة */
.list { margin-block-start: 4px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-direction: column; gap: 10px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: start; padding: 14px 16px 12px; box-shadow: var(--lift); }
.row:hover { border-color: var(--accent); }
.row-top { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 0 12px; align-items: center; }
.mono { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font: 800 20px/1 var(--display); }
.row-name { display: block; font-weight: 700; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.row-cat { display: block; font-size: 13px; color: var(--ink-3); }
.row-price { display: block; font-weight: 800; font-size: 19px; line-height: 1.3; text-align: end; white-space: nowrap; }
.row-cycle { display: block; font-size: 12.5px; color: var(--ink-3); text-align: end; white-space: nowrap; }
.row-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.fact { display: flex; flex-direction: column; gap: 1px; min-width: 0; align-items: flex-start; }
.fact-label { font-size: 12px; color: var(--ink-3); }
.fact-val { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.meter { display: block; height: 5px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }
.row.is-cancelled .row-name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-3); }
.row.is-cancelled .row-price { color: var(--ink-3); font-weight: 600; }
.row.is-cancelled .meter i, .row.is-paused .meter i { opacity: .4; }
.row.is-cancelled { background: transparent; box-shadow: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 0 7px; font-size: 12px; font-weight: 700; line-height: 1.7; white-space: nowrap; }
.pill svg { flex: none; }
.pill.active { color: var(--good); background: var(--good-bg); }
.pill.trial { color: var(--trial); background: var(--trial-bg); box-shadow: inset 0 0 0 1px var(--trial); }
.pill.paused { color: var(--warn); background: var(--warn-bg); }
.pill.cancelled { color: var(--off); background: var(--off-bg); }

.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 32px 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }

.fab { position: fixed; z-index: 5; inset-inline-end: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); }
@media (max-width: 699px) { .fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 900px) { .fab { inset-inline-end: calc((100vw - 828px) / 2); } }

/* الأزرار */
.btn { border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: none; }
.btn.danger.armed { background: var(--danger); color: var(--card); border-color: var(--danger); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* صفحة الدخول */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: var(--paper); color: var(--ink); overflow: hidden; text-align: center; padding-block: 56px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.landing canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.landing-theme { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); inset-inline-end: max(16px, env(safe-area-inset-left, 0px)); background: var(--card); }
.landing-box { position: relative; display: flex; flex-direction: column; align-items: center; color: var(--accent); margin-block: auto; }
.landing h1 { font: 800 clamp(40px, 11vw, 60px)/1.2 var(--display); margin-block-start: 8px; }
.hero-lead { margin-block: 6px 26px; font-size: 17px; color: var(--ink-2); max-width: 36ch; text-wrap: balance; }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; padding: 12px 28px; border-radius: 11px; }
.google-btn:hover { filter: brightness(1.06); }
.hero-note { margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.privacy { position: relative; font-size: 13px; color: var(--ink-3); max-width: 62ch; }
.search-box { position: relative; display: flex; align-items: center; margin-block-end: 10px; color: var(--ink-3); }
.search-box svg { position: absolute; inset-inline-start: 12px; pointer-events: none; }
.search-box input { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 11px; padding: 9px 40px 9px 12px; font-size: 16px; }
.search-box input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.search-box input::placeholder { color: var(--ink-3); }
.filter-label { font-size: 13px; color: var(--ink-3); flex: none; }
a.btn { display: inline-block; text-decoration: none; color: var(--ink); }
.gate { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding-block: 40px; }
.gate h1 { font: 800 26px/1.3 var(--display); color: var(--accent); }

.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person span { overflow-wrap: anywhere; min-width: 0; direction: ltr; unicode-bidi: isolate; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-form .field { flex: 1 1 220px; }

/* اللوحة المنبثقة */
dialog#sheet { border: 0; padding: 0; background: var(--card); color: var(--ink); width: min(640px, 100%); max-width: 100%; max-height: min(92dvh, 900px); margin: auto auto 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); overflow: auto; }
@media (min-width: 700px) { dialog#sheet { margin: auto; border-radius: 16px; } }
dialog#sheet::backdrop { background: rgba(26, 20, 13, .55); }
#sheet-body { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font: 700 21px/1.3 var(--display); overflow-wrap: anywhere; min-width: 0; }
.close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent-soft); font-size: 18px; line-height: 1; }

.paid { border: 1px solid var(--note-line); background: var(--note); color: var(--note-ink); border-radius: 12px; padding: 12px 14px; }
.paid .label { font-size: 13px; color: var(--note-ink-2); }
.paid .num { color: var(--gold); font: 800 28px/1.3 var(--display); }
.paid .sub { font-size: 13px; color: var(--note-ink-2); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }

.log { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.log button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 12px; text-align: start; }
.log button:last-child { border-bottom: 0; }
.log button:hover { background: var(--accent-soft); }
.log .amount { font-weight: 600; text-align: end; white-space: nowrap; }
.log .src { font-size: 12.5px; color: var(--ink-3); }

/* النماذج */
form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label, .legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 8px 10px; font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 13px; color: var(--danger); font-weight: 500; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segment { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; background: var(--accent-soft); padding: 3px; border-radius: 10px; }
.segment.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment label { text-align: center; padding: 6px 2px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.segment input:checked + label { background: var(--card); font-weight: 700; color: var(--accent); }
.segment input:focus-visible + label { outline: 2px solid var(--accent); }
.backfill { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.backfill input { margin-block-start: 5px; flex: none; width: 17px; height: 17px; }
.sticky-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding-top: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
label.btn { display: inline-block; cursor: pointer; }
.import-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; border-bottom: 1px solid var(--line); padding: 8px 12px; }
.import-row:last-child { border-bottom: 0; }

.promo-note { display: block; font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 5px 10px; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.check-line input { width: 17px; height: 17px; flex: none; }
.segment.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.promo-hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }

/* التقارير */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.hbar .name { font-weight: 500; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.hbar .val { font-weight: 600; font-size: 14px; white-space: nowrap; }
.cols-wrap { overflow-x: auto; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(24px, 1fr); gap: 4px; height: 140px; align-items: end; direction: ltr; min-width: 340px; }
.col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.col .b { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .b, .col:focus .b { opacity: .8; }
.col .tip { position: absolute; bottom: calc(100% - 12px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 2px 6px; border-radius: 5px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 2; }
.col:hover .tip, .col:focus .tip { opacity: 1; }
.col:first-child .tip { left: 0; transform: none; }
.col:last-child .tip { left: auto; right: 0; transform: none; }
.axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(24px, 1fr); gap: 4px; direction: ltr; min-width: 340px; font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 4px; }
details summary { cursor: pointer; font-size: 13.5px; color: var(--accent); font-weight: 500; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.tbl th, .tbl td { text-align: start; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tbl td:last-child, .tbl th:last-child { text-align: end; }
.rank-list { display: flex; flex-direction: column; }
.rank-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 0; text-align: start; }
.rank-list button:last-child { border-bottom: 0; }
.rank-list .nm { font-weight: 500; overflow-wrap: anywhere; }
.rank-list .sm { font-size: 12.5px; color: var(--ink-3); }
.rank-list .vl { font-weight: 600; text-align: end; white-space: nowrap; }

.status-line { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on { background: var(--good); }
.dot.bad { background: var(--danger); }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }


#toast { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(130px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--card); padding: 8px 14px; border-radius: 9px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: no-preference) {
  dialog#sheet[open] { animation: rise .16s ease-out; }
  @keyframes rise { from { transform: translateY(16px); } to { transform: none; } }
}
