:root {
    --ink: #17233b;
    --ink-2: #233655;
    --paper: #f5f0e7;
    --paper-deep: #ebe3d5;
    --surface: #fffdf8;
    --surface-strong: #ffffff;
    --line: #ded6c8;
    --muted: #6f716e;
    --muted-light: #96968f;
    --coral: #c9504e;
    --coral-dark: #a9393d;
    --leaf: #78a83b;
    --leaf-dark: #527d23;
    --primary-color: var(--ink);
    --primary-hover: var(--ink-2);
    --card-bg: var(--surface);
    --text-color: var(--ink);
    --border-color: var(--line);
    --bg-color: var(--paper);
    --shadow-sm: 0 8px 24px rgba(23, 35, 59, .06);
    --shadow-md: 0 22px 60px rgba(23, 35, 59, .12);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 14%, rgba(201, 80, 78, .06), transparent 24rem),
        radial-gradient(circle at 88% 34%, rgba(120, 168, 59, .07), transparent 28rem),
        var(--paper);
    font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}

main { flex: 1 0 auto; min-height: 55vh; }
img { max-width: 100%; }
a { color: var(--ink-2); text-underline-offset: 3px; }
a:hover { color: var(--coral-dark); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.025em; }
p { margin-top: 0; }
::selection { color: #fff; background: var(--coral); }

.container { width: min(100% - 40px, 1180px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 9999; padding: 10px 16px; color: #fff; background: var(--ink); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(23, 35, 59, .1);
    background: rgba(245, 240, 231, .9);
    backdrop-filter: blur(18px) saturate(140%);
}
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; border-radius: 16px; background: #fbf8f2; box-shadow: 0 5px 18px rgba(23, 35, 59, .1); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 1.36rem; font-weight: 820; letter-spacing: -.055em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a { padding: 9px 12px; border-radius: 999px; color: var(--ink); font-size: .91rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.site-nav > a:not(.button):hover, .site-nav > a:not(.button).active { background: rgba(23, 35, 59, .07); color: var(--coral-dark); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }

.user-menu { position: relative; margin-left: 4px; }
.user-menu-toggle { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 700; }
.user-initial { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--coral); }
.user-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; display: none; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-strong); box-shadow: var(--shadow-md); }
.user-menu.open .user-menu-panel { display: grid; }
.user-menu-panel a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.user-menu-panel a:hover { background: var(--paper); }
.user-menu-panel a.danger { color: var(--coral-dark); }
.menu-separator { height: 1px; margin: 5px; background: var(--line); }

