:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #132533;
  background: #f0f4f7;
  font-synthesis: none;
  --muted: #4d6373;
  --border: #ccd9e2;
  --blue: #0c526e;
  --blue-dark: #093c51;
  --blue-light: #e5f1f7;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid #1983ac;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { max-width: 1480px; padding: 35px 36px 44px; margin: auto; }
.masthead { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; }
.section-mark { color: var(--blue); font-size: .79rem; font-weight: 750; letter-spacing: .07em; }
.section-mark span { color: var(--muted); font-weight: 600; margin-left: 4px; }
h1 { font-size: clamp(1.9rem, 3vw, 2.7rem); font-weight: 700; line-height: 1.07; letter-spacing: -.045em; margin: 5px 0 0; }
h2 { font-size: 1.14rem; font-weight: 700; margin: 0; letter-spacing: -.015em; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .83rem; white-space: nowrap; margin-bottom: 5px; }
.connection::before { content: ""; border-radius: 50%; height: 8px; width: 8px; background: #728591; }
.connection.online::before { background: #23825f; }
.connection.offline::before { background: #ae4035; }
.workspace { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.controls { display: grid; gap: 16px; }
.panel { min-width: 0; padding: 21px; background: #fff; border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 2px 5px #1630430a; }
.muted, .help { margin: 6px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.help { font-size: .81rem; }
.file-fields { display: grid; gap: 6px; margin: 18px 0; }
.file-fields label { display: flex; gap: 7px; align-items: baseline; font-size: .88rem; }
.file-fields label span { color: var(--muted); font-size: .8rem; }
.file-fields input { width: 100%; color: var(--muted); font-size: .81rem; border: 1px solid var(--border); border-radius: 6px; padding: 5px; }
.file-fields input + label { margin-top: 7px; }
.file-fields input::file-selector-button { color: var(--blue-dark); background: var(--blue-light); border: 0; border-radius: 4px; padding: 5px 7px; margin-right: 8px; cursor: pointer; }
.button { padding: 9px 13px; border-radius: 6px; font-size: .88rem; font-weight: 650; border: 1px solid transparent; }
.primary { background: var(--blue); color: white; }
.primary:not(:disabled):hover { background: var(--blue-dark); }
.secondary { color: var(--blue-dark); background: var(--blue-light); border-color: #bdd5e1; }
.secondary:not(:disabled):hover { background: #d4eaf4; }
.button:disabled { background: #edf1f4; border-color: #d8e1e7; color: #607381; }
#run { margin-top: 14px; width: 100%; }
.case-summary { margin-top: 13px; border-top: 1px solid #e1e8ed; padding-top: 11px; display: grid; gap: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: .81rem; }
.case-summary strong { color: #233b4b; font-weight: 650; }
.progress-block { margin-top: 16px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
.progress-label span { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 12px; accent-color: #137e9e; }
.notice { margin: 0; padding: 11px 13px; border-radius: 6px; font-size: .85rem; overflow-wrap: anywhere; color: #762d28; background: #fae7e5; border: 1px solid #eac0bd; }
.results { min-height: 500px; }
.results-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.results-head > div { min-width: 0; }
#results-path { overflow-wrap: anywhere; }
.run-picker { display: grid; gap: 3px; }
.run-picker label { color: var(--muted); font-size: .78rem; }
.run-picker select { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #f8fbfd; color: #233b4b; padding: 6px 8px; font-size: .84rem; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 14px; border-bottom: 1px solid var(--border); }
.tabs button { color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-size: .86rem; font-weight: 650; padding: 9px 12px; }
.tabs button[aria-pressed="true"] { color: var(--blue-dark); border-bottom-color: #0f7296; }
.tabs button:hover { color: var(--blue-dark); background: #f0f7fa; }
.result-content { padding-top: 16px; font-size: .88rem; }
.empty { color: var(--muted); margin: 0; }
.screening-intro { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 7px; margin-bottom: 13px; }
.screening-intro .muted { margin: 0; }
.verdict { font-size: .77rem; font-weight: 700; display: inline-block; border-radius: 4px; padding: 4px 6px; color: #435763; background: #edf1f4; }
.verdict.pass { color: #175a41; background: #dcf2e6; }
.verdict.fail { color: #862e29; background: #f9e6e4; }
.verdict.review { color: #6c4b09; background: #fff0cb; }
.table-wrap { overflow: auto; max-height: 65vh; border: 1px solid #dbe5eb; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .82rem; line-height: 1.4; }
th, td { padding: 9px 10px; vertical-align: top; }
th { position: sticky; top: 0; background: #e9f0f5; color: #263e4f; }
td { border-top: 1px solid #e2eaf0; }
td:first-child { min-width: 136px; }
td:nth-child(2) { min-width: 105px; }
.asset-grid { display: grid; grid-template-columns: minmax(135px, .32fr) minmax(0, 1fr); gap: 12px; }
.asset-list { display: grid; gap: 3px; align-content: start; max-height: 60vh; overflow: auto; padding: 3px; }
.asset-list button { width: 100%; text-align: left; color: #294455; background: #f6f9fb; border: 1px solid transparent; border-radius: 5px; padding: 6px 7px; overflow-wrap: anywhere; font-size: .82rem; }
.asset-list button:hover, .asset-list button[aria-pressed="true"] { background: #e3f0f6; border-color: #b8d6e5; color: var(--blue-dark); }
.asset-list small { display: block; font-size: .70rem; color: var(--muted); }
.preview { min-width: 0; }
.preview-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 8px; }
.preview-head strong { padding-top: 5px; overflow-wrap: anywhere; }
.preview-head button { padding: 5px 8px; }
.preview img { display: block; max-width: 100%; max-height: 64vh; object-fit: contain; border: 1px solid #dbe5eb; }
.preview iframe { width: 100%; height: 62vh; min-height: 270px; border: 1px solid #dbe5eb; border-radius: 5px; }
.preview pre { background: #f3f7fa; border: 1px solid #dbe5eb; border-radius: 5px; padding: 10px; max-height: 62vh; overflow: auto; margin: 0; font: .78rem/1.45 Consolas, monospace; }
@media (max-width: 850px) {
  .shell { padding: 24px 20px; }
  .workspace { grid-template-columns: minmax(230px, 265px) minmax(0, 1fr); gap: 12px; }
  .panel { padding: 15px; }
  .asset-grid { grid-template-columns: 1fr; }
  .asset-list { max-height: 170px; }
}
@media (max-width: 660px) {
  .workspace { grid-template-columns: 1fr; }
  .shell { padding: 19px 13px; }
  .results-head { flex-wrap: wrap; }
  .masthead { align-items: start; }
}

.tuning { display: grid; gap: 16px; }
.tuning h3, .tuning h4 { margin: 0; font-size: 1rem; }
.tuning h4 { font-size: .9rem; }
.tuning-picker, .tuning-form { display: grid; gap: 8px; }
.tuning-picker label, .tuning-form > label { font-size: .82rem; font-weight: 650; }
.tuning input, .tuning select, .tuning textarea { padding: 7px 8px; color: #233b4b; background: #fff; border: 1px solid var(--border); border-radius: 5px; font: inherit; min-width: 0; }
.tuning-picker select { max-width: 100%; }
.tuning-detail, .tuning-revision, .tuning-comparison { border: 1px solid var(--border); border-radius: 7px; padding: 13px; background: #f8fbfd; }
.tuning-detail { display: grid; gap: 10px; }
.tuning-detail > button, .tuning-form > button { justify-self: start; }
.tuning-evidence { border-top: 1px solid #dbe5eb; padding-top: 8px; }
.tuning-evidence summary { color: var(--blue-dark); font-weight: 650; cursor: pointer; }
.tuning-evidence ul, .tuning-checks { padding-left: 19px; margin: 5px 0; }
.tuning-evidence li, .tuning-checks li { margin-bottom: 6px; line-height: 1.4; }
.tuning-evidence code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .77rem; }
.tuning-evidence li strong { font-size: .77rem; color: var(--muted); }
.tuning-editor:empty { display: none; }
.tuning-editor { border-top: 1px solid #dbe5eb; padding-top: 12px; }
.tuning-tools, .tuning-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.tuning-fields { max-height: 420px; background: #fff; }
.tuning-fields td small { display: block; color: var(--muted); }
.tuning-fields input { width: 105px; }
.tuning-form textarea { resize: vertical; }
.tuning-message { margin: 0; color: var(--blue-dark); }
.tuning-revisions { display: grid; gap: 8px; }
.tuning-comparison { margin: 12px 0 0; }
.tuning-comparison button { margin-top: 8px; }
@media (max-width: 850px) {
  .tuning-fields td:first-child { min-width: 112px; }
  .tuning-fields td:nth-child(2) { min-width: 95px; }
  .tuning-fields input { width: 80px; }
}
.tuning-tools input[type="search"] { width: min(100%, 265px); }

.automatic-progress { border-top: 1px solid var(--border); padding-top: 11px; }
.automatic-progress .tuning-actions { margin-top: 8px; }
.tuning-editor > .button, .tuning-revision .tuning-actions { margin-top: 9px; }
.tuning-editor > .tuning-evidence { margin-top: 8px; }

.masthead-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 8px 12px; }
.masthead-actions .connection { margin-bottom: 0; }
.share-link-fallback { display: grid; max-width: 640px; gap: 6px; padding: 12px; margin: -8px 0 14px auto; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.share-link-fallback label { color: var(--muted); font-size: .82rem; }
.share-link-fallback input { width: 100%; padding: 6px; }

.parameter-guide { margin-top: 5px; min-width: 0; }
.parameter-guide summary { cursor: pointer; color: var(--blue-dark); font-size: .79rem; font-weight: 650; }
.parameter-guide p { margin-top: 5px; }
.parameter-guide .parameter-range { font-weight: 650; color: #233b4b; overflow-wrap: anywhere; }

.access-panel { max-width: 42rem; margin: 1rem 0; }
.access-panel input, .access-panel select { width: 100%; }
.access-panel li { margin-bottom: .5rem; overflow-wrap: anywhere; }
.account-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.account-bar button { margin-left: auto; }
