/* LO AI Workspace — Design System
   Outfit display + Plus Jakarta Sans body. Warm cream & orange palette.
   Matches guide/styles.css design system. WCAG 2.2 AA compliant. */

/* ------------------------------------------------------------------ */
/* Design tokens                                                       */
/* ------------------------------------------------------------------ */

:root {
    /* Brand — #ad5415 is the lightest same-hue orange that passes
       WCAG AA 4.5:1 on white, cream-bg, and primary-light surfaces */
    --primary:        #ad5415;
    --primary-hover:  #934712;
    --primary-light:  #fcf0d8;
    --primary-surface:#fff3e4;
    --accent:         #ad5415;
    --accent-light:   #fcf0d8;

    /* Neutrals */
    --text:           #040608;
    --text-secondary: #655b55;
    --text-tertiary:  #726e6b;
    --bg:             #fef8ee;
    --surface:        #ffffff;
    --border:         #d5cfcc;
    --border-light:   #ece7e3;

    /* Semantic */
    --error:          #b83a2e;
    --error-bg:       #fdf0ef;
    --warning:        #a67d1a;
    --warning-bg:     #fef9e7;
    --success:        #1a7a3a;
    --success-bg:     #edf7f0;
    --info-bg:        #fff3e4;

    /* Org accent — teal for LogicalOutcomes section */
    --lo-accent:      #1a6b63;

    /* Radii */
    --radius-sm:      6px;
    --radius:         0.75rem;
    --radius-lg:      20px;
    --radius-pill:    999px;

    /* Shadows */
    --shadow-xs:      0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:         0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.12);
    --focus-ring:     0 0 0 3px rgba(173, 84, 21, 0.25);
    /* Header */
    --header-bg:      rgba(255, 255, 255, 0.94);
    --accent-dark:    #934712;

    /* Spacing scale */
    --space-xs:       0.25rem;
    --space-sm:       0.5rem;
    --space-md:       1rem;
    --space-lg:       1.5rem;
    --space-xl:       2.5rem;

    /* Layout */
    --max-width:      960px;
    --page-padding:   2rem;

    /* Fonts */
    --font-display:   'Outfit', sans-serif;
    --font-body:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
                      "Segoe UI", Roboto, sans-serif;
}

/* ------------------------------------------------------------------ */
/* Reset & base                                                        */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(173, 84, 21, 0.08), transparent 28%),
        linear-gradient(180deg, #fffdf9 0%, var(--bg) 32%, #ffffff 100%);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.25;
    color: var(--text);
}

h1 { font-size: 2rem;   font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }

p { color: var(--text-secondary); }

a { color: var(--primary); transition: color 0.15s; }
a:hover { color: var(--primary-hover); }
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 3px;
}

code {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    font-weight: 500;
}

strong { font-weight: 600; color: var(--text); }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--page-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 3.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.nav-brand:hover { opacity: 0.9; }

.nav-logo {
    height: 28px;
    width: auto;
}

.nav-brand-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links { display: flex; gap: 0.15rem; align-items: center; }

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover {
    color: var(--text);
}
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
/* Nav dropdown (Learn menu) */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-dropdown > a {
    cursor: pointer;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.nav-dropdown-menu a:hover {
    background: var(--bg);
    color: var(--text);
}
.nav-dropdown-heading {
    display: block;
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.nav-dropdown-heading:not(:first-child) {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--page-padding);
    width: 100%;
    flex: 1;
}

.site-footer {
    text-align: center;
    padding: 1rem var(--page-padding);
    font-size: 0.8rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
}
.site-footer a {
    color: var(--text-tertiary);
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}
.site-footer a:hover {
    color: var(--text-secondary);
}

/* Tools page styles are in guide.css */

/* ------------------------------------------------------------------ */
/* Back link                                                           */
/* ------------------------------------------------------------------ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}
.back-link:hover { color: var(--primary); }

.nav-reassurance {
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ------------------------------------------------------------------ */
/* Workflow header (inner pages)                                        */
/* ------------------------------------------------------------------ */

.workflow-header {
    margin-bottom: 2rem;
    animation: fadeUp 0.4s ease-out;
}
.workflow-header h1 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.workflow-header p {
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 640px;
}

/* ------------------------------------------------------------------ */
/* Brand page — template list                                          */
/* ------------------------------------------------------------------ */

.template-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 2rem;
    animation: fadeUp 0.4s ease-out 0.05s both;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.template-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.template-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.template-thumb {
    flex-shrink: 0;
    width: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.1));
}
.template-thumb svg {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.template-info {
    flex: 1;
    min-width: 0;
}
.template-item-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--text);
}
.template-item-format {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.template-item-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Tab bar                                                             */
/* ------------------------------------------------------------------ */

.input-area {
    animation: fadeUp 0.4s ease-out 0.1s both;
}

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
    color: var(--primary);
}
.tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Content textarea                                                    */
/* ------------------------------------------------------------------ */

