/* ============================================================
   Theme: calm, neutral look for the SPP research service.
   Loaded last on every page, overrides the older stylesheets
   without touching the classes and ids the scripts depend on.
   ============================================================ */
:root {
    --font-display: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --c-teal: #0b5563;          /* primary, 8.1:1 on white */
    --c-teal-dark: #083f4a;
    --c-teal-tint: #e8f1f3;
    --c-green: #1f7a5c;
    --c-red: #a3352a;
    --c-amber: #8a5a00;

    --c-page: #f3f5f7;
    --c-bg: #ffffff;
    --c-bg-sunken: #f7f8fa;
    --c-border: #dce1e6;
    --c-border-strong: #c3cbd3;
    --c-text: #17212b;
    --c-text-muted: #55616d;    /* 6.3:1 on white */

    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
    --topbar-height: 64px;
    --side-width: 360px;
}

html { scroll-behavior: smooth; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    background: var(--c-page);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection { background: #cfe3e8; color: var(--c-text); }

:focus-visible {
    outline: 3px solid #2f8fa3;
    outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    padding: 0.6rem 1rem; border-radius: var(--radius-sm);
    background: var(--c-teal); color: #fff; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------------- header ---------------- */
.topbar {
    position: sticky; top: 0;
    min-height: var(--topbar-height);
    padding: 0 clamp(1rem, 3vw, 2rem);
    gap: 1rem;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
}
.topbar-brand {
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none; min-width: 0;
}
.logo-img { height: 34px; margin: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-brand .brand-name {
    font-size: 1.1rem; font-weight: 700; letter-spacing: 0;
    color: var(--c-text); text-transform: none;
}
.brand-sub { font-size: 0.8rem; color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { gap: 0.25rem; }
.topbar-btn {
    font-size: 0.95rem; font-weight: 500;
    color: var(--c-text-muted);
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
}
.topbar-btn i { font-size: 0.9em; }
.topbar-btn:hover { background: var(--c-bg-sunken); color: var(--c-teal); }
.topbar-btn[aria-current="page"] { color: var(--c-teal); box-shadow: inset 0 -2px 0 var(--c-teal); border-radius: 0; }
.topbar-btn.account {
    margin-left: 0.5rem;
    border: 1px solid var(--c-teal);
    color: var(--c-teal);
    font-weight: 600;
}
.topbar-btn.account:hover,
.topbar-btn.account[aria-current="page"] { background: var(--c-teal); color: #fff; box-shadow: none; border-radius: var(--radius-sm); }

/* ---------------- service bar ---------------- */
.service-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem;
    padding: 0.55rem clamp(1rem, 3vw, 2rem);
    background: var(--c-teal-tint);
    border-bottom: 1px solid #cfe0e4;
    font-size: 0.9rem; color: var(--c-text);
}
.service-badge {
    padding: 0.1rem 0.5rem; border-radius: 999px;
    background: var(--c-teal); color: #fff;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
}
.service-bar a { color: var(--c-teal-dark); font-weight: 600; }

/* ---------------- page frame ---------------- */
.app-body { flex: 1; display: block; min-height: 0; }
.Main {
    overflow: visible;
    padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 3rem;
}
.main-inner { max-width: 1240px; gap: 1.5rem; }

.page-head h1, .hero h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
    color: var(--c-text);
}
.page-head p, .hero p { margin: 0; max-width: 70ch; font-size: 1.05rem; color: var(--c-text-muted); }
.top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-width);
    gap: 1.5rem;                     /* align-items defaults to stretch */
}
.top-main { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }

.steps {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
    list-style: none; margin: 1rem 0 0; padding: 0;
    font-size: 0.95rem; color: var(--c-text);
}
.steps li { display: flex; align-items: center; gap: 0.5rem; }
.step-no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    border: 1.5px solid var(--c-teal); color: var(--c-teal);
    font-size: 0.85rem; font-weight: 700;
}

/* notices (hf token / audio), only visible when relevant */
.notice:not(:has(p:not(.disabled))) { display: none; }
.notice p {
    margin: 0 0 0.5rem; padding: 0.75rem 1rem;
    border-radius: var(--radius-sm); border: 1px solid; border-left-width: 4px;
    font-size: 0.95rem;
}
.notice .important { background: #fdf3f2; border-color: #e8c3be; border-left-color: var(--c-red); color: #5c1d16; }
.notice .information { background: #fff8e8; border-color: #ecd9a8; border-left-color: var(--c-amber); color: #4a3300; }
.notice .disabled { display: none; }
.notice-item { position: relative; }   /* tooltip positions relative to this */

.notice .notice-link {
    display: flex; align-items: center; gap: 0.5rem;
    color: inherit; text-decoration: none; font-weight: 600;
}
.notice .notice-link:hover { text-decoration: underline; }
.notice .important .notice-icon { color: var(--c-red); }
.notice .information .notice-icon { color: var(--c-amber); }

.notice-detail {
    display: none;
    position: absolute; top: 100%; left: 0; z-index: 10;
    width: max-content; max-width: min(360px, 90vw);
    padding: 0.75rem 1rem;
    background: var(--c-bg);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
    color: var(--c-text);
    font-size: 0.9rem; font-weight: 400; line-height: 1.5;
}
.notice-item:hover .notice-detail,
.notice-item:focus-within .notice-detail { display: block; }
/* ---------------- cards ---------------- */
.card,
.Input, .Queue, .Output {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem;
}
.card-heading,
.Queue .section-header, .Output .section-header {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem; font-weight: 700;
    letter-spacing: 0; text-transform: none;
    color: var(--c-text);
}
.Queue .card-heading { margin-bottom: 0.5rem; }
.field-hint { font-size: 0.85rem; color: var(--c-text-muted); }

/* ---------------- work area: content + settings column ---------------- */
/*.work-row {*/
/*    display: grid;*/
/*    grid-template-columns: minmax(0, 1fr) var(--side-width);*/
/*    gap: 1.5rem;*/
/*    align-items: start;*/
/*}*/


.work-main { gap: 1.5rem; }
.side-column {
    display: flex; flex-direction: column; gap: 1rem;
    position: sticky; top: calc(var(--topbar-height) + 1rem);
}

@media (min-width: 1081px) {
    .side-column {
        display: flex; flex-direction: column; gap: 1rem;
        contain: size;               /* column adds 0 to the row height */
    }
    .page-process .Sidebar { flex: 1 1 0; min-height: 0; max-height: none; }
    .widgets { flex: 0 0 auto; }
}

@media (max-width: 1080px) {
    .top-row { grid-template-columns: minmax(0, 1fr); }
    .page-process .Sidebar { order: -1; max-height: none; overflow: visible; }
    .page-process .sidebar-panels { overflow-y: visible; }
}

/* ---------------- settings panel (was the hover sidebar) ---------------- */
.page-process .Sidebar {
    display: flex; flex-direction: column;
    max-height: calc(100vh - var(--topbar-height) - 2rem);
    overflow: hidden;
    padding: 1.25rem;
    background: var(--c-bg);
}
.page-process .Sidebar .card-heading { margin-bottom: 0.75rem; }
.page-process .sidebar-pin-floating { display: none; }
.page-process .sidebar-tabs {
    flex-direction: row; margin: 0 0 1rem; padding: 0.25rem;
    gap: 0.25rem; overflow: visible;
    background: var(--c-bg-sunken); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.page-process .sidebar-tab {
    flex: 1; justify-content: center; gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    border: none; border-radius: 4px;
    font-size: 0.9rem; font-weight: 600; color: var(--c-text-muted);
}
.page-process .sidebar-tab .tab-icon { width: auto; height: auto; font-size: 0.85em; }
.page-process .sidebar-tab .tab-label { opacity: 1; }
.page-process .sidebar-tab.active {
    background: var(--c-bg); color: var(--c-teal);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
.page-process .sidebar-panels {
    opacity: 1; pointer-events: auto; padding: 0 0.25rem 0 0;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
}
.page-process .Sidebar > .card-heading,
.page-process .sidebar-tabs { flex: 0 0 auto; }

.settings-footer {
    flex: 0 0 auto;
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid var(--c-border);
}
.settings-footer h5 {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.85rem; font-weight: 600; color: var(--c-text);
}
.sidebar-panel h5 {
    margin: 1.1rem 0 0.4rem;
    font-family: var(--font-display);
    font-size: 0.85rem; font-weight: 600;
    letter-spacing: 0; text-transform: none;
    color: var(--c-text);
}
.sidebar-panel h5 label { font: inherit; }

#entryBox-component, #parameters .form-control, #parameters-high .form-control {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    background: var(--c-bg);
    font-size: 0.9rem; color: var(--c-text);
}
#entryBox-component:disabled { background: var(--c-bg-sunken); color: var(--c-text-muted); }

/* toggles (modality / method chips) */
.btn-group-toggle { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.btn-toggle, .form-check label.btn-toggle {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 0.9rem; font-weight: 500;
}
.btn-toggle:hover:not(:disabled) { border-color: var(--c-teal); color: var(--c-teal); }
.btn-toggle.active:hover:not(:disabled) {
    background: #cfe3e8;                 /* lighter teal, already used in ::selection */
    border-color: var(--c-teal);
    color: var(--c-teal-dark);
}
.btn-toggle.active,
.form-check-input[type="checkbox"]:checked + label.btn-toggle {
    background: var(--c-teal); border-color: var(--c-teal); color: #fff;
}
.btn-information {
    display: inline-flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.5rem;
    color: var(--c-teal); font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.btn-information:hover { text-decoration: underline; }

/* model cards */
.model-card { border-radius: var(--radius-sm); border-color: var(--c-border); }
.model-card.active { border-color: var(--c-teal); box-shadow: inset 3px 0 0 var(--c-teal); background: var(--c-teal-tint); }

/* guest lock note */
.guest-lock-notice {
    border-left-color: var(--c-teal);
    font-size: 0.9rem; color: var(--c-text);
}

/* ---------------- input card ---------------- */
.input-method-row { gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.input-method-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    background: var(--c-bg); color: var(--c-text);
    font-size: 0.95rem; font-weight: 600;
}
.input-method-btn:hover { border-color: var(--c-teal); color: var(--c-teal); }
.input-method-btn.active { background: var(--c-teal); border-color: var(--c-teal); color: #fff; }

.modality-select-container { display: flex; align-items: center; gap: 0.5rem; }
#modality-select, .mode-select {
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    background: var(--c-bg); color: var(--c-text);
    font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
}

#drop-zone {
    min-height: 170px;
    border: 2px dashed var(--c-border-strong); border-radius: var(--radius-md);
    background: var(--c-bg-sunken);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--c-text-muted); font-size: 1rem; text-align: center;
}
#drop-zone:hover { border-color: var(--c-teal); background: var(--c-teal-tint); color: var(--c-teal-dark); }
#drop-zone-text i { display: block; margin: 0 auto 0.5rem; font-size: 1.4rem; color: var(--c-teal); }

#text-input-area {
    min-height: 170px;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-md);
    font-family: var(--font-display); font-size: 1rem; line-height: 1.55;
    color: var(--c-text);
}
#text-input-area:focus { border-color: var(--c-teal); }

.input-actions {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem;
}
.process-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; width: auto; justify-content: flex-end; }
.process-controls .mode-select-wrap { width: 190px; max-width: 190px; }

#clear-btn {
    padding: 0.55rem 1rem;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    background: var(--c-bg); color: var(--c-text); font-weight: 600;
}
#clear-btn:hover { border-color: var(--c-text-muted); background: var(--c-bg-sunken); }

