:root {
    --bg-canvas: #f5f7fa;
    --bg-veil: linear-gradient(180deg, #f9fafc 0%, #f5f7fa 44%, #eef2f6 100%);
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-strong: #0f172a;
    --surface-glass: rgba(255, 255, 255, 0.92);
    --border: #dce2ea;
    --border-strong: #aeb8c5;
    --text: #101828;
    --text-muted: #526070;
    --text-subtle: #8a96a8;
    --brand: #244260;
    --brand-hover: #182f49;
    --brand-soft: #eef3f8;
    --brand-ring: rgba(36, 66, 96, 0.16);
    --brand-2: #2f587f;
    --brand-3: #536173;
    --success: #2f6f57;
    --success-soft: #edf7f2;
    --warning: #b45309;
    --warning-soft: #fdf3e2;
    --danger: #b91c1c;
    --danger-soft: #fbeaea;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 56px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg-canvas);
    background-image: var(--bg-veil);
    background-attachment: fixed;
    line-height: 1.45;
    - webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    letter-spacing: -0.015em;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell > .app-main {
    flex: 1 1 auto;
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0 1.1rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.93) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.app-navbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.app-navbar .brand img {
    height: 22px;
    filter: brightness(0) invert(1);
}

.app-navbar .brand .brand-sub {
    color: #ccd9e8;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-left: 1px solid rgba(190, 208, 229, 0.34);
    padding-left: 0.8rem;
    font-weight: 600;
}

.app-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.app-nav li {
    display: inline-flex;
}

.app-nav .nav-divider {
    flex: 1;
}

.app-nav .nav-link {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #cfdded;
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: 160ms ease;
}

.app-nav .nav-link:hover {
    color: #f5fbff;
    border-color: rgba(163, 190, 220, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.app-nav .nav-link.active {
    color: #ffffff;
    border-color: rgba(200, 205, 210, 0.35);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.app-nav .nav-link.nav-secondary {
    color: #a6bdd8;
}

.nav-user-slot {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nav-user {
    font-size: 0.82rem;
    font-weight: 500;
    color: #cfdded;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(200, 215, 235, 0.18);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-main {
    width: min(1320px, calc(100% - 2rem));
    margin: 1.25rem auto 2.5rem;
    animation: page-enter 320ms ease-out;
}

.workspace-toolbar {
    position: sticky;
    top: 58px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.55rem 1rem;
    margin: 0.65rem auto 0;
    width: min(1320px, calc(100% - 2rem));
    border: 1px solid rgba(190, 194, 200, 0.5);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 249, 250, 0.94) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.toolbar-title {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.toolbar-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.toolbar-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 0.34rem 0.72rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: 140ms ease;
}

.toolbar-chip:hover {
    border-color: var(--border-strong);
    background: #f5f6f7;
    color: var(--text);
}

.toolbar-chip.active {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.toolbar-chip.toolbar-chip-secondary {
    color: var(--text-muted);
}

.page-shell {
    background: var(--surface-glass);
    border: 1px solid rgba(188, 206, 225, 0.58);
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.analyst-mode {
    --table-cell-pad-y: 0.42rem;
    --table-cell-pad-x: 0.66rem;
}

.analyst-mode .form-panel {
    padding: 1rem;
    margin-bottom: 1.05rem;
}

.analyst-mode .form-panel .mb-3 {
    margin-bottom: 0.8rem !important;
}

.analyst-mode .page-subtitle {
    margin-bottom: 1rem;
}

.page-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    margin: 0 0 1.4rem;
    font-size: 0.94rem;
    color: var(--text-muted);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(120deg, #244260 0%, #1f2f43 58%, #111827 100%);
    color: #f1f5fb;
    box-shadow: var(--shadow-lg);
}

.hero-panel::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    right: -120px;
    top: -160px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.hero-logo {
    position: relative;
    margin-bottom: 1.2rem;
}

.hero-logo img {
    height: 38px;
    /* invert dark text/icon to white for the dark hero background */
    filter: brightness(0) invert(1);
}

.hero-title {
    position: relative;
    margin: 0 0 0.7rem;
    font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.5rem);
    font-weight: 700;
    max-width: 800px;
}

.hero-subtitle {
    position: relative;
    margin: 0;
    max-width: 780px;
    color: rgba(239, 247, 255, 0.88);
    font-size: 0.98rem;
}

.hero-metrics {
    position: relative;
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.hero-metric {
    border: 1px solid rgba(200, 200, 200, 0.2);
    background: rgba(30, 33, 38, 0.45);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    color: #d5d8dc;
}

.feature-card {
    display: block;
    height: 100%;
    text-decoration: none;
    border: 1px solid #d7dee8;
    border-radius: var(--radius);
    padding: 1.3rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: #9aa7b8;
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.09);
}

.feature-card .feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    background: #344054;
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.12);
}

/* Action-tile icon palette - distinct, lifted tones in the Authority-Blue family.
   Tool-card icons (compact secondary lists) stay calm and uniform. */
.feature-icon.icon-brand {
    background: #1e3e60;
    box-shadow: 0 8px 18px rgba(30, 62, 96, 0.30);
}

.feature-icon.icon-primary {
    background: #2f6694;
    box-shadow: 0 8px 18px rgba(47, 102, 148, 0.28);
}

.feature-icon.icon-slate {
    background: #3a8898;
    box-shadow: 0 8px 18px rgba(58, 136, 152, 0.28);
}

.feature-icon.icon-success {
    background: #4a7d6e;
    box-shadow: 0 8px 18px rgba(74, 125, 110, 0.28);
}

.tool-card-icon.icon-brand { background: #263746; }
.tool-card-icon.icon-primary { background: #1f4e79; }
.tool-card-icon.icon-slate { background: #475467; }
.tool-card-icon.icon-success { background: #3d665f; }

.feature-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.03rem;
    color: var(--text);
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    background: linear-gradient(180deg, #fefefe 0%, #f7f8f9 100%);
}

.card-body {
    padding: 1.1rem;
}

.form-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
    max-width: 800px;
    margin-bottom: 1.4rem;
}

.form-panel .form-label {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-panel .form-control {
    border-radius: 10px;
    border-color: var(--border);
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.54rem 0.8rem;
}

.form-panel .form-control:focus {
    border-color: var(--text-subtle);
    box-shadow: 0 0 0 4px rgba(60, 64, 67, 0.1);
}

.vt-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

.vt-group-label:first-child {
    margin-top: 0;
}

.vt-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.vt-chip {
    /* button reset */
    - webkit-appearance: none;
    appearance: none;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    /* chip style */
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: #fafafa;
    line-height: 1.3;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.vt-chip:hover {
    border-color: var(--border-strong);
    background: #f0f1f2;
    color: var(--text);
}

.vt-chip.is-selected {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.vt-chip.is-selected:hover {
    background: var(--brand-hover);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
}

.vt-chip.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.vt-chips-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 0.3rem;
}

.validation-selected-count {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.validation-options-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.validation-quick-action {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 0.26rem 0.75rem;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    letter-spacing: 0.02em;
    line-height: 1.2;
    cursor: pointer;
    transition: 140ms ease;
}

.validation-quick-action:hover {
    border-color: var(--border-strong);
    background: #f0f1f2;
    color: var(--text);
}

/* ── Validator wizard ───────────────────────────────────────────── */
.validator-header {
    max-width: 920px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.7rem 0.9rem;
    margin-bottom: 0.85rem;
}

.validator-header .page-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.45rem;
    color: var(--text);
}

.validator-header .page-title svg {
    color: var(--text);
}

.validator-header .page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.vx-stepper {
    max-width: 920px;
    margin-bottom: 0.75rem;
    padding: 0.45rem 0.6rem;
}

.vx-stepper .rg-step {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
}

.vx-stepper .rg-step-num {
    width: 19px;
    height: 19px;
    font-size: 0.68rem;
}

.wizard {
    max-width: 920px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.wiz-step-compact .wiz-step-head,
.wiz-step-compact .wiz-step-body { display: none; }

.wiz-collapsed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
}

.wiz-collapsed-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.wiz-collapsed-num {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2e5e3a;
    background: #e5ede7;
    border: 1px solid #b5ccba;
}

.wiz-collapsed-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.wiz-collapsed-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wiz-collapsed-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiz-step {
    background: linear-gradient(180deg, #ffffff 0%, #fafcfe 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.wiz-step:hover { border-color: var(--border-strong); }

.wiz-step-head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.05rem 1.3rem 0.85rem;
    border-bottom: 1px solid #ebedef;
}

.wiz-step-num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-weight: 700;
    font-size: 0.86rem;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.22);
}

.wiz-step-title {
    margin: 0 0 0.18rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
}

.wiz-step-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.wiz-step-body {
    padding: 0.8rem 1rem;
}

.flow-panels {
    display: grid;
    gap: 0.85rem;
}

.flow-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

#vx-step-3.flow-panel {
    margin-top: 0.85rem;
}

.flow-panel.is-active {
    border-color: #7aa7d9;
    box-shadow: 0 10px 24px rgba(36, 78, 122, 0.11);
}

.flow-panel.is-complete:not(.is-active) {
    border-color: #bfd5c5;
}

.flow-panel.is-locked {
    opacity: 0.72;
}

.flow-panel-summary {
    display: grid;
    grid-template-columns: 32px minmax(120px, 0.28fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid transparent;
}

.flow-panel[open] > .flow-panel-summary {
    border-bottom-color: #edf0f2;
}

.flow-panel-summary::-webkit-details-marker { display: none; }
.flow-panel-summary::marker { content: ""; }

.flow-panel-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    color: #344054;
    background: #eef2f6;
    border: 1px solid #d6dde5;
}

.flow-panel.is-complete .flow-panel-mark {
    color: #24633b;
    background: #e7f3ea;
    border-color: #aacbb4;
}

.flow-panel-title {
    min-width: 0;
    font-weight: 700;
    color: var(--text);
}

.flow-panel-result {
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flow-panel-empty {
    padding: 0.9rem 1rem 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    background: #fbfcfd;
}

.flow-panel > .eb-content,
.flow-panel > .rg-facts-layout,
.flow-panel > .wiz-step-body {
    margin-top: 0;
}

@media (max-width: 720px) {
    .flow-panel-summary {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .flow-panel-result {
        grid-column: 2;
        white-space: normal;
    }
}

/* File drop zone */
.file-drop {
    position: relative;
    display: block;
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(180deg, #fbfcfd 0%, #f5f7fa 100%);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.file-drop:hover,
.file-drop:focus-within {
    border-color: var(--brand);
    background: #f4f7fb;
    box-shadow: 0 0 0 4px rgba(36, 99, 235, 0.08);
}

.file-drop.has-file {
    border-style: solid;
    border-color: var(--border);
    padding: 0.6rem 0.75rem;
    background: #ffffff;
}

.file-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-empty {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.file-drop-icon {
    flex: 0 0 auto;
    color: var(--brand);
    opacity: 0.85;
    transition: transform 160ms ease, opacity 160ms ease;
}

.file-drop:hover .file-drop-icon {
    opacity: 1;
    transform: translateY(-2px);
}

.file-drop-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
}

.file-drop-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.file-drop-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-drop-formats {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: var(--text-subtle);
    letter-spacing: 0.04em;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    padding: 0.35rem 0.65rem;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 999px;
    white-space: nowrap;
}

.file-drop-filled {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.4rem 0.5rem;
    pointer-events: none;
}

.file-badge {
    flex: 0 0 auto;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    letter-spacing: 0.05em;
    color: #fff;
    background: var(--brand);
    min-width: 56px;
    text-align: center;
}

.file-badge.kind-inline { background: var(--text-muted); }
.file-badge.kind-zip { background: var(--text-subtle); }

.file-meta { flex: 1 1 auto; min-width: 0; }

.file-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-type {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.file-change {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    text-transform: uppercase;
}

.file-drop:hover .file-change {
    border-color: var(--border-strong);
    background: #f0f1f2;
    color: var(--text);
}

/* Validation option groups - compact horizontal layout */
.vt-group {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #ebedef;
}

.vt-group:first-child { padding-top: 0.15rem; }
.vt-group:last-child { border-bottom: none; padding-bottom: 0.15rem; }

.vt-group.vt-group-disabled .vt-group-head { opacity: 0.45; }

.vt-group-head {
    flex: 0 0 150px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-top: 0.4rem;
}

.vt-group-head .vt-group-label {
    margin: 0;
    font-size: 0.7rem;
}

.vt-group .vt-chips-row {
    flex: 1 1 auto;
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .vt-group { flex-direction: column; gap: 0.35rem; }
    .vt-group-head { flex: 0 0 auto; padding-top: 0; }
}

.vt-group-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.vt-group-dot.c-primary { background: var(--brand); }
.vt-group-dot.c-violet  { background: var(--text-muted); }
.vt-group-dot.c-teal    { background: var(--text-subtle); }
.vt-group-dot.c-orange  { background: #a0a5ab; }
.vt-group-dot.c-slate   { background: #c5c9cf; }

/* Footer action bar */
.wiz-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 0.5rem;
    z-index: 5;
}

.wiz-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem;
    background: #f0f1f2;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
}

.wiz-summary-count {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.wiz-summary-label {
    font-size: 0.78rem;
    color: var(--text);
    font-weight: 600;
}

.wiz-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ghost {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 140ms ease;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--border-strong);
    background: #f5f6f7;
    color: var(--text);
}

.btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-validate {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-validate svg { transition: transform 160ms ease; }
.btn-validate:hover:not(:disabled) svg { transform: translateX(3px); }

@media (max-width: 640px) {
    .wiz-footer { flex-direction: column; align-items: stretch; gap: 0.7rem; }
    .wiz-actions { justify-content: flex-end; flex-wrap: wrap; }
    .validator-hero { flex-direction: column; gap: 0.6rem; }
}

/* Chip style applied to the old sidebar HTML structure */
.validation-picker {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.validation-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.validation-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.validation-sidebar-item {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 0.55rem 1.3rem;
    cursor: pointer;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: #fafafa;
    line-height: 1.3;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.validation-sidebar-item:hover {
    border-color: var(--border-strong);
    background: #f0f1f2;
    color: var(--text);
}

.validation-sidebar-item.is-selected {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.validation-sidebar-item.is-selected:hover {
    background: var(--brand-hover);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
}

.validation-option-input {
    display: none;
}

.validation-option-hint {
    font-size: 0.76rem;
    color: var(--text-subtle);
    margin-top: 0.2rem;
}

.btn-action {
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.22);
    cursor: pointer;
    transition: all 160ms ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-action:hover:not(:disabled) {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.28);
}

.btn-action:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.22);
}

.btn-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.35rem;
}

.stat-pill {
    min-width: 105px;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-pill .stat-value {
    font-size: 1.35rem;
    line-height: 1.15;
    font-weight: 700;
}

.stat-pill .stat-label {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.app-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
}

.app-tabs button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.44rem 0.86rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: 150ms ease;
}

.app-tabs button:hover {
    color: var(--text);
    border-color: var(--border);
    background: #f5f6f7;
}

.app-tabs button.active {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand);
}

.scroll-pane {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.analyst-mode .scroll-pane {
    /* no scroll constraints */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.data-table th {
    background: #f5f6f7;
    color: var(--text-muted);
    text-align: left;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: var(--table-cell-pad-y, 0.65rem) var(--table-cell-pad-x, 0.74rem);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: var(--table-cell-pad-y, 0.54rem) var(--table-cell-pad-x, 0.74rem);
    border-bottom: 1px solid #ebedef;
    vertical-align: top;
}

.data-table.data-table-compact td {
    padding: 0.34rem 0.56rem;
    font-size: 0.79rem;
}

/* â”€â”€ Results toolbar â”€â”€ */

.results-toolbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.results-toolbar-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.9rem;
    background: #f8fafc;
    border-bottom: 1px solid #ebedef;
    flex-wrap: wrap;
}

.results-toolbar-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.results-toolbar-action {
    margin-left: auto;
}

.results-stat {
    font-size: 0.82rem;
    font-weight: 700;
}

.stat-error { color: var(--danger); }
.stat-warning { color: var(--warning); }
.stat-info { color: var(--text-muted); }

.results-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
}

.filter-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.filter-chip {
    border: 1px solid var(--border);
    background: #fafafa;
    color: var(--text);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: 140ms ease;
}

.filter-chip:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.filter-chip.active {
    background: var(--brand);
    border-color: var(--text);
    color: #fff;
}

.category-select {
    min-height: 30px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    color: var(--text);
    background: #fafafa;
    cursor: pointer;
    min-width: 180px;
}

.category-select:focus {
    border-color: var(--text);
    outline: none;
    box-shadow: 0 0 0 2px rgba(60, 64, 67, 0.15);
}

.quick-filter-search {
    min-height: 30px;
    font-size: 0.78rem;
    border-radius: 8px;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    margin-left: auto;
    width: 200px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.data-table .cell-muted {
    color: var(--text-muted);
}

.data-table .cell-mono {
    font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 0.79rem;
}

.data-table .code-cell {
    white-space: nowrap;
    font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* â”€â”€ Validation category group header â”€â”€ */

.msg-group-row td {
    background: #f0f1f2;
    padding: 0.45rem 0.74rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    cursor: default;
}

.msg-group-row td .group-count {
    font-weight: 600;
    font-size: 0.7rem;
    color: #7f91a8;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 0.4rem;
}

.verdict-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.4rem 0.94rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.verdict-badge.valid {
    color: #2e5e3a;
    background: #e5ede7;
    border: 1px solid #b5ccba;
}

.verdict-badge.invalid {
    color: #6b2d2d;
    background: #f0e0e0;
    border: 1px solid #d4a5a5;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0.12rem 0.42rem;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-badge.error {
    color: #7a2e2e;
    background: #f5e0e0;
}

.severity-badge.warning {
    color: #6b4a1a;
    background: #f3e8d5;
}

.severity-badge.info {
    color: var(--text);
    background: #e6e8eb;
}

.msg-row-error {
    background: #fafafa;
}

.msg-row-warning {
    background: #fafafa;
}

.dim-badge {
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #f0f1f2;
    color: var(--text);
    font-size: 0.74rem;
}

.app-alert {
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    font-size: 0.86rem;
}

.app-alert.alert-error {
    color: #7a2e2e;
    background: #f5e0e0;
    border: 1px solid #d4a5a5;
}

.app-alert.alert-success {
    color: #2e5e3a;
    background: #e5ede7;
    border: 1px solid #b5ccba;
}

.report-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: #fff;
    overflow: hidden;
}

.report-container .report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    background: #f8f9fa;
}

.report-container .report-header .report-meta {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.78rem;
}

.report-container .report-body {
    padding: 1.2rem;
    overflow-x: auto;
}

/* â”€â”€ TOC + Report layout â”€â”€ */
.xbrl-report-layout {
    display: grid;
    grid-template-columns: minmax(210px, 250px) minmax(720px, 1fr);
    gap: 1rem;
    align-items: start;
}

.xbrl-toc {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.xbrl-toc-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.72rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #24425c;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
    border-bottom: 1px solid var(--border);
}

.xbrl-toc-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.xbrl-toc-list li {
    margin: 0;
}

.xbrl-toc-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 38px;
    margin: 0 0.35rem;
    padding: 0.48rem 0.55rem;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: 120ms ease;
}

.xbrl-toc-link:hover {
    background: #eef7f6;
    border-left-color: #2d7b6f;
    color: var(--text);
}

.xbrl-toc-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: - webkit-box;
    - webkit-line-clamp: 2;
    - webkit-box-orient: vertical;
}

.xbrl-toc-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 0.38rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #24425c;
    background: #e6f0f5;
    border-radius: 999px;
}

.xbrl-toc-badge-warning {
    color: #a86417;
    background: #fff1d6;
}

/* â”€â”€ Report sections â”€â”€ */
.xbrl-report .xbrl-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    overflow: hidden;
    scroll-margin-top: 80px;
}

.xbrl-report .xbrl-section h2 {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.xbrl-section-title-main {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.xbrl-section-title-sub {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.66rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* â”€â”€ Table â”€â”€ */
.xbrl-report .xbrl-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
}

.xbrl-report .xbrl-table th,
.xbrl-report .xbrl-table td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.46rem 0.62rem;
    vertical-align: middle;
}

.xbrl-report .xbrl-table th:last-child,
.xbrl-report .xbrl-table td:last-child {
    border-right: 0;
}

.xbrl-report .xbrl-table tbody tr:last-child td {
    border-bottom: 0;
}

.xbrl-report .xbrl-table th {
    background: linear-gradient(180deg, #f8fbfd 0%, #edf4f7 100%);
    color: #23364f;
    font-weight: 700;
    font-size: 0.72rem;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: bottom;
    white-space: normal;
    min-width: 80px;
}

.xbrl-report .xbrl-table th:first-child {
    background: #e8f2f6;
    color: #24425c;
    text-align: left;
    white-space: normal;
}

.xbrl-report .xbrl-table td:first-child {
    text-align: left;
    color: #253247;
    background: #fbfcfe;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.xbrl-report .xbrl-table td:not(:first-child) {
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-variant-numeric: tabular-nums;
}

.xbrl-report .xbrl-table tbody tr:nth-child(even) td:not(.abstract) {
    background: #fbfcfe;
}

.xbrl-report .xbrl-table tbody tr:hover td {
    background: #f0f8f7;
}

.xbrl-report .xbrl-table td.empty {
    color: #b8c2cf;
    font-weight: 500;
}

.xbrl-report .xbrl-table td.abstract {
    color: #24425c;
    background: #eaf3f7;
    font-weight: 700;
}

.xbrl-report .xbrl-table td.abstract:first-child {
    background: #dcecf3;
}

.xbrl-report .xbrl-table tr.is-total td {
    border-top: 2px solid #b8c7d4;
    background: #f4f8fb;
    font-weight: 800;
}

.xbrl-report .xbrl-table tr.is-total td:first-child {
    color: var(--text);
}

.xbrl-report .xbrl-table th .col-period {
    font-size: 0.74rem;
    font-weight: 800;
    color: #23364f;
    margin-bottom: 0.2rem;
}

.xbrl-report .xbrl-table th .col-dims {
    max-height: 3.4em;
    overflow: hidden;
    font-size: 0.63rem;
    font-weight: 500;
    color: var(--text-subtle);
    line-height: 1.25;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.xbrl-report .xbrl-table td.level-0 { padding-left: 0.65rem; }
.xbrl-report .xbrl-table td.level-1 { padding-left: 1.65rem; }
.xbrl-report .xbrl-table td.level-2 { padding-left: 2.65rem; }
.xbrl-report .xbrl-table td.level-3 { padding-left: 3.65rem; }
.xbrl-report .xbrl-table td.level-4 { padding-left: 4.65rem; }
.xbrl-report .xbrl-table td.level-5 { padding-left: 5.65rem; }

@media (max-width: 1100px) {
    .xbrl-report-layout {
        grid-template-columns: 1fr;
    }

    .xbrl-toc {
        position: static;
        max-height: 240px;
    }
}

.summary-table {
    width: 100%;
    font-size: 0.84rem;
}

.summary-table td {
    padding: 0.44rem 0.72rem;
    border-bottom: 1px solid #ebedef;
}

.summary-table td:first-child {
    width: 46%;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.tuple-row {
    background: #fafafa;
}

.text-accent {
    color: var(--brand);
}

.mt-section {
    margin-top: 1.5rem;
}

/* â”€â”€ Clickable message rows â”€â”€ */

.msg-row {
    cursor: pointer;
    transition: background 120ms ease;
}

.msg-row:hover {
    background: #f0f1f2 !important;
}

.msg-row-expanded {
    background: #ebedef !important;
    border-bottom-color: transparent;
}

.msg-expand-hint {
    float: right;
    color: #a0a5ab;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    transition: color 120ms;
}

.msg-row:hover .msg-expand-hint {
    color: var(--text-muted);
}

/* â”€â”€ Expand panel with tabs â”€â”€ */

.expand-panel-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.expand-panel {
    margin: 0;
    overflow: hidden;
}

.expand-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e6e8eb;
    padding: 0 0.8rem;
    background: #f0f1f2;
}

.expand-tab {
    padding: 0.5rem 1rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: 120ms ease;
}

.expand-tab:hover {
    color: var(--text);
}

.expand-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.expand-tab-body {
    padding: 0.6rem 0.8rem 0.75rem;
    overflow: hidden;
}

/* â”€â”€ AI Chat (shared by expand panel and Q&A) â”€â”€ */

.ai-chat {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    overflow: hidden;
}

.ai-chat-messages {
    padding: 0.65rem 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-msg {
    font-size: 0.82rem;
    line-height: 1.55;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    max-width: 92%;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg.chat-ai {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
}

.chat-msg.chat-user {
    background: var(--brand);
    color: #fff;
    align-self: flex-end;
    border: none;
}

.chat-ai-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    background: #ebedef;
    border-radius: 4px;
    padding: 0.08rem 0.35rem;
    margin-right: 0.45rem;
    vertical-align: middle;
}

.chat-typing {
    color: #7f91a8;
    font-style: italic;
}

.chat-typing .dot1 { animation: blink 1.4s 0s infinite; }
.chat-typing .dot2 { animation: blink 1.4s 0.2s infinite; }
.chat-typing .dot3 { animation: blink 1.4s 0.4s infinite; }

@keyframes blink {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.ai-chat-input {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border-top: 1px solid #e6e8eb;
    background: #fafafa;
}

.ai-chat-input .form-control {
    flex: 1;
    min-height: 34px;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    border-color: var(--border);
}

.btn-chat-send {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    min-height: 34px;
    border-radius: 8px;
}

/* â”€â”€ PDF Viewer â”€â”€ */

.pdf-viewer-fullscreen {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 2;
}

.pdf-toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.35rem;
}

.pdf-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: 120ms;
    font-size: 1rem;
}

.pdf-upload-btn:hover {
    background: #ebedef;
}

.pdf-upload-icon {
    font-size: 1.05rem;
}

.pdf-file-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-page-input {
    width: 48px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.25rem;
    color: var(--text);
    background: #fff;
}

.pdf-page-input:focus {
    outline: 2px solid var(--brand);
    outline-offset: -1px;
    border-color: var(--brand);
}

.pdf-zoom-label {
    min-width: 42px;
    text-align: center;
}

.pdf-fit-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.pdf-canvas-wrapper {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #5c6370;
}

.pdf-canvas {
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    background: #fff;
    max-width: 100%;
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .app-navbar {
        height: auto;
        min-height: 58px;
        align-items: flex-start;
        flex-direction: column;
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }

    .app-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .app-nav .nav-divider {
        display: none;
    }

    .app-main {
        width: min(1320px, calc(100% - 1rem));
        margin-top: 0.9rem;
    }

    .workspace-toolbar {
        width: min(1320px, calc(100% - 1rem));
        top: 98px;
        padding: 0.55rem 0.7rem;
    }

    .toolbar-title {
        display: none;
    }

    .page-shell {
        padding: 1.05rem;
    }

    .hero-panel {
        padding: 1.3rem;
    }

    .hero-panel::after {
        width: 240px;
        height: 240px;
        right: -90px;
        top: -100px;
    }
}

/* â”€â”€ Calculation detail panel â”€â”€ */

/* â”€â”€ Pager â”€â”€ */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem 0;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: 140ms ease;
}

.pager-btn:hover:not(:disabled) {
    background: #ebedef;
    border-color: #91b8e2;
}

.pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pager-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 0.6rem;
    font-weight: 600;
}

.msg-text-cell {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.calc-detail {
    padding: 0.7rem 0.85rem;
    background: #f8f9fb;
    border: 1px solid #e2e6ed;
    border-radius: 6px;
    font-size: 0.82rem;
    overflow: hidden;
}

.calc-detail-role {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.calc-detail-equation {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.6;
}

.calc-detail-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.calc-detail-table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid #e5e7eb;
    padding: 0.3rem 0.5rem;
    text-align: left;
}

.calc-detail-table th:first-child {
    width: auto;
}

.calc-detail-table th:nth-child(2) {
    width: 70px;
}

.calc-detail-table th:nth-child(3),
.calc-detail-table th:nth-child(4) {
    width: 110px;
}

.calc-detail-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #f0f1f3;
}

.calc-detail-table td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-detail-table .text-end {
    text-align: right;
    white-space: nowrap;
}

.calc-detail-total td {
    font-weight: 700;
    border-top: 2px solid #d1d5db;
    border-bottom: none;
    color: var(--danger);
}

/* â”€â”€ Generic detail (non-calculation messages) â”€â”€ */

.generic-detail {
    padding: 0.5rem 0.6rem;
    background: #f8f9fb;
    border: 1px solid #e2e6ed;
    border-radius: 6px;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.generic-detail-row {
    display: flex;
    gap: 0.7rem;
    align-items: baseline;
}

.generic-detail-label {
    flex: 0 0 auto;
    width: 118px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.generic-detail-value {
    flex: 1 1 auto;
    min-width: 0;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.detail-explanation {
    background: #f0f6ff;
    border-left: 3px solid #6b9fd4;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #1e3a5f;
    white-space: pre-line;
}


/* ================================================================
   Extension Viewer
   ================================================================ */

/* Load bar */
.ext-load-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    max-width: 1000px;
}
.ext-load-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-subtle);
    white-space: nowrap;
}
.ext-uri-input {
    flex: 1;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text);
    background: #fff;
    transition: border-color 120ms;
}
.ext-uri-input:focus { outline: none; border-color: var(--text-subtle); box-shadow: 0 0 0 3px rgba(60,64,67,0.1); }

/* Tab bar */
.ext-tabbar {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e5ecf3;
    background: linear-gradient(180deg, #fafbfc 0%, #f6f9fc 100%);
    margin-bottom: 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}
.ext-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7d92;
    cursor: pointer;
    transition: all 140ms ease;
    white-space: nowrap;
    position: relative;
}
.ext-tab:hover:not(:disabled) {
    color: #3a5070;
    background: rgba(60, 64, 67, 0.06);
}
.ext-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}
.ext-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.ext-tab .ext-tc {
    font-size: 0.75rem;
    background: #f0f4f9;
    color: #6b7d92;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}
.ext-tab:hover { color: #1a3a58; }
.ext-tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.ext-tc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e6e8eb;
    color: var(--text);
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.08rem 0.42rem;
    line-height: 1.5;
}
.ext-tab.active .ext-tc { background: rgba(60,64,67,0.13); color: var(--text); }
.ext-tab-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.75rem;
    font-size: 0.76rem;
    color: #8a9db5;
}
.ext-lang-sel {
    height: 26px;
    font-size: 0.76rem;
    border: 1px solid #cdd8e8;
    border-radius: 4px;
    padding: 0 0.35rem;
    background: #fff;
    color: var(--text);
}

/* Two-column viewer */
.ext-viewer {
    display: grid;
    grid-template-columns: minmax(280px, var(--ext-left-pane, 40%)) 10px minmax(0, 1fr);
    border: 1px solid #dde8f2;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    min-height: 70vh;
    overflow: hidden;
}

/* Left panel */
.ext-left {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ext-splitter {
    position: relative;
    cursor: col-resize;
    background: #f4f7fa;
    border-left: 1px solid #e5ecf3;
    border-right: 1px solid #e5ecf3;
    transition: background 140ms ease;
}

.ext-splitter:hover {
    background: #ebedef;
}

.ext-splitter-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    border-radius: 2px;
    background: #c4d3e4;
    transition: width 120ms ease, background-color 120ms ease;
}

.ext-viewer:hover .ext-splitter-line {
    background: #a0b8d0;
}

.ext-viewer-dragging {
    -webkit-user-select: none;
    user-select: none;
    cursor: col-resize;
}

.ext-viewer-dragging .ext-splitter-line {
    width: 3px;
    background: var(--brand);
}
.ext-left-top {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e5ecf3;
    background: linear-gradient(180deg, #fafbfc 0%, #f6f9fc 100%);
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}
.ext-net-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}
.ext-net-row-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7890a8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.ext-net-sel {
    flex: 1;
    height: 28px;
    font-size: 0.78rem;
    border: 1px solid #cdd8e8;
    border-radius: 5px;
    padding: 0 0.4rem;
    background: #fff;
    color: var(--text);
}
/* Arcrole / filter dropdown */
.ext-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ext-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #5a7090;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.ext-filter-sel {
    flex: 1;
    height: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #c4d5e8;
    border-radius: 6px;
    padding: 0 0.55rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 0;
    transition: border-color 120ms;
}
.ext-filter-sel:focus {
    outline: none;
    border-color: var(--text-subtle);
    box-shadow: 0 0 0 3px rgba(60, 64, 67, 0.1);
}
.ext-filter-sel:hover {
    border-color: #91b8e2;
}

.ext-search-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ext-search-inp {
    flex: 1;
    height: 24px;
    padding: 0 0.4rem;
    font-size: 0.76rem;
    border: 1px solid #cdd8e8;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    min-width: 0;
}
.ext-search-inp:focus { outline: none; border-color: var(--text-subtle); }
.ext-search-inp:focus {
    box-shadow: 0 0 0 3px rgba(60, 64, 67, 0.12);
}
.ext-search-clr {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 0.72rem;
    padding: 0 0.15rem;
    line-height: 1;
}
.ext-search-clr:hover { color: #555; }
.ext-btn-xs {
    background: #fff;
    border: 1px solid #cdd8e8;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 600;
    color: #5a7090;
    padding: 0.1rem 0.38rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 80ms;
}
.ext-btn-xs:hover { background: #eef6ff; border-color: #90bce8; }

/* Tree */
.ext-tree {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}
.ext-hint {
    padding: 2rem 1rem;
    text-align: center;
    color: #aab8c8;
    font-size: 0.82rem;
}
.ext-node {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 0.18rem 0.5rem 0.18rem calc(0.5rem + var(--d, 0) * 16px);
    cursor: pointer;
    font-size: 0.82rem;
    color: #1a2a3a;
    border-left: 2px solid transparent;
    transition: background 60ms;
    -webkit-user-select: none;
    user-select: none;
}
.ext-node:hover { background: #f0f6ff; }
.ext-node-h1 {
    font-weight: 700;
    color: #0d1e2e;
    background: #f4f8fd;
    border-bottom: 1px solid #eef3f8;
    padding-left: 0.5rem !important;
}
.ext-node-h1:hover { background: #e8f2fb; }
.ext-node-sel { background: #ebedef !important; border-left-color: var(--text); color: var(--text); }
.ext-node-pad { display: none; }
.ext-node-tog {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-right: 3px;
}
.ext-arrow { display: inline-block; width: 0; height: 0; }
.ext-arrow-d {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #80868b;
}
.ext-node-sel .ext-arrow-d { border-top-color: var(--text); }
.ext-arrow-r {
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #80868b;
}
.ext-node-sel .ext-arrow-r { border-left-color: var(--text); }
.ext-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c8d8e8;
    margin: 0 5.5px;
}
.ext-node-lbl {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ext-node-extra {
    font-size: 0.68rem;
    color: #9ab0c8;
    margin-left: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Right panel */
.ext-right {
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}
.ext-right-empty {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.ext-right-empty-title { font-size: 1rem; font-weight: 700; color: #1a2a3a; margin-bottom: 0.3rem; }
.ext-right-empty-sub { font-size: 0.72rem; color: #9ab0c8; word-break: break-all; max-width: 500px; margin-bottom: 1rem; }
.ext-right-empty-hint {
    font-size: 0.82rem;
    color: #7890a8;
    padding: 0.75rem 1rem;
    background: #f4f8fd;
    border: 1px solid #e0eaf4;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Right panel network summary (shown when no concept selected) */
.ext-net-summary-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7890a8;
    margin-bottom: 0.5rem;
}
.ext-net-summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ext-net-summary-list li {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: #2a4060;
    border-bottom: 1px solid #eef3f9;
    cursor: pointer;
    transition: background 80ms;
    border-radius: 4px;
}
.ext-net-summary-list li:hover {
    background: #f0f1f2;
    color: var(--text);
}
.ext-net-summary-list li:last-child {
    border-bottom: none;
}
.ext-net-summary-count {
    font-size: 0.7rem;
    color: #9ab0c8;
    margin-left: 0.3rem;
}
.ext-net-summary-section {
    margin-bottom: 1.25rem;
}

/* Concept detail */
.ext-detail-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d1e2e;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e4edf6;
}
.ext-section-hd {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7890a8;
    margin: 1.25rem 0 0.45rem;
}
.ext-dtbl { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ext-dtbl th {
    text-align: left;
    padding: 0.32rem 0.75rem;
    background: #f3f7fb;
    border: 1px solid #dde8f2;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3a5070;
}
.ext-dtbl td {
    padding: 0.28rem 0.75rem;
    border: 1px solid #e8eff6;
    color: #1a2a3a;
    vertical-align: top;
}
.ext-dtbl td:first-child {
    font-weight: 500;
    color: #5a7090;
    background: #f8fbfe;
    width: 155px;
    white-space: nowrap;
}
.ext-dtbl tr:hover td { background: #f5f9fe; }
.ext-dtbl tr:hover td:first-child { background: #f0f1f2; }
.ext-row-hl td { background: #f0f7ff !important; }
.ext-row-hl td:first-child { background: #e6f0fb !important; }
.ext-mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.76rem; }
.ext-wrap { word-break: break-all; }

.ext-badge { display: inline-block; border-radius: 4px; padding: 0.1rem 0.45rem; font-size: 0.72rem; font-weight: 700; }
.ext-badge-period { background: #e6e8eb; color: var(--brand); }
.ext-badge-debit  { background: #e5ede7; color: #2e5e3a; }
.ext-badge-credit { background: #f0e0e0; color: #7a2e2e; }

@media (max-width: 1100px) {
    .ext-viewer { grid-template-columns: minmax(240px, var(--ext-left-pane, 40%)) 10px minmax(0, 1fr); }
}
@media (max-width: 800px) {
    .ext-viewer { grid-template-columns: 1fr; }
    .ext-splitter { display: none; }
    .ext-left { border-right: none; border-bottom: 1px solid #dde8f2; }
    .ext-tree { max-height: 40vh; }
}

.ext-tree-count {
    font-size: 0.68rem;
    color: #9ab0c8;
    margin-top: 0.25rem;
    text-align: right;
}
.ext-detail-id {
    font-size: 0.72rem;
    color: #9ab0c8;
    font-family: ui-monospace, Consolas, monospace;
    word-break: break-all;
    margin-bottom: 0.75rem;
}
.ext-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f0f8;
    color: #5a7090;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.38rem;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* ================================================================
   Combined TaxonomyLoader page additions
   ================================================================ */

.tl-page {
    display: block;
}

.tl-header {
    margin: 0 0 0.6rem;
    padding: 0;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.tl-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
    color: #11263d;
}

.tl-subtitle {
    margin: 0;
    color: #8a9db5;
    font-size: 0.78rem;
    max-width: 72ch;
}

/* Load bar */
.tl-load-bar {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f5f6f7 100%);
    border: 1px solid #dde8f4;
    border-radius: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tl-src-toggle {
    display: inline-flex;
    border: 1px solid #d0dce8;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.tl-src-btn {
    padding: 0.45rem 0.9rem;
    height: auto;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a7090;
    cursor: pointer;
    transition: all 120ms ease;
    position: relative;
}
.tl-src-btn:first-child { border-right: 1px solid #d0dce8; }
.tl-src-btn.active { background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%); color: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,0.2); }
.tl-src-btn:not(.active):hover { background: #eef6ff; }
.tl-zip-row { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 200px; }
.tl-zip-name { font-size: 0.78rem; color: #5a7090; font-weight: 500; }

.tl-empty-state {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border: 1px dashed #c8d7e7;
    border-radius: 10px;
    background: linear-gradient(180deg, #fafafa 0%, #f5f6f7 100%);
}

.tl-empty-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #224468;
}

.tl-empty-text {
    margin-top: 0.2rem;
    font-size: 0.84rem;
    color: #5d7592;
}

/* Stats strip */
.tl-stats-strip {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(180deg, #f9fbfd 0%, #f4f9fc 100%);
    border: 1px solid #dde8f4;
    border-radius: 10px 10px 0 0;
    font-size: 0.8rem;
    color: #3a5070;
    flex-wrap: wrap;
    margin-bottom: 0;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.8);
}
.tl-stat { display: inline-flex; align-items: center; gap: 0.2rem; }
.tl-stat strong { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.tl-stat-warn strong { color: var(--warning); }
.tl-sep { color: #c4d3e0; font-weight: 300; }
.tl-spacer { flex: 1; }
.tl-lang-row { display: flex; align-items: center; gap: 0.5rem; }
.tl-lang-lbl { font-size: 0.75rem; font-weight: 600; color: #7890a8; text-transform: uppercase; letter-spacing: 0.05em; }

/* Overview layout */
.tl-overview {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 1px solid #dde8f4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fbfc 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tl-overview-left { display: flex; flex-direction: column; gap: 1rem; }
.tl-overview-right { overflow: hidden; }

/* Overview cards */
.tl-card {
    border: 1px solid #dde8f4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 200ms ease;
}
.tl-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d0dce8;
}
.tl-card-title {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f5f9fc 0%, #f0f6fa 100%);
    font-size: 0.8rem;
    font-weight: 700;
    color: #2a4060;
    border-bottom: 1px solid #dde8f4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tl-card-warn { border-color: #fcd34d; }
.tl-card-title-warn { color: #b45309; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-bottom-color: #fcd34d; }

/* Role type list in overview */
.tl-role-list {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}
.tl-role-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #eef3f9;
    transition: background 60ms;
}
.tl-role-item:hover {
    background: #f5f9fe;
}
.tl-role-item:last-child {
    border-bottom: none;
}
.tl-role-def {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a2a3a;
    line-height: 1.35;
}
.tl-role-uri {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.67rem;
    color: #9ab0c8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

@media (max-width: 900px) {
    .tl-header {
        margin-bottom: 0.8rem;
    }

    .tl-subtitle {
        font-size: 0.84rem;
    }

    .tl-overview { grid-template-columns: 1fr; }
}

/* ================================================================
   Extension Builder
   ================================================================ */

.eb-content {
    border: 1px solid #dde8f4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fbfc 100%);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Form grids */
.eb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.65rem 1rem;
}
.eb-form-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.65rem 1rem;
}
.eb-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    position: relative;
    min-width: 0;
}
.eb-field label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #5a7090;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.eb-field input, .eb-field select {
    height: 32px;
    padding: 0 0.55rem;
    border: 1px solid #c4d5e8;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text);
    background: #fff;
    transition: border-color 120ms;
    min-width: 0;
}
.eb-field input:focus, .eb-field select:focus {
    outline: none;
    border-color: var(--text-subtle);
    box-shadow: 0 0 0 3px rgba(60,64,67,0.1);
}
.eb-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
}
.eb-field-wide {
    grid-column: 1 / -1;
}
.eb-field-2col {
    grid-column: span 2;
}
.eb-inline-checks {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    grid-column: span 2;
}
.eb-inline-checks label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #3a5070;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.eb-inline-checks input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Tables */
.eb-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.eb-table th {
    text-align: left;
    padding: 0.38rem 0.6rem;
    background: #f3f7fb;
    border: 1px solid #dde8f2;
    font-size: 0.68rem;
    font-weight: 700;
    color: #3a5070;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.eb-table td {
    padding: 0.32rem 0.6rem;
    border: 1px solid #e8eff6;
    vertical-align: middle;
}
.eb-table tbody tr:hover {
    background: #f5f9fe;
}
.eb-table td:last-child {
    width: 70px;
    text-align: center;
}

.eb-empty {
    padding: 1.5rem;
    text-align: center;
    color: #9ab0c8;
    font-size: 0.82rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #fafafa;
}

.eb-btn-del {
    background: none;
    border: 1px solid #e5a5a5;
    color: #c53030;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: 120ms;
    white-space: nowrap;
}
.eb-btn-del:hover {
    background: #f0e0e0;
    border-color: #c53030;
}

/* Add form */
.eb-add-form {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, #fafafa 0%, #f5f6f7 100%);
}
.eb-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}
.eb-add-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2a4060;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}
.eb-add-btn {
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    box-shadow: 0 3px 10px rgba(60, 64, 67, 0.25);
    cursor: pointer;
    transition: all 140ms ease;
    white-space: nowrap;
}
.eb-add-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(60, 64, 67, 0.35);
}
.eb-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* Concept picker dropdown */
.eb-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #c4d5e8;
    border-radius: 0 0 6px 6px;
    border-top: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.eb-picker-item {
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    border-bottom: 1px solid #f0f4f9;
    transition: background 60ms;
}
.eb-picker-item:hover {
    background: #f0f1f2;
}
.eb-picker-item:last-child {
    border-bottom: none;
}
.eb-picker-ext {
    background: #f0faf5;
}
.eb-picker-ext:hover {
    background: #e0f5eb;
}
.eb-picker-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a2a3a;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.eb-picker-id {
    font-size: 0.65rem;
    color: #9ab0c8;
    font-family: ui-monospace, Consolas, monospace;
    flex-shrink: 0;
}

/* Action bar */
.eb-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, #f4f8fc 0%, #f0f1f2 100%);
    border: 1px solid #dde8f4;
    border-radius: 10px;
}

/* Tree-based arc builder */
.eb-tree-viewer {
    display: grid;
    grid-template-columns: 1fr 320px;
    border: 1px solid #dde8f2;
    border-radius: 8px;
    background: #fff;
    min-height: 50vh;
    overflow: hidden;
}
.eb-tree-left {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e5ecf3;
}
.eb-tree-left .ext-tree {
    max-height: calc(100vh - 340px);
}
.eb-tree-right {
    overflow-y: auto;
    max-height: calc(100vh - 340px);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

/* Extension node highlight in tree */
.eb-node-ext {
    background: #f0faf5 !important;
}
.eb-node-ext:hover {
    background: #e0f5eb !important;
}
.eb-node-ext .ext-node-lbl {
    color: #0d7a3e;
    font-weight: 600;
}
.eb-ext-badge {
    font-size: 0.58rem;
    font-weight: 800;
    color: #fff;
    background: var(--success);
    border-radius: 3px;
    padding: 0.05rem 0.3rem;
    margin-left: 0.4rem;
    flex-shrink: 0;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

/* Attach panel */
.eb-attach-panel {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.eb-attach-selected {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5ecf3;
}
.eb-attach-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #7890a8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}
.eb-attach-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0d1e2e;
    line-height: 1.3;
}
.eb-attach-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(180deg, #fafafa 0%, #f5f6f7 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.eb-attach-form .eb-field {
    gap: 0.1rem;
}
.eb-attach-children {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.eb-attach-child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    background: #f0faf5;
    border: 1px solid #d0ebdb;
    border-radius: 5px;
    font-size: 0.78rem;
}
.eb-attach-child-name {
    font-weight: 600;
    color: #0d7a3e;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .eb-form-grid { grid-template-columns: 1fr 1fr; }
    .eb-form-grid-4 { grid-template-columns: 1fr 1fr; }
    .eb-tree-viewer { grid-template-columns: 1fr; }
    .eb-tree-left { border-right: none; border-bottom: 1px solid #e5ecf3; }
    .eb-tree-left .ext-tree { max-height: 40vh; }
}
@media (max-width: 600px) {
    .eb-form-grid, .eb-form-grid-4 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   Report Generator
   ═══════════════════════════════════════════════════════════════════ */

.rg-steps {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.8rem 1rem; margin-bottom: 0;
    background: var(--surface-soft, #f8fafc);
    border-radius: var(--radius-md, 10px) var(--radius-md, 10px) 0 0;
    border: 1px solid var(--border, #e5ecf3);
    border-bottom: none;
    flex-wrap: wrap; justify-content: center;
}

/* In the Report Generator the eb-content panels sit below rg-steps
   instead of below a tab bar, so they need a full border & radius. */
.rg-steps ~ .eb-content {
    border: 1px solid #dde8f4;
    border-radius: 0 0 var(--radius-md, 10px) var(--radius-md, 10px);
}

/* Alert banners between the step bar and content: blend into the column */
.rg-steps ~ .app-alert {
    border-radius: 0; margin-bottom: 0;
    border-left: 1px solid var(--border, #e5ecf3);
    border-right: 1px solid var(--border, #e5ecf3);
}
.rg-step {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 1rem; border: 1px solid #d0d8e0; border-radius: 20px;
    background: #fff; font-size: 0.82rem; font-weight: 500;
    color: #6b7d94; cursor: pointer; transition: all 0.15s;
}
.rg-step:hover:not(:disabled) { border-color: #90bce8; color: #1a3a58; }
.rg-step.active {
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: #fff; border-color: transparent; font-weight: 600;
}
.rg-step.done { background: #e8f5e9; color: #2e7d32; border-color: #b5ccba; }
.rg-step:disabled { opacity: 0.45; cursor: not-allowed; }
.rg-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: #e5ecf3; font-size: 0.72rem; font-weight: 700; color: #6b7d94;
}
.rg-step.active .rg-step-num { background: rgba(255,255,255,0.25); color: #fff; }
.rg-step.done .rg-step-num { background: #b5ccba; color: #2e5e3a; }
.rg-step-arrow { color: #b0bec5; font-size: 1rem; flex-shrink: 0; }

.rg-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem; font-weight: 600; color: #1a3a58;
    margin: 1.2rem 0 0.5rem; padding-bottom: 0.35rem;
    border-bottom: 1px solid #e5ecf3;
}

/* ── Step 3: Facts layout ───────────────────────────────────────── */
.rg-facts-layout {
    display: grid; grid-template-columns: 240px 1fr;
    gap: 0; border: 1px solid #e5ecf3;
    border-top: none;
    border-radius: 0 0 var(--radius-md, 10px) var(--radius-md, 10px);
    background: #fff; min-height: 400px; overflow: hidden;
}
.rg-networks {
    border-right: 1px solid #e5ecf3; padding: 0.5rem 0;
    overflow-y: auto; max-height: 70vh; background: var(--surface-soft, #f8fafc);
}
.rg-networks-title {
    font-size: 0.78rem; font-weight: 600; color: #6b7d94;
    padding: 0.4rem 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.rg-net-btn {
    display: block; width: 100%; text-align: left;
    padding: 0.4rem 0.8rem; border: none; background: transparent;
    font-size: 0.78rem; color: #3a5068; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 0.1s;
}
.rg-net-btn:hover { background: #eef3fa; }
.rg-net-btn.active { background: #e6e8eb; color: var(--text); font-weight: 600; }

.rg-fact-form { padding: 0.75rem; overflow-y: auto; max-height: 70vh; }
.rg-fact-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid #e5ecf3;
}
.rg-fact-controls { display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap; }
.rg-inline-select {
    padding: 0.2rem 0.4rem; border: 1px solid #d0d8e0; border-radius: 4px;
    font-size: 0.75rem; background: #fff;
}
.rg-fact-table { overflow-y: auto; }
/* Override the single-value .eb-table td:last-child centering + fixed 70px width
   so the multi-column fact grid respects its colgroup widths and left-aligns
   colspan'd abstract rows. */
.rg-fact-table .eb-table td:last-child { width: auto; text-align: left; }
.rg-abstract-row td { background: #f0f1f2 !important; font-size: 0.8rem; text-align: left; }
.rg-fact-input {
    width: 100%; padding: 0.3rem 0.5rem;
    border: 1px solid #d0d8e0; border-radius: 4px;
    font-size: 0.82rem; font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.15s;
}
.rg-fact-input:focus { outline: none; border-color: var(--text-subtle); box-shadow: 0 0 0 2px rgba(60,64,67,0.08); }

.rg-type-badge {
    display: inline-block; font-size: 0.65rem; font-weight: 600;
    padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.3rem;
    background: #e3f2fd; color: #1565c0; vertical-align: middle;
}
.rg-type-badge.rg-type-enum { background: #ede7f6; color: #5e35b1; }
.rg-type-text { background: #f3e8ff; color: var(--text-muted); }

.rg-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 200px; color: var(--text-subtle); font-size: 0.88rem;
}

.rg-facts-status {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1rem; margin-top: 0.5rem;
    font-size: 0.8rem; color: #6b7d94;
    background: var(--surface-soft, #f8fafc); border-radius: var(--radius-sm, 6px);
}

/* ── Dimension picker ────────────────────────────────────────── */
.rg-dim-section {
    margin-top: 0.6rem; padding: 0.6rem 0.8rem;
    background: #f8fafc; border: 1px solid #e5ecf3; border-radius: var(--radius-sm, 6px);
}
.rg-dim-title {
    font-size: 0.78rem; font-weight: 600; color: #6b7d94;
    margin-bottom: 0.4rem;
}
.rg-dim-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.rg-dim-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.5rem; font-size: 0.75rem; font-weight: 500;
    background: #e6e8eb; color: var(--text); border-radius: 12px;
}
.rg-dim-tag-x {
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: 0.9rem; color: #6b7d94; line-height: 1;
}
.rg-dim-tag-x:hover { color: var(--danger); }
.rg-dim-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}
.rg-dim-field { display: flex; flex-direction: column; gap: 0.2rem; }
.rg-dim-field label {
    font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rg-dim-select, .rg-dim-input {
    padding: 0.35rem 0.5rem; border: 1px solid #d0d8e0; border-radius: 4px;
    font-size: 0.78rem; background: #fff; width: 100%;
    transition: border-color 0.15s;
}
.rg-dim-select:focus, .rg-dim-input:focus {
    outline: none; border-color: var(--text-subtle); box-shadow: 0 0 0 2px rgba(60,64,67,0.08);
}
.rg-dim-row {
    display: flex; align-items: end; gap: 0.5rem; flex-wrap: wrap;
}
.rg-dim-row .eb-field { flex: 1; min-width: 160px; }
.rg-dim-row .eb-field label { font-size: 0.72rem; }

@media (max-width: 768px) {
    .rg-facts-layout { grid-template-columns: 1fr; }
    .rg-networks { border-right: none; border-bottom: 1px solid #e5ecf3; max-height: 30vh; }
    .rg-steps { padding: 0.6rem 0.75rem; gap: 0.3rem; }
    .rg-step { padding: 0.35rem 0.75rem; font-size: 0.76rem; }
    .rg-step-arrow { display: none; }
}

/* ── Taxonomy parameter overrides (Step 2) ──────────────────── */
.rg-hint {
    margin: 0.2rem 0 0.5rem; font-size: 0.75rem; color: #6b7d94;
}
.rg-param-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.rg-param-row {
    display: grid;
    grid-template-columns: minmax(160px, 0.55fr) minmax(160px, 0.45fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0;
}
.rg-param-pair {
    display: grid;
    grid-template-columns:
        minmax(160px, 0.55fr) minmax(160px, 0.45fr)
        minmax(160px, 0.55fr) minmax(160px, 0.45fr);
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 0.3rem 0;
}
.rg-param-label {
    font-size: 0.82rem; color: #3a5070; font-weight: 500;
}
.rg-param-input {
    height: 32px; padding: 0 0.55rem;
    border: 1px solid #c4d5e8; border-radius: 6px;
    font-size: 0.82rem; color: var(--text); background: #fff;
    transition: border-color 120ms;
    min-width: 0;
}
.rg-param-input:focus {
    outline: none; border-color: var(--text-subtle);
    box-shadow: 0 0 0 3px rgba(60,64,67,0.1);
}
@media (max-width: 900px) {
    .rg-param-pair {
        grid-template-columns: minmax(160px, 0.55fr) minmax(160px, 0.45fr);
    }
}

/* ── Report period information (Step 2) ─────────────────────── */
.rg-period-table {
    margin-bottom: 0.5rem;
}
.rg-period-input {
    width: 100%;
    height: 30px; padding: 0 0.5rem;
    border: 1px solid #c4d5e8; border-radius: 6px;
    font-size: 0.82rem; color: var(--text); background: #fff;
    transition: border-color 120ms;
    box-sizing: border-box;
}
.rg-period-input:focus {
    outline: none; border-color: var(--text-subtle);
    box-shadow: 0 0 0 2px rgba(60,64,67,0.08);
}
.rg-period-add {
    width: 36px; height: 36px;
    border: none; border-radius: 6px;
    background: #22c55e; color: #fff;
    font-size: 1.2rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color 120ms, transform 120ms;
    margin-top: 0.25rem;
}
.rg-period-add:hover { background: var(--success); transform: translateY(-1px); }
.rg-period-add:active { transform: translateY(0); }

/* ── Presentation-grid period column headers (Step 3) ───────── */
.rg-period-dates {
    font-size: 0.7rem; color: #6b7d94;
    margin-top: 2px; line-height: 1.2;
    display: flex; flex-direction: column; gap: 1px;
    text-transform: none; letter-spacing: 0;
}
.rg-period-dates .rg-period-instant { color: #8797ab; }
.rg-cell-na {
    display: inline-block; padding: 0 0.3rem;
    color: #b0bec5; font-size: 0.9rem;
}

/* ── Document Converter ──────────────────────────────────────── */

.dc-section { margin-bottom: 0.75rem; }
.dc-section-header {
    cursor: pointer;
    font-weight: 600; font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc; border: 1px solid #e0e2e4;
    border-radius: 6px;
    -webkit-user-select: none;
    user-select: none;
}
.dc-section-header:hover { background: #ebedef; }
.dc-section[open] > .dc-section-header { border-radius: 6px 6px 0 0; border-bottom: none; }
.dc-section > .eb-table { border-top: none; border-radius: 0 0 6px 6px; }

.dc-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.dc-download-card {
    border: 1px solid #e0e2e4;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    background: #fff;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}
.dc-download-card:hover {
    border-color: var(--text-subtle);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dc-download-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.dc-download-label { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.dc-download-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.35; }

/* ── Document Converter: mapping UI ──────────────────────────── */

.dc-mapped { color: var(--success); }
.dc-unmapped { color: var(--danger); }

/* Document Converter - taxonomy step layout */
.dc-tax-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
}

.dc-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #e5edf5;
}

.dc-section-header .rg-section-title { margin: 0; }
.dc-section-header .rg-hint { margin: 0; }

.dc-tax-lang {
    max-width: 220px;
}

.dc-tax-actions {
    display: flex;
    gap: 0.65rem;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid #eef2f6;
}

.dc-filter-tabs-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dc-filter-tabs-row .dc-filter-tabs {
    margin-bottom: 0;
}

.dc-ai-assist-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dc-filter-tabs {
    display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.dc-filter-tab {
    padding: 0.35rem 0.9rem; border: 1px solid #cbd5e1; border-radius: 6px;
    background: #fff; font-size: 0.82rem; cursor: pointer; transition: all 0.15s;
}
.dc-filter-tab:hover { background: #f0f1f2; }
.dc-filter-tab.active { background: var(--brand); color: #fff; border-color: var(--text); }

.dc-mapping-table { font-size: 0.85rem; }

.dc-row-auto { background: #f5f7f5; }
.dc-row-confirmed { background: #f5f6f8; }
.dc-row-unmapped { background: #f9f5f5; }
.dc-row-skipped { background: #f8f8f8; opacity: 0.6; }

.dc-concept-id { font-size: 0.75rem; color: var(--text); word-break: break-all; }
.dc-concept-label { font-size: 0.8rem; color: var(--text-muted); }
.dc-concept-type { font-size: 0.72rem; color: var(--text-subtle); margin-left: 0.5rem; }

.dc-section-tag {
    font-size: 0.7rem; color: var(--text-muted); background: #f0f1f2;
    padding: 0.1rem 0.4rem; border-radius: 3px;
}

.dc-badge {
    display: inline-block; font-size: 0.65rem; font-weight: 600; padding: 0.1rem 0.4rem;
    border-radius: 3px; margin-left: 0.4rem; vertical-align: middle;
}
.dc-badge-auto { background: #e5ede7; color: #2e5e3a; }
.dc-badge-confirmed { background: #e6e8eb; color: var(--text); }

.dc-value {
    cursor: pointer; padding: 0.1rem 0.3rem; border-radius: 3px;
    transition: background 0.15s;
}
.dc-value:hover { background: #e0e2e4; }
.dc-value-selected { background: #e6e8eb; font-weight: 600; }

.dc-confidence-bar {
    width: 100%; height: 6px; background: #e0e2e4; border-radius: 3px; overflow: hidden;
}
.dc-confidence-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.dc-conf-high { background: var(--success); }
.dc-conf-medium { background: #a8860a; }
.dc-conf-low { background: #b33a3a; }
.dc-confidence-text { font-size: 0.72rem; color: var(--text-muted); }

.dc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 4px;
    background: #fff; cursor: pointer; font-size: 0.82rem; margin-right: 0.25rem;
    transition: all 0.15s;
}
.dc-btn:hover { background: #f0f1f2; }
.dc-btn-accept { color: var(--success); border-color: #b5ccba; }
.dc-btn-accept:hover { background: #e5ede7; }
.dc-btn-search { color: var(--text); border-color: var(--border-strong); }
.dc-btn-search:hover { background: #ebedef; }
.dc-btn-skip { color: var(--danger); border-color: #d4a5a5; }
.dc-btn-skip:hover { background: #f0e0e0; }
.dc-btn-undo { color: var(--text-muted); }

.dc-suggestions { margin-top: 0.4rem; }
.dc-suggestions summary { font-size: 0.75rem; color: var(--text); cursor: pointer; }
.dc-suggestions ul { list-style: none; padding: 0; margin: 0.3rem 0 0; }
.dc-suggestion-item {
    padding: 0.35rem 0.5rem; border: 1px solid #e0e2e4; border-radius: 4px;
    margin-bottom: 0.25rem; cursor: pointer; font-size: 0.78rem;
    transition: background 0.15s;
}
.dc-suggestion-item:hover { background: #f5f6f7; }
.dc-confidence { font-size: 0.7rem; color: var(--text-muted); margin-left: 0.5rem; }
.dc-match-reason { font-size: 0.68rem; color: var(--text-subtle); margin-left: 0.3rem; }

.dc-search-results {
    margin-top: 0.4rem; max-height: 300px; overflow-y: auto;
    border: 1px solid #e0e2e4; border-radius: 6px; background: #fff;
}
.dc-search-result-item {
    padding: 0.4rem 0.6rem; border-bottom: 1px solid #f0f1f2;
    cursor: pointer; font-size: 0.78rem; transition: background 0.15s;
}
.dc-search-result-item:hover { background: #f5f6f7; }
.dc-search-result-item:last-child { border-bottom: none; }

.dc-mapping-summary { font-size: 0.85rem; color: var(--text-muted); margin-right: 1rem; }

/* ── Edit panel ──────────────────────────────────────────────── */
.dc-edit-row td { background: #f8faff; padding: 0 !important; }
.dc-edit-panel {
    padding: 0.75rem 1rem; border-top: 2px solid #80868b;
}
.dc-edit-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.dc-edit-section { display: flex; flex-direction: column; gap: 0.25rem; }
.dc-edit-label { font-weight: 600; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dc-edit-col-label { font-size: 0.75rem; color: var(--text-muted); min-width: 50px; }
.dc-edit-hint { font-size: 0.7rem; color: var(--text-subtle); }
.dc-edit-tag { display: inline-block; font-size: 0.65rem; background: #ebedef; color: var(--text); padding: 0.05rem 0.35rem; border-radius: 3px; margin-right: 0.2rem; }
.dc-value-edited { border-bottom: 1px dashed #80868b; }

/* ── Journey-first navigation (Phase 1) ─────────────────────── */

.app-nav .nav-link.nav-journey {
    color: #f0f7ff;
    border-color: rgba(163, 190, 220, 0.18);
    background: rgba(255, 255, 255, 0.04);
}

.app-nav .nav-link.nav-journey.active {
    color: #ffffff;
    border-color: rgba(125, 201, 255, 0.55);
    background: linear-gradient(135deg, rgba(60, 64, 67, 0.72) 0%, rgba(10, 136, 225, 0.66) 100%);
    box-shadow: inset 0 0 0 1px rgba(213, 236, 255, 0.3), 0 6px 18px rgba(60, 64, 67, 0.38);
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-dropdown-details {
    position: relative;
}

.nav-dropdown-details > summary {
    list-style: none;
    cursor: pointer;
}

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

.nav-dropdown-details > summary::marker {
    content: "";
    display: none;
}

.nav-dropdown .nav-dropdown-toggle {
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #cfdded;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    transition: 160ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    -webkit-user-select: none;
    user-select: none;
}

.nav-dropdown .nav-dropdown-toggle:hover {
    color: #f5fbff;
    border-color: rgba(163, 190, 220, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-details[open] > .nav-dropdown-toggle {
    color: #f5fbff;
    border-color: rgba(125, 201, 255, 0.4);
    background: rgba(60, 64, 67, 0.35);
}

.nav-dropdown .nav-chevron {
    font-size: 0.65rem;
    opacity: 0.75;
    transition: transform 160ms ease;
}

.nav-dropdown-details[open] .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 240px;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid rgba(148, 174, 204, 0.35);
    border-radius: 12px;
    box-shadow: 0 20px 44px rgba(15, 34, 56, 0.22);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.nav-dropdown-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.5rem 0.7rem 0.3rem;
}

.nav-dropdown-heading:not(:first-child) {
    border-top: 1px solid #ebedef;
    margin-top: 0.25rem;
    padding-top: 0.6rem;
}

.nav-dropdown-item {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    transition: 140ms ease;
}

.nav-dropdown-item:hover {
    background: #eef5ff;
    color: var(--text);
}

.nav-dropdown-item.active {
    background: linear-gradient(135deg, #f0f1f2 0%, #dbe9ff 100%);
    color: #0b4aa6;
    font-weight: 600;
}

/* ── Journey hero ───────────────────────────────────────────── */

.journey-hero {
    position: relative;
    padding: 2rem 2.2rem 1.9rem;
    border-radius: 18px;
    color: #fafafa;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.20);
}

.journey-hero-create {
    background: linear-gradient(135deg, #1d334f 0%, #264b70 58%, #536b83 100%);
}

.journey-hero-review {
    background: linear-gradient(135deg, #203846 0%, #2f5f66 58%, #55737c 100%);
}

.journey-hero-explore {
    background: linear-gradient(135deg, #111827 0%, #273344 58%, #475569 100%);
}

.journey-hero-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.journey-hero-title {
    margin: 0 0 0.5rem;
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
}

.journey-hero-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(248, 251, 255, 0.88);
    max-width: 760px;
}

/* ── Journey cards (homepage + hub pages) ───────────────────── */

.journey-card {
    position: relative;
    padding: 1.5rem 1.4rem;
}

.journey-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: transparent;
}

.journey-card h3 {
    font-size: 1.08rem;
}

.journey-card p {
    font-size: 0.88rem;
    line-height: 1.5;
}

.journey-card-cta {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

.journey-card:hover .journey-card-cta {
    color: var(--brand-hover);
}

.journey-card-create:hover { border-color: var(--brand); }
.journey-card-review:hover { border-color: var(--border-strong); }
.journey-card-validate:hover { border-color: #8aa0aa; }
.journey-card-explore:hover { border-color: var(--border-strong); }

.journey-tip {
    padding: 0.85rem 1.15rem;
    background: linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
    border: 1px solid #d2dce8;
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #2f4861;
}

.journey-tip strong {
    color: var(--brand-hover);
}

/* ── Tool cards (compact row on homepage "All tools") ───────── */

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    height: 100%;
    padding: 0.9rem 1rem;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 26px rgba(16, 24, 40, 0.11);
}

.tool-card-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #536173 0%, #364252 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tool-card h4 {
    margin: 0 0 0.2rem;
    font-size: 0.9rem;
    color: var(--text);
}

.tool-card p {
    margin: 0;
    font-size: 0.77rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ── Home: compact hero, static feature card, primary action, advanced tools ── */

.hero-panel-compact {
    padding: 1.6rem 2rem;
    margin-bottom: 1.25rem;
}

.hero-panel-compact .hero-title {
    font-size: clamp(1.45rem, 1.1rem + 0.9vw, 1.9rem);
    margin-bottom: 0.4rem;
}

.hero-panel-compact .hero-subtitle {
    font-size: 0.92rem;
}

.feature-card-static {
    cursor: default;
}

.feature-card-static:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.primary-action-card {
    overflow: hidden;
    border-color: #7f94ad;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    background: #ffffff;
}

.primary-action-card::before {
    background: #3577a8;
}

.primary-action-card:hover {
    border-color: #56708f;
    box-shadow: 0 16px 34px rgba(16, 24, 40, 0.12);
}

/* Journey-card top accent stripes (scoped - does not affect shared icon classes) */
.journey-card-create::before { background: #3577a8; }
.journey-card-review::before { background: #5c92be; }
.journey-card-validate::before { background: #7faa9b; }

/* Journey-card icon hues (scoped overrides of shared .icon-* classes) */
.journey-card-create .feature-icon {
    background: #1e3e60;
    box-shadow: 0 6px 14px rgba(30, 62, 96, 0.30);
}

.journey-card-review .feature-icon {
    background: #2f6694;
    box-shadow: 0 6px 14px rgba(47, 102, 148, 0.28);
}

.journey-card-validate .feature-icon {
    background: #4a7d6e;
    box-shadow: 0 6px 14px rgba(74, 125, 110, 0.28);
}

.advanced-tools {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.advanced-tools[open] .advanced-tools-chevron {
    transform: rotate(180deg);
}

.advanced-tools-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.4rem 0;
    -webkit-user-select: none;
    user-select: none;
}

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

.advanced-tools-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.advanced-tools-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.advanced-tools-chevron {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 160ms ease;
}

.advanced-tools-summary:hover .advanced-tools-title {
    color: var(--brand-hover);
}

@media (max-width: 960px) {
    .nav-dropdown .nav-dropdown-menu {
        right: auto;
        left: 0;
    }
}

/* ── Wizard stepper (in-page horizontal step indicator) ──────── */

.wiz-stepper {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0 0 1.25rem;
    padding: 0.45rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow-x: auto;
}

.wiz-step {
    flex: 1 1 0;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: var(--text-muted);
    font-family: inherit;
    font-size: inherit;
    position: relative;
    transition: background-color 140ms ease, color 140ms ease;
}

.wiz-step + .wiz-step::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 14px;
    border-top: 1px dashed #cbd5e1;
    transform: translateY(-50%);
}

.wiz-step:hover:not(:disabled) {
    background: rgba(15, 34, 56, 0.04);
    color: #1f2937;
}

.wiz-step:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.wiz-step-mark {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: #e2e8f0;
    color: var(--text-muted);
    transition: background 140ms ease, color 140ms ease;
}

.wiz-step-body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.wiz-step-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: inherit;
}

.wiz-step-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.wiz-step.is-current {
    background: rgba(59, 130, 246, 0.08);
}

.wiz-step.is-current .wiz-step-mark {
    background: var(--brand);
    color: #fff;
}

.wiz-step.is-current .wiz-step-title {
    color: var(--brand);
}

.wiz-step.is-complete .wiz-step-mark {
    background: var(--success);
    color: #fff;
}

.wiz-step.is-complete .wiz-step-title {
    color: #047857;
}

.wiz-step.is-current.is-complete {
    background: rgba(16, 185, 129, 0.08);
}

.wiz-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

@media (max-width: 720px) {
    .wiz-step {
        min-width: 130px;
        padding: 0.45rem 0.55rem;
    }

    .wiz-step-detail {
        max-width: 140px;
    }
}

/* ── Framework template gallery (Report Generator step 1) ─────── */

.tpl-gallery {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.tpl-gallery-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.tpl-gallery-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.tpl-gallery-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tpl-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}

button.tpl-card,
.tpl-card {
    --tpl-accent: #3b82f6;
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    - webkit-appearance: none;
    appearance: none;
}

.tpl-card:hover {
    border-color: var(--tpl-accent);
    box-shadow: 0 6px 18px rgba(15, 34, 56, 0.08);
    transform: translateY(-1px);
}

.tpl-card.is-selected {
    border-color: var(--tpl-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tpl-accent) 18%, transparent);
    background: color-mix(in srgb, var(--tpl-accent) 5%, #ffffff);
}

.tpl-card-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.tpl-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tpl-accent);
    flex: 0 0 auto;
}

.tpl-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.tpl-card-region {
    margin-left: auto;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.05);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.tpl-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Report progress bar (Open/Create -> Review -> Validate -> Preview -> Export) */

.rpb-bar {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border-bottom: 1px solid #e5e9f0;
    box-shadow: inset 0 -1px 0 rgba(15, 34, 56, 0.04);
}

.rpb-inner {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.55rem 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
}

.rpb-step {
    flex: 1 1 0;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-muted);
    transition: background-color 140ms ease, color 140ms ease;
    position: relative;
}

.rpb-step + .rpb-step::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.rpb-step:hover:not(:disabled) {
    background: rgba(15, 34, 56, 0.04);
    color: #1f2937;
}

.rpb-step:disabled {
    cursor: default;
    opacity: 0.65;
}

.rpb-step-mark {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e2e8f0;
    color: var(--text-muted);
}

.rpb-step-body {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.rpb-step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: inherit;
}

.rpb-step-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.rpb-step-done .rpb-step-mark {
    background: var(--success);
    color: #fff;
}

.rpb-step-done .rpb-step-label {
    color: #047857;
}

.rpb-step-active {
    background: rgba(59, 130, 246, 0.06);
}

.rpb-step-active .rpb-step-mark {
    background: var(--brand);
    color: #fff;
}

.rpb-step-active .rpb-step-label {
    color: var(--brand);
}

.rpb-step-active.rpb-step-fix .rpb-step-mark,
.rpb-step[data-mark="!"] .rpb-step-mark {
    background: var(--danger);
}

.rpb-step-upcoming .rpb-step-mark {
    background: transparent;
    color: var(--text-subtle);
    border: 1px dashed #cbd5e1;
}

@media (max-width: 720px) {
    .rpb-step {
        min-width: 120px;
    }

    .rpb-step-detail {
        max-width: 140px;
    }
}

/* ── Filed banner (post-export terminal state) ──────────────── */

.filed-banner {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    border-bottom: 1px solid #6ee7b7;
}

.filed-banner-inner {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.65rem 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.filed-banner-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.filed-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

.filed-banner-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #065f46;
}

.filed-banner-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #047857;
}

.filed-banner-file {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "JetBrains Mono", monospace;
}

.filed-banner-sep {
    opacity: 0.55;
}

.filed-banner-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filed-banner-btn {
    border: 1px solid #6ee7b7;
    background: #ffffff;
    color: #047857;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.filed-banner-btn:hover {
    background: #ecfdf5;
    border-color: var(--success);
}

.filed-banner-btn-primary {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.filed-banner-btn-primary:hover {
    background: var(--success);
    border-color: var(--success);
}

/* ── Taxonomy context bar (Phase 2) ─────────────────────────── */

.tctx-bar {
    background: linear-gradient(180deg, #eaf2ff 0%, #dce9fb 100%);
    border-bottom: 1px solid #b8cfec;
    box-shadow: inset 0 -1px 0 rgba(15, 34, 56, 0.04);
}

.tctx-bar-inner {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.55rem 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.tctx-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tctx-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.tctx-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}

.tctx-source {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-all;
}

.tctx-stats {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tctx-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0b3f82;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #c9dcf5;
    border-radius: 999px;
    white-space: nowrap;
}

.tctx-chip-muted {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.45);
}

.tctx-actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.tctx-btn {
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border: 1px solid #b8cfec;
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
    transition: 140ms ease;
}

.tctx-btn:hover {
    color: #073e8a;
    border-color: #7fb0e8;
    background: #f3f8ff;
}

.tctx-btn-ghost {
    color: var(--text-muted);
    background: transparent;
    border-color: transparent;
}

.tctx-btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
    border-color: #c9dcf5;
}

@media (max-width: 720px) {
    .tctx-bar-inner {
        flex-wrap: wrap;
    }
    .tctx-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .tctx-source {
        max-width: none;
    }
}

/* ── Validation Gate modal (Phase 2) ────────────────────────── */

.vg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 34, 56, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
    animation: vg-fade-in 160ms ease-out;
}

@keyframes vg-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.vg-modal {
    width: min(640px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(15, 34, 56, 0.35);
    overflow: hidden;
    animation: vg-pop 180ms ease-out;
}

@keyframes vg-pop {
    from { transform: translateY(10px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.vg-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.3rem;
    color: #fff;
}

.vg-header-ok {
    background: linear-gradient(135deg, #059669, #10b981);
}

.vg-header-blocked {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.vg-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    flex-shrink: 0;
}

.vg-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.vg-body {
    padding: 1.1rem 1.3rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.vg-body-lead {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #1e293b;
}

.vg-msg-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.vg-msg {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.83rem;
}

.vg-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.vg-msg-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.vg-msg-code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.78;
}

.vg-msg-text {
    line-height: 1.4;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.vg-msg-code {
    flex-shrink: 0;
}

.vg-msg-source {
    margin-left: auto;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-muted);
    align-self: flex-start;
    flex-shrink: 0;
}

.vg-msg-overflow {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.vg-warnings {
    margin-top: 0.9rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.8rem;
}

.vg-warnings > summary {
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: #78350f;
    padding: 0.2rem 0;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Plain-language validation cards ─────────────────────────── */

.vg-msg-cards {
    gap: 0.6rem;
}

/* ── Fix Center: grouped validation cards ───────────────────── */

.vg-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.vg-group-card {
    list-style: none;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    border: 1px solid transparent;
}

.vg-group-card.vg-msg-card-error {
    background: #fef2f2;
    border-color: #fecaca;
}

.vg-group-card.vg-msg-card-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.vg-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.vg-group-rootcause {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: #444;
}

.vg-group-count {
    margin-left: auto;
    color: #555;
    font-variant-numeric: tabular-nums;
}

.vg-group-title {
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.vg-group-summary {
    margin-top: 0.2rem;
    font-size: 0.86rem;
    color: #444;
}

.vg-group-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.vg-group-messages {
    margin-top: 0.65rem;
    padding-left: 0.6rem;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.rv-facts-locate-chip {
    margin-left: 0.4rem;
}

.vg-msg-card {
    list-style: none;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

.vg-msg-card-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.vg-msg-card-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.vg-msg-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.vg-msg-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.12);
    color: inherit;
}

.vg-msg-card-warn .vg-msg-tag {
    background: rgba(120, 53, 15, 0.12);
}

.vg-msg-card .vg-msg-source {
    margin-left: auto;
}

.vg-msg-explanation {
    color: #1f2937;
}

.vg-msg-card-error .vg-msg-explanation {
    color: #4b1a1a;
}

.vg-msg-card-warn .vg-msg-explanation {
    color: #4a2c0a;
}

.vg-msg-explanation p {
    margin: 0 0 0.5rem;
}

.vg-msg-explanation p:last-child {
    margin-bottom: 0;
}

.vg-msg-explanation code {
    background: rgba(15, 23, 42, 0.06);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.78rem;
}

.vg-msg-tech {
    margin-top: 0.55rem;
    font-size: 0.78rem;
}

.vg-msg-tech > summary {
    cursor: pointer;
    color: var(--text-muted);
    -webkit-user-select: none;
    user-select: none;
    padding: 0.15rem 0;
}

.vg-msg-tech[open] > summary {
    margin-bottom: 0.35rem;
}

.vg-msg-tech-body {
    background: rgba(15, 23, 42, 0.04);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vg-msg-tech-label {
    display: inline-block;
    min-width: 96px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.vg-msg-tech-body code {
    background: rgba(15, 23, 42, 0.08);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.78rem;
}

.vg-msg-tech-text {
    color: #374151;
    word-break: break-word;
}

.vg-ai-panel {
    margin-top: 0.55rem;
}

.vg-ai-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    color: #374151;
}

.vg-ai-head span {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vg-ai-head small {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
}

.vg-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.3rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.vg-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: 140ms ease;
}

.vg-btn:hover {
    border-color: var(--text-subtle);
    background: #f0f1f2;
}

.vg-btn-primary {
    background: var(--brand);
    border-color: var(--text);
    color: #ffffff;
}

.vg-btn-primary:hover {
    background: #073e8a;
    border-color: #073e8a;
    color: #ffffff;
}

/* ── Inline gate banner (DocumentConverter) ─────────────────── */

.dc-gate-banner {
    margin: 0.75rem 0;
    padding: 0.7rem 0.95rem;
    border-radius: 10px;
    font-size: 0.86rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.dc-gate-banner a {
    margin-left: auto;
    font-weight: 600;
    text-decoration: none;
}

.dc-gate-ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.dc-gate-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.dc-gate-warn a { color: #78350f; }

.dc-gate-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7a2e2e;
}

.dc-gate-error a { color: #7a2e2e; }

/* ── Unified Review page (Phase 2c) ─────────────────────────── */

.rv-upload-card {
    margin: 1rem 0;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rv-upload-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rv-upload-caption {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.rv-upload-selected {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.rv-upload-actions {
    display: flex;
    gap: 0.5rem;
}

.rv-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.rv-back-row {
    margin-bottom: 0.6rem;
}

.rv-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.32rem 0.85rem;
    cursor: pointer;
    transition: 140ms ease;
}

.rv-back-btn:hover {
    color: #073e8a;
    border-color: #7fb0e8;
    background: #f3f8ff;
}

.rv-session-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.9rem;
}

.rv-session-meta {
    min-width: 0;
    flex: 1;
}

.rv-session-eyebrow {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.rv-session-filename {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.rv-session-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rv-stat-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0b3f82;
    background: #f0f1f2;
    border-radius: 999px;
}

.rv-stat-chip-muted {
    color: var(--text-muted);
    background: #eef2f7;
}

.rv-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #cdd9e8;
    padding: 0 0.2rem;
    margin-bottom: 1rem;
}

.rv-tab {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    padding: 0.6rem 1.1rem;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: 140ms ease;
    margin-bottom: -1px;
}

.rv-tab:hover {
    color: var(--text);
    background: #f1f6ff;
}

.rv-tab.active {
    color: var(--text);
    background: #ffffff;
    border-color: #cdd9e8;
    border-bottom: 1px solid #ffffff;
}

.rv-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
}

.rv-tab-badge-error { background: #f0e0e0; color: #7a2e2e; }
.rv-tab-badge-warn  { background: #fef3c7; color: #92400e; }
.rv-tab-badge-ok    { background: #e5ede7; color: #2e5e3a; }
.rv-tab-badge-muted { background: #e0e2e4; color: var(--text-muted); }

.rv-tab-panel {
    padding: 0.5rem 0 2rem;
}

.rv-facts-related-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.7rem;
    border: 1px solid rgba(36, 99, 235, 0.18);
    background: rgba(36, 99, 235, 0.06);
    border-radius: 8px;
    font-size: 0.85rem;
}

.rv-facts-related-label {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.rv-facts-related-title {
    flex: 1 1 auto;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rv-facts-related-clear {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.rv-facts-related-clear:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.rv-facts-toolbar {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.rv-facts-search {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    border: 1px solid #cdd9e8;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.rv-facts-search:focus {
    outline: none;
    border-color: #7fb0e8;
    box-shadow: 0 0 0 3px rgba(60, 64, 67, 0.12);
}

.rv-facts-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.rv-facts-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
}

.rv-facts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rv-facts-table thead th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid #e0e2e4;
    white-space: nowrap;
}

.rv-facts-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f1f2;
    vertical-align: top;
}

.rv-facts-table tbody tr:hover {
    background: #fafafa;
}

.rv-facts-concept {
    font-weight: 600;
    color: var(--text);
}

.rv-facts-period,
.rv-facts-unit {
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rv-facts-col-value {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    max-width: 40ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-facts-col-dec {
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    width: 6ch;
}

.rv-facts-nil {
    color: var(--text-subtle);
    font-style: italic;
}

.rv-facts-id {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.rv-facts-entity {
    font-weight: 600;
    color: var(--text);
}

.rv-facts-entity-scheme {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    color: var(--text-subtle);
    margin-top: 0.15rem;
}

.rv-facts-muted {
    color: var(--text-subtle);
}

.facts-inner-tabs {
    margin-bottom: 0.5rem;
}

.rv-footnote-block {
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.rv-footnote-block .rv-facts-table {
    border: 0;
}

.rv-footnote-role {
    padding: 0.55rem 0.85rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.74rem;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    word-break: break-all;
}

.rv-facts-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.9rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rv-rendered-wrap {
    position: relative;
    padding: 1.25rem;
    background: linear-gradient(180deg, #f8fbfd 0%, #eef3f7 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 60vh;
    max-height: calc(100vh - 220px);
    overflow: auto;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Preview wrapper - hosts toolbar + rendered report, supports fullscreen mode. */
.ws-preview {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ws-preview.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    padding: 0.75rem 1rem 1rem;
    background: var(--surface-soft, #f4f6f8);
    gap: 0.75rem;
    overflow: hidden;
}

/* `.page-shell`'s `backdrop-filter` creates a containing block, which would
   trap `position: fixed` on the fullscreen overlay inside the page-shell rect
   instead of the viewport. Disable the filter while the preview is fullscreen
   so the overlay can actually cover the whole window. */
.page-shell:has(.ws-preview.is-fullscreen) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.ws-preview.is-fullscreen .ws-render-toolbar {
    margin-bottom: 0;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.ws-preview.is-fullscreen .rv-rendered-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: 100%;
}

.ws-preview.is-fullscreen .ws-render-empty-hint {
    margin-bottom: 0;
}

.ws-render-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ws-render-fullscreen[aria-pressed="true"] {
    background: var(--brand-soft, #eef4ff);
    color: var(--brand, #2463eb);
    border-color: var(--brand, #2463eb);
}

/* Keep rendered-report children inside the preview frame: any TOC or nav
   the renderer emits with absolute/fixed widths reflows instead of bleeding
   past the workspace canvas. */
.rv-rendered-wrap > * {
    max-width: 100%;
    box-sizing: border-box;
}

.rv-rendered-wrap nav,
.rv-rendered-wrap aside {
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
}

.rv-val-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.2rem 0 0.5rem;
}

.rv-val-summary {
    margin-bottom: 0.5rem;
}

/* ── Workspace progress chip (global, shown in MainLayout while a long op is running) ── */
.wp-chip {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 auto;
    width: min(1320px, calc(100% - 2rem));
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem;
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-radius: 10px;
    margin-top: 0.4rem;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
    font-size: 0.85rem;
    color: #7c2d12;
}

.wp-chip-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fdba74;
    border-top-color: #ea580c;
    animation: wp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes wp-spin {
    to { transform: rotate(360deg); }
}

.wp-chip-text {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.wp-chip-stage {
    font-weight: 700;
    color: #9a3412;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.wp-chip-message {
    color: #7c2d12;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wp-chip-bar {
    flex: 0 0 120px;
    height: 6px;
    background: rgba(234, 88, 12, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.wp-chip-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #ea580c);
    transition: width 0.18s ease-out;
}

.wp-chip-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #9a3412;
    flex-shrink: 0;
}

/* ── Issues badge in navbar ── */
.nav-issues-slot {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.ib-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s;
    font-family: inherit;
}

.ib-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ib-btn:active {
    transform: scale(0.97);
}

.ib-btn-pending { color: var(--text-muted); border-color: rgba(255, 255, 255, 0.2); }
.ib-btn-ok      { color: var(--success); border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.10); }
.ib-btn-warn    { color: #f59e0b; border-color: rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.12); }
.ib-btn-error   { color: #fca5a5; border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.18); }

.ib-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.ib-dot-pending { background: #9ca3af; }
.ib-dot-ok      { background: var(--success); }
.ib-dot-warn    { background: #f59e0b; }
.ib-dot-error   { background: var(--danger); animation: ib-pulse 1.6s ease-in-out infinite; }

@keyframes ib-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ── Issues drawer ── */
.id-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.35);
    z-index: 90;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.id-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100vw);
    background: #ffffff;
    box-shadow: -12px 0 28px rgba(15, 34, 56, 0.18);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: id-slide-in 0.22s ease-out;
}

@keyframes id-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.id-drawer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}

.id-drawer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    flex: 1 1 auto;
}

.id-close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.4rem;
    border-radius: 6px;
}

.id-close:hover {
    background: #e5e7eb;
    color: var(--text);
}

.id-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.5rem;
}

/* ── Export menu in navbar ── */
.nav-export-slot {
    display: flex;
    align-items: center;
}

.em-root {
    position: relative;
}

.em-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    transition: filter 0.15s ease;
}

.em-toggle::-webkit-details-marker { display: none; }

.em-toggle:hover { filter: brightness(1.08); }

.em-chev {
    font-size: 0.7rem;
    opacity: 0.85;
}

.em-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(11, 17, 32, 0.18);
    padding: 0.4rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    animation: em-fade-in 0.14s ease-out;
}

@keyframes em-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.em-item {
    appearance: none;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: var(--text);
    font-family: inherit;
}

.em-item:hover { background: #f3f4f6; }

.em-item-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.em-item-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.em-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.25rem 0;
}

.em-warning {
    margin-top: 0.3rem;
    padding: 0.45rem 0.7rem;
    border-radius: 7px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.72rem;
    border: 1px solid #fecaca;
}

/* ── Recent workspaces ── */
.rw-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.rw-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s;
}

.rw-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.10);
}

.rw-card:active { transform: translateY(1px); }
.rw-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.rw-card-status {
    width: 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rw-status-pending { background: #d1d5db; }
.rw-status-ok      { background: linear-gradient(180deg, #34d399, #059669); }
.rw-status-warn    { background: linear-gradient(180deg, #fbbf24, #d97706); }
.rw-status-error   { background: linear-gradient(180deg, #f87171, #dc2626); }

.rw-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rw-card-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rw-card-tax {
    font-size: 0.74rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rw-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.rw-card-stats {
    display: inline-flex;
    gap: 0.4rem;
    font-weight: 600;
}

.rw-stat-ok   { color: #047857; }
.rw-stat-warn { color: #b45309; }
.rw-stat-err  { color: var(--danger); }

.rw-card-remove {
    position: absolute;
    top: 4px;
    right: 6px;
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.rw-card:hover .rw-card-remove,
.rw-card:focus-within .rw-card-remove { opacity: 1; }

.rw-card-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* ── Global drag-and-drop zone (covers the viewport while a file is dragged) ── */
.gd-zone {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.gd-zone .gd-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.gd-zone.gd-active {
    pointer-events: auto;
}

.gd-zone.gd-active .gd-input {
    pointer-events: auto;
    cursor: copy;
}

.gd-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 34, 56, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.gd-zone.gd-active .gd-overlay {
    opacity: 1;
}

.gd-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 2px dashed var(--brand);
    box-shadow: 0 24px 48px rgba(11, 17, 32, 0.35);
    color: var(--text);
    text-align: center;
    max-width: 28rem;
}

.gd-icon {
    font-size: 3rem;
    line-height: 1;
    color: var(--brand);
}

.gd-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.gd-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── ConceptHelp inline tooltip ── */
.ch-root {
    position: relative;
    display: inline-block;
    margin-left: 0.35rem;
}

.ch-trigger {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.ch-trigger:hover {
    background: #e0e7ff;
    color: var(--brand);
    border-color: #93c5fd;
}

.ch-trigger-open {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.ch-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 70;
    width: min(320px, 80vw);
    padding: 0.7rem 0.85rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 16px 32px rgba(11, 17, 32, 0.16);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text);
    white-space: normal;
}

.ch-pop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.35rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
}

.ch-close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 0.3rem;
    border-radius: 4px;
}

.ch-close:hover { background: #f3f4f6; color: var(--text); }

.ch-loading {
    color: var(--text-muted);
    font-style: italic;
}

.ch-text {
    line-height: 1.4;
    color: #1f2937;
}

.ch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.ch-tag {
    font-size: 0.68rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-weight: 600;
}

.rv-facts-concept-name {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--text-subtle);
    margin-top: 0.15rem;
    word-break: break-all;
}

.rv-facts-concept-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.rv-facts-concept-label {
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.ws-render-empty-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ws-render-empty-hint em {
    font-style: italic;
    font-weight: 600;
}

/* Unified workspace shell */
.ws-start-flow {
    max-width: 920px;
}

.ws-shell {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.ws-rail {
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.ws-rail-head {
    min-width: 0;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #edf0f2;
}

.ws-eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.ws-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-step-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ws-step {
    appearance: none;
    width: 100%;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    text-align: left;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.65rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease;
}

.ws-step:hover {
    background: #f3f8ff;
    border-color: #bfdbfe;
}

.ws-step.is-complete {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ws-step.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.ws-step-mark {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.ws-step strong {
    display: block;
    color: #111827;
    font-size: 0.84rem;
    line-height: 1.2;
}

.ws-step small {
    display: block;
    min-width: 0;
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-rail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ws-rail-stats span {
    display: inline-flex;
    padding: 0.22rem 0.52rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.ws-new-btn {
    justify-content: center;
}

.ws-canvas {
    min-width: 0;
}

.ws-render-toolbar,
.ws-validation-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.65rem;
    padding: 0.75rem;
    margin-bottom: 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* Render-toolbar: grouped variant - separates view, show, actions */
.ws-render-toolbar-grouped {
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
}

.ws-render-group {
    display: flex;
    align-items: end;
    gap: 0.55rem;
    flex-wrap: nowrap;
}

.ws-render-group-show {
    align-items: center;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.03);
    flex-wrap: wrap;
}

.ws-render-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-right: 0.35rem;
}

.ws-render-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 0.15rem 0;
}

.ws-render-narrow { min-width: 70px !important; }
.ws-render-narrow input { width: 4.5rem; }
.ws-render-language select { width: 5.25rem; }

.ws-render-toolbar-grouped .ws-render-group label,
.ws-render-toolbar-grouped .ws-render-group-show .ws-check {
    min-width: 0;
}

.ws-render-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ws-render-toolbar label,
.ws-validation-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.ws-render-toolbar label > span,
.ws-validation-toolbar label > span {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ws-rule-chips {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.55rem;
    margin-top: 0.25rem;
    border-top: 1px dashed var(--border);
}

.ws-rule-chips-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ws-rule-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ws-rule-chips-hint {
    font-size: 0.74rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

.ws-render-toolbar .ws-check {
    min-width: auto;
    flex-direction: row;
    align-items: center;
    padding-bottom: 0.35rem;
}

.ws-render-toolbar .ws-check span {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

    .ws-rail {
        position: static;
    }
}

/* ── Anonymous landing: enhanced hero + step cards ─────────────── */

.hero-landing {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.4rem;
    align-items: center;
    padding: 2.6rem 2.6rem 2.4rem;
}

.hero-landing-content {
    position: relative;
    min-width: 0;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(199, 219, 240, 0.82);
    padding: 0.32rem 0.75rem 0.32rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 1.1rem;
}

.hero-eyebrow-mark {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #6cc5ff;
    box-shadow: 0 0 0 3px rgba(108, 197, 255, 0.20);
}

.hero-landing .hero-title {
    margin-bottom: 0.85rem;
    max-width: 24ch;
    line-height: 1.12;
    font-size: clamp(1.85rem, 1.4rem + 1.4vw, 2.65rem);
}

.hero-landing .hero-subtitle {
    max-width: 46ch;
    font-size: 1.02rem;
    line-height: 1.55;
}

.hero-cta-row {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.6rem;
}

.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
}

.hero-cta-primary svg {
    flex: 0 0 auto;
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.95rem;
    color: rgba(239, 247, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    transition: 160ms ease;
}

.hero-cta-secondary:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.10);
}

.hero-conformance {
    margin: 1.65rem 0 0;
    padding: 1.15rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.hero-conformance-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.9rem;
    margin-bottom: 0.7rem;
}

.hero-conformance-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(199, 219, 240, 0.62);
}

.hero-conformance-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #a7f3d0;
    padding: 0.18rem 0.6rem 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.32);
    font-variant-numeric: tabular-nums;
}

.hero-conformance-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hero-conformance-chips li {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(232, 240, 250, 0.82);
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    white-space: nowrap;
}

.hero-landing-visual {
    position: relative;
    min-width: 0;
}

.hero-landing-visual svg {
    width: 100%;
    height: auto;
    max-width: 460px;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 22px 46px rgba(0, 0, 0, 0.30));
}

.steps-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    margin: 1.75rem 0 0;
}

.steps-row::before {
    content: "";
    position: absolute;
    top: 60px;
    left: 17%;
    right: 17%;
    height: 2px;
    background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.2px);
    background-size: 8px 2px;
    background-repeat: repeat-x;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
}

.step-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 1.45rem 1.4rem 1.55rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.09);
    border-color: var(--border-strong);
}

.step-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.step-card-num {
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--text-subtle);
}

.step-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #2f6694;
    box-shadow: 0 8px 18px rgba(47, 102, 148, 0.28);
}

.step-card-icon.icon-brand {
    background: #1e3e60;
    box-shadow: 0 8px 18px rgba(30, 62, 96, 0.30);
}

.step-card-icon.icon-primary {
    background: #2f6694;
    box-shadow: 0 8px 18px rgba(47, 102, 148, 0.28);
}

.step-card-icon.icon-success {
    background: #4a7d6e;
    box-shadow: 0 8px 18px rgba(74, 125, 110, 0.28);
}

.step-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.08rem;
    color: var(--text);
}

.step-card > p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.step-card-tags {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.step-card-tags li {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
}

@media (max-width: 920px) {
    .hero-landing {
        grid-template-columns: 1fr;
        gap: 1.6rem;
        padding: 2rem 1.6rem;
    }

    .hero-landing-visual {
        max-width: 380px;
        margin: 0 auto;
    }

    .steps-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .steps-row::before {
        display: none;
    }
}

/* ── Workspace stage strip (Open/Create → Review → Validate → Preview → Export) ── */

.ws-stages {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0 0 1.1rem;
    padding: 0.45rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ws-stage {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: 140ms ease;
    font-family: inherit;
    position: relative;
}

.ws-stage:hover:not(:disabled) {
    background: #ffffff;
    border-color: var(--border);
}

.ws-stage.is-active {
    background: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-ring);
}

.ws-stage:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ws-stage-mark {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e4ebf2;
    color: var(--text-muted);
    transition: 140ms ease;
}

.ws-stage.is-active .ws-stage-mark {
    background: var(--brand);
    color: #ffffff;
}

.ws-stage.is-complete .ws-stage-mark {
    background: #2f6f57;
    color: #ffffff;
}

.ws-stage.is-warn .ws-stage-mark {
    background: #b45309;
    color: #ffffff;
}

.ws-stage.is-error .ws-stage-mark {
    background: #b91c1c;
    color: #ffffff;
}

.ws-stage.is-ready .ws-stage-mark {
    background: #2f6694;
    color: #ffffff;
}

.ws-stage-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.ws-stage-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-stage.is-active .ws-stage-title {
    color: var(--brand-hover);
}

.ws-stage-detail {
    font-size: 0.72rem;
    color: var(--text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-stage-badge {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.ws-stage-badge-error { background: #fbeaea; color: #7a2e2e; }
.ws-stage-badge-warn  { background: #fef3c7; color: #92400e; }
.ws-stage-badge-ok    { background: #e5ede7; color: #2e5e3a; }
.ws-stage-badge-muted { background: #e0e2e4; color: var(--text-muted); }

.ws-stages-sep {
    align-self: center;
    flex: 0 0 auto;
    color: var(--text-subtle);
    font-size: 1rem;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
}

@media (max-width: 1100px) {
    .ws-stages { flex-wrap: wrap; }
    .ws-stage { flex: 1 1 calc(50% - 0.5rem); }
    .ws-stages-sep { display: none; }
}

@media (max-width: 640px) {
    .ws-stage { flex: 1 1 100%; }
}

/* ── Source panel (Open/Create stage) ──────────────────────────── */

.ws-source-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1.5rem;
}

.ws-source-summary,
.ws-source-actions {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
}

.ws-source-summary h3,
.ws-source-actions h3 {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.ws-source-meta {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0.6rem;
}

.ws-source-meta > div {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: baseline;
    gap: 0.6rem;
}

.ws-source-meta dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-subtle);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ws-source-meta dd {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text);
    word-break: break-word;
}

.ws-source-hint {
    margin: 0 0 0.9rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .ws-source-panel {
        grid-template-columns: 1fr;
    }
}

/* ── Export panel (Export stage) ───────────────────────────────── */

.ws-export-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ws-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.9rem;
}

.ws-export-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "icon body"
        "icon cta";
    column-gap: 0.95rem;
    row-gap: 0.4rem;
    align-items: start;
    padding: 1.15rem 1.2rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: left;
    cursor: pointer;
    transition: 160ms ease;
    font-family: inherit;
    color: var(--text);
}

.ws-export-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 14px 28px rgba(16, 24, 40, 0.10);
}

.ws-export-card-icon {
    grid-area: icon;
    align-self: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    background: #2f6694;
    box-shadow: 0 6px 14px rgba(47, 102, 148, 0.26);
}

.ws-export-card-body {
    grid-area: body;
    min-width: 0;
}

.ws-export-card-body h4 {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.ws-export-card-body p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.ws-export-card-body code {
    font-size: 0.78rem;
    padding: 0.05rem 0.25rem;
    background: var(--surface-soft);
    border-radius: 4px;
    color: var(--text);
}

.ws-export-card-cta {
    grid-area: cta;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: 0.01em;
}

.ws-export-card:hover .ws-export-card-cta {
    color: var(--brand-hover);
}

.alert-success {
    background: #edf7f2;
    border: 1px solid #c5dccd;
    color: #2e5e3a;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

/* ── Required-field marker + inline validation ─────────────────── */

.rg-required {
    color: var(--danger);
    font-weight: 700;
    margin-left: 0.15rem;
}

.rg-field-error {
    display: block;
    margin-top: 0.3rem;
    color: var(--danger);
    font-size: 0.78rem;
    line-height: 1.4;
}

.eb-field input.is-invalid,
input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

/* Ghost variant of .btn-action - same shape, white background, brand outline. */
.btn-action.btn-action-ghost {
    background: #ffffff;
    color: var(--brand);
    border: 1px solid var(--border-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn-action.btn-action-ghost:hover:not(:disabled) {
    background: var(--brand-soft);
    color: var(--brand-hover);
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 66, 96, 0.18);
}

.btn-action.btn-action-ghost:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.ws-render-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────── */
/*  Workspace 3-pane shell: rail · canvas · context  +  bottom dock        */
/* ─────────────────────────────────────────────────────────────────────── */

.ws-shell.ws-shell-3pane,
.ws-shell.ws-shell-3pane:has(.ws-context.is-collapsed),
.ws-shell.ws-shell-3pane:has(.ws-context.is-open) {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) 44px;
}

.ws-context {
    position: sticky;
    top: 82px;
    align-self: start;
    display: flex;
    flex-direction: column;
    width: 44px;
    min-width: 44px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    max-height: calc(100vh - 110px);
}

.ws-context.is-collapsed {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.ws-context.is-open {
    width: 320px;
    min-width: 320px;
    margin-left: -276px;
    background: #ffffff;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
    z-index: 4;
}

.ws-context-handle {
    appearance: none;
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.6rem 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease;
}

.ws-context-handle:hover {
    color: var(--brand);
    background: var(--brand-soft);
}

.ws-context-handle-icon {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.ws-context-handle-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ws-context-head {
    position: relative;
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid #edf0f2;
}

.ws-context-eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.ws-context-title {
    margin: 0;
    padding-right: 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

.ws-context-close {
    position: absolute;
    top: 0.6rem;
    right: 0.55rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.ws-context-close:hover {
    color: var(--brand);
    border-color: var(--border-strong);
    background: var(--brand-soft);
}

.ws-context-body {
    padding: 0.85rem 1rem 1rem;
    overflow-y: auto;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.55;
}

.ws-context-body p {
    margin: 0 0 0.7rem;
}

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

.ws-context-body em {
    font-style: italic;
    color: var(--text);
}

.ws-context-body strong {
    color: var(--text);
}

.ws-context-hint {
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
}

/* ── Bottom dock ─────────────────────────────────────────────────────── */

.ws-dock {
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.55rem 0.9rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
}

.ws-dock-section {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ws-dock-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ws-dock-value {
    color: var(--text);
}

.ws-dock-value-muted {
    color: var(--text-muted);
}

.ws-dock-divider {
    width: 1px;
    height: 22px;
    background: #edf0f2;
}

.ws-dock-spacer {
    flex: 1 1 auto;
}

.ws-dock-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
}

.ws-dock-pill-ok    { background: #e5ede7; color: #2e5e3a; }
.ws-dock-pill-warn  { background: #fef3c7; color: #92400e; }
.ws-dock-pill-error { background: #fbeaea; color: #7a2e2e; }

.ws-dock-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    max-width: 360px;
}

.ws-dock-progress-stage {
    font-weight: 600;
    color: var(--text);
}

.ws-dock-progress-msg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

/* ── Responsive: collapse the 3rd pane on narrow viewports ──────────── */

@media (max-width: 1280px) {
    .ws-shell.ws-shell-3pane,
    .ws-shell.ws-shell-3pane:has(.ws-context.is-collapsed) {
        grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    }

    .ws-context {
        display: none;
    }
}

/* ── Fact Edit toolbar ──────────────────────────────────── */
.rv-edit-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--color-surface, #f9fafb);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    flex-shrink: 0;
}

.rv-edit-save-btn {
    margin-left: auto;
}

.rv-edit-dirty-label {
    font-size: 0.75rem;
    color: var(--color-muted, #6b7280);
    white-space: nowrap;
}

/* ── Dirty-row indicator ────────────────────────────────── */
tr.rv-facts-row-dirty td:first-child {
    border-left: 3px solid #f59e0b;
}

tr.rv-facts-row-dirty {
    background-color: rgba(245, 158, 11, 0.04);
}

/* ── Editable cell hint ─────────────────────────────────── */
.rv-facts-col-editable {
    cursor: text;
}

.rv-facts-col-editable:hover {
    background-color: rgba(59, 130, 246, 0.04);
    outline: 1px dashed rgba(59, 130, 246, 0.35);
    outline-offset: -1px;
}

/* ── Inline edit input ──────────────────────────────────── */
.rv-facts-edit-input {
    width: 100%;
    min-width: 60px;
    background: #fff;
    border: 1px solid var(--color-primary, #3b82f6);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.rv-facts-edit-input:focus {
    outline: none;
    border-color: var(--color-primary, #3b82f6);
}

.rv-facts-edit-dec {
    width: 56px;
    min-width: unset;
    text-align: center;
}