.content-textarea {
    width: 100%;
    min-height: 280px;
    padding: 1rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.content-textarea::placeholder {
    color: var(--text-tertiary);
}
.content-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(173,84,21,0.12);
}

/* ------------------------------------------------------------------ */
/* Generate row (brand forms)                                          */
/* ------------------------------------------------------------------ */

.generate-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.htmx-request .indicator,
.htmx-request.indicator { display: flex; }
.htmx-request #generate-btn { opacity: 0.5; pointer-events: none; }

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ------------------------------------------------------------------ */
/* Download / success page (brand)                                     */
/* ------------------------------------------------------------------ */

.download-area {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeUp 0.5s ease-out;
}
.download-checkmark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: scaleIn 0.4s ease-out;
}
.download-area h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.download-filename {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
    background: var(--bg);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 1.5rem;
}
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
    margin-bottom: 1rem;
}
.download-tip {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}
.generate-another {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.generate-another:hover { color: var(--primary); }

/* ------------------------------------------------------------------ */
/* Metadata confirmation step (brand)                                  */
/* ------------------------------------------------------------------ */

.confirm-area {
    max-width: 560px;
    margin: 0 auto;
    animation: fadeUp 0.4s ease-out;
}
.confirm-area h2 {
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
}
.confirm-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1.25rem;
}
.confidence-high {
    background: var(--success-bg);
    color: var(--success);
}
.confidence-medium {
    background: var(--warning-bg);
    color: var(--warning);
}
.confidence-low {
    background: var(--error-bg);
    color: var(--error);
}
.confirm-fields {
    display: grid;
    gap: 0.875rem;
    margin-bottom: 0.5rem;
}
.confirm-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.confirm-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}
.confirm-field input[type="text"] {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.confirm-field input[type="text"]::placeholder {
    color: var(--text-tertiary);
}
.confirm-field input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(173,84,21,0.12);
}

/* Slide mode picker on confirm page */
.slide-mode-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 0.5rem;
    background: var(--surface);
}
.slide-mode-fieldset legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0 0.4rem;
}
.slide-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0.75rem 0;
    cursor: pointer;
    line-height: 1.4;
}
.slide-mode-option input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: var(--primary);
}
.slide-mode-option strong {
    color: var(--text);
    font-size: 0.95rem;
}
.radio-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.generation-summary {
    max-width: 400px;
    margin: 0 auto 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
}
.summary-heading {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.summary-fields {
    display: grid;
    gap: 0.25rem;
}
.summary-field {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
}
.summary-field dt {
    color: var(--text-secondary);
    min-width: 5rem;
    flex-shrink: 0;
}
.summary-field dt::after { content: ":"; }
.summary-field dd {
    color: var(--text);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}
.btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: var(--surface);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-sm);
    color: var(--surface);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-small {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}
.btn-small:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* ------------------------------------------------------------------ */
/* Dropzone (data cleaning upload)                                     */
/* ------------------------------------------------------------------ */

.upload-form { margin-bottom: 2rem; }

/* Upload progress feedback (shown during file transfer) */
.upload-progress {
    margin-top: 1rem;
    text-align: center;
}
.upload-progress .progress-bar {
    margin: 0.75rem auto;
    max-width: 400px;
}
.upload-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.btn-uploading {
    opacity: 0.7;
    pointer-events: none;
}
.btn-uploading .spinner {
    margin-right: 0.5rem;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    margin-bottom: 1.5rem;
    background: var(--surface);
}
.dropzone:hover, .dropzone:focus, .dropzone-active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-selected {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: 0.5rem;
}

.dropzone-icon {
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}
.dropzone-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}
.dropzone-hint,
.option-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.link-button {
    background: none;
    border: none;
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(173,84,21,0.3);
    text-underline-offset: 2px;
    padding: 0;
}
.link-button:hover { text-decoration-color: var(--primary); }

