:root {
    --bg: #f5f1e8;
    --panel: rgba(255, 252, 246, 0.92);
    --panel-strong: #fffdf8;
    --ink: #1f1f18;
    --muted: #5d5a4f;
    --line: rgba(31, 31, 24, 0.12);
    --accent: #0d5c63;
    --accent-strong: #083c41;
    --warm: #d7a15a;
    --shadow: 0 18px 40px rgba(35, 30, 18, 0.08);
    --urgent: #c0392b;
    --high: #d97a2b;
    --medium: #c9a22b;
    --low: #2d7d46;
    --done-bg: rgba(45, 125, 70, 0.12);
    --done-fg: #1d6b36;
    --progress-bg: rgba(13, 92, 99, 0.12);
    --progress-fg: var(--accent-strong);
    --todo-bg: rgba(93, 90, 79, 0.12);
    --todo-fg: var(--muted);
    --waiting-bg: rgba(217, 122, 43, 0.12);
    --waiting-fg: #a85d1a;
    --in-progress-bg: rgba(13, 92, 99, 0.12);
    --in-progress-fg: var(--accent-strong);
    --focus-ring: 0 0 0 3px rgba(13, 92, 99, 0.25);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161610;
        --panel: rgba(28, 28, 22, 0.94);
        --panel-strong: #20201a;
        --ink: #e0ddd0;
        --muted: #8f8c7a;
        --line: rgba(224, 221, 208, 0.10);
        --accent: #3ab0b8;
        --accent-strong: #6dc5cb;
        --warm: #d7a15a;
        --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
        --urgent: #e74c3c;
        --high: #f09c4a;
        --medium: #d4b84c;
        --low: #4caf7a;
    }
    body {
        background:
            radial-gradient(circle at top left, rgba(215, 161, 90, 0.10), transparent 30%),
            linear-gradient(180deg, #1a1a14 0%, #12120e 100%);
    }
}

* {
    box-sizing: border-box;
}

/* ===== TRANSITIONS & MICRO-INTERACTIONS ===== */
.button,
.button-secondary,
.button-danger,
.stat-card,
.panel,
.form-input,
.form-select,
.form-textarea,
.data-table tbody tr,
.timeline-modal-dialog,
.timeline-modal-backdrop {
    transition: all 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 92, 99, 0.25);
}

.button-secondary:hover {
    background: rgba(13, 92, 99, 0.06);
    transform: translateY(-1px);
}

.button-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 47, 57, 0.25);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(35, 30, 18, 0.10);
}

.panel:hover {
    box-shadow: 0 20px 44px rgba(35, 30, 18, 0.06);
}

/* ===== FOCUS RINGS ===== */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.student-grid-controls input[type="search"]:focus,
.search-form input:focus,
.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

