/* ==========================================================================
   NUNA CONTROLE · ATELIER DO ALUNO — Design system v5
   Estética: chumbo + rosa Nuna · Cinzel / Plus Jakarta Sans / JetBrains Mono
   Sem dependências externas (funciona offline / vitalício).
   ========================================================================== */

@font-face { font-family: 'Cinzel'; font-weight: 500 700; font-display: swap; src: url('fonts/Cinzel.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400 700; font-display: swap; src: url('fonts/PlusJakartaSans.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 600; font-display: swap; src: url('fonts/JetBrainsMono.woff2') format('woff2'); }

:root {
  --bg: #1E2026;
  --bg-header: #23262E;
  --panel: #272A32;
  --card: #2E323C;
  --card-hover: #343946;
  --input: #191B20;
  --line: #3A3F4D;
  --line-soft: #343844;
  --text: #F1F2F6;
  --muted: #A6ABBA;
  --dim: #98A0B3;
  --pink: #E85D9A;
  --pink-soft: #F4A9CB;
  --pink-bg: rgba(232, 93, 154, .14);
  --pink-line: rgba(232, 93, 154, .45);
  --purple: #9333EA;
  --green: #34D399;
  --green-bg: rgba(16, 185, 129, .13);
  --green-line: rgba(16, 185, 129, .42);
  --amber: #FCD34D;
  --amber-bg: rgba(245, 158, 11, .13);
  --amber-line: rgba(245, 158, 11, .42);
  --red: #FB7185;
  --red-bg: rgba(244, 63, 94, .13);
  --red-line: rgba(244, 63, 94, .42);
  --sky: #38BDF8;
  --sky-bg: rgba(56, 189, 248, .12);
  --sky-line: rgba(56, 189, 248, .38);
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --brand: 'Cinzel', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
@media (min-width: 900px) { body { padding-bottom: 32px; } }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, p { margin: 0; }
strong { font-weight: 700; }
a { color: var(--pink-soft); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--pink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.brand-font { font-family: var(--brand); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.pink { color: var(--pink-soft); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.sky { color: var(--sky); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.shrink0 { flex-shrink: 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(35, 38, 46, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-badge {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(236,72,153,.3), rgba(147,51,234,.3)); border: 1px solid rgba(244,114,182,.4);
  font-family: var(--brand); font-weight: 700; color: var(--pink-soft); font-size: 18px;
}
.logo-name { font-family: var(--brand); font-weight: 700; letter-spacing: .08em; font-size: 15px; white-space: nowrap; }
.pill-tag {
  display: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; padding: 3px 9px; border-radius: 8px;
  background: var(--pink-bg); color: var(--pink-soft); border: 1px solid var(--pink-line);
}
@media (min-width: 560px) { .pill-tag { display: inline-block; } }
.topnav { display: none; gap: 4px; background: var(--input); padding: 4px; border-radius: 14px; border: 1px solid #363B47; }
@media (min-width: 900px) { .topnav { display: flex; } }
.tabbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: .15s;
}
.tabbtn:hover { color: var(--text); }
.tabbtn[aria-current="page"] { background: var(--card); color: #fff; border-color: var(--pink-line); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.iconbtn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--input); border: 1px solid var(--line);
  font-size: 18px; transition: .15s;
}
.iconbtn:hover { background: var(--card); }
.iconbtn[aria-current="page"] { border-color: var(--pink-line); background: var(--pink-bg); }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(35, 38, 46, .97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: var(--safe-b);
}
@media (min-width: 900px) { .bottomnav { display: none; } }
.navitem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h); border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.navitem .ic { font-size: 21px; line-height: 1; filter: grayscale(.6); transition: .15s; }
.navitem[aria-current="page"] { color: var(--pink-soft); }
.navitem[aria-current="page"] .ic { filter: none; transform: translateY(-1px); }

/* ---------- Layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 18px 16px 8px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(2, 1fr); }
.cols-3 > :last-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-3 > :last-child { grid-column: auto; } }
.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .cols-4 { grid-template-columns: repeat(4, 1fr); } }
.calc-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .calc-grid { grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr); } .sticky-col { position: sticky; top: 76px; } }
.cards-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel.hl { border-color: var(--pink-line); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.card.hl { border-color: var(--pink-line); background: var(--pink-bg); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.step-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pink-bg); border: 1px solid var(--pink-line); color: var(--pink-soft); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ---------- Forms ---------- */
label.lbl { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.field { background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; height: 46px; width: 100%; font-size: 16px; }
.field:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232, 93, 154, .18); }
.field::placeholder { color: #666C7C; }
select.field { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A6ABBA' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.money { position: relative; }
.money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.money > .field { padding-left: 38px; text-align: right; font-family: var(--mono); font-weight: 600; }
.field.big { height: 56px; font-size: 24px; font-weight: 700; border-width: 2px; border-color: var(--pink-line); }
.money.bigm > span { font-size: 18px; font-weight: 700; color: var(--pink-soft); }
.field.sm { height: 44px; font-size: 16px; }
.fgrid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .fgrid.c2 { grid-template-columns: 1fr 1fr; } .fgrid.c3 { grid-template-columns: repeat(3, 1fr); } .fgrid.c4 { grid-template-columns: repeat(4, 1fr); } }
.fgrid.c2m { grid-template-columns: 1fr 1fr; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--input); color: var(--text); font-weight: 700; font-size: 14px; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--card); border-color: #4A5062; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(90deg, #EC4899, #9333EA); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(236, 72, 153, .25); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.green { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.btn.green:hover { background: rgba(16,185,129,.22); }
.btn.pinkline { background: var(--pink-bg); border-color: var(--pink-line); color: var(--pink-soft); }
.btn.pinkline:hover { background: rgba(232,93,154,.24); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red-line); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--card); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); text-align: left; min-height: 56px; transition: .15s;
}
.chip:hover { border-color: #5A6074; color: var(--text); }
.chip.on { border-color: var(--pink); background: var(--pink-bg); color: #fff; }
.chip .n { font-size: 14px; font-weight: 700; }
.chip .p { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--dim); }
.chip.on .p { color: var(--pink-soft); }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.seg { display: flex; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .seg { display: inline-flex; } }
.seg button { flex: 1 0 auto; white-space: nowrap; min-height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"], .seg button.on { background: var(--card); color: #fff; border-color: var(--pink-line); }
.seg.green button.on { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }

/* Arte presets */
.arte-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .arte-grid { grid-template-columns: repeat(3, 1fr); } }
.arte { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: .15s; }
.arte:hover { border-color: #5A6074; }
.arte.on { border-color: var(--pink); background: var(--pink-bg); box-shadow: 0 0 0 1px var(--pink) inset; }
.arte .em { font-size: 26px; line-height: 1; }
.arte .t { font-weight: 700; font-size: 15px; }
.arte .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.arte .h { font-size: 12px; margin-top: 6px; color: var(--pink-soft); font-weight: 600; }

/* Stepper */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--input); font-size: 20px; font-weight: 700; line-height: 1; display: grid; place-items: center; }
.stepper button:hover { background: var(--card-hover); }
.stepper .val { min-width: 84px; text-align: center; padding: 0 8px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--input); border: 1px solid var(--line); font-family: var(--mono); font-weight: 600; font-size: 14px; }
.mat-row { display: grid; gap: 10px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 640px) { .mat-row { grid-template-columns: minmax(0, 1fr) auto 110px; } }
.mat-row.off { opacity: .7; }

/* ---------- KPI ---------- */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-weight: 700; font-size: 22px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--dim); margin-top: 2px; }
.kpi.good { border-color: var(--green-line); background: var(--green-bg); }
.kpi.good .k { color: var(--green); font-weight: 600; }
.kpi.good .v { color: var(--green); }
.hero-kpi { background: linear-gradient(135deg, rgba(236,72,153,.16), rgba(147,51,234,.14)); border: 1px solid var(--pink-line); border-radius: var(--r-lg); padding: 20px; }
.hero-kpi .v { font-family: var(--mono); font-weight: 700; font-size: 34px; letter-spacing: -.02em; }

