/* Studyhelper design system */
:root {
  --bg: #F7F6F2;
  --panel: #FFFFFF;
  --ink: #24303C;
  --muted: #66727E;
  --line: #E2E0D8;
  --accent: #1B6E8C;
  --accent-ink: #FFFFFF;
  --ok: #2E7D46;
  --warn: #A85B00;
  --danger: #B33A3A;
  --banner: #FFF3C4;
  --banner-ink: #5C4A00;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151C24;
    --panel: #1E2833;
    --ink: #E8EAEC;
    --muted: #93A0AC;
    --line: #2C3843;
    --accent: #58AFCF;
    --accent-ink: #0D1620;
    --banner: #4A3E10;
    --banner-ink: #F5E9B8;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
.container { max-width: 62rem; margin: 0 auto; padding: 1.2rem; }
.narrow { max-width: 34rem; margin: 0 auto; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; margin: .6rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.02rem; margin: 1rem 0 .3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.inline { display: inline; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: .5rem 1rem;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.1rem; }
.mainnav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.navlink {
  text-decoration: none; color: var(--ink); padding: .35rem .6rem;
  border-radius: 8px; font-size: .95rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.navlink:hover { background: var(--bg); }
.tier-aldre .nav-ico { display: none; }

/* Bottom tab bar: the phone's primary navigation on every tier */
.bottomnav { display: none; }
@media (max-width: 640px) {
  .mainnav { display: none; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bn-link {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    text-decoration: none; color: var(--ink); font-size: .68rem;
    padding: .2rem .5rem; border-radius: 10px; min-width: 3.2rem;
  }
  .bn-ico { font-size: 1.45rem; line-height: 1.2; }
  body { padding-bottom: 4.6rem; }
}
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.username { color: var(--muted); font-size: .9rem; }

/* Cards & layout */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin: .8rem 0;
}
.cardgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: .9rem;
}
.cardgrid .card { margin: 0; }
.card.action { text-decoration: none; color: var(--ink); transition: transform .1s; display: block; }
.card.action:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .emoji { font-size: 2rem; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 8rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .93rem; }
label.choice { flex-direction: row; align-items: center; gap: .5rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button, .button {
  font: inherit; cursor: pointer; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: .5rem .9rem; display: inline-block;
}
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.big { font-size: 1.15rem; padding: .7rem 1.4rem; }
button.ghost { border: none; background: none; color: var(--muted); padding: .3rem .5rem; }
button.small { font-size: .85rem; padding: .25rem .5rem; }
.button.warn, button.warn { border-color: var(--warn); color: var(--warn); }
.button.ok, button.ok { border-color: var(--ok); color: var(--ok); }
.button.danger, button.danger { border-color: var(--danger); color: var(--danger); }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; margin: .4rem 0; }

.badge {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 99px; padding: .05rem .6rem; font-size: .8rem; vertical-align: middle;
}
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.banner {
  background: var(--banner); color: var(--banner-ink);
  border-radius: var(--radius); padding: .6rem 1rem; margin: .8rem 0;
}
.banner.small { font-size: .85rem; padding: .3rem .6rem; }
.alert {
  background: #FBE6E6; color: #7C2222; border-radius: var(--radius);
  padding: .6rem 1rem; margin: .8rem 0;
}
@media (prefers-color-scheme: dark) { .alert { background: #4A1D1D; color: #F3C2C2; } }
.list { padding-left: 1.1rem; }
.list li { margin: .3rem 0; }
.table { border-collapse: collapse; width: 100%; }
.table th { text-align: left; border-bottom: 2px solid var(--line); padding: .4rem .5rem; font-size: .85rem; color: var(--muted); }
.table td { border-bottom: 1px solid var(--line); padding: .45rem .5rem; vertical-align: top; }
.table.small { font-size: .85rem; }
.row-ok { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.row-bad { background: color-mix(in srgb, var(--danger) 7%, transparent); }

/* Grades */
.grade-big { font-size: 4rem; font-weight: 800; }
.grade-A, .grade-9 { color: #1E8449; }
.grade-B, .grade-8 { color: #2E9E5B; }
.grade-C, .grade-7, .grade-6 { color: #B7950B; }
.grade-D, .grade-5, .grade-4 { color: #CA6F1E; }
.grade-E, .grade-3, .grade-2 { color: #BA4A00; }
.grade-F, .grade-1 { color: #B33A3A; }
.meter { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; height: .7rem; width: 10rem; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.meter-fill { background: var(--accent); height: 100%; border-radius: 99px; display: block; }
.meter-fill.meter-over { background: var(--danger, #B33A3A); }
.levelcard { margin-bottom: 1rem; }

.drill-continue { margin-top: .6rem; }

/* Streak + weekly goal: honest 'you showed up' feedback, no leagues */
.streakbar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: .2rem 0 1rem; }
.streakflame { font-weight: 600; }
.streakflame.cold { filter: grayscale(1); opacity: .6; }
.weekdots { display: inline-flex; gap: .3rem; }
.weekdots .dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.weekdots .dot.on { background: var(--accent); border-color: var(--accent); }
body.tier-barn .streakbar { font-size: 1.15rem; }
body.tier-barn .weekdots .dot { width: .85rem; height: .85rem; }

/* Admin sub-navigation: quiet tabs, current page underlined with accent */
.subnav { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .8rem 0 1.4rem; overflow-x: auto; }
.subnav a { padding: .55rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: var(--radius) var(--radius) 0 0; }
.subnav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.subnav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* Chooser-first starters: a compact row that expands its configuration */
.starterlist { display: flex; flex-direction: column; gap: .6rem; margin: .8rem 0 1.6rem; }
.starter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.starter > summary { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; cursor: pointer; list-style: none; border-radius: var(--radius); }
.starter > summary::-webkit-details-marker { display: none; }
.starter > summary::after { content: ""; width: .8rem; height: .8rem; background: var(--muted); clip-path: polygon(50% 72%, 8% 32%, 20% 20%, 50% 48%, 80% 20%, 92% 32%); transition: transform .18s ease-out; margin-left: auto; flex-shrink: 0; }
.starter[open] > summary::after { transform: rotate(180deg); }
.starter > summary:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.starter > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.starter[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.starter-ico { font-size: 1.35rem; flex-shrink: 0; width: 1.8rem; text-align: center; }
.starter-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.starter-main .muted.small { line-height: 1.35; }
.starter-body { padding: 1rem; }
.starter-body h3:first-child { margin-top: 0; }
.planrow { display: flex; align-items: center; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.planrow:last-child { border-bottom: none; }
.planrow b { min-width: 6rem; }
.social-row .button { display: block; text-align: center; }
.levelchips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.levelchip { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 99px; padding: .35rem .8rem; background: var(--bg); }
.levelgrade { font-weight: 800; }
.leveltrend { font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* Login */
.login-wrap { max-width: 26rem; margin: 3rem auto; }
.login-logo { text-align: center; font-size: 2rem; }
.kid-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.kid-choice { flex-direction: row; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; cursor: pointer; font-size: 1.05rem; }
.kid-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pin-input { font-size: 1.6rem; letter-spacing: .5rem; text-align: center; }

/* Chat */
.chatlog { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; min-height: 8rem; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 46rem; padding: .55rem .9rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); white-space: pre-wrap;
}
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chatinput { display: flex; gap: .5rem; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding: .5rem 0; }
.chatinput textarea { flex: 1; resize: vertical; }
#recbtn.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.speakbtn { border: none; background: none; cursor: pointer; font-size: .95rem; opacity: .6; }
.speakbtn:hover { opacity: 1; }
.chat-img { display: block; max-width: 280px; max-height: 280px; border-radius: 10px; margin-top: .5rem; }
.chat-file { margin-top: .4rem; font-size: .88rem; opacity: .85; }
.attach-preview { display: flex; gap: .4rem; flex-wrap: wrap; }
.attach-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: .15rem .6rem; font-size: .85rem;
}

/* Drills */
.drill-question { font-size: 2.6rem; text-align: center; margin: 1rem 0; word-break: break-word; }
.drill-answerrow { display: flex; gap: .6rem; justify-content: center; }
.drill-answerrow input { font-size: 1.8rem; width: 9rem; text-align: center; }
.drill-options { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.drill-options button { font-size: 1.8rem; min-width: 4rem; padding: .8rem 1.2rem; }
.drill-options button.opt-wide {
  font-size: 1.05rem; min-width: 0; width: 100%; max-width: 34rem;
  text-align: left; padding: .7rem 1rem;
}
.drill-question.longq { font-size: 1.35rem; text-align: left; line-height: 1.5; }
.drill-feedback { text-align: center; font-size: 1.2rem; min-height: 2rem; margin-top: .8rem; }
.drill-progress { text-align: center; color: var(--muted); margin: .5rem; }
.drill-score { font-size: 2rem; margin: 1rem; }
.tables-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.tbl { flex-direction: row; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; justify-content: center; cursor: pointer; }
.tbl:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.clockface { display: block; margin: 0 auto; }

/* ============ Age tiers: one school, three rooms ============ */

/* Mellan (åk 3/4–6): energetic clubroom — indigo, lively, never childish */
.tier-mellan {
  --accent: #4F46E5;
  --accent-ink: #FFFFFF;
  --radius: 14px;
  font-size: 17px;
}
.tier-mellan .banner {
  background: linear-gradient(100deg, var(--banner), color-mix(in srgb, #4F46E5 14%, var(--banner)));
}
.tier-mellan .card.action:hover { transform: translateY(-3px); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 45%, transparent); }
.tier-mellan .card .emoji { font-size: 2.4rem; }
@media (prefers-color-scheme: dark) {
  .tier-mellan { --accent: #8B8AF7; --accent-ink: #10142E; }
}

/* Barn (F–åk 2/3): playroom — sky ground, coral + sun, audio and icons first */
.tier-barn {
  --bg: #EAF4FC;
  --panel: #FFFFFF;
  --ink: #1E3348;
  --muted: #55708B;
  --line: #C9E0F1;
  --accent: #E8543F;
  --accent-ink: #FFFFFF;
  --banner: #FFE9A8;
  --banner-ink: #6B4E00;
  --radius: 22px;
  font-size: 19px;
}
.tier-barn { --head: #C9432E; }
@media (prefers-color-scheme: dark) {
  .tier-barn {
    /* the playroom keeps its blue warmth after dark: deep sky, not gray slate */
    --bg: #0E2A44; --panel: #17456B; --ink: #F2F8FD; --muted: #A9C6DD;
    --line: #2E608A; --accent: #FF8A65; --accent-ink: #3A1508;
    --banner: #5C4A12; --banner-ink: #FFE9A8;
    --head: #FFB59E;
  }
}
.tier-barn h1 { font-size: 2rem; }
.tier-barn .card.action h2 { color: var(--head); }
.tier-barn .card .emoji { font-size: 3.4rem; }
.tier-barn .card.action { padding: 1.4rem 1.4rem 1.2rem; position: relative; }
.tier-barn .card.action h2 { font-size: 1.35rem; }
.tier-barn button, .tier-barn .button { min-height: 3.1rem; font-size: 1.08rem; }
.tier-barn button.ghost { min-height: 0; }
.tier-barn input, .tier-barn select, .tier-barn textarea { min-height: 3rem; font-size: 1.05rem; }
.tier-barn .drill-question { font-size: 3.6rem; }
.tier-barn .drill-answerrow input { font-size: 2.2rem; width: 11rem; }
.tier-barn .drill-options button { font-size: 2.2rem; min-width: 5rem; padding: 1rem 1.5rem; }
.tier-barn .card-face { font-size: 2.3rem; }
.tier-barn .bn-txt { font-size: .74rem; font-weight: 600; }
.tier-barn .bn-ico { font-size: 1.7rem; }
.tier-barn .badge { font-size: .95rem; padding: .15rem .8rem; }
.card-speak {
  position: absolute; top: .8rem; right: .8rem;
  border-radius: 50%; width: 3rem; height: 3rem; min-height: 0 !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; padding: 0;
  background: var(--bg); border: 1px solid var(--line);
}
@media (hover: hover) {
  .card-speak:hover { border-color: var(--accent); }
}
/* playful press-down on touch, unless motion is reduced */
.tier-barn button.primary:active, .tier-barn .card.action:active { transform: scale(.965); }
.tier-barn button.primary, .tier-barn .card.action { transition: transform .12s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .tier-barn button.primary:active, .tier-barn .card.action:active { transform: none; }
  .card.action, .card.action:hover { transform: none !important; transition: none; }
}

/* Tablet: comfortable touch without losing the desktop calm */
@media (min-width: 641px) and (max-width: 1024px) {
  .container { padding: 1.4rem 1.6rem; }
  button.primary, .button.primary { min-height: 2.7rem; }
  .homegrid { grid-template-columns: repeat(2, 1fr); }
}

/* Celebration bursts: earned moments only, sized to the tier's voice */
.done-card { position: relative; overflow: hidden; }
.burst-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.burst-p {
  position: absolute; bottom: -1.6rem;
  animation: burst-rise 1.4s ease-out forwards;
}
@keyframes burst-rise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-16rem) rotate(24deg); opacity: 0; }
}
.drill-praise { font-size: 1.15rem; font-weight: 600; margin: .3rem 0 .1rem; }
.tier-barn .drill-praise { font-size: 1.45rem; }
@media (prefers-reduced-motion: reduce) {
  .burst-layer { display: none; }
}

/* Camera capture controls exist only where there is a camera in hand */
.mobile-only { display: none !important; }
@media (pointer: coarse) {
  .mobile-only { display: flex !important; }
  label.mobile-only { display: flex !important; }
}

/* Global audio bar: pause/resume + stop for whatever voice is playing */
#audio-bar {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  display: flex; align-items: center; gap: .4rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: .35rem .6rem;
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, .35);
}
#audio-bar .ab-ico { font-size: 1.1rem; }
#audio-bar.loading .ab-ico { animation: ab-pulse 1s ease-in-out infinite; }
@keyframes ab-pulse { 50% { opacity: .35; } }
#audio-bar .ab-btn {
  border: none; background: var(--bg); border-radius: 50%;
  width: 2.4rem; height: 2.4rem; min-height: 0 !important;
  font-size: 1.05rem; padding: 0; display: flex; align-items: center; justify-content: center;
}
#audio-bar .ab-btn:hover { background: color-mix(in srgb, var(--accent) 15%, var(--bg)); }
.tier-barn #audio-bar .ab-btn { width: 3rem; height: 3rem; font-size: 1.3rem; }
@media (max-width: 640px) {
  #audio-bar { bottom: 5.2rem; } /* clear the bottom tab bar */
}
@media (prefers-reduced-motion: reduce) {
  #audio-bar.loading .ab-ico { animation: none; }
}

/* Browser surfaces carry the palette too */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tier-barn :focus-visible { outline-width: 3px; }
* { scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; scrollbar-width: thin; }
.table td, .drill-score, .meter + * { font-variant-numeric: tabular-nums; }

/* Cards review */
.card-face { font-size: 1.9rem; margin: 1.2rem 0; min-height: 3rem; }
.card-face.back { color: var(--accent); }
.card-grades { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* Workbook ask */
.askanswer { margin-top: .8rem; white-space: pre-wrap; }
.askanswer .cites { margin-top: .6rem; font-size: .85rem; color: var(--muted); }

/* Prov */
.question .qhead { margin-bottom: .5rem; }
#timer {
  /* remaining time must stay visible while scrolling through the test */
  position: sticky; top: .5rem; z-index: 45;
  box-shadow: 0 3px 12px -4px rgba(0, 0, 0, .3);
  font-variant-numeric: tabular-nums;
}
#timer.low { background: #F8D7DA; color: #842029; }
@media (prefers-color-scheme: dark) {
  #timer.low { background: #58151C; color: #F5C2C7; }
}

.inactive { opacity: .65; }
@media (max-width: 640px) {
  .drill-question { font-size: 2rem; }
  .tier-barn .drill-question { font-size: 2.8rem; }
  .username { display: none; }
  h1 { font-size: 1.45rem; }
  .tier-barn h1 { font-size: 1.7rem; }
}

/* ============================== Landing ==================================
   The honesty manifesto (seed 461a3f48). Familjen Grotesk display over the
   app's own paper/ink/teal world. ONE alert color, reserved for the honesty
   moments; the three room fields own their tier colors completely. */
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
.landing { --land-alert: #B33A3A; font-family: "Familjen Grotesk", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) { .landing { --land-alert: #EA5C6B; } }
.landing section { padding: 3.5rem 0; border-bottom: 1px solid var(--line); }
.landing h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -.01em; margin: 0 0 .5rem; text-wrap: balance; }
.land-section-sub { color: var(--muted); margin: 0 0 1.6rem; font-size: 1.05rem; }

.land-top { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1rem; }
.land-brand { font-weight: 700; font-size: 1.15rem; }
.land-nav { display: flex; align-items: center; gap: 1rem; }
.land-lang, .land-loginlink { color: var(--muted); text-decoration: none; }
.land-loginlink:hover, .land-lang:hover { color: var(--ink); }
.land-cta-btn { display: inline-block; background: var(--accent); color: var(--accent-ink, #fff); padding: .6rem 1.2rem; border-radius: 999px; text-decoration: none; font-weight: 600; white-space: nowrap; transition: transform .15s ease-out, box-shadow .15s ease-out; }
.land-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.land-cta-btn.big { padding: .9rem 1.8rem; font-size: 1.15rem; }
.land-ghost { color: var(--ink); text-decoration: none; padding: .9rem .6rem; font-weight: 600; }
.land-ghost:hover { color: var(--accent); }

.land-hero { border-bottom: none !important; padding-top: 3rem !important; }
.land-hero h1 { font-size: clamp(2.1rem, 6.5vw, 4.2rem); font-weight: 700; line-height: 1.06; letter-spacing: -.025em; margin: 0 0 1.2rem; text-wrap: balance; }
.land-hero h1 span { display: block; }
.land-alert-em { font-style: italic; color: var(--land-alert); }
.land-sub { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 44rem; line-height: 1.55; margin: 0 0 1.6rem; }
.land-cta-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.land-trust { color: var(--muted); font-size: .92rem; margin-top: 1rem; }

.land-receipt { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.land-receipt h2 { font-size: 1.25rem; }
.land-get, .land-never { border-radius: 16px; padding: 1.6rem; }
.land-get { background: var(--panel); border: 1px solid var(--line); }
.land-never { background: color-mix(in srgb, var(--land-alert) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--land-alert) 25%, transparent); }
.land-receipt ul { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.land-receipt li { padding-left: 1.7rem; position: relative; line-height: 1.45; }
.land-get li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.land-never li::before { content: "✕"; position: absolute; left: 0; color: var(--land-alert); font-weight: 700; }

.land-roomgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.land-room { border-radius: 18px; padding: 1.6rem; }
.land-room h3 { margin: .4rem 0 .4rem; font-size: 1.2rem; }
.land-room p { margin: 0; line-height: 1.5; font-size: .97rem; }
.room-ico { font-size: 2rem; }
.room-barn { background: #EAF4FC; color: #1E3348; border: 2px solid #E8543F; }
.room-mellan { background: #EEF2FF; color: #1E1B4B; border: 2px solid #4F46E5; }
.room-aldre { background: var(--panel); color: var(--ink); border: 2px solid var(--accent); }
@media (prefers-color-scheme: dark) {
  .room-barn { background: #0E2A44; color: #F2F8FD; }
  .room-mellan { background: #1E1B4B; color: #E0E7FF; }
}

.land-chat { max-width: 34rem; display: flex; flex-direction: column; gap: .7rem; }
.land-msg { display: flex; }
.land-msg.user { justify-content: flex-end; }
.land-bubble { max-width: 85%; padding: .8rem 1.1rem; border-radius: 18px; line-height: 1.5; }
.land-msg.user .land-bubble { background: var(--accent); color: var(--accent-ink, #fff); border-bottom-right-radius: 6px; }
.land-msg.ai .land-bubble { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .land-chat .land-msg { opacity: 0; transform: translateY(10px); }
  .land-chat.play .land-msg { animation: land-in .5s ease-out forwards; }
  .land-chat.play .land-msg:nth-child(1) { animation-delay: .1s; }
  .land-chat.play .land-msg:nth-child(2) { animation-delay: .9s; }
  .land-chat.play .land-msg:nth-child(3) { animation-delay: 1.9s; }
  .land-chat.play .land-msg:nth-child(4) { animation-delay: 2.7s; }
  @keyframes land-in { to { opacity: 1; transform: none; } }
}

.land-steps { list-style: none; counter-reset: step; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.2rem; }
.land-steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 1rem; }
.land-steps li::before { content: counter(step); display: block; font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--accent); margin-bottom: .5rem; letter-spacing: -.02em; }
.land-steps h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.land-steps p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .95rem; }

.land-plangrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.land-plan { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; text-align: center; }
.land-plan.featured { border: 2px solid var(--accent); box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 15%, transparent); }
.land-plan h3 { margin: 0 0 .4rem; }
.land-plan-price { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.land-plan-price span { font-size: .95rem; font-weight: 400; color: var(--muted); }
.land-plan .land-cta-btn { margin-top: 1rem; }

.land-faq details { border-bottom: 1px solid var(--line); }
.land-faq summary { cursor: pointer; padding: 1rem 0; font-weight: 600; font-size: 1.05rem; list-style: none; position: relative; padding-right: 2rem; }
.land-faq summary::-webkit-details-marker { display: none; }
.land-faq summary::after { content: "+"; position: absolute; right: .4rem; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.land-faq details[open] summary::after { content: "–"; }
.land-faq details p { margin: 0 0 1.1rem; max-width: 46rem; line-height: 1.6; color: var(--muted); }

.land-final { text-align: center; border-bottom: none !important; }
.land-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 0 .6rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.land-footer a { color: var(--muted); }

@media (max-width: 760px) {
  .land-receipt, .land-roomgrid, .land-steps, .land-plangrid { grid-template-columns: 1fr; }
  .landing section { padding: 2.4rem 0; }
  .land-loginlink { display: none; }
  .land-hero { padding-top: 1.5rem !important; }
}

/* --- cookie notice (public pages) ------------------------------------- */
.cookie-note {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  z-index: 90; max-width: min(94vw, 34rem);
  display: flex; align-items: center; gap: .8rem;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: .8rem;
  padding: .7rem 1rem; font-size: .85rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.cookie-note .button { flex: 0 0 auto; }