.file-list {
    list-style: none;
    text-align: left;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.file-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.file-size {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ------------------------------------------------------------------ */
/* Options / fieldset                                                   */
/* ------------------------------------------------------------------ */

.options-group {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.options-group legend {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    color: var(--text);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */

.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.55;
    border-left: 4px solid transparent;
}
.alert-error   { background: var(--error-bg);   border-left-color: var(--error); }
.alert-warning { background: var(--warning-bg);  border-left-color: var(--warning); }
.alert-info    { background: var(--info-bg);     border-left-color: var(--primary); }

.error-message {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    border-left: 4px solid var(--error);
    background: var(--error-bg);
    color: var(--text);
}

.text-error { color: var(--error); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* CSV column picker                                                   */
/* ------------------------------------------------------------------ */

.csv-picker {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.csv-picker h2 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}
.picker-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.column-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.column-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s;
}
.column-item:hover {
    background: var(--primary-light);
}
.column-suggested {
    background: var(--primary-surface);
}

.column-item input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.column-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.column-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.column-sample {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.badge-suggested {
    background: var(--primary-light);
    color: var(--primary);
}

/* ------------------------------------------------------------------ */
/* Results                                                             */
/* ------------------------------------------------------------------ */

.batch-summary {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.batch-summary h2 {
    font-size: 1.1rem;
    font-family: var(--font-body);
    margin-bottom: 0.75rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.result-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--success);
    transition: box-shadow 0.2s;
}
.result-card:hover {
    box-shadow: var(--shadow-sm);
}
.result-error  { border-left-color: var(--error); }
.result-review { border-left-color: var(--warning); }

/* Collapsible result cards for large batches (uses <details>) */
details.result-card { cursor: default; }
details.result-card > summary.result-header {
    cursor: pointer;
    list-style: none;
    margin-bottom: 0;
}
details.result-card > summary.result-header::-webkit-details-marker { display: none; }
details.result-card > summary.result-header::marker { display: none; content: ""; }
details.result-card[open] > summary.result-header {
    margin-bottom: 0.875rem;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.875rem;
}
.result-header h2 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.result-icon {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--warning-bg);
    color: var(--warning);
}
.result-icon-ok    { background: var(--success-bg); color: var(--success); }
.result-icon-error { background: var(--error-bg);   color: var(--error); }

.result-error-msg {
    color: var(--error);
    font-size: 0.9rem;
}

.result-downloads {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    margin-bottom: 1rem;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-value {
    font-size: 0.9rem;
    color: var(--text);
}

/* ------------------------------------------------------------------ */
/* Review section (expandable)                                         */
/* ------------------------------------------------------------------ */

.review-section {
    margin: 0.875rem 0;
    border: 1.5px solid var(--warning);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
/* Shared expandable toggle — chevron rotation for <details>/<summary> */
.expandable-toggle {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}
.expandable-toggle::-webkit-details-marker { display: none; }
.expandable-toggle::marker { display: none; content: ""; }
.expandable-toggle::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.65em;
    transition: transform 0.2s;
}
details[open] > .expandable-toggle::before {
    transform: rotate(90deg);
}

.review-toggle {
    padding: 0.6rem 0.875rem;
    background: var(--warning-bg);
    font-size: 0.85rem;
    color: var(--warning);
}
.review-items { padding: 0.875rem; }
.review-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.review-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}
.review-item:last-child { border-bottom: none; }
.review-type {
    font-weight: 600;
    color: var(--warning);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    margin-right: 0.5rem;
}
.review-text {
    background: var(--warning-bg);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}
.review-context {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    word-break: break-word;
}

.error-actions {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Results actions                                                     */
/* ------------------------------------------------------------------ */

.results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.results-actions-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/* Info box                                                            */
/* ------------------------------------------------------------------ */

.info-box {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.info-box h2 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 0.4rem;
    margin-top: 1.25rem;
    color: var(--text);
}
.info-box h2:first-child { margin-top: 0; }
.info-box ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.info-box li {
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
}
.info-box p {
    margin-bottom: 0.4rem;
}

/* ------------------------------------------------------------------ */
/* Animations / keyframes                                              */
/* ------------------------------------------------------------------ */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ── Transparency link inside card details ──────────────────────── */
.details-transparency-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-dark);
    text-decoration: none;
    transition: color 0.15s;
}

.details-transparency-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ── How It Works page ───────────────────────────────────────────── */
.how-it-works {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--page-padding);
}

.how-it-works-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.how-it-works-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-dark);
    text-decoration: none;
    white-space: nowrap;
}
.back-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.how-it-works-content {
    line-height: 1.6;
}

.how-it-works-content h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text);
}

.how-it-works-content h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-top: 1.25rem;
}

.how-it-works-content ul {
    padding-left: 1.25rem;
}

.how-it-works-content li {
    margin-bottom: 0.3rem;
}

