:root {
    --bg: #f6efe4;
    --bg-deep: #ecd9bb;
    --paper: rgba(255, 250, 241, 0.92);
    --paper-strong: #fff8ef;
    --text-strong: #2f241d;
    --text-muted: #6c5a4d;
    --forest: #0f5049;
    --forest-soft: rgba(15, 80, 73, 0.12);
    --copper: #ca784f;
    --copper-deep: #995232;
    --danger: #a24332;
    --border: rgba(92, 64, 49, 0.14);
    --shadow: 0 24px 80px rgba(78, 45, 26, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --font-sans: 'Manrope', 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text-strong);
    background:
        radial-gradient(circle at top left, rgba(226, 176, 84, 0.25), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 80, 73, 0.12), transparent 25%),
        linear-gradient(180deg, var(--bg), var(--bg-deep));
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

p,
h1,
h2,
h3 {
    margin: 0;
}

#app {
    min-height: 100vh;
}

.app-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 20px auto 56px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topbar,
.surface,
.hero-panel,
.footer-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, var(--paper-strong), var(--paper));
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.surface::before,
.hero-panel::before,
.footer-panel::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    left: -60px;
    bottom: -80px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(242, 186, 96, 0.24), rgba(242, 186, 96, 0));
    pointer-events: none;
}

.topbar {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar strong {
    display: block;
    color: var(--text-strong);
}

.topbar-badge,
.status-pill,
.category-pill,
.chip,
.chip-solid,
.save-state,
.metric-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font-weight: 700;
}

.topbar-badge,
.status-pill,
.category-pill,
.chip,
.metric-chip {
    padding: 9px 13px;
    background: var(--forest-soft);
    color: var(--forest);
}

.save-state--error,
.banner--error {
    background: rgba(162, 67, 50, 0.12);
    color: var(--danger);
}

.chip-solid {
    padding: 10px 13px;
    background: var(--forest);
    color: #f4fbf9;
}

.hero-grid,
.report-grid,
.survey-grid,
.dual-grid,
.timeline-grid {
    display: grid;
    gap: 24px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
}

.survey-grid {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
}

.report-grid,
.dual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeline-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-panel,
.surface,
.footer-panel {
    padding: 28px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 560px;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--copper);
}

.display-title,
.section-title,
.timeline-card h3,
.talent-card h3 {
    font-family: var(--font-display);
    color: var(--text-strong);
    letter-spacing: -0.04em;
}

.display-title {
    max-width: 12ch;
    font-size: clamp(2.8rem, 5vw, 5.1rem);
    line-height: 0.94;
    margin-bottom: 18px;
}

.section-title {
    font-size: clamp(1.55rem, 2vw, 2.3rem);
    line-height: 1.03;
}

.lead {
    max-width: 60ch;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.stats-grid,
.jump-grid,
.option-list,
.score-list,
.talent-list,
.method-grid {
    display: grid;
    gap: 14px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

.stat-card,
.note-box,
.timeline-card,
.talent-card,
.method-card,
.score-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(92, 64, 49, 0.08);
}

.stat-card strong {
    display: block;
    font-size: 1.9rem;
    color: var(--text-strong);
}

.note-box,
.meta-note,
.helper,
.option-description,
.talent-card p,
.surface p,
.footer-panel p,
.detail-list,
.method-card ul {
    color: var(--text-muted);
}

.note-box {
    margin-top: 18px;
    background: rgba(15, 80, 73, 0.08);
    border-color: rgba(15, 80, 73, 0.12);
}

.note-box--soft {
    background: rgba(202, 120, 79, 0.1);
    border-color: rgba(202, 120, 79, 0.16);
}

.panel-heading,
.stack-row,
.action-row,
.metric-row,
.score-head,
.talent-head,
.footer-links,
.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.panel-heading,
.score-list,
.talent-list,
.timeline-grid,
.detail-list,
.method-card ul,
.option-list {
    margin-top: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.field,
.checkbox-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label,
.checkbox-field label,
.field-title {
    color: var(--text-strong);
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(92, 64, 49, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-strong);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(202, 120, 79, 0.7);
    box-shadow: 0 0 0 4px rgba(202, 120, 79, 0.14);
    transform: translateY(-1px);
}

.field textarea {
    resize: vertical;
    min-height: 104px;
}

.checkbox-field {
    flex-direction: row;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(92, 64, 49, 0.12);
    background: rgba(255, 255, 255, 0.5);
}

.checkbox-field input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
}

.button,
.option-button,
.jump-button {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 14px 20px;
    font-weight: 700;
}

.button-primary {
    background: linear-gradient(135deg, var(--copper), #e59d58);
    color: #fffdf8;
    box-shadow: 0 18px 30px rgba(202, 120, 79, 0.28);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.76);
    color: var(--text-strong);
    border: 1px solid rgba(92, 64, 49, 0.14);
}

.button:hover,
.option-button:hover,
.jump-button:hover {
    transform: translateY(-2px);
}

.button[disabled] {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
    box-shadow: none;
}

.banner {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(15, 80, 73, 0.1);
    color: var(--forest);
    font-weight: 700;
}

.jump-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.jump-button,
.option-button {
    border: 1px solid rgba(92, 64, 49, 0.12);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-strong);
    cursor: pointer;
}

