.bureaucracy-container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: Arial, 'Helvetica Neue', sans-serif;
    font-size: 0.95rem;
    color: #222;
}

/* Progress bar */

.stage-progress {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: #f0f0f0;
    border: 1px solid #d0d0d0;
}

.stage-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.dot-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid #bbb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.dot-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.stage-dot.active .dot-circle {
    background: #333;
    border-color: #333;
    color: #fff;
}

.stage-dot.active .dot-label {
    color: #333;
    font-weight: 600;
}

.stage-dot.complete .dot-circle {
    background: #888;
    border-color: #888;
    color: #fff;
}

.stage-dot.complete .dot-label {
    color: #666;
}

.stage-connector {
    flex: 1;
    height: 2px;
    background: #ccc;
    margin: 0 0.25rem;
    margin-bottom: 1.5rem;
}

/* Stage panels */

.stage-panel {
    display: none;
    background: #fff;
    border: 1px solid #d0d0d0;
    margin-bottom: 1.5rem;
}

.stage-panel.stage-active {
    display: block;
}

.stage-header {
    background: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
    border-left: 4px solid #555;
    padding: 0.75rem 1rem;
}

.stage-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stage-subtext {
    font-size: 0.72rem;
    color: #777;
    font-style: italic;
    margin: 0;
}

.stage-body {
    padding: 1.25rem 1rem;
}

/* Intake form */

.field-group {
    margin-bottom: 1rem;
}

.field-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field-group textarea,
.field-group select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #bbb;
    background: #fafafa;
    font-size: 0.9rem;
    color: #222;
    border-radius: 2px;
    box-sizing: border-box;
    font-family: inherit;
    margin: 0;
}

.field-group textarea:focus,
.field-group select:focus {
    outline: 2px solid #555;
    outline-offset: 1px;
    border-color: #555;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .field-group {
    flex: 1;
}

.form-hint {
    font-size: 0.72rem;
    color: #aaa;
    margin: 0 0 0.75rem;
}

/* Generated content */

.generated-field {
    margin-bottom: 0.85rem;
    padding: 0.6rem 0.75rem;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
}

.field-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
    margin-bottom: 0.25rem;
}

.field-value {
    display: block;
    font-size: 0.9rem;
    color: #222;
    line-height: 1.5;
}

.ref-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #555;
}

/* Routing */

.routing-note {
    font-size: 0.88rem;
    color: #555;
    font-style: italic;
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #ccc;
    background: #fafafa;
}

.routing-log {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 1px solid #e0e0e0;
}

.routing-log li {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.88rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.routing-log li:last-child {
    border-bottom: none;
}

.routing-team {
    font-weight: 600;
    color: #333;
}

.routing-reason {
    color: #777;
    font-style: italic;
    text-align: right;
}

.routing-unassigned {
    background: #f5f5f5;
}

.routing-owner-unassigned {
    color: #aaa;
    font-style: italic;
}

/* Review */

.review-doubt-header {
    font-size: 0.9rem;
    color: #444;
    padding: 0.75rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: 4px solid #999;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.risk-score-block {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    background: #f0f0f0;
    border: 1px solid #ccc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    color: #555;
    margin: 0.5rem 0 1.25rem;
}

/* Closure */

.closure-notice {
    padding: 1rem;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-left: 4px solid #888;
    margin-bottom: 1.25rem;
}

.close-reason {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
    margin: 0 0 0.75rem;
}

.close-footer {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
    font-style: italic;
}

/* Buttons */

.proc-btn {
    padding: 0.55rem 1.4rem;
    border: 1px solid #555;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
}

.proc-btn-primary {
    background: #444;
    color: #fff;
    border-color: #333;
}

.proc-btn-primary:hover {
    background: #333;
}

.proc-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border-color: #bbb;
    margin-left: 0.5rem;
}

.proc-btn-secondary:hover {
    background: #e0e0e0;
}

/* Audit trail */

.audit-trail {
    margin-top: 2rem;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

.audit-trail h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    margin: 0 0 0.75rem;
}

#audit-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#audit-list li {
    font-size: 0.78rem;
    color: #888;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
}

#audit-list li:last-child {
    border-bottom: none;
}

.audit-timestamp {
    color: #bbb;
}

/* Close button row */

.close-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: flex-start;
}

.close-btn-row > span {
    display: flex;
    flex-direction: column;
}

/* Toggle panels */

.toggle-panel {
    margin-top: 1rem;
}

/* Incident inversion */

.inversion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #ccc;
    border: 1px solid #ccc;
    margin-bottom: 0.5rem;
}

.inversion-block {
    padding: 0.85rem;
    background: #fff;
}

.inversion-operational {
    background: #fafafa;
}

.inversion-record {
    background: #f0f0f0;
}

.inversion-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.inversion-operational .inversion-label {
    color: #444;
}

.inversion-record .inversion-label {
    color: #888;
}

.inversion-text {
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

.inversion-operational .inversion-text {
    color: #222;
}

.inversion-record .inversion-text {
    color: #555;
    font-style: italic;
}

/* Compliance narrative */

.compliance-doc {
    border: 1px solid #ccc;
    background: #fff;
    margin-bottom: 0.5rem;
}

.compliance-header {
    background: #e8e8e8;
    border-bottom: 1px solid #d0d0d0;
    padding: 0.75rem 1rem;
}

.compliance-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.2rem;
    color: #333;
}

.compliance-header p {
    font-size: 0.72rem;
    color: #888;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
}

.compliance-body {
    padding: 1rem;
}

.compliance-body p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #444;
    margin: 0 0 0.75rem;
}

.compliance-body p:last-child {
    margin-bottom: 0;
}

/* Responsive */

@media (max-width: 540px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .stage-progress {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .stage-connector {
        display: none;
    }
}