/* The brand fonts, self-hosted: the app is local-first and makes no request to
   Google Fonts or any CDN. Files and their OFL licences are in static/fonts/
   (see its README.md for the upstream sources). Each family ships a latin and
   a latin-ext subset, so Turkish letters (ğ ş İ) come from the same face.
   Newsreader and Hanken Grotesk are variable fonts, one file covering every
   weight the CSS uses; IBM Plex Mono is static, and only 400/500/600 are
   used. Courier Prime draws "[Redact]" in the wordmark and nothing else: the
   1c logo's mono is Courier-style, while mono UI text stays IBM Plex Mono. */
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/newsreader/newsreader-roman-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/newsreader/newsreader-roman-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Newsreader";
    font-style: italic;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/newsreader/newsreader-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Newsreader";
    font-style: italic;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/newsreader/newsreader-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/hanken-grotesk/hanken-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Hanken Grotesk";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/hanken-grotesk/hanken-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-500-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-mono/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Courier Prime";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/courier-prime/courier-prime-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Courier Prime";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/courier-prime/courier-prime-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    color-scheme: light;
    --color-canvas: #f5f2eb;
    --color-surface: #ffffff;
    --color-surface-soft: #fbf9f3;
    --color-surface-raised: #ffffff;
    --color-text: #1c1a15;
    --color-text-muted: #78746a;
    --color-text-faint: #a7a296;
    --color-border: #e6e1d4;
    --color-border-strong: #d7d1c1;
    --color-accent: #6e2a32;
    --color-accent-hover: #57202a;
    --color-accent-soft: #f3e7e6;
    --color-focus: #7e343d;
    --color-success: #3d6b4e;
    --color-success-soft: #eaf0e9;
    --color-warning: #8a6a24;
    --color-warning-soft: #f5edd9;
    --color-danger: #8f3a34;
    --color-danger-soft: #f6e7e4;
    --color-info: #3c5568;
    --color-info-soft: #e9eef1;

    --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-document: "Newsreader", Georgia, "Times New Roman", serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-wordmark: "Courier Prime", "Courier New", Courier, monospace;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 11px;
    --radius-pill: 999px;
    --space-7: 48px;
    --space-8: 64px;
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-display: 32px;
    --line-tight: 1.25;
    --line-body: 1.55;
    --control-height: 40px;
    --control-height-sm: 32px;
    --shadow: 0 1px 2px rgba(29, 29, 27, 0.05);
    --shadow-md: 0 12px 32px rgba(29, 29, 27, 0.1);
    --focus-ring: 0 0 0 3px rgba(98, 88, 199, 0.28);

    /* The review marks, from the approved Legal Redact landing prototype. A
       finding is bracketed in the accent over a tint; each decision changes
       the bracket, never the tint alone, so the state survives a monochrome
       print or a colour-blind reader. Measured values:
       --color-text-secondary  #5f5b52, 6.05:1 on the canvas, 6.76:1 on white
       --color-mark-faint      #8f8a7e, 3.44:1 on white (a non-text mark)
       --color-mark-strong     the accent at 14% on white */
    --color-text-secondary: #5f5b52;
    --color-mark-tint: var(--color-accent-soft);
    --color-mark-strong: rgba(110, 42, 50, 0.14);
    --color-mark-hot: #ead3d3;
    --color-mark-kept: #ece8dd;
    --color-mark-faint: #8f8a7e;
    --shadow-sheet: 0 1px 2px rgba(28, 26, 21, 0.05), 0 28px 56px -32px rgba(28, 26, 21, 0.3);
    --page-gutter: 40px;

    /* Compatibility aliases keep existing templates and Studio scripts stable. */
    --shell-bg: var(--color-canvas);
    --shell-panel: var(--color-surface);
    --shell-panel-soft: var(--color-surface-soft);
    --shell-text: var(--color-text);
    --shell-muted: var(--color-text-muted);
    --shell-faint: var(--color-text-faint);
    --shell-line: var(--color-border);
    --shell-sidebar: #fbf9f3;
    --shell-sidebar-soft: var(--color-surface);
    --shell-sidebar-line: #e6e1d4;
    --shell-sidebar-text: var(--color-text);
    --shell-sidebar-muted: var(--color-text-muted);
    --shell-blue: var(--color-accent);
    --shell-blue-soft: var(--color-accent-soft);
    --shell-green: var(--color-success);
    --shell-green-soft: var(--color-success-soft);
    --shell-amber: var(--color-warning);
    --shell-amber-soft: var(--color-warning-soft);
    --shell-red: var(--color-danger);
    --shell-red-soft: var(--color-danger-soft);
    --shell-shadow: var(--shadow);
    --shell-shadow-md: var(--shadow-md);
}

