/* ==========================================================
   Subscrybers — live demo workspace
   ========================================================== */

.demo-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; padding-block: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 32px); }
.demo-page main { position: relative; isolation: isolate; }
.demo-page main::before { content: ""; position: absolute; inset: -140px 0 auto 0; height: 620px; z-index: -1; pointer-events: none; background: radial-gradient(620px 360px at 92% 20%, rgba(91, 61, 245, .18), transparent 70%), radial-gradient(480px 300px at 0% 70%, rgba(200, 245, 71, .34), transparent 70%); -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.demo-intro h1 { font-size: clamp(2rem, 3vw + .8rem, 3.2rem); }
.demo-intro .lead { margin-top: .9rem; max-width: 62ch; font-size: 1.06rem; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.demo-status { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .95rem; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-weight: 600; font-size: .88rem; }
@media (max-width: 860px) { .demo-intro { grid-template-columns: 1fr; } }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: clip; min-height: 760px; }
.app-side { background: #f5f2fd; border-right: 1px solid var(--line); padding: 18px 14px; }
.app-side-inner { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 18px; }
.demo-page .site-header { position: relative; }
.app-user { display: flex; align-items: center; gap: 11px; padding: 6px 8px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 650; flex: none; }
.app-user strong { display: block; font-size: .95rem; line-height: 1.2; }
.app-user div span { font-size: .78rem; color: var(--muted); }
.app-nav { display: grid; gap: 4px; }
.app-nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; font-weight: 550; font-size: .95rem; color: var(--ink-2); text-align: left; transition: background-color .15s, color .15s; }
.app-nav button svg { width: 19px; height: 19px; flex: none; color: var(--faint); }
.app-nav button:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.app-nav button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.app-nav button[aria-current="page"] svg { color: var(--violet); }
.app-nav .count { margin-left: auto; font-size: .74rem; font-weight: 600; background: var(--violet-l); color: var(--violet-d); border-radius: 999px; padding: .08rem .5rem; }
.app-side-foot { margin-top: 8px; background: var(--ink); color: #fff; border-radius: 18px; padding: 16px; }
.app-side-foot strong { display: block; font-size: .98rem; letter-spacing: -.01em; }
.app-side-foot p { font-size: .82rem; color: #c3bfe0; margin: .35rem 0 .9rem; line-height: 1.45; }
.app-side-foot .btn { width: 100%; }
.app-main { padding: clamp(16px, 2.6vw, 32px); min-width: 0; outline: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); border-radius: 20px; }
  .app-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; min-width: 0; }
  .app-side-inner { position: static; gap: 10px; min-width: 0; }
  .app-user, .app-side-foot { display: none; }
  .app-nav { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav button { width: auto; white-space: nowrap; flex: none; }
}

/* ---------- view head ---------- */
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.view-head h2 { font-size: clamp(1.5rem, 1.4vw + 1rem, 2rem); letter-spacing: -.03em; }
.view-head p { color: var(--muted); font-size: .95rem; margin-top: .25rem; }
.view-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; padding: .42rem .95rem; border-radius: 999px; font-weight: 600; font-size: .86rem; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; background: var(--surface); min-width: 0; }
.kpi .k-label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.kpi .k-value { font-size: clamp(1.5rem, 1.6vw + .8rem, 2.05rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.15; margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-note { font-size: .82rem; color: var(--muted); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { background: var(--ink); color: #fff; border-color: transparent; position: relative; overflow: hidden; isolation: isolate; }
.kpi.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(240px 160px at 100% 0%, rgba(91, 61, 245, .7), transparent 70%); }
.kpi.hero .k-label, .kpi.hero .k-note { color: #c3bfe0; }
.kpi.hero .k-value { font-size: clamp(2rem, 2.4vw + .9rem, 3rem); }
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .kpis { grid-template-columns: 1fr; } }

/* ---------- panels ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; margin-bottom: 14px; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid-2, .grid-2.even { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 20px; background: var(--surface); min-width: 0; }
.panel + .panel.stack { margin-top: 14px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 14px; }
.panel-head h3 { font-size: 1.05rem; letter-spacing: -.015em; }
.panel-head span, .panel-head button.link { font-size: .84rem; color: var(--muted); }
button.link { border: 0; background: transparent; padding: 0; color: var(--violet) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: .95rem; }

/* upcoming list */
.up-list { display: grid; }
.up-row { display: grid; grid-template-columns: 46px auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.up-row + .up-row { border-top: 1px solid var(--line); }
.date-chip { width: 46px; border-radius: 12px; background: var(--tint); text-align: center; padding: 5px 0 6px; line-height: 1.1; }
.date-chip small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--violet-d); font-weight: 600; }
.date-chip b { font-size: 1.1rem; font-weight: 650; letter-spacing: -.03em; }
.up-when { font-size: .8rem; color: var(--muted); }
.up-amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.up-amt small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }

/* category bars */
.cat-bars { display: grid; gap: 4px; }
.cat-bar { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 8px; margin-inline: -8px; border-radius: 10px; font-size: .9rem; }
.cat-bar:hover, .cat-bar:focus-visible { background: var(--bg); }
.cat-bar .lbl { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.cat-bar .bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--c, var(--violet)); min-width: 3px; width: var(--w, 0%); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.cat-bar b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* column chart */
.colchart { display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: 190px auto; column-gap: 10px; row-gap: 8px; margin-top: 26px; }
.cc-y { position: relative; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-y span { position: absolute; right: 0; translate: 0 50%; white-space: nowrap; }
.cc-plot { position: relative; border-bottom: 1px solid var(--line-2); }
.cc-grid span { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.cc-cols { position: absolute; inset: 0; display: flex; }
.cc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; border-radius: 8px 8px 0 0; transition: background-color .15s; }
.cc-col:hover, .cc-col:focus-visible { background: rgba(91, 61, 245, .07); }
.cc-bar { width: min(24px, 46%); background: var(--violet); border-radius: 4px 4px 0 0; min-height: 2px; transition: background-color .15s; }
.cc-col:hover .cc-bar, .cc-col:focus-visible .cc-bar { background: var(--violet-d); }
.cc-val { font-size: .76rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.cc-x { grid-column: 2; display: flex; }
.cc-x span { flex: 1; text-align: center; font-size: .76rem; color: var(--muted); }
.col-stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.chart-table { margin-top: 10px; font-size: .86rem; }
.chart-table summary { cursor: pointer; color: var(--violet); font-weight: 600; width: fit-content; }
.chart-table table { border-collapse: collapse; margin-top: 8px; width: 100%; max-width: 360px; }
.chart-table th, .chart-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chart-table td:last-child, .chart-table th:last-child { text-align: right; }

.chart-tip { position: fixed; z-index: 300; pointer-events: none; background: var(--ink); color: #fff; border-radius: 12px; padding: 9px 12px; font-size: .82rem; line-height: 1.4; box-shadow: 0 12px 30px -10px rgba(20, 16, 43, .6); max-width: 240px; }
.chart-tip strong { display: block; font-size: .86rem; }
.chart-tip span { color: #c9c5e2; }

/* flags */
.flags { display: grid; gap: 10px; }
.flag { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.flag .icon-chip { width: 34px; height: 34px; border-radius: 10px; }
.flag .icon-chip.warn { background: #fff1d6; color: #8a5600; }
.flag strong { display: block; font-size: .93rem; line-height: 1.3; }
.flag div span { font-size: .82rem; color: var(--muted); }
@media (max-width: 520px) { .flag { grid-template-columns: auto minmax(0, 1fr); } .flag .btn { grid-column: 1 / -1; } }

/* ---------- subscriptions table ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.toolbar .search input { padding-left: 38px; }
.field-ctl, .toolbar input, .toolbar select { width: 100%; padding: .68rem .9rem; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: .94rem; transition: border-color .2s, box-shadow .2s; }
.toolbar select { width: auto; flex: 0 1 auto; }
.field-ctl:focus, .toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(91, 61, 245, .16); }
.table-wrap { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.sub-table { width: 100%; border-collapse: collapse; }
.sub-table th { text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 14px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.sub-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .93rem; }
.sub-table tr:last-child td { border-bottom: 0; }
.sub-table tbody tr { transition: background-color .15s; }
.sub-table tbody tr:hover { background: #fcfbff; }
.sub-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.sub-table tr.is-off .cell-name strong, .sub-table tr.is-off .money { color: var(--faint); }
.sub-table tr.is-cancelled .cell-name strong { text-decoration: line-through; }
.cell-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-name strong { display: block; font-size: .96rem; line-height: 1.25; }
.cell-name div > span { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.money { font-weight: 600; }
.sub-table small { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; }
.status { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.active { background: #dff7ec; color: #0b6644; }
.status.trial { background: #fff1d6; color: #7a4b00; }
.status.paused { background: #ecebf3; color: #55516e; }
.status.cancelled { background: #fde8e8; color: #9b1c22; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--muted); transition: background-color .15s, color .15s, border-color .15s; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--tint); color: var(--violet-d); border-color: var(--line); }
.icon-btn.danger:hover { background: #fde8e8; color: var(--danger); border-color: #f6caca; }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: 12px 4px 0; font-size: .88rem; color: var(--muted); }
.table-foot b { color: var(--ink); font-weight: 600; }

@media (max-width: 820px) {
  .sub-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sub-table, .sub-table tbody, .sub-table tr, .sub-table td { display: block; }
  .sub-table tr { padding: 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
  .sub-table tr:last-child { border-bottom: 0; }
  .sub-table td { padding: 0; border: 0; }
  .sub-table td.c-name { grid-column: 1 / -1; }
  .sub-table td.c-norm { display: none; }
  .sub-table .r { text-align: left; }
  .sub-table td:nth-child(4) { text-align: right; }
  .row-actions { justify-content: flex-end; }
}

/* ---------- calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { min-width: 150px; text-align: center; font-size: 1.05rem; letter-spacing: -.015em; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { margin-bottom: 6px; }
.cal-dow span { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { min-height: 78px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 7px 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; font-size: .84rem; transition: border-color .15s, background-color .15s; min-width: 0; }
.cal-cell.blank { border-color: transparent; background: transparent; }
button.cal-cell:hover { border-color: var(--violet); }
.cal-cell .d { font-weight: 600; color: var(--ink-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; margin: -2px 0 0 -3px; }
.cal-cell.is-today .d { background: var(--ink); color: #fff; }
.cal-cell.is-past { background: var(--bg); }
.cal-cell.is-past .d { color: var(--faint); }
.cal-cell.is-selected { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(91, 61, 245, .16); }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.cal-dots .dot { width: 9px; height: 9px; }
.cal-amt { font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 620px) { .cal-cell { min-height: 56px; padding: 5px; } .cal-amt { display: none; } .cal-dow span { font-size: .62rem; letter-spacing: 0; } }
.cal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.cal-stat { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.cal-stat span { font-size: .76rem; color: var(--muted); display: block; }
.cal-stat b { font-size: 1.1rem; font-weight: 600; letter-spacing: -.03em; }
@media (max-width: 520px) { .cal-stats { grid-template-columns: 1fr; } }

/* ---------- insights ---------- */
.trim-list { display: grid; }
.trim-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; cursor: pointer; }
.trim-row + .trim-row { border-top: 1px solid var(--line); }
.trim-row input { width: 19px; height: 19px; accent-color: var(--violet); margin: 0; cursor: pointer; }
.trim-row strong { font-size: .94rem; display: block; line-height: 1.25; }
.trim-row > span > span { font-size: .8rem; color: var(--muted); display: block; }
.trim-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.trim-row.is-cut strong { color: var(--faint); text-decoration: line-through; }
.trim-row.is-cut b { color: var(--faint); }
.trim-sum { margin-top: 14px; border-radius: 16px; padding: 16px 18px; background: var(--lime); color: var(--lime-ink); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.trim-sum.idle { background: var(--tint); color: var(--ink-2); }
.trim-sum strong { display: block; font-size: 1.5rem; letter-spacing: -.035em; line-height: 1.15; font-weight: 650; }
.trim-sum span { font-size: .86rem; }
.rank-bars { display: grid; gap: 4px; }
.rank-bar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 8px; margin-inline: -8px; border-radius: 10px; font-size: .88rem; }
.rank-bar:hover, .rank-bar:focus-visible { background: var(--bg); }
.rank-bar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.rank-bar .bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--violet); width: var(--w, 0%); min-width: 3px; }
.rank-bar b { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .cat-bar, .rank-bar { grid-template-columns: minmax(0, 104px) minmax(0, 1fr) auto; gap: 8px; } }

/* ---------- reminders ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row strong { display: block; font-size: .95rem; }
.set-row span { font-size: .82rem; color: var(--muted); display: block; max-width: 44ch; }
.sw { width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--line-2); position: relative; flex: none; transition: background-color .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: translate .2s; }
.sw[aria-checked="true"] { background: var(--violet); }
.sw[aria-checked="true"]::after { translate: 18px 0; }
.set-row select { padding: .5rem .7rem; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: .88rem; }
.rem-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; }
.rem-row + .rem-row { border-top: 1px solid var(--line); }
.rem-row strong { display: block; font-size: .94rem; line-height: 1.25; }
.rem-row div span { font-size: .8rem; color: var(--muted); }
.rem-row select { padding: .42rem .6rem; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: .84rem; }
.rem-row select:disabled { opacity: .45; }
@media (max-width: 520px) { .rem-row { grid-template-columns: auto minmax(0, 1fr) auto; } .rem-row select { grid-column: 2 / -1; justify-self: start; } }
.preview-label { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 8px; }
.preview-label:first-of-type { margin-top: 0; }
.sms { background: var(--ink); color: #fff; padding: 12px 15px; border-radius: 18px 18px 18px 5px; font-size: .9rem; line-height: 1.5; max-width: 340px; }
.mail { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-width: 380px; }
.mail-head { background: var(--bg); padding: 10px 14px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.mail-head b { color: var(--ink); display: block; font-size: .92rem; }
.mail-body { padding: 14px; font-size: .9rem; color: var(--ink-2); }
.note { margin-top: 14px; font-size: .84rem; color: var(--muted); background: var(--bg); border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; }

/* ---------- dialogs + toasts ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: 24px; width: min(580px, calc(100% - 28px)); max-height: calc(100dvh - 28px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(20, 16, 43, .5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog.sheet[open] { animation: pop .25s cubic-bezier(.2, .9, .3, 1.1); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 20px 24px 0; }
.sheet-head h2 { font-size: 1.4rem; letter-spacing: -.025em; }
.sheet-body { padding: 18px 24px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.form-grid textarea { resize: vertical; min-height: 68px; }
.form-grid .err { display: none; color: var(--danger); font-size: .82rem; font-weight: 500; margin-top: 4px; }
.form-grid .invalid .field-ctl { border-color: var(--danger); background: #fff6f6; }
.form-grid .invalid .err { display: block; }
.inline-check { display: flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 500; }
.inline-check input { width: 19px; height: 19px; accent-color: var(--violet); margin: 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.confirm-body { padding: 26px 24px 22px; }
.confirm-body h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.confirm-body p { color: var(--muted); margin-top: .5rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a11d23; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.toasts { position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 400; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 500; box-shadow: 0 14px 34px -12px rgba(20, 16, 43, .7); display: inline-flex; align-items: center; gap: .55rem; animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2); transition: opacity .3s, translate .3s; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.toast.out { opacity: 0; translate: 0 8px; }
@keyframes toast-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

.demo-foot { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 18px; }
.demo-page .site-footer { margin-top: clamp(40px, 6vw, 72px); }
.noscript { margin: 16px auto; max-width: 640px; padding: 14px 18px; border-radius: 14px; background: #fff1d6; color: #6b4300; text-align: center; }