.jump-button {
    min-height: 48px;
    border-radius: 16px;
    font-weight: 700;
}

.jump-button--done {
    background: rgba(15, 80, 73, 0.16);
    color: var(--forest);
}

.jump-button--active {
    background: rgba(202, 120, 79, 0.16);
    border-color: rgba(202, 120, 79, 0.22);
}

.option-button {
    width: 100%;
    text-align: left;
    border-radius: var(--radius-lg);
    padding: 18px;
}

.option-button--selected {
    border-color: rgba(202, 120, 79, 0.4);
    background: linear-gradient(135deg, rgba(202, 120, 79, 0.14), rgba(15, 80, 73, 0.08));
    box-shadow: 0 16px 30px rgba(202, 120, 79, 0.14);
}

.option-title {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.progress {
    display: grid;
    gap: 12px;
}

.progress strong {
    font-size: 2rem;
}

.progress-track,
.score-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(92, 64, 49, 0.1);
}

.progress-bar,
.score-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--forest), var(--copper));
}

.accent-surface {
    background: linear-gradient(135deg, rgba(15, 80, 73, 0.95), rgba(38, 103, 95, 0.92));
    color: #f2f6f4;
}

.accent-surface .eyebrow,
.accent-surface .lead,
.accent-surface p,
.accent-surface span,
.accent-surface strong,
.accent-surface h2,
.accent-surface h3 {
    color: inherit;
}

.talent-head {
    align-items: flex-start;
}

.rank-badge {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: rgba(202, 120, 79, 0.18);
    color: var(--copper-deep);
    flex-shrink: 0;
}

.detail-list,
.method-card ul {
    padding-left: 18px;
    line-height: 1.72;
}

.detail-list.compact {
    margin-top: 12px;
}

.timeline-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-week {
    display: inline-flex;
    color: var(--copper-deep);
    font-weight: 800;
}

.metric-row,
.action-row,
.footer-links,
.meta-row {
    flex-wrap: wrap;
}

.metric-box {
    min-width: 160px;
}

.metric-box span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.84rem;
    color: inherit;
    opacity: 0.86;
}

.footer-panel {
    display: grid;
    gap: 18px;
}

.method-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.method-card h3 {
    margin-bottom: 10px;
}

.method-card a {
    color: var(--forest);
    text-decoration: none;
    font-weight: 700;
}

.method-card a:hover {
    text-decoration: underline;
}

.empty-state {
    padding: 42px 20px;
    text-align: center;
}

.app-shell--narrow {
    width: min(640px, calc(100% - 24px));
}

.admin-title {
    max-width: none;
}

.login-shell,
.summary-tile {
    padding: 28px;
}

.summary-grid,
.history-grid {
    display: grid;
    gap: 18px;
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-tile strong {
    display: block;
    font-size: 2rem;
    color: var(--text-strong);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.field-inline {
    min-width: 0;
}

.table-wrap {
    margin-top: 22px;
    overflow-x: auto;
    border: 1px solid rgba(92, 64, 49, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.52);
}

.admin-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(92, 64, 49, 0.08);
    vertical-align: top;
    text-align: left;
}

.admin-table th {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--copper-deep);
}

.admin-table tbody tr.is-selected {
    background: rgba(15, 80, 73, 0.08);
}

.table-stack,
.table-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
}

.table-actions a {
    color: var(--forest);
    text-decoration: none;
    font-weight: 700;
}

.table-actions a:hover {
    text-decoration: underline;
}

.history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.history-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(92, 64, 49, 0.1);
    background: rgba(255, 255, 255, 0.62);
}

.history-card--current {
    border-color: rgba(15, 80, 73, 0.32);
    box-shadow: 0 14px 32px rgba(15, 80, 73, 0.08);
}

.pagination-row {
    margin-top: 22px;
}

.panel-heading--tight {
    margin-top: 28px;
}