#process-btn {
    flex: 0 0 auto; width: auto; height: 46px;
    padding: 0 1.75rem; gap: 0.5rem;
    border-radius: var(--radius-sm) !important;
    background: var(--c-teal);
    font-size: 1rem; font-weight: 700; letter-spacing: 0;
}
#process-btn:hover:not(:disabled) { background: var(--c-teal-dark); transform: none; }

#download-all-btn {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--c-teal); border-radius: var(--radius-sm);
    background: var(--c-bg); color: var(--c-teal); font-weight: 600;
}
#download-all-btn:hover:not(:disabled) { background: var(--c-teal); color: #fff; }

/* queue & results inside cards */
.Queue .queue-item, .output-item { border-radius: var(--radius-sm); }
.queue-summary { font-size: 0.95rem; color: var(--c-text-muted); }

/* ---------------- widgets: now part of the settings column ---------------- */
.widgets {
    position: static; width: auto; left: auto; top: auto;
    display: flex; flex-direction: column; gap: 1rem;
}
@media (max-width: 1600px) {
    .widgets { display: flex; }

}
.widget-card, #queue-indicator-widget {
    padding: 1rem 1.25rem;
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    background: var(--c-bg); box-shadow: var(--shadow-card);
    animation: none;
}
.widget-title {
    margin: 0 0 0.4rem;
    font-size: 0.95rem; font-weight: 700; letter-spacing: 0; text-transform: none;
    color: var(--c-text);
}
.quota-line { font-size: 0.95rem; color: var(--c-text); margin: 0; }
.quota-link { display: block; margin: 0.5rem 0 0; color: var(--c-teal); font-weight: 600; }
.widget-info { font-size: 0.85rem; }
.widget-status { color: var(--c-teal-dark); }