.how-it-works-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.how-it-works-content code,
.how-it-works-content pre {
    font-size: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.how-it-works-content pre {
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.how-it-works-content code {
    padding: 0.15rem 0.35rem;
}

.how-it-works-content a {
    color: var(--accent-dark);
    text-decoration: none;
}
.how-it-works-content a:hover {
    text-decoration: underline;
}

.how-it-works-content em {
    color: var(--text-secondary);
}

/* ── Compliance report ────────────────────────────────────────────── */

/* Prominent disclaimer blockquote */
.compliance-report-content blockquote {
    border-left: 4px solid var(--warning);
    background: var(--warning-bg);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
}

.compliance-report-content blockquote p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
}

/* Summary table */
.compliance-report-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 1rem 0 1.5rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compliance-report-content th {
    background: var(--primary-light);
    color: var(--text);
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
}

.compliance-report-content td {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-light);
    vertical-align: top;
}

.compliance-report-content tr:nth-child(even) td {
    background: var(--primary-surface);
}

/* Per-tool h3 sections (rendered from pandoc h3) */
.compliance-report-content h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-transform: none;
    letter-spacing: 0;
}

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

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    :root {
        --page-padding: 1.25rem;
    }
    .template-item { gap: 1rem; padding: 0.875rem 1rem; }
    .template-thumb { width: 72px; }
    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
        height: auto;
        padding: 0.75rem var(--page-padding);
    }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .results-actions { flex-direction: column; }
    .form-actions { flex-direction: column; }
    .result-stats { gap: 0.5rem 1.5rem; }
}

@media (max-width: 480px) {
    .brand-header h1,
    .workflow-header h1 { font-size: 1.4rem; }
    .template-item { padding: 0.75rem; }
    .template-thumb { width: 60px; }
}

/* -----------------------------------------------------------------------
   Qualitative Analysis workflow styles
   ----------------------------------------------------------------------- */

/* Step layout & header */
.qual-step { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1rem; }
.qual-step-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.qual-phase-label {
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.qual-step-badge { background: var(--primary); color: #fff; padding: 0.25rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; }
.qual-project-code { font-family: monospace; background: var(--border-light); padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-left: auto; }
.qual-step-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.qual-step-subtitle {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-tertiary);
    font-family: var(--font-body);
    margin-top: 0.25rem;
}

/* Home page */
.qual-home { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem 2rem; }
.qual-home .workflow-header { margin-bottom: 1.5rem; }
.qual-home-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; margin-bottom: 2rem; }
.qual-home-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.qual-home-card h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.qual-home-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 1rem; }
.qual-home-card label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.qual-home-card input[type="text"] {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.qual-home-card small { display: block; font-size: 0.8rem; color: var(--text-tertiary); margin-bottom: 0.75rem; }
.qual-home .info-box { margin-bottom: 1.5rem; }

/* Process overview (home page stepper) */
.qual-process-overview {
    display: flex;
    align-items: flex-start;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}
.qual-phase-group { flex: 1; min-width: 0; }
.qual-phase-group .qual-phase-label {
    display: inline-block;
    margin-bottom: 0.5rem;
}
.qual-phase-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: none;
}
.qual-phase-steps li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.15rem 0;
    line-height: 1.4;
}
.qual-phase-steps li::before {
    content: counter(list-item) ". ";
    font-weight: 600;
    color: var(--text-tertiary);
}
.qual-phase-arrow {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem 0;
    color: var(--border);
    font-size: 1.25rem;
    flex-shrink: 0;
}
.qual-phase-arrow::after { content: "\2192"; }

/* Form cards (replace browser-default fieldsets) */
.qual-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.qual-form-card h2 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Table scroll wrapper */
.qual-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0.5rem 0;
}

