/* Hub pages (subject hub + task-number hubs) — components styled with the app's
   own CSS tokens (loaded from app_core/trainer_base): --card-bg, --card-border,
   --accent, --text, --text-hint, --radius. The page chrome (topbar, crumbs,
   footer) comes from seo_solve.css. */

/* Content column + no fixed answer bar on hubs → normal bottom padding */
body.seo-hub #app { padding-bottom: 24px; }
#app .seo-hubwrap { max-width: min(960px, 100%); margin: 0 auto; }

/* Hero: value + stats chips + mascot */
#app .seo-hero {
    display: flex; align-items: center; gap: 28px;
    background: linear-gradient(135deg, rgba(39, 119, 255, .14), rgba(30, 111, 255, .03) 60%), var(--card-bg);
    border: 1px solid rgba(77, 158, 255, .35); border-radius: var(--radius, 16px);
    padding: 28px 30px; margin: 16px 0 30px;
}
#app .seo-hero__text { flex: 1 1 auto; min-width: 0; }
#app .seo-hero__text h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.18; letter-spacing: -.02em; margin: 0 0 10px; color: var(--text); font-weight: 900; }
#app .seo-hero__lead { font-size: 15px; line-height: 1.55; color: var(--text-hint); max-width: 58ch; margin: 0 0 16px; }
#app .seo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
#app .seo-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(30, 111, 255, .14); border: 1px solid var(--card-border);
    border-radius: 999px; padding: 6px 14px;
    font-size: 12.5px; font-weight: 700; color: var(--text);
}
#app .seo-chip b { color: var(--accent-soft, #4d9eff); font-weight: 900; }
#app .seo-hero__perks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 7px; }
#app .seo-hero__perks li { position: relative; padding-left: 24px; font-size: 13.5px; color: var(--text); font-weight: 600; }
#app .seo-hero__perks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success, #00b894); font-weight: 900; }
#app .seo-hero__visual { position: relative; flex: 0 0 auto; align-self: center; }
#app .seo-hero__glow {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 240px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(47, 125, 255, .35), transparent 72%);
}
#app .seo-hero__visual img { position: relative; width: 220px; height: auto; object-fit: contain; filter: drop-shadow(0 10px 26px rgba(30, 111, 255, .35)); }
@media (max-width: 760px) {
    #app .seo-hero { flex-direction: column-reverse; text-align: left; padding: 22px 18px; gap: 8px; }
    #app .seo-hero__visual img { width: 150px; }
    #app .seo-hero__glow { width: 220px; height: 170px; }
}

/* Exam-part sections */
#app .seo-part { margin: 26px 0; }
#app .seo-part h2 { font-size: clamp(19px, 3vw, 24px); margin: 0 0 4px; color: var(--text); font-weight: 900; letter-spacing: -.01em; }
#app .seo-part__note { margin: 0 0 14px; font-size: 13.5px; color: var(--text-hint); }

/* Headings / lead */
#app .seo-article > h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; letter-spacing: -.02em; margin: 8px 0 10px; color: var(--text); font-weight: 900; }
#app .seo-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; color: var(--accent-soft, #4d9eff); margin: 14px 0 0; }
#app .seo-eyebrow a { color: var(--accent-soft, #4d9eff); text-decoration: none; }
#app .seo-lead { font-size: 16px; color: var(--text-hint); max-width: 64ch; margin: 0 0 22px; }

/* Subject hub: grid of number cards (looks like the app's category cards) */
#app .seo-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; margin: 6px 0 30px; }
#app .seo-numcard {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius, 16px); padding: 15px 16px 16px;
    color: var(--text); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
#app .seo-numcard:hover { border-color: var(--accent, #1e6fff); transform: translateY(-2px); }
#app .seo-numcard__badge { align-self: flex-start; font-weight: 800; font-size: 12.5px; color: var(--accent-soft, #4d9eff); background: rgba(30, 111, 255, .14); border-radius: 999px; padding: 3px 10px; }
#app .seo-numcard__title { font-weight: 700; font-size: 15px; line-height: 1.25; }
#app .seo-numcard__count { font-size: 12.5px; color: var(--text-hint); }

/* Content blocks */
#app .seo-block { margin: 26px 0; }
#app .seo-block > h2 { font-size: clamp(19px, 3vw, 24px); margin: 0 0 12px; color: var(--text); font-weight: 900; letter-spacing: -.01em; }
#app .seo-intro { font-size: 16px; color: var(--text-hint); margin: 0 0 18px; }
#app .seo-intro p, #app .seo-prose p { margin: 0 0 12px; }
#app .seo-prose { color: var(--text); font-size: 15px; line-height: 1.6; }
#app .seo-prose :last-child, #app .seo-intro :last-child { margin-bottom: 0; }

