/* Love — design system v2 */
:root {
  --bg: #f7f5f8;
  --bg-glow-1: rgba(244, 63, 94, .10);
  --bg-glow-2: rgba(139, 92, 246, .09);
  --surface: #ffffff;
  --surface-2: #f3eff5;
  --surface-3: #ebe5ee;
  --line: #e6e0ea;
  --text: #17121c;
  --muted: #6a6173;
  --accent: #e11d48;
  --accent-strong: #be123c;
  --accent-soft: #ffe4ea;
  --accent-ink: #9f1239;
  --violet: #7c3aed;
  --ok: #15803d;
  --danger: #dc2626;
  --brand: linear-gradient(135deg, #f43f5e 0%, #be185d 55%, #7c3aed 130%);
  --shadow-sm: 0 1px 2px rgba(23, 18, 28, .05);
  --shadow: 0 1px 2px rgba(23, 18, 28, .04), 0 10px 30px rgba(23, 18, 28, .06);
  --shadow-lg: 0 24px 60px rgba(23, 18, 28, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Hind Siliguri", "Noto Sans Bengali", "Nirmala UI", Arial, sans-serif;
  --serif: "Fraunces", ui-serif, "Iowan Old Style", Georgia, "Hind Siliguri", "Noto Sans Bengali", "Nirmala UI", serif;
  --side-w: 272px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0a11;
  --bg-glow-1: rgba(244, 63, 94, .12);
  --bg-glow-2: rgba(139, 92, 246, .14);
  --surface: #17121d;
  --surface-2: #1f1927;
  --surface-3: #2a2234;
  --line: #2d2537;
  --text: #f6eff8;
  --muted: #a99bb3;
  --accent: #fb7185;
  --accent-strong: #f43f5e;
  --accent-soft: #3b1824;
  --accent-ink: #fda4af;
  --violet: #a78bfa;
  --ok: #4ade80;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[lang="bn"] { --serif: "Hind Siliguri", "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif; }
:root[lang="bn"] body { line-height: 1.7; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.6 var(--sans);
  background:
    radial-gradient(900px 480px at 85% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 420px at 10% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.fill { fill: currentColor; stroke: none; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.big { font: 600 22px/1.3 var(--serif); letter-spacing: -.01em; }
.sub, .hint, .meta { color: var(--muted); }
.hint { font-size: 12.5px; }
.meta { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px;
  color: #efe6f3; background: linear-gradient(180deg, #1c1024 0%, #12091a 100%); border-right: 1px solid rgba(255, 255, 255, .06);
  overflow-y: auto; z-index: 60;
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(244, 63, 94, .35); }
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font: 600 22px/1.1 var(--serif); letter-spacing: .01em; color: #fff; }
.brand-text small { font-size: 11px; color: #b8a8c2; letter-spacing: .02em; }
.nav { display: grid; gap: 18px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8c7b98; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: #cdbfd6; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(244, 63, 94, .22), rgba(244, 63, 94, .06)); color: #fff; font-weight: 600; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #fb7185; }
.nav a em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 6px; }
.streak-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-weight: 600; font-size: 13px; color: #ffd9e0; }
.streak-card .icon { color: #fb923c; }
.foot-note { font-size: 11.5px; color: #8c7b98; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; min-width: 0; }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs h1 { font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.only-mobile, .menu-btn { display: none; }
.sidebar .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #fff; }
.lang-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.lang-pill select { border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--text); padding: 0 6px 0 0; cursor: pointer; outline: none; }
.lang-pill:focus-within { border-color: var(--accent); }
.avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: var(--brand); font-weight: 700; box-shadow: var(--shadow-sm); }
.avatar #avatar-letter { display: none; }
.avatar.has-letter #avatar-letter { display: block; }
.avatar.has-letter .icon { display: none; }
#view { padding: 32px; max-width: 1280px; margin: 0 auto; outline: none; }

/* ---------- Page head + workspace ---------- */
.page-head { margin-bottom: 24px; }
.eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow.light { color: #ffd1da; }
.page-head h2 { margin-top: 6px; font: 600 34px/1.15 var(--serif); letter-spacing: -.02em; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 640px; font-size: 15.5px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.panel { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 0; background: var(--surface-2); font-weight: 650; text-align: left; border-bottom: 1px solid var(--line); cursor: default; }
.panel-head .chev { margin-left: auto; display: none; transition: transform .2s; }
.panel-body { padding: 18px; display: grid; gap: 22px; max-height: calc(100vh - 170px); overflow-y: auto; }
.opt-group { display: grid; gap: 10px; }
.tip { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; }
.tip .icon { margin-top: 2px; }

/* ---------- Cards, buttons, fields ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 16px; font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title h3 { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.count { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); font-size: 12px; color: var(--muted); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .1s, background .15s, border-color .15s, box-shadow .15s, filter .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.lg { min-height: 46px; padding: 0 22px; border-radius: 13px; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.primary { color: #fff; border-color: transparent; background: var(--brand); box-shadow: 0 8px 22px rgba(190, 18, 60, .28); }
.btn.primary:hover { filter: brightness(1.07); background: var(--brand); }
.btn.light { background: #fff; color: #9f1239; border-color: transparent; }
.btn.light:hover { background: #fff1f3; }
.btn.ghost-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .24); }
.btn.danger { color: var(--danger); }
.btn.icon-only { width: 34px; padding: 0; }
.btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn.on .icon { fill: currentColor; }

.label { display: block; margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field, .select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.field { min-height: 130px; resize: vertical; line-height: 1.6; }
.group { margin-top: 16px; }
.group:first-of-type { margin-top: 14px; }
.select-wrap { min-width: 150px; }

/* segmented + option list */
.seg { display: inline-flex; width: 100%; padding: 4px; gap: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn { flex: 1; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s, box-shadow .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .seg-btn[aria-checked="true"] { background: var(--surface-3); color: var(--accent); }
.main .row > .seg { width: auto; min-width: 220px; }
.optlist { display: grid; gap: 6px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, background .15s; }
.opt:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.opt-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: border-color .15s; }
.opt-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.opt-text b { font-weight: 600; font-size: 14px; }
.opt-text small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.opt em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-checked="true"] .opt-radio { border-color: var(--accent); }
.opt[aria-checked="true"] .opt-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chip-static { display: inline-flex; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.chip-static.alt { background: var(--surface-3); color: var(--muted); }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }

.swatches, .stickers { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: linear-gradient(135deg, var(--a), var(--b)); transition: transform .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.sticker { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; }
.sticker[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Results ---------- */
.result {
  position: relative; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
}
.result + .result { margin-top: 12px; }
.result p { white-space: pre-wrap; font-size: 15.5px; line-height: 1.65; }
.result .tag { display: inline-block; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.result .tools, .paper-wrap .tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.animate .result { animation: rise .4s ease both; animation-delay: calc(var(--i, 0) * 60ms); }
.result.poem p { font: italic 19px/1.8 var(--serif); }
:root[lang="bn"] .result.poem p { font-style: normal; }
.result.daily { border-left-width: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface)); }
.convo + .convo { margin-top: 26px; }
.convo-head { display: grid; gap: 10px; margin-bottom: 12px; justify-items: start; }
.emotion { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--muted)) 22%, transparent); }
.bubble { max-width: 88%; padding: 11px 16px; border-radius: 18px; font-size: 14.5px; white-space: pre-wrap; }
.bubble.them { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.me { margin-left: auto; color: #fff; background: var(--brand); border-bottom-right-radius: 5px; }
.chat { display: grid; gap: 10px; }
.paper-wrap { display: grid; }
.paper { width: 100%; min-height: 340px; padding: 28px 30px; border-radius: 16px; border: 1px solid var(--line); resize: vertical; font: 17px/1.9 var(--serif); color: var(--text); background: repeating-linear-gradient(transparent 0 33px, color-mix(in srgb, var(--line) 70%, transparent) 33px 34px), var(--surface); box-shadow: var(--shadow); }
.paper:focus { outline: none; border-color: var(--accent); }

.empty { display: grid; justify-items: center; gap: 6px; padding: 38px 20px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty b { color: var(--text); font-size: 15px; }
.empty p { max-width: 340px; font-size: 13.5px; }
.empty-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 6px; }
.empty-ic .icon { width: 24px; height: 24px; }

.skeleton { display: grid; gap: 10px; border-left-color: var(--line); }
.skeleton i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; display: grid; padding: 38px; border-radius: 26px; color: #fff; background: var(--brand); box-shadow: 0 24px 60px rgba(190, 18, 60, .28); }
.hero h2 { margin-top: 8px; font: 600 38px/1.15 var(--serif); letter-spacing: -.02em; }
.hero p { margin-top: 10px; max-width: 520px; color: #ffe4ea; font-size: 16px; }
.hero > div:first-child { position: relative; z-index: 1; }
.hero-art span { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-art span:nth-child(1) { width: 320px; height: 320px; right: -60px; top: -90px; }
.hero-art span:nth-child(2) { width: 200px; height: 200px; right: 140px; bottom: -110px; background: rgba(255, 255, 255, .08); }
.hero-art span:nth-child(3) { width: 90px; height: 90px; right: 60px; bottom: 40px; background: rgba(255, 255, 255, .16); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.stat { position: relative; display: grid; gap: 2px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat b { font: 600 28px/1.15 var(--serif); }
.stat > span:last-child { font-size: 12.5px; color: var(--muted); }
.stat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 8px; color: var(--accent); background: var(--accent-soft); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { position: relative; display: grid; gap: 6px; align-content: start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--brand); margin-bottom: 6px; }
.tile b { font-size: 15.5px; }
.tile p { color: var(--muted); font-size: 13.5px; }
.tile-go { position: absolute; top: 18px; right: 18px; color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; }
.tile:hover .tile-go { opacity: 1; transform: translateX(3px); }

/* ---------- Dates, mood, card, tools ---------- */
.spin { text-align: center; padding: 30px 22px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)), var(--surface)); }
.spin h3 { margin: 8px 0; font: 600 30px/1.2 var(--serif); letter-spacing: -.01em; }
.spin p { color: var(--muted); max-width: 520px; margin: 0 auto; }
.ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.idea { display: grid; gap: 10px; align-content: space-between; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.idea:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.idea h4 { font-size: 15.5px; }
.idea p { color: var(--muted); font-size: 14px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.step b { display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.step p { font-size: 15.5px; line-height: 1.65; }
.step-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.step.say .step-ic { background: linear-gradient(135deg, #10b981, #047857); }
.step.avoid .step-ic { background: linear-gradient(135deg, #f87171, #b91c1c); }
.step.do .step-ic { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.step .tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card-stage { display: grid; place-items: center; padding: 28px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 22px 22px; }
#card-canvas { width: min(100%, 380px); height: auto; border-radius: 20px; box-shadow: var(--shadow-lg); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
.countdown div { padding: 18px 6px; border-radius: 16px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.countdown b { display: block; font: 600 34px/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--accent-strong); }
:root[data-theme="dark"] .countdown b { color: var(--accent); }
.countdown span { display: block; margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.prompt { font: italic 20px/1.5 var(--serif); }
:root[lang="bn"] .prompt { font-style: normal; }
.list-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item p { white-space: pre-wrap; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .4s; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; text-align: left; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; transition: border-color .15s, background .15s; }
.option + .option { margin-top: 10px; }
.option span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.option:hover:not([disabled]) { border-color: var(--accent); }
.option.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.option.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.option[disabled] { cursor: default; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
.hints { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.feedback .fb-top { display: flex; gap: 22px; align-items: center; }
.feedback p { margin-top: 6px; }

.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray .6s; }
.ring-n { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-n b { font: 600 28px/1 var(--serif); }
.ring-n span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ring.sm { width: 68px; height: 68px; }
.ring.sm .ring-n b { font-size: 17px; }
.ring.sm .ring-n span { display: none; }
.center .ring { margin: 0 auto; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.badge { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); opacity: .6; }
.badge.on { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.badge .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--muted); flex: none; }
.badge.on .ic { color: #fff; background: var(--brand); }
.badge b { display: block; font-size: 14px; }
.badge small { color: var(--muted); font-size: 12.5px; }
.prefs { display: grid; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.pref:first-child { border-top: 0; padding-top: 0; }
.pref b { display: block; font-size: 14.5px; }
.pref small { color: var(--muted); font-size: 13px; }

/* ---------- Overlays ---------- */
.toast-box { position: fixed; top: 18px; right: 18px; z-index: 300; display: grid; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: slide .3s ease both; }
.toast .icon { color: #34d399; }
.toast.out { opacity: 0; transform: translateX(16px); transition: all .25s; }
dialog { border: 1px solid var(--line); border-radius: 22px; padding: 26px; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 6, 14, .55); backdrop-filter: blur(4px); }
dialog h3 { font: 600 24px/1.2 var(--serif); margin-bottom: 4px; }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 400; }
.nav-overlay { display: none; }
.bottomnav { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.view-in { animation: rise .35s ease both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .panel { position: static; order: -1; }
  .panel-head { cursor: pointer; }
  .panel-head .chev { display: block; }
  .panel.collapsed .panel-body { display: none; }
  .panel.collapsed .chev { transform: rotate(-90deg); }
  .panel-body { max-height: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .icon-btn.only-mobile, .menu-btn { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .nav-overlay { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 6, 14, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav a[aria-current="page"]::before { left: -14px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .crumbs span, .crumbs i { display: none; }
  .crumbs h1 { font-size: 16px; }
  #ai-toggle span { display: none; }
  #ai-toggle { width: 36px; padding: 0; }
  .lang-pill { padding-left: 8px; }
  #view { padding: 20px 16px 110px; }
  .page-head h2 { font-size: 28px; }
  .hero { padding: 26px 22px; }
  .hero h2 { font-size: 30px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  .bottomnav a, .bottomnav button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 12px; }
  .bottomnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .toast-box { top: auto; bottom: 86px; right: 14px; left: 14px; }
  .toast { max-width: none; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles, .ideas, .cols { grid-template-columns: 1fr; }
  .countdown b { font-size: 26px; }
  .feedback .fb-top { flex-direction: column; align-items: flex-start; }
  .main .row > .seg { width: 100%; }
  .paper { padding: 20px; }
}
@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #card-canvas, #card-canvas * { visibility: visible; }
  #card-canvas { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 90vw; max-height: 90vh; box-shadow: none; }
}

/* Bengali: letter-spacing breaks conjunct rendering, and there is no letter case */
:root[lang="bn"] * { letter-spacing: 0 !important; text-transform: none !important; }
:root[lang="bn"] .nav-label, :root[lang="bn"] .label, :root[lang="bn"] .eyebrow { font-size: 12.5px; }