/* ===== MODAL ANIMATIONS ===== */
.timeline-modal {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.timeline-modal.is-open {
    opacity: 1;
}

.timeline-modal-dialog {
    transform: scale(0.95) translateY(8px);
}

.timeline-modal.is-open .timeline-modal-dialog {
    transform: scale(1) translateY(0);
}

.timeline-modal-backdrop {
    opacity: 0;
}

.timeline-modal.is-open .timeline-modal-backdrop {
    opacity: 1;
}

/* ===== STATUS & PRIORITY PILLS ===== */
.status-pill {
    display: inline-flex;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(215, 161, 90, 0.22);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.priority-urgent {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(192, 57, 43, 0.12);
    color: var(--urgent);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.priority-high {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(217, 122, 43, 0.12);
    color: var(--high);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.priority-medium {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(201, 162, 43, 0.12);
    color: var(--medium);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.priority-low {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(45, 125, 70, 0.12);
    color: var(--low);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-done {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--done-bg);
    color: var(--done-fg);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-in-progress {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--in-progress-bg);
    color: var(--in-progress-fg);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-waiting {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--waiting-bg);
    color: var(--waiting-fg);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-todo {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--todo-bg);
    color: var(--todo-fg);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== STICKY TABLE HEADERS ===== */
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel);
    backdrop-filter: blur(4px);
}

/* ===== TABLE ROW HOVER ===== */
.data-table tbody tr:hover {
    background: rgba(13, 92, 99, 0.03);
}

.data-table tbody tr:first-child:hover td {
    background: rgba(13, 92, 99, 0.03);
}

/* ===== EMPTY STATES WITH CTAs ===== */
.empty-state {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.empty-state-action {
    margin-top: 0.75rem;
}

/* ===== OVERFLOW INDICATOR ===== */
.table-wrap {
    position: relative;
}

.table-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(90deg, transparent, var(--panel));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.table-wrap:has(.data-table)::after {
    opacity: 1;
}

/* ===== NAV ACTIVE INDICATOR ===== */
.site-nav a.is-active {
    color: var(--accent-strong);
    font-weight: 600;
}

/* ===== MOBILE NAV TOGGLE ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 600px) {
    .nav-toggle {
        display: flex;
    }
    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 1rem 0 0;
    }
    .site-nav.is-open {
        display: flex;
    }
    .site-header {
        flex-wrap: wrap;
    }
}


/* ===== KEYBOARD SHORTCUT HINT ===== */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(215, 161, 90, 0.28), transparent 30%),
        linear-gradient(180deg, #f7f2e8 0%, #efe7d7 100%);
    color: var(--ink);
    font-family: "Instrument Sans", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem 2rem;
}

.brand {
    font-family: "Fraunces", serif;
    font-size: 1.6rem;
    text-decoration: none;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    padding: 1rem 0 2rem;
}

.hero h1 {
    max-width: 14ch;
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 0.98;
}

.hero-compact h1 {
    max-width: none;
    font-size: clamp(2rem, 3.5vw, 3rem);
}

.hero-copy {
    color: var(--muted);
}

.hero-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.button-secondary {
    background: transparent;
    color: var(--accent-strong);
}

.button-danger {
    border-color: #8b2f39;
    background: #8b2f39;
    color: white;
}

.stats-grid,
.content-grid,
.detail-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

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

.stat-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 1.25rem;
}

.stat-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 2.2rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.panel {
    padding: 1.25rem;
}

.narrow-panel {
    max-width: 560px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.panel h2,
.stack-list h3 {
    margin: 0;
}

.list,
.stack-list,
.mini-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li,
.stack-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
}

.stack-list li {
    display: block;
}

.list li:first-child,
.stack-list li:first-child {
    border-top: 0;
    padding-top: 0.2rem;
}

.list span,
.stack-list p,
.detail-list dt {
    color: var(--muted);
}

.detail-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem;
}

.detail-list dt,
.detail-list dd {
    margin: 0;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.student-grid-controls {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.student-grid-filters {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(180px, 1fr));
    gap: 0.75rem;
}

.student-grid-controls input[type="search"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    font: inherit;
}

.student-grid-summary {
    margin: 0 0 0.85rem;
    color: var(--muted);
}

.student-grid-modal {
    width: min(1100px, 100%);
}

.student-grid-modal-header {
    align-items: flex-start;
}

.student-grid-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.student-grid-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.student-grid-column {
    min-height: 0;
}

.student-grid-column h3,
.student-grid-card h3,
.plan-progress-card h3 {
    margin: 0 0 0.35rem;
}

.student-grid-stack {
    display: grid;
    gap: 0.75rem;
}

.student-grid-card,
.plan-progress-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.student-grid-column .student-grid-stack {
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.plan-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.plan-progress-bar {
    height: 12px;
    margin: 0.9rem 0 0.55rem;
    border-radius: 999px;
    background: rgba(13, 92, 99, 0.12);
    overflow: hidden;
}

.plan-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--warm));
}

.plan-progress-meta {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.plan-progress-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ps-total-bar {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
    color: var(--accent-strong);
}

.ps-total-bar strong {
    font-size: 1.8rem;
}

.ps-section-editor + .ps-section-editor {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.ps-section-count {
    color: var(--muted);
    font-weight: 600;
}

.ps-comments-group {
    margin-top: 1rem;
}

.ps-comment-list {
    display: grid;
    gap: 0.75rem;
}

.ps-comment-item {
    display: grid;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.ps-resource-list {
    display: grid;
    gap: 0.9rem;
}

.ps-resource-item {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.flash-message {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(13, 92, 99, 0.18);
    border-radius: 18px;
    background: rgba(13, 92, 99, 0.08);
    color: var(--accent-strong);
}

.search-form input {
    min-width: min(480px, 100%);
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    font: inherit;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
}

.record-form {
    display: grid;
    gap: 1rem;
}

.upload-form {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.document-upload-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1rem;
}

.form-row {
    display: grid;
    gap: 0.4rem;
}

.form-row label {
    font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    color: var(--ink);
    font: inherit;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-input {
    width: 1rem;
    height: 1rem;
}

.field-help,
.field-errors,
.form-errors {
    margin: 0;
    font-size: 0.92rem;
}

.field-help {
    color: var(--muted);
}

.field-errors,
.form-errors {
    color: #8b2f39;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.filter-label {
    color: var(--muted);
    font-weight: 600;
}

.compact-select {
    width: auto;
    min-width: 180px;
}

.table-empty-state {
    margin-top: 0.85rem;
}

.supplementary-content {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    color: var(--muted);
}

.choice-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.9rem 0.75rem;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
}

.table-sort-link:hover {
    color: var(--accent-strong);
}

.table-sort-link.is-active {
    color: var(--accent-strong);
}

.data-table tbody tr:first-child td {
    border-top: 1px solid var(--line);
}

.table-actions {
    text-align: right;
}

.table-actions-cell {
    white-space: nowrap;
}

.table-link {
    font-weight: 600;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.table-subtext {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-detail-row td {
    color: var(--muted);
    white-space: pre-wrap;
}

.student-list-table {
    min-width: 760px;
}

.student-list-table-wrap {
    overflow-x: auto;
}

.scroll-window {
    max-height: 28rem;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.timeline-table-window {
    max-height: 20rem;
    overflow-y: auto;
}

.timeline-event-button,
.viewer-trigger-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.timeline-event-button:hover,
.viewer-trigger-button:hover {
    text-decoration: underline;
}

.timeline-event-button.is-selected,
.viewer-trigger-button.is-selected {
    color: var(--accent);
}

.timeline-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.timeline-modal.is-open {
    display: flex;
}

.timeline-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 31, 24, 0.48);
}

.timeline-modal-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(80vh, 720px);
    overflow-y: auto;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(215, 161, 90, 0.18), transparent 32%),
        var(--panel-strong);
    box-shadow: 0 24px 60px rgba(31, 31, 24, 0.2);
}

.timeline-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.timeline-viewer-header h3 {
    margin: 0 0 0.25rem;
}

.timeline-viewer-meta,
.timeline-viewer-body {
    margin: 0;
    color: var(--muted);
}

.timeline-viewer-body {
    white-space: pre-wrap;
}

.timeline-viewer-body + .timeline-viewer-body {
    margin-top: 0.9rem;
}

.status-pill {
    display: inline-flex;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(215, 161, 90, 0.22);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.panel-header-tight {
    margin-bottom: 0.35rem;
}

.document-group + .document-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.document-group-count {
    color: var(--muted);
    font-size: 0.9rem;
}

.document-list li:first-child {
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.document-list-scroll {
    max-height: 20rem;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.document-link {
    font-weight: 600;
    text-decoration: none;
}

.document-link:hover {
    text-decoration: underline;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.login-card {
    width: min(100%, 460px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0 0 0.6rem;
    font-family: "Fraunces", serif;
    font-size: clamp(2rem, 4vw, 3rem);
}

.login-copy {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-form label {
    display: grid;
    gap: 0.45rem;
}

.login-form span {
    color: var(--muted);
    font-size: 0.92rem;
}

.login-form input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    font: inherit;
}

@media (max-width: 840px) {
    .site-header,
    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .content-grid,
    .detail-grid,
    .form-layout,
    .document-upload-grid,
    .student-grid-filters {
        grid-template-columns: 1fr;
    }

    .student-grid-columns,
    .plan-progress-grid {
        grid-template-columns: 1fr;
    }

    .page-shell {
        padding: 0 1rem 2rem;
    }

    .site-header {
        padding: 1rem;
    }

    .detail-list div {
        grid-template-columns: 1fr;
    }

    .section-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-viewer-header {
        flex-direction: column;
    }

    .section-nav {
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .section-nav a {
        font-size: 0.78rem;
        padding: 0.3rem 0.55rem;
        white-space: nowrap;
    }

    .hero-contact-chips {
        flex-wrap: wrap;
    }
}

/* ===== SECTION NAVIGATOR (sticky) ===== */
.section-nav {
    display: flex;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0.5rem;
    z-index: 20;
    overflow-x: auto;
}

.section-nav a {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.section-nav a:hover {
    background: rgba(13, 92, 99, 0.08);
    color: var(--accent-strong);
}

/* ===== HERO CONTACT CHIPS ===== */
.hero-contact-chips {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== INLINE PLAN PROGRESS BAR ===== */
.plan-progress-cell {
    min-width: 140px;
}

.plan-inline-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(13, 92, 99, 0.12);
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.plan-inline-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--warm));
    transition: width 0.3s ease;
}

.plan-inline-label {
    font-size: 0.78rem;
    color: var(--muted);
}

/* ===== COLLAPSIBLE DETAILS PANEL ===== */
.details-panel {
    margin-bottom: 1rem;
}

.details-summary {
    cursor: pointer;
    list-style: none;
    margin-bottom: 0;
}

.details-summary::-webkit-details-marker {
    display: none;
}

.details-summary:hover {
    opacity: 0.75;
}

.details-toggle-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.details-body {
    margin-top: 0.75rem;
}

/* ===== PANEL TITLE LINK ===== */
.panel-title-link {
    color: inherit;
    text-decoration: none;
}

.panel-title-link:hover {
    text-decoration: underline;
}

/* ===== OWNER LABEL ===== */
.owner-neil {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(13, 92, 99, 0.12);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.owner-lead {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(217, 122, 43, 0.12);
    color: var(--high);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== DOCUMENT GROUP (collapsible body) ===== */
.document-group {
    margin-bottom: 0.5rem;
}