/* ---------------- footer ---------------- */
.footer {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    background: var(--c-bg); border-top: 1px solid var(--c-border);
    font-size: 0.9rem; color: var(--c-text-muted);
}
.footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.footer a { color: var(--c-text-muted); text-decoration: none; }
.footer a:hover { color: var(--c-teal); text-decoration: underline; }

/* ---------------- account page: sidebar as a fixed side navigation ---------------- */
.page-account .app-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}
.page-account .Sidebar { background: var(--c-bg); border-right: 1px solid var(--c-border); }
.page-account .sidebar-pin-floating { display: none; }
.page-account .sidebar-tabs { margin-top: 1rem; }
.page-account .sidebar-tab { padding: 0.6rem 1.25rem; font-size: 0.95rem; }
.page-account .sidebar-tab .tab-label { opacity: 1; }
.page-account .sidebar-tab.active { border-left-color: var(--c-teal); background: var(--c-teal-tint); color: var(--c-teal-dark); }
.page-account .main-inner, .page-docs .main-inner { max-width: 900px; }
.settings-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

/* ---------------- documentation page ---------------- */
.documentation-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.documentation-nav li {
    margin: 0;
    padding: 0;
}

.documentation-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    border-radius: 6px;
    color: inherit;
    transition: background-color 0.2s ease;
}

