/* Copyright (c) 2024–2026 Data Curators BV. All rights reserved.
 * Proprietary and confidential. Unauthorized copying, modification,
 * or distribution is prohibited except as expressly permitted by license.
 */

/* Shared TIDE NeXT design tokens and application shell. */
:root {
  --navy: #1a1a2e;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --muted: #64748b;
  --border: #e2e8f4;
  --border-strong: #cfd8e8;
  --bg: #f8faff;
  --surface: #fff;
  --surface-2: #f3f6fc;
  --mono: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
}
body { background: var(--bg); color: var(--navy); font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.6; }
.container-fluid { padding: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.app-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tide-mark { height: 44px; width: 33px; flex: 0 0 auto; }
.brand-titles { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.brand-titles span { display: block; font-size: 12px; font-weight: 400; letter-spacing: .02em; color: var(--muted); margin-top: 5px; }
.app-header #identity > div { display: flex; align-items: center; gap: 16px; }
.app-main { max-width: 1440px; margin: auto; padding: 24px 32px 48px; min-height: calc(100vh - 200px); }
.app-footer { max-width: 1376px; margin: 0 auto; padding: 20px 0; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.tide-logo { width: 125px; height: auto; }
/* Signed-out welcome and session loading. */
.session-loading { padding: 96px 0; text-align: center; color: var(--muted); }
.welcome { padding: 36px 0 12px; }
.welcome-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; padding: 20px 0 44px; }
.welcome-eyebrow { color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 24px; }
.welcome h1 { font-size: clamp(38px, 4.5vw, 64px); line-height: 1.08; font-weight: 600; letter-spacing: -.045em; max-width: 640px; margin: 0 0 24px; }
.welcome-intro { max-width: 490px; color: var(--muted); font-size: 19px; line-height: 1.65; margin-bottom: 30px; }
.welcome-sign-in { padding: 14px 22px; font-size: 16px; }
.welcome-sign-in span { margin-left: 18px; }
.welcome-access { color: var(--muted); font-size: 12px; margin-top: 14px; }
.welcome-art { position: relative; min-width: 0; border-radius: 32px; background: radial-gradient(ellipse, #dbeafe 0, #eff6ff88 48%, transparent 72%); }
.welcome-art img { display: block; width: 100%; height: auto; }
.welcome-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.welcome-feature { padding: 26px 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.welcome-number { color: var(--primary); font-family: var(--mono); font-size: 12px; }
.welcome-feature h2 { margin: 14px 0 10px; font-size: 21px; }
.welcome-feature p { margin: 0; color: var(--muted); }
@media (max-width: 767px) {
  .welcome { padding: 20px 0; }
  .welcome-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 12px 0 28px; }
  .welcome h1 { font-size: 42px; }
  .welcome-intro { font-size: 17px; }
  .welcome-art { max-width: 500px; margin: 0 auto; }
  .welcome-features { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .welcome-feature { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { .welcome *, .welcome *::before, .welcome *::after { animation: none !important; transition: none !important; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin: 20px 0; box-shadow: 0 1px 2px #1a1a2e0d; }
h2 { font-size: 24px; font-weight: 600; margin-top: 0; letter-spacing: -.02em; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
.nav-tabs { border-bottom: 1px solid var(--border); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 4px; }
.nav-tabs > li { float: none; }
.nav-tabs > li > a, .nav-pills > li > a { color: var(--muted); font-weight: 500; }
.nav-tabs > li > a { border: 0; border-bottom: 3px solid transparent; background: transparent; }
.nav-tabs > li > a:hover { background: var(--surface-2); }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: var(--navy); border: 0; border-bottom: 3px solid var(--primary); background: transparent; }
.nav-pills > li > a { border-radius: 8px; }
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { background: #dbeafe; color: #1e40af; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border-radius: 8px; padding: 9px 15px; font-weight: 500; white-space: normal; transition: background-color .15s, border-color .15s; }
.btn-default { background: var(--surface); border-color: var(--border-strong); color: var(--navy); }
.btn-default:hover, .btn-default:focus { background: var(--surface-2); border-color: #94a3b8; color: var(--navy); }
.btn.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.btn-primary:hover, .btn.btn-primary:focus { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.btn-danger { background: #b91c1c; border-color: #b91c1c; color: white; }
.btn.btn-danger:hover, .btn.btn-danger:focus { background: #991b1b; border-color: #991b1b; color: white; }
.btn.btn-danger-outline { background: white; border-color: #b91c1c; color: #b91c1c; }
.btn.btn-danger-outline:hover, .btn.btn-danger-outline:focus { background: #fef2f2; border-color: #991b1b; color: #991b1b; }

.form-control { border-color: var(--border-strong); border-radius: 8px; min-height: 40px; box-shadow: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #2563eb14; }
.shiny-input-container:not(.shiny-input-container-inline) { width: 100%; }
textarea.form-control { min-height: 84px; }
label { font-weight: 500; }
details { border-top: 1px solid var(--border); padding: 16px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--navy); }
details[open] > summary { margin-bottom: 16px; }
.analysis-table-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.analysis-table-header h3 { margin: 0; }
.filter-toggle { display: inline-flex; align-items: center; gap: 8px; }
.filter-active-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.filters-active .filter-active-dot { display: inline-block; }
.filter-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 16px; margin: 0 0 20px; }
.filter-panel[hidden] { display: none !important; }
.sort-column { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 4px 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.sort-column:hover { color: var(--primary); }
.sort-column .fa-sort { opacity: .45; }
th[aria-sort="ascending"] .sort-column, th[aria-sort="descending"] .sort-column { color: var(--primary); }
.action-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.help-block, .eyebrow, .muted { color: var(--muted); }
.app-main .muted { overflow-wrap: anywhere; }
.status-badge { display: inline-block; border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 6px; padding: 3px 10px; margin: 0 8px 8px 0; font-size: 12px; font-weight: 500; }
.succeeded, .approved { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.failed, .interrupted, .rejected { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.running, .queued, .submitted { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.metrics { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.metric { background: var(--surface-2); border: 1px solid var(--border); padding: 14px 20px; border-radius: 12px; min-width: 180px; flex: 1; }
.metric > span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 28px; }
.table-scroll { overflow-x: auto; }
#record_list .table, #batch_members .table { min-width: 740px; }
#record_list td:first-child, #batch_members td:nth-child(2) { white-space: nowrap; font-family: var(--mono); }
.table > thead > tr > th { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table > tbody > tr > td { border-color: var(--border); vertical-align: middle; }
.table > tbody > tr.selected { background: #eff6ff; }
.record-open { background: none; border: 0; color: var(--primary); text-decoration: underline; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.warning-card { overflow-wrap: anywhere; border: 1px solid #fcd34d; border-left: 4px solid #b45309; background: #fffbeb; padding: 16px; margin: 12px 0; border-radius: 8px; }
.review-decision { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; }
.alert { border-radius: 10px; }
.empty-state { padding: 30px 12px; color: var(--muted); }
.todo-empty-state { padding: 8px 0 30px; text-align: center; }
.todo-empty-cover { display: block; width: 100%; max-width: 960px; height: clamp(84px, 10vw, 120px); margin: 0 auto 20px; object-fit: cover; }
.todo-empty-state > p { margin: 0; }
pre { background: var(--surface-2); border-color: var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #b57800 !important; outline-offset: 3px; }
.shiny-output-error { color: #991b1b; }
#guide, #batch_guide, pre, code { font-family: var(--mono); }
#guide, #batch_guide { letter-spacing: 1px; }
.busy-indicator { display: none; position: fixed; right: 24px; bottom: 24px; z-index: 1100; max-width: calc(100vw - 48px); margin: 0; box-shadow: 0 4px 16px #1a1a2e26; }
body.is-busy .busy-indicator { display: block; }
body.is-working .btn { pointer-events: none; opacity: .6; }
.entry-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.entry-grid > div { min-width: 0; }
.entry-inputs { border-right: 1px solid var(--border); padding-right: 28px; }
.entry-inputs > h3, .entry-settings > h3 { margin-top: 0; }
.entry-readiness { background: var(--surface-2); border-radius: 10px; padding: 4px 16px 10px; margin-top: 16px; }
.mode-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 10px 14px; margin-bottom: 20px; font-size: 13px; }
.mode-pill { background: var(--primary); color: #fff; border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.panel-files .input-group { border: 2px dashed #b8c4d6; border-radius: 10px; padding: 5px; background: #f8faff; }
.panel-files .input-group .form-control { border: 0; background: transparent; box-shadow: none; font-size: 12px; }
.panel-files .input-group .btn-file { border-radius: 7px !important; }
.panel-files .input-group.shiny-file-input-active { border-color: var(--primary); background: #eff6ff; }
.panel-files .input-group.shiny-file-input-over { border-color: #15803d; background: #ecfdf3; }
.plot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.result-card { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 16px; margin: 0 0 14px; }
.result-card > h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.result-card > h3::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.signal-card > h3::before { background: #15803d; }
.quality-card > h3::before { background: #b45309; }
.modal-content { border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 48px #1a1a2e26; }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-weight: 600; }
@media (max-width: 767px) {
  .app-header { padding: 16px; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .app-header #identity { margin-left: auto; }
  .app-header #identity > div { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
  .brand-titles { font-size: 23px; }
  .brand-titles span { font-size: 11px; }
  .app-main { padding: 16px; }
  .app-footer { margin: 0 16px; }
  .card { padding: 16px; }
  .nav-tabs > li > a { padding: 10px; }
  .metric { min-width: 130px; padding: 12px; }
  .metric strong { font-size: 24px; }
  .entry-grid, .plot-pair { grid-template-columns: minmax(0, 1fr); }
  .entry-inputs { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .entry-grid { gap: 20px; }
  .result-card { padding: 12px 8px; }
}

/* Saved-analysis navigation and workflow presentation. */
.identity-name{font-weight:600}
.selectable-row{cursor:pointer}.table>tbody>tr.selectable-row:hover{background:#f3f6fc}
.table>tbody>tr.selectable-row.selected{background:#eff6ff}
.table>tbody>tr.selectable-row:focus-within{outline:2px solid var(--primary);outline-offset:-2px;background:#eff6ff}

.user-permissions{display:block;font-size:12px;line-height:1.5;color:var(--muted);max-width:520px;overflow-wrap:anywhere}

.analysis-next-action{white-space:nowrap}
.execution-indicator{display:inline-block;position:relative;margin-left:6px;cursor:help}
.execution-error,.execution-error>i,.execution-error>svg{color:#c62828}.execution-pending{color:#225a80}
.execution-indicator:focus-visible{outline:3px solid #b57800;outline-offset:3px}
.execution-tooltip[hidden]{display:none!important}
.execution-tooltip{display:block;position:fixed;z-index:1200;width:220px;white-space:normal;overflow-wrap:anywhere;background:#1a1a2e;color:white;padding:8px;border-radius:4px;font-size:12px;font-weight:400}

.analyses-panel-header{display:flex;align-items:flex-start;justify-content:flex-end;gap:16px;margin-bottom:16px}
@media(max-width:767px){.analyses-panel-header{flex-wrap:wrap}}

.analysis-detail-header{margin-bottom:20px;display:flex;justify-content:space-between;align-items:flex-start;gap:24px;flex-wrap:wrap}
.analysis-detail-header #detail_heading{flex:1;min-width:200px}.analysis-detail-header h2{overflow-wrap:anywhere}
.detail-workflow-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap;min-width:0;max-width:100%;padding:3px;overflow-x:auto;scroll-padding-inline:4px}
.detail-workflow-actions #analyst_actions,.detail-workflow-actions #review_actions,.detail-workflow-actions #signature_link,.detail-workflow-actions #downloads,.detail-workflow-actions #delete_action{display:contents}
.detail-workflow-actions .btn,.detail-workflow-actions .download-menu,.detail-workflow-actions #signature_link a{flex:0 0 auto;white-space:nowrap}
.detail-workflow-actions:focus-visible{outline:3px solid #b57800;outline-offset:3px}
.analysis-status { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.detail-settings { padding: 16px; margin: 20px 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.detail-settings > h3 { margin: 0; font-size: 16px; font-weight: 600; }
.detail-settings fieldset { margin-top: 16px; min-width: 0; }
.detail-settings fieldset:disabled { opacity: .7; }
.detail-settings [hidden] { display: none !important; }
.detail-settings .help-block { margin-bottom: 0; }
@media(max-width:767px){.analysis-detail-header{gap:12px}.detail-workflow-actions{max-width:100%;width:100%;justify-content:flex-start}.detail-workflow-actions #signature_link{text-align:left}}

/* Identity and administration navigation. */
.account-menu-identity { padding: 11px 12px; overflow-wrap: anywhere; }
.identity-access-label { margin-top: 10px; font-size: 12px; font-weight: 600; }
.account-menu-identity .user-permissions { white-space: normal; }
.administration-toolbar, .administration-navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.administration-toolbar { justify-content: space-between; gap: 16px; }
.administration-navigation [aria-current="page"] { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }

.account-menu { position: relative; }
.account-menu-toggle { display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; border: 0; background: transparent; color: var(--navy); font: inherit; padding: 4px 0; }
.account-menu-toggle:hover { color: var(--primary); }
.account-menu-toggle > i, .account-menu-toggle > svg { font-size: 11px; }
.account-menu-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 1200; width: 250px; max-width: calc(100vw - 32px); padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px #1a1a2e1a; }
.account-menu-panel[hidden] { display: none !important; }
.account-menu-item, .btn.account-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--navy); font: inherit; text-align: left; }
.account-menu-item:hover, .account-menu-item:focus { background: var(--surface-2); color: var(--primary); }
.account-menu-item > i, .account-menu-item > svg { width: 18px; color: var(--muted); }
@media (max-width: 767px) { #administration_menu { left: 0; right: auto; } }
.account-menu-panel hr { margin: 5px 4px; border-color: var(--border); }
[id^="admin_"][id$="_heading"] { margin-top: 24px; }

.result-card .shiny-plot-output img { max-width: 100%; height: auto; }

/* Analysis header, provenance and downloads share the same action treatment. */
.analysis-detail-header .detail-title { min-width: 0; flex: 1 1 460px; }
.analysis-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.analysis-title-line h2, .analysis-title-line .status-badge { margin: 0; }
.detail-meta { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 12px; }
.detail-meta > span { min-width: 0; overflow-wrap: anywhere; }
.detail-workflow-actions .btn, .batch-workflow-actions .btn, .detail-settings .btn { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; }
.download-menu { position: relative; }
.download-menu-panel { position: fixed; text-align: left; max-height: calc(100vh - 16px); overflow-y: auto; }
.account-menu-item.is-disabled { color: var(--muted); opacity: .65; cursor: not-allowed; }
/* Saved evidence stays readable in a compact review sheet. */
.provenance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.provenance-card { border: 1px solid var(--border); border-radius: 10px; padding: 20px; min-width: 0; }
.provenance-card h3, .results-warnings h3 { margin: 0 0 16px; font-size: 16px; }
.provenance-card p, .provenance-card .help-block { margin-bottom: 0; }
.provenance-facts { display: grid; grid-template-columns: minmax(130px, 45%) minmax(0, 1fr); gap: 12px 20px; margin: 0; }
.provenance-facts dt { font-weight: 500; color: var(--muted); }
.provenance-facts dd { margin: 0; overflow-wrap: anywhere; }
.provenance-card code { color: var(--navy); background: #e8edf7; overflow-wrap: anywhere; white-space: normal; }
.provenance-guide { grid-template-columns: minmax(90px, 30%) minmax(0, 1fr); margin-bottom: 20px; }
.signature-list, .input-files { padding: 0; margin: 0; list-style: none; }
.signature-list li { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.signature-list li + li { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.input-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.input-file:last-child { padding-bottom: 0; }
.input-file-kind { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.input-file-name { display: block; overflow-wrap: anywhere; }
.input-file-size { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 2px; }
.provenance-application { grid-column: auto; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; background: var(--surface-2); }
.provenance-application h3, .provenance-application p { margin: 0; overflow-wrap: anywhere; }
.results-warnings { margin: 0; }
.warning-details { margin: 20px 0; }
.warning-status { display: flex; align-items: center; gap: 8px; }
.warning-status-icon { display: inline-flex; flex: 0 0 auto; font-size: 20px; }
.warning-status-warning { color: #92400e; }
.results-warnings .warning-card { margin-bottom: 12px; }
.results-warnings .warning-card:last-child { margin-bottom: 0; }
@media(max-width:767px) {
  .analysis-detail-header .detail-title { flex-basis: 100%; }
  .detail-workflow-actions { width: 100%; justify-content: flex-start; }
  .provenance-grid { grid-template-columns: minmax(0, 1fr); }
  .provenance-card { padding: 16px; }
  .provenance-facts { grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 12px; }
  .provenance-guide { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .provenance-guide dd + dt { margin-top: 8px; }
  .download-menu-panel { right: 0; max-width: calc(100vw - 64px); }
}

.identifier-editor { margin: 12px 0; max-width: 560px; }
.identifier-editor .action-bar { margin: 8px 0; }

.result-cut-site { margin: -8px 0 20px; color: var(--muted); font-size: 13px; }
.provenance-results-title { border-top: 1px solid var(--border); padding-top: 16px; margin: 20px 0 12px; font-size: 14px; }

.saved-inputs { max-width: 960px; margin-top: 20px; }

.editable-value { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.analysis-label > span { min-width: 0; overflow-wrap: anywhere; }
.saved-inputs .identifier-editor { margin: 0; min-width: 0; }
.editable-value code { min-width: 0; overflow-wrap: anywhere; }
.inline-edit.btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); box-shadow: none; }
.inline-edit.btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--primary); }
.inline-edit.btn:focus-visible { outline: 3px solid #b57800; outline-offset: 2px; }
.guide-editor { min-width: 0; max-width: 560px; }
.guide-editor .action-bar { margin: 8px 0; }
.guide-editor input { font-family: monospace; }

.analysis-browse-bar { margin: 18px 0; }
.analysis-title-line #analysis_navigation { min-width: 0; max-width: 100%; }
.analysis-navigation { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.analysis-navigation .analysis-id { min-width: 0; }
.analysis-navigation .btn { flex: 0 0 40px; display: inline-flex; justify-content: center; align-items: center; min-width: 40px; min-height: 40px; }
.analysis-id:focus-visible { outline: 3px solid #b57800; outline-offset: 3px; }

.result-checks { list-style: none; padding: 0; margin: 8px 0 0; }
.result-checks li { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 13px; }
.check-icon { flex: 0 0 auto; }
.check-pass { color: #166534; }
.check-warning { color: #92400e; }
.check-unavailable { color: var(--muted); font-size: 12px; }
.check-label { min-width: 0; overflow-wrap: anywhere; }
@media(max-width:767px) {
  .metrics .checks-card { flex-basis: 100%; }
}

.analysis-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.analysis-results-toolbar h3 { margin: 0; color: var(--primary); font-size: 16px; }
.analysis-details-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.analysis-details.has-details .analysis-details-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.analysis-results { min-width: 0; }
.analysis-details-sidebar { min-width: 0; padding-left: 16px; border-left: 1px solid var(--border); background: white; }
.analysis-details-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.analysis-details-heading h3 { margin: 0; font-size: 16px; }
.analysis-details-sidebar > details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 0 12px 12px; }
.analysis-details-sidebar > details:not([open]) { padding-bottom: 0; }
.analysis-details-sidebar summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 600; list-style: none; }
.analysis-details-sidebar summary::-webkit-details-marker { display: none; }
.analysis-details-sidebar summary::before { content: ""; flex: 0 0 10px; width: 10px; height: 10px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1l4 4-4 4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E"); }
.analysis-details-sidebar details[open] > summary::before { transform: rotate(90deg); }
.analysis-details-sidebar summary:focus-visible { outline: 3px solid #b57800; outline-offset: 2px; }
.analysis-details-sidebar .saved-inputs { max-width: none; margin-top: 0; }
.analysis-details-sidebar .provenance-grid { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.analysis-details-sidebar .provenance-card { padding: 12px; }
.analysis-details-sidebar .provenance-facts { grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 10px; }
.analysis-details-sidebar .provenance-guide { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.analysis-details-sidebar .provenance-guide dd + dt { margin-top: 8px; }
.analysis-details-sidebar .detail-settings { margin-bottom: 0; padding: 12px; }
.analysis-details-sidebar .row > [class*="col-"] { width: 100%; float: none; }
.analysis-details-sidebar[hidden], .analysis-details-backdrop[hidden] { display: none !important; }
#close_analysis_details, #close_batch_details { display: none; }
#toggle_analysis_details.has-pending, #toggle_batch_details.has-pending { border-color: #b45309; color: #92400e; }
body.analysis-drawer-open, body.batch-drawer-open { overflow: hidden; }
@media(max-width:1199px) {
  .analysis-details.has-details .analysis-details-layout { grid-template-columns: minmax(0, 1fr); }
  .analysis-details-sidebar { position: fixed; z-index: 1101; top: 0; right: 0; width: min(420px, calc(100vw - 32px)); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 16px; box-shadow: -8px 0 32px #0f172a33; }
  .analysis-details-backdrop { position: fixed; inset: 0; z-index: 1100; background: #0f172a66; }
  .analysis-details-heading { position: sticky; top: 0; z-index: 1; background: white; }
  #close_analysis_details, #close_batch_details { display: inline-block; }
}

/* Batch summaries live on their own screen; the analysis table stays flat. */
.batch-link { text-align: left; }
#batch_heading { overflow-wrap: anywhere; }
.batch-metadata { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1.5rem; }
.batch-metadata dd { margin: 0; overflow-wrap: anywhere; }
.batch-table-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#batch_details .batch-metadata { grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 10px; }
#batch_members .table { min-width: 540px; }
@media (max-width: 600px) {
  .batch-metadata { grid-template-columns: 1fr; gap: .2rem; }
  .batch-metadata dd { margin-bottom: .6rem; }
}

#batch_heading .inline-edit { margin-left: .5rem; vertical-align: middle; }
.batch-label-editor { max-width: 40rem; margin-bottom: 1rem; }

.batch-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
#batch_label_heading { flex: 1; min-width: 0; }
.batch-workflow-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.batch-workflow-actions .shiny-html-output { display: contents; }
@media (max-width: 600px) {
  .batch-detail-header { flex-direction: column; }
  #batch_label_heading { width: 100%; }
}

.detail-batch { min-width: 0; max-width: 100%; }
.detail-batch .record-open { max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: left; }

.overview-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border-strong); margin-bottom: 1rem; }
.overview-tab { font: inherit; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; padding: .65rem 1.1rem; }
.overview-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.overview-tab:hover { color: var(--primary); }
#batches_list .table { min-width: 900px; }
#batches_list td:first-child { font-family: var(--mono); white-space: nowrap; }
.batches-refresh { margin-bottom: 1rem; }
.action-tooltip-trigger { display: inline-block; }
.action-tooltip-trigger > .btn:disabled { pointer-events: none; }

/* Shared detail headers and accordion contents. */
.batch-status-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.analysis-title-line > .shiny-html-output { display: contents; }
.analysis-details-sidebar > details { padding: 0; }
.analysis-details-sidebar > details > summary { padding: 12px; }
.details-section-content { padding: 0 12px 12px; }
.details-section-content .provenance-card,
.details-section-content .detail-settings { border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0; box-shadow: none; }
.details-section-content .provenance-grid { gap: 20px; }
.details-section-content h3 { font-size: 14px; margin: 0 0 12px; }
.details-section-content .saved-inputs > h3 { display: none; }
.details-section-content dl { margin-top: 0; margin-bottom: 0; }
.details-section-content dt { font-weight: 500; color: var(--muted); }
.details-section-content dd { margin: 0; overflow-wrap: anywhere; }

.batch-label-details { margin-bottom: 16px; overflow-wrap: anywhere; }
.details-field-label { color: var(--muted); font-weight: 500; margin-bottom: 6px; }

#todo_list_view .table { min-width: 900px; }
.refresh-error { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; color: var(--muted); }

/* Shared interaction states override variant and layout-specific treatments. */
.btn:focus-visible, .action-tooltip-trigger:focus-visible { outline: 3px solid #b57800; outline-offset: 3px; }
.btn.btn:disabled, .btn.btn[disabled], .btn.btn.disabled, .btn.btn[aria-disabled="true"] { background: #f1f5f9; border-color: #cbd5e1; color: #64748b; opacity: 1; cursor: not-allowed; box-shadow: none; }
.inline-edit.btn { min-width: 40px; min-height: 40px; }
@media (max-width: 767px) {
  .btn, .inline-edit.btn, .account-menu-item { min-height: 44px; }
  .analysis-navigation .btn, .inline-edit.btn { min-width: 44px; }
}

.approval-meaning { color: var(--muted); font-size: 13px; margin: -8px 0 16px; text-align: right; }
@media (max-width: 767px) { .approval-meaning { text-align: left; } }

/* User directory and focused access editor. */
#users_table .table { min-width: 620px; }
#users_table th:first-child { width: 24%; }
#users_table td:last-child { white-space: nowrap; }
.users-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 20px 0; }
.users-toolbar > .shiny-input-container { flex: 1; max-width: 520px; margin-bottom: 0; }
.users-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actor-editor .shiny-input-container { width: 100%; }
.actor-editor .shiny-options-group { display: grid; gap: 8px; }
.actor-editor .checkbox { margin: 0; }
.actor-editor > .shiny-input-container:has(#actor_active) { margin-top: 20px; }
.actor-identity-details { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px; }
.actor-identity-details summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 500; list-style: none; }
.actor-identity-details summary::-webkit-details-marker { display: none; }
.actor-identity-details summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.actor-identity-details[open] > summary::after { transform: rotate(225deg); }
.actor-identity-details dl { margin: 16px 0 0; }
.actor-identity-details dt { color: var(--muted); font-size: 12px; }
.actor-identity-details dd { margin: 0 0 12px; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .users-toolbar { flex-wrap: wrap; }
  .users-toolbar > .shiny-input-container { flex-basis: 100%; max-width: none; }
  .users-toolbar-actions { width: 100%; justify-content: flex-end; }
  #shiny-modal[data-actor-editor] .modal-dialog { margin: 12px; }
  #shiny-modal[data-actor-editor] .modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
}

/* Installation audit browsing. */
.audit-toolbar { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.audit-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.audit-filters { display: grid; grid-template-columns: minmax(160px, 1fr) 170px 170px minmax(220px, 2fr) auto; align-items: end; gap: 12px; margin-bottom: 24px; }
.audit-filters .shiny-input-container { width: 100%; margin-bottom: 0; }
.audit-events-table { min-width: 760px; }
.audit-event-id { font-family: var(--mono); white-space: nowrap; }
.audit-event-details dd { margin-bottom: 12px; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .audit-filters { grid-template-columns: minmax(0, 1fr); } .audit-toolbar-actions { flex-wrap: wrap; } }

/* License status and reviewed activation. */
.license-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 20px; }
.license-status { margin-bottom: 20px; }
.license-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 20px 0 28px; }
.license-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.license-facts dd { margin: 0; overflow-wrap: anywhere; }
.license-features { max-width: 640px; margin-bottom: 24px; }
.license-feature { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.license-feature .disabled { color: var(--muted); background: var(--surface-2); }
.license-technical { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.license-technical summary { display: list-item; cursor: pointer; }
.license-technical dl { margin: 16px 0 0; }
.license-technical dd { margin: 4px 0 16px; overflow-wrap: anywhere; }
.license-feature-change { background: var(--surface-2); }
.license-comparison th, .license-comparison td { overflow-wrap: anywhere; }
#shiny-modal[data-license-editor] .modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
#shiny-modal[data-license-editor] .shiny-input-container { width: 100%; }
@media (max-width: 767px) { .license-facts { grid-template-columns: minmax(0, 1fr); gap: 14px; } #shiny-modal[data-license-editor] .modal-dialog { margin: 12px; } }

/* Batch creation shares the single-analysis entry layout. */
.batch-entry .entry-readiness { margin-top: 0; }
.batch-template { max-width: 100%; white-space: normal; }
.batch-preview { margin-top: 24px; }
.batch-preview-scroll { max-height: 420px; overflow: auto; }
.batch-preview-scroll table { min-width: 660px; margin-bottom: 0; }
.batch-preview-scroll th { position: sticky; top: 0; z-index: 1; }
.batch-preview-scroll td { overflow-wrap: anywhere; }
.batch-preview-guide { font-family: var(--mono); white-space: nowrap; }
.batch-ready-summary { color: #166534; }
@media (max-width: 767px) { .batch-preview-scroll { max-height: min(420px, 50vh); } }
