/*
 * Math House Academy launch site: home, legal and coming-soon pages.
 * The house style: deep navy and steel blue on paper and mist, a thin gold rule,
 * hairline borders, square corners, DM Sans throughout, and mathematics typeset
 * by the bundled KaTeX (assets/katex). Self-contained apart from katex.min.css.
 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(assets/fonts/dm-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #182f4d;
  --navy: #203749;
  --deep: #15304f;
  --deeper: #0f2340;
  --panel: #29495f;
  --steel: #2f6f99;
  --steel-dark: #285f8d;
  --gold: #aa9670;
  --gold-ink: #7d5c30;
  --gold-light: #d8b46a;
  --cream: #f0dfb6;
  --paper: #fbfaf7;
  --sand: #f3f1ec;
  --sand-line: #e3ded3;
  --mist: #edf2f6;
  --line: #dce5ef;
  --line-strong: #c9d6e3;
  --text: #22364c;
  --muted: #4a5b6d;
  --green: #3f6f50;
  --green-bg: #eef5f0;
  --green-line: #bcd5c4;
  --rust: #9a4f2c;
  --radius: 4px;
  --shadow: 0 18px 44px rgba(21, 48, 79, 0.10);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
.tutor-question-preview {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  cursor: text;
  display: block;
  font: inherit;
  min-height: 110px;
  overflow-wrap: anywhere;
  padding: 12px;
  text-align: left;
  width: 100%;
}
.tutor-question-preview[hidden], #tutor-input[hidden] { display: none; }
.tutor-question-edit-hint { color: var(--muted); display: block; font-size: 12px; margin-top: 10px; }
.tutor-question-preview:focus-visible { outline: 2px solid var(--steel-dark); outline-offset: 2px; }
.contact-page { max-width: 840px; }
.contact-page h1 { margin-top: 18px; }
.contact-page [data-support-form] { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 18px; margin: 28px 0; padding: clamp(16px, 4vw, 28px); }
.contact-page [data-support-form] > label { display: grid; gap: 8px; min-width: 0; font-weight: 600; }
.contact-page :is(select, textarea, input[type='email']) { background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font: inherit; font-size: 16px; min-height: 48px; min-width: 0; padding: 10px 12px; width: 100%; }
.contact-page textarea { min-height: 180px; resize: vertical; }
.contact-page [data-support-form] > .contact-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 400; }
.contact-consent input { flex: none; height: 20px; width: 20px; margin: 3px 0 0; }
.contact-page [data-support-form] p { margin: 0; font-size: 14px; }
.contact-page [data-support-form] > button { justify-self: start; min-height: 48px; }
.contact-page :is(select, textarea, input, button):focus-visible { outline: 2px solid var(--steel-dark); outline-offset: 2px; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 17px/1.65 var(--font); text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; }
a { color: var(--steel-dark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--font); color: var(--ink); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.14rem; font-weight: 700; }
p { margin: 0 0 14px; }
:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 10001; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1140px, 100% - 48px); margin-inline: auto; }

/* Announcement bar */
.announce { background: var(--deep); color: #dbe4ee; font-size: 0.8rem; }
.announce .wrap { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 26px; min-height: 36px; padding-block: 7px; text-align: center; }
.announce strong { color: var(--cream); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.announce a { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.4); }
.announce a:hover { color: var(--cream); border-bottom-color: var(--cream); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 74px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 48px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 9px 11px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--steel-dark); border-bottom-color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn { min-height: 44px; white-space: nowrap; }
.header-actions .btn-ghost { border-color: var(--navy); }

/* Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px; border: 1px solid transparent; border-radius: var(--radius); font: 700 0.98rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--deeper); color: #fff; }
.btn-accent { background: var(--steel-dark); color: #fff; }
.btn-accent:hover { background: #1f4e75; color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn-ghost:hover { background: #fff; border-color: var(--navy); color: var(--navy); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.text-link { display: inline-block; color: var(--ink); font-weight: 700; font-size: 0.94rem; text-decoration: none; padding: 10px 2px; border-bottom: 1px solid var(--line-strong); }
.text-link:hover { color: var(--steel-dark); border-bottom-color: var(--gold); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* Shared labels */
.eyebrow, .kicker { display: block; color: var(--gold-ink); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.02em; margin-bottom: 14px; }
.rule { display: block; width: 64px; height: 2px; margin: 26px 0 24px; border: 0; background: var(--gold); }
.badge { display: inline-block; color: var(--gold-ink); background: #f7f0e1; border: 1px solid #e8d9b8; border-radius: 3px; padding: 3px 9px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.fine { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

/* Hero */
.hero { background: var(--mist); border-bottom: 1px solid var(--line); padding: 64px 0 60px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 56px; align-items: start; }
.hero h1 span { display: block; color: var(--steel-dark); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; }
.hero-facts { list-style: none; margin: 26px 0 0; padding: 0; max-width: 34em; border-top: 1px solid var(--line-strong); }
.hero-facts li { display: grid; grid-template-columns: 42px minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--line-strong); font-size: 0.97rem; }
.hero-facts b { color: var(--gold-ink); font-size: 0.8rem; letter-spacing: 0.08em; line-height: 1.9; }
.hero .cta-row { margin-top: 30px; }

/* The free tutor, styled as the Math House problem card */
.tutor { background: #fff; border: 1px solid var(--line-strong); border-top: 4px solid var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.tutor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 22px; padding: 16px 0 14px; border-bottom: 1px dashed var(--line-strong); }
.tutor-head strong { color: var(--ink); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.tutor-count { color: var(--ink); background: var(--mist); border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.tutor-log { min-height: 250px; max-height: 520px; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.tutor-kicker { margin: 0 0 6px; color: var(--steel-dark); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.tutor-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 0 0 6px; }
.tutor-empty > p:not(.tutor-kicker) { color: var(--muted); font-size: 0.96rem; margin-bottom: 16px; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chip { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; text-align: left; background: #f5f8fb; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); font: 500 0.94rem/1.35 var(--font); cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.chip:hover { background: #fff; border-color: var(--steel-dark); }
.chip-key { flex: 0 0 auto; color: var(--steel-dark); font-size: 0.78rem; font-weight: 700; }
.chip .katex { white-space: nowrap; }
.tutor-form { padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.tutor-form textarea { display: block; width: 100%; min-height: 78px; resize: vertical; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.tutor-form textarea:focus { outline: none; border-color: var(--steel-dark); box-shadow: 0 0 0 3px rgba(40, 95, 141, 0.16); }
.tutor-form textarea:disabled { background: var(--mist); }
.tutor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.tutor-meta { color: var(--muted); font-size: 0.82rem; }
.tutor-fine { margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.tutor-cta { margin: 0 22px; padding: 18px 0; border-top: 1px dashed var(--line-strong); }
.tutor-cta h3 { margin-bottom: 6px; }
.tutor-cta p { color: var(--muted); font-size: 0.95rem; }
.tutor-cta .cta-row { gap: 10px; margin-top: 12px; }
.tutor-sign { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 22px; padding: 12px 0 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
.tutor-sign b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #3a5f99; color: #fff; font-size: 0.76rem; letter-spacing: 0.02em; }

/* Conversation */
.msg { font-size: 0.98rem; line-height: 1.6; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; max-width: 88%; padding: 10px 14px; background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 var(--radius); white-space: pre-wrap; }
.msg-ai { align-self: stretch; padding: 14px 16px 16px; background: #e8ebe2; border: 1px solid var(--line); border-inline-start: 3px solid var(--steel-dark); border-radius: 0 var(--radius) var(--radius) 0; }
.msg-label { display: block; margin-bottom: 10px; color: var(--steel-dark); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.msg-note { align-self: center; max-width: 100%; padding: 8px 12px; background: #fbf6ea; border: 1px solid #ead9b5; border-radius: var(--radius); color: var(--gold-ink); font-size: 0.92rem; text-align: center; }
.msg-thinking { align-self: flex-start; color: var(--muted); font-size: 0.94rem; font-style: italic; }

/* A structured answer: knowledge points, numbered steps, answer, check, common mistake, try next */
.answer > p { margin: 0 0 10px; }
.answer p:last-child { margin-bottom: 0; }
.answer strong { color: var(--ink); }
.answer-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.answer-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.answer-section h3 { margin: 0 0 8px; color: var(--gold-ink); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.answer ul { margin: 0; padding-inline-start: 20px; }
.answer ul li { margin-bottom: 6px; }
.answer ul li::marker { color: var(--gold); }
.answer ol { list-style: none; margin: 0; padding: 0; }
.answer ol li { position: relative; margin-bottom: 10px; padding-inline-start: 36px; }
.answer ol li:last-child { margin-bottom: 0; }
.answer ol li::before { content: attr(data-step); position: absolute; inset-inline-start: 0; top: 1px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.72rem; font-weight: 700; }
.answer-section--answer { padding: 10px 14px; background: var(--green-bg); border: 1px solid var(--green-line); border-inline-start: 3px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; }
.answer-section--answer h3 { color: var(--green); }
.answer-section--answer + .answer-section { border-top: 0; }
.answer-section--mistake h3 { color: var(--rust); }
.answer-section--try { padding: 10px 14px; background: var(--mist); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.answer-section--try h3 { color: var(--steel-dark); }
.answer-section--next { padding: 10px 14px; background: var(--mist); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.answer-section--next h3 { color: var(--steel-dark); }
.tex-display, .answer .katex-display { display: block; margin: 8px 0; padding: 2px 0; overflow-x: auto; overflow-y: hidden; }
.answer .katex-display > .katex { text-align: start; }
.katex { font-size: 1.05em; }
.tex-source { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; color: var(--ink); }
.answer-figure { margin: 14px 0 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.answer-figure img { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
.answer-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 0.86rem; line-height: 1.5; text-align: center; }

/* Sections */
.section { padding: 84px 0; }
.section-head { max-width: 46em; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.section-dark { background: var(--deep); color: #d3dde8; }
.section-dark h2 { color: #fff; }
.section-dark .kicker { color: var(--gold-light); }
.section-steel { background: var(--steel-dark); color: #dfeaf4; }
.section-steel h2, .section-steel h3 { color: #fff; }
.section-steel .kicker { color: var(--cream); }
.section-steel .section-head p { color: #d2e2ef; }
.section-sand { background: var(--sand); border-block: 1px solid var(--sand-line); }

/* Example answer */
.example-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 60px; align-items: center; }
.example-grid > div > p { color: #c3d0dd; font-size: 1.06rem; max-width: 32em; }
.feature-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 20px; }
.feature-list li { padding: 2px 0 2px 18px; border-left: 2px solid var(--gold); }
.feature-list strong { display: block; color: #fff; font-size: 1.04rem; margin-bottom: 3px; }
.feature-list span { color: #b9c7d5; font-size: 0.95rem; }
.example-card { margin: 0; background: #fff; color: var(--text); border-radius: 12px; overflow: hidden; box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28); }
.example-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; background: #f2f6f9; border-bottom: 1px solid var(--line); }
.example-card header span { color: #4f6d8a; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.example-card header strong { color: var(--ink); font-size: 0.92rem; }
.example-body { padding: 18px 22px 20px; }
.example-problem { margin: 0 0 16px; color: var(--ink); font-size: 1.1rem; font-weight: 700; }
.example-card .answer { font-size: 0.95rem; line-height: 1.6; }
.example-note { margin: 0; padding: 11px 22px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.everyday-examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; align-items: stretch; }
.everyday-examples-grid .example-card { display: flex; flex-direction: column; box-shadow: 0 12px 30px rgba(30, 52, 74, 0.12); }
.everyday-examples-grid .example-body { display: flex; flex-direction: column; flex: 1; }
.everyday-examples-grid .answer-section h3 { color: var(--gold-ink); }
.everyday-examples-grid .answer-section--mistake h3 { color: var(--rust); }
.everyday-examples-grid .answer-section--mistake { margin-bottom: 14px; }
.everyday-examples-grid .answer-section--try { margin-top: auto; }
.everyday-examples-grid .answer-section--try h3 { color: var(--steel-dark); }
.example-visual { margin-bottom: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f2f6f9; }
.example-visual svg { display: block; width: 100%; height: auto; }
.example-visual p { margin: 8px 0 0; color: var(--ink); font-size: 0.85rem; line-height: 1.5; }
.visual-part { fill: #c4dcec; stroke: #406786; stroke-width: 1.5; }
.visual-empty { fill: #fff; stroke: #406786; stroke-width: 1.5; }
.visual-label { fill: #193b57; font-family: var(--font); font-size: 14px; font-weight: 700; }
.visual-line { fill: none; stroke: #406786; stroke-width: 2; stroke-linejoin: round; }
.visual-triangle { fill: #dceaf4; stroke: #406786; stroke-width: 2; stroke-linejoin: round; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, 0.24); }
.steps article { padding: 28px 28px 4px 0; }
.steps article + article { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, 0.24); }
.step-num { display: block; margin-bottom: 14px; color: var(--gold-light); font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.steps p { color: #d6e4f0; }

/* Trust */
.trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trust-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 0 16px; padding: 24px 26px; background: #fff; border: 1px solid var(--sand-line); border-radius: var(--radius); }
.trust-card .num { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #f6ebe4; color: var(--rust); font-size: 0.86rem; font-weight: 700; }
.trust-card p { color: var(--muted); margin: 0; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.plan { position: relative; overflow: hidden; max-width: 720px; padding: 30px 32px 28px; background: #fff; border: 1px solid var(--line-strong); border-top: 4px solid var(--steel-dark); border-radius: var(--radius); box-shadow: var(--shadow); }
.plan::after { content: ''; position: absolute; top: -78px; right: -78px; width: 220px; height: 220px; border: 28px solid rgba(47, 111, 153, 0.07); border-radius: 50%; pointer-events: none; }
.plan-price { margin: 14px 0 6px; color: var(--ink); font-size: clamp(2.4rem, 5vw, 3.1rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.plan-price small { color: var(--muted); font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.plan ul { list-style: none; margin: 22px 0; padding: 0; border-top: 1px solid var(--line); }
.plan li { position: relative; padding: 11px 0 11px 26px; border-bottom: 1px solid var(--line); }
.plan li::before { content: ''; position: absolute; left: 2px; top: 22px; width: 11px; height: 2px; background: var(--gold); }
.plan .fine { margin: 18px 0 0; }

/* Coming soon */
.soon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.soon-card { padding: 26px 24px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius); }
.soon-card h3 { margin-top: 14px; }
.soon-card p { color: var(--muted); margin: 0; }
.soon-card--bc { border-top-color: var(--steel); }
.soon-bc-landscape { display: block; width: 96px; height: 72px; }
.soon-bc-caption { color: var(--steel-dark); display: block; font-size: 13px; margin-top: 16px; }
.soon-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.soon-symbol { display: grid; place-items: center; width: 48px; height: 48px; background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); color: var(--steel-dark); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.soon-note { margin-top: 22px; }

/* FAQ */
.faq { max-width: 860px; border-top: 1px solid var(--line-strong); }
details { border-bottom: 1px solid var(--line-strong); }
summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 0; color: var(--ink); font-weight: 700; font-size: 1.03rem; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; flex: 0 0 auto; color: var(--gold-ink); font-size: 1.35rem; font-weight: 400; line-height: 1; }
details[open] summary::after { content: '\2212'; }
details p { max-width: 46em; margin: 0 0 18px; color: var(--muted); }

/* Footer */
.tutor-media-controls, .tutor-media-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0; }
.tutor-media-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
@media (max-width: 540px) {
  .tutor-media-options { grid-template-columns: minmax(0, 1fr); }
}
.tutor-media-controls .btn, .tutor-answer-tools .btn { min-height: 44px; gap: 8px; }
.tutor-media-controls svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tutor-media-options label { display: grid; gap: 6px; color: var(--ink); font-size: .85rem; }
.tutor-media-options select { max-width: 100%; height: 48px; min-height: 48px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; }
.tutor-media-options .tutor-auto-read { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.tutor-auto-read input, .tutor-photo-review input { width: 20px; height: 20px; flex: none; }
.tutor-media-status { margin: 8px 0; font-size: .88rem; color: var(--muted); }
.tutor-media-status[role="alert"] { color: var(--rust); }
.tutor-photo-review { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--mist); }
.tutor-photo-review img { display: block; max-width: 100%; max-height: 220px; margin-bottom: 10px; }
.tutor-photo-review label { display: flex; align-items: start; gap: 8px; font-size: .88rem; margin-bottom: 10px; }
.tutor-age-confirm { display: flex; align-items: start; gap: 8px; font-size: .88rem; line-height: 1.45; margin: 6px 0 10px; }
.tutor-age-confirm input { margin-top: 3px; flex: none; }
.tutor-answer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
[data-free-tutor] [hidden] { display: none !important; }
@media (pointer: coarse) {
  [data-free-tutor] .btn, [data-free-tutor] select { min-height: 48px; min-width: 48px; }
  [data-free-tutor] .btn { touch-action: manipulation; }
}
@media (min-width: 761px) and (max-width: 1366px) and (pointer: coarse) {
  [data-free-tutor] .answer { font-size: 18px; line-height: 1.85; }
  [data-free-tutor] .tutor-media-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  [data-free-tutor] .tutor-media-options select { width: 100%; font-size: 16px; }
  [data-free-tutor] .tutor-media-controls { gap: 12px; }
  [data-free-tutor] .tutor-answer-tools { gap: 12px; }
  [data-free-tutor] .answer-figure img { max-height: 560px; }
}
.tutor-answer-tools audio { width: 100%; min-width: 0; }
.tutor-answer-tools [role="status"] { width: 100%; font-size: .85rem; color: var(--muted); }
.site-footer { padding: 46px 0 54px; background: var(--sand); border-top: 1px solid var(--sand-line); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; }
.footer-brand { display: inline-block; margin-bottom: 14px; }
.footer-brand img { display: block; height: 54px; width: auto; }
.site-footer p { margin: 0 0 8px; font-size: 0.92rem; }
.site-footer strong { color: var(--ink); }
.footer-links { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 12px 22px; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; background: none; border: 0; border-bottom: 1px solid var(--line-strong); color: var(--ink); font: 600 0.92rem/1.5 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; }
.footer-links a:hover, .footer-links button:hover { border-bottom-color: var(--gold); color: var(--steel-dark); }

/* Legal and plain pages */
.page { padding: 52px 0 80px; }
.legal { max-width: 860px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.legal section { margin: 18px 0; padding: 22px 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.legal h2 { font-size: 1.25rem; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.notice { padding: 14px 16px; background: #fbf6ea; border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; }
.card { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card p:last-child { margin-bottom: 0; }
.center-card { max-width: 660px; margin: 40px auto; text-align: center; border-top: 4px solid var(--panel); box-shadow: var(--shadow); }
.center-card .lead { margin-inline: auto; }

@media (max-width: 1080px) {
  .site-nav a { padding-inline: 8px; }
}
@media (max-width: 1023px) {
  .site-header-home .wrap { flex-wrap: wrap; gap: 6px 16px; min-height: 0; padding-block: 12px 0; }
  .site-header-home .site-nav { order: 3; width: 100%; margin: 0 -8px; gap: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .site-header-home .site-nav a { white-space: nowrap; padding: 10px 8px; }
  .site-header-home .header-actions { margin-left: auto; }
}
@media (max-width: 960px) {
  .hero-grid, .example-grid, .pricing-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: 1fr; }
  .steps article, .steps article + article { padding: 24px 0 8px; border-left: 0; }
  .steps article + article { border-top: 1px solid rgba(255, 255, 255, 0.24); }
  .trust-grid, .soon-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: start; }
  .footer-links a, .footer-links button { justify-self: start; white-space: normal; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { width: min(1140px, 100% - 32px); }
  .announce .wrap { gap: 2px 14px; }
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: wrap; gap: 6px 12px; min-height: 0; padding-block: 10px 0; }
  .brand img { height: 40px; }
  .site-nav { order: 3; width: 100%; margin: 0 -8px; gap: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .site-nav a { white-space: nowrap; padding: 10px 8px; }
  .header-actions { margin-left: auto; gap: 12px; }
  .site-header-home .header-actions { gap: 8px; }
  .site-header-home .header-actions .btn-small { padding-inline: 12px; }
  .hero { padding: 34px 0 40px; }
  .hero-facts { display: none; }
  .hero .cta-row { margin-top: 20px; }
  .rule { margin: 20px 0 18px; }
  .section { padding: 56px 0; }
  .tutor-head, .tutor-cta, .tutor-sign { margin-inline: 16px; }
  .tutor-log { padding: 16px; max-height: 70vh; }
  .tutor-form { padding: 12px 16px 16px; }
  .msg-user { max-width: 94%; }
  .plan { padding: 26px 20px 22px; }
  .example-body, .example-card header { padding-inline: 16px; }
  .example-note { padding-inline: 16px; }
}
@media (max-width: 520px) {
  .chips { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .site-header-home .wrap { column-gap: 8px; }
  .site-header-home .brand img { height: 35px; }
  .site-header-home .header-actions { gap: 6px; }
  .site-header-home .header-actions .btn-small { padding-inline: 10px; font-size: 0.86rem; }
}
@media (max-width: 359px) {
  .site-header-home .header-actions { order: 2; width: 100%; margin-left: 0; }
  .site-header-home .header-actions .btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .chip { transition: none; }
}
@media print {
  .announce, .site-header, .site-footer, .mh-chat-launcher, .mh-chat-panel { display: none !important; }
  .section-dark, .section-steel { background: #fff; color: #000; }
}