/* Algorithm steps / mistakes / tips */
#app .seo-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
#app .seo-steps li {
    position: relative; padding: 13px 15px 13px 52px; font-size: 14.5px; line-height: 1.5;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm, 10px);
    color: var(--text);
}
#app .seo-steps li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 13px; top: 11px;
    width: 27px; height: 27px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
    background: var(--accent, #1e6fff); color: #fff;
}
#app .seo-mistakes, #app .seo-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
#app .seo-mistakes li, #app .seo-tips li {
    position: relative; padding: 11px 14px 11px 38px; font-size: 14.5px; line-height: 1.5;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm, 10px);
    color: var(--text);
}
#app .seo-mistakes li::before { content: "✕"; position: absolute; left: 14px; top: 11px; color: var(--error, #e17055); font-weight: 900; }
#app .seo-tips li::before { content: "✓"; position: absolute; left: 14px; top: 11px; color: var(--success, #00b894); font-weight: 900; }

/* Task list (published number) */
#app .seo-tasklist { display: grid; gap: 9px; }
#app .seo-taskrow {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm, 10px);
    padding: 12px 15px; color: var(--text); font-size: 14.5px; text-decoration: none;
    transition: border-color .15s;
}
#app .seo-taskrow:hover { border-color: var(--accent, #1e6fff); }
#app .seo-taskrow__text { flex: 1; }
#app .seo-taskrow__tag { font-size: 11.5px; color: var(--text-hint); border: 1px solid var(--card-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* Collapsed task list: 12 rows visible, the rest expand on click (links stay in
   the DOM for crawlers either way) */
#app .seo-tasklist:not(.is-expanded) .seo-taskrow--more { display: none; }
#app .seo-showall {
    display: flex; align-items: center; justify-content: center;
    width: 100%; margin-top: 10px; min-height: 46px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm, 10px); color: var(--accent-soft, #4d9eff);
    font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
#app .seo-showall:hover { border-color: var(--accent, #1e6fff); }

/* Mistakes + tips side-by-side on desktop */
#app .seo-twocol { display: grid; gap: 0 22px; }
@media (min-width: 760px) { #app .seo-twocol { grid-template-columns: 1fr 1fr; } }

/* Primary action card (unpublished numbers): one clear CTA */
#app .seo-action {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(39, 119, 255, .16), rgba(30, 111, 255, .04) 60%), var(--card-bg);
    border: 1px solid rgba(77, 158, 255, .38); border-radius: var(--radius, 16px);
    padding: 22px 24px; margin: 20px 0 26px;
}
#app .seo-action__text h2 { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: var(--text); }
#app .seo-action__text p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-hint); max-width: 52ch; }
#app .seo-btn--lg { min-height: 54px; padding: 0 28px; font-size: 15px; }

/* Method accordions: closed by default, content stays in the DOM */
#app .seo-method { margin: 26px 0 0; }
#app .seo-acc {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm, 10px); margin: 0 0 10px; overflow: hidden;
}
#app .seo-acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; }
#app .seo-acc summary::-webkit-details-marker { display: none; }
#app .seo-acc summary h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
#app .seo-acc summary::after { content: ""; flex: 0 0 auto; width: 9px; height: 9px; border-right: 2px solid var(--text-hint); border-bottom: 2px solid var(--text-hint); transform: rotate(45deg); transition: transform .15s; margin-right: 3px; }
#app .seo-acc[open] summary::after { transform: rotate(225deg); }
#app .seo-acc__body { padding: 0 16px 15px; }
/* Inside an accordion the lists go flat — no cards-in-cards */
#app .seo-acc .seo-steps li { background: none; border: none; padding: 3px 0 3px 40px; }
#app .seo-acc .seo-steps li::before { left: 0; top: 2px; }
#app .seo-acc .seo-mistakes li, #app .seo-acc .seo-tips li { background: none; border: none; padding: 3px 0 3px 28px; }
#app .seo-acc .seo-mistakes li::before, #app .seo-acc .seo-tips li::before { left: 0; top: 3px; }
#app .seo-acc .seo-tips { margin-top: 10px; }

/* Sample cards (unpublished numbers) */
#app .seo-samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 11px; }
#app .seo-sample { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm, 10px); padding: 13px 14px; }
#app .seo-sample__text { margin: 0 0 8px; color: var(--text-hint); font-size: 13.5px; line-height: 1.45; }
#app .seo-sample__ans { margin: 0; font-size: 13px; color: var(--text); }
#app .seo-note { color: var(--text-hint); font-size: 14px; margin-top: 12px; }

/* CTA */
#app .seo-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: #2777ff; color: #fff !important; font-weight: 900;
    padding: 13px 22px; border-radius: 999px; font-size: 14px; white-space: nowrap;
    text-decoration: none; box-shadow: 0 12px 24px rgba(39, 119, 255, .28);
}
#app .seo-btn:hover { filter: brightness(1.06); }
#app .seo-cta-inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 6px; }
#app .seo-cta-inline__note { color: var(--text-hint); font-size: 13.5px; }
#app .seo-cta-band {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius, 16px); padding: 20px 22px; margin: 34px 0 0;
}
#app .seo-cta-band h2 { margin: 0 0 6px; font-size: 19px; font-weight: 900; color: var(--text); }
#app .seo-cta-band p { margin: 0; color: var(--text-hint); font-size: 13.5px; line-height: 1.45; max-width: 56ch; }

/* Math overflow */
#app .katex-display, #app .math-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