.section-subtitle {
    max-width: 56ch;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.screening-grid {
    margin-top: 18px;
}

.status-pill--green {
    background: rgba(15, 80, 73, 0.12);
    color: var(--forest);
}

.status-pill--yellow {
    background: rgba(202, 120, 79, 0.16);
    color: var(--copper-deep);
}

.status-pill--red {
    background: rgba(162, 67, 50, 0.12);
    color: var(--danger);
}

.safety-surface {
    border-width: 2px;
}

.safety-surface--green {
    border-color: rgba(15, 80, 73, 0.16);
    background: linear-gradient(160deg, rgba(244, 251, 249, 0.98), rgba(255, 250, 241, 0.92));
}

.safety-surface--yellow {
    border-color: rgba(202, 120, 79, 0.28);
    background: linear-gradient(160deg, rgba(255, 247, 235, 0.98), rgba(255, 250, 241, 0.92));
}

.safety-surface--red {
    border-color: rgba(162, 67, 50, 0.28);
    background: linear-gradient(160deg, rgba(255, 243, 240, 0.98), rgba(255, 250, 241, 0.92));
}

.experiment-grid,
.checkin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.experiment-card,
.checkin-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(92, 64, 49, 0.1);
    background: rgba(255, 255, 255, 0.72);
}

.experiment-card h3,
.checkin-card h3 {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.timeline-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline-card--compact {
    min-height: 100%;
}

.checkin-metrics {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 14px 0;
    color: var(--text-muted);
    font-weight: 700;
}

.scale-dots {
    display: inline-flex;
    gap: 5px;
    margin-left: 6px;
}

.scale-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(92, 64, 49, 0.12);
}

.scale-dot--active {
    background: linear-gradient(180deg, var(--copper), var(--forest));
}

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.tab-button {
    border: 1px solid rgba(92, 64, 49, 0.14);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-body);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(202, 120, 79, 0.42);
}

.tab-button--active {
    background: linear-gradient(135deg, rgba(202, 120, 79, 0.18), rgba(15, 80, 73, 0.12));
    border-color: rgba(15, 80, 73, 0.3);
    color: var(--forest);
}

.observer-grid,
.case-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.observer-card,
.case-card,
.note-log {
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(92, 64, 49, 0.1);
    background: rgba(255, 255, 255, 0.72);
}

.observer-card h3,
.case-card h3,
.note-log h3 {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: -0.03em;
}

.observer-question {
    border-top: 1px solid rgba(92, 64, 49, 0.08);
    padding-top: 16px;
}

.observer-question:first-of-type {
    border-top: none;
    padding-top: 0;
}

.note-log {
    display: grid;
    gap: 12px;
}

.note-log-entry {
    border-top: 1px solid rgba(92, 64, 49, 0.08);
    padding-top: 12px;
}

.note-log-entry:first-child {
    border-top: none;
    padding-top: 0;
}

.case-card--red {
    border-color: rgba(162, 67, 50, 0.24);
    background: linear-gradient(180deg, rgba(255, 243, 240, 0.94), rgba(255, 255, 255, 0.8));
}

.case-card--yellow {
    border-color: rgba(202, 120, 79, 0.24);
    background: linear-gradient(180deg, rgba(255, 249, 239, 0.94), rgba(255, 255, 255, 0.8));
}

@media (max-width: 1180px) {
    .hero-grid,
    .survey-grid,
    .report-grid,
    .dual-grid,
    .timeline-grid,
    .method-grid,
    .summary-grid,
    .history-grid,
    .experiment-grid,
    .checkin-grid,
    .observer-grid,
    .case-grid {
        grid-template-columns: 1fr;
    }

    .action-row,
    .panel-heading,
    .metric-row,
    .stack-row,
    .footer-links,
    .meta-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 820px) {
    .app-shell {
        width: min(100% - 20px, 1240px);
        margin-top: 12px;
        gap: 16px;
    }

    .topbar,
    .surface,
    .hero-panel,
    .footer-panel {
        padding: 20px;
        border-radius: 24px;
    }

    .display-title {
        max-width: none;
        font-size: clamp(2.3rem, 10vw, 4rem);
    }

    .stats-grid,
    .form-grid,
    .filter-grid,
    .tab-row {
        grid-template-columns: 1fr;
    }

    .tab-button {
        width: 100%;
    }

    .jump-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .jump-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .button {
        width: 100%;
    }
}

@media print {
    body {
        background: #fff;
    }

    .app-shell {
        width: 100%;
        margin: 0;
    }

    .topbar,
    .action-row,
    .footer-panel {
        display: none !important;
    }

    .surface,
    .hero-panel {
        box-shadow: none;
        border-color: rgba(0, 0, 0, 0.12);
        break-inside: avoid;
    }
}
