@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ─── CSS Variables ───────────────────────────────── */
:root {
    --bg:               #0d1117;
    --surface:          #161b22;
    --surface-raised:   #21262d;
    --border:           #30363d;
    --border-bright:    #484f58;
    --text:             #e6edf3;
    --text-dim:         #8b949e;
    --text-muted:       #6e7681;
    --green:            #3fb950;
    --green-dim:        #1a4726;
    --green-muted:      #bedeb4;
    --green-muted-dim:  #1e3a26;
    --blue:             #58a6ff;
    --blue-dim:         #1c3454;
    --orange:           #f0883e;
    --orange-dim:       #3d2210;
    --red:              #ff7b72;
    --yellow:           #d29922;
    --purple:           #bc8cff;
    --font:             'Space Grotesk', 'Segoe UI', sans-serif;
}

/* ─── Reset ───────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    background-color: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

/* ─── Base ────────────────────────────────────────── */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 0.9rem;
    /* subtle scanline overlay */
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ─── Header ──────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 4px;
}

header .container {
    padding-top: 0;
    padding-bottom: 0;
}

h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

h1::before {
    content: '// ';
    color: var(--text-muted);
    font-weight: 300;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 300;
}

.header-intro {
    font-size: 0.95rem;
    color: var(--text);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.6;
}

.header-intro-dim {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* ─── Progress Bar ────────────────────────────────── */
.progress-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.progress-bar.visible {
    max-height: 60px;
    opacity: 1;
    pointer-events: auto;
}

.progress-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.progress-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 6px;
    font-family: var(--font);
    white-space: nowrap;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border: 1px solid var(--border-bright);
    background: transparent;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.progress-dot.filled {
    background: var(--green);
    border-color: var(--green);
}

.progress-counter {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 8px;
    font-family: var(--font);
}

/* ─── Narrative connectors ────────────────────────────── */
.narrative {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 16px 0;
    width: 100%;
}

.narrative-intro {
    color: var(--text);
    margin-bottom: 16px;
}

/* ─── Box Label (shared section label across all boxes) ── */
.box-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 4px;
    width: 100%;
}

/* ─── Pill Selectors ──────────────────────────────── */
.pill-selectors {
    display: flex;
    row-gap: 4px;
    column-gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.pill-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill-selector label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: none;
    letter-spacing: 0.05em;
}

.pill-selector select {
    padding: 6px 12px;
    width: 200px;
    border: 1px solid var(--border-bright);
    background: var(--surface-raised);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

#employee-select {
    width: 240px;
}

.pill-selector select:hover {
    border-color: var(--blue);
}

.pill-selector select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

/* ─── Timeline ────────────────────────────────────── */
.timeline-section {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.stage-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 4px;
}

.stage-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 300;
}

.preview-btn {
    padding: 7px 14px;
    background: transparent;
    color: var(--blue);
    border: 1px solid var(--blue);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.03em;
}

.preview-btn:hover {
    background: var(--blue);
    color: var(--bg);
}

#timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    overflow-x: auto;
}

.timeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: 70px;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    background: var(--surface-raised);
    border: 2px solid var(--border-bright);
    transition: all 0.2s;
}

.timeline-stage.completed .timeline-dot {
    background: var(--green);
    border-color: var(--green);
}

.timeline-stage.current .timeline-dot {
    background: var(--blue);
    border-color: var(--blue);
    width: 16px;
    height: 16px;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
}

.timeline-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    text-transform: none;
    letter-spacing: 0.04em;
}

.timeline-stage.completed .timeline-label {
    color: var(--green);
}

.timeline-stage.current .timeline-label {
    color: var(--blue);
}

.timeline-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 20px;
}

.timeline-connector.completed {
    background: var(--green);
}

/* ─── Processes Section ───────────────────────────── */
.processes-section {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
}

.processes-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.processes-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.processes-header-row .export-buttons button {
    white-space: nowrap;
}

.processes-header-row .narrative {
    margin-bottom: 0;
}


#process-count {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.export-buttons button {
    padding: 7px 14px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-bright);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.03em;
}

.export-buttons button:hover {
    border-color: var(--green);
    color: var(--green);
}

/* ─── Overview Card ───────────────────────────────── */
.overview-card {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
}

.overview-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.overview-col-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.overview-col-header {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border: 1px solid var(--border-bright);
    color: var(--text-muted);
}

.critical-badge {
    border-color: var(--green) !important;
    color: var(--green) !important;
}

.recommended-badge {
    border-color: var(--green-muted) !important;
    color: var(--green-muted) !important;
}

.future-badge {
    border-color: var(--border-bright) !important;
    color: var(--text-muted) !important;
}

.not-applicable-badge {
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    opacity: 0.6;
}
    display: inline-block;
}

.overview-toggle {
    padding: 0;
    background: transparent;
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s;
}

