:root {
  color-scheme: dark;
  --background: light-dark(#f6f5fa,#12111c);
  --surface: light-dark(#fff,#1c192a);
  --surface-raised: light-dark(#f8f6fc,#242033);
  --surface-hover: light-dark(#f0ebfa,#2c2540);
  --ink: light-dark(#262035,#f6f2ff);
  --muted: light-dark(#605972,#bdb5ce);
  --border: light-dark(#e8e2ef,#373047);
  --accent: light-dark(#7251c0,#b8a0fa);
  --accent-strong: light-dark(#5d3dac,#d2c0ff);
  --accent-bg: light-dark(#efe8fb,#302348);
  --primary: light-dark(#6744b8,#c2aafe);
  --primary-hover: light-dark(#55339f,#d6c6ff);
  --primary-ink: light-dark(#fff,#201433);
  --green: light-dark(#267154,#8ce5b5);
  --green-bg: light-dark(#e9f5ee,#203a33);
  --peach: light-dark(#985037,#ffc1a8);
  --peach-bg: light-dark(#fff0e8,#402a34);
  --blue: light-dark(#365e92,#b1cfff);
  --blue-bg: light-dark(#eaf1fc,#25334d);
  --pink: light-dark(#8a4377,#f1aee2);
  --pink-bg: light-dark(#f8e9f5,#412644);
  --shadow: 0 2px 3px light-dark(#22173905,#0806114a), 0 8px 26px light-dark(#39234d08,#0806112e);
  --heading: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  background: radial-gradient(ellipse at 95% 0%, var(--page-glow, light-dark(#eee8f8,#1f1831)) 0%, transparent 44rem), var(--background);
  color: var(--ink);
  font: 400 14px/1.55 var(--body);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { display: block; width: 20px; height: 20px; flex: none; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--heading); letter-spacing: -.042em; }
h1 { font-size: clamp(31px, 4.1vw, 53px); font-weight: 800; line-height: 1.08; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; }
small, .muted { color: var(--muted); }
small { font-size: 12px; }
.skip-link { position: fixed; inset: 12px auto auto 12px; z-index: 20; padding: 9px 12px; color: var(--primary-ink); background: var(--primary); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.shell { min-height: 100vh; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 10px; font: 800 23px/1 var(--heading); letter-spacing: -.065em; }
.brand > span:last-child > span { color: var(--accent-strong); }
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--primary-ink);
  background: linear-gradient(145deg, var(--primary-hover), var(--primary));
  border-radius: 11px;
  box-shadow: 0 4px 13px light-dark(#7551c642,#b897ff39);
}
.brand-mark svg { width: 21px; height: 21px; }
.workspace { width: 100%; max-width: 1360px; margin-inline: auto; min-width: 0; padding: 22px clamp(19px, 3.5vw, 54px) 56px; outline: none; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 11px; margin-bottom: 21px; }
#breadcrumb { font-size: 13px; font-weight: 700; }
.date { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; padding-right: 4px; }
.date svg { width: 14px; height: 14px; color: var(--accent); }
.theme-picker { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.theme-picker button { display: flex; align-items: center; gap: 5px; min-height: 27px; border: 0; border-radius: 7px; padding: 4px 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.theme-picker button:hover, .theme-picker button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-bg); }
.theme-picker svg { width: 14px; height: 14px; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 182px;
  margin-bottom: 17px;
  border: 1px solid var(--hero-border, light-dark(#d9caef,#4d3b76));
  border-radius: 20px;
  background: radial-gradient(ellipse at 87% 40%, var(--hero-glow, light-dark(#f8e5f2,#322955)), transparent 47%),
    linear-gradient(112deg, var(--hero-a, light-dark(#f0e8fc,#2e2150)), var(--hero-b, light-dark(#e1d3f7,#201a36)));
}
.hero::before {
  position: absolute;
  inset: 0 0 0 40%;
  content: "";
  background: radial-gradient(circle, light-dark(#9173b237,#c6aeff42) 1px, transparent 1.5px) repeat;
  background-size: 19px 19px;
  mask-image: linear-gradient(90deg, transparent, #0008 45%, black);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 68%; padding: 25px clamp(18px, 3.2vw, 37px); }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 9px; color: var(--accent-strong); font-size: 11px; font-weight: 700; }
.eyebrow svg { width: 14px; height: 14px; }
.hero-objective { display: flex; align-items: start; gap: 6px; margin-top: 12px; color: light-dark(#5a4b73,#e1d9f5); font-size: 13px; overflow-wrap: anywhere; }
.hero-objective svg { width: 15px; height: 15px; margin-top: 3px; color: var(--accent-strong); }
.hero-art { position: absolute; inset: 0 2% 0 auto; width: 51%; height: 100%; object-fit: contain; object-position: right; image-rendering: pixelated; }
.page-title { margin-bottom: 20px; }
.page-title h1 { font-size: clamp(29px, 3.6vw, 42px); }
.page-title p { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 87px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 13px; box-shadow: var(--shadow); }
.metric-icon { display: grid; place-items: center; width: 43px; height: 43px; flex: none; color: var(--accent-strong); background: var(--accent-bg); border-radius: 11px; }
.metric-icon.green { color: var(--green); background: var(--green-bg); }
.metric-icon.peach { color: var(--peach); background: var(--peach-bg); }
.metric strong { display: block; margin-top: 2px; font: 800 clamp(20px, 2.1vw, 27px)/1.15 var(--heading); letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { display: block; line-height: 1.25; }
.metric small.metric-detail { margin-top: 5px; font-size: 10px; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); align-items: start; gap: 17px; }
.stack { display: grid; gap: 17px; min-width: 0; }
.columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 17px; }
.panel { min-width: 0; padding: clamp(14px, 1.7vw, 22px); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-head > :last-child:not(:first-child) { flex: none; }
.heading-inline { display: flex; align-items: center; gap: 8px; }
.heading-inline svg { color: var(--accent-strong); width: 17px; height: 17px; }
.btn, .icon-btn { border: 1px solid transparent; border-radius: 9px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 6px 10px; background: var(--accent-bg); color: var(--accent-strong); font-size: 12px; font-weight: 700; white-space: nowrap; }
.btn svg, .icon-btn svg { width: 15px; height: 15px; }
.btn:hover:not(:disabled), .icon-btn:hover:not(:disabled) { background: var(--surface-hover); }
.btn.primary { color: var(--primary-ink); background: var(--primary); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.quiet { color: var(--muted); border-color: var(--border); background: var(--surface); }
.btn.quiet:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled) { transform: translateY(1px); }
.icon-btn { display: grid; place-items: center; width: 35px; height: 35px; background: var(--surface); color: var(--accent-strong); border-color: var(--border); padding: 0; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; list-style: none; margin: 14px 0 0; padding: 0; }
.week-grid li { min-width: 0; color: var(--muted); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 9px; padding: 7px 2px; text-align: center; }
.week-grid li[aria-current="date"] { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-bg); }
.week-grid span, .week-grid strong { display: block; font-size: 10px; overflow-wrap: anywhere; }
.week-grid span { font-weight: 600; }
.week-grid strong { color: var(--ink); line-height: 1.25; margin-top: 3px; }
.week-grid .day-off strong { color: var(--muted); font-weight: 500; }
.cycle .section-head h2 { font-size: 22px; }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.bar-label strong { color: var(--accent-strong); text-align: right; }
.track { height: 6px; margin: 6px 0 12px; overflow: hidden; border-radius: 99px; background: var(--surface-hover); }
.fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--primary-hover)); transition: width .25s; }
.subjects { list-style: none; margin: 0; padding: 0; }
.subject, .subject-columns {
  display: grid;
  grid-template-columns: 35px minmax(0, 1.55fr) minmax(61px, .7fr) minmax(58px, .65fr) 76px;
  align-items: center;
  gap: 8px;
  padding-inline: 8px;
}
.subject-columns { min-height: 28px; font-size: 10px; font-weight: 600; color: var(--muted); }
.subject-columns > :first-child { grid-column: span 2; }
.subject-columns > :last-child { text-align: right; }
.subject { min-height: 61px; padding-block: 8px; border-top: 1px solid var(--border); }
.subject:hover { background: var(--surface-raised); }
.subject.next { background: var(--accent-bg); }
.subject.done { background: var(--green-bg); }
.subject-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; }
.subject-icon svg { width: 17px; height: 17px; }
.tone-0 { color: var(--accent-strong); background: var(--accent-bg); }
.tone-1 { color: var(--peach); background: var(--peach-bg); }
.tone-2 { color: var(--green); background: var(--green-bg); }
.tone-3 { color: var(--blue); background: var(--blue-bg); }
.tone-4 { color: var(--pink); background: var(--pink-bg); }
.subject-meta strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3; }
.subject-meta small { font-size: 10px; }
.subject-target strong, .subject-time strong { display: block; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.subject-target small, .subject-time small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); font-size: 10px; }
.subject-time strong { color: var(--accent-strong); }
.subject-track { height: 3px; margin: 4px 0 0; max-width: 68px; }
.subject-actions { display: flex; justify-content: flex-end; gap: 4px; }
.check { color: var(--muted); }
.check-square { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.check.active { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.cycle-hint { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.hint { color: var(--muted); font-size: 11px; }
.cycle-finished { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 5px; margin: 10px 0; padding: 8px; border-radius: 8px; color: var(--green); background: var(--green-bg); font-size: 11px; }
.cycle-finished > div { display: flex; gap: 5px; align-items: center; }
.cycle-finished svg { width: 15px; height: 15px; }

.timer { background: radial-gradient(ellipse at 50% 45%, light-dark(#f0e7fb,#302242), transparent 72%), var(--surface); }
.timer-state { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; background: var(--surface-raised); color: var(--muted); border: 1px solid var(--border); padding: 2px 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.timer-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.timer-state.running { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.readout { margin: 12px 0 11px; text-align: center; color: var(--accent-strong); font: 500 clamp(34px, 3.3vw, 49px)/1.04 var(--mono); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.timer-controls { display: grid; gap: 8px; }
.timer-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.focus-list { display: grid; list-style: none; padding: 0; margin: 8px 0; }
.focus-list li { display: grid; grid-template-columns: 7px minmax(0,1fr) auto 29px; align-items: center; gap: 7px; min-height: 38px; border-bottom: 1px solid var(--border); }
.focus-list strong { font-size: 12px; overflow-wrap: anywhere; }
.focus-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.focus-duration { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.focus-list .icon-btn { width: 27px; height: 27px; }
.focus-empty { margin-top: 8px; }

.garden-scene { position: relative; overflow: hidden; border-radius: 10px; background: var(--surface-raised); border: 1px solid var(--border); aspect-ratio: 2 / 1; margin: 11px 0; }
.garden-scene.settlement { aspect-ratio: 1.84; }
.garden-scene canvas { width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: pixelated; }
.garden-chip { position: absolute; inset: 8px auto auto 8px; padding: 2px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-size: 10px; font-weight: 700; }
.garden .bar-label { margin-top: 9px; }
.garden .bar-label strong { color: var(--green); }
.garden .fill { background: linear-gradient(90deg, light-dark(#5fa37c,#459981), light-dark(#3a9369,#92e0b7)); }
.garden .track { margin-bottom: 4px; }
.garden-detail { margin-top: 12px; color: var(--muted); font-size: 12px; }
.big-garden .garden-scene { aspect-ratio: 1.85; }
.big-garden .garden-scene.settlement canvas { object-fit: contain; }
.world-columns:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.world-columns:has(> :only-child) .garden-scene { max-height: 440px; }
.world-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.world-choice, .tree-option { display: grid; align-items: center; gap: 8px; min-width: 0; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 8px; }
.world-choice { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 11px; }
.tree-option { grid-template-columns: 66px minmax(0, 1fr) auto; }
.world-choice:hover, .tree-option:hover { background: var(--surface-hover); }
.world-choice[aria-pressed="true"], .tree-option[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); }
.world-choice strong, .world-choice small, .tree-option strong, .tree-option small { display: block; }
.world-choice small, .tree-option small { line-height: 1.35; }
.world-choice > svg, .tree-option > svg { width: 16px; height: 16px; color: var(--accent); }
.world-symbol { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--accent-strong); background: var(--accent-bg); }
.tree-picker { display: grid; gap: 7px; margin-top: 12px; }
.tree-option canvas { width: 66px; height: 41px; object-fit: cover; border-radius: 6px; image-rendering: pixelated; }
.zone-controls { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 12px; }

.history { margin-top: 17px; }
.history-period { display: block; font-weight: 400; }
.data-list { list-style: none; margin: 10px 0 0; padding: 0; }
.data-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 13px; }
.data-list li:last-child { border-bottom: 0; }
.data-list li > :first-child { overflow-wrap: anywhere; }
.data-list li > strong { text-align: right; font-size: 12px; }
.progress-check { color: var(--green); }
.empty { color: var(--muted); font-size: 13px; margin-top: 10px; }
.chart { height: 174px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: stretch; margin-top: 12px; }
.chart-day { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.chart-day.today { color: var(--accent-strong); font-weight: 700; }
.chart-rail { display: flex; align-items: flex-end; width: min(27px, 78%); border-radius: 6px; overflow: hidden; background: var(--surface-hover); }
.chart-fill { width: 100%; border-radius: inherit; background: linear-gradient(0deg, var(--accent), var(--primary-hover)); }

input, select { width: 100%; min-width: 0; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
input::placeholder { color: var(--muted); opacity: .85; }
.timer select { padding: 6px 7px; font-size: 12px; }
dialog { width: min(610px, calc(100% - 24px)); max-height: calc(100% - 24px); background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 17px; padding: 20px; box-shadow: 0 22px 65px #08041372; }
dialog::backdrop { background: #100a2580; backdrop-filter: blur(4px); }
dialog form > .section-head { align-items: flex-start; }
.plan-fields, .form-subjects { display: grid; gap: 9px; margin-top: 10px; }
.form-subject { display: grid; grid-template-columns: minmax(0, 1fr) 61px 35px; align-items: end; gap: 7px; }
.form-subject label { min-width: 0; }
label { color: var(--muted); font-size: 12px; font-weight: 600; }
label input { display: block; margin-top: 4px; }
.time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 11px; margin: 0; padding: 9px 10px 10px; }
legend { padding: 0 4px; color: var(--ink); font-size: 13px; font-weight: 700; }
fieldset [data-action="add"] { margin-top: 8px; }
.schedule-label { margin-top: 9px; font-size: 12px; font-weight: 700; }
.schedule-fields { display: grid; gap: 3px; margin-top: 9px; }
.schedule-row { display: grid; grid-template-columns: minmax(0, 1fr) 59px 62px; min-height: 37px; align-items: center; gap: 7px; padding: 3px; border-bottom: 1px solid var(--border); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row input[name="day-minutes"] { padding: 4px; text-align: center; }
.schedule-row .btn { min-height: 29px; padding: 3px 4px; }
.schedule-day { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.schedule-day input { width: 16px; height: 16px; flex: none; margin: 0; accent-color: var(--accent); }
.schedule-off { text-align: center; color: var(--muted); font-size: 12px; }
.schedule-estimate { margin-top: 9px; color: var(--accent-strong); font-weight: 700; }
#dialog { padding: 0; scroll-padding-bottom: 65px; }
#edit-form { padding: 20px 20px 0; }
.form-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 13px -20px 0; padding: 9px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.form-error { margin-right: auto; color: light-dark(#a02d64,#ff9ecd); font-size: 12px; }
.form-error:empty { display: none; }

#tutorial { width: min(470px, calc(100% - 24px)); padding: 0; }
.tutorial-art { display: grid; place-items: center; height: 105px; background: radial-gradient(ellipse, var(--surface-hover), var(--accent-bg)); border-bottom: 1px solid var(--border); }
.tutorial-art span { display: grid; place-items: center; width: 56px; height: 56px; color: var(--accent-strong); border: 1px solid var(--accent); border-radius: 16px; background: var(--surface); }
.tutorial-art svg { width: 27px; height: 27px; }
.tutorial-content { padding: 20px; }
.tutorial-progress { margin-bottom: 5px; color: var(--accent-strong); font-size: 11px; font-weight: 700; }
#tutorial-title:focus { outline: none; }
#tutorial-description { margin-top: 8px; color: var(--muted); }
.tutorial-actions, .tutorial-actions > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tutorial-actions { justify-content: space-between; margin-top: 17px; }
#toast { position: fixed; inset: auto 18px 18px auto; z-index: 11; max-width: calc(100% - 36px); padding: 9px 12px; background: var(--accent-bg); color: var(--ink); border: 1px solid var(--accent); border-radius: 9px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(7px); transition: opacity .18s, transform .18s; }
#toast.visible { opacity: 1; transform: translateY(0); }
.enter { animation: enter .22s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1110px) {
  .dashboard { grid-template-columns: minmax(0, 1.7fr) minmax(238px, 1fr); }
}
@media (max-width: 930px) {
}
@media (max-width: 760px) {
  .dashboard, .columns { grid-template-columns: minmax(0, 1fr); }
  .metrics, .dashboard, .columns, .stack { gap: 10px; }
  .top { margin-bottom: 13px; }
  .date { display: none; }
}
@media (max-width: 580px) {
  .brand { font-size: 19px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 8px; }
  .brand-mark svg { width: 17px; height: 17px; }
  .workspace { padding: 13px 11px 34px; }
  .hero { min-height: 136px; margin-bottom: 11px; }
  .hero-content { max-width: 95%; padding: 17px 13px; }
  .hero-art { opacity: .4; width: 46%; inset-inline-end: 0; }
  .hero h1 { font-size: clamp(26px, 7vw, 40px); }
  .eyebrow { font-size: 10px; }
  .hero-objective { font-size: 11px; margin-top: 7px; }
  .metrics { gap: 5px; margin-bottom: 10px; }
  .metric { display: grid; align-content: start; gap: 5px; min-height: 75px; padding: 7px; border-radius: 10px; }
  .metric-icon { width: 24px; height: 24px; border-radius: 6px; }
  .metric-icon svg { width: 14px; height: 14px; }
  .metric small { font-size: 10px; }
  .metric strong { font-size: clamp(15px, 3.6vw, 21px); }
  .metric small.metric-detail { font-size: 8px; margin-top: 2px; }
  .world-choices { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 460px) {
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .subject-columns { display: none; }
  .subject { grid-template-columns: 29px minmax(0,1fr) minmax(0,1fr) 64px; gap: 3px 6px; padding-inline: 2px; }
  .subject-icon { grid-area: 1 / 1; width: 28px; height: 28px; }
  .subject-meta { grid-area: 1 / 2 / 2 / 4; }
  .subject-meta strong { font-size: 12px; }
  .subject-target { grid-area: 2 / 2; }
  .subject-time { grid-area: 2 / 3; }
  .subject-target small, .subject-time small { position: static; display: block; width: auto; height: auto; overflow: visible; clip-path: none; }
  .subject-actions { grid-area: 1 / 4 / 3 / 5; }
  .subject-actions .icon-btn { width: 29px; height: 31px; }
  .readout { font-size: 40px; }
  .agenda .section-head { flex-wrap: wrap; }
}
@media (max-width: 350px) {
  #breadcrumb { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.cards-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.cards-header h1 { font-size: clamp(29px, 3.6vw, 42px); }
.cards-header p { margin-top: 7px; color: var(--muted); }
.cards-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 17px; }
.cards-summary > div { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.cards-summary strong { font: 800 24px/1.1 var(--heading); color: var(--accent-strong); }
.cards-summary span { color: var(--muted); font-size: 12px; }
.cards-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0 8px; }
.cards-filter select { width: min(100%, 260px); padding: 6px 8px; }
.cards-empty { display: grid; justify-items: center; gap: 8px; padding: 25px 8px; text-align: center; color: var(--muted); }
.cards-empty > span { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-strong); }
.card-list { margin: 0; padding: 0; list-style: none; }
.card-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.card-row-info { display: grid; justify-items: start; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.card-row-info strong { font-size: 14px; font-weight: 700; }
.card-tag { max-width: 100%; padding: 2px 7px; border-radius: 999px; background: var(--accent-bg); color: var(--accent-strong); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.card-row-actions { display: flex; gap: 5px; flex: none; }
.review-stage { max-width: 850px; }
.review-card { margin: 14px 0; padding: clamp(15px, 3vw, 33px); border: 1px solid var(--border); border-radius: 13px; background: radial-gradient(ellipse at 80% 12%, var(--accent-bg), transparent 72%), var(--surface-raised); }
.review-card h3 { margin: 10px 0 0; font: 700 clamp(16px, 2.4vw, 24px)/1.4 var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; }
.review-answer { margin-top: 17px; padding-top: 12px; border-top: 1px solid var(--border); }
.review-answer p { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-controls, .review-grades, .backup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; margin-top: 13px; }
.backup-actions { justify-content: flex-start; }
#cards-dialog textarea { display: block; width: 100%; padding: 8px; margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); color: var(--ink); font: inherit; resize: vertical; }
#cards-dialog .plan-fields { margin-top: 12px; }
.btn.danger { color: light-dark(#982847,#ffc5cf); background: light-dark(#fbe9ee,#51283a); }
.btn.danger:hover { background: light-dark(#f7d4de,#673449); }
.delete-card-question, .backup-warning { margin: 9px 0; color: var(--muted); overflow-wrap: anywhere; }
.backup-panel { margin-top: 17px; }
.backup-totals { display: flex; gap: 6px 17px; flex-wrap: wrap; margin: 10px 0; padding-inline-start: 17px; font-size: 12px; }
.review-reminder { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.review-reminder .metric-icon { width: 32px; height: 32px; }
.review-reminder > :last-child { margin-inline-start: auto; }


@media (max-width: 580px) {
  .cards-header { flex-wrap: wrap; }
  .cards-summary { gap: 6px; }
  .cards-summary > div { padding: 8px; }
  .cards-summary span { font-size: 10px; }
  .review-reminder { gap: 6px; padding: 7px; }
  .review-reminder strong { font-size: 11px; }
  .review-reminder .metric-icon { width: 25px; height: 25px; }
  .review-reminder .metric-icon svg { width: 16px; height: 16px; }
}

.kit-offer { background: radial-gradient(ellipse at 100% 0%, var(--accent-bg), transparent 65%), var(--surface); }
.kit-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 12px; color: var(--accent-strong); background: var(--accent-bg); }
.kit-edition { color: var(--accent-strong); font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.kit-details { color: var(--muted); margin-top: 6px; }
.kit-includes, .kit-preview { list-style: none; padding: 0; margin: 13px 0; }
.kit-includes li, .kit-preview li { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--border); padding: 6px 0; font-size: 12px; }
.kit-includes svg { width: 15px; height: 15px; color: var(--green); }
.kit-preview li { justify-content: space-between; }
.kit-preview li strong { white-space: nowrap; color: var(--accent-strong); }
.kit-price { display: flex; align-items: baseline; gap: 8px; margin: 11px 0 3px; }
.kit-price strong { color: var(--accent-strong); font: 800 25px/1 var(--heading); }
.kit-source { margin-top: 12px; }
.kit-source a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent-strong); }
.kit-source svg { width: 14px; height: 14px; }
.kit-import .btn { margin: 12px 0 8px; }
.kit-scheduled { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--accent-bg); color: var(--accent-strong); font-size: 12px; }
@media (max-width: 360px) {
}

.member-panel { margin-block: 15px; }
.member-panel h2 { margin-bottom: 8px; }
.member-panel p, .member-product p { color: var(--muted); }
.member-form { display: grid; gap: 9px; margin-block: 10px; max-width: 37rem; }
.member-form > .btn { justify-self: start; }
.member-auth { max-width: 33rem; }
.member-auth-modes { display: flex; gap: 6px; margin-bottom: 16px; }
.member-auth-modes .btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.member-password-hint, .member-status { font-size: .875rem; }
.member-status:empty { margin-top: -9px; }
.member-auth-alternative { border-top: 1px solid var(--border); padding-top: 14px; }
.google-login { display: grid; gap: 4px; margin-top: 14px; justify-items: start; }
.google-login [role="status"] { font-size: .875rem; }
.google-login [role="status"]:empty { margin: 0; }
.member-actions, .skin-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.member-check { display: flex; align-items: center; gap: 6px; }
.member-check input { width: auto; margin: 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.member-product { display: grid; justify-items: start; gap: 7px; border: 1px solid var(--border); background: var(--surface-raised); border-radius: 11px; padding: 12px; }
.member-product h3 { margin: 0; }
.skin-controls { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 8px; font-size: 14px; }
.plus-report { margin-bottom: 10px; }

.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, .52fr); align-items: start; gap: 16px; }
.community-layout > *, .community-list li { min-width: 0; }
.group-header, .community-thread { margin-bottom: 14px; }
.group-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.group-title h1 { overflow-wrap: anywhere; }
.group-header p, .community-list p, .community-body { overflow-wrap: anywhere; margin: 7px 0; }
.community-list { padding: 0; margin: 12px 0 0; list-style: none; }
.community-list li { border-top: 1px solid var(--border); padding: 11px 0; }
.community-list a { color: var(--accent-strong); overflow-wrap: anywhere; }
.community-list a:hover { text-decoration: underline; }
.community-actions, .community-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.community-search input { flex: 1; min-width: 140px; }
.community-status, .community-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--accent-bg); color: var(--accent-strong); vertical-align: middle; }
.community-badge svg { width: 13px; height: 13px; }
.community-body { white-space: pre-wrap; }
.community-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.rules-panel li, .rules-panel p { margin-top: 5px; color: var(--muted); font-size: 14px; }
.community-report summary { cursor: pointer; font-size: 13px; color: var(--muted); }
[data-community-form] textarea { display: block; width: 100%; padding: 8px; margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); color: var(--ink); font: inherit; resize: vertical; }
@media (max-width: 760px) { .community-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1360px; margin: auto; padding: 0 clamp(19px, 3.5vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; }
.header-actions, .study-nav, .page-context { display: flex; align-items: center; }
.header-actions { gap: 14px; }
.account-short { display: none; }
.study-nav { gap: 4px; }
.study-nav a, #account-link, #explore-menu summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 12px; border-radius: 11px; font-size: .9rem; font-weight: 650; white-space: nowrap; }
.study-nav a { color: var(--muted); }
.study-nav a:hover, #explore-menu summary:hover, .explore-list a:hover, .explore-list button:hover { background: var(--surface-hover); color: var(--ink); }
.study-nav a[aria-current], .explore-list a[aria-current], #explore-menu:has([aria-current]) summary { background: var(--accent-bg); color: var(--accent-strong); }
.study-nav svg, .header-actions svg { width: 17px; height: 17px; }
#account-link { background: var(--primary); color: var(--primary-ink); }
#account-link:hover { background: var(--primary-hover); }
#explore-menu { position: relative; }
#explore-menu summary { cursor: pointer; list-style: none; }
#explore-menu summary::-webkit-details-marker { display: none; }
#explore-menu summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
#explore-menu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.explore-list { position: absolute; z-index: 10; right: 0; top: calc(100% + 8px); width: 208px; padding: 7px; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 36px #100d242c; background: var(--surface); }
.explore-list a, .explore-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font: 600 .9rem var(--body); }
.explore-list svg { color: var(--accent); }
.explore-list button { border-top: 1px solid var(--border); margin-top: 4px; }
.page-context { flex-wrap: wrap; gap: 12px; }
.page-context .date { border-inline-start: 1px solid var(--border); padding-inline-start: 12px; font-size: .8rem; }
.theme-picker button { min-width: 34px; min-height: 32px; justify-content: center; }
.resource-section { margin-block: 30px 8px; }
.resource-section h2 { margin-bottom: 14px; }
.resource-links { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.resource-links a { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); padding: 16px; border-radius: 14px; background: var(--surface); }
.resource-links a:hover { border-color: var(--accent); }
.resource-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--accent-bg); color: var(--accent-strong); }
.resource-links small { display: block; margin-top: 2px; }
@media (min-width: 901px) {
  .workspace { padding-top: 18px; }
  .hero { min-height: 204px; }
  .dashboard, .stack { gap: 20px; }
}
@media (max-width: 980px) {
  .header-inner { gap: 10px; }
  .header-actions, .study-nav { gap: 2px; }
  .study-nav a { padding-inline: 9px; }
  .resource-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1023px) {
  .header-inner { min-height: 64px; }
  .header-actions { gap: 8px; }
  .study-nav { position: fixed; inset: auto 0 0; z-index: 8; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; padding: 5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .study-nav a { flex-direction: column; gap: 3px; min-height: 48px; padding: 4px 2px; font-size: .75rem; }
  .workspace { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .header-inner { padding-inline: 14px; }
  #account-link { padding-inline: 9px; }
  .account-short { display: inline; }
  .account-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .workspace { padding-inline: 14px; }
  .page-context #breadcrumb { font-size: .85rem; }
  .resource-links a { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; }
  .resource-links { gap: 8px; }
  .resource-icon { width: 30px; height: 30px; }
  .resource-links small { font-size: .75rem; }
}
@media (max-width: 380px) {
  .header-inner { gap: 4px; padding-inline: 10px; }
  .header-actions { gap: 2px; }
  #account-link [data-icon] { display: none; }
  #explore-menu summary { padding-inline: 8px; }
  .explore-list { right: -30px; }
}

.module-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2.2vw, 25px);
  padding: clamp(18px, 3.5vw, 40px);
  margin-bottom: 16px;
  background: radial-gradient(ellipse at 95% 8%, var(--accent-bg), transparent 65%), var(--surface);
}
.module-header h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); overflow-wrap: anywhere; }
.module-header p, .module-notice p { margin-top: 7px; color: var(--muted); font-size: 1rem; overflow-wrap: anywhere; }
.module-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent-strong); background: var(--accent-bg); border-radius: 12px; }
.module-tag { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 7px; background: var(--accent-bg); color: var(--accent-strong); font-size: .8rem; font-weight: 700; }
.module-tag.muted { background: var(--surface-raised); color: var(--muted); }
.module-notice { margin-bottom: 14px; }
.module-notice h3 { margin: 20px 0 0; font-size: 1rem; }
.module-notice > .module-tag { margin-top: 8px; }
.module-notice .btn, .module-search .btn, .contest-card .btn { min-height: 40px; font-size: .875rem; white-space: normal; text-align: center; }
.module-section-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.module-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.module-filter > label { flex: 1 1 180px; min-width: 0; }
.module-filter label, .module-form label { font-size: .875rem; }
.module-filter input, .module-filter select, .module-form input:not([type="checkbox"]), .module-form select { min-height: 40px; font-size: .95rem; }
.module-search + .module-notice, .contest-grid { margin-top: 13px; }
.module-form { max-width: 54rem; gap: 12px; }
.module-form textarea { display: block; width: 100%; padding: 9px 11px; margin-top: 5px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); color: var(--ink); font: inherit; resize: vertical; }
.module-form .hint { font-size: .875rem; }
.module-form code { font-family: var(--mono); }
.module-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.module-form .form-feedback:empty { display: none; }
.module-back, .module-footer a, .member-product p a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: .2em; }
.module-back { display: inline-block; margin-bottom: 12px; }
.module-footer { margin: 17px 0 10px; color: var(--muted); font-size: .9rem; }
.module-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; color: var(--muted); }
.contest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr)); gap: 12px; padding: 0; list-style: none; }
.contest-card { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.contest-card h2, .contest-card h3, .contest-card p { overflow-wrap: anywhere; }
.contest-card p { font-size: 1rem; }
.contest-card small { margin-bottom: 6px; }
.contest-card .btn { margin-top: auto; }
.contest-card-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .875rem; }
.contest-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.contest-layout > .panel { margin: 0; }
.contest-layout > .panel:nth-child(3) { grid-column: 1 / -1; }
.contest-plan { border-top: 3px solid var(--accent); }
.exam-basis { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; padding: 4px; margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; }
.exam-basis a { padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: .875rem; font-weight: 700; }
.exam-basis a:is(:hover, [aria-current]) { background: var(--accent-bg); color: var(--accent-strong); }
.exam-summary .module-section-heading > div { min-width: 0; }
.exam-summary .module-table :is(th, td):nth-child(3) { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.exam-topics { margin-top: 16px; }
.exam-topics summary { color: var(--accent-strong); cursor: pointer; font-weight: 700; }
.exam-topics dt { margin-top: 10px; font-weight: 700; }
.exam-topics dd { margin: 3px 0 0; color: var(--muted); }
.kit-library { margin-bottom: 20px; }
.kit-library-intro .btn { margin-top: 10px; }
.kit-guide { padding-inline-start: 1.35em; margin-block: 8px; }
.kit-guide li + li { margin-top: 6px; }
.module-fieldset { display: grid; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.module-fieldset legend { padding-inline: 4px; font-weight: 700; }
.module-table-wrap { overflow: auto; }
.module-table { width: 100%; margin-block: 12px 5px; border-collapse: collapse; font-size: .9rem; }
.module-table th, .module-table td { padding: 8px clamp(4px, 1vw, 11px); text-align: right; border-bottom: 1px solid var(--border); }
.module-table th:first-child { text-align: left; overflow-wrap: anywhere; }
.module-table thead { background: var(--surface-raised); color: var(--muted); }
.module-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; padding: 6px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.ops-nav a { display: inline-flex; align-items: center; padding: 8px 11px; min-height: 39px; border-radius: 8px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.ops-nav a:is(:hover, [aria-current]) { background: var(--accent-bg); color: var(--accent-strong); }
.ops-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.ops-metric { display: grid; gap: 6px; }
.ops-metric:hover { border-color: var(--accent); }
.ops-metric small { font-size: .875rem; }
.ops-metric strong { font: 800 clamp(1.06rem, 2.3vw, 1.64rem)/1.1 var(--heading); overflow-wrap: anywhere; }
.ops-list li { flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.ops-list .member-actions { margin-top: 0; }
.ops-amount { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-variant-numeric: tabular-nums; }
.finance-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 9px; margin: 16px 0 0; }
.finance-summary > div { padding: 11px; border-radius: 10px; background: var(--surface-raised); }
.finance-summary dt { color: var(--muted); }
.finance-summary dd { margin: 2px 0 0; font: 750 1rem var(--heading); overflow-wrap: anywhere; }
.ticket-thread { display: grid; gap: 10px; padding: 0; margin-block: 14px; list-style: none; }
.ticket-message { max-width: 49rem; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-raised); }
.ticket-message.team { border-color: var(--accent); }
.ticket-message > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 13px; }
.ticket-message time { color: var(--muted); font-size: .875rem; }
.ticket-message p { white-space: pre-wrap; color: var(--ink); }
.site-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 28px; }
.site-legal a, .legal-page nav a, .legal-document a, .consent-check a, .admin-entry .module-footer a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.legal-page { max-width: 810px; }
.legal-page nav { display: flex; flex-wrap: wrap; gap: 16px; margin-block: 10px 18px; }
.legal-document { padding: clamp(20px, 5vw, 42px); font-size: 1rem; }
.legal-document header p { color: var(--muted); margin-top: 10px; }
.legal-document section { margin-top: 26px; }
.legal-document section p, .legal-document li + li { margin-top: 8px; }
.legal-document ul { padding-inline-start: 22px; }
.consent-panel { width: min(100%, 42rem); margin-inline: auto; }
.consent-panel h1, .admin-entry h1 { font-size: clamp(1.75rem, 5vw, 2.55rem); }
.consent-check { display: flex; gap: 10px; align-items: baseline; margin-block: 6px; line-height: 1.55; }
.consent-check input { width: 1rem; flex: 0 0 auto; margin: 0; accent-color: var(--primary); }
.admin-entry { max-width: 540px; padding-top: clamp(26px, 8vh, 94px); }
.admin-entry > .brand { margin-bottom: 24px; }
.admin-entry > .brand > span { color: var(--accent-strong); }
@media (max-width: 880px) {
  .contest-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-header { grid-template-columns: auto minmax(0, 1fr); }
  .module-header > .module-tag { grid-column: 2; }
}
@media (max-width: 365px) {
  .study-nav { gap: 1px; padding-inline: 4px; }
  .study-nav a { font-size: .7rem; }
  .module-field-grid { grid-template-columns: minmax(0, 1fr); }
  .contest-plan .module-table, .exam-summary .module-table { font-size: .8rem; }
}

/* ===== Login redesenhado ===== */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: stretch; max-width: 980px; margin: 8px auto 0; }
.auth-layout .member-auth { max-width: none; margin: 0; padding: clamp(20px, 3vw, 36px); }
.auth-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.auth-brand h1 { font-size: clamp(26px, 3vw, 34px); }
.auth-brand p { margin-top: 6px; color: var(--muted); }
.auth-mark { width: 46px; height: 46px; border-radius: 14px; }
.auth-mark svg { width: 25px; height: 25px; }
.google-primary { margin: 0; justify-items: stretch; min-height: 44px; }
.google-primary > div { display: flex; justify-content: center; }
.google-primary [role="status"] { text-align: center; color: var(--muted); }
.google-primary.google-pending [role="status"] { padding: 11px 12px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-raised); }
.auth-terms-note { margin-top: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-terms-note a, .auth-switch .link-btn { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-email { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); }
.auth-email > summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 650; cursor: pointer; list-style: none; }
.auth-email > summary::-webkit-details-marker { display: none; }
.auth-email > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.auth-email[open] > summary::after { transform: rotate(-135deg); }
.auth-email .member-form { margin: 0; padding: 0 14px 14px; max-width: none; }
.auth-email .member-form > .btn { justify-self: stretch; min-height: 42px; }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 74px; }
.password-toggle { position: absolute; inset: 50% 6px auto auto; transform: translateY(-50%); border: 0; border-radius: 7px; padding: 4px 8px; background: var(--accent-bg); color: var(--accent-strong); font-size: 11px; font-weight: 700; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); }
.link-btn { border: 0; padding: 0; background: none; font-weight: 700; }
.auth-aside { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--border); border-radius: 16px;
  background: radial-gradient(circle at 100% 0%, light-dark(#e6dcfb,#3a2a5c) 0%, transparent 60%), var(--surface); box-shadow: var(--shadow); }
.auth-aside ul { display: grid; gap: 14px; margin: 4px 0; padding: 0; list-style: none; }
.auth-aside li { display: flex; gap: 12px; align-items: flex-start; }
.auth-aside li strong { display: block; }
.auth-aside li small { display: block; margin-top: 2px; font-size: 13px; }
.auth-check { display: grid; flex: none; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-bg); }
.auth-check svg { width: 15px; height: 15px; }
.auth-aside .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { order: 2; }
}
.google-pending + .auth-terms-note { display: none; }
.account-head { display: flex; align-items: center; gap: 16px; }
.account-avatar { display: grid; flex: none; width: 58px; height: 58px; place-items: center; border-radius: 50%; color: var(--primary-ink);
  background: linear-gradient(145deg, var(--primary-hover), var(--primary)); font: 800 21px/1 var(--heading); box-shadow: 0 6px 18px light-dark(#7551c642,#b897ff39); }
.account-head p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.account-badge { padding: 2px 8px; border-radius: 99px; background: var(--accent-bg); color: var(--accent-strong); font-size: 11px; font-weight: 700; }
.account-badge.plus { background: var(--green-bg); color: var(--green); }

/* ===== Sequência e meta do dia ===== */
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border: 1px solid light-dark(#d9ccf3,#4a3b68); border-radius: 99px;
  background: light-dark(#ffffffb3,#1c192ab3); backdrop-filter: blur(6px); font-size: 12px; font-weight: 700; }
.hero-pill svg { width: 15px; height: 15px; }
.hero-pill.streak { color: var(--peach); }
.hero-pill.streak.idle { color: var(--muted); }
.hero-pill.goal { color: var(--green); }
.goal-ring { width: 15px; height: 15px; border-radius: 50%; background: conic-gradient(currentColor var(--goal), var(--surface-hover) 0);
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 4.5px); mask: radial-gradient(circle, transparent 4px, #000 4.5px); }

/* ===== Pomodoro ===== */
.pomodoro-status { position: relative; margin: -4px 0 12px; padding-bottom: 8px; color: var(--accent-strong); font-size: 12px; font-weight: 700; text-align: center; }
.pomodoro-status::after { content: ""; position: absolute; inset: auto 15% 0; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--pomodoro, 0%), var(--surface-hover) 0); }
.pomodoro-toggle { position: relative; display: flex; align-items: center; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 650; cursor: pointer; }
.pomodoro-toggle small { font-weight: 400; }
.pomodoro-toggle input { position: absolute; left: 0; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pomodoro-toggle .switch { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--surface-hover); border: 1px solid var(--border); transition: background .2s ease; }
.pomodoro-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.pomodoro-toggle input:checked + .switch { background: var(--primary); border-color: var(--primary); }
.pomodoro-toggle input:checked + .switch::after { transform: translateX(14px); background: var(--primary-ink); }
.pomodoro-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Mapa de constância ===== */
.heatmap-panel { margin-top: 17px; }
.heat-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.heat-stats span { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--border); }
.heat-stats strong { font: 800 20px/1.2 var(--heading); letter-spacing: -.03em; }
.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 4px; width: max-content; }
.heat-cell { display: block; width: 14px; height: 14px; border-radius: 4px; background: var(--surface-hover); }
.heat-cell.level-1 { background: light-dark(#d9caf6,#45336b); }
.heat-cell.level-2 { background: light-dark(#b597ec,#6c50a8); }
.heat-cell.level-3 { background: light-dark(#8a66d6,#9a7ddf); }
.heat-cell.level-4 { background: light-dark(#5d3dac,#d2c0ff); }
.heat-cell.level-none { background: transparent; }
.heat-cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; }
.heat-legend .heat-cell { width: 11px; height: 11px; border-radius: 3px; }
@media (max-width: 580px) {
  .heat-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { margin-top: 10px; gap: 6px; }
  .hero-pill { font-size: 11px; padding: 4px 9px 4px 7px; }
}

/* ===== Acabamento geral ===== */
.panel { transition: border-color .2s ease, box-shadow .2s ease; }
.resource-links a { transition: transform .18s ease, border-color .18s ease; }
.resource-links a:hover { transform: translateY(-2px); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .resource-links a:hover { transform: none; } }
.heatmap-scroll { direction: rtl; text-align: center; }
.heatmap-scroll .heatmap { direction: ltr; display: inline-grid; }

/* ===== Plus ===== */
.plus-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 800;
  color: light-dark(#6a4a00,#ffe2a0); background: linear-gradient(135deg, light-dark(#ffe9b0,#5a4413), light-dark(#ffd3e4,#5a2342)); }
.plus-badge svg { width: 13px; height: 13px; }
.plus-panel { position: relative; overflow: hidden; border-color: light-dark(#e3d4fb,#4a3b68);
  background: radial-gradient(circle at 100% 0%, var(--accent-bg) 0%, transparent 55%), var(--surface); }
.plus-panel-head { display: grid; gap: 8px; justify-items: start; margin-bottom: 14px; }
.plus-panel h3 { margin: 16px 0 8px; font: 800 15px/1.2 var(--heading); }
.plus-price { display: flex; align-items: baseline; gap: 6px; }
.plus-price strong { font: 800 34px/1 var(--heading); letter-spacing: -.04em; color: var(--ink); }
.plus-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.plus-features li { display: grid; gap: 2px; padding: 11px 12px 11px 36px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); position: relative; }
.plus-features li::before { content: "✓"; position: absolute; left: 12px; top: 10px; color: var(--green); font-weight: 800; }
.plus-features small { font-size: 12.5px; }
.plus-cta { min-height: 44px; padding-inline: 20px; font-size: 14px; }
.accent-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 5px 12px 5px 6px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; }
.accent-swatch span { width: 22px; height: 22px; border-radius: 50%; background: var(--swatch); }
.accent-swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.plus-locked-body { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.plus-locked-body p { flex: 1 1 260px; color: var(--muted); }
.plus-locked-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: var(--accent-strong); background: var(--accent-bg); }
.plus-locked, .plus-report-panel { margin-top: 17px; }
.report-bars { display: grid; gap: 9px; margin: 6px 0 0; padding: 0; list-style: none; }
.report-bars li { display: grid; grid-template-columns: minmax(90px, 200px) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.report-bars li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-rail { height: 10px; border-radius: 6px; background: var(--surface-hover); overflow: hidden; }
.report-rail div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--primary-hover)); }
.pomodoro-lengths { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { min-height: 30px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.chip[aria-pressed="true"] { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.plus-hint { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; }
.plus-hint svg { width: 14px; height: 14px; margin-top: 2px; color: var(--accent-strong); }
.plus-hint a { color: var(--accent-strong); text-decoration: underline; }
.kit-admin-form textarea { width: 100%; font: 13px/1.5 var(--mono); }
@media (max-width: 580px) { .report-bars li { grid-template-columns: minmax(70px, 110px) 1fr auto; gap: 8px; } }

/* Cores exclusivas do Plus */
:root[data-accent="oceano"] { --accent: light-dark(#2563a8,#8cc4ff); --accent-strong: light-dark(#1b4f8a,#b9dcff); --accent-bg: light-dark(#e4f0fc,#1d3350);
  --primary: light-dark(#2563a8,#8cc4ff); --primary-hover: light-dark(#1b4f8a,#b0d8ff); --primary-ink: light-dark(#fff,#0c1d33); }
:root[data-accent="floresta"] { --accent: light-dark(#23794f,#86e0b0); --accent-strong: light-dark(#1a603f,#b2f0cd); --accent-bg: light-dark(#e3f4ea,#1c3a2c);
  --primary: light-dark(#23794f,#86e0b0); --primary-hover: light-dark(#1a603f,#a9edc7); --primary-ink: light-dark(#fff,#0b2419); }
:root[data-accent="aurora"] { --accent: light-dark(#b23a62,#ffa3c2); --accent-strong: light-dark(#922a4f,#ffc6d9); --accent-bg: light-dark(#fbe6ee,#45203a);
  --primary: light-dark(#b23a62,#ffa3c2); --primary-hover: light-dark(#922a4f,#ffbcd2); --primary-ink: light-dark(#fff,#33101f); }
:root[data-accent="solar"] { --accent: light-dark(#a8611a,#ffc27a); --accent-strong: light-dark(#87490c,#ffd9a8); --accent-bg: light-dark(#fcefdf,#45301a);
  --primary: light-dark(#a8611a,#ffc27a); --primary-hover: light-dark(#87490c,#ffd29a); --primary-ink: light-dark(#fff,#2e1a05); }

/* ===== Meus mundos: cartões com prévia ===== */
.world-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.world-card { display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; text-align: left; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--ink); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.world-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.world-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.world-preview { position: relative; display: block; aspect-ratio: 1.84; background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.world-preview canvas { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.world-card.locked .world-preview canvas { filter: saturate(.55) brightness(.8); }
.world-lock { position: absolute; inset: 8px 8px auto auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 800; color: light-dark(#6a4a00,#ffe2a0); background: linear-gradient(135deg, light-dark(#ffe9b0,#5a4413), light-dark(#ffd3e4,#5a2342)); }
.world-lock svg { width: 12px; height: 12px; }
.world-card-body { display: grid; gap: 3px; padding: 11px 12px 13px; }
.world-card-title { display: flex; align-items: center; gap: 7px; }
.world-card-title > svg { width: 17px; height: 17px; color: var(--accent); }
.world-current { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; padding: 1px 7px; border-radius: 99px; background: var(--accent-bg); color: var(--accent-strong); font-size: 10.5px; font-weight: 800; }
.world-current svg { width: 11px; height: 11px; }
.world-next { color: var(--accent-strong); font-weight: 650; }
.world-plus-note { display: flex; align-items: center; gap: 7px; margin: -2px 0 14px; }
.world-plus-note svg { width: 15px; height: 15px; color: var(--accent-strong); }
.world-plus-note a { color: var(--accent-strong); text-decoration: underline; }
.world-milestones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 14px 0 4px; padding: 0; list-style: none; }
.world-milestones li { display: grid; justify-items: center; gap: 4px; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-raised); text-align: center; color: var(--muted); }
.world-milestones li > span:last-child { display: grid; gap: 1px; }
.world-milestones strong { font-size: 11.5px; line-height: 1.25; }
.world-milestones small { font-size: 10.5px; }
.milestone-mark { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--surface-hover); }
.milestone-mark svg { width: 13px; height: 13px; }
.world-milestones li.reached { color: var(--ink); }
.world-milestones li.reached .milestone-mark { color: var(--green); background: var(--green-bg); }
.world-milestones li.current { border-color: var(--accent); background: var(--accent-bg); }
@media (max-width: 930px) { .world-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) {
  .world-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .world-card-body { padding: 8px 9px 10px; }
  .world-card-body small { font-size: 11px; }
  .world-milestones { grid-template-columns: repeat(5, minmax(54px, 1fr)); overflow-x: auto; }
}

/* ===== Animações suaves ===== */
.enter { animation: enter .28s cubic-bezier(.2,.7,.3,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fill { transition: width .5s cubic-bezier(.2,.7,.3,1); }
.just-checked { animation: row-done .7s ease; }
.just-checked [data-action="check"] { animation: check-pop .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes row-done { 0% { background: var(--green-bg); } 100% { background: transparent; } }
@keyframes check-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.garden-scene.evolved { animation: evolve 1.4s ease; }
.garden-scene.evolved::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at 50% 60%, #fff6 0%, transparent 60%); animation: evolve-glow 1.4s ease forwards; }
@keyframes evolve { 0% { transform: scale(1); } 25% { transform: scale(1.025); box-shadow: 0 0 0 4px var(--accent-bg), 0 0 28px var(--accent); } 100% { transform: scale(1); } }
@keyframes evolve-glow { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.readout { font-variant-numeric: tabular-nums; }
.timer-state.running::before { animation: soft-pulse 1.8s ease-in-out infinite; }
@keyframes soft-pulse { 50% { opacity: .35; } }
.study-nav a, #explore-menu summary, .btn, .chip, .accent-swatch, .world-choice { transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
@media (prefers-reduced-motion: reduce) {
  .enter, .just-checked, .just-checked [data-action="check"], .garden-scene.evolved, .garden-scene.evolved::after, .timer-state.running::before { animation: none !important; }
  .world-card:hover, .resource-links a:hover { transform: none; }
}

/* ===== Botão Plus no cabeçalho ===== */
#plus-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; white-space: nowrap;
  color: light-dark(#7a4f00,#ffd98a); border: 1px solid light-dark(#efd08a,#6b5320); background: light-dark(#fff8e6,#2a2214); transition: background .18s ease, border-color .18s ease; }
#plus-link svg { width: 15px; height: 15px; }
#plus-link:hover, #plus-link[aria-current] { background: light-dark(#ffefc2,#3a2e16); border-color: light-dark(#e0b75a,#9a7a30); }
.plus-link-short { display: none; }
/* Notebooks (1024–1360px): cabeçalho compacto para caber tudo sem rolagem lateral. */
@media (max-width: 1360px) and (min-width: 1024px) {
  .header-inner { gap: 12px; }
  .study-nav { gap: 0; }
  .study-nav a { padding-inline: 9px; }
  .header-actions { gap: 6px; }
  #plus-link { padding-inline: 10px; }
  .plus-link-short { display: inline; }
  .plus-link-label, .account-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .account-short { display: inline; }
}
@media (max-width: 1160px) and (min-width: 1024px) { .study-nav svg { display: none; } }
@media (max-width: 560px) {
  #plus-link { padding-inline: 9px; min-height: 34px; }
  .plus-link-short { display: inline; }
  .plus-link-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
}
@media (max-width: 380px) { #plus-link svg { display: none; } }

/* ===== Página do Plus ===== */
.plus-hero { display: grid; justify-items: start; gap: 12px; padding: clamp(22px, 4vw, 44px); margin-bottom: 16px; border-color: light-dark(#e3d4fb,#4a3b68);
  background: radial-gradient(circle at 92% 10%, light-dark(#ffe9b0,#4a3a1a) 0%, transparent 38%), radial-gradient(circle at 0% 100%, light-dark(#f1e6ff,#3a2a5c) 0%, transparent 50%), var(--surface); }
.plus-hero h1 { font-size: clamp(30px, 4vw, 48px); }
.plus-hero > p { max-width: 46rem; color: var(--muted); font-size: 15px; }
.plus-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.plus-highlight { display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.plus-highlight h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 18px; }
.plus-highlight h2 svg { color: var(--accent); }
.plus-highlight p { color: var(--muted); margin-bottom: 10px; }
.plus-xray, .plus-kit-stack, .plus-worlds { min-height: 118px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--border); padding: 12px; }
.plus-xray { display: grid; gap: 7px; align-content: center; }
.plus-xray span { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; }
.plus-xray i { display: block; height: 9px; border-radius: 6px; width: var(--value); background: linear-gradient(90deg, var(--accent), var(--primary-hover)); }
.plus-kit-stack { display: grid; align-content: center; justify-items: center; }
.plus-kit-stack span { width: 78%; padding: 8px 10px; margin-top: -6px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; }
.plus-kit-stack span:nth-child(2) { transform: translateX(8px) rotate(1.5deg); }
.plus-kit-stack span:nth-child(3) { transform: translateX(-6px) rotate(-1.5deg); }
.plus-worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
.plus-worlds canvas { width: 100%; aspect-ratio: 1.84; border-radius: 8px; image-rendering: pixelated; }
@media (max-width: 880px) { .plus-highlights { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 440px) {
  .header-actions { gap: 4px; }
  #plus-link svg, #account-link [data-icon] { display: none; }
  #explore-menu summary, #account-link { padding-inline: 8px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand-mark { width: 31px; height: 31px; }
}
@media (max-width: 350px) { .brand > span:last-child { display: none; } }
.world-columns:has(> :only-child) .garden-scene { margin-inline: auto; }

/* ===== Pagamentos ===== */
.payment-banner { display: grid; gap: 4px; margin-bottom: 16px; border-left: 4px solid var(--accent); }
.payment-banner.ok { border-left-color: var(--green); background: linear-gradient(90deg, var(--green-bg), var(--surface) 60%); }
.payment-banner.bad { border-left-color: var(--peach); background: linear-gradient(90deg, var(--peach-bg), var(--surface) 60%); }
.payment-banner.wait strong::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; }
.payment-banner p { color: var(--muted); }
.payment-banner .btn { justify-self: start; margin-top: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-methods { margin-top: 6px; }
.kit-plus-hint { margin: -6px 0 12px; }
.kit-plus-hint a { color: var(--accent-strong); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .payment-banner.wait strong::after { animation: none; } }

/* ===== Recuperação de senha e confirmação de e-mail ===== */
.auth-layout.single { grid-template-columns: minmax(0, 34rem); justify-content: center; }
.forgot-link { justify-self: center; margin-top: 2px; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.email-warning { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--peach-bg); color: var(--peach) !important; font-weight: 600; }

/* ===== Assistente de estudos ===== */
#assistant-fab { position: fixed; right: 22px; bottom: 22px; z-index: 9; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 20px 0 16px;
  border: 0; border-radius: 99px; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: var(--primary-ink); font: 700 14px var(--body);
  box-shadow: 0 10px 30px light-dark(#5d3dac55,#00000088); transition: transform .18s ease; }
#assistant-fab:hover { transform: translateY(-2px); }
#assistant-fab svg { width: 19px; height: 19px; }
.assistant-panel { position: fixed; right: 22px; bottom: 86px; z-index: 12; display: grid; grid-template-rows: auto 1fr auto; width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 120px)); border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 70px #0006; overflow: hidden;
  animation: enter .22s ease both; }
.assistant-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); background: var(--surface-raised); }
.assistant-head > div { flex: 1; min-width: 0; display: grid; }
.assistant-head small { font-size: 11px; }
.assistant-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-strong); }
.assistant-count { font-size: 11px; font-weight: 700; color: var(--accent-strong); background: var(--accent-bg); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.assistant-body { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.assistant-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; line-height: 1.5; font-size: 14px; }
.assistant-msg p { margin: 0 0 6px; } .assistant-msg p:last-child { margin-bottom: 0; }
.assistant-msg ul, .assistant-msg ol { margin: 4px 0 6px; padding-left: 20px; }
.assistant-msg code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-hover); padding: 1px 5px; border-radius: 5px; }
.assistant-msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.assistant-msg.bot { align-self: flex-start; background: var(--surface-raised); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.assistant-save { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; border: 0; background: none; padding: 0; color: var(--accent-strong); font: 700 12px var(--body); }
.assistant-save svg { width: 14px; height: 14px; }
.assistant-msg.typing { display: flex; gap: 5px; padding: 14px; }
.assistant-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: soft-pulse 1s ease-in-out infinite; }
.assistant-msg.typing span:nth-child(2) { animation-delay: .15s; } .assistant-msg.typing span:nth-child(3) { animation-delay: .3s; }
.assistant-empty { display: grid; gap: 14px; margin: auto 0; text-align: center; color: var(--muted); }
.assistant-empty .btn { justify-self: center; }
.assistant-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.assistant-chips .chip { color: var(--ink); }
.assistant-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.assistant-form textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink); font: inherit; }
.assistant-form .btn { min-height: 42px; min-width: 46px; }
@media (max-width: 1023px) {
  #assistant-fab { bottom: calc(80px + env(safe-area-inset-bottom)); right: 14px; min-height: 46px; padding: 0 16px 0 13px; }
}
@media (max-width: 560px) {
  #assistant-fab span { display: none; } #assistant-fab { padding: 0; width: 50px; justify-content: center; }
  .assistant-panel { inset: 8px 8px calc(78px + env(safe-area-inset-bottom)) 8px; width: auto; height: auto; }
}
@media (prefers-reduced-motion: reduce) { .assistant-panel, .assistant-msg.typing span { animation: none; } }

/* ===== Temas do site por mundo (Plus) ===== */
:root[data-world-theme] { --green: light-dark(#23794f,#8ce5b5); }
:root[data-world-theme="garden"] {
  --background: light-dark(#f1f7f0,#0e1913); --surface: light-dark(#ffffff,#15231b); --surface-raised: light-dark(#f5faf4,#1b2c22); --surface-hover: light-dark(#e6f2e3,#22382b);
  --border: light-dark(#dbe8d7,#2c4736); --ink: light-dark(#1d2b21,#ecf7ee); --muted: light-dark(#56685a,#a9c2b0);
  --accent: light-dark(#2f7d4f,#8fe0a8); --accent-strong: light-dark(#226640,#b6f0c6); --accent-bg: light-dark(#e2f3e6,#1f3d2b);
  --primary: light-dark(#2f7d4f,#8fe0a8); --primary-hover: light-dark(#226640,#a9ecbd); --primary-ink: light-dark(#fff,#0b2416);
  --page-glow: light-dark(#dcefd9,#173524); --hero-a: light-dark(#e6f4e2,#183223); --hero-b: light-dark(#cfe8c9,#11241a); --hero-glow: light-dark(#fff4c9,#26462f); --hero-border: light-dark(#c4dfbd,#2f5a3e);
}
:root[data-world-theme="farm"] {
  --background: light-dark(#faf4e8,#1b140e); --surface: light-dark(#fffdf7,#261d14); --surface-raised: light-dark(#fbf6eb,#2e2419); --surface-hover: light-dark(#f4ead6,#3a2d1f);
  --border: light-dark(#eadcc2,#4a3a28); --ink: light-dark(#33261a,#fbf1e2); --muted: light-dark(#76624c,#cdb79c);
  --accent: light-dark(#b0601c,#f2b56b); --accent-strong: light-dark(#8f4b12,#ffd29a); --accent-bg: light-dark(#f8e7cf,#4a3218);
  --primary: light-dark(#b0601c,#f2b56b); --primary-hover: light-dark(#8f4b12,#ffc888); --primary-ink: light-dark(#fff,#2a1705);
  --page-glow: light-dark(#f6e2bf,#3a2914); --hero-a: light-dark(#fbeed6,#33261a); --hero-b: light-dark(#f2dcb4,#231a11); --hero-glow: light-dark(#d9efc2,#4b3a1d); --hero-border: light-dark(#ead2a6,#5a4227);
}
:root[data-world-theme="city"] {
  --background: light-dark(#eef1f8,#0b0e1d); --surface: light-dark(#ffffff,#131829); --surface-raised: light-dark(#f4f6fc,#191f36); --surface-hover: light-dark(#e6eaf6,#212945);
  --border: light-dark(#dbe0ef,#2b3459); --ink: light-dark(#1d2236,#eef2ff); --muted: light-dark(#5b6382,#a9b2d6);
  --accent: light-dark(#3157d4,#6fe0ff); --accent-strong: light-dark(#2343ad,#a6eeff); --accent-bg: light-dark(#e2e9fd,#173450);
  --primary: light-dark(#3157d4,#6fe0ff); --primary-hover: light-dark(#2343ad,#93e9ff); --primary-ink: light-dark(#fff,#061522);
  --page-glow: light-dark(#dfe4fb,#2a1747); --hero-a: light-dark(#e6ebfb,#171c3a); --hero-b: light-dark(#d3dbf6,#0f1328); --hero-glow: light-dark(#f7d9f0,#4a1f5c); --hero-border: light-dark(#c7d1f1,#35407a);
}
:root[data-world-theme="aquarium"] {
  --background: light-dark(#edf7f9,#06171d); --surface: light-dark(#ffffff,#0c222a); --surface-raised: light-dark(#f2fafb,#112c36); --surface-hover: light-dark(#e1f2f5,#163744);
  --border: light-dark(#d2e8ed,#1d4554); --ink: light-dark(#14303a,#e6fbff); --muted: light-dark(#4c6e78,#9cc6d0);
  --accent: light-dark(#0f7f8f,#6fe3ee); --accent-strong: light-dark(#0a6573,#a3f1f7); --accent-bg: light-dark(#d9f2f5,#12414b);
  --primary: light-dark(#0f7f8f,#6fe3ee); --primary-hover: light-dark(#0a6573,#93ecf3); --primary-ink: light-dark(#fff,#03222a);
  --page-glow: light-dark(#cfeef3,#0f3b47); --hero-a: light-dark(#d9f1f5,#0e2d38); --hero-b: light-dark(#bfe6ee,#081d25); --hero-glow: light-dark(#ffe3c2,#14505c); --hero-border: light-dark(#b8dde6,#1d5363);
}
:root[data-world-theme="station"] {
  --background: light-dark(#f0f1fb,#05060d); --surface: light-dark(#ffffff,#0d0f1d); --surface-raised: light-dark(#f5f6fd,#13162a); --surface-hover: light-dark(#e7e9f8,#1a1e39);
  --border: light-dark(#dcdff2,#252a4d); --ink: light-dark(#1c1f38,#eef0ff); --muted: light-dark(#5d628a,#a4aad6);
  --accent: light-dark(#4b4fd8,#9ab4ff); --accent-strong: light-dark(#3a3db4,#c4d3ff); --accent-bg: light-dark(#e5e6fb,#1c2350);
  --primary: light-dark(#4b4fd8,#9ab4ff); --primary-hover: light-dark(#3a3db4,#b5c8ff); --primary-ink: light-dark(#fff,#070b24);
  --page-glow: light-dark(#e1e3fa,#141a45); --hero-a: light-dark(#e6e8fb,#0e1230); --hero-b: light-dark(#d3d6f5,#06081a); --hero-glow: light-dark(#d4f3ff,#1b2f66); --hero-border: light-dark(#cbcff0,#262d63);
}
:root[data-world-theme="island"] {
  --background: light-dark(#f2f5fe,#121330); --surface: light-dark(#ffffff,#1a1b3d); --surface-raised: light-dark(#f6f8ff,#212249); --surface-hover: light-dark(#e9edfc,#292b57);
  --border: light-dark(#dde3f8,#34376b); --ink: light-dark(#22264a,#f3f2ff); --muted: light-dark(#5f6690,#b4b5e0);
  --accent: light-dark(#d4566e,#ffb38a); --accent-strong: light-dark(#b23f57,#ffd0b4); --accent-bg: light-dark(#fde6ea,#4a2a4a);
  --primary: light-dark(#d4566e,#ffb38a); --primary-hover: light-dark(#b23f57,#ffc4a3); --primary-ink: light-dark(#fff,#2b1222);
  --page-glow: light-dark(#ffe1d6,#3b2559); --hero-a: light-dark(#e3ecff,#20235a); --hero-b: light-dark(#ffe1e3,#141640); --hero-glow: light-dark(#fff1c4,#5a2f5a); --hero-border: light-dark(#d8e0fb,#3c3f80);
}
.hero-world { position: absolute; inset: 14px 18px 14px auto; width: min(46%, 420px); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px #0003; }
.hero-world canvas { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
@media (max-width: 580px) { .hero-world { opacity: .35; width: 52%; inset: 0 0 0 auto; border-radius: 0; box-shadow: none; } }
.world-theme-toggle { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); }
.world-theme-toggle > div { flex: 1; display: grid; }
.world-theme-toggle small { font-size: 12px; }
.theme-choice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* ===== Primeiros passos ===== */
.onboarding { margin-bottom: 17px; border-color: var(--accent); background: linear-gradient(135deg, var(--accent-bg), var(--surface) 55%); }
.onboarding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.onboarding-head p { margin-top: 4px; color: var(--muted); }
.onboarding-head .link-btn { color: var(--muted); font-size: 12px; text-decoration: underline; }
.onboarding-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.onboarding-steps li { display: grid; align-content: start; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.onboarding-steps li > div { display: grid; gap: 2px; }
.onboarding-steps small { font-size: 12px; line-height: 1.4; }
.onboarding-steps .btn { justify-self: start; }
.onboarding-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-hover); color: var(--muted); font-weight: 800; font-size: 13px; }
.onboarding-mark svg { width: 15px; height: 15px; }
.onboarding-steps li.done { opacity: .7; }
.onboarding-steps li.done .onboarding-mark { background: var(--green-bg); color: var(--green); }
.onboarding-steps li.done strong { text-decoration: line-through; text-decoration-color: var(--muted); }
.onboarding-steps li.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.onboarding-steps li.next .onboarding-mark { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 1100px) { .onboarding-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .onboarding-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .onboarding-steps li { grid-template-columns: auto 1fr; align-items: center; padding: 10px; }
  .onboarding-steps li .btn { grid-column: 1 / -1; justify-self: stretch; }
  .onboarding-steps li.done small { display: none; }
}
.resource-links button { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); padding: 16px; border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.resource-links button:hover { transform: translateY(-2px); border-color: var(--accent); }
.resource-links button small { display: block; margin-top: 2px; }
@media (max-width: 560px) { .resource-links button { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px; } }

/* ===== Galeria de temas ===== */
.theme-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.theme-card { display: grid; gap: 6px; justify-items: start; padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; transition: transform .18s ease, border-color .18s ease; }
.theme-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.theme-card strong { font-size: 13px; }
.theme-card small { color: var(--accent-strong); font-weight: 700; font-size: 11px; }
.theme-preview { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; width: 100%; height: 52px; border-radius: 9px; overflow: hidden; }
.theme-preview i:nth-child(1) { grid-row: 1 / 3; background: var(--b); position: relative; }
.theme-preview i:nth-child(1)::after { content: ""; position: absolute; left: 10px; right: 30%; bottom: 10px; height: 10px; border-radius: 5px; background: var(--a); }
.theme-preview i:nth-child(2) { background: var(--a); }
.theme-preview i:nth-child(3) { background: var(--c); }
.theme-preview.custom { --a: #8a66d6; --b: #efe8fb; --c: linear-gradient(90deg, #2f7fd1, #2f9a6a, #d9567c, #d98a2b); }
.theme-preview.custom i:nth-child(3) { background: linear-gradient(90deg, #2f7fd1, #2f9a6a, #d9567c, #d98a2b); }
.theme-palette { gap: 5px; }
.theme-palette-label { font-size: 11px; font-weight: 700; }
@media (max-width: 560px) { .theme-palette-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .theme-card:hover { transform: none; } }

/* ===== Mini-simulado e resumo dos kits ===== */
.kit-extras { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.kit-quiz { display: grid; gap: 14px; margin-top: 12px; }
.quiz-question { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-raised); }
.quiz-question legend { display: block; float: left; width: 100%; margin-bottom: 10px; font-weight: 650; line-height: 1.45; }
.quiz-question legend small { display: block; color: var(--accent-strong); font-weight: 700; font-size: 11px; margin-bottom: 2px; }
.quiz-number { float: left; display: grid; place-items: center; width: 26px; height: 26px; margin: 0 10px 4px 0; border-radius: 50%; background: var(--accent-bg); color: var(--accent-strong); font-size: 12px; font-weight: 800; }
.quiz-option { clear: both; display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.quiz-option:hover { background: var(--surface-hover); }
.quiz-option input { width: auto; margin-top: 3px; accent-color: var(--primary); }
.quiz-option b { color: var(--muted); }
.quiz-question.right { border-color: var(--green); }
.quiz-question.wrong { border-color: var(--peach); }
.quiz-question.right .quiz-option.correct, .quiz-question.wrong .quiz-option.correct { border-color: var(--green); background: var(--green-bg); }
.quiz-feedback { clear: both; margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--muted); }
.quiz-feedback strong { color: var(--ink); }
.quiz-result { padding: 12px 14px; border-radius: 12px; background: var(--accent-bg); }
.quiz-result:empty { display: none; }
.kit-summary-section { margin-top: 14px; }
.kit-summary-section h3 { margin: 0 0 6px; font: 800 15px var(--heading); }
.kit-summary-section ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
#print-area { display: none; }
@media print {
  html.print-summary body > *:not(#print-area) { display: none !important; }
  html.print-summary #print-area { display: block; color: #111; background: #fff; font: 12pt/1.5 Arial, sans-serif; }
  html.print-summary body { background: #fff !important; }
  #print-area h2 { font-size: 20pt; margin: 0 0 4pt; }
  #print-area .hint, #print-area .print-brand { color: #555; font-size: 9pt; }
  #print-area h3 { font-size: 13pt; margin: 14pt 0 4pt; color: #3b2a7a; }
  #print-area section { break-inside: avoid; }
  #print-area li { margin-bottom: 3pt; }
}

/* ===== Sequência de estudos (calendário anual estilo Anki) ===== */
.heatmap-scroll { direction: ltr; text-align: left; }
.heatmap-year { display: inline-grid; grid-template-columns: 26px auto; grid-template-rows: auto auto; gap: 4px 6px; padding: 2px; }
.heat-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), 14px); column-gap: 3px; font-size: 10.5px; color: var(--muted); }
.heat-months span { white-space: nowrap; }
.heat-weekdays { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, 14px); row-gap: 3px; font-size: 10px; color: var(--muted); align-items: center; }
.heatmap-year .heatmap { grid-column: 2; grid-row: 2; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 3px; width: max-content; }
button.heat-cell { padding: 0; border: 0; cursor: pointer; }
button.heat-cell:hover { outline: 2px solid var(--muted); outline-offset: 1px; }
.heat-cell.selected { outline: 2px solid var(--ink) !important; outline-offset: 1px; }
.heat-cell.rest { background: repeating-linear-gradient(135deg, var(--surface-hover) 0 3px, transparent 3px 6px); }
.heat-cell.frozen { background: light-dark(#bfe6ff,#2a5a7a); }
.heat-legend { flex-wrap: wrap; }
.heat-legend .heat-cell.rest, .heat-legend .heat-cell.frozen { margin-left: 10px; }
.streak-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.streak-fire strong { color: var(--peach); }
.streak-fire.cold strong { color: var(--muted); }
.freeze-empty { filter: grayscale(1); opacity: .3; }
.streak-year { display: flex; align-items: center; gap: 6px; }
.streak-year strong { font: 800 16px var(--heading); min-width: 44px; text-align: center; }
.streak-detail { display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--border); }
.streak-detail.hint { background: none; border-style: dashed; text-align: center; }
.streak-date { font-weight: 800; }
.streak-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.streak-title { margin: 18px 0 8px; font: 800 15px var(--heading); }
.streak-badges { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.streak-badges li { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-raised); text-align: center; opacity: .45; filter: grayscale(1); }
.streak-badges li.won { opacity: 1; filter: none; border-color: var(--accent); background: var(--accent-bg); }
.streak-badges li > span { font-size: 22px; }
.streak-badges strong { font-size: 12px; }
.streak-badges small { font-size: 10.5px; line-height: 1.2; }
.streak-rules { margin-top: 12px; }
.week-strip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 10px; border-radius: 99px; border: 1px solid light-dark(#d9ccf3,#4a3b68); background: light-dark(#ffffffb3,#1c192ab3); }
.week-day { display: grid; justify-items: center; gap: 2px; font-size: 9.5px; font-weight: 700; color: var(--muted); }
.week-day i { width: 12px; height: 12px; border-radius: 4px; background: var(--surface-hover); }
.week-day.done i { background: var(--peach); }
.week-day.frozen i { background: light-dark(#7cc4f0,#5aa9d6); }
.week-day.rest i { background: repeating-linear-gradient(135deg, var(--border) 0 2px, transparent 2px 4px); }
.week-day.today i { outline: 2px solid var(--accent); outline-offset: 1px; }
.week-day.missed i { background: light-dark(#f1d3d3,#4a2a2f); }
.week-day.future i { background: transparent; border: 1px dashed var(--border); }
@media (max-width: 900px) { .streak-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .streak-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 580px) { .streak-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .week-strip { padding: 4px 8px; gap: 4px; } }

/* ===== Títulos e medalhas ===== */
.titles-block { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--border); }
.titles-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.titles-head p { margin: 0; color: var(--muted); font-size: 13px; }
.title-form { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised); }
.title-form button { border: 0; background: none; color: var(--muted); font: 600 12.5px var(--body, inherit); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.title-form button[aria-pressed="true"] { background: var(--accent-bg); color: var(--ink); }
.title-current, .title-next { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.title-current strong, .title-next strong { color: var(--ink); }
.title-next .track { margin-top: 6px; max-width: 420px; }
.titles-sub { margin: 16px 0 8px; font: 700 13px var(--heading); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.titles-sub + .title-grid { margin-top: 0; }
.title-card { width: 100%; height: 100%; display: grid; justify-items: center; align-content: start; gap: 3px; padding: 12px 8px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--muted); text-align: center; font: inherit; cursor: default; }
.title-card .title-icon { font-size: 24px; filter: grayscale(1); opacity: .6; }
.title-card strong { font-size: 13px; line-height: 1.2; }
.title-card small { font-size: 11px; line-height: 1.25; }
.title-card.won { color: var(--ink); border-color: var(--accent); background: var(--accent-bg); cursor: pointer; transition: transform .15s ease; }
.title-card.won .title-icon { filter: none; opacity: 1; }
.title-card.won:not(:disabled):hover { transform: translateY(-2px); }
.title-card.equipped { box-shadow: 0 0 0 2px var(--accent) inset; }
.title-card.equipped small { color: var(--accent); font-weight: 700; }

/* Título ao lado do nome na comunidade */
.honor { display: inline-block; position: relative; vertical-align: middle; margin-left: 4px; }
.honor summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.honor summary::-webkit-details-marker { display: none; }
.honor-title { padding: 2px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--ink); font-size: 11.5px; font-weight: 700; }
.honor-streak { font-size: 11.5px; font-weight: 700; color: var(--peach); }
.honor-medal { font-size: 14px; }
.honor-card { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 240px; display: grid; gap: 4px; padding: 12px; border-radius: 14px;
  background: var(--surface-raised); border: 1px solid var(--border); box-shadow: 0 12px 30px rgb(0 0 0 / .25); color: var(--ink); }
.honor-card p { margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.honor-medals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.honor-medals li { border: 0 !important; padding: 0 !important; margin: 0; display: grid; justify-items: center; font-size: 18px; opacity: .3; filter: grayscale(1); }
.honor-medals li.won { opacity: 1; filter: none; }
.honor-medals small { font-size: 10px; color: var(--muted); }

/* ===== Início enxuto ===== */
.week-mini-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.week-mini h2 { margin: 0; font: 800 18px var(--heading); }
.week-mini p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
details.fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary span { color: var(--muted); font-size: 13px; }
details.fold > summary span::after { content: " ▾"; }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold[open] > summary span::after { content: " ▴"; }
@media (max-width: 600px) {
  .title-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .title-card { padding: 9px 4px; }
  .title-card .title-icon { font-size: 20px; }
  .title-card strong { font-size: 11.5px; }
  .title-card small { font-size: 10px; }
  /* Primeiros passos no celular: só o próximo passo aparece. */
  .onboarding-steps li:not(.next) { display: none; }
}

/* Ser Supremo: título lendário */
.title-card.legendary.won, .honor-title.legendary {
  color: #fff; border-color: transparent;
  background: linear-gradient(120deg, #3b1d8f, #8a3fd1, #d9567c, #f0b429, #3b1d8f); background-size: 300% 100%;
  animation: supreme-shine 6s linear infinite; text-shadow: 0 1px 2px rgb(0 0 0 / .35);
}
.title-card.legendary.won small { color: #fff; }
@keyframes supreme-shine { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .title-card.legendary.won, .honor-title.legendary { animation: none; } }