/* These aliases deliberately outrank page-local :root declarations without
   requiring markup or JavaScript changes. */
html:root {
    --bg: var(--color-canvas);
    --panel: var(--color-surface);
    --soft: var(--color-surface-soft);
    --panel-soft: var(--color-surface-soft);
    --border: var(--color-border);
    --line: var(--color-border);
    --text: var(--color-text);
    --ink: var(--color-text);
    --muted: var(--color-text-muted);
    --blue: var(--color-accent);
    --green: var(--color-success);
    --amber: var(--color-warning);
    --red: var(--color-danger);
    --shadow: 0 1px 2px rgba(29, 29, 27, 0.05);
    --shadow-md: 0 12px 32px rgba(29, 29, 27, 0.1);
}

:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--shell-bg);
    color: var(--shell-text);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: var(--line-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html body h1,
html body h2,
html body h3 {
    color: var(--color-text);
    font-family: var(--font-ui);
    line-height: var(--line-tight);
}

html body a {
    color: var(--color-accent);
    text-underline-offset: 0.18em;
}

html body a:hover {
    color: var(--color-accent-hover);
}

html body button,
html body .button-link,
html body input,
html body textarea,
html body select {
    font-family: var(--font-ui);
    font-size: var(--text-base);
}

html body button,
html body .button-link {
    min-height: var(--control-height);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-4);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 600;
    line-height: 1;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

html body button:hover,
html body .button-link:hover {
    border-color: var(--color-text-muted);
    background: var(--color-surface-soft);
    color: var(--color-text);
}

html body button:active,
html body .button-link:active {
    box-shadow: none;
}

html body button.primary,
html body button.primary-btn,
html body .button-link.primary,
html body .button-link.gate-export-primary {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
}

html body button.primary:hover,
html body button.primary-btn:hover,
html body .button-link.primary:hover,
html body .button-link.gate-export-primary:hover {
    border-color: var(--color-accent-hover);
    background: var(--color-accent-hover);
    color: #fff;
}

html body button.danger,
html body .button-link.danger {
    border-color: #d8aaa7;
    background: var(--color-surface);
    color: var(--color-danger);
}

html body button.danger:hover,
html body .button-link.danger:hover {
    border-color: var(--color-danger);
    background: var(--color-danger-soft);
}

html body button:disabled,
html body .button-link.disabled,
html body [aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}

html body input,
html body textarea,
html body select {
    width: 100%;
    min-height: var(--control-height);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background-color: var(--color-surface);
    color: var(--color-text);
    box-shadow: inset 0 1px 0 rgba(29, 29, 27, 0.02);
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

html body input::placeholder,
html body textarea::placeholder {
    color: var(--color-text-faint);
    opacity: 1;
}

html body input:hover,
html body textarea:hover,
html body select:hover {
    border-color: var(--color-text-muted);
}

html body input:focus,
html body textarea:focus,
html body select:focus {
    outline: 2px solid transparent;
    border-color: var(--color-focus);
    box-shadow: var(--focus-ring);
}

html body input:disabled,
html body textarea:disabled,
html body select:disabled {
    background: #f1efe9;
    color: var(--color-text-muted);
    cursor: not-allowed;
}

html body select {
    appearance: none;
    padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
        linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

html body .panel,
html body .stat,
html body .studio,
html body .terminology,
html body .table-wrap,
html body .card {
    border-color: var(--color-border);
    background-color: var(--color-surface);
    box-shadow: var(--shadow);
}

html body .badge,
html body .trust-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.25;
}

html body .badge.ready,
html body .badge.risk-Low {
    border-color: #b8d9c8;
    background: var(--color-success-soft);
    color: var(--color-success);
}

html body .badge.needs,
html body .badge.risk-Medium {
    border-color: #e6cb94;
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

html body .badge.blocked,
html body .badge.risk-High,
html body .badge.risk-CRITICAL,
html body .badge.risk-UNKNOWN,
html body .badge.ready-Blocked {
    border-color: #e3b5b2;
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

html body .badge.risk-Unknown {
    border-color: var(--color-border);
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
}

html body .badge.ready-Needs {
    border-color: #e6cb94;
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

html body .badge.ready-Allowed {
    border-color: #b8d9c8;
    background: var(--color-success-soft);
    color: var(--color-success);
}

.app-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--shell-bg);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: 20px 12px 14px;
    background: var(--shell-sidebar);
    color: var(--shell-sidebar-text);
    border-right: 1px solid var(--shell-sidebar-line);
}

.brand-block {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0 8px 20px;
    border-bottom: 1px solid var(--shell-sidebar-line);
}

/* The Legal Redact lockup (templates/partials/brand.html): a serif L between
   square brackets on an ink tile, beside "Legal [Redact]". Geometry is the 30px
   sidebar size of logo option 1c. */
.brand-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--color-text);
    color: var(--color-canvas);
}

.brand-icon__bracket {
    width: 4px;
    height: 15px;
    box-sizing: border-box;
    border: 1.5px solid currentColor;
}

.brand-icon__bracket--open {
    border-right: none;
}

.brand-icon__bracket--close {
    border-left: none;
}

/* The fixed height is the cap height, so the flex row centres the letter's
   visible shape rather than its line box. */
.brand-icon__letter {
    display: block;
    height: 11px;
    overflow: visible;
    font-family: var(--font-document);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

.wordmark {
    font-family: var(--font-document);
    font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
}

.wordmark__redact {
    font-family: var(--font-wordmark);
    font-size: 0.9em;
    font-weight: 400;
    color: var(--color-accent);
}

.brand-block > .brand-icon {
    grid-row: 1 / span 2;
}

.brand-title,
.brand-subtitle {
    grid-column: 2;
}

.brand-title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0;
    color: var(--shell-sidebar-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle,
.nav-section-label,
.user-role {
    color: var(--shell-sidebar-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.nav-section {
    display: grid;
    gap: 6px;
}

.nav-section-label {
    padding: 0 8px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 10.5px;
}

.nav-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--shell-sidebar-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--shell-sidebar-text);
}

.nav-item.active {
    background: var(--shell-sidebar-soft);
    color: var(--shell-sidebar-text);
    box-shadow: var(--shell-shadow);
}

.nav-item:focus-visible {
    position: relative;
    z-index: 1;
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(102, 112, 133, 0.09);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
    padding: 12px 8px 4px;
    border-top: 1px solid var(--shell-sidebar-line);
}

.sidebar-footer .user-role::before {
    content: "";
    width: 28px;
    height: 28px;
    margin-right: 9px;
    display: inline-flex;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--shell-sidebar-soft);
    border: 1px solid var(--shell-sidebar-line);
}

.logout-button {
    min-height: var(--control-height);
    border: 1px solid var(--shell-sidebar-line);
    border-radius: 8px;
    background: var(--shell-sidebar-soft);
    color: var(--shell-sidebar-text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}

.shell-main {
    min-width: 0;
    background: var(--shell-bg);
}

.shell-banner {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 0 24px;
    border-bottom: 1px solid var(--shell-line);
    background: var(--shell-panel);
    color: var(--shell-muted);
    font-size: var(--text-sm);
}

.shell-banner strong {
    color: var(--shell-text);
    font-size: var(--text-base);
    font-weight: 600;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--shell-panel-soft);
    border: 1px solid var(--shell-line);
    color: var(--shell-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.role-readonly {
    border: 1px solid var(--shell-line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--shell-panel-soft);
    color: var(--shell-muted);
    font-size: var(--text-sm);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-5);
    background: var(--shell-panel-soft);
    color: var(--shell-muted);
    text-align: center;
}

.empty-state > :first-child {
    margin-top: 0;
}

.empty-state > :last-child {
    margin-bottom: 0;
}

.empty-state-title {
    color: var(--color-text);
    font-size: var(--text-lg);
    font-weight: 600;
}

.empty-state-copy {
    max-width: 48ch;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* Tooltip: use data-tooltip on a focusable trigger. The title attribute may
   remain as a no-JavaScript fallback on existing controls. */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    position: absolute;
    z-index: 80;
    left: 50%;
    bottom: calc(100% + 8px);
    max-width: 280px;
    width: max-content;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: #292825;
    color: #fff;
    content: attr(data-tooltip);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Native details provides a keyboard-accessible dropdown without a new
   dependency. Align the panel with .dropdown-menu when used elsewhere. */
.dropdown {
    position: relative;
    width: fit-content;
}

.dropdown > summary {
    min-height: var(--control-height);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

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

.dropdown > summary::after {
    content: "⌄";
    color: var(--color-text-muted);
}

.dropdown[open] > summary {
    border-color: var(--color-focus);
    box-shadow: var(--focus-ring);
}

.dropdown-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-raised);
    box-shadow: var(--shadow-md);
}

.dropdown-menu a,
.dropdown-menu button {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

dialog,
.dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-raised);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

dialog::backdrop {
    background: rgba(29, 29, 27, 0.48);
}

.dialog-header,
.dialog-body,
.dialog-actions {
    padding: var(--space-4) var(--space-5);
}

.dialog-header {
    border-bottom: 1px solid var(--color-border);
}

.dialog-header h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.toast,
[role="status"].toast,
[role="alert"].toast {
    position: fixed;
    z-index: 100;
    right: var(--space-5);
    bottom: var(--space-5);
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: #292825;
    color: #fff;
    box-shadow: var(--shadow-md);
    font-size: var(--text-sm);
    line-height: 1.4;
}

.toast-success {
    border-color: #83b89e;
    background: #235f45;
}

.toast-error {
    border-color: #d69b98;
    background: #7e302d;
}

.skeleton,
.skeleton-line {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #e9e7e1;
    color: transparent;
}

.skeleton::after,
.skeleton-line::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
    content: "";
    transform: translateX(-100%);
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
}

@keyframes skeleton-shimmer {
    to { transform: translateX(100%); }
}

.panel,
.stat,
.studio,
.terminology,
.table-wrap {
    box-shadow: var(--shell-shadow);
}

table tbody tr {
    transition: background-color 120ms ease;
}

.badge,
.trust-pill,
button,
.button-link,
input,
select {
    letter-spacing: 0;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        padding-top: 12px;
    }

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

    .nav-section-label,
    .sidebar-footer {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .shell-banner {
        min-height: 48px;
        padding: 8px 16px;
    }

    .trust-strip {
        display: none;
    }

    .nav-section {
        grid-template-columns: 1fr;
    }

    .nav-section-label,
    .sidebar-footer {
        grid-column: auto;
    }

    .dialog-header,
    .dialog-body,
    .dialog-actions {
        padding: var(--space-4);
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions > * {
        width: 100%;
    }

    .toast {
        right: var(--space-4);
        bottom: var(--space-4);
        left: var(--space-4);
    }
}

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

    .skeleton::after,
    .skeleton-line::after {
        display: none;
    }
}

.local-only-note {
    margin: 0 12px 8px;
    padding: 7px 10px;
    border-radius: var(--radius);
    background: var(--color-success-soft);
    border: 1px solid #b8d9c8;
    color: var(--color-success);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
    cursor: default;
}

/* Quietly premium legal-tech treatment shared by every workstation view. */
html body {
    font-family: var(--font-ui) !important;
}

html body h1,
html body .studio-document-title h1,
html body .brand-title {
    font-family: var(--font-document);
    font-weight: 500;
    letter-spacing: 0.01em;
}

html body h1 {
    font-size: 22px;
}

html body h2,
html body h3 {
    font-family: var(--font-ui);
    font-weight: 600;
}

.app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
}

.app-sidebar {
    gap: 20px;
    padding: 20px 14px 14px;
}

.brand-block {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 3px 11px;
    padding: 2px 8px 18px;
}

.brand-title {
    position: relative;
    font-size: 16px;
    line-height: 1;
}

.brand-subtitle {
    color: var(--color-text-faint);
    font-size: 10.5px;
}

.nav-section {
    gap: 5px;
}

.nav-section-label {
    color: var(--color-text-faint);
    font-size: 10px;
    letter-spacing: 0.15em;
}

.nav-item {
    min-height: 36px;
    padding: 8px 11px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.nav-item.active {
    box-shadow: inset 2px 0 0 var(--color-accent), var(--shadow);
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    background: transparent;
    color: var(--color-text-faint);
    font-family: var(--font-mono);
    font-size: 10px;
}

.nav-item.active .nav-icon {
    color: var(--color-accent);
}

.shell-banner {
    min-height: 60px;
    padding: 0 24px;
}

.shell-banner strong {
    font-family: var(--font-document);
    font-size: 16px;
    font-weight: 500;
}

html body .badge,
html body .trust-pill {
    border-radius: 6px;
}

html body .panel,
html body .stat,
html body .studio,
html body .terminology,
html body .table-wrap,
html body .card {
    border-radius: 11px;
}

/* Column headings in the secondary ink rather than the faint one: at 10px the
   faint ink measured 2.3:1 on white, below every WCAG threshold. */
html body table th {
    color: var(--color-text-secondary) !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.08em;
}

html body table tbody tr:hover {
    background: var(--color-surface-soft);
}

html body .stat-value {
    font-family: var(--font-document);
    font-weight: 500;
}

html body .tabs button.active,
html body .filter-btn.active {
    border-color: var(--color-border-strong);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

html body .local-only-note {
    border-color: #cfe0d0;
    background: var(--color-success-soft);
}

/* Inline action inside body copy (e.g. "Clear filters" in an empty table). */
html body .link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

html body .link-btn:hover {
    color: var(--color-accent-hover);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   The Legal Redact design language, carried from the approved landing
   prototype into the workstation: a serif display face over a warm canvas,
   white sheets with a deep soft shadow, hairline rules instead of nested
   boxes, the accent used for one thing at a time, and three marks that mean
   the same on every screen --

     a bracket   [Deniz Kurgusal]   something the rules found (.mark)
     a chip      [PERSON_1]         what a redacted copy carries (.ph-chip)
     a step      1 [Find] 2 Decide  where the review stands (.stage-step)

   Every rule below is scoped to the workstation (.app-shell). The
   unauthenticated /welcome page loads this stylesheet for its tokens and uses
   some of the same class names (.mark, .sheet, .section-title) for its own,
   differently drawn marks, so an unscoped rule here would restyle it.
   ========================================================================== */

.app-shell {
    /* The prototype's secondary ink. The inherited muted ink measured 4.15:1
       on the canvas, under AA for body text; each alias is resolved where it
       is declared, so every one that reads it is restated here. */
    --color-text-muted: var(--color-text-secondary);
    --muted: var(--color-text-secondary);
    --shell-muted: var(--color-text-secondary);
    --shell-sidebar-muted: var(--color-text-secondary);
    --focus-ring: 0 0 0 3px rgba(126, 52, 61, 0.26);
}

/* ---- the sidebar ---------------------------------------------------------- */

.app-shell .app-sidebar {
    background: var(--color-canvas);
    border-right-color: var(--color-border);
}

.app-shell .brand-block {
    border-bottom-color: var(--color-border);
}

.app-shell .nav-item {
    color: var(--color-text-secondary);
    font-size: 13.5px;
}

.app-shell .nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-text);
}

/* The current place is bracketed, the way the step header brackets the
   current step and the logo brackets its L. */
.app-shell .nav-item.active {
    background: var(--color-surface);
    box-shadow: var(--shadow);
    color: var(--color-text);
}

.app-shell .nav-item.active .nav-icon::before,
.app-shell .nav-item.active .nav-icon::after {
    color: var(--color-accent);
    font-weight: 500;
}

.app-shell .nav-item.active .nav-icon::before {
    content: "[";
    content: "[" / "";
}

.app-shell .nav-item.active .nav-icon::after {
    content: "]";
    content: "]" / "";
}

.app-shell .nav-icon {
    width: 22px;
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.app-shell .local-only-note {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 0 8px 8px;
    padding: 9px 2px 0;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-align: left;
}

.app-shell .local-only-note::before {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    content: "";
    transform: translateY(-1px);
}

.app-shell .sidebar-footer {
    border-top-color: var(--color-border);
}

.app-shell .logout-button {
    border-color: var(--color-border-strong);
    background: var(--color-surface);
    font-weight: 600;
}

/* ---- the page frame ------------------------------------------------------- */

.app-shell .shell-banner {
    min-height: 52px;
    padding: 0 var(--page-gutter);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-canvas);
    color: var(--color-text-secondary);
}

.app-shell .shell-banner strong {
    color: var(--color-text-secondary);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
}

.app-shell .trust-pill {
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 11.5px;
    font-weight: 500;
}

/* The title of a place: set large in the document serif, on the canvas
   rather than on a white band. */
.app-shell .page-header {
    padding: 40px var(--page-gutter) 8px;
}

.app-shell .page-header h1 {
    margin: 0;
    font-family: var(--font-document);
    font-size: 34px;
    font-weight: 440;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.app-shell .page-lede {
    max-width: 46em;
    margin: 12px 0 0;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.app-shell .content {
    display: grid;
    align-content: start;
    gap: 32px;
    min-width: 0;
    padding: 28px var(--page-gutter) 56px;
}

/* A section on a page: a serif heading over a short secondary line. */
.app-shell .section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
}

.app-shell .section-head h2,
.app-shell .section-title {
    margin: 0;
    font-family: var(--font-document);
    font-size: 23px;
    font-weight: 440;
    line-height: 1.2;
    letter-spacing: -0.005em;
}

.app-shell .section-lede {
    margin: 5px 0 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

/* A step number or kicker: a serif numeral in the accent. */
.app-shell .kicker {
    margin: 0 0 8px;
    color: var(--color-accent);
    font-family: var(--font-document);
    font-size: 15px;
    font-variant-numeric: lining-nums;
}

/* ---- cards and rules ------------------------------------------------------ */

/* The Studio is excluded: its .panel is a workspace column, and the panels
   inside its export details are deliberately flat. */
html body:not(.studio-app) .app-shell .panel,
html body .app-shell .table-wrap,
html body .app-shell .card,
html body .app-shell .sheet {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

html body .app-shell .sheet {
    box-shadow: var(--shadow-sheet);
}

.app-shell .card-pad {
    padding: 24px 26px;
}

/* Facts: a grid of short statements, each under a hairline. The prototype's
   answer to a grid of bordered boxes, and to the KPI tile. */
.app-shell .facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 36px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-shell .fact {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.app-shell .fact strong {
    color: var(--color-text);
    font-size: 15px;
    font-weight: 650;
}

.app-shell .fact span {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

/* Figures: a number set in the serif over its label, under a hairline. */
.app-shell .figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 36px;
}

.app-shell .figure {
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-strong);
}

.app-shell .figure-value {
    color: var(--color-text);
    font-family: var(--font-document);
    font-size: 32px;
    font-weight: 440;
    line-height: 1.05;
    font-variant-numeric: lining-nums tabular-nums;
}

.app-shell .figure-label {
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: 13.5px;
}

/* ---- tables --------------------------------------------------------------- */

.app-shell .data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.app-shell .data-table th,
.app-shell .data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    font-size: 13.5px;
    overflow-wrap: anywhere;
}

.app-shell .data-table th {
    padding-top: 12px;
    padding-bottom: 11px;
    border-bottom-color: var(--color-border-strong);
    background: var(--color-surface);
    text-transform: uppercase;
}

.app-shell .data-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-shell .data-table tbody tr[onclick] {
    cursor: pointer;
}

.app-shell .row-title {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}

/* A file name: the prototype sets it in the mono, in the secondary ink. */
.app-shell .file-name,
.app-shell .row-meta {
    margin-top: 3px;
    color: var(--color-text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
}

.app-shell .file-name {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ---- badges --------------------------------------------------------------- */

html body .app-shell .badge {
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
}

/* ---- the step header: 1 [Find] 2 Decide 3 Export -------------------------- */

.app-shell .stage-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-shell .stage-step {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 4px;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.app-shell .stage-num {
    color: var(--color-accent);
    font-family: var(--font-document);
    font-size: 13.5px;
    font-variant-numeric: lining-nums;
}

.app-shell .stage-label::before,
.app-shell .stage-label::after {
    display: inline-block;
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-weight: 500;
    opacity: 0;
}

.app-shell .stage-label::before {
    margin-right: 2px;
    content: "[";
    content: "[" / "";
}

.app-shell .stage-label::after {
    margin-left: 2px;
    content: "]";
    content: "]" / "";
}

/* The current step is bracketed, the way a placeholder is. */
.app-shell .stage-step.is-current {
    color: var(--color-text);
}

.app-shell .stage-step.is-current .stage-label::before,
.app-shell .stage-step.is-current .stage-label::after {
    opacity: 1;
}

.app-shell .stage-check {
    color: var(--color-success);
    font-size: 12px;
    font-weight: 700;
}

/* The studio's real sub-steps inside the current step. */
.app-shell .stage-substeps {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    margin: 0;
    padding: 0 0 0 14px;
    border-left: 1px solid var(--color-border);
    list-style: none;
    color: var(--color-text-secondary);
    font-size: 12.5px;
}

.app-shell .stage-substep.is-current {
    color: var(--color-text);
    font-weight: 600;
}

.app-shell .stage-substep.is-done::after {
    margin-left: 4px;
    color: var(--color-success);
    content: "\2713";
    content: "\2713" / "";
    font-weight: 700;
}

/* ---- the placeholder chip: [PERSON_1] -------------------------------------- */

/* What a redacted copy carries in place of an approved finding. IBM Plex
   Mono like every placeholder; the wordmark alone is set in Courier Prime. */
.app-shell .ph-chip {
    display: inline-block;
    padding: 0 0.3em;
    border-radius: 3px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.86em;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ---- the bracket mark: [Deniz Kurgusal] ------------------------------------ */

/* A finding in running text. The brackets are drawn by the element itself --
   its left and right borders, plus four gradient ticks -- so they need no
   measurement and no extra nodes, and they wrap with the text: an inline box
   paints its left edge on its first line and its right edge on its last
   (box-decoration-break: slice), which is exactly where a bracket goes. */
.app-shell .mark {
    --mark-stroke: var(--color-accent);
    --mark-weight: 1.4px;
    --mark-tick: 4px;
    --mark-fill: var(--color-mark-tint);
    padding: 1px 0.2em;
    border-left: var(--mark-weight) solid var(--mark-stroke);
    border-right: var(--mark-weight) solid var(--mark-stroke);
    background:
        linear-gradient(var(--mark-stroke), var(--mark-stroke)) left top / var(--mark-tick) var(--mark-weight) no-repeat,
        linear-gradient(var(--mark-stroke), var(--mark-stroke)) left bottom / var(--mark-tick) var(--mark-weight) no-repeat,
        linear-gradient(var(--mark-stroke), var(--mark-stroke)) right top / var(--mark-tick) var(--mark-weight) no-repeat,
        linear-gradient(var(--mark-stroke), var(--mark-stroke)) right bottom / var(--mark-tick) var(--mark-weight) no-repeat,
        var(--mark-fill);
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
}

/* Kept unredacted: a real identifier the reviewer chose to leave in. Ink
   brackets, so it can never be read as resolved or as dismissed. */
.app-shell .mark.mark--retained {
    --mark-stroke: var(--color-text);
    --mark-fill: var(--color-mark-kept);
}

/* Not sensitive: the rules were wrong. Faint brackets, no tint. */
.app-shell .mark.mark--dismissed {
    --mark-stroke: var(--color-mark-faint);
    --mark-weight: 1px;
    --mark-fill: transparent;
    color: var(--color-text-secondary);
}

.app-shell .mark.mark--approved {
    --mark-weight: 1.9px;
    --mark-fill: var(--color-mark-strong);
}

.app-shell .mark.is-selected {
    --mark-weight: 2px;
    --mark-fill: var(--color-mark-hot);
}

.app-shell .mark.mark--retained.is-selected {
    --mark-fill: #e2ddd0;
}

.app-shell .page-lede[title] {
    cursor: help;
}

.app-shell .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A gate condition, met or not: the prototype's bracketed check and cross.
   The row is positioned so its visually hidden "Met:" label is laid out
   inside it: absolutely positioned against the page instead, the label sat
   below every clipping panel and stretched the Studio's document height. */
.app-shell .gate-row,
.app-shell .stage-step {
    position: relative;
}

.app-shell .gate-mark {
    flex: none;
    min-width: 30px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}

.app-shell .gate-row.is-pass .gate-mark { color: var(--color-success); }
.app-shell .gate-row.is-fail .gate-mark { color: var(--color-danger); }

.app-shell .table-wrap {
    overflow-x: auto;
}

@media (max-width: 980px) {
    .app-shell {
        --page-gutter: 16px;
    }

    .app-shell .page-header {
        padding-top: 24px;
    }

    .app-shell .page-header h1 {
        font-size: 28px;
    }

    .app-shell .facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .app-shell .figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 20px;
    }

    .app-shell .card-pad {
        padding: 20px 18px;
    }
}

@media (max-width: 640px) {
    /* A wide table scrolls inside its card rather than crushing its columns
       to a word each; the page itself never scrolls sideways. */
    .app-shell .data-table {
        min-width: 720px;
    }

    .app-shell .shell-banner strong {
        font-size: 12.5px;
    }
}

/* On a narrow screen the sidebar is a strip above the page rather than a
   column: every place and the sign-out stay, in a fraction of the height. */
@media (max-width: 980px) {
    .app-shell .app-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 6px;
        padding: 12px var(--page-gutter);
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .app-shell .brand-block {
        flex: 1 1 100%;
        padding: 0 0 10px;
    }

    .app-shell .nav-section {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .app-shell .nav-section-label {
        display: none;
    }

    .app-shell .nav-item {
        min-height: 36px;
        padding: 6px 10px 6px 6px;
    }

    .app-shell .local-only-note {
        flex: 1 1 auto;
        margin: 0;
        padding: 0;
        border-top: 0;
    }

    .app-shell .sidebar-footer {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0;
        padding: 0;
        border-top: 0;
    }

    .app-shell .sidebar-footer .user-role::before {
        display: none;
    }

    .app-shell .logout-button {
        min-height: 34px;
        padding: 0 14px;
    }
}

/* The header's steps are also the way to each step. */
html body .app-shell .stage-step {
    min-height: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
}

html body .app-shell .stage-step:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

html body .app-shell .stage-step.is-current {
    color: var(--color-text);
}

.app-shell .stage-steps > li {
    display: flex;
}

/* What is left before the export, on the Export step itself. */
.app-shell .stage-left {
    color: var(--color-text-secondary);
    font-size: 12.5px;
    font-weight: 500;
}

.app-shell .stage-left::before {
    margin-right: 6px;
    color: var(--color-border-strong);
    content: "\00B7";
    content: "\00B7" / "";
}

.app-shell .stage-left-short {
    display: none;
}

@media (max-width: 860px) {
    .app-shell .stage-left-long {
        display: none;
    }

    .app-shell .stage-left-short {
        display: inline;
    }
}