.overview-toggle:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.overview-category-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 10px;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}

.overview-col-content .overview-category-label:first-child {
    margin-top: 0;
}

.overview-list {
    list-style: none;
    padding: 0;
    margin: 0 0 4px;
}

.overview-list li {
    font-size: 0.78rem;
    color: var(--text-dim);
    padding: 3px 0;
    font-weight: 300;
}


@media (max-width: 768px) {
    .overview-cols {
        grid-template-columns: 1fr;
    }
}

/* ─── Process Sections (Critical / Recommended / Future) ── */
.process-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border-bright);
    border-left: 3px solid var(--border-bright);
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.section-header.critical-header {
    border-left-color: var(--green);
}

.section-header.recommended-header {
    border-left-color: var(--green-muted);
}

.section-header.future-header {
    border-left-color: var(--border-bright);
}

.section-header.not-applicable-header {
    border-left-color: var(--border);
    opacity: 0.7;
}

.section-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.section-header.critical-header h3 {
    color: var(--green);
}

.section-header.recommended-header h3 {
    color: var(--green-muted);
}

.section-header .count {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.toggle-btn {
    padding: 3px 8px;
    background: transparent;
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border-bright);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.05em;
}

.toggle-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.section-content {
    padding: 0;
}

/* ─── Category Header between processes ──────────── */
.process-category-header {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    padding: 18px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.process-category-header:first-child {
    padding-top: 0;
}

/* ─── Individual Process Card ─────────────────────── */
.process {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 2px solid var(--border);
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}

.process:hover {
    border-color: var(--border-bright);
}

.process.critical-process {
    border-left-color: var(--green);
}

.process.recommended-process {
    border-left-color: var(--green-muted);
}

.process-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.process-category {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.78rem;
}

.process-breadcrumb-sep {
    color: var(--border-bright);
    font-weight: 400;
    margin: 0 2px;
}

.optional-tag {
    display: inline-block;
    background: transparent;
    color: var(--yellow);
    border: 1px solid var(--yellow);
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: none;
}

.process-description {
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.65;
    margin-bottom: 14px;
    font-weight: 400;
    padding-left: 4px;
}

.stage-focus {
    margin-top: 10px;
    margin-bottom: 14px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-left: 3px solid var(--green);
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text);
}

.stage-focus-label {
    color: var(--green);
    font-weight: 700;
}

/* ─── Dimension Rows ──────────────────────────────── */
.dimensions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.dimension-row {
    display: grid;
    grid-template-columns: 190px 240px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
}

.dimension-label {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: help;
    text-transform: none;
    letter-spacing: 0.04em;
}

.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--text-dim);
    font-size: 0.6rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
}

.help-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ─── Radio Buttons ───────────────────────────────── */
.radio-group {
    display: flex;
    gap: 6px;
}

.radio-option {
    position: relative;
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: 1px solid var(--border-bright);
    background: var(--surface-raised);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.12s;
    font-family: var(--font);
}

.radio-option label:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-dim);
}

.radio-option input[type="radio"]:checked + label {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--bg);
}

/* ─── Tooltip ─────────────────────────────────────── */
.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--border-bright);
    padding: 8px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    font-weight: 400;
    font-family: var(--font);
    max-width: 280px;
    white-space: normal;
    text-align: left;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-bright);
}

.radio-option:hover .tooltip,
.radio-option.active .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ─── Notes Input ─────────────────────────────────── */
.notes-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-bright);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    transition: border-color 0.15s, background 0.15s;
}

.notes-input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.notes-input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--bg);
}

/* ─── Summary ─────────────────────────────────────── */
.summary {
    margin-top: 24px;
    padding: 20px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-top: 2px solid var(--green);
    text-align: center;
}

.summary h3 {
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

#avg-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: -0.02em;
}

#avg-score::after {
    content: ' / 4';
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
}

.summary-export-btn {
    margin-top: 16px;
    padding: 7px 14px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-bright);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.03em;
}

.summary-export-btn:hover {
    border-color: var(--green);
    color: var(--green);
}

/* ─── Toast ───────────────────────────────────────── */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface-raised);
    color: var(--green);
    border: 1px solid var(--green);
    padding: 12px 20px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 10000;
    letter-spacing: 0.03em;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-bright);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .pill-selectors {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pill-selector select {
        width: 100%;
    }

    .timeline-label {
        font-size: 0.62rem;
    }

    .timeline-dot {
        width: 12px;
        height: 12px;
    }

    .timeline-stage.current .timeline-dot {
        width: 14px;
        height: 14px;
    }

    .dimension-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .radio-group {
        gap: 4px;
    }

    .radio-option label {
        width: 36px;
        height: 32px;
    }

    .tooltip {
        max-width: 200px;
    }

    .export-buttons {
        flex-direction: column;
    }

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