:root {
  color-scheme: light;
  --ink: #17243b;
  --ink-soft: #66738a;
  --muted: #91a0b5;
  --paper: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --line: #e7ebf3;
  --navy: #111d33;
  --navy-soft: #1b2b47;
  --accent: #ffb84d;
  --accent-dark: #e69626;
  --green: #39a889;
  --red: #df696e;
  --blue: #638ce4;
  --violet: #8c79da;
  --shadow: 0 18px 48px rgba(27, 45, 77, .08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(255,184,77,.55); outline-offset: 3px; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(1px); opacity: .48; }
.ambient-one { width: 420px; height: 420px; top: -240px; right: 12%; background: radial-gradient(circle, rgba(255,202,130,.28), transparent 68%); }
.ambient-two { width: 500px; height: 500px; bottom: -300px; left: 18%; background: radial-gradient(circle, rgba(123,163,232,.16), transparent 67%); }
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; max-width: 1800px; margin: 0 auto; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; min-height: 720px; padding: 28px 17px 18px; display: flex; flex-direction: column; color: #eef3fb; background: var(--navy); overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 3px 8px 32px; text-decoration: none; }
.brand-mark { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.06; letter-spacing: .075em; }
.brand-copy strong { font-size: 10px; font-weight: 850; color: #fff; }
.brand-copy b { font-size: 18px; font-weight: 900; color: var(--accent); letter-spacing: .045em; }
.brand-copy small { margin-top: 6px; color: #8e9bb1; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-label { padding: 0 13px 10px; color: #74839b; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.side-nav { display: grid; gap: 6px; }
.nav-link { width: 100%; min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 12px; color: #aab6c9; background: transparent; text-align: left; font-size: 13px; font-weight: 650; transition: background .2s, color .2s, transform .2s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-link.active { color: #fff; background: #243550; box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; color: #f6bd65; font-size: 18px; }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 9px; color: #1c2a43; background: var(--accent); text-align: center; font-size: 10px; font-weight: 850; }
.sidebar-bottom { margin-top: auto; }
.sidebar-case-card { margin: 34px 4px 17px; padding: 16px 15px 15px; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: linear-gradient(145deg, #20324e, #182740); }
.case-card-top { display: flex; align-items: center; gap: 7px; color: #a3b1c6; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ed0a4; box-shadow: 0 0 0 4px rgba(94,208,164,.12); }
.sidebar-case-card strong { display: block; margin-top: 11px; font-size: 14px; color: #fff; }
.sidebar-case-card p { margin: 6px 0 12px; color: #9eacc0; font-size: 11px; line-height: 1.55; }
.text-action { padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 11px; font-weight: 800; }
.text-action span { margin-left: 5px; }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 12px 8px 12px; border-top: 1px solid rgba(255,255,255,.09); }
.avatar-mini { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #2a3d5a; font-size: 19px; }
.sidebar-user-copy { min-width: 0; display: grid; gap: 1px; }
.sidebar-user-copy strong { overflow: hidden; max-width: 126px; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { color: #8290a6; font-size: 9px; }
.dots-button { margin-left: auto; border: 0; color: #8f9cb0; background: transparent; letter-spacing: 2px; }
.sidebar-foot { padding: 10px 8px 0; color: #60718a; font-size: 9px; }

/* Main layout */
.main-panel { min-width: 0; padding: 0 42px 22px; }
.topbar { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: #9aa6b8; font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.topbar h1 { margin: 4px 0 0; color: var(--ink); font-size: 22px; line-height: 1.22; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.coin-pill { display: flex; align-items: baseline; gap: 6px; padding: 9px 13px; border: 1px solid #f1e4ce; border-radius: 30px; color: #a36a18; background: #fff9ef; }
.coin-pill span { color: #e6a43e; font-size: 18px; }
.coin-pill b { font-size: 13px; }
.coin-pill small { color: #a88b62; font-size: 9px; }
.icon-button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); background: var(--surface); font-size: 18px; }
.profile-button { min-height: 39px; display: flex; align-items: center; gap: 8px; padding: 4px 9px 4px 5px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 750; }
.profile-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #edf1fa; font-size: 17px; }
.chevron { color: #95a0b1; font-size: 15px; }
.app-content { min-height: calc(100vh - 163px); padding: 28px 0 44px; }
.main-footer { display: flex; justify-content: space-between; gap: 15px; padding: 17px 0 0; border-top: 1px solid var(--line); color: #9aa5b5; font-size: 10px; }
.main-footer div { display: flex; gap: 10px; }
.main-footer a { color: #7e8ba0; text-decoration: none; }
.main-footer a:hover { color: var(--ink); }
.loading-state { min-height: 380px; display: grid; align-content: center; justify-items: center; gap: 10px; color: var(--ink-soft); }
.loading-mark { font-size: 35px; animation: bob 1.3s ease-in-out infinite; }
.loading-state strong { color: var(--ink); font-size: 16px; }
.loading-state span { font-size: 12px; }

/* Shared elements */
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.035em; }
.section-heading p { max-width: 570px; margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.section-kicker { color: #9aa6b8; font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-size: 11px; font-weight: 850; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary { color: #17233a; background: var(--accent); box-shadow: 0 6px 14px rgba(232,157,48,.15); }
.button-primary:hover { background: #ffc66e; box-shadow: 0 8px 18px rgba(232,157,48,.23); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button-secondary:hover { border-color: #cbd4e4; background: var(--surface-2); }
.button-quiet { color: var(--ink-soft); border-color: var(--line); background: transparent; }
.button-wide { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 20px; color: #69758b; background: #f0f3f8; font-size: 9px; font-weight: 800; }
.pill.green { color: #23876c; background: #e8f7f1; }
.pill.orange { color: #ad741e; background: #fff3df; }
.pill.blue { color: #5478c1; background: #edf2ff; }
.pill.red { color: #b94f58; background: #fff0f0; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 7px 24px rgba(30,48,78,.035); }
.muted { color: var(--ink-soft); }
.small-text { color: var(--muted); font-size: 10px; }
.empty-state { padding: 34px 20px; border: 1px dashed #d8dfeb; border-radius: 16px; color: var(--ink-soft); text-align: center; }

/* Dashboard */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .75fr); gap: 18px; }
.hero-card { position: relative; min-height: 242px; display: flex; align-items: center; overflow: hidden; padding: 29px 30px; border-radius: 22px; color: #f7f9fd; background: radial-gradient(circle at 88% 18%, rgba(255,184,77,.18), transparent 26%), linear-gradient(115deg, #172842 0%, #233755 65%, #293b5c 100%); box-shadow: 0 16px 34px rgba(24,41,69,.15); }
.hero-copy { position: relative; z-index: 1; max-width: 64%; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: #b7c4d6; font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.hero-kicker span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-card h2 { margin: 12px 0 8px; font-size: clamp(24px, 3vw, 33px); line-height: 1.13; letter-spacing: -.045em; }
.hero-card h2 em { color: var(--accent); font-style: normal; }
.hero-card p { max-width: 420px; margin: 0 0 19px; color: #b5c1d2; font-size: 11px; line-height: 1.7; }
.hero-visual { position: absolute; right: 13px; bottom: -8px; width: 235px; height: 235px; opacity: .96; }
.hero-visual img { width: 100%; height: 100%; object-fit: contain; }
.hero-visual .hero-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 132px; filter: drop-shadow(0 16px 18px rgba(0,0,0,.2)); }
.hero-visual .hero-fallback svg { width: 100%; height: 100%; }
.level-card { min-height: 242px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.level-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.level-symbol { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; color: #ab762d; background: #fff3df; font-size: 21px; }
.level-card h3 { margin: 13px 0 2px; font-size: 17px; letter-spacing: -.02em; }
.level-card p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.xp-numbers { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 7px; }
.xp-numbers strong { font-size: 17px; }
.xp-numbers small { color: var(--muted); font-size: 9px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 9px; background: #edf0f5; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f8af42, #ffd17e); transition: width .45s ease; }
.progress-caption { display: flex; justify-content: space-between; margin-top: 7px; color: #98a3b3; font-size: 9px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 17px 0 28px; }
.stat-card { min-height: 80px; display: flex; align-items: center; gap: 12px; padding: 15px 17px; }
.stat-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 13px; font-size: 19px; background: #f1f3fc; }
.stat-icon.gold { color: #b98023; background: #fff4e2; }
.stat-icon.green { color: #299477; background: #e9f8f2; }
.stat-icon.blue { color: #5c7fc8; background: #edf2ff; }
.stat-copy small { display: block; color: var(--muted); font-size: 9px; }
.stat-copy strong { display: block; margin-top: 1px; font-size: 18px; line-height: 1.2; }
.stat-copy em { margin-left: 4px; color: #9ba6b7; font-size: 9px; font-style: normal; }
.quest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.quest-card { position: relative; min-height: 210px; overflow: hidden; padding: 17px 16px 15px; transition: transform .2s, box-shadow .2s; }
.quest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quest-card::after { position: absolute; right: -25px; top: -32px; width: 110px; height: 110px; content: ""; border-radius: 50%; background: var(--quest-tint, #f0efff); opacity: .95; }
.quest-card[data-color="green"] { --quest-tint: #e8f7f0; --quest-color: #44a889; }
.quest-card[data-color="violet"] { --quest-tint: #f0edff; --quest-color: #8876d7; }
.quest-card[data-color="orange"] { --quest-tint: #fff2df; --quest-color: #e4a247; }
.quest-card[data-color="blue"] { --quest-tint: #ebf1ff; --quest-color: #6f91de; }
.quest-emoji { position: relative; z-index: 1; width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: var(--quest-tint); font-size: 23px; }
.quest-card h3 { position: relative; z-index: 1; margin: 14px 0 5px; font-size: 14px; letter-spacing: -.02em; }
.quest-card p { min-height: 34px; margin: 0 0 11px; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.quest-meta { display: flex; align-items: center; justify-content: space-between; color: #9aa5b5; font-size: 9px; }
.quest-open { border: 0; color: var(--quest-color); background: transparent; font-size: 11px; font-weight: 850; }
.quest-mini-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 5px; background: #edf0f5; }
.quest-mini-progress span { height: 100%; display: block; border-radius: inherit; background: var(--quest-color); }
.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 15px; margin-top: 26px; }
.daily-card { display: flex; align-items: center; gap: 17px; padding: 18px 19px; }
.daily-art { width: 53px; height: 53px; flex: 0 0 53px; display: grid; place-items: center; border-radius: 16px; background: #fff2df; font-size: 25px; }
.daily-copy { flex: 1; }
.daily-copy small { color: #b27b2f; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.daily-copy strong { display: block; margin: 3px 0; font-size: 13px; }
.daily-copy p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.streak-card { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; }
.streak-card strong { display: block; font-size: 18px; }
.streak-card small { color: var(--ink-soft); font-size: 10px; }
.streak-flame { font-size: 28px; }

/* Quests */
.back-link { margin: 0 0 16px; padding: 0; border: 0; color: #8793a7; background: transparent; font-size: 11px; font-weight: 750; }
.quest-header-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 18px; }
.quest-header-icon { width: 62px; height: 62px; display: grid; place-items: center; flex: 0 0 62px; border-radius: 19px; background: var(--quest-tint, #f0edff); font-size: 31px; }
.quest-header-card h2 { margin: 2px 0 5px; font-size: 21px; letter-spacing: -.04em; }
.quest-header-card p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.quest-header-side { margin-left: auto; min-width: 120px; text-align: right; }
.quest-header-side strong { display: block; font-size: 15px; }
.quest-header-side small { color: var(--muted); font-size: 9px; }
.question-card { max-width: 900px; margin: 0 auto; padding: 25px; }
.question-progress-row { display: flex; justify-content: space-between; margin-bottom: 12px; color: #8d99ac; font-size: 10px; font-weight: 750; }
.question-progress-row strong { color: var(--ink); }
.question-card h2 { margin: 21px 0 19px; font-size: clamp(18px, 2.4vw, 23px); line-height: 1.35; letter-spacing: -.025em; }
.answer-list { display: grid; gap: 9px; }
.answer-option { width: 100%; display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); text-align: left; font-size: 12px; line-height: 1.55; transition: border .18s, background .18s, transform .18s; }
.answer-option:not(:disabled):hover { transform: translateX(2px); border-color: #f1bf70; background: #fffaf1; }
.answer-letter { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 8px; color: #7d8aa0; background: #f0f3f8; font-size: 10px; font-weight: 850; }
.answer-option.correct { border-color: #65c5a5; color: #226e59; background: #eefaf5; }
.answer-option.correct .answer-letter { color: #fff; background: #43b18b; }
.answer-option.wrong { border-color: #e8a3a5; color: #a24f56; background: #fff5f5; }
.answer-option.wrong .answer-letter { color: #fff; background: #d9777d; }
.answer-option:disabled { cursor: default; }
.answer-feedback { margin-top: 17px; padding: 15px 16px; border-radius: 13px; background: #f3f7fd; }
.answer-feedback.good { border: 1px solid #cdeee1; background: #f0faf5; }
.answer-feedback.bad { border: 1px solid #f2dddd; background: #fff7f6; }
.feedback-title { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-size: 12px; font-weight: 850; }
.answer-feedback p { margin: 0; color: #66738a; font-size: 11px; line-height: 1.65; }
.question-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.question-footer small { color: #9aa6b5; font-size: 9px; }
.quest-complete { max-width: 700px; margin: 24px auto; padding: 36px 28px; text-align: center; }
.complete-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 25px; background: #fff3df; font-size: 37px; }
.quest-complete h2 { margin: 5px 0 7px; font-size: 25px; }
.quest-complete p { max-width: 490px; margin: 0 auto 18px; color: var(--ink-soft); font-size: 12px; }
.reward-row { display: flex; justify-content: center; gap: 9px; margin: 18px 0 22px; }
.reward-chip { padding: 8px 12px; border-radius: 22px; color: #9b6b22; background: #fff4e2; font-size: 11px; font-weight: 850; }

/* Training */
.training-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.training-card { min-height: 218px; padding: 22px; }
.training-card-top { display: flex; align-items: center; justify-content: space-between; }
.training-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 15px; font-size: 25px; background: #eef2ff; }
.training-card h3 { margin: 14px 0 5px; font-size: 16px; }
.training-card p { max-width: 420px; margin: 0 0 17px; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }
.trainer-panel { max-width: 860px; margin: 0 auto; padding: 24px; }
.trainer-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.trainer-top h2 { margin: 0; font-size: 19px; }
.trainer-top p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 19px; }
.budget-summary div { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.budget-summary small { display: block; color: var(--muted); font-size: 9px; }
.budget-summary strong { display: block; margin-top: 3px; font-size: 16px; }
.budget-envelope-list { display: grid; gap: 11px; }
.envelope-row { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(100px, 1.5fr) 100px; align-items: center; gap: 12px; }
.envelope-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 750; }
.envelope-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #f1f4fa; font-size: 16px; }
.envelope-row input[type="range"] { width: 100%; accent-color: #e9a33e; }
.envelope-row input[type="number"] { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); text-align: right; font-weight: 750; }
.budget-total-bar { display: flex; justify-content: space-between; margin: 15px 0 5px; color: var(--ink-soft); font-size: 10px; }
.budget-total-bar strong { color: var(--ink); }
.event-card { display: flex; align-items: center; gap: 13px; margin: 18px 0; padding: 15px; border: 1px solid #f1dfc2; border-radius: 13px; background: #fff9ef; }
.event-icon { width: 41px; height: 41px; flex: 0 0 41px; display: grid; place-items: center; border-radius: 12px; background: #ffedce; font-size: 20px; }
.event-card strong { display: block; font-size: 12px; }
.event-card p { margin: 3px 0 0; color: #8d7756; font-size: 10px; }
.event-cost { margin-left: auto; color: #a76e1d; font-size: 15px; font-weight: 900; white-space: nowrap; }
.budget-result { margin-top: 15px; padding: 16px; border-radius: 13px; background: var(--surface-2); }
.budget-result h3 { margin: 0 0 5px; font-size: 14px; }
.budget-result p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.scam-card { max-width: 640px; margin: 16px auto; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.scam-browser { display: flex; align-items: center; gap: 5px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.browser-dot { width: 7px; height: 7px; border-radius: 50%; background: #e6b2a7; }
.browser-dot:nth-child(2) { background: #e7c77e; }
.browser-dot:nth-child(3) { background: #8fc9a9; }
.browser-label { margin-left: auto; color: #a1aabc; font-size: 9px; }
.scam-message { padding: 20px; }
.scam-channel { display: inline-flex; padding: 5px 8px; border-radius: 6px; color: #6e7c95; background: #edf1f8; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.scam-message h3 { margin: 12px 0 5px; font-size: 15px; }
.scam-sender { margin-bottom: 15px; color: #8995a8; font-size: 10px; }
.scam-message-body { padding: 15px; border: 1px solid #edf0f5; border-radius: 12px; color: #4e5e75; background: #fbfcfe; font-size: 12px; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.scam-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.scam-actions button { min-height: 46px; border-radius: 11px; font-size: 11px; font-weight: 850; }
.scam-feedback { margin: 0 20px 20px; padding: 15px; border-radius: 12px; background: var(--surface-2); }
.scam-feedback h4 { margin: 0 0 5px; font-size: 12px; }
.scam-feedback p { margin: 0 0 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.flag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.flag-tag { padding: 5px 8px; border-radius: 7px; color: #8d6a37; background: #fff3df; font-size: 9px; }

/* Knowledge */
.knowledge-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-field { min-width: 200px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search-field span { color: #9ba6b5; }
.search-field input { width: 100%; height: 39px; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 11px; }
.filter-chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: #748197; background: var(--surface); font-size: 10px; font-weight: 750; }
.filter-chip.active { border-color: #efc783; color: #94641e; background: #fff7e9; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.fact-card { min-height: 190px; display: flex; flex-direction: column; padding: 17px; }
.fact-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fact-category { color: #9b7a4d; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.favorite-button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 9px; color: #9aa5b4; background: var(--surface); font-size: 16px; }
.favorite-button.active { border-color: #f2d3a2; color: #d99a37; background: #fff6e8; }
.fact-card h3 { margin: 13px 0 7px; font-size: 13px; }
.fact-card p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.fact-tip { margin-top: auto; padding-top: 12px; color: #4e8d79; font-size: 10px; line-height: 1.5; }
.fact-tip strong { color: #2e9a79; }
.fact-feature { display: flex; align-items: center; gap: 16px; padding: 19px; margin-bottom: 17px; background: linear-gradient(110deg, #fff8ec, #fff); border-color: #f2e4cd; }
.fact-feature-icon { width: 51px; height: 51px; display: grid; place-items: center; flex: 0 0 51px; border-radius: 15px; background: #ffeed1; font-size: 25px; }
.fact-feature-copy { flex: 1; }
.fact-feature-copy small { color: #b1823d; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.fact-feature-copy strong { display: block; margin: 3px 0; font-size: 14px; }
.fact-feature-copy p { margin: 0; color: #8a7b65; font-size: 10px; }

/* Profile / Leaderboard */
.profile-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 15px; }
.profile-card { padding: 22px; }
.profile-identity { display: flex; align-items: center; gap: 13px; }
.profile-big-avatar { width: 61px; height: 61px; display: grid; place-items: center; border-radius: 19px; background: #edf2fb; font-size: 31px; }
.profile-identity h2 { margin: 0; font-size: 18px; }
.profile-identity p { margin: 3px 0 0; color: var(--ink-soft); font-size: 10px; }
.profile-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 20px; }
.profile-detail { padding: 12px; border-radius: 11px; background: var(--surface-2); }
.profile-detail small { display: block; color: var(--muted); font-size: 9px; }
.profile-detail strong { display: block; margin-top: 2px; font-size: 15px; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.achievement { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.achievement.locked { opacity: .48; filter: grayscale(1); }
.achievement-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 10px; background: #fff4e2; font-size: 18px; }
.achievement strong { display: block; font-size: 10px; }
.achievement small { display: block; color: var(--muted); font-size: 8px; line-height: 1.4; }
.leaderboard-card { overflow: hidden; }
.leaderboard-row { display: grid; grid-template-columns: 35px minmax(0,1fr) 90px; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.leaderboard-row:last-child { border-bottom: 0; }
.rank-number { color: #9aa6b7; font-size: 11px; font-weight: 850; }
.rank-number.top { color: #b77c28; }
.rank-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rank-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-size: 17px; }
.rank-person strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { text-align: right; color: #a16f25; font-size: 11px; font-weight: 850; }

/* Modal / cookie / toast */
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(10,18,32,.62); backdrop-filter: blur(6px); }
.modal { position: relative; width: min(100%, 480px); max-height: min(92vh, 850px); overflow: auto; padding: 28px; border: 1px solid rgba(255,255,255,.6); border-radius: 22px; background: var(--surface); box-shadow: 0 26px 90px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 31px; height: 31px; border: 0; border-radius: 50%; color: #7f8ba0; background: var(--surface-2); font-size: 20px; }
.modal-emblem { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 17px; background: #fff2de; font-size: 26px; }
.centered { text-align: center; }
.modal h2 { margin: 5px 0 6px; text-align: center; font-size: 22px; letter-spacing: -.04em; }
.modal-lead { max-width: 350px; margin: 0 auto 17px; color: var(--ink-soft); text-align: center; font-size: 11px; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin-bottom: 15px; border-radius: 11px; background: var(--surface-2); }
.auth-tab { min-height: 35px; border: 0; border-radius: 8px; color: #8994a6; background: transparent; font-size: 10px; font-weight: 850; }
.auth-tab.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(25,40,67,.08); }
.auth-form { display: grid; gap: 11px; }
.auth-form > label:not(.consent-line) { display: grid; gap: 5px; color: #657187; font-size: 10px; font-weight: 750; }
.auth-form input:not([type="checkbox"]):not([type="radio"]) { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: var(--surface); font-size: 11px; }
.auth-form input:focus { border-color: #efbb67; box-shadow: 0 0 0 3px rgba(255,184,77,.12); }
.avatar-picker { display: grid; gap: 7px; }
.field-title { color: #657187; font-size: 10px; font-weight: 750; }
.avatar-options { display: flex; gap: 7px; flex-wrap: wrap; }
.avatar-options label { position: relative; cursor: pointer; }
.avatar-options input { position: absolute; opacity: 0; }
.avatar-options span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 19px; }
.avatar-options input:checked + span { border-color: #eeb45d; background: #fff5e3; box-shadow: 0 0 0 2px rgba(238,180,93,.13); }
.consent-line { display: flex; align-items: flex-start; gap: 8px; color: #78859a; font-size: 9px; line-height: 1.5; }
.consent-line input { flex: 0 0 auto; margin: 2px 0 0; accent-color: #d99a37; }
.consent-line a { color: #9c6c28; }
.form-note { color: #9ba6b5; text-align: center; font-size: 9px; }
.guest-transfer-note { margin-top: 13px; padding: 10px; border-radius: 9px; color: #78849a; background: var(--surface-2); text-align: center; font-size: 9px; }
.cookie-banner { position: fixed; z-index: 45; left: 50%; bottom: 18px; width: min(900px, calc(100% - 30px)); display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 50px rgba(25,40,67,.2); transform: translateX(-50%); }
.cookie-symbol { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 12px; color: #b07a2a; background: #fff4e1; font-size: 21px; }
.cookie-copy { flex: 1; }
.cookie-copy strong { display: block; margin-bottom: 2px; font-size: 11px; }
.cookie-copy p { margin: 0; color: var(--ink-soft); font-size: 9px; line-height: 1.5; }
.cookie-copy a { color: #a16f28; }
.cookie-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.cookie-actions .button { min-height: 34px; padding: 0 10px; font-size: 9px; }
.toast-stack { position: fixed; z-index: 70; top: 18px; right: 18px; display: grid; gap: 8px; width: min(340px, calc(100% - 36px)); }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 11px; animation: toastIn .22s ease-out; }
.toast.error { border-color: #efc5c6; }
.toast.success { border-color: #bce7d7; }

/* Dark theme */
html[data-theme="dark"] { color-scheme: dark; --ink: #edf2fb; --ink-soft: #a5b1c5; --muted: #7f8ca2; --paper: #0e1728; --surface: #17243a; --surface-2: #1d2b43; --line: #2a3a55; --navy: #0a1322; --shadow: 0 18px 48px rgba(0,0,0,.22); }
html[data-theme="dark"] .sidebar { background: #091322; }
html[data-theme="dark"] .topbar h1 { color: var(--ink); }
html[data-theme="dark"] .coin-pill { border-color: #5d482b; color: #f0c37f; background: #302719; }
html[data-theme="dark"] .profile-avatar, html[data-theme="dark"] .stat-icon, html[data-theme="dark"] .envelope-icon { background: #263650; }
html[data-theme="dark"] .progress-track, html[data-theme="dark"] .quest-mini-progress { background: #2a3a52; }
html[data-theme="dark"] .answer-option { color: var(--ink); background: #17243a; }
html[data-theme="dark"] .answer-option:not(:disabled):hover { background: #2d2b27; }
html[data-theme="dark"] .answer-feedback { background: #1d2c43; }
html[data-theme="dark"] .answer-feedback p { color: #a8b4c7; }
html[data-theme="dark"] .answer-feedback.good { border-color: #2f6759; background: #1b342f; }
html[data-theme="dark"] .answer-feedback.bad { border-color: #704247; background: #39252a; }
html[data-theme="dark"] .fact-feature { border-color: #51432d; background: linear-gradient(110deg,#2c261c,#1c2638); }
html[data-theme="dark"] .fact-feature-copy p { color: #b9a98e; }
html[data-theme="dark"] .event-card { border-color: #5c492f; background: #2b261d; }
html[data-theme="dark"] .event-card p { color: #c4a878; }
html[data-theme="dark"] .scam-message-body { border-color: var(--line); color: #b7c2d4; background: #1d2b42; }
html[data-theme="dark"] .scam-browser { background: #1d2b42; }
html[data-theme="dark"] .scam-feedback { background: #1d2b42; }
html[data-theme="dark"] .hero-card { background: radial-gradient(circle at 88% 18%, rgba(255,184,77,.13), transparent 26%), linear-gradient(115deg, #101c30 0%, #1a2a43 65%, #20324e 100%); }
html[data-theme="dark"] .sidebar-case-card { background: #17243a; }
html[data-theme="dark"] .quest-card::after { opacity: .22; }
html[data-theme="dark"] .quest-emoji { background: #2a3650; }
html[data-theme="dark"] .daily-card { background: var(--surface); }
html[data-theme="dark"] .streak-card { background: var(--surface); }
html[data-theme="dark"] .answer-letter { color: #b7c2d2; background: #293852; }
html[data-theme="dark"] .answer-option.correct { color: #a5e0cb; background: #1a382f; border-color: #397a65; }
html[data-theme="dark"] .answer-option.wrong { color: #f0b5b8; background: #3a252c; border-color: #7e4c54; }
html[data-theme="dark"] .answer-option.correct .answer-letter { background: #32886b; }
html[data-theme="dark"] .answer-option.wrong .answer-letter { background: #b65b64; }
html[data-theme="dark"] .fact-tip { color: #9fcdbb; }
html[data-theme="dark"] .fact-tip strong { color: #66c5a2; }
html[data-theme="dark"] .fact-category { color: #c9a977; }
html[data-theme="dark"] .filter-chip.active { color: #f2c77f; border-color: #66512e; background: #322a1d; }
html[data-theme="dark"] .pill { color: #acb8ca; background: #293852; }
html[data-theme="dark"] .pill.green { color: #83d6b7; background: #1b3b32; }
html[data-theme="dark"] .pill.orange { color: #ecc17e; background: #3c301e; }
html[data-theme="dark"] .pill.blue { color: #a5bbf0; background: #24365b; }
html[data-theme="dark"] .pill.red { color: #eca8ab; background: #44272d; }
html[data-theme="dark"] .budget-summary div { background: #1d2b42; }
html[data-theme="dark"] .profile-detail { background: #1d2b42; }
html[data-theme="dark"] .rank-avatar { background: #263650; }
html[data-theme="dark"] .avatar-options span { background: #1d2b42; }
html[data-theme="dark"] .avatar-options input:checked + span { border-color: #b9873c; background: #3b2e1c; }
html[data-theme="dark"] .auth-form input:not([type="checkbox"]):not([type="radio"]) { border-color: var(--line); color: var(--ink); background: #1c2a42; }
html[data-theme="dark"] .auth-tabs { background: #1d2b42; }
html[data-theme="dark"] .auth-tab.active { background: #293953; }
html[data-theme="dark"] .cookie-banner { box-shadow: 0 18px 50px rgba(0,0,0,.4); }

/* Responsive */
@media (max-width: 1180px) {
  .main-panel { padding-right: 27px; padding-left: 27px; }
  .quest-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-visual { right: -8px; width: 205px; height: 205px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { align-items: center; padding: 18px 9px; }
  .brand { padding: 0 0 27px; }
  .brand-mark { width: 47px; height: 47px; }
  .brand-copy, .sidebar-label, .nav-link > span:not(.nav-icon), .sidebar-case-card, .sidebar-user-copy, .dots-button, .sidebar-foot { display: none; }
  .nav-link { width: 48px; height: 48px; min-height: 48px; justify-content: center; padding: 0; }
  .nav-icon { width: auto; font-size: 20px; }
  .sidebar-user { padding: 18px 0 0; border: 0; }
  .avatar-mini { width: 42px; height: 42px; }
  .sidebar-bottom { width: 100%; display: flex; justify-content: center; }
  .hero-grid { grid-template-columns: minmax(0,1fr) 250px; }
  .hero-copy { max-width: 75%; }
  .fact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .app-shell { display: block; padding-bottom: 62px; }
  .sidebar { position: fixed; z-index: 30; top: auto; right: 0; bottom: 0; left: 0; width: 100%; height: 61px; min-height: 0; flex-direction: row; justify-content: center; padding: 6px 8px; border-top: 1px solid rgba(255,255,255,.08); overflow: visible; }
  .brand, .sidebar-bottom { display: none; }
  .side-nav { width: min(100%, 520px); display: flex; align-items: center; justify-content: space-around; gap: 3px; }
  .nav-link { width: 47px; height: 46px; flex-direction: column; gap: 0; border-radius: 10px; }
  .nav-link > span:not(.nav-icon) { display: none; }
  .nav-icon { height: 100%; font-size: 19px; }
  .nav-link.active { box-shadow: inset 0 3px 0 var(--accent); }
  .main-panel { padding: 0 15px 16px; }
  .topbar { min-height: 82px; }
  .topbar h1 { font-size: 17px; }
  .topbar .eyebrow { font-size: 8px; }
  .topbar-actions { gap: 6px; }
  .coin-pill { gap: 4px; padding: 7px 8px; }
  .coin-pill small, .profile-button #topIdentity, .profile-button .chevron { display: none; }
  .profile-button { padding: 4px; }
  .icon-button { width: 34px; height: 34px; }
  .app-content { min-height: calc(100vh - 152px); padding-top: 17px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 225px; padding: 24px 21px; }
  .hero-copy { max-width: 76%; }
  .hero-card h2 { font-size: 27px; }
  .hero-card p { font-size: 10px; }
  .hero-visual { right: -24px; bottom: -1px; width: 165px; height: 165px; opacity: .7; }
  .hero-visual .hero-fallback { font-size: 94px; }
  .level-card { min-height: 180px; }
  .stats-row { gap: 7px; margin: 13px 0 23px; }
  .stat-card { min-height: 73px; gap: 7px; padding: 9px; }
  .stat-icon { width: 31px; height: 31px; flex-basis: 31px; font-size: 15px; }
  .stat-copy small { font-size: 8px; }
  .stat-copy strong { font-size: 15px; }
  .stat-copy em { display: none; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 18px; }
  .quest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .quest-card { min-height: 200px; padding: 13px 12px; }
  .quest-card h3 { font-size: 12px; }
  .quest-card p { font-size: 9px; }
  .dashboard-lower { grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
  .daily-card { padding: 13px; }
  .streak-card { padding: 14px; }
  .main-footer { flex-direction: column; font-size: 9px; }
  .quest-header-card { align-items: flex-start; padding: 15px; }
  .quest-header-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 24px; }
  .quest-header-card h2 { font-size: 16px; }
  .quest-header-card p { font-size: 9px; }
  .quest-header-side { min-width: 58px; }
  .quest-header-side strong { font-size: 11px; }
  .quest-header-side small { font-size: 8px; }
  .question-card { padding: 16px; }
  .question-card h2 { font-size: 18px; }
  .answer-option { padding: 11px; font-size: 11px; }
  .training-grid { grid-template-columns: 1fr; }
  .trainer-panel { padding: 15px; }
  .envelope-row { grid-template-columns: 1fr 95px; gap: 8px; }
  .envelope-row input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
  .envelope-row input[type="number"] { grid-column: 2; grid-row: 1; }
  .budget-summary { gap: 6px; }
  .budget-summary div { padding: 9px; }
  .budget-summary strong { font-size: 13px; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact-card { min-height: 160px; }
  .profile-layout { grid-template-columns: 1fr; }
  .achievement-grid { grid-template-columns: 1fr 1fr; }
  .cookie-banner { align-items: flex-start; bottom: 72px; padding: 12px; gap: 9px; }
  .cookie-symbol { display: none; }
  .cookie-banner { flex-direction: column; }
  .cookie-actions { width: 100%; }
  .cookie-actions .button { flex: 1; }
  .modal { padding: 23px 17px; }
}
@media (max-width: 390px) {
  .topbar-title { max-width: 145px; }
  .topbar h1 { font-size: 15px; }
  .coin-pill { padding: 6px; }
  .quest-grid { grid-template-columns: 1fr; }
  .quest-card { min-height: auto; }
  .stats-row { grid-template-columns: 1fr 1fr 1fr; }
  .stat-card { flex-direction: column; align-items: flex-start; }
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.quest-emoji svg { width: 25px; height: 25px; color: var(--quest-color, #6e80b2); }
.envelope-icon svg { width: 19px; height: 19px; color: #7889a3; }
.achievement-icon svg { width: 21px; height: 21px; color: #ab762d; }