/* Actions */
.button, .btn, .btn-auth, .view-all-btn, .slide-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #fff !important;
    background: var(--ink);
    box-shadow: 0 8px 22px rgba(23, 35, 59, .16);
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover, .btn:hover, .btn-auth:hover, .view-all-btn:hover, .slide-btn:hover { color: #fff; background: var(--ink-2); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23, 35, 59, .2); }
.button-small, .btn-sm { min-height: 39px; padding: 8px 14px; border-radius: 11px; font-size: .87rem; }
.button-coral { background: var(--coral); box-shadow: 0 9px 24px rgba(201, 80, 78, .22); }
.button-coral:hover { background: var(--coral-dark); }
.button-light, .button-ghost { color: var(--ink) !important; border-color: var(--line); background: rgba(255, 253, 248, .82); box-shadow: none; }
.button-light:hover, .button-ghost:hover { color: var(--ink) !important; background: #fff; border-color: var(--ink); }

/* Shared surfaces */
.card, .widget, .auth-card, .contact-card, .content-card {
    border: 1px solid rgba(23, 35, 59, .11);
    border-radius: var(--radius);
    background: rgba(255, 253, 248, .94);
    box-shadow: var(--shadow-sm);
}
.card { padding: 26px; margin-bottom: 24px; }
.alert { padding: 14px 16px; border: 1px solid; border-radius: 12px; }
.alert-success { color: #356018; border-color: #bcd39b; background: #f2f8e9; }
.alert-error, .alert-danger { color: #852d31; border-color: #e7b4b1; background: #fff0ef; }
.alert-warning { color: #78551c; border-color: #dfc68d; background: #fff8e6; }
.alert-info { color: var(--ink-2); border-color: #b8c6d8; background: #eef3f8; }

/* Home */
.home-hero { padding: clamp(58px, 9vw, 112px) 0 86px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px, 7vw, 90px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; color: var(--coral-dark); font-size: .76rem; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.eyebrow > span { width: 30px; height: 2px; background: currentColor; }
.hero-copy h1 { max-width: 700px; margin: 0 0 24px; color: var(--ink); font-size: clamp(3rem, 6.4vw, 5.8rem); font-weight: 760; line-height: .97; letter-spacing: -.068em; }
.hero-copy h1 em { color: var(--coral); font-style: normal; font-weight: 760; text-decoration: underline; text-decoration-color: rgba(120, 168, 59, .8); text-decoration-thickness: .07em; text-underline-offset: .12em; }
.hero-copy > p { max-width: 650px; margin-bottom: 30px; color: #555e6c; font-size: clamp(1.04rem, 1.8vw, 1.22rem); line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 28px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.hero-notes span { display: inline-flex; align-items: center; gap: 7px; }
.hero-notes i { color: var(--leaf-dark); }
.proof-board { position: relative; min-height: 560px; display: grid; place-items: center; border: 1px solid rgba(23, 35, 59, .13); border-radius: 44% 56% 47% 53% / 52% 42% 58% 48%; background: rgba(255, 253, 248, .72); box-shadow: var(--shadow-md); transform: rotate(1deg); }
.proof-board::before, .proof-board::after { content: ""; position: absolute; border-radius: 50%; }
.proof-board::before { width: 72px; height: 72px; top: 35px; right: 42px; border: 2px solid rgba(201, 80, 78, .35); }
.proof-board::after { width: 14px; height: 14px; left: 44px; bottom: 95px; background: var(--leaf); box-shadow: 24px 18px 0 rgba(120, 168, 59, .45); }
.proof-board > img { position: relative; z-index: 2; width: min(76%, 400px); filter: drop-shadow(0 22px 24px rgba(23, 35, 59, .16)); transform: rotate(-2deg); }
.board-label { position: absolute; top: 40px; left: 50px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.board-equation { position: absolute; z-index: 1; color: rgba(23, 35, 59, .45); font-family: Georgia, serif; font-style: italic; }
.board-equation-one { top: 91px; left: 44px; font-size: 1.35rem; transform: rotate(-7deg); }
.board-equation-two { right: 52px; bottom: 133px; font-size: 1.55rem; transform: rotate(8deg); }
.board-note { position: absolute; z-index: 3; right: -30px; bottom: 28px; max-width: 230px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); transform: rotate(-3deg); }
.board-note strong, .board-note span { display: block; }
.board-note strong { font-family: Georgia, serif; }
.board-note span { margin-top: 4px; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.proof-line { position: absolute; z-index: 3; width: 175px; right: 10px; top: 55px; fill: none; stroke: var(--leaf); stroke-width: 4; stroke-linecap: round; transform: rotate(-8deg); }
.math-workspace { position: relative; width: 100%; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); border-radius: 28px; color: #edf2f8; background: #111a2d; box-shadow: 0 35px 75px rgba(23, 35, 59, .26); transform: perspective(1200px) rotateY(-2deg) rotateX(1deg); }
.math-workspace::after { content: ""; position: absolute; width: 220px; height: 220px; right: -100px; bottom: -130px; border-radius: 50%; background: rgba(120, 168, 59, .16); filter: blur(10px); pointer-events: none; }
.workspace-bar { height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; padding: 0 19px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #9ca9bc; background: #17233b; font-size: .73rem; }
.workspace-dots { display: flex; gap: 6px; }
.workspace-dots i { width: 8px; height: 8px; display: block; border-radius: 50%; background: #cf5b59; }
.workspace-dots i:nth-child(2) { background: #d7a64f; }
.workspace-dots i:nth-child(3) { background: #78a83b; }
.workspace-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-status { justify-self: end; display: inline-flex; align-items: center; gap: 7px; }
.workspace-status i { width: 7px; height: 7px; border-radius: 50%; background: #8ac34a; box-shadow: 0 0 0 4px rgba(138, 195, 74, .12); }
.workspace-shell { min-height: 440px; display: grid; grid-template-columns: 62px 1fr; }
.workspace-tools { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 23px; border-right: 1px solid rgba(255, 255, 255, .07); background: rgba(0, 0, 0, .1); }
.workspace-tools span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #7f8b9e; font-family: Georgia, serif; font-size: .93rem; }
.workspace-tools .active { color: #fff; background: rgba(201, 80, 78, .92); box-shadow: 0 8px 18px rgba(201, 80, 78, .22); }
.workspace-editor { min-width: 0; padding: 29px 28px 25px; }
.editor-kicker { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 23px; color: #77849a; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.editor-kicker strong { color: #9cba60; }
.code-line { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 12px; margin: 0 -10px; padding: 9px 10px; border-left: 2px solid var(--coral); background: rgba(255, 255, 255, .035); }
.code-line + .code-line { margin-top: 3px; }
.code-line > span { color: #536076; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .69rem; line-height: 1.8; }
.code-line code { overflow: hidden; color: #e8d8b6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(.72rem, 1.5vw, .87rem); text-overflow: ellipsis; white-space: nowrap; }
.muted-code { border-left-color: transparent; background: transparent; }
.muted-code code { color: #9ca9bc; }
.math-preview { margin-top: 24px; padding: 20px 20px 17px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 17px; background: rgba(255, 255, 255, .055); }
.preview-label { display: flex; align-items: center; justify-content: space-between; color: #8c99ad; font-size: .67rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.preview-label i { color: #a8c852; }
.rendered-equation { min-height: 83px; display: grid; place-items: center; overflow-x: auto; color: #fff; font-size: clamp(.8rem, 1.55vw, 1.08rem); }
.rendered-equation mjx-container { max-width: 100%; margin: 0 !important; overflow-x: auto; overflow-y: hidden; }
.reason-row { display: flex; align-items: center; gap: 11px; margin-top: 18px; }
.reason-check { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #5c872b; font-size: .72rem; }
.reason-row strong, .reason-row small { display: block; }
.reason-row strong { font-size: .77rem; }
.reason-row small { margin-top: 2px; color: #76849a; font-size: .66rem; }
.workspace-foot { min-height: 44px; display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 0 20px; border-top: 1px solid rgba(255, 255, 255, .07); color: #718097; background: #0d1525; font-size: .65rem; }
.workspace-foot i { margin-right: 5px; color: #93b455; }
.manifesto-strip { border-block: 1px solid rgba(23, 35, 59, .12); background: rgba(255, 253, 248, .58); }
.manifesto-inner { display: flex; align-items: center; gap: 24px; padding-block: 27px; }
.manifesto-inner p { max-width: 960px; margin: 0; color: #525a68; }
.manifesto-mark { color: var(--coral); font-size: 1.55rem; }
.home-section { padding: clamp(78px, 10vw, 125px) 0; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: clamp(2.35rem, 5vw, 4.4rem); font-weight: 720; letter-spacing: -.055em; }
.split-heading { display: grid; grid-template-columns: 1.15fr .85fr; gap: 70px; align-items: end; margin-bottom: 55px; }
.split-heading > p { max-width: 520px; margin: 0 0 8px; color: var(--muted); font-size: 1.05rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { position: relative; min-height: 340px; padding: 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 253, 248, .86); }
.step-card.featured { color: #fff; border-color: var(--ink); background: var(--ink); transform: translateY(-18px); }
.step-number { position: absolute; top: 24px; right: 28px; color: var(--muted-light); font-family: Georgia, serif; font-size: 2.8rem; opacity: .45; }
.step-card.featured .step-number { color: #fff; }
.step-icon { width: 59px; height: 59px; display: grid; place-items: center; margin-bottom: 54px; border-radius: 17px; color: #fff; background: var(--coral); font-size: 1.3rem; }
.step-card.featured .step-icon { color: var(--ink); background: var(--leaf); }
.step-card h3 { margin: 0 0 13px; font-size: 1.4rem; }
.step-card p { margin: 0; color: var(--muted); }
.step-card.featured p { color: #bfc8d6; }
.category-section { background: rgba(235, 227, 213, .55); }
.centered-heading { max-width: 820px; margin: 0 auto 54px; text-align: center; }
.centered-heading .eyebrow { justify-content: center; }
.centered-heading > p { max-width: 590px; margin: 20px auto 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card { min-height: 170px; display: grid; grid-template-columns: 1fr auto; align-content: space-between; padding: 23px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.category-card:hover { color: var(--ink); border-color: currentColor; box-shadow: var(--shadow-sm); transform: translateY(-4px); }
.category-symbol { grid-column: 1 / -1; font-family: Georgia, serif; font-size: 2.5rem; font-style: italic; }
.category-card strong { align-self: end; font-size: .94rem; }
.category-card > i { align-self: end; color: var(--muted); font-size: .8rem; }
.tone-coral .category-symbol { color: var(--coral); }
.tone-green .category-symbol { color: var(--leaf-dark); }
.tone-navy .category-symbol { color: var(--ink-2); }
.principle-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(45px, 8vw, 100px); align-items: center; }
.principle-visual { padding: 40px; border-radius: 36px; background: var(--ink); transform: rotate(-1.5deg); }
.notebook-sheet { position: relative; min-height: 470px; padding: 48px 38px 35px 65px; border-radius: 8px 18px 18px 8px; background: repeating-linear-gradient(to bottom, #fffdf8 0, #fffdf8 36px, #dce4e9 37px); box-shadow: var(--shadow-md); transform: rotate(3deg); }
.notebook-sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 45px; width: 2px; background: rgba(201, 80, 78, .42); }
.paper-kicker { color: var(--coral-dark); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.notebook-sheet ol { margin: 44px 0 0; padding: 0; list-style: none; }
.notebook-sheet li { display: flex; align-items: center; gap: 13px; min-height: 63px; font-family: Georgia, serif; font-size: 1.08rem; }
.notebook-sheet li span { color: var(--muted-light); font-family: inherit; font-size: .78rem; }
.proof-stamp { position: absolute; right: 30px; bottom: 28px; padding: 9px 14px; border: 2px solid var(--leaf-dark); border-radius: 8px; color: var(--leaf-dark); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-8deg); }
.principle-copy h2 { margin: 0 0 24px; font-size: clamp(2.4rem, 5vw, 4.8rem); font-weight: 720; letter-spacing: -.055em; }
.principle-copy > p { max-width: 650px; color: var(--muted); font-size: 1.05rem; }
.check-list { display: grid; gap: 13px; margin: 26px 0 30px; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: center; gap: 11px; font-weight: 650; }
.check-list i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--leaf-dark); font-size: .7rem; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--coral-dark); font-weight: 800; text-decoration: none; }
.home-cta { display: flex; align-items: center; justify-content: space-between; gap: 50px; margin-bottom: 20px; padding: clamp(38px, 6vw, 68px); border-radius: 30px; color: #fff; background: var(--ink); box-shadow: var(--shadow-md); }
.eyebrow-light { color: #a8c852; }
.home-cta h2 { max-width: 720px; margin: 0 0 12px; font-size: clamp(2.2rem, 4vw, 4rem); font-weight: 720; letter-spacing: -.05em; }
.home-cta p { max-width: 680px; margin: 0; color: #bbc5d3; }
.home-cta-actions { min-width: 205px; display: grid; gap: 11px; }
.home-cta .button-ghost { color: #fff !important; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.home-cta .button-ghost:hover { background: rgba(255, 255, 255, .13); }

/* Forms */
.form-group, .input-group { margin-bottom: 20px; }
.form-group label, .input-group label { display: block; margin-bottom: 8px; color: var(--ink); font-size: .88rem; font-weight: 750; }
.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #cfc7ba;
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: rgba(255, 255, 255, .86);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea, textarea.form-control { min-height: 150px; resize: vertical; line-height: 1.55; }
.form-control:focus, input:focus, select:focus, textarea:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(23, 35, 59, .1); }
.input-wrapper { position: relative; }
.input-wrapper > i { position: absolute; top: 50%; left: 16px; z-index: 1; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.input-wrapper .form-control { padding-left: 45px; }
.preview-area { min-height: 120px; padding: 18px; border: 1px dashed #bbb2a4; border-radius: 12px; background: #fff; }

/* Auth pages */
.auth-wrapper { min-height: 72vh !important; display: grid !important; place-items: center; padding: 64px 20px !important; }
.auth-card { width: min(100%, 460px) !important; max-width: 460px !important; padding: clamp(28px, 5vw, 44px) !important; border-radius: 24px !important; background: rgba(255, 253, 248, .96) !important; box-shadow: var(--shadow-md) !important; }
.auth-header { text-align: left !important; }
.auth-header .icon-bg { width: 58px !important; height: 58px !important; margin: 0 0 22px !important; border-radius: 16px !important; color: #fff !important; background: var(--coral) !important; box-shadow: 0 10px 24px rgba(201, 80, 78, .2) !important; }
.auth-header h2 { color: var(--ink) !important; font-size: 2rem !important; }
.auth-header p, .auth-footer { color: var(--muted) !important; }
.auth-footer a { color: var(--coral-dark) !important; }
.google-btn { min-height: 48px; border: 1px solid var(--line) !important; border-radius: 12px !important; background: #fff !important; color: var(--ink) !important; }
.auth-card .alert { margin-bottom: 22px; }
.auth-card .eyebrow { margin-bottom: 8px; }
.auth-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -4px 0 24px; }
.auth-benefits span { display: grid; place-items: center; gap: 6px; min-height: 68px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); color: var(--navy); font-size: .72rem; font-weight: 750; text-align: center; }
.auth-benefits i { color: var(--coral); font-size: 1rem; }
.auth-link-button { display: flex !important; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.form-label-row label { margin: 0; }
.form-label-row a, .auth-secondary a { color: var(--coral-dark); font-size: .82rem; text-decoration: none; }
.input-group label small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.divider { display: flex; align-items: center; gap: 14px; margin: 25px 0; color: var(--muted-light); font-size: .8rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px; font-weight: 700; text-decoration: none; }
.auth-secondary { margin-top: 9px; }
.captcha-wrap { max-width: 100%; margin: 0 0 20px; overflow-x: auto; }

/* Tables and admin-compatible primitives */
.table-container { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th { color: var(--muted); background: #f1ece3; font-size: .76rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(235, 227, 213, .36); }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.pagination a, .pagination span { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); text-decoration: none; }
.pagination .active { color: #fff; border-color: var(--ink); background: var(--ink); }

/* Community */
.community-header, .page-header { padding: 54px 0 26px; }
.page-title { margin: 0; color: var(--ink); font-size: clamp(2rem, 5vw, 3.4rem); }
.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
.question-item, .question-list-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.question-item:last-child { border-bottom: 0; }
.question-title, .q-title { margin: 0 0 7px; font-size: 1.18rem; }
.question-title a, .q-title a { color: var(--ink); text-decoration: none; }
.question-title a:hover, .q-title a:hover { color: var(--coral-dark); }
.question-meta, .q-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: .82rem; }
.tag, .q-tag, .tag-cloud-item { display: inline-flex; padding: 4px 9px; border: 1px solid #cdd9b5; border-radius: 999px; color: #43651e; background: #f1f6e8; font-size: .78rem; text-decoration: none; }
.active-tag-filter { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -6px 0 18px; padding: 10px 14px; border: 1px solid #cdd9b5; border-radius: 12px; color: #43651e; background: #f1f6e8; font-size: .82rem; font-weight: 700; }
.active-tag-filter a { color: var(--ink); font-size: .76rem; }
.tag-cloud-item small { margin-left: 5px; opacity: .68; }
.widget { padding: 22px; margin-bottom: 20px; }
.widget-title { margin-bottom: 15px; color: var(--ink); font-size: .8rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.q-container { display: flex; gap: 22px; }
.vote-cell { width: 54px; flex: 0 0 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-weight: 800; }
.vote-btn { width: 42px; height: 38px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.vote-btn:hover { color: var(--coral); background: #fff0ef; }
.post-cell { min-width: 0; flex: 1; }
.post-content { line-height: 1.75 !important; }
.post-content pre { max-width: 100%; overflow: auto; padding: 18px; border-radius: 13px; background: #111827; }
.post-content img { border-radius: 14px; }
.post-content .math-display { max-width: 100%; margin: 14px 0; overflow-x: auto; overflow-y: hidden; }
.post-content mjx-container[jax="CHTML"][display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 8px 0; }
.answer-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 240px)); gap: 12px; margin: 18px 0; }
.answer-images a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f8f4ec; }
.answer-images img { display: block; width: 100%; height: auto; max-height: 280px; object-fit: contain; }
.code-frame { max-width: 100%; margin: 22px 0; overflow: hidden; border: 1px solid #273248; border-radius: 16px; background: #0e1420; box-shadow: 0 12px 30px rgba(14, 20, 32, .12); }
.code-frame-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 6px 8px 6px 15px; border-bottom: 1px solid #273248; background: #182238; }
.code-frame-head > span { display: inline-flex; gap: 8px; align-items: center; color: #cad3e2; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.code-frame-head > span i { color: #a8c852; }
.code-copy-button { display: inline-flex; gap: 7px; align-items: center; min-height: 32px; padding: 5px 10px; border: 0; border-radius: 9px; color: #cad3e2; background: transparent; cursor: pointer; font-size: .7rem; font-weight: 800; }
.code-copy-button:hover, .code-copy-button.copied { color: #fff; background: rgba(255, 255, 255, .09); }
.code-frame pre, .post-content .code-frame pre { max-width: 100%; margin: 0; padding: 18px 20px; overflow: auto; border: 0; border-radius: 0; background: #0e1420; }
.code-frame pre code, .code-frame pre code.hljs { display: block; min-width: max-content; padding: 0; color: #e6edf7; background: transparent; font-size: .84rem; line-height: 1.65; tab-size: 4; }
.post-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line) !important; }
.accepted-answer { border-color: #9fbd73 !important; background: #fbfff5 !important; }
.accepted-badge { color: var(--leaf-dark) !important; }
.user-card { border: 1px solid var(--line); border-radius: 999px !important; background: #f8f4ec !important; }

/* Rich editor */
.note-editor.note-frame { overflow: hidden; border: 1px solid #cfc7ba !important; border-radius: 14px !important; background: #fff; }
.note-toolbar { border-bottom: 1px solid var(--line) !important; background: #f3eee5 !important; }
.note-btn { border-color: #d8d0c3 !important; background: #fff !important; }
.modal-content { border: 1px solid var(--line) !important; border-radius: 20px !important; background: var(--surface) !important; box-shadow: var(--shadow-md) !important; }

/* Namespaced code dialog (kept separate from Summernote modals) */
body.dialog-open { overflow: hidden; }
.code-dialog[hidden] { display: none; }
.code-dialog { position: fixed; z-index: 6000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(10, 18, 32, .72); backdrop-filter: blur(8px); }
.code-dialog-panel { width: min(100%, 720px); max-height: min(90vh, 820px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; background: var(--surface); box-shadow: 0 35px 90px rgba(5, 13, 28, .4); }
.code-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.code-dialog-head > div { display: flex; align-items: center; gap: 13px; }
.code-dialog-head > div > span { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--ink); }
.code-dialog-head small { display: block; color: var(--coral-dark); font-size: .63rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.code-dialog-head h2 { margin: 3px 0 0; font-size: 1.35rem; }
.code-dialog-close { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fff; cursor: pointer; }
.code-dialog-close:hover { color: var(--ink); border-color: var(--ink); }
.code-dialog-body { display: grid; gap: 17px; overflow-y: auto; padding: 24px; }
.code-dialog-body label { display: grid; gap: 8px; color: var(--ink); font-size: .76rem; font-weight: 800; }
.code-dialog-body select { min-height: 48px; }
.code-dialog-body textarea { min-height: 290px; padding: 18px; border: 1px solid #26344b; border-radius: 14px; color: #dfe8f4; background: #111a2d; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .88rem; line-height: 1.65; tab-size: 4; }
.code-dialog-body textarea:focus { border-color: #83ad48; background: #111a2d; box-shadow: 0 0 0 4px rgba(120, 168, 59, .15); }
.code-dialog-hint { display: flex; align-items: center; gap: 8px; margin-top: -7px; color: var(--muted); font-size: .69rem; }
.code-dialog-hint i { color: var(--leaf-dark); }
.code-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 24px 22px; border-top: 1px solid var(--line); }

/* Content pages */
.page-content { line-height: 1.8 !important; }
.page-content h2, .page-content h3, .page-content h4 { margin-top: 1.8em; color: var(--ink); }
.page-content hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.page-content a { color: var(--coral-dark); }
.content-page-wrap { padding-block: 72px; }
.content-page-card { max-width: 900px; margin-inline: auto; padding: clamp(28px, 6vw, 68px); border: 1px solid var(--line); border-radius: 28px; background: rgba(255, 253, 248, .94); box-shadow: var(--shadow-sm); }
.content-page-card > h1 { margin: 0 0 36px; font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.055em; }
.content-page-action { margin-top: 32px; }

.legal-page { margin-top: -1px; background: linear-gradient(180deg, #f6f1e7 0, #fffdf8 420px); }
.legal-hero { overflow: hidden; background: var(--ink); color: #fff; }
.legal-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; align-items: end; padding-block: clamp(58px, 8vw, 96px); }
.legal-hero h1 { max-width: 820px; margin: 16px 0 20px; color: #fff; font-size: clamp(2.7rem, 6vw, 5.4rem); letter-spacing: -.06em; }
.legal-hero p { max-width: 760px; margin: 0; color: rgba(255, 255, 255, .72); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.75; }
.legal-meta { padding: 22px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; background: rgba(255, 255, 255, .06); }
.legal-meta span, .legal-meta small { display: block; color: rgba(255, 255, 255, .58); }
.legal-meta span { margin-bottom: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.legal-meta strong { display: block; margin-bottom: 9px; color: #fff; font-size: 1.12rem; }
.legal-meta small { line-height: 1.5; }
.legal-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(34px, 6vw, 86px); align-items: start; padding-block: clamp(46px, 7vw, 86px); }
.legal-nav { position: sticky; top: 104px; display: grid; gap: 5px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .84); box-shadow: var(--shadow-sm); }
.legal-nav > strong { padding: 7px 10px 13px; color: var(--ink); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.legal-nav a { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 11px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.legal-nav a:hover { background: rgba(23, 35, 59, .07); color: var(--ink); }
.legal-nav a span { color: var(--coral); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .69rem; font-weight: 800; }
.legal-content { min-width: 0; }
.legal-content > section { position: relative; padding: 0 0 44px 58px; border-left: 1px solid var(--line); scroll-margin-top: 118px; }
.legal-content > section + section { padding-top: 8px; }
.legal-section-number { position: absolute; top: 0; left: -21px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fffdf8; color: var(--coral); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; font-weight: 900; }
.legal-content h2 { margin: 0 0 18px; color: var(--ink); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.035em; }
.legal-copy { color: var(--muted); font-size: 1rem; line-height: 1.8; }
.legal-copy p { margin: 0 0 16px; }
.legal-copy ul, .legal-copy ol { display: grid; gap: 10px; margin: 0 0 18px; padding-left: 22px; }
.legal-copy li::marker { color: var(--coral); font-weight: 800; }
.legal-copy a { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: rgba(23, 35, 59, .25); text-underline-offset: 3px; }
.legal-contact-card { display: flex; gap: 22px; align-items: center; justify-content: space-between; margin-top: 10px; padding: 28px; border-radius: 22px; background: var(--ink); color: #fff; }
.legal-contact-card span, .legal-contact-card strong { display: block; }
.legal-contact-card span { margin-bottom: 5px; color: var(--leaf); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.legal-contact-card strong { font-size: 1.05rem; line-height: 1.45; }

@media (max-width: 820px) {
    .legal-hero-inner, .legal-layout { grid-template-columns: 1fr; }
    .legal-hero-inner { gap: 28px; }
    .legal-meta { max-width: 360px; }
    .legal-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .legal-nav > strong { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .legal-nav { grid-template-columns: 1fr; }
    .legal-content > section { padding-left: 34px; }
    .legal-contact-card { align-items: stretch; flex-direction: column; }
    .legal-contact-card .button { width: 100%; text-align: center; }
}

/* About */
.about-page { margin-top: -1px; }
.about-hero { position: relative; overflow: hidden; padding: clamp(70px, 10vw, 120px) 0; color: #fff; background: var(--ink); }
.about-hero::after { content: "∴"; position: absolute; right: -2vw; bottom: -15vw; color: rgba(255, 255, 255, .035); font-family: Georgia, serif; font-size: min(45vw, 600px); line-height: 1; pointer-events: none; }
.about-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(45px, 9vw, 110px); align-items: center; }
.about-hero-copy h1 { max-width: 720px; margin: 0 0 26px; font-size: clamp(3rem, 6.2vw, 5.8rem); font-weight: 720; line-height: .98; letter-spacing: -.066em; }
.about-hero-copy h1 em { color: #a8c852; font-style: normal; }
.about-hero-copy p { max-width: 650px; margin: 0; color: #bac5d4; font-size: clamp(1rem, 1.8vw, 1.2rem); }
.about-formula { padding: clamp(26px, 5vw, 42px); border: 1px solid rgba(255, 255, 255, .13); border-radius: 26px; background: rgba(255, 255, 255, .06); backdrop-filter: blur(12px); }
.formula-label, .section-index { display: block; color: var(--coral-dark); font-size: .69rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.formula-label { color: #98a9bf; }
.formula-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 34px 0 22px; }
.formula-row strong { padding: 9px 12px; border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .1); font-size: clamp(.72rem, 1.5vw, .9rem); }
.formula-row i { color: #7d8ca2; font-style: normal; }
.formula-result { padding: 19px; border-radius: 15px; color: #dce6ef; background: rgba(120, 168, 59, .14); font-size: clamp(1.05rem, 2vw, 1.38rem); font-weight: 750; text-align: center; }
.formula-result span { margin-right: 8px; color: #a8c852; }
.formula-note { display: flex; gap: 10px; margin-top: 25px; color: #8e9db2; font-size: .77rem; }
.formula-note i { color: var(--coral); }
.about-intro { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(45px, 9vw, 110px); padding-block: clamp(80px, 11vw, 135px) 60px; }
.about-intro-title h2 { max-width: 470px; margin: 20px 0 0; font-size: clamp(2.3rem, 4.5vw, 4.3rem); font-weight: 720; letter-spacing: -.055em; }
.about-intro-copy { padding-top: 12px; color: var(--muted); }
.about-intro-copy .lead { color: var(--ink); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 650; line-height: 1.45; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: clamp(85px, 11vw, 135px); }
.value-card { position: relative; min-height: 305px; padding: 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 253, 248, .9); }
.value-card > span { position: absolute; top: 25px; right: 27px; color: var(--muted-light); font-size: .72rem; font-weight: 800; }
.value-card > i { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 56px; border-radius: 15px; color: #fff; background: var(--coral); }
.green-value > i { background: var(--leaf-dark); }
.navy-value > i { background: var(--ink); }
.value-card h3 { margin: 0 0 12px; font-size: 1.42rem; }
.value-card p { margin: 0; color: var(--muted); }
.about-origin { padding: clamp(72px, 9vw, 110px) 0; color: #fff; background: #20324e; }
.origin-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(50px, 10vw, 130px); align-items: center; }
.origin-mark { aspect-ratio: 1; max-width: 300px; display: grid; place-content: center; border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; background: rgba(255, 255, 255, .05); text-align: center; }
.origin-mark span, .origin-mark small { display: block; }
.origin-mark span { font-size: clamp(3rem, 7vw, 5rem); font-weight: 800; letter-spacing: -.07em; }
.origin-mark small { color: #a8c852; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.section-index-light { color: #a8c852; }
.origin-copy h2 { max-width: 700px; margin: 18px 0 22px; font-size: clamp(2.3rem, 4.5vw, 4.2rem); letter-spacing: -.055em; }
.origin-copy p { max-width: 700px; margin: 0; color: #b9c5d5; font-size: 1.04rem; }
.about-cta { display: flex; justify-content: space-between; align-items: end; gap: 50px; padding-block: clamp(78px, 10vw, 120px) 40px; }
.about-cta h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 4.8rem); letter-spacing: -.06em; }
.about-cta-actions { display: grid; gap: 17px; min-width: 220px; }

/* Contact */
.contact-page { margin-top: -1px; }
.contact-intro { padding: clamp(62px, 9vw, 105px) 0 clamp(105px, 14vw, 160px); color: #fff; background: var(--ink); }
.contact-intro-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(45px, 9vw, 110px); align-items: end; }
.contact-intro h1 { margin: 0; font-size: clamp(3.1rem, 7vw, 6.4rem); font-weight: 740; line-height: .92; letter-spacing: -.07em; }
.contact-intro h1 em { color: #a8c852; font-style: normal; }
.contact-intro-note { padding-left: 26px; border-left: 1px solid rgba(255, 255, 255, .18); }
.note-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 14px; color: #fff; background: var(--coral); }
.contact-intro-note p { max-width: 510px; color: #c0c9d6; font-size: 1.05rem; }
.contact-intro-note > div { display: flex; align-items: center; gap: 9px; color: #8998ad; font-size: .76rem; font-weight: 700; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #92c84e; box-shadow: 0 0 0 5px rgba(146, 200, 78, .12); }
.contact-layout { position: relative; z-index: 2; display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(42px, 8vw, 90px); margin-top: -62px; padding: clamp(35px, 6vw, 58px); border: 1px solid var(--line); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow-md); }
.contact-details { padding-top: 12px; }
.contact-details h2 { margin: 15px 0 32px; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -.045em; }
.contact-channel { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.contact-channel > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--coral-dark); background: #fff3f0; }
.contact-channel small, .contact-channel strong { display: block; }
.contact-channel small { color: var(--muted); font-size: .68rem; }
.contact-channel strong { overflow-wrap: anywhere; font-size: .86rem; }
.contact-channel > i { color: var(--muted-light); font-size: .7rem; }
.contact-availability { display: flex; gap: 13px; margin-top: 28px; color: var(--muted); font-size: .76rem; }
.contact-availability > i { margin-top: 4px; color: var(--leaf-dark); }
.contact-availability strong, .contact-availability span { display: block; }
.contact-availability strong { color: var(--ink); }
.contact-socials { margin-top: 35px; }
.contact-socials > small { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.contact-socials > div { display: flex; gap: 8px; margin-top: 12px; }
.contact-socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); text-decoration: none; }
.contact-form-card { padding: clamp(28px, 5vw, 46px); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow-sm); }
.form-card-heading > span { color: var(--coral-dark); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.form-card-heading h2 { margin: 12px 0 8px; font-size: clamp(1.8rem, 3.4vw, 3rem); letter-spacing: -.05em; }
.form-card-heading p { margin-bottom: 30px; color: var(--muted); }
.contact-form { display: grid; gap: 19px; }
.contact-form label { display: grid; gap: 7px; color: var(--ink); font-size: .79rem; font-weight: 750; }
.contact-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input, .contact-form textarea { margin: 0; border-radius: 11px; background: #fff; font-size: .91rem; font-weight: 500; }
.contact-submit-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 3px; padding-top: 19px; border-top: 1px solid var(--line); }
.contact-submit-row > span { max-width: 260px; color: var(--muted); font-size: .69rem; }
.contact-submit-row > span i { margin-right: 5px; color: var(--leaf-dark); }
.contact-success { display: flex; align-items: flex-start; gap: 17px; padding: 22px; border: 1px solid #bdd49d; border-radius: 16px; color: #365e1d; background: #f2f8e9; }
.contact-success > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--leaf-dark); }
.contact-success p { margin: 4px 0 0; }

/* LaTeX compose experience */
.compose-page { margin-top: -1px; }
.compose-intro { padding: clamp(58px, 8vw, 95px) 0 105px; color: #fff; background: var(--ink); }
.compose-intro-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(40px, 8vw, 95px); align-items: end; }
.compose-intro h1 { margin: 0; font-size: clamp(3rem, 6vw, 5.7rem); font-weight: 740; line-height: .95; letter-spacing: -.066em; }
.compose-intro h1 em { color: #a8c852; font-style: normal; }
.compose-intro p { max-width: 500px; margin: 0 0 6px; color: #b8c3d2; font-size: 1.04rem; }
.compose-shell { position: relative; z-index: 2; margin-top: -54px; }
.compose-shell > .alert { margin-bottom: 18px; }
.compose-form { display: grid; gap: 18px; }
.compose-card { padding: clamp(25px, 4.5vw, 43px); border: 1px solid var(--line); border-radius: 23px; background: rgba(255, 253, 248, .97); box-shadow: var(--shadow-sm); }
.compose-card-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 29px; }
.compose-card-head > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--coral); font-size: .69rem; font-weight: 850; }
.compose-card-head h2 { margin: 0 0 4px; font-size: clamp(1.35rem, 2.8vw, 2rem); }
.compose-card-head p { margin: 0; color: var(--muted); font-size: .84rem; }
.compose-label { display: grid; gap: 8px; color: var(--ink); font-size: .77rem; font-weight: 800; }
.compose-label input { min-height: 56px; font-size: 1rem; }
.latex-quickbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; color: #dfe6ef; background: var(--ink); }
.latex-quickbar > div:first-child { display: flex; align-items: center; gap: 11px; }
.latex-quickbar > div:first-child > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--coral); }
.latex-quickbar strong, .latex-quickbar small { display: block; }
.latex-quickbar strong { font-size: .78rem; }
.latex-quickbar small { color: #8190a5; font-size: .64rem; }
.latex-snippets { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.latex-snippets button { min-height: 32px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; color: #dfe6ef; background: rgba(255, 255, 255, .07); font-size: .69rem; font-weight: 750; cursor: pointer; }
.latex-snippets button:hover { color: #fff; border-color: #a8c852; background: rgba(168, 200, 82, .14); }
.compose-editor-grid, .answer-editor-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 13px; }
.compose-editor-pane, .compose-preview-pane { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.pane-label { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--ink); background: #f3eee5; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pane-label small { color: var(--muted); font-size: .61rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.pane-label small i { color: var(--leaf); font-size: .45rem; }
.compose-editor-pane .note-editor.note-frame { margin: 0; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.compose-editor-pane .note-toolbar { padding: 8px !important; }
.compose-editor-pane .note-editable { min-height: 260px; padding: 18px !important; }
.compose-preview { min-height: 341px; padding: 20px; overflow: auto; background: #fff; line-height: 1.7; }
.compose-preview mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.preview-empty { min-height: 295px; display: grid; place-content: center; gap: 8px; color: var(--muted-light); text-align: center; }
.preview-empty > i { margin-bottom: 5px; color: var(--leaf-dark); font-size: 1.35rem; }
.preview-empty strong, .preview-empty small { display: block; }
.preview-empty strong { color: var(--ink); font-size: .88rem; }
.preview-empty small { font-size: .72rem; }
.compose-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upload-box { position: relative; min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 20px; overflow: hidden; border: 1px dashed #b8ae9f; border-radius: 15px; background: #faf7f1; cursor: pointer; }
.upload-box > i { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--coral-dark); background: #fff0ef; }
.upload-box strong, .upload-box small { display: block; }
.upload-box strong { font-size: .85rem; }
.upload-box small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tag-field { display: grid; align-content: center; gap: 8px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #faf7f1; }
.tag-field > label { display: flex; justify-content: space-between; gap: 15px; font-size: .76rem; font-weight: 800; }
.tag-field > label small { color: var(--muted); font-weight: 600; }
#tag-container { min-height: 46px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 5px; border: 1px solid #cfc7ba; border-radius: 11px; background: #fff; }
#tag-container input { min-width: 120px; min-height: 34px; flex: 1; padding: 5px 7px; border: 0; box-shadow: none; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; color: #43651e; background: #edf5df; font-size: .73rem; font-weight: 750; }
.tag-remove { display: grid; place-items: center; padding: 0; border: 0; color: inherit; background: transparent; font-size: .64rem; cursor: pointer; }
.image-preview-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.image-preview-list:empty { display: none; }
.image-preview-list img { width: 88px; height: 88px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; }
.compose-submit, .answer-submit-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 4px 0; }
.compose-submit > span, .answer-submit-row > span { color: var(--muted); font-size: .7rem; }
.compose-submit > span i, .answer-submit-row > span i { margin-right: 5px; color: var(--leaf-dark); }
.answer-compose-card { margin-top: 40px; padding: clamp(24px, 4vw, 38px); }
.answer-compose-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.answer-compose-heading > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--coral); }
.answer-compose-heading small { color: var(--coral-dark); font-size: .67rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.answer-compose-heading h3 { margin: 4px 0 0; font-size: clamp(1.3rem, 3vw, 1.9rem); }
.answer-quickbar { margin-bottom: 13px; }
.answer-editor-grid .compose-preview { min-height: 341px; }

/* Footer */
.site-footer { flex-shrink: 0; margin-top: 80px; padding-top: 58px; color: #d9e0ea; background: var(--ink); }
.footer-main { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 45px; padding-bottom: 42px; }
.brand-on-dark { color: #fff; }
.brand-on-dark:hover { color: #fff; }
.brand-on-dark .brand-copy small { color: #aebbd0; }
.footer-brand > p { max-width: 390px; margin: 22px 0 10px; color: #b9c3d1; }
.ahd-signature { color: #a8c852; font-size: .82rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.footer-column { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer-column h2 { margin: 5px 0 13px; color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-column a { color: #bac4d2; text-decoration: none; }
.footer-column a:hover { color: #fff; }
.social-links { display: flex; gap: 9px; }
.social-links a { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .18); border-radius: 11px; color: #fff; background: rgba(255, 255, 255, .06); }
.social-links a:hover { border-color: var(--coral); background: var(--coral); }
.footer-location { margin-top: 16px; color: #96a3b6; font-size: .86rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 21px 0 25px; border-top: 1px solid rgba(255, 255, 255, .11); color: #8997ab; font-size: .8rem; }

@media (max-width: 1040px) {
    .menu-toggle { display: grid; place-items: center; }
    .site-nav { position: absolute; top: 100%; left: 20px; right: 20px; display: none; padding: 14px; border: 1px solid var(--line); border-radius: 0 0 18px 18px; background: var(--surface); box-shadow: var(--shadow-md); }
    .site-nav.open { display: grid; }
    .site-nav > a { width: 100%; padding: 12px 14px; border-radius: 10px; }
    .site-nav > .button { margin-top: 5px; }
    .user-menu { width: 100%; margin: 6px 0 0; }
    .user-menu-toggle { width: 100%; border-radius: 12px; }
    .user-menu-toggle > i { margin-left: auto; }
    .user-menu-panel { position: static; width: 100%; margin-top: 7px; box-shadow: none; }
    .footer-main { grid-template-columns: 1.5fr 1fr 1fr; }
    .footer-main .footer-column:last-child { grid-column: 2 / 4; }
    .hero-grid { grid-template-columns: 1fr; }
    .proof-board, .math-workspace { width: min(100%, 620px); margin: 0 auto; }
    .steps-grid { grid-template-columns: 1fr; }
    .step-card { min-height: 260px; }
    .step-card.featured { transform: none; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    .container { width: min(100% - 28px, 1180px); }
    .brand-copy small { display: none; }
    .brand-copy strong { font-size: 1.25rem; }
    .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
    .header-inner { min-height: 68px; }
    .community-layout { grid-template-columns: 1fr; }
    .q-container { flex-direction: column; }
    .vote-cell { width: 100%; flex: auto; flex-direction: row; justify-content: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
    .post-footer { flex-direction: column; align-items: flex-start !important; gap: 14px; }
    .post-footer > div { width: 100%; }
    .footer-main { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-main .footer-column:last-child { grid-column: auto; }
    .footer-bottom { flex-direction: column; }
    .card { padding: 20px; }
    table { min-width: 680px; }
    .home-hero { padding-top: 52px; }
    .hero-copy h1 { font-size: clamp(3.1rem, 15vw, 5rem); }
    .proof-board { min-height: 440px; border-radius: 30px; }
    .board-note { right: 15px; }
    .split-heading { grid-template-columns: 1fr; gap: 22px; }
    .principle-grid { grid-template-columns: 1fr; }
    .principle-visual { padding: 24px; }
    .home-cta { flex-direction: column; align-items: stretch; }
    .home-cta-actions { min-width: 0; }
    .math-workspace { border-radius: 22px; transform: none; }
    .workspace-shell { min-height: 405px; }
    .about-hero-grid, .about-intro, .origin-grid, .contact-intro-grid, .contact-layout { grid-template-columns: 1fr; }
    .about-hero-copy h1 { font-size: clamp(2.8rem, 12vw, 4.6rem); }
    .about-intro { gap: 30px; }
    .values-grid { grid-template-columns: 1fr; }
    .value-card { min-height: 240px; }
    .value-card > i { margin-bottom: 38px; }
    .origin-mark { width: min(62vw, 260px); margin-inline: auto; }
    .about-cta { flex-direction: column; align-items: stretch; }
    .contact-intro { padding-bottom: 125px; }
    .contact-intro-note { padding-left: 0; border-left: 0; }
    .contact-layout { gap: 45px; margin-top: -62px; }
    .compose-intro-inner, .compose-editor-grid, .answer-editor-grid { grid-template-columns: 1fr; }
    .compose-intro-inner { gap: 25px; }
    .compose-intro { padding-bottom: 92px; }
    .compose-preview { min-height: 240px; }
    .preview-empty { min-height: 195px; }
}

@media (max-width: 520px) {
    .brand-copy strong { font-size: 1.1rem; }
    .auth-card { padding: 25px !important; }
    .footer-main { grid-template-columns: 1fr; }
    .footer-brand, .footer-main .footer-column:last-child { grid-column: auto; }
    .btn, .button:not(.button-small), .btn-auth { width: 100%; }
    .hero-actions { display: grid; }
    .proof-board { min-height: 370px; }
    .proof-board > img { width: 82%; }
    .board-equation-two, .proof-line { display: none; }
    .board-note { max-width: 190px; padding: 13px 15px; }
    .category-grid { grid-template-columns: 1fr; }
    .category-card { min-height: 135px; }
    .notebook-sheet { min-height: 430px; padding-inline: 55px 20px; }
    .workspace-bar { grid-template-columns: auto 1fr; }
    .workspace-title { text-align: right; }
    .workspace-status { display: none; }
    .workspace-shell { grid-template-columns: 46px minmax(0, 1fr); min-height: 380px; }
    .workspace-tools span { width: 31px; height: 31px; }
    .workspace-editor { padding: 22px 14px 18px; }
    .editor-kicker { margin-bottom: 16px; }
    .editor-kicker strong { display: none; }
    .math-preview { padding-inline: 12px; }
    .rendered-equation { min-height: 75px; font-size: .73rem; }
    .workspace-foot { justify-content: center; }
    .about-formula { padding: 24px 18px; }
    .formula-row { gap: 5px; }
    .formula-row strong { padding-inline: 8px; }
    .about-cta-actions { min-width: 0; }
    .contact-layout { width: min(100% - 20px, 1180px); padding: 18px; border-radius: 22px; }
    .contact-form-card { padding: 23px 18px; }
    .contact-field-row { grid-template-columns: 1fr; }
    .contact-submit-row { flex-direction: column; align-items: stretch; }
    .contact-submit-row .button { width: 100%; }
    .compose-shell { width: min(100% - 20px, 1180px); }
    .compose-card { padding: 21px 16px; }
    .compose-intro h1 { font-size: clamp(2.75rem, 13vw, 4rem); }
    .latex-quickbar { align-items: flex-start; flex-direction: column; }
    .latex-snippets { justify-content: flex-start; }
    .compose-meta-grid { grid-template-columns: 1fr; }
    .compose-submit, .answer-submit-row { flex-direction: column; align-items: stretch; }
    .compose-submit .button, .answer-submit-row .button { width: 100%; }
    .code-dialog { padding: 10px; }
    .code-dialog-panel { max-height: 94vh; border-radius: 18px; }
    .code-dialog-head, .code-dialog-body { padding: 17px; }
    .code-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 14px 17px 17px; }
    .code-dialog-actions .button { width: 100%; min-width: 0; padding-inline: 10px; }
    .code-dialog-body textarea { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