/* Table helper text */
.qual-table-help {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* Inventory summary */
.qual-inventory-summary { margin-bottom: 0.5rem; }
.qual-inventory-summary p { font-size: 0.9rem; color: var(--text-secondary); }

/* Inventory table */
.qual-inventory-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.qual-inventory-table th, .qual-inventory-table td { padding: 0.5rem 0.625rem; border: 1px solid var(--border); text-align: left; font-size: 0.875rem; }
.qual-inventory-table thead th { background: var(--primary-surface); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.qual-inventory-table input[type="text"],
.qual-inventory-table input[type="number"] { width: 100%; border: 1px solid var(--border); padding: 0.3rem 0.4rem; border-radius: 3px; font-size: 0.85rem; }
.qual-inventory-table input[type="text"]:focus,
.qual-inventory-table input[type="number"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(173,84,21,0.12); }
.qual-inventory-table input[type="checkbox"] { width: auto; }
.qual-inventory-table tr.excluded td { background: var(--border-light); color: var(--text-tertiary); }
.qual-inventory-table tr.excluded td:first-child { color: inherit; }
.exclusion-rationale-row td { border-top: none !important; padding-top: 0; }
.exclusion-rationale-row input[type="text"] { width: auto; }

/* Consent */
.qual-consent-box { background: var(--info-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin: 1.5rem 0; }

/* Progress */
.qual-progress { text-align: center; padding: 2rem; }
.progress-bar { height: 8px; background: var(--border); border-radius: var(--radius-sm); margin: 1rem 0; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: var(--radius-sm); transition: width 0.3s; }

/* Coding workspace */
.qual-coding-workspace { max-width: 1200px; }
.qual-coding-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; min-height: 500px; }
.qual-theme-sidebar { border-right: 1px solid var(--border); padding-right: 1rem; overflow-y: auto; max-height: 70vh; }
.qual-theme-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.qual-theme-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0.5rem; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left; }
.qual-theme-btn:hover, .qual-theme-btn:focus { border-color: var(--primary); background: var(--primary-surface); }
.qual-theme-btn.active { border-color: var(--primary); background: var(--primary-surface); font-weight: 600; }
.qual-theme-count { background: var(--border-light); padding: 0.125rem 0.5rem; border-radius: 10px; font-size: 0.75rem; }
.qual-filter-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 0.75rem; background: var(--primary-surface); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.qual-filter-bar label { font-size: 0.875rem; font-weight: 500; }
.qual-filter-bar select { padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Excerpt cards */
.qual-excerpt-cards { display: flex; flex-direction: column; gap: 1rem; }
.qual-excerpt-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; }
.qual-excerpt-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.qual-excerpt-quote { border-left: 4px solid var(--primary); padding-left: 1rem; margin: 0.75rem 0; font-style: italic; }
.qual-excerpt-code { font-family: monospace; font-size: 0.75rem; background: var(--border-light); padding: 0.125rem 0.375rem; border-radius: 3px; }

/* Badges */
.badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 10px; font-size: 0.75rem; background: var(--border-light); }
.badge-new { background: var(--primary); color: #fff; font-weight: 600; }

/* Traffic lights — intentionally use specific colours for green/yellow/red */
.qual-traffic-light { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius-sm); margin: 1rem 0; }
.qual-traffic-green { background: var(--success-bg); border: 1px solid #66bb6a; }
.qual-traffic-yellow { background: var(--warning-bg); border: 1px solid #ffca28; }
.qual-traffic-red { background: var(--error-bg); border: 1px solid #ef5350; }
.qual-traffic-indicator { width: 16px; height: 16px; border-radius: 50%; }
.qual-traffic-green .qual-traffic-indicator { background: #66bb6a; }
.qual-traffic-yellow .qual-traffic-indicator { background: #ffca28; }
.qual-traffic-red .qual-traffic-indicator { background: #ef5350; }
.qual-traffic-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.25rem; }
.qual-traffic-dot.qual-traffic-green { background: #66bb6a; }
.qual-traffic-dot.qual-traffic-yellow { background: #ffca28; }
.qual-traffic-dot.qual-traffic-red { background: #ef5350; }

/* Verification check traffic badges */
.traffic-badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; }
.traffic-badge-green { background: var(--success-bg); color: var(--success); }
.traffic-badge-yellow { background: var(--warning-bg); color: var(--warning); }
.traffic-badge-red { background: var(--error-bg); color: var(--error); }
.traffic-badge-na { background: var(--border-light); color: var(--text-secondary); }

/* Profile */
.qual-profile-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; min-height: 500px; }
.qual-transcript-text { max-height: 60vh; overflow-y: auto; white-space: pre-wrap; font-size: 0.875rem; line-height: 1.6; padding: 1rem; background: var(--primary-surface); border-radius: var(--radius-sm); }
.qual-chat-msg { padding: 0.5rem; margin: 0.5rem 0; border-radius: var(--radius-sm); }
.qual-chat-user { background: var(--info-bg); }
.qual-chat-assistant { background: var(--border-light); }

/* Danger zone */
.qual-export-danger { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.btn-danger { background: var(--error); color: #fff; border: none; padding: 0.5rem 1rem; border-radius: var(--radius-sm); cursor: pointer; }

/* Decision log */
.qual-decision-log { width: 100%; border-collapse: collapse; }
.qual-decision-log th, .qual-decision-log td { padding: 0.5rem; border: 1px solid var(--border); text-align: left; font-size: 0.875rem; }

/* Quote accuracy gate */
.qual-accuracy-card { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin: 1.25rem 0; }
.qual-accuracy-card.qual-accuracy-green { background: var(--success-bg); border: 1px solid #66bb6a; }
.qual-accuracy-card.qual-accuracy-yellow { background: var(--warning-bg); border: 1px solid #ffca28; }
.qual-accuracy-card.qual-accuracy-red { background: var(--error-bg); border: 1px solid #ef5350; }
.qual-accuracy-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.qual-accuracy-indicator { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.qual-accuracy-indicator.green { background: #2d8659; }
.qual-accuracy-indicator.yellow { background: #b8860b; }
.qual-accuracy-indicator.red { background: #c0392b; }
.qual-accuracy-count { font-size: 0.875rem; color: var(--text-secondary); margin-left: auto; }
.qual-accuracy-breakdown { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.35rem; }
.qual-accuracy-details { margin-top: 0.75rem; }
.qual-accuracy-details summary { cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.qual-accuracy-issues { list-style: none; padding: 0; margin-top: 0.5rem; }
.qual-accuracy-issues li { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.375rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.8125rem; }
.qual-accuracy-issues li:last-child { border-bottom: none; }
.qual-accuracy-pid { font-family: monospace; font-size: 0.75rem; background: var(--border-light); padding: 0.125rem 0.375rem; border-radius: 3px; flex-shrink: 0; }
.qual-accuracy-text { color: var(--text-secondary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qual-accuracy-score { font-family: monospace; font-size: 0.75rem; color: var(--text-tertiary); flex-shrink: 0; }

/* Codebook */
.qual-codebook-list { list-style: none; padding: 0; }
.qual-codebook-list li { padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }

/* Theme-participant matrix */
.qual-matrix-panel { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.qual-matrix-panel summary { font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text-secondary); padding: 0.25rem 0; }
.qual-matrix-panel summary:hover { color: var(--text); }
.qual-matrix-scroll { overflow-x: auto; margin-top: 0.5rem; }
.qual-matrix-table { font-size: 0.75rem; border-collapse: collapse; width: 100%; }
.qual-matrix-table th,
.qual-matrix-table td { padding: 0.2rem 0.4rem; text-align: center; border: 1px solid var(--border-light); white-space: nowrap; }
.qual-matrix-table thead th { background: var(--primary-surface); font-weight: 600; font-size: 0.7rem; }
.qual-matrix-table th[scope="row"] { text-align: left; font-weight: 500; background: var(--primary-surface); }
.qual-matrix-zero { color: var(--text-tertiary); }
.qual-matrix-total { font-weight: 600; background: var(--border-light); }
.qual-matrix-grand-total { background: var(--primary-light); }
.qual-matrix-gap { background: var(--warning-bg); }
.qual-matrix-gap-row th,
.qual-matrix-gap-row td { background: var(--warning-bg); }
.qual-matrix-gap-row .qual-matrix-total { background: var(--warning-bg); font-weight: 700; }

/* Responsive */
@media (max-width: 900px) {
    .qual-coding-layout { grid-template-columns: 1fr; }
    .qual-theme-sidebar { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 1rem; max-height: 200px; }
    .qual-profile-layout { grid-template-columns: 1fr; }
    .qual-process-overview { flex-direction: column; gap: 0.5rem; }
    .qual-phase-arrow { padding: 0 0.5rem; transform: rotate(90deg); }
}

/* ------------------------------------------------------------------ */
/* Transcription workflow                                              */
/* ------------------------------------------------------------------ */

.workflow-progress {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.progress-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.progress-message {
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 500;
}

.progress-status .progress-bar {
    width: 100%;
    max-width: 400px;
    margin: 0;
}

.progress-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.workflow-progress-note {
    text-align: center;
    margin-bottom: 2rem;
}

.workflow-progress-note p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Progress stage dots (stage preset) */
.progress-stages {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

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

.progress-stage-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s, border-color 0.2s;
}

.progress-stage--complete .progress-stage-dot {
    background: var(--lo-accent);
    color: #fff;
    border: 2px solid var(--lo-accent);
}

.progress-stage--active .progress-stage-dot {
    background: var(--primary-surface);
    border: 2px solid var(--primary);
}

.progress-stage--pending .progress-stage-dot {
    background: var(--surface);
    border: 2px solid var(--border);
}

.progress-stage-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    max-width: 80px;
}

.progress-stage--active .progress-stage-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-stage--complete .progress-stage-label {
    color: var(--lo-accent);
}

.progress-stage-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-top: 16px; /* centre on dot */
    min-width: 24px;
}

.progress-stage-connector--reached {
    background: var(--lo-accent);
}

.spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* Friendly message (heading + detail) */
.progress-friendly-message {
    text-align: center;
    margin-bottom: 0.5rem;
}

.progress-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.progress-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Progress counter (batch preset) */
.progress-counter {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 1rem;
}

/* Elapsed time */
.progress-elapsed {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0.75rem 0 0;
}

/* Safe-to-leave reassurance */
.progress-safe-to-leave {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.progress-safe-to-leave svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--lo-accent);
}

.progress-safe-to-leave p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
    text-align: left;
    max-width: 400px;
}

.transcribe-preview,
.transcribe-downloads,
.transcribe-handoff,
.next-steps {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.transcript-textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    resize: vertical;
    margin: 1rem 0;
}

.transcript-truncated {
    font-size: 0.85rem;
    font-style: italic;
}

.download-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
}

/* Pipeline step indicator */

.pipeline-steps {
    margin-bottom: 1.5rem;
}

.pipeline-steps ol {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pipeline-step {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.pipeline-step::after {
    content: "\2192";
    margin: 0 0.75rem;
    color: var(--border);
}

.pipeline-step:last-child::after {
    display: none;
}

.pipeline-step--complete {
    color: var(--primary);
    font-weight: 600;
}

.pipeline-step--current {
    color: var(--text);
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Login page                                                          */
/* ------------------------------------------------------------------ */

/* Login — uses site-wide .btn, .alert, border/shadow tokens */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 2.5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo { margin-bottom: 1.5rem; }

.login-container h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-container > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.login-form { text-align: left; }

.login-form .form-group { margin-bottom: 1.25rem; }

.login-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.login-form .form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(173, 84, 21, 0.12);
}

.login-form .btn { width: 100%; margin-top: 0.5rem; }

.login-back { margin-top: 1.5rem; font-size: 0.85rem; }
.login-back a { color: var(--text-secondary); text-decoration: none; }
.login-back a:hover { color: var(--primary); }

.nav-link-auth {
    margin-left: auto;
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------ */
/* Guide Assistant (handbook chat)                                     */
/* ------------------------------------------------------------------ */

.handbook-container {
    position: relative;
}

.handbook-entry {
    text-align: center;
    padding: var(--space-xl) 0;
    max-width: 800px;
    margin: 0 auto;
}

.handbook-entry .workflow-header {
    text-align: center;
}

/* Override: handbook heading is a UI question, not a branded workflow title —
   use default text colour instead of the component's orange (--primary). */
.handbook-entry .workflow-header h1 {
    color: var(--text);
}

.handbook-entry .workflow-header p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.handbook-search-form {
    margin-bottom: var(--space-lg);
}

.handbook-input-row {
    display: flex;
    gap: var(--space-sm);
}

.handbook-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--surface);
    transition: border-color 0.15s;
}

.handbook-input:focus {
    outline: 3px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

.handbook-send {
    white-space: nowrap;
}

.handbook-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.handbook-pill {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.handbook-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.handbook-pill:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 1px;
}

.handbook-trust {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.handbook-privacy {
    font-size: 0.8rem;
    margin-top: var(--space-xs);
    opacity: 0.8;
}

.handbook-error {
    max-width: 800px;
    margin: var(--space-md) auto;
    padding: 0 var(--space-md);
}

.handbook-chat {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
}

.handbook-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.handbook-msg {
    display: flex;
    flex-direction: column;
}

.handbook-msg--user {
    align-items: flex-end;
}

.handbook-msg--model {
    align-items: flex-start;
}

.handbook-msg-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    line-height: 1.6;
    font-size: 0.95rem;
}

.handbook-msg--user .handbook-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.handbook-msg--model .handbook-msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
}

/* Neutralise headings inside chat bubbles — keep them visually inline
   so they don't break heading hierarchy or dominate the conversation. */
.handbook-prose h1,
.handbook-prose h2,
.handbook-prose h3,
.handbook-prose h4,
.handbook-prose h5,
.handbook-prose h6 {
    font-size: inherit;
    font-weight: 600;
    margin: 0.6rem 0 0.3rem;
}

.handbook-prose h1:first-child,
.handbook-prose h2:first-child,
.handbook-prose h3:first-child {
    margin-top: 0;
}

/* Prose formatting for rendered markdown in assistant responses */
.handbook-prose p {
    margin: 0 0 0.6rem;
}

.handbook-prose p:last-child,
.handbook-prose p:last-of-type {
    margin-bottom: 0;
}

.handbook-prose ul,
.handbook-prose ol {
    padding-left: 1.4rem;
    margin: 0.4rem 0 0.6rem;
}

.handbook-prose li {
    margin-bottom: 0.25rem;
}

.handbook-prose li:last-child {
    margin-bottom: 0;
}

.handbook-prose strong {
    font-weight: 600;
}

.handbook-prose a {
    color: var(--primary);
    text-decoration: underline;
}

.handbook-prose a:hover {
    color: var(--primary-hover);
}

/* Adjacent block spacing (e.g. paragraph followed by list) */
.handbook-prose p + ul,
.handbook-prose p + ol {
    margin-top: -0.2rem;
}

/* Remove bottom margin on the last prose element before citations */
.handbook-prose > *:last-of-type:not(.handbook-citations) {
    margin-bottom: 0;
}

.handbook-citations {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.handbook-citations-label {
    font-weight: 600;
    margin-right: 0.2rem;
}

.handbook-citations a {
    color: var(--primary);
    text-decoration: underline;
}

.handbook-citations a:hover {
    color: var(--primary-hover);
}

.handbook-feedback {
    display: flex;
    gap: var(--space-xs);
    margin-top: 0.25rem;
}

.handbook-feedback-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.handbook-feedback-btn:hover {
    color: var(--primary);
    border-color: var(--border-light);
}

.handbook-feedback-btn[aria-pressed="true"] {
    color: var(--primary);
    border-color: var(--primary);
}

.handbook-feedback-btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 1px;
}

.handbook-input-bar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-light);
    position: sticky;
    bottom: 0;
    background: var(--bg);
}

.handbook-new-chat {
    text-align: right;
    padding: var(--space-sm) 0 0;
}

.handbook-new-chat a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.handbook-new-chat a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.handbook-loading {
    display: none;
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.htmx-request .handbook-loading,
.htmx-request.handbook-loading {
    display: block;
}

.handbook-limit {
    text-align: center;
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

.handbook-limit p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

@media (max-width: 768px) {
    .handbook-input-row {
        flex-direction: column;
    }

    .handbook-msg-bubble {
        max-width: 92%;
    }
}

/* ------------------------------------------------------------------ */
/* Qualitative Analysis — 4-step flow                                  */
/* ------------------------------------------------------------------ */

.qual-data-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.qual-summary-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.qual-summary-stats .stat {
    text-align: center;
}

.qual-summary-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--primary);
}

.qual-summary-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.qual-questions-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.qual-questions-fieldset legend {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0 0.5rem;
}

.fieldset-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.qual-question-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.qual-question-item:last-child {
    border-bottom: none;
}

.qual-question-item input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.qual-question-item label {
    line-height: 1.5;
}

.qual-form-group {
    margin-bottom: 1.5rem;
}

.qual-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-input:focus {
    outline: 3px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

/* Additional options section on confirm page */
.qual-additional-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.qual-additional-toggle {
    padding: 1rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
}

.qual-additional-body {
    padding: 0 1.5rem 1.5rem;
}

.qual-context-fieldset {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.qual-context-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.375rem;
}

.qual-question-item input[type="radio"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.form-input-inline {
    width: auto;
    flex: 1;
    min-width: 12rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

.form-input-inline:focus {
    outline: 3px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}

/* Custom evaluation questions */
.qual-custom-eq-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.qual-custom-eq-row .form-input {
    flex: 1;
}

.qual-custom-eq-list {
    list-style: none;
    padding: 0;
    margin-top: 0.75rem;
}

.qual-custom-eq-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 0.375rem;
}

.qual-custom-eq-item span {
    flex: 1;
}

.btn-remove {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.btn-remove:hover {
    color: var(--error);
    border-color: var(--error);
}

.qual-key-findings {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.qual-findings-preview {
    margin-bottom: 2rem;
}

.qual-finding-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.qual-finding-card summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qual-finding-card summary:hover {
    background: var(--primary-surface);
}

.qual-finding-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.qual-finding-body {
    padding: 0 1.5rem 1.5rem;
}

.qual-finding-section {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.qual-finding-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qual-finding-positive {
    background: var(--success-bg);
    border-left: 3px solid var(--success);
}

.qual-finding-attention {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
}

.qual-finding-discussion {
    background: var(--info-bg);
    border-left: 3px solid var(--primary);
}

.qual-download-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.btn-danger-outline {
    color: var(--error);
    border: 1px solid var(--error);
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger-outline:hover {
    background: var(--error-bg);
}

@media (max-width: 768px) {
    .qual-summary-stats {
        flex-direction: column;
        gap: 1rem;
    }
}
