:root {
    --ink: #172522;
    --muted: #61706d;
    --line: #dce4e1;
    --surface: #ffffff;
    --surface-soft: #f4f7f5;
    --brand: #153f3a;
    --brand-light: #dcece8;
    --accent: #c99c38;
    --warning: #9a6814;
    --warning-bg: #fff8e8;
    --danger: #a43c36;
    --danger-bg: #fff1ef;
    --success: #246c59;
    --shadow: 0 20px 55px rgba(26, 55, 49, .09);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #edf2ef; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(201, 156, 56, .08), transparent 24rem),
        linear-gradient(180deg, #f7f9f7 0, #edf2ef 100%);
    font-family: Inter, Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}
a { color: inherit; }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(201, 156, 56, .55);
    outline-offset: 3px;
}

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header-stack {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(21, 63, 58, .1);
    background: rgba(248, 250, 248, .94);
    backdrop-filter: blur(18px);
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    min-height: 76px;
    padding: 12px max(24px, calc((100vw - 1280px) / 2));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: var(--brand);
    box-shadow: 0 8px 20px rgba(21, 63, 58, .18);
    font-weight: 700;
    letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.product-nav { margin-left: auto; }
.product-nav a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #40514d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
    transition: border-color .18s ease, background .18s ease;
}
.product-nav a:hover { border-color: #b7c8c3; background: rgba(255, 255, 255, .75); }
.product-nav a.active { border-color: #557e75; color: var(--brand); background: #fff; }
.profile-switcher-shell {
    border-top: 1px solid rgba(21, 63, 58, .07);
    background: rgba(239, 244, 241, .88);
}
.profile-switcher {
    display: flex;
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    align-items: center;
    gap: 18px;
    padding: 9px 0;
}
.profile-switcher__intro {
    flex: 0 0 170px;
    line-height: 1.25;
}
.profile-switcher__intro span,
.profile-switcher__intro strong {
    display: block;
}
.profile-switcher__intro span {
    color: var(--success);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.profile-switcher__intro strong {
    margin-top: 2px;
    font-size: 11px;
}
.profile-switcher__items {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}
.profile-switcher__item {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #40514d;
    background: rgba(255, 255, 255, .56);
    text-align: left;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
a.profile-switcher__item:hover {
    transform: translateY(-1px);
    border-color: #b7c8c3;
    background: rgba(255, 255, 255, .92);
}
.profile-switcher__item.active {
    border-color: #557e75;
    color: var(--brand);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(85, 126, 117, .15), 0 7px 18px rgba(21, 63, 58, .07);
}
.profile-switcher__item--unavailable { opacity: .72; cursor: default; }
.profile-switcher__mark {
    display: grid;
    flex: 0 0 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    color: var(--brand);
    background: var(--brand-light);
    font-size: 11px;
    font-weight: 800;
}
.profile-switcher__copy {
    min-width: 0;
}
.profile-switcher__copy strong,
.profile-switcher__purpose,
.profile-switcher__copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-switcher__copy strong {
    font-size: 11px;
}
.profile-switcher__purpose {
    margin-top: 1px;
    color: #40514d;
    font-size: 9px;
}
.profile-switcher__copy small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 8px;
}
.profile-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: 1px;
}
.profile-status-dot--available { background: var(--success); }
.profile-status-dot--preview { background: var(--accent); }
.profile-status-dot--unavailable { background: #8e9b98; }
.profile-status-dot--loading {
    background: #8aa59e;
    animation: profile-status-pulse 1.2s ease-in-out infinite;
}
@keyframes profile-status-pulse { 50% { opacity: .35; } }
.profile-switcher__problem {
    display: flex;
    width: min(1280px, calc(100% - 48px));
    margin: -3px auto 7px;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    color: #7a3f39;
    font-size: 9px;
}
.profile-switcher__problem button {
    padding: 3px 7px;
    border: 1px solid #d9aaa5;
    border-radius: 7px;
    color: #7a3f39;
    background: #fff7f6;
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
}
.profile-switcher__problem button:disabled { opacity: .55; cursor: wait; }
.site-main { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 64px; flex: 1; }
.site-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding: 22px 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, .5);
    font-size: 12px;
}
.site-footer span + span::before { content: "•"; margin-right: 26px; color: #aebbb7; }

.hero { display: flex; align-items: end; justify-content: space-between; gap: 48px; margin-bottom: 28px; }
.hero > div { max-width: 760px; }
.eyebrow, .step-label, .result-kicker {
    margin: 0 0 8px;
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
    margin-bottom: 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.02;
    letter-spacing: -.035em;
}
.hero-copy, .page-heading > div > p {
    max-width: 700px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 20px; }
.hero-actions span { max-width: 340px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.analysis-grid { scroll-margin-top: 24px; }
.reference-link {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    min-width: 270px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.reference-link:hover { transform: translateY(-2px); border-color: #9eb4ae; box-shadow: 0 12px 25px rgba(27, 60, 53, .08); }
.reference-link-icon {
    display: grid;
    width: 36px; height: 36px;
    place-items: center;
    border-radius: 50%;
    color: var(--brand);
    background: var(--brand-light);
    font-family: Georgia, serif;
    font-weight: 700;
}
.reference-link strong, .reference-link small { display: block; }
.reference-link strong { font-size: 13px; }
.reference-link small { color: var(--muted); font-size: 11px; }
.safety-banner {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid #ead8a7;
    border-radius: 13px;
    color: #70521a;
    background: #fffaf0;
    font-size: 13px;
}
.safety-banner strong { margin-right: 4px; }

.analysis-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.panel {
    min-width: 0;
    border: 1px solid rgba(21, 63, 58, .11);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.input-panel { position: sticky; top: 166px; padding: 24px; }
.result-panel { min-height: 650px; padding: 24px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.character-count { color: var(--muted); font-size: 12px; }
.character-count.near-limit { color: var(--danger); font-weight: 700; }
textarea {
    width: 100%;
    min-height: 238px;
    resize: vertical;
    padding: 17px;
    border: 1px solid #cbd7d3;
    border-radius: 15px;
    color: var(--ink);
    background: #fbfcfb;
    line-height: 1.6;
    transition: border-color .2s, box-shadow .2s;
}
textarea::placeholder { color: #8c9996; }
textarea:focus { border-color: #568078; box-shadow: 0 0 0 4px rgba(58, 116, 102, .1); outline: none; }
textarea:disabled { opacity: .7; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 12px 0 22px; }
.examples > span { margin-right: 2px; color: var(--muted); font-size: 11px; }
.examples button {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #435652;
    background: var(--surface-soft);
    cursor: pointer;
    font-size: 11px;
}
.examples button:hover { border-color: #8da9a1; }
.mode-fieldset { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.mode-fieldset legend { margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-option {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafcfb;
    cursor: pointer;
}
.mode-option.selected { border-color: #517c72; background: #edf6f3; box-shadow: inset 0 0 0 1px #517c72; }
.mode-option input { width: 15px; height: 15px; margin: 0 9px 0 0; accent-color: var(--brand); }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { font-size: 11px; }
.mode-option small { color: var(--muted); font-size: 9px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 17px;
    border: 0;
    border-radius: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { color: white; background: var(--brand); box-shadow: 0 10px 24px rgba(21, 63, 58, .2); }
.button-primary:hover { background: #0e332f; }
.button-secondary { border: 1px solid var(--line); color: var(--brand); background: white; }
.button:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }
.analyze-button { width: 100%; justify-content: space-between; }
.transient-note { margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.inline-error { margin: -8px 0 12px; color: var(--danger); font-size: 12px; font-weight: 600; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state, .loading-state, .error-state { display: flex; min-height: 500px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.empty-state h3, .loading-state h3, .error-state h3 { margin-bottom: 7px; font-size: 20px; }
.empty-state p, .loading-state p, .error-state p { max-width: 410px; color: var(--muted); }
.empty-illustration { position: relative; width: 150px; height: 125px; margin-bottom: 20px; }
.document-shape {
    position: absolute; left: 18px; top: 8px; width: 75px; height: 98px;
    border: 2px solid #a9bcb6; border-radius: 12px; background: #f4f8f6;
}
.document-shape::before, .document-shape::after { content: ""; position: absolute; left: 14px; right: 14px; height: 4px; border-radius: 3px; background: #ccdad6; }
.document-shape::before { top: 24px; box-shadow: 0 15px #ccdad6, 0 30px #ccdad6; }
.route-line { position: absolute; left: 80px; top: 58px; width: 54px; height: 38px; border-top: 2px dashed var(--accent); border-right: 2px dashed var(--accent); border-radius: 0 20px 0 0; }
.route-dot { position: absolute; width: 12px; height: 12px; border: 3px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.route-dot.one { left: 74px; top: 52px; }
.route-dot.two { right: 8px; bottom: 23px; }
.loading-orbit { position: relative; width: 72px; height: 72px; margin-bottom: 20px; border: 2px solid #dce9e5; border-radius: 50%; }
.loading-orbit::before { content: ""; position: absolute; inset: 10px; border: 2px solid #a8c4bc; border-radius: 50%; }
.loading-orbit span { position: absolute; left: 28px; top: 28px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .55; } }
.skeleton { width: 100%; height: 13px; margin-top: 16px; border-radius: 8px; background: linear-gradient(90deg, #eef2f0 25%, #f9fbfa 50%, #eef2f0 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton.short { width: 62%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state-icon { display: grid; width: 54px; height: 54px; margin-bottom: 16px; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-bg); font-size: 24px; font-weight: 700; }

.status-badge, .count-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}
.status-combined { color: #255e50; background: #dff0ea; }
.status-ai { color: #43598a; background: #e8ecf8; }
.status-rules { color: #445d56; background: #e9efed; }
.status-warning { color: #805b13; background: #fff0c9; }
.api-disclosure-region { min-width: 0; margin-top: 22px; }
.api-disclosure {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(21, 63, 58, .14);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.api-disclosure > summary {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
}
.api-disclosure > summary::-webkit-details-marker { display: none; }
.api-disclosure > summary::after {
    content: "+";
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--brand);
    background: var(--brand-light);
    font-size: 20px;
    font-weight: 700;
}
.api-disclosure[open] > summary::after { content: "−"; }
.api-disclosure-summary-copy { min-width: 0; }
.api-disclosure-summary-copy strong,
.api-disclosure-summary-copy small { display: block; }
.api-disclosure-summary-copy strong { font-size: 16px; }
.api-disclosure-summary-copy small { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
.api-operation-status {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    color: #37534c;
    background: #edf2f0;
    font-size: 10px;
    font-weight: 700;
}
.api-operation-status--implemented { color: #255e50; background: #dff0ea; }
.api-operation-status--target { color: #725518; background: #fff0c9; }
.api-disclosure-body { display: grid; gap: 16px; padding: 0 22px 22px; border-top: 1px solid var(--line); }
.api-current-operation,
.api-target-operation { min-width: 0; margin-top: 20px; padding: 20px; border-radius: 18px; }
.api-current-operation { border: 1px solid #c7dfd8; background: #f7fbf9; }
.api-target-operation { border: 1px dashed #d9bf7e; background: #fffbf1; }
.api-operation-heading { display: flex; min-width: 0; align-items: start; justify-content: space-between; gap: 16px; }
.api-operation-heading h3 { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 19px; }
.api-operation-lead { max-width: 900px; color: #405550; }
.api-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.api-detail-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.api-detail-grid h4,
.api-policy h4 { margin: 0 0 7px; font-size: 13px; }
.api-detail-grid p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.api-detail-grid ul,
.api-policy ul { margin: 8px 0 0; padding-left: 18px; color: #405550; font-size: 12px; }
.api-detail-grid li + li,
.api-policy li + li { margin-top: 5px; }
.api-code {
    max-width: 100%;
    margin: 10px 0 0;
    overflow-x: auto;
    padding: 14px;
    border: 1px solid #d5dedb;
    border-radius: 11px;
    color: #e9f4f1;
    background: #173632;
    scrollbar-width: thin;
}
.api-code code { white-space: pre; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.api-mode-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 !important; list-style: none; }
.api-mode-list li { margin: 0 !important; }
.api-mode-list code { display: inline-block; padding: 5px 8px; border-radius: 8px; color: var(--brand); background: var(--brand-light); font-size: 11px; }
.api-policy { margin-top: 16px; padding: 15px 17px; border-left: 4px solid var(--accent); border-radius: 10px; background: #fffaf0; }
.api-target-operation > p { max-width: 850px; color: #66562f; }
.api-target-list { display: grid; gap: 8px; margin-top: 14px; }
.api-target-item { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid #eadbb7; border-radius: 11px; background: #fff; }
.api-target-item span { color: #725518; font-size: 10px; font-weight: 700; }
.api-target-item code { min-width: 0; overflow-wrap: anywhere; text-align: right; font-size: 12px; }
.review-notice { display: flex; gap: 11px; margin-bottom: 18px; padding: 13px; border: 1px solid #c7dfd8; border-radius: 13px; background: #f0f8f5; }
.review-notice > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 12px; }
.review-notice p { margin: 0; }
.review-notice strong, .review-notice small { display: block; }
.review-notice strong { font-size: 12px; }
.review-notice small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.result-section { padding: 18px 0; border-top: 1px solid var(--line); }
.result-section:first-of-type { border-top: 0; }
.result-section h3 { margin-bottom: 15px; font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1.25; }
.result-section h4 { margin-bottom: 12px; font-size: 13px; }
.confidence-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 11px; }
.confidence-track { height: 7px; overflow: hidden; border-radius: 10px; background: #e7ecea; }
.confidence-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d2a33a, #39806f); }
.confidence-note { margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.result-alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 11px; }
.result-alert strong { display: block; margin-bottom: 3px; }
.result-alert ul { margin: 5px 0 0; padding-left: 17px; }
.result-alert.warning { border: 1px solid #ecd49a; color: #735217; background: var(--warning-bg); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; }
.count-badge { color: var(--brand); background: var(--brand-light); }
.issue-list { display: grid; gap: 8px; }
.issue-item { display: flex; gap: 11px; padding: 11px; border-radius: 12px; background: var(--surface-soft); }
.issue-index { display: grid; flex: 0 0 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--brand); background: white; font-size: 10px; font-weight: 700; }
.issue-item strong, .issue-item small { display: block; }
.issue-item strong { font-size: 11px; }
.issue-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.route-card { display: flex; gap: 12px; padding: 14px; border: 1px solid #bfd6cf; border-radius: 14px; background: #f2f8f6; }
.route-symbol { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border-radius: 10px; color: white; background: var(--brand); }
.route-card strong { font-size: 12px; }
.route-card p, .route-empty p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.route-empty { padding: 14px; border: 1px dashed #b9c8c4; border-radius: 13px; }
.assignment-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.assignment-list span { padding: 5px 8px; border-radius: 8px; background: white; font-size: 9px; }
.missing-list { display: grid; gap: 7px; }
.missing-list article { display: flex; gap: 10px; padding: 10px; border-radius: 11px; background: #fff8e9; }
.missing-list article > span { display: grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; color: #805c17; background: #f5dfac; font-weight: 700; }
.missing-list strong { font-size: 10px; }
.missing-list p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.reference-evidence > p { margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.evidence-group { margin-top: 10px; }
.evidence-group > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.code-links { display: flex; flex-wrap: wrap; gap: 6px; }
.code-links a { padding: 5px 8px; border-radius: 8px; color: var(--brand); background: var(--brand-light); font-family: ui-monospace, monospace; font-size: 9px; text-decoration: none; }
.evidence-group.cited .code-links a { color: white; background: var(--success); }
.technical-details { margin-top: 6px; border-top: 1px solid var(--line); font-size: 10px; }
.technical-details summary { padding: 14px 0; color: var(--muted); cursor: pointer; }
.technical-details dl { margin: 0; padding: 0 0 10px; }
.technical-details dl div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; }
.technical-details dt { color: var(--muted); }
.technical-details dd { margin: 0; text-align: right; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-heading h1 { margin-bottom: 12px; }
.reference-explainer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.reference-explainer article { display: flex; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.64); }
.reference-explainer article > span { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 9px; color: white; background: var(--brand); font-size: 11px; font-weight: 700; }
.reference-explainer strong { font-size: 11px; }
.reference-explainer p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.catalog-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.catalog-meta span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 10px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reference-card {
    display: flex;
    min-height: 230px;
    padding: 20px;
    flex-direction: column;
    border: 1px solid rgba(21, 63, 58, .12);
    border-radius: 18px;
    background: white;
    box-shadow: 0 10px 30px rgba(33, 63, 56, .06);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.reference-card:hover { transform: translateY(-3px); border-color: #9cb3ad; box-shadow: 0 16px 38px rgba(33, 63, 56, .1); }
.reference-rubric { align-self: flex-start; padding: 5px 8px; border-radius: 8px; color: var(--brand); background: var(--brand-light); font-size: 9px; font-weight: 700; }
.reference-card h2 { margin: 16px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.2; }
.reference-card p { color: var(--muted); font-size: 11px; }
.reference-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--success); font-size: 9px; font-weight: 700; }
.reference-card code { overflow: hidden; color: var(--muted); text-overflow: ellipsis; font-size: 8px; }
.skeleton-card { pointer-events: none; }
.state-card { max-width: 680px; margin: 50px auto; padding: 42px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); text-align: center; }
.state-card.error-state { min-height: 360px; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--brand); }
.reference-detail { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.reference-detail > header { padding: 38px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f5f9f7, #fffaf0); }
.reference-detail > header h1 { max-width: 800px; margin: 18px 0 12px; font-size: clamp(34px, 5vw, 54px); }
.reference-detail > header p { max-width: 760px; color: var(--muted); font-size: 15px; }
.reference-detail > header code { color: var(--muted); font-size: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 9px; }
.detail-meta .approved { border-color: #b9d8cd; color: var(--success); background: #eff8f5; }
.reference-body { display: grid; grid-template-columns: 1.5fr .75fr; gap: 30px; padding: 38px; }
.markdown-content { max-width: 760px; }
.markdown-content h2 { margin-bottom: 16px; font-family: Georgia, "Times New Roman", serif; font-size: 26px; }
.markdown-content p { color: #354744; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.75; }
.reference-aside { display: grid; align-content: start; gap: 10px; }
.reference-aside section { padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.reference-aside h2 { margin-bottom: 7px; font-size: 11px; }
.reference-aside p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-section { padding: 30px 38px; border-top: 1px solid var(--line); }
.detail-section > h2 { margin-bottom: 16px; font-size: 17px; }
.required-data-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.required-data-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 13px; }
.required-data-grid span { color: var(--success); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.required-data-grid h3 { margin: 7px 0 4px; font-size: 12px; }
.required-data-grid p { margin: 0; color: var(--muted); font-size: 9px; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; }
.detail-columns .detail-section + .detail-section { border-left: 1px solid var(--line); }
.detail-section ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; }
.detail-section li + li { margin-top: 7px; }
.danger-section { background: #fffaf9; }
.loading-detail { min-height: 500px; padding: 40px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.direction-preview,
.directions-overview {
    display: grid;
    gap: 24px;
}
.direction-preview__hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 36px;
    padding: 38px;
    border: 1px solid rgba(21, 63, 58, .12);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 90% 10%, rgba(201, 156, 56, .14), transparent 22rem),
        linear-gradient(135deg, #fff, #f3f7f5);
    box-shadow: var(--shadow);
}
.direction-preview__hero > div { min-width: 0; max-width: 820px; }
.direction-preview__hero h1 {
    margin-top: 15px;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-size: clamp(34px, 4.6vw, 56px);
}
.direction-preview__hero .button {
    max-width: 100%;
    flex: 0 0 auto;
    white-space: normal;
    text-align: center;
}
.direction-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.direction-status--available { color: #215d4d; background: #e1f1eb; }
.direction-status--preview { color: #765515; background: #fff0c9; }
.direction-status--future { color: #53635f; background: #e9efed; }
.direction-status--loading { color: #53635f; background: #e9efed; }
.direction-status--unavailable { color: #7a3f39; background: #fff0ee; }
.preview-notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 17px 19px;
    border: 1px solid #ead7a3;
    border-radius: 16px;
    color: #664b17;
    background: var(--warning-bg);
}
.preview-notice--neutral {
    border-color: #c6d8d3;
    color: var(--ink);
    background: #f0f7f5;
}
.preview-notice__icon {
    display: grid;
    flex: 0 0 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    color: white;
    background: var(--warning);
    font-family: Georgia, serif;
    font-weight: 700;
}
.preview-notice--neutral .preview-notice__icon { background: var(--brand); }
.preview-notice strong { font-size: 13px; }
.preview-notice p { max-width: 900px; margin: 3px 0 0; color: inherit; font-size: 11px; }
.direction-preview__grid,
.profile-principles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.direction-preview__grid article,
.profile-principles article {
    display: flex;
    min-width: 0;
    min-height: 225px;
    padding: 20px;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: white;
    box-shadow: 0 10px 30px rgba(33, 63, 56, .05);
}
.preview-card__step,
.profile-principles article > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    color: var(--brand);
    background: var(--brand-light);
    font-size: 10px;
    font-weight: 800;
}
.direction-preview__grid h2,
.profile-principles h2 {
    margin: 18px 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.2;
}
.direction-preview__grid p,
.profile-principles p {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
}
.preview-card__state {
    align-self: flex-start;
    margin-top: auto;
    padding: 5px 8px;
    border-radius: 8px;
    color: #765515;
    background: #fff4d7;
    font-size: 8px;
    font-weight: 700;
}
.direction-boundary {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 34px;
    padding: 28px;
    border-radius: 19px;
    color: white;
    background: var(--brand);
}
.direction-boundary h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; line-height: 1.2; }
.direction-boundary .eyebrow { color: #b9d9d0; }
.direction-boundary ul { margin: 0; padding-left: 20px; color: #dcebe7; font-size: 12px; }
.direction-boundary li + li { margin-top: 8px; }
.profile-principles { margin-top: -6px; }
.direction-roadmap {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 12px;
}
.direction-roadmap > div {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: white;
}
.direction-roadmap h2 { margin: 16px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.direction-roadmap p { margin: 0; color: var(--muted); font-size: 11px; }
.direction-roadmap p strong { color: #314b45; }
.direction-roadmap__action { display: inline-flex; gap: 6px; margin-top: 16px; color: var(--brand); font-size: 11px; font-weight: 800; text-decoration: none; }
.direction-roadmap__action:hover { text-decoration: underline; text-underline-offset: 3px; }
.direction-roadmap__arrow { align-self: center; color: #91a49f; font-size: 24px; }
.profile-catalog-problem { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #e1b8b2; border-radius: 14px; color: #7a3f39; background: #fff7f6; font-size: 12px; }

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    left: 18px;
    padding: 14px 44px 14px 16px;
    border-radius: 12px;
    color: #6b271f;
    background: #ffe9e6;
    box-shadow: var(--shadow);
    font-size: 12px;
}
#blazor-error-ui .dismiss { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }

@media (max-width: 980px) {
    .profile-switcher {
        display: block;
        padding: 9px 0 11px;
    }
    .profile-switcher__intro { display: none; }
    .input-panel { top: 151px; }
    .analysis-grid { grid-template-columns: 1fr; }
    .input-panel { position: static; }
    .result-panel { min-height: 520px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reference-body { grid-template-columns: 1fr; }
    .direction-preview__hero { display: block; }
    .direction-preview__hero .button { margin-top: 24px; }
    .direction-preview__grid,
    .profile-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .site-header { min-height: 66px; padding: 9px 14px; }
    .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
    .brand strong { font-size: 13px; }
    .brand small { display: none; }
    .profile-switcher {
        width: 100%;
        padding: 7px 12px 9px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .profile-switcher::-webkit-scrollbar { display: none; }
    .profile-switcher__items {
        display: flex;
        width: max-content;
    }
    .profile-switcher__item {
        width: 155px;
        flex: 0 0 155px;
    }
    .profile-switcher__problem {
        width: calc(100% - 24px);
        justify-content: flex-start;
        margin-top: -2px;
    }
    .site-main { width: min(100% - 24px, 1280px); padding: 30px 0 44px; }
    .hero { display: block; margin-bottom: 20px; }
    h1 { font-size: 38px; }
    .hero-copy, .page-heading > div > p { font-size: 14px; }
    .reference-link { width: 100%; min-width: 0; margin-top: 20px; }
    .analysis-grid { gap: 12px; }
    .panel { border-radius: 18px; }
    .input-panel, .result-panel { padding: 17px; }
    .result-panel { min-height: 460px; }
    textarea { min-height: 210px; }
    .mode-options { grid-template-columns: 1fr 1fr; }
    .mode-option { padding: 9px; }
    .api-disclosure > summary { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
    .api-disclosure > summary .api-operation-status { order: 3; }
    .api-disclosure-body { padding: 0 12px 12px; }
    .api-current-operation,
    .api-target-operation { padding: 15px; }
    .api-operation-heading { display: block; }
    .api-operation-heading .api-operation-status { display: inline-block; margin-top: 10px; }
    .api-detail-grid { grid-template-columns: 1fr; }
    .api-target-item { align-items: flex-start; flex-direction: column; }
    .api-target-item code { text-align: left; }
    .empty-state, .loading-state, .error-state { min-height: 380px; }
    .confidence-row { grid-template-columns: 1fr auto; }
    .confidence-row > span:first-child { grid-column: 1 / -1; }
    .site-footer { display: grid; justify-items: center; text-align: center; }
    .site-footer span + span::before { display: none; }
    .page-heading { display: block; }
    .page-heading .button { margin-top: 18px; }
    .reference-explainer { grid-template-columns: 1fr; }
    .catalog-grid { grid-template-columns: 1fr; }
    .reference-card { min-height: 205px; }
    .reference-detail > header, .reference-body, .detail-section { padding: 23px 19px; }
    .required-data-grid, .detail-columns { grid-template-columns: 1fr; }
    .detail-columns .detail-section + .detail-section { border-left: 0; }
    .markdown-content p { font-size: 16px; }
    .state-card { padding: 28px 18px; }
    .direction-preview__hero { padding: 25px 19px; }
    .direction-preview__hero h1 { font-size: 32px; }
    .direction-preview__hero .button { width: 100%; }
    .direction-preview__grid,
    .profile-principles { grid-template-columns: 1fr; }
    .direction-preview__grid article,
    .profile-principles article { min-height: 190px; }
    .direction-boundary { grid-template-columns: 1fr; gap: 18px; padding: 23px 19px; }
    .direction-boundary h2 { font-size: 24px; }
    .direction-roadmap { grid-template-columns: 1fr; }
    .direction-roadmap__arrow { justify-self: center; transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Archive database demonstration */
.archive-demo { display: grid; gap: 20px; }
.archive-demo__hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding: 26px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(135deg, #fff 0%, #f4f8f7 100%); }
.archive-demo__hero h1 { max-width: 760px; margin: 6px 0 10px; }
.direction-status--available { color: #176b4d; background: #e8f7f0; border: 1px solid #b9e5d2; }
.archive-demo__warning, .archive-demo__error, .archive-demo__notice, .archive-demo__progress { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 13px; }
.archive-demo__warning { background: #fff8e8; border: 1px solid #efd99f; color: #654c12; }
.archive-demo__error { background: #fff0ee; border: 1px solid #e7b9b4; color: #7b2921; }
.archive-demo__notice { background: #eaf6f1; border: 1px solid #b9ddcf; color: #225d4b; }
.archive-demo__notice span { flex: 1; }
.archive-demo__progress { background: #eef4f8; border: 1px solid #cbdce7; color: #315465; }
.archive-demo__progress > span { width: 10px; height: 10px; border: 2px solid #89a7b7; border-top-color: #315465; border-radius: 50%; animation: archive-spin .8s linear infinite; }
@keyframes archive-spin { to { transform: rotate(360deg); } }
.archive-demo__error span { flex: 1; }
.archive-demo__error button { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; }
.archive-demo__workspace { display: grid; grid-template-columns: minmax(240px,.78fr) minmax(340px,1.25fr) minmax(280px,1fr); gap: 16px; align-items: stretch; }
.archive-panel { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(25,46,42,.06); }
.archive-panel h2, .archive-db h2, .archive-audit h2 { margin: 3px 0 16px; font-size: 18px; }
.archive-help, .archive-draft-heading span, .archive-search-result span { color: var(--muted); font-size: 13px; }
.archive-help { margin: 10px 0 0; }
.archive-empty { display: grid; place-items: center; min-height: 180px; padding: 16px; text-align: center; color: var(--muted); background: #f8faf9; border: 1px dashed var(--border); border-radius: 12px; }
.archive-empty > span { font-size: 28px; }
.archive-draft-heading { display: grid; gap: 5px; margin-bottom: 12px; }
.archive-operation { width: fit-content; padding: 3px 8px; border-radius: 999px; color: #275f51 !important; background: #e8f5f1; font-weight: 700; }
.archive-change-list { display: grid; gap: 9px; max-height: 300px; overflow: auto; padding-right: 4px; }
.archive-change { padding: 10px; background: #f8faf9; border-left: 3px solid #6a9d90; border-radius: 7px; }
.archive-change > div { display: flex; justify-content: space-between; gap: 8px; }
.archive-change p { margin: 7px 0; }
.archive-change small { display: block; color: var(--muted); line-height: 1.4; }
.archive-inline-warning { padding: 9px; color: #684b0d; background: #fff7df; border-radius: 8px; font-size: 13px; }
.archive-processing-result { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0 0 16px; }
.archive-processing-result > div { padding: 12px; background: #eef6f3; border: 1px solid #cde0da; border-radius: 11px; }
.archive-processing-result dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.archive-processing-result dd { margin: 5px 0 0; color: #234a40; font-weight: 800; line-height: 1.35; }
.archive-auto-complete { display: grid; gap: 6px; padding: 16px; color: #185b43; background: #e7f6ef; border: 1px solid #b8dfcf; border-radius: 12px; }
.archive-auto-complete strong { font-size: 16px; }
.archive-auto-complete small { color: #3d6d5d; }
.archive-review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.archive-panel label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.archive-search-box { display: flex; gap: 8px; }
.archive-search-box input { min-width: 0; flex: 1; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.archive-query-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.archive-query-examples button { padding: 4px 9px; color: #315e54; background: #edf5f2; border: 0; border-radius: 999px; cursor: pointer; }
.archive-search-result { display: grid; gap: 7px; margin-top: 12px; padding: 12px; background: #f2f7ff; border: 1px solid #cad9ed; border-radius: 11px; }
.archive-search-result article { display: grid; gap: 2px; padding-top: 7px; border-top: 1px solid #d8e3ef; }
.archive-search-result code { overflow-wrap: anywhere; font-size: 12px; }
.archive-search-result small { color: #6b4f12; }
.archive-db { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: #f6f8f8; }
.archive-db > header, .archive-audit > div { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.archive-db__version { white-space: nowrap; padding: 6px 10px; color: #315e54; background: #e6f1ed; border-radius: 999px; font-size: 13px; font-weight: 700; }
.archive-db__legend { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.archive-table-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.archive-table-card { min-width: 0; overflow: hidden; border: 1px solid #d8dfdd; border-radius: 14px; background: #fff; }
.archive-table-card > header { display: flex; justify-content: space-between; gap: 8px; padding: 11px 13px; color: #fff; background: #263f3a; }
.archive-table-card > header span { opacity: .72; font-size: 12px; }
.archive-table-card__rows { display: grid; }
.archive-db-row { display: grid; gap: 4px; padding: 10px 12px; border-top: 1px solid #e7ecea; transition: background .25s ease, box-shadow .25s ease; }
.archive-db-row:first-child { border-top: 0; }
.archive-db-row > span { color: #52625e; font-size: 13px; overflow-wrap: anywhere; }
.archive-db-row__id { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.archive-db-row--Added { background: #e9f8ef; box-shadow: inset 4px 0 #2d8c5a; }
.archive-db-row--Updated { background: #fff5df; box-shadow: inset 4px 0 #d88a16; }
.archive-db-row--Read { background: #eaf3ff; box-shadow: inset 4px 0 #397ac1; }
.archive-db-row--Relation { background: #f3edff; box-shadow: inset 4px 0 #7757b0; }
.trace-badge { display: inline-flex; align-items: center; width: fit-content; gap: 3px; padding: 3px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.trace-badge--Added { color: #17643d; background: #dff4e7; }
.trace-badge--Updated { color: #794b08; background: #ffedc5; }
.trace-badge--Read { color: #245b99; background: #dfeeff; }
.trace-badge--Relation { color: #604298; background: #eae0fa; }
.archive-audit { display: grid; grid-template-columns: minmax(240px,.6fr) minmax(0,1.4fr); gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.archive-audit ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.archive-audit li { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; padding: 9px 11px; background: #f7f9f8; border-radius: 9px; font-size: 13px; }
.archive-audit li span { color: #315e54; font-weight: 700; }
.archive-audit time { color: var(--muted); }
.archive-loading { padding: 32px; text-align: center; color: var(--muted); }

@media (max-width: 1050px) {
    .archive-demo__workspace { grid-template-columns: 1fr 1fr; }
    .archive-panel--search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .archive-demo__hero { flex-direction: column; }
    .archive-demo__workspace, .archive-table-grid, .archive-audit { grid-template-columns: 1fr; }
    .archive-panel--search { grid-column: auto; }
    .archive-search-box { flex-direction: column; }
    .archive-audit li { grid-template-columns: 1fr; }
    .archive-table-card > header { align-items: flex-start; flex-direction: column; }
}

/* Paper appeal: scan → verified text → Appeal → Core recommendation → human decision */
.scenario-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 18px 0 24px;
    padding: 22px 24px;
    border: 1px solid #cadbd5;
    border-radius: 16px;
    background: linear-gradient(135deg, #f4faf7 0%, #eef5f2 100%);
}

.scenario-callout h2,
.scenario-callout p { margin: 0; }
.scenario-callout h2 { margin-bottom: 6px; font-size: 21px; }
.scenario-callout p:last-child { color: var(--muted); line-height: 1.55; }
.scenario-callout .button { flex: 0 0 auto; }
.scenario-callout__availability { max-width: 300px; padding: 10px 12px; border-radius: 12px; color: #66531e !important; background: #fff5d8; font-size: 11px; font-weight: 750; }

.paper-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 20px;
}

.paper-hero h1 { max-width: 900px; margin: 4px 0 12px; font-size: clamp(40px, 5vw, 64px); line-height: 1.02; }
.paper-hero p:last-child { max-width: 850px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.paper-loading { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.paper-loading h2, .paper-loading p { margin: 0; }
.paper-loading p { margin-top: 4px; color: var(--muted); }
.paper-boundary-note { max-width: 680px; padding: 12px 14px; background: #f4f6f5; border-radius: 8px; }

.paper-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.paper-progress li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 11px 12px;
    color: #6d7773;
    background: #f1f3f2;
    border-radius: 10px;
    font-size: 13px;
}

.paper-progress li span {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid #bfc8c4;
    border-radius: 50%;
    background: white;
}

.paper-progress li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-progress li.is-complete { color: #245e50; background: #e5f2ed; }
.paper-progress li.is-complete span { color: white; border-color: #397768; background: #397768; }

.inline-operation-error {
    display: flex;
    align-items: baseline;
    gap: 8px 14px;
    margin-bottom: 18px;
    padding: 13px 16px;
    color: #763d33;
    border-left: 4px solid #b75c4c;
    border-radius: 8px;
    background: #fff1ee;
}

.inline-operation-error small { margin-left: auto; }
.paper-source,
.paper-gate,
.paper-appeal-card,
.paper-recommendation,
.paper-decision,
.paper-audit,
.paper-confirmed-text { margin-top: 20px; }
.paper-source,
.paper-gate { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.paper-source h2, .paper-source p, .paper-gate h2, .paper-gate p { margin: 0; }
.paper-source p:last-child, .paper-gate p:last-child { margin-top: 5px; color: var(--muted); }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 28px 0 14px;
}

.section-heading h2, .section-heading p { margin: 0; }
.section-heading > p, .section-heading > span { color: var(--muted); font-size: 14px; }
.paper-pages { display: grid; gap: 18px; }

.paper-page-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 24px rgba(35, 56, 50, .05);
}

.paper-page-card.is-complete { border-color: #a9cec1; }
.paper-page-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.paper-page-card h3 { margin: 2px 0 0; font-size: 18px; }
.paper-page-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.confidence-chip { padding: 5px 9px; border-radius: 999px; color: #34443f; background: #edf1ef; font-size: 13px; font-weight: 700; }

.paper-compare {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(340px, 1.1fr);
    gap: 20px;
    padding: 20px;
    background: #fafbf9;
}

.paper-scan { margin: 0; }
.paper-scan img { display: block; width: 100%; max-height: 470px; object-fit: contain; border: 1px solid #d3d6d2; border-radius: 10px; background: #e9e7df; }
.paper-scan figcaption { margin-top: 7px; color: var(--muted); font-size: 12px; }
.paper-ocr { display: flex; flex-direction: column; }
.paper-ocr label, .paper-review-actions label, .paper-decision-form label { color: #34443f; font-size: 13px; font-weight: 700; }
.paper-ocr textarea { flex: 1; min-height: 210px; margin-top: 7px; padding: 14px; resize: vertical; line-height: 1.6; }
.paper-ocr small { margin-top: 7px; color: var(--muted); }

.paper-review-actions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 18px 20px;
}
.paper-review-actions label { display: grid; gap: 7px; }
.paper-review-actions input { min-height: 42px; padding: 9px 11px; }
.paper-review-actions > div { display: flex; flex-wrap: wrap; gap: 9px; }
.paper-review-complete { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 15px 20px; color: #245e50; background: #eaf5f1; }
.paper-review-complete small { margin-left: auto; color: #557068; }

.paper-gate { border-left: 5px solid #b8c3bf; }
.paper-gate.is-ready { border-left-color: #397768; background: #f5faf8; }
.paper-confirmed-text summary { cursor: pointer; color: #315f53; font-weight: 700; }
.paper-confirmed-text p { margin: 14px 0 0; white-space: pre-line; line-height: 1.65; }
.paper-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.paper-meta div { padding: 12px; border-radius: 9px; background: #f5f7f6; }
.paper-meta dt { color: var(--muted); font-size: 12px; }
.paper-meta dd { overflow-wrap: anywhere; margin: 5px 0 0; font-weight: 700; }

.paper-recommendation { border-left: 5px solid #5979b7; }
.paper-recommendation-summary { margin: 4px 0 16px; font-size: 17px; line-height: 1.55; }
.paper-evidence-list { display: grid; gap: 8px; padding-left: 22px; line-height: 1.5; }
.paper-warning { display: grid; gap: 4px; margin: 16px 0; padding: 13px 15px; color: #6a511a; border-radius: 9px; background: #fff6dc; }

.paper-decision { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 28px; border-left: 5px solid #397768; }
.paper-decision h2, .paper-decision p { margin: 0; }
.paper-decision p:last-child { margin-top: 6px; color: var(--muted); }
.paper-decision-form { display: grid; gap: 13px; }
.paper-decision-form label { display: grid; gap: 7px; }
.paper-decision-form select,
.paper-decision-form textarea { min-height: 43px; padding: 10px 11px; }
.paper-decision-form textarea { min-height: 90px; resize: vertical; }
.paper-human-result { display: grid; align-content: center; justify-items: start; gap: 8px; padding: 18px; border-radius: 12px; background: #edf6f2; }
.paper-human-result p { margin: 0; }

.paper-audit ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.paper-audit li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.paper-audit li:first-child { border-top: 0; }
.paper-audit-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #397768; box-shadow: 0 0 0 4px #e5f2ed; }
.paper-audit p { margin: 3px 0; color: #475651; line-height: 1.45; }
.paper-audit small { color: var(--muted); }

@media (max-width: 900px) {
    .paper-progress { grid-template-columns: 1fr; }
    .paper-progress li strong { white-space: normal; }
    .paper-compare,
    .paper-decision { grid-template-columns: 1fr; }
    .paper-review-actions { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .scenario-callout,
    .paper-hero,
    .paper-source,
    .paper-gate,
    .section-heading,
    .paper-page-card > header { align-items: stretch; flex-direction: column; }
    .scenario-callout .button,
    .scenario-callout__availability,
    .paper-hero .button,
    .paper-gate .button { width: 100%; }
    .hero-actions { display: grid; }
    .hero-actions .button { width: 100%; }
    .profile-catalog-problem { align-items: stretch; flex-direction: column; }
    .paper-page-badges { justify-content: flex-start; }
    .paper-compare, .paper-page-card > header, .paper-review-actions { padding: 14px; }
    .paper-review-actions > div { display: grid; }
    .paper-review-actions .button { width: 100%; }
    .paper-review-complete { align-items: flex-start; flex-direction: column; }
    .paper-review-complete small { margin-left: 0; }
    .paper-meta { grid-template-columns: 1fr; }
    .inline-operation-error { align-items: flex-start; flex-direction: column; }
    .inline-operation-error small { margin-left: 0; }
    .paper-hero h1 { font-size: 32px; line-height: 1.06; }
}

.archive-workspaces { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.archive-workspaces button { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; padding: 13px; text-align: left; color: inherit; background: #f7f9f8; border: 1px solid var(--border); border-radius: 13px; cursor: pointer; }
.archive-workspaces button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; color: #315e54; background: #e5f0ec; border-radius: 10px; font-weight: 800; }
.archive-workspaces button small { color: var(--muted); }
.archive-workspaces button.is-active { border-color: #347c69; background: #edf7f3; box-shadow: 0 5px 16px rgba(36,92,77,.1); }
.archive-flow-summary { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.archive-flow-summary span { white-space: nowrap; padding: 5px 9px; color: var(--muted); background: #f4f6f5; border-radius: 999px; font-size: 12px; font-weight: 700; }
.archive-flow-summary span.is-current { color: #fff; background: #315e54; }
.archive-flow-summary span.is-done { color: #225d4b; background: #dff1ea; }
.archive-flow-summary span.is-done::before { content: "✓ "; }
.archive-digitization { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(360px,1.35fr) minmax(260px,.85fr); gap: 16px; }
.archive-document-card { display: grid; gap: 4px; width: 100%; margin-bottom: 8px; padding: 11px; text-align: left; color: inherit; background: #f8faf9; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.archive-document-card.is-selected { border-color: #337c69; background: #ebf6f2; box-shadow: inset 3px 0 #337c69; }
.archive-document-card small { color: var(--muted); }
.archive-library__heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; align-items: baseline; }
.archive-library__heading h2 { margin-bottom: 8px; }
.archive-library__heading span { color: var(--muted); font-size: 12px; font-weight: 700; }
.archive-library__toggle { width: 100%; margin: 2px 0 12px; padding: 9px 11px; color: #315e54; background: #edf5f2; border: 1px solid #c7d9d3; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 800; }
.archive-library__toggle:hover { background: #e3f0eb; }
.archive-library__toggle:focus-visible, .archive-document-card:focus-visible { outline: 3px solid #8bb9aa; outline-offset: 2px; }
.archive-file-kind { width: fit-content; padding: 2px 6px; color: #315e54; background: #e4efeb; border-radius: 5px; font-size: 10px; font-weight: 800; }
.archive-upload-placeholder { display: grid; place-items: center; gap: 4px; padding: 16px; text-align: center; color: var(--muted); border: 1px dashed #aebbb7; border-radius: 10px; }
.archive-upload-placeholder > span { font-size: 24px; }
.archive-upload-placeholder > .archive-future-badge { padding: 3px 7px; color: #6b5421; background: #fff1c9; border-radius: 999px; font-size: 11px; font-weight: 800; }
.archive-safe-intake { display: grid; gap: 10px; margin-top: 14px; padding: 15px; color: var(--text); background: #f5f9f7; border: 1px dashed #8ead9f; border-radius: 10px; }
.archive-safe-intake p, .archive-safe-intake small { margin: 0; color: var(--muted); }
.archive-safe-intake .archive-future-badge { justify-self: start; padding: 3px 7px; color: #315e54; background: #dff1ea; border-radius: 999px; font-size: 11px; font-weight: 800; }
.archive-sample-links { display: flex; flex-wrap: wrap; gap: 8px; }
.archive-sample-download--rejected { color: #8a3030; border-color: #d7a0a0; background: #fff7f7; }
.archive-sample-download--technical { color: #765018; border-color: #d8bd86; background: #fffaf0; }
.archive-intake-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.archive-intake-stages li { padding: 8px 10px; color: var(--muted); background: #f3f5f4; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 750; text-align: center; }
.archive-intake-stages li.is-done, .archive-intake-stages li.is-ready { color: #245b4c; background: #e5f4ed; border-color: #9bc6b5; }
.archive-intake-stages li.is-rejected { color: #842d2d; background: #fff0f0; border-color: #d9a0a0; }
.archive-intake-stages li.is-technical { color: #735510; background: #fff8dd; border-color: #d7bf71; }
.archive-intake-rejection { display: grid; gap: 4px; padding: 10px 12px; color: #752626; background: #fff0f0; border-left: 4px solid #b64545; border-radius: 7px; }
.archive-intake-rejection span { color: #752626; }
.archive-intake-technical { display: grid; gap: 4px; padding: 10px 12px; color: #61490d; background: #fff8dd; border-left: 4px solid #b58b22; border-radius: 7px; }
.archive-intake-technical span { color: #61490d; }
.archive-sample-download { color: #176853; font-weight: 800; }
.archive-file-picker { display: grid; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-weight: 800; }
.archive-file-picker input { width: 100%; font: inherit; font-weight: 500; }
.archive-selected-upload { overflow-wrap: anywhere; }
.archive-upload-confirmation { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 13px; line-height: 1.4; }
.archive-upload-confirmation input { margin-top: 3px; }
.archive-intake-result { display: grid; gap: 5px; padding: 11px; color: #205c4d; background: #e8f5ef; border: 1px solid #a9cfbf; border-radius: 8px; font-size: 12px; }
.archive-intake-result ul { margin: 3px 0 0; padding-left: 18px; }
.archive-intake-journal { display: grid; gap: 10px; margin-top: 4px; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.archive-intake-journal > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; }
.archive-intake-journal h3 { margin: 2px 0 3px; font-size: 16px; }
.archive-intake-journal > header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.archive-intake-journal > header .button { margin: 0; padding: 7px 9px; font-size: 12px; }
.archive-intake-journal__empty { display: grid; gap: 3px; padding: 10px; color: #52615e; background: #f3f6f5; border-radius: 8px; font-size: 12px; }
.archive-intake-journal__list { display: grid; gap: 8px; }
.archive-intake-journal__item { display: grid; gap: 7px; min-width: 0; padding: 10px; background: #f8faf9; border: 1px solid #dbe4e1; border-left: 4px solid #889792; border-radius: 8px; }
.archive-intake-journal__item--Ready { border-left-color: #318064; }
.archive-intake-journal__item--Rejected { border-left-color: #b64a42; }
.archive-intake-journal__item--TechnicalError { border-left-color: #bd862d; }
.archive-intake-journal__item--Checking { border-left-color: #477b91; }
.archive-intake-journal__item > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; align-items: flex-start; }
.archive-intake-journal__item > header div { display: grid; gap: 2px; min-width: 0; }
.archive-intake-journal__item code { overflow-wrap: anywhere; font-size: 11px; }
.archive-intake-journal__status { display: inline-flex; width: fit-content; padding: 4px 7px; color: #40514c; background: #e8edeb; border-radius: 999px; font-size: 11px; font-weight: 800; }
.archive-intake-journal__status--Ready { color: #225d4b; background: #dff1ea; }
.archive-intake-journal__status--Rejected { color: #7b2921; background: #ffe2df; }
.archive-intake-journal__status--TechnicalError { color: #714e08; background: #fff0c2; }
.archive-intake-journal__status--Checking { color: #315465; background: #e5f0f5; }
.archive-intake-journal__item dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 9px; margin: 0; }
.archive-intake-journal__item dl div { min-width: 0; }
.archive-intake-journal__item dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.archive-intake-journal__item dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.archive-intake-journal__item p { margin: 0; font-size: 12px; line-height: 1.4; }
.archive-intake-journal__item small { color: var(--muted); line-height: 1.4; }
.archive-file-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.archive-file-meta span, .archive-file-meta code { padding: 4px 7px; background: #eef3f1; border-radius: 6px; font-size: 11px; }
.archive-document-page { min-height: 310px; padding: 28px 32px; background: #fffdf7; border: 1px solid #dfd8c5; border-radius: 6px; box-shadow: 0 7px 20px rgba(54,44,22,.08); }
.archive-page-label { display: block; margin-bottom: 18px; color: #7b6d4c; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.archive-document-page p { white-space: pre-line; font-family: Georgia,serif; font-size: 17px; line-height: 1.8; }
.archive-viewer__notice { margin: 0 0 10px; padding: 9px 11px; color: #62511e; background: #fff8e5; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.archive-viewer__notice--ready { color: #315e54; background: #eaf5f1; }
.archive-ocr-board { padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.archive-ocr-board > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.archive-ocr-board h2 { margin: 3px 0 0; font-size: 20px; }
.archive-ocr-pages { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; padding: 10px 12px; background: #edf5f2; border: 1px solid #cfe0da; border-radius: 10px; }
.archive-ocr-pages > div { display: flex; flex-wrap: wrap; gap: 7px; }
.archive-ocr-pages button { padding: 7px 11px; color: #315e54; background: #fff; border: 1px solid #b9d0c8; border-radius: 8px; font-weight: 750; cursor: pointer; }
.archive-ocr-pages button.is-active { color: #fff; background: #315e54; border-color: #315e54; }
.archive-ocr-anchor { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 0 0 12px; padding: 9px 11px; color: #3d514b; background: #f8faf9; border-left: 3px solid #c89a34; font-size: 13px; }
.archive-ocr-anchor span { color: var(--muted); }
.archive-ocr-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.archive-ocr-panel { min-width: 0; padding: 14px; background: #f8faf9; border: 1px solid #dbe4e1; border-radius: 12px; }
.archive-ocr-panel__heading { display: flex; gap: 9px; align-items: center; margin-bottom: 12px; }
.archive-ocr-panel__heading > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; color: #fff; background: #315e54; border-radius: 9px; font-weight: 800; }
.archive-ocr-panel__heading div { display: grid; gap: 2px; }
.archive-ocr-panel__heading small, .archive-ocr-panel > small { color: var(--muted); line-height: 1.4; }
.archive-ocr-image-stage { position: relative; overflow: hidden; background: #d8d3c6; border: 1px solid #b9b1a0; border-radius: 7px; }
.archive-ocr-panel img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; }
.archive-ocr-region { position: absolute; border: 3px solid #c64035; background: rgba(255, 224, 84, .16); box-shadow: 0 0 0 2px rgba(255,255,255,.7); pointer-events: none; }
.archive-ocr-image-error { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 260px; padding: 18px; text-align: center; color: #7b2921; background: #fff0ee; border: 1px solid #e7b9b4; border-radius: 8px; }
.archive-ocr-panel code { display: block; margin-top: 9px; overflow-wrap: anywhere; font-size: 11px; }
.archive-ocr-text { min-height: 150px; margin: 0 0 10px; padding: 12px; white-space: pre-line; background: #fff; border: 1px solid #dbe4e1; border-radius: 8px; line-height: 1.6; }
.archive-ocr-confidence { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.archive-ocr-status { display: inline-flex; width: fit-content; margin-bottom: 9px; padding: 4px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.archive-ocr-status--warning { color: #714e08; background: #fff0c2; }
.archive-ocr-status--draft { color: #315465; background: #e8f1f6; }
.archive-ocr-status--success { color: #225d4b; background: #dff1ea; }
.archive-review-queue { padding: 20px; background: #f6f8f8; border: 1px solid var(--border); border-radius: 18px; }
.archive-review-queue > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; }
.archive-review-queue > header h2 { margin: 3px 0 6px; }
.archive-review-queue > header p { max-width: 720px; margin: 0; color: var(--muted); }
.archive-review-queue__summary { display: flex; flex-wrap: wrap; gap: 7px; }
.archive-review-queue__summary span { padding: 7px 10px; color: #315e54; background: #e7f1ee; border-radius: 9px; font-size: 12px; }
.archive-review-queue__notice { display: grid; gap: 3px; margin: 14px 0; padding: 11px 13px; color: #5e4a1b; background: #fff6dd; border: 1px solid #ecd8a2; border-radius: 10px; }
.archive-review-queue__notice span { font-size: 13px; }
.archive-review-queue__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.archive-review-task { display: grid; gap: 11px; min-width: 0; padding: 15px; background: #fff; border: 1px solid #d8e1de; border-radius: 14px; }
.archive-review-task--InProgress { border-color: #d1aa57; box-shadow: inset 4px 0 #d1aa57; }
.archive-review-task--Completed { border-color: #9ecdbb; background: #f4fbf8; box-shadow: inset 4px 0 #3b8b70; }
.archive-review-task > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.archive-review-task > header > div { display: flex; flex-wrap: wrap; gap: 6px; }
.archive-review-task h3, .archive-review-task p { margin: 0; }
.archive-priority, .archive-review-status { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.archive-priority--High { color: #7b2921; background: #ffe2df; }
.archive-priority--Normal { color: #315465; background: #e5f0f5; }
.archive-review-status--Unassigned { color: #52615e; background: #edf0ef; }
.archive-review-status--InProgress { color: #714e08; background: #fff0c2; }
.archive-review-status--Completed { color: #225d4b; background: #dff1ea; }
.archive-review-task dl { display: grid; gap: 6px; margin: 0; }
.archive-review-task dl div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.archive-review-task dt { color: var(--muted); font-size: 12px; }
.archive-review-task dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.archive-review-task__reason { padding: 9px 10px; color: #614a16; background: #fff8e6; border-left: 3px solid #d3a84e; font-size: 13px; line-height: 1.45; }
.archive-review-task label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.archive-review-task select, .archive-review-task textarea { width: 100%; padding: 9px 10px; border: 1px solid #aebbb7; border-radius: 8px; font: inherit; }
.archive-review-task textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.archive-review-task__result { display: grid; gap: 4px; padding: 10px 11px; color: #225d4b; background: #e3f4ed; border-radius: 9px; }
.archive-review-task__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.archive-review-task__actions .button { margin: 0; }
.archive-review-board { padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.archive-review-board > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.archive-review-board h2 { margin: 3px 0 14px; font-size: 19px; }
.archive-source-badge { width: fit-content; padding: 5px 9px; color: #714e08; background: #fff2ca; border-radius: 999px; font-size: 12px; font-weight: 700; }
.archive-plan-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.archive-plan-header > span:last-child { color: #52615e; font-size: 12px; font-weight: 700; }
.archive-plan-summary { margin: 10px 0 12px; color: #34433f; }
.archive-task-list { display: grid; gap: 12px; margin: 12px 0; }
.archive-search-task { padding: 12px; border: 1px solid #c9d5d1; border-radius: 12px; background: #fff; }
.archive-search-task.needs-clarification { border-color: #d8ad55; background: #fffaf0; }
.archive-search-task > header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.archive-search-task > header label { display: flex; gap: 8px; align-items: center; }
.archive-search-task > header > span { color: #52615e; font-size: 12px; font-weight: 700; }
.archive-search-task > p { margin: 8px 0; color: #3d4d49; line-height: 1.4; }
.archive-clarification { margin: 8px 0; padding: 8px 10px; color: #714e08; background: #fff0c2; border-radius: 8px; font-size: 13px; font-weight: 700; }
.archive-edit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.archive-edit-card { display: grid; gap: 7px; padding: 12px; background: #f8faf9; border: 1px solid #e0e7e4; border-radius: 10px; }
.archive-edit-card > div { display: flex; justify-content: space-between; gap: 8px; }
.archive-edit-card > input { width: 100%; padding: 9px 10px; border: 1px solid #aebbb7; border-radius: 8px; font: inherit; }
.archive-transcription-editor { width: 100%; min-height: 130px; padding: 10px; resize: vertical; border: 1px solid #aebbb7; border-radius: 8px; font: inherit; line-height: 1.5; }
.archive-edit-card small { color: var(--muted); line-height: 1.4; }
.archive-review-summary { margin: 12px 0 0; padding: 10px 12px; color: #315e54; background: #edf6f3; border-radius: 9px; font-size: 13px; }
.archive-edit-toggle { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; }
.archive-request-layout, .archive-request-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.archive-request-layout textarea { width: 100%; min-height: 220px; margin: 6px 0 12px; padding: 12px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; font: inherit; line-height: 1.55; }
.archive-term-list { display: grid; gap: 8px; margin: 12px 0; }
.archive-term-list label { display: grid; grid-template-columns: auto 110px 1fr; gap: 8px; align-items: center; padding: 7px; background: #f7f9f8; border-radius: 8px; }
.archive-term-list label > input:last-child { min-width: 0; padding: 7px; border: 1px solid #bdc8c5; border-radius: 7px; }
.archive-term-list label > small { grid-column: 2 / -1; color: #65736f; }
.archive-task-results { display: grid; gap: 8px; margin: 10px 0 14px; }
.archive-task-results article { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px; border: 1px solid #c8d7d2; border-radius: 10px; background: #f4faf7; }
.archive-task-results article.no-results { border-color: #d8ad55; background: #fff9ea; }
.archive-task-results article span { font-size: 13px; font-weight: 700; }
.archive-task-results article small { grid-column: 1 / -1; color: #714e08; }
.archive-result-card { display: grid; gap: 6px; margin-bottom: 9px; padding: 12px; border: 1px solid #dce5e2; border-radius: 10px; }
.archive-result-card > div { display: flex; justify-content: space-between; gap: 8px; color: #315e54; font-size: 12px; }
.archive-result-card h3, .archive-result-card p { margin: 0; }
.archive-result-card code { overflow-wrap: anywhere; color: var(--muted); }
.archive-access-state { display: grid !important; justify-content: stretch !important; gap: 2px !important; padding: 7px 9px; border-radius: 8px; }
.archive-access-state.is-open { color: #315e54; background: #e7f1ee; }
.archive-access-state.is-restricted { color: #7a4d16; background: #fff4df; border: 1px solid #efd29f; }
.archive-access-state span { line-height: 1.35; }
.archive-access-warning { color: #7a4d16; font-weight: 700; }
.archive-access-notice { display: grid; gap: 3px; margin: 10px 0; padding: 10px 12px; color: #6d4515; background: #fff4df; border: 1px solid #efd29f; border-radius: 9px; }
.archive-search-summary { padding: 9px 11px; color: #315e54; background: #edf6f3; border-radius: 9px; font-size: 13px; }
.archive-result-explanation { color: var(--muted); line-height: 1.45; }
.archive-result-actions { display: flex !important; flex-wrap: wrap; justify-content: flex-start !important; gap: 7px !important; }
.archive-result-card button, .archive-response-package article button { width: fit-content; padding: 5px 8px; color: #315e54; background: #e7f1ee; border: 0; border-radius: 7px; cursor: pointer; }
.archive-result-card button:disabled { color: #5f6f6a; background: #edf0ef; cursor: default; }
.archive-response-package article { display: grid; gap: 4px; margin-bottom: 8px; padding: 10px; background: #f7f9f8; border-radius: 9px; }
.archive-response-package article code { overflow-wrap: anywhere; font-size: 11px; }
.archive-package-summary { display: grid; gap: 4px; margin-top: 12px; padding: 12px; color: #315e54; background: #eaf5f1; border-radius: 10px; }
.archive-package-summary .button { margin-top: 8px; color: #fff; background: #315e54; }
.archive-package-confirmed { display: grid; gap: 4px; margin-top: 10px; padding: 12px; color: #225d4b; background: #e4f5ed; border: 1px solid #b9ddcf; border-radius: 10px; }
.archive-material-preview { padding: 20px; background: #fff; border: 1px solid #b9cec7; border-radius: 16px; box-shadow: 0 8px 28px rgba(25,46,42,.07); }
.archive-material-preview > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.archive-material-preview h2 { margin: 3px 0 14px; }
.archive-material-preview > header button { padding: 6px 9px; color: #315e54; background: #edf5f2; border: 0; border-radius: 8px; cursor: pointer; }
.archive-table-card > header small { display: block; opacity: .72; font-size: 10px; }
.archive-db .archive-audit { margin-top: 16px; }
.archive-db__explanation { display: grid; gap: 5px; margin-bottom: 14px; padding: 12px 14px; color: #344a44; background: #eef5f2; border-left: 4px solid #5b9182; border-radius: 9px; }
.archive-db__explanation p { margin: 0; line-height: 1.5; }
.archive-empty--compact { min-height: 96px; border: 0; border-radius: 0; }

@media (max-width: 1050px) {
    .archive-digitization { grid-template-columns: 1fr 1.4fr; }
    .archive-panel--action { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .archive-workspaces, .archive-digitization, .archive-edit-grid, .archive-processing-result, .archive-request-layout, .archive-request-results, .archive-ocr-grid, .archive-review-queue__grid, .archive-intake-stages { grid-template-columns: 1fr; }
    .archive-intake-journal__item dl { grid-template-columns: 1fr; }
    .archive-panel--action { grid-column: auto; }
    .archive-review-board > header { flex-direction: column; }
    .archive-material-preview > header { flex-direction: column; }
    .archive-document-page { min-height: 220px; padding: 20px; }
    .archive-term-list label { grid-template-columns: auto 1fr; }
    .archive-term-list label > input:last-child { grid-column: 1 / -1; }
    .archive-review-task dl div { grid-template-columns: 1fr; gap: 2px; }
}

/* Catalog 1A */
.api-catalog-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
}
.api-catalog-hero > div:first-child { max-width: 790px; }
.api-catalog-hero h1 { margin-bottom: 14px; }
.api-catalog-legend {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px 15px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 700;
}
.api-catalog-legend span { display: inline-flex; align-items: center; gap: 6px; }
.api-catalog-dot { width: 8px; height: 8px; border-radius: 50%; }
.api-catalog-dot--implemented { background: var(--success); }
.api-catalog-dot--target { background: var(--accent); }
.api-catalog-guidance {
    margin-bottom: 20px;
    padding: 14px 17px;
    border: 1px solid #c8d9d4;
    border-left: 4px solid #5b9182;
    border-radius: 13px;
    color: #344a44;
    background: #eef5f2;
    font-size: 13px;
}
.api-catalog-guidance strong { margin-right: 4px; }
.api-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.api-catalog-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(21, 63, 58, .13);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(26, 55, 49, .07);
}
.api-catalog-card--target {
    border-color: #dec888;
    background: linear-gradient(145deg, #fffdf7 0%, #fff9e9 100%);
}
.api-catalog-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.api-catalog-card__header > div { min-width: 0; }
.api-catalog-card__header h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.api-catalog-direction {
    margin: 0;
    color: var(--success);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.api-catalog-status {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}
.api-catalog-status--implemented { color: #205f4f; background: #e2f1ec; }
.api-catalog-status--target { color: #76550f; background: #ffedba; }
.api-catalog-description { margin: 13px 0 16px; color: var(--muted); font-size: 13px; }
.api-catalog-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}
.api-catalog-facts > div { min-width: 0; padding: 10px 11px; background: #fafcfb; }
.api-catalog-facts > div:nth-child(even) { border-left: 1px solid var(--line); }
.api-catalog-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.api-catalog-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.api-catalog-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.api-catalog-operations { margin-top: 17px; }
.api-catalog-operations h3 { margin-bottom: 9px; font-size: 12px; }
.api-catalog-operations ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.api-catalog-operations li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 3px 8px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #e1e8e5;
    border-radius: 10px;
    background: #fbfcfb;
}
.api-method {
    align-self: start;
    padding: 2px 4px;
    border-radius: 5px;
    text-align: center;
    font: 800 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.api-method--get { color: #205f4f; background: #e2f1ec; }
.api-method--post { color: #694c0e; background: #fff0c8; }
.api-path-scroll { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.api-path-scroll code { display: block; width: max-content; min-width: 100%; color: #263b36; font-size: 10px; line-height: 1.6; white-space: nowrap; }
.api-catalog-operations small { grid-column: 2; color: var(--muted); font-size: 10px; }
.api-catalog-scenario-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}
.api-catalog-scenario-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.api-catalog-no-action { margin: 16px 0 0; color: #76550f; font-size: 11px; font-weight: 750; }

@media (max-width: 900px) {
    .api-catalog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .site-header { gap: 12px; }
    .product-nav a { min-height: 36px; padding: 7px 9px; font-size: 11px; }
    .api-catalog-hero { display: block; }
    .api-catalog-legend { width: fit-content; margin-top: 16px; }
    .api-catalog-card { padding: 16px; border-radius: 16px; }
    .api-catalog-card__header { display: block; }
    .api-catalog-status { display: inline-block; margin-top: 9px; white-space: normal; }
    .api-catalog-facts { grid-template-columns: 1fr; }
    .api-catalog-facts > div:nth-child(even) { border-left: 0; }
    .api-catalog-facts > div:nth-child(n+2) { border-top: 1px solid var(--line); }
}

@media (max-width: 420px) {
    .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
    .brand strong { font-size: 14px; }
    .brand small { font-size: 9px; }
}

/* Developer Contract Pack 4C */
.api-catalog-scenario-link--guide { color: #76550f; }
.api-guide-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.api-guide-breadcrumb a { color: var(--brand); font-weight: 800; text-underline-offset: 3px; }
.api-guide-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.api-guide-hero > div:first-child { max-width: 820px; }
.api-guide-hero h1 { margin-bottom: 12px; }
.api-guide-hero p:last-child { margin: 0; color: var(--muted); }
.api-guide-badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.api-guide-badges span { padding: 6px 9px; border-radius: 999px; color: #76550f; background: #ffedba; font-size: 10px; font-weight: 800; }
.api-guide-boundary { display: grid; gap: 5px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid #dec888; border-left: 5px solid var(--accent); border-radius: 14px; background: #fff9e9; color: #5f502c; font-size: 12px; }
.api-guide-boundary strong { color: #4f3e16; font-size: 13px; }
.api-guide-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.api-guide-facts article { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.api-guide-facts article > code { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.api-guide-facts article > small { grid-column: 2; color: var(--muted); font-size: 9px; }
.api-guide-facts article > strong { color: var(--brand); font-size: 10px; }
.api-guide-section { min-width: 0; margin-top: 20px; padding: 22px; border: 1px solid rgba(21, 63, 58, .13); border-radius: 20px; background: var(--surface); box-shadow: 0 14px 38px rgba(26, 55, 49, .06); }
.api-guide-section-heading { max-width: 880px; margin-bottom: 17px; }
.api-guide-section-heading h2 { margin: 2px 0 7px; font-size: 23px; line-height: 1.25; }
.api-guide-section-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.api-guide-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.api-guide-flow li { display: flex; gap: 10px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf9; }
.api-guide-flow li > span { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: 10px; font-weight: 800; }
.api-guide-flow strong { display: block; font-size: 11px; }
.api-guide-flow p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.api-guide-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.api-guide-code-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.api-guide-code-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.api-guide-code-card h3 { margin: 1px 0 0; font-size: 15px; }
.api-copy-button { min-height: 36px; padding: 7px 11px; border: 1px solid #b9cec8; border-radius: 9px; color: var(--brand); background: #eef5f2; font-size: 10px; font-weight: 800; cursor: pointer; }
.api-copy-button:hover { background: var(--brand-light); }
.api-guide-code { max-width: 100%; max-height: 520px; margin: 12px 0 0; overflow: auto; padding: 14px; border: 1px solid #294e48; border-radius: 11px; color: #e9f4f1; background: #173632; scrollbar-width: thin; }
.api-guide-code code { white-space: pre; font: 11px/1.55 "Cascadia Code", Consolas, monospace; }
.api-copy-status { min-height: 30px; margin: 8px 1px 0; color: var(--muted); font-size: 9px; }
.api-copy-status--error { color: var(--danger); font-weight: 700; }
.api-guide-example-list, .api-guide-field-groups { display: grid; gap: 10px; }
.api-guide-example, .api-guide-field-group { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfb; }
.api-guide-example > summary, .api-guide-field-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; cursor: pointer; list-style: none; }
.api-guide-example > summary::-webkit-details-marker, .api-guide-field-group > summary::-webkit-details-marker { display: none; }
.api-guide-example > summary span { min-width: 0; }
.api-guide-example > summary strong, .api-guide-example > summary small { display: block; }
.api-guide-example > summary strong { font-size: 12px; }
.api-guide-example > summary small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.api-guide-example > summary em, .api-guide-field-group > summary span { flex: 0 0 auto; color: #76550f; font-size: 9px; font-style: normal; font-weight: 800; }
.api-guide-example > .api-guide-code-card { margin: 0 12px 12px; }
.api-guide-table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.api-guide-table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; font-size: 10px; }
.api-guide-table th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; color: #344a44; background: #edf3f0; text-align: left; font-size: 9px; }
.api-guide-table td { max-width: 290px; padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.api-guide-table code { overflow-wrap: anywhere; color: #294e48; font-size: 9px; }
.api-guide-field-group > .api-guide-table-scroll { margin: 0 12px 12px; }
.api-guide-field-table { min-width: 1500px; }
.api-guide-next { margin: 20px 0 0; padding: 18px; border-radius: 16px; color: #eaf4f1; background: var(--brand); }
.api-guide-next strong { font-size: 14px; }
.api-guide-next p { margin: 5px 0 10px; color: #c9dcd7; font-size: 11px; }
.api-guide-next a { font-size: 11px; font-weight: 800; text-underline-offset: 3px; }

@media (max-width: 980px) {
    .api-guide-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .api-guide-code-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .api-guide-hero { display: block; }
    .api-guide-badges { justify-content: flex-start; margin-top: 14px; }
    .api-guide-facts { grid-template-columns: 1fr; }
    .api-guide-section { padding: 15px; border-radius: 16px; }
    .api-guide-flow { grid-template-columns: 1fr; }
    .api-guide-example > summary, .api-guide-field-group > summary { align-items: flex-start; }
    .api-guide-example > summary { display: block; }
    .api-guide-example > summary em { display: inline-block; margin-top: 7px; }
    .api-guide-code-card > header { align-items: flex-start; }
}