/* Result card */
.price-big { font-family: var(--mono); font-weight: 700; font-size: 36px; letter-spacing: -.02em; color: #fff; line-height: 1.1; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tier { text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); min-height: 64px; transition: .15s; }
.tier:hover { border-color: #5A6074; }
.tier .n { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tier .p { font-family: var(--mono); font-weight: 700; font-size: 15px; margin-top: 3px; }
.tier .m { font-size: 12px; color: var(--dim); margin-top: 1px; }
.tier.on { border-color: var(--pink); background: var(--pink-bg); }
.tier.on .n { color: var(--pink-soft); }
.health { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 14px; }
.health.ok { background: var(--green-bg); border-color: var(--green-line); }
.health.warn { background: var(--amber-bg); border-color: var(--amber-line); }
.health.bad { background: var(--red-bg); border-color: var(--red-line); }
.health .e { font-size: 20px; line-height: 1.1; }
.line-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.line-item + .line-item { border-top: 1px dashed var(--line-soft); }
.line-item .a { color: var(--muted); }
.line-item .b { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.line-total { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--line); font-weight: 700; }

/* Mobile sticky price bar */
.pricebar {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 35; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(46, 50, 60, .97); border: 1px solid var(--pink-line); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@media (min-width: 1000px) { .pricebar { display: none; } }
.pricebar .pb-p { font-family: var(--mono); font-weight: 700; font-size: 19px; line-height: 1.1; }
.pricebar .pb-l { font-size: 12px; color: var(--muted); }

/* ---------- Lists / expandable rows ---------- */
.xrow { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.xrow + .xrow { margin-top: 10px; }
.xhead { width: 100%; display: grid; gap: 4px 12px; align-items: center; padding: 14px 16px; background: transparent; border: 0; text-align: left; min-height: 64px; grid-template-columns: minmax(0, 1fr) auto; }
.xhead:hover { background: rgba(255,255,255,.02); }
.xhead .t { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xhead .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xhead .r { text-align: right; }
.xhead .r .a { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.xhead .r .b { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.xbody { padding: 4px 16px 16px; border-top: 1px solid var(--line-soft); }
.xbody .grid2 { display: grid; gap: 4px 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .xbody .grid2 { grid-template-columns: 1fr 1fr; } }
.chev { display: inline-block; transition: transform .2s; color: var(--dim); margin-left: 6px; }
.xrow.open .chev { transform: rotate(180deg); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.badge.ok { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge.warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.badge.info { background: var(--sky-bg); color: var(--sky); border-color: var(--sky-line); }
.badge.gray { background: rgba(255,255,255,.06); color: var(--muted); border-color: var(--line); }
.badge.pink { background: var(--pink-bg); color: var(--pink-soft); border-color: var(--pink-line); }
.empty { text-align: center; padding: 36px 20px; border: 1px dashed var(--line); border-radius: var(--r-lg); background: rgba(255,255,255,.015); }
.empty .em { font-size: 38px; }
.empty h3 { font-size: 17px; margin-top: 8px; }
.empty p { color: var(--muted); margin: 6px auto 16px; max-width: 420px; font-size: 14px; }

/* checklist */
.check { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); width: 100%; text-align: left; }
.check:hover { border-color: #5A6074; }
.check .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 13px; flex-shrink: 0; color: transparent; }
.check.done { opacity: .75; }
.check.done .dot { background: var(--green-bg); border-color: var(--green); color: var(--green); font-weight: 700; }
.check.done .tx { text-decoration: line-through; text-decoration-color: var(--dim); }
.progress { height: 6px; background: var(--input); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #EC4899, #9333EA); border-radius: 99px; transition: width .3s; }

/* banner */
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; border: 1px solid; font-size: 14px; }
.banner.info { background: var(--sky-bg); border-color: var(--sky-line); }
.banner.warn { background: var(--amber-bg); border-color: var(--amber-line); }
.banner.pink { background: var(--pink-bg); border-color: var(--pink-line); }

/* chart */
.chart { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 12px; }
.chart .val { fill: var(--text); font-family: var(--mono); font-weight: 600; font-size: 11px; }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8, 9, 12, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; animation: fade .15s; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 24px; } }
.sheet { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); max-height: 92vh; overflow-y: auto; animation: rise .22s ease-out; }
@media (min-width: 700px) { .sheet { border-radius: 22px; } }
.sheet.narrow { max-width: 460px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 16px; font-weight: 700; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }

/* certificate */
.cert { background: #181A20; border: 2px solid #4A4E5D; border-radius: 14px; padding: 30px 22px; text-align: center; }
.cert .c1 { font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--pink-soft); font-weight: 600; }
.cert .c2 { font-family: var(--brand); font-size: 26px; font-weight: 700; letter-spacing: .12em; margin-top: 10px; }
.cert .c3 { font-size: 14px; color: #D4D6DE; max-width: 460px; margin: 14px auto 0; line-height: 1.6; }
.cert .c4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #323642; font-size: 13px; }
.cert .c5 { display: flex; justify-content: space-around; gap: 20px; margin-top: 34px; font-size: 12px; color: var(--muted); }
.cert .c5 div { border-top: 1px solid #5A5F70; padding-top: 6px; width: 46%; }

/* toasts */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
@media (min-width: 900px) { #toasts { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; border-radius: 14px; background: #3A3F4D; border: 1px solid #555B6E; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; font-weight: 600; max-width: 520px; animation: rise .2s; }
.toast button { background: transparent; border: 0; color: var(--pink-soft); font-weight: 700; padding: 6px 8px; border-radius: 8px; min-height: 36px; }
.toast button:hover { background: rgba(255,255,255,.08); }
.has-pricebar #toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 84px); }

/* print */
@media print {
  body { background: #fff; padding: 0; }
  body * { visibility: hidden; }
  #cert-print, #cert-print * { visibility: visible; }
  #cert-print { position: fixed; left: 0; top: 0; width: 100vw; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* details/summary (progressive disclosure) */
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸'; margin-right: 8px; color: var(--pink-soft); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }

.xbody a { display: inline-block; padding: 10px 0; }
.seg button { min-height: 44px; }
