:root {
    --paper: #fffdf8;
    --ink: #1b2430;
    --muted: #5d6977;
    --line: #d7cec0;
    --accent: #8f3b2e;
    --shadow: rgba(27, 36, 48, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    color: var(--ink);
}

a {
    color: var(--accent);
}

.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 28px 52px;
    position: relative;
    z-index: 1;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    padding: 28px 0 26px;
    margin-bottom: 14px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.breadcrumbs {
    display: grid;
    gap: 4px;
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.96rem;
}

.breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.breadcrumb-line {
    line-height: 1.45;
}

.breadcrumb-branch {
    padding-left: 22px;
    position: relative;
}

.breadcrumb-branch::before {
    content: "|_";
    position: absolute;
    left: 0;
    color: var(--muted);
}

.summary-line {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-left: 4px solid var(--accent);
    background: #fbf6ee;
    color: var(--ink);
    line-height: 1.6;
}

.examiner-detail-intro {
    display: block;
    margin-bottom: 18px;
}

.examiner-detail-intro-main {
    min-width: 0;
}

.examiner-detail-intro-main .summary-line {
    margin-bottom: 0;
}

.examiner-export-actions {
    display: grid;
    gap: 10px;
}

.examiner-export-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(143, 59, 46, 0.22);
    background: linear-gradient(180deg, #fff8ef 0%, #f6eadb 100%);
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.examiner-export-action:hover,
.examiner-export-action:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(27, 36, 48, 0.12);
    border-color: rgba(143, 59, 46, 0.36);
    background: linear-gradient(180deg, #fffdf8 0%, #f7efe4 100%);
}

.examiner-export-action-secondary {
    background: linear-gradient(180deg, #8f3b2e 0%, #6f2d24 100%);
    border-color: rgba(111, 45, 36, 0.84);
    color: #fffdf8;
}

.examiner-export-action-secondary:hover,
.examiner-export-action-secondary:focus-visible {
    background: linear-gradient(180deg, #a44a39 0%, #7c3328 100%);
    border-color: rgba(124, 51, 40, 0.96);
    color: #fffdf8;
}

.examiner-export-action-locked {
    background: linear-gradient(180deg, #f4ece4 0%, #e8ddd1 100%);
    border-color: rgba(93, 105, 119, 0.24);
    color: #4a5563;
}

.examiner-export-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.activity-alert {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    margin: 0 0 16px;
    border: 1px solid var(--line);
}

.activity-stale {
    background: #fff4d6;
    border-color: #e0c36b;
}

.activity-inactive {
    background: #f8dddd;
    border-color: #d18a8a;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.status-card,
.panel {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 10px 28px var(--shadow);
}

.status-card {
    padding: 16px;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.35rem;
}

.status-card-export {
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(248, 242, 232, 0.96) 100%);
}

.status-card-export-locked {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #ededed 0%, #dcdcdc 100%);
    border-color: #c8c8c8;
    box-shadow: 0 10px 24px rgba(27, 36, 48, 0.08);
    filter: grayscale(1);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.status-card-export-locked:hover,
.status-card-export-locked:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(27, 36, 48, 0.12);
    border-color: #b2b2b2;
    outline: none;
}

.examiner-export-actions-compact {
    margin-top: 2px;
}

.examiner-export-actions-disabled {
    pointer-events: none;
}

.examiner-export-action-compact {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.examiner-export-action-disabled {
    cursor: default;
    box-shadow: none;
}

.examiner-export-note-compact {
    font-size: 0.76rem;
    line-height: 1.35;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
    overflow-x: auto;
}

.panel h2 {
    margin-top: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-header h2 {
    margin: 0;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-meta,
.panel-note,
.chart-note,
.note {
    color: var(--muted);
}

.panel-note {
    margin: 0 0 14px;
}

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

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

tbody th[scope="row"] {
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink);
}

tbody tr:hover {
    background: rgba(27, 36, 48, 0.06);
}

.heat-cell {
    transition: background-color 120ms ease;
}

.highlight-row {
    font-weight: bold;
    background: #f7efe3;
}

.toggle-panel-button {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    width: auto;
}

.toggle-panel-button:hover {
    background: transparent;
    color: #6f2d24;
}

.toggle-panel-button:focus-visible {
    outline: 2px solid rgba(143, 59, 46, 0.6);
    outline-offset: 4px;
    border-radius: 4px;
    color: #6f2d24;
}

.gap-row td {
    font-style: italic;
    color: var(--muted);
    background: #faf6ef;
}

.status-easy {
    background: #dff4df;
    border-color: #8cc78c;
}

.status-mixed {
    background: #fff3cd;
    border-color: #e0c36b;
}

.status-hard {
    background: #f7d8d8;
    border-color: #d18a8a;
}

.status-neutral {
    background: #ececec;
    border-color: #c5c5c5;
}

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

.detail-list {
    margin: 0;
    display: grid;
    gap: 10px;
}

.detail-list div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    font-weight: bold;
}

.detail-list dd {
    margin: 0;
}

.linked-group-line + .linked-group-line {
    margin-top: 6px;
}

.timeline-chart {
    overflow-x: auto;
    padding-bottom: 10px;
}

.grant-line-chart {
    margin: 4px 0 18px;
    overflow-x: auto;
}

.grant-chart-recent-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fbf6ee;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.grant-chart-recent-swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 1px solid rgba(143, 59, 46, 0.14);
    background: rgba(143, 59, 46, 0.08);
}

.grant-line-chart svg {
    width: 100%;
    min-width: 760px;
    height: auto;
    display: block;
    background: linear-gradient(180deg, #fffdf8 0%, #faf4ea 100%);
    border: 1px solid var(--line);
}

.grant-axis {
    stroke: #857a69;
    stroke-width: 1;
}

.grant-recent-band {
    fill: rgba(143, 59, 46, 0.08);
}

.grant-grid {
    stroke: #e2d7c8;
    stroke-width: 1;
}

.grant-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.grant-point {
    fill: #fffdf8;
    stroke: var(--accent);
    stroke-width: 2;
}

.grant-axis-label {
    fill: var(--muted);
    font-size: 12px;
    font-family: Georgia, "Times New Roman", serif;
}

.grant-validation-note {
    margin-top: 14px;
    margin-bottom: 0;
}

.timeline-shell {
    position: relative;
    min-width: max-content;
}

.timeline-markers,
.timeline-bars {
    display: grid;
    grid-auto-flow: column;
    gap: 12px;
}

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
    padding: 0 12px;
    pointer-events: none;
}

.timeline-bars {
    position: relative;
    align-items: end;
    min-height: 320px;
    padding: 56px 12px 0;
    border-bottom: 1px solid var(--line);
    z-index: 1;
}

.timeline-bar-group {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    align-items: end;
    justify-items: center;
}

.timeline-bar-shell {
    position: relative;
    width: 100%;
    max-width: 42px;
    height: 180px;
    display: flex;
    align-items: end;
    border: 1px solid #d4c7b4;
    background: linear-gradient(180deg, #f8f2e8 0%, #efe5d6 100%);
}

.timeline-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #d07c48 0%, #8f3b2e 100%);
}

.timeline-bar-value {
    font-size: 0.82rem;
    color: var(--muted);
}

.timeline-bar-year {
    font-size: 0.84rem;
    font-weight: 600;
}

.timeline-marker-grid {
    position: relative;
    min-height: 250px;
    justify-self: end;
    width: 0;
}

.timeline-marker-line {
    position: absolute;
    top: 28px;
    bottom: 42px;
    right: 0;
    border-left: 1px dashed #8f3b2e;
}

.timeline-marker-label {
    position: absolute;
    top: 0;
    right: 8px;
    max-width: 96px;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--accent);
    text-align: right;
}

.chart-note {
    margin: 12px 0 0;
}

.error-block {
    white-space: pre-wrap;
    background: #fff8f7;
    border: 1px solid #e6c3bb;
    padding: 12px;
}

.footer-note {
    margin-top: 18px;
}

.data-context-panel {
    margin-top: 22px;
    padding: 14px 16px 0;
    border-top: 1px solid rgba(143, 59, 46, 0.16);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.data-context-title {
    margin: 0 0 10px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(27, 36, 48, 0.68);
}

.data-context-panel .note {
    margin: 0 0 10px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(27, 36, 48, 0.72);
}

.data-context-panel .note:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .index-topbar-main {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 18px;
    }

    .page {
        padding: 18px 16px 32px;
    }

    .hero,
    .two-col,
    .examiner-detail-intro {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero {
        align-items: start;
    }

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

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

    .timeline-bars {
        min-height: 280px;
    }
}