.documentation-nav a:hover {
    background-color: var(--c-teal-dark);
    color: white;
}
.page-docs .main-inner {
    max-width: 1240px;
}

.page-docs .top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-width);
    gap: 1.5rem;
}

.page-docs .Sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
    height: fit-content;
    max-height: calc(100vh - var(--topbar-height) - 2rem);
    overflow: auto;
}

.page-docs .top-main > .text {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: clamp(1.25rem, 3vw, 2.5rem);
}
@media (max-width: 1080px) {
    .page-docs .top-row {
        display: flex;
        flex-direction: column;
    }

    .page-docs .side-column {
        order: -1;
        width: 100%;
        position: static;
    }

    .page-docs .top-main {
        width: 100%;
    }

    .page-docs .Sidebar {
        display: flex;
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    .page-docs .sidebar-panels {
        overflow-y: visible;
    }
}
/* Documentation sidebar: keep the contents visible */
.page-docs .sidebar-panels {
    display: block;
    overflow: visible;
}

.page-docs .sidebar-panel {
    display: block !important;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: visible;
}

/* Prevent hover effects from controlling panel visibility */
.page-docs .Sidebar:hover .sidebar-panel,
.page-docs .Sidebar:hover .sidebar-panels {
    display: block;
    visibility: visible;
    opacity: 1;
}
/* ---------------- small screens ---------------- */
@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; position: static; }
    .brand-sub { display: none; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    /* icons only, the label stays readable for screen readers */
    .topbar-btn:not(.account) span {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .topbar-btn { padding: 0.55rem 0.75rem; }
    .page-account .app-body { grid-template-columns: minmax(0, 1fr); }
    .page-account .Sidebar, .page-account .Main { grid-column: 1; }
    .page-account .Sidebar { border-right: none; border-bottom: 1px solid var(--c-border); }
    .page-account .sidebar-tabs { flex-direction: row; overflow-x: auto; margin: 0; }
    .page-account .sidebar-tab { border-left: none; border-bottom: 3px solid transparent; }
    .page-account .sidebar-tab.active { border-bottom-color: var(--c-teal); }
    .input-actions, .process-controls { width: 100%; }
    .process-controls .mode-select-wrap { flex: 1; max-width: none; width: auto; }
    #process-btn { flex: 1 1 100%; }
    .side-column { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------------- modality switch on the input card ---------------- */
.page-process #modality-selection { display: none !important; }   /* the switch below replaces it */
.modality-switch {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem; margin-bottom: 1rem;
}
.modality-option {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-md);
    background: var(--c-bg); color: var(--c-text);
    font-size: 1rem; font-weight: 600;
}
.modality-option i { color: var(--c-teal); }
.modality-option:hover { border-color: var(--c-teal); background: var(--c-teal-tint); }
.modality-option.active {
    border-color: var(--c-teal); background: var(--c-teal-tint); color: var(--c-teal-dark);
    box-shadow: inset 0 0 0 1px var(--c-teal);
}
.modality-switch[inert] { opacity: 0.55; }
.input-method-btn.hidden { display: none; }

/* ---------------- result cards ---------------- */
.output-section { display: flex; flex-direction: column; gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.Output .output-item {
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    background: var(--c-bg); overflow: hidden; padding: 0;
}
.Output .output-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; background: var(--c-bg-sunken);
    border-bottom: 1px solid var(--c-border); cursor: default;
    font-family: var(--font-display); font-size: 1rem; color: var(--c-text);
    justify-content: flex-start;
}
.output-icon { color: var(--c-teal); width: 1.1rem; text-align: center; }
.output-title { flex: 1; min-width: 0; }
.output-name { display: block; font-weight: 700; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.Output .output-meta {
    display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin: 0.1rem 0 0; padding: 0;
    font-size: 0.85rem; font-weight: 400; font-style: normal; opacity: 1; color: var(--c-text-muted);
}
.Output .output-meta span { margin: 0; }
.output-chip {
    padding: 0 0.45rem; border-radius: 999px;
    background: var(--c-teal-tint); color: var(--c-teal-dark); font-weight: 600;
}
.Output .output-buttons {
    display: flex; align-items: center; gap: 0.4rem; margin: 0;
    width: auto; padding: 0; flex-shrink: 0; justify-content: flex-end;
}
.Output .output-buttons button {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.75rem; height: auto;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    background: var(--c-bg); color: var(--c-text);
    font-size: 0.9rem; font-weight: 600;
}
.Output .output-buttons button:hover:not(:disabled) { border-color: var(--c-teal); color: var(--c-teal); }
.Output .output-buttons .download-btn { background: var(--c-teal); border-color: var(--c-teal); color: #fff; }
.Output .output-buttons .download-btn:hover:not(:disabled) { background: var(--c-teal-dark); color: #fff; }
.Output .output-body { padding: 1rem 1.25rem; background: var(--c-bg); border: 0; margin: 0; }
.Output .output-body[hidden] { display: none; }
.output-text {
    white-space: pre-wrap; overflow-wrap: anywhere;
    font-size: 1rem; line-height: 1.75; color: var(--c-text);
    max-height: 26rem; overflow-y: auto;
}
.pii-tag {
    padding: 0.05rem 0.4rem; border-radius: 4px;
    background: #e3eef1; color: var(--c-teal-dark);
    border: 1px solid #c4dbe1;
    font-family: var(--font-mono); font-size: 0.82em; font-weight: 500;
    white-space: nowrap;
}
.pii-tag::before { content: "["; opacity: 0.55; }
.pii-tag::after { content: "]"; opacity: 0.55; }
.output-media { max-width: 100%; border-radius: var(--radius-sm); }
.output-item.pending .output-header { opacity: 0.75; }

@media (max-width: 760px) {
    .Output .output-header { flex-wrap: wrap; }
    .Output .output-buttons { width: 100%; }
    .Output .output-buttons .download-btn { flex: 1; justify-content: center; }
}
