:root {
    --ink: #111c2b;
    --muted: #657083;
    --line: #e2e8e4;
    --surface: #f5f8f5;
    --white: #fff;
    --primary: #111c2b;
    --primary-dark: #0a121d;
    --accent: #a7f432;
    --violet: #334a65;
    --good: #16845b;
    --warn: #b7791f;
    --bad: #c24155;
    --shadow: 0 24px 70px rgba(28, 40, 77, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: "Avenir Next Rounded", "Nunito Sans", ui-rounded, "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 4.75rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.12; letter-spacing: -.03em; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.eyebrow { color: var(--primary); font-size: .74rem; letter-spacing: .15em; font-weight: 800; margin-bottom: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .68rem; color: var(--ink); font-family: "Avenir Next Rounded", "Nunito Sans", ui-rounded, "Segoe UI", sans-serif; font-weight: 900; font-size: 1.22rem; letter-spacing: -.035em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: var(--white);
    padding: .75rem 1.05rem;
    font-weight: 750;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(28, 40, 77, .11); }
.button.primary { color: #fff; border-color: var(--primary); background: linear-gradient(135deg, var(--primary), #263b53); }
.button.primary:hover { box-shadow: 0 12px 26px rgba(17, 28, 43, .22), 0 0 0 3px rgba(167, 244, 50, .24); }
.button.ghost { background: transparent; }
.button.small { padding: .52rem .82rem; font-size: .9rem; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.site-header {
    width: min(1180px, calc(100% - 40px));
    height: 86px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header nav, footer > div { display: flex; align-items: center; gap: 1.4rem; }
.site-header nav > a:not(.button), footer a { color: var(--muted); font-weight: 650; font-size: .9rem; }
.site-header.compact { border-bottom: 1px solid var(--line); }
.hero {
    width: min(1180px, calc(100% - 40px));
    min-height: 690px;
    margin: 20px auto 70px;
    padding: 70px 80px;
    border: 1px solid rgba(17, 28, 43, .12);
    border-radius: 36px;
    background:
        radial-gradient(circle at 80% 15%, rgba(167, 244, 50, .22), transparent 32%),
        radial-gradient(circle at 12% 90%, rgba(17, 28, 43, .10), transparent 30%),
        #fff;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 70px;
    align-items: center;
    overflow: hidden;
}
.hero h1 { max-width: 760px; margin: 1.1rem 0 1.4rem; }
.hero h1 em { color: #385f08; font-style: normal; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .14em; text-underline-offset: .08em; }
.hero-copy > p { color: var(--muted); font-size: 1.12rem; max-width: 640px; }
.pill { display: inline-flex; border: 1px solid #d4e7bc; color: #294b00; background: #f2fbE7; border-radius: 999px; padding: .45rem .8rem; font-size: .8rem; font-weight: 800; }
.pill.dark { background: var(--ink); border-color: var(--ink); color: var(--accent); }
.hero-actions { display: flex; gap: .75rem; margin-top: 1.8rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 2rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
.phone-card {
    width: 330px;
    justify-self: center;
    padding: 22px;
    border: 8px solid var(--ink);
    border-radius: 40px;
    background: #f7f8fc;
    box-shadow: 0 40px 80px rgba(28, 40, 77, .25);
    transform: rotate(2deg);
}
.phone-top { display: flex; align-items: center; gap: .6rem; font-weight: 800; margin: 8px 0 24px; }
.phone-top img { width: 28px; }
.ticket { padding: 18px; border-radius: 18px; background: linear-gradient(135deg, #111c2b, #2d435d); color: #fff; box-shadow: 0 12px 30px rgba(17, 28, 43, .24); margin-bottom: 12px; }
.ticket.soft { background: #fff; color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.ticket strong, .ticket small { display: block; }
.ticket small { opacity: .8; margin-top: .3rem; }
.ticket > div { display: flex; justify-content: space-between; margin-top: 2rem; font-size: .78rem; }
.ticket-type { display: block; font-size: .65rem; letter-spacing: .12em; opacity: .8; margin-bottom: .7rem; font-weight: 800; }
.feature-section, .security-section, .download-section {
    width: min(1050px, calc(100% - 40px));
    margin: 110px auto;
}
.section-title { max-width: 620px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 38px; }
.feature-grid article { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 30px; min-height: 230px; }
.feature-grid article p { color: var(--muted); }
.feature-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #effbdc; color: #294b00; font-size: .72rem; font-weight: 900; margin-bottom: 28px; }
.security-section { color: #fff; background: var(--ink); border-radius: 28px; padding: 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: end; }
.security-section p { color: #c7cee0; font-size: 1.05rem; }
.security-section .eyebrow { color: var(--accent); }
.download-section { display: flex; align-items: center; gap: 24px; padding: 30px; border: 1px solid var(--line); background: #fff; border-radius: 24px; }
.download-section img { width: 70px; }
.download-section h2 { font-size: 1.35rem; margin-bottom: .2rem; }
.download-section p { color: var(--muted); margin: 0; }
.download-section .pill { margin-left: auto; }
footer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 130px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
footer small { color: var(--muted); }

.auth-shell { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #eafbd5, transparent 32%), var(--surface); }
.auth-card { width: min(460px, 100%); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card.wide { width: min(620px, 100%); }
.auth-card.center { text-align: center; }
.auth-card h1 { font-size: 2rem; }
.auth-logo { width: 54px; height: 54px; margin-bottom: 25px; object-fit: contain; }
.stack { display: grid; gap: 16px; }
.top-gap { margin-top: 25px; }
label { display: grid; gap: .45rem; color: #353d51; font-size: .84rem; font-weight: 750; }
input, select {
    width: 100%;
    border: 1px solid #d6dce8;
    border-radius: 10px;
    padding: .72rem .8rem;
    color: var(--ink);
    background: #fff;
    outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(167, 244, 50, .28); }
.check { display: flex; grid-column: auto; flex-direction: row; align-items: center; gap: .6rem; }
.check input { width: auto; }
.alert { border-radius: 11px; padding: .8rem 1rem; margin: 1rem 0; font-size: .88rem; }
.alert.error { color: #8d2437; border: 1px solid #f1c4cc; background: #fff0f3; }
.alert.success { color: #0a6845; border: 1px solid #bce7d4; background: #ecfbf5; }
.alert ul { margin-bottom: 0; padding-left: 1.1rem; }
.secret-box, .install-result { border: 1px dashed #aab8e7; background: #f4f6ff; padding: 15px; border-radius: 10px; }
.secret-box code { font-size: 1.15rem; letter-spacing: .12em; word-break: break-all; }
.break { display: block; word-break: break-all; white-space: normal; }
.result-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; font-weight: 900; margin: 0 auto 1.2rem; }
.success-icon { color: var(--good); background: #e9f8f2; }
.error-icon { color: var(--bad); background: #fff0f3; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 20px; color: #fff; background: var(--ink); }
.sidebar .brand { color: #fff; padding: 0 10px 25px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { color: #aeb8ce; padding: .75rem .85rem; border-radius: 9px; font-size: .9rem; font-weight: 700; }
.sidebar nav a:hover, .sidebar nav a.active { color: var(--accent); background: #26384d; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #303c56; padding: 18px 10px 0; display: grid; gap: 5px; font-size: .72rem; color: #aeb8ce; word-break: break-all; }
.link-button { border: 0; padding: 0; background: transparent; color: #fff; font-weight: 750; cursor: pointer; }
.admin-main { padding: 45px; overflow: hidden; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-head h1 { font-size: 2.2rem; margin: 0; }
.status-dot { color: var(--good); font-size: .82rem; font-weight: 800; }
.status-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 7px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 25px; }
.metric { border: 1px solid var(--line); background: #fff; padding: 22px; border-radius: 15px; }
.metric span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.metric strong { display: block; font-size: 2rem; margin-top: .3rem; letter-spacing: -.04em; }
.panel { border: 1px solid var(--line); background: #fff; border-radius: 16px; margin-bottom: 22px; overflow: hidden; }
.panel-head, .form-panel { padding: 24px; }
.panel-head h2, .form-panel h2 { margin: 0; font-size: 1.15rem; }
.form-panel { overflow: visible; }
.form-panel > h2 { margin-bottom: .35rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.wide-field { grid-column: 1 / -1; }
.learning-sample-groups { display: grid; gap: 14px; margin-top: 18px; }
.learning-sample-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.learning-sample-group h3 { flex-basis: 100%; margin: 0; font-size: .82rem; color: var(--muted); }
.learning-sample-link { display: inline-flex; align-items: center; gap: 7px; }
.learning-mapper { padding: 24px; }
.learning-mapper h2 { margin-top: 0; }
.learning-field-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.learning-field-picker button { border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); padding: .62rem .85rem; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.learning-field-picker button:hover, .learning-field-picker button.active { border-color: var(--primary); color: var(--primary); background: #eef4ff; }
.learning-pair-state { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 12px 14px; border: 1px solid #cbd8ff; border-radius: 12px; background: #f4f7ff; }
.learning-pair-state strong { color: var(--primary); font-size: .84rem; }
.learning-pair-state span { color: var(--muted); font-size: .78rem; }
.learning-pair-state[data-phase="value"] { border-color: #89ddd2; background: #effbf8; }
.learning-pair-state[data-phase="value"] strong { color: #087565; }
.learning-mapping-summaries { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.learning-mapping-chip { display: inline-flex; padding: .38rem .58rem; border-radius: 999px; color: #087565; background: #eaf9f5; font-size: .7rem; font-weight: 800; }
.pdf-mapper-status { margin: 0 0 14px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.pdf-mapper-pages { display: grid; justify-items: center; gap: 20px; max-height: 78vh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #e8edf3; }
.pdf-mapper-page { position: relative; flex: 0 0 auto; box-shadow: 0 10px 32px rgba(20, 32, 52, .18); background: #fff; overflow: hidden; }
.pdf-mapper-page canvas { display: block; }
.pdf-text-overlay { position: absolute; inset: 0; }
.pdf-text-target { position: absolute; border: 1px solid transparent; background: transparent; border-radius: 3px; padding: 0; cursor: crosshair; }
.pdf-text-target:hover, .pdf-text-target:focus-visible { border-color: #0f5bff; background: rgba(15, 91, 255, .20); outline: 2px solid rgba(15, 91, 255, .18); }
.pdf-text-target:active { background: rgba(18, 195, 177, .28); border-color: var(--accent); }
.pdf-text-target.pdf-text-anchor-selected { border-color: #0f5bff; background: rgba(15, 91, 255, .24); outline: 2px solid rgba(15, 91, 255, .2); }
.pdf-text-target.pdf-text-value-selected { border-color: #079987; background: rgba(18, 195, 177, .30); outline: 2px solid rgba(18, 195, 177, .18); }
.pdf-page-label { position: absolute; right: 9px; bottom: 9px; padding: .28rem .48rem; border-radius: 999px; color: #fff; background: rgba(20, 32, 52, .78); font-size: .66rem; font-weight: 800; pointer-events: none; }
.learning-target-flash { animation: learning-target-flash .8s ease-out; }
@keyframes learning-target-flash { 0% { box-shadow: 0 0 0 3px rgba(18, 195, 177, .45); } 100% { box-shadow: 0 0 0 0 rgba(18, 195, 177, 0); } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th { color: var(--muted); text-align: left; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
.badge { display: inline-flex; padding: .25rem .5rem; border-radius: 999px; background: #eef1f6; color: #5e687d; font-size: .68rem; font-weight: 800; }
.badge.good { color: #08714b; background: #e9f8f2; }
.badge.warn { color: #946218; background: #fff6df; }
.search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 520px; }

.install-shell { width: min(1100px, calc(100% - 40px)); margin: 50px auto; display: grid; grid-template-columns: .75fr 1.25fr; gap: 28px; align-items: start; }
.install-intro { position: sticky; top: 40px; padding: 35px; }
.install-intro h1 { font-size: 2.6rem; }
.install-card { border: 1px solid var(--line); background: #fff; border-radius: 22px; padding: 34px; box-shadow: var(--shadow); }
fieldset { border: 1px solid var(--line); border-radius: 13px; padding: 20px; margin: 0; }
legend { padding: 0 .5rem; font-weight: 850; }
.requirements { list-style: none; padding: 0; margin: 35px 0 0; border-top: 1px solid var(--line); }
.requirements li { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); }
.install-result { margin: 12px 0; }
.install-result span, .install-result code { display: block; }
.install-result span { color: var(--muted); font-size: .72rem; font-weight: 800; margin-bottom: .3rem; }
.install-result code { font-size: .9rem; }
.legal { width: min(760px, calc(100% - 40px)); margin: 80px auto 120px; background: #fff; padding: 50px; border: 1px solid var(--line); border-radius: 20px; }
.legal h1 { font-size: 2.8rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal p { color: #4d566a; }
.support-page { width: min(940px, calc(100% - 40px)); }
.support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
}
.support-grid section {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    background: #fafbfe;
}
.support-grid section h2 { margin-top: 0; }
.support-grid section p { margin-bottom: 0; }

@media (max-width: 900px) {
    .site-header nav > a:not(.button) { display: none; }
    .hero { grid-template-columns: 1fr; padding: 50px 30px; }
    .phone-card { width: min(330px, 100%); }
    .feature-grid, .security-section { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar nav { grid-template-columns: repeat(3, 1fr); }
    .sidebar-foot { display: none; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .install-shell { grid-template-columns: 1fr; }
    .install-intro { position: static; }
}

@media (max-width: 600px) {
    .site-header { width: calc(100% - 28px); }
    .hero { width: calc(100% - 24px); margin-top: 6px; padding: 42px 22px; border-radius: 25px; }
    .hero-actions { flex-direction: column; }
    .feature-grid { grid-template-columns: 1fr; }
    .security-section { padding: 35px 25px; }
    .download-section, footer { align-items: flex-start; flex-direction: column; }
    footer { padding: 30px 0; }
    .admin-main { padding: 25px 16px; }
    .sidebar nav { grid-template-columns: 1fr 1fr; }
    .metrics, .form-grid { grid-template-columns: 1fr; }
    .wide-field { grid-column: auto; }
    .learning-mapper { padding: 18px 12px; }
    .pdf-mapper-pages { padding: 6px; }
    .auth-card, .install-card { padding: 26px 20px; }
    .install-shell { width: calc(100% - 24px); margin: 20px auto; }
    .legal { width: calc(100% - 24px); padding: 30px 22px; margin-top: 30px; }
    .support-grid { grid-template-columns: 1fr; }
}
