/* Workspace presentation. Diagnostic colours and report geometry remain shared. */
:root {
  --bg: #f2f2f7; --surface: #fff; --soft: #f5f5f9; --soft-2: #ededf2;
  --text: #1c1c1e; --muted: #52525b; --muted-2: #63636c; --border: #dedee5;
  --brand: #0066cc; --brand-dark: #004f9e; --btn: #0066cc; --btn-border: #0066cc; --btn-text: #fff;
  --radius: 20px; --shadow: 0 2px 12px rgb(20 25 45 / 3%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
body { font: 15px/1.5 var(--font); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #0066cc; outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #0066cc; outline-offset: 2px; }
.app-icon svg, .nav-item svg, .privacy-label svg, .setup-note svg, .workflow-note svg, .empty-state svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.app-shell { min-height: 100vh; }
.app-sidebar { width: 224px; position: fixed; inset: 0 auto 0 0; background: #ebebf2; border-right: 1px solid #dddde5; padding: 32px 16px 24px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { padding: 0 12px; display: block; }
.sidebar-brand .brand-logo { width: 152px; height: auto; }
.sidebar-product { display: flex; align-items: center; gap: 11px; padding: 32px 10px 28px; }
.sidebar-product strong { font-size: 15px; letter-spacing: -.25px; display: block; }
.sidebar-product span { display: block; font-size: 13px; color: var(--muted-2); margin-top: 2px; }
.app-icon { width: 42px; height: 42px; border-radius: 6px; background: #ee8a23; color: white; display: grid; place-items: center; flex-shrink: 0; box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%); }
.app-icon svg { width: 29px; height: 29px; stroke-width: 1.8; }
.app-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { appearance: none; display: flex; align-items: center; gap: 12px; min-height: 46px; border: 0; border-radius: 6px; background: transparent; color: #4d4d57; font: 500 15px var(--font); text-align: left; padding: 10px 14px; cursor: pointer; position: relative; }
.nav-item:hover { background: #e2e2eb; }
.nav-item.is-active { background: #fff; color: var(--brand); box-shadow: 0 2px 5px rgb(35 35 55 / 5%); font-weight: 650; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: auto; }
.sidebar-bottom { margin-top: auto; padding: 30px 12px 0; color: var(--muted-2); font-size: 13px; }
.privacy-label { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--muted); }
.privacy-label svg { width: 15px; height: 15px; }
.sidebar-bottom p { margin: 6px 0 22px; }
.sidebar-bottom a { display: flex; justify-content: space-between; text-decoration: none; font-size: 13px; color: var(--muted); }
.app-content { margin-left: 224px; }
.workspace-bar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 36px; border-bottom: 1px solid #dedee6; color: var(--muted-2); font-size: 13px; background: rgb(249 249 252 / 90%); }
.workspace-bar strong { color: #41414a; font-weight: 500; }
.workspace-bar > span:first-child > span { margin: 0 12px; color: #a0a0aa; }
.local-status { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.local-status > span { width: 6px; height: 6px; border-radius: 50%; background: #248648; }
#workspace { max-width: 1420px; padding: 36px 36px 20px; margin: auto; }
.workspace-title { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
h1 { font-size: 24px; letter-spacing: -1.1px; font-weight: 700; margin: 0 0 9px; }
.workspace-title p { margin: 0; color: var(--muted-2); font-size: 15px; }
.unit-pill { padding: 7px 11px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-layout { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.6fr); gap: 22px; align-items: start; }
.card { margin: 0; padding: 25px; border: 1px solid #e5e5ec; border-radius: 6px; box-shadow: var(--shadow); min-width: 0; }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.section-step { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: #edf4ff; color: var(--brand); font-size: 13px; font-weight: 650; flex-shrink: 0; }
h2 { font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.45px; }
.section-heading h2 { margin: 0; }
.section-description { font-size: 13px; color: var(--muted-2); margin: 0 0 23px; line-height: 1.6; }
.count-pill { font-size: 13px; padding: 3px 7px; background: var(--soft); border-radius: 6px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }
.calc-setup .setup-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.field { gap: 7px; font-size: 13px; font-weight: 600; min-width: 0; }
.field select, .field input, .param input, .paste textarea { font-family: var(--font); font-size: 15px; font-weight: 400; min-height: 44px; border: 1px solid #dcdce3; border-radius: 6px; background: #fafafd; color: var(--text); width: 100%; padding: 10px 11px; }
.field select { padding-right: 28px; text-overflow: ellipsis; }
.field small { font-size: 13px; line-height: 1.5; }
.field.is-disabled { opacity: 1; }
.field select:disabled { background: #f0f0f4; color: #666670; cursor: not-allowed; }
.setup-note { border-top: 1px solid #ececf2; display: flex; gap: 9px; margin-top: 26px; padding-top: 18px; color: var(--muted-2); }
.setup-note svg { width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }
.setup-note p { margin: 0; font-size: 13px; line-height: 1.65; }
.example-picker { background: #f5f7fc; border: 1px solid #e8ebf3; border-radius: 6px; padding: 0 13px; margin-bottom: 21px; }
summary { cursor: pointer; }
.example-picker summary { font-size: 13px; color: var(--brand); padding: 12px 0; font-weight: 600; }
.example-picker summary .muted { font-size: 13px; font-weight: 400; margin-left: 8px; }
.example-picker .field { padding: 2px 0 14px; }
.sample-card { min-width: 0; }
.sample-card + .sample-card { border-top: 1px solid var(--border); padding-top: 23px; margin-top: 24px; }
.sample-header { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; flex-wrap: wrap; }
.sample-header h3 { font-size: 13px; margin: 0 auto 0 0; font-weight: 650; letter-spacing: -.15px; }
.date-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-2); }
.date-field input { font: 13px var(--font); border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px; min-height: 36px; width: 138px; background: white; color: var(--text); }
.sample-header .rm { padding: 4px 8px; min-height: 36px; font-size: 13px; color: #b42318; }
.gas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 13px; }
.gas-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gas-label { display: flex; align-items: baseline; gap: 7px; font-weight: 600; font-size: 15px; }
.gas-label small { font-size: 13px; font-weight: 400; color: var(--muted-2); }
.gas-field input { font: 15px var(--font); font-variant-numeric: tabular-nums; width: 100%; min-width: 0; height: 46px; padding: 10px 12px; border: 1px solid #dcdce3; border-radius: 6px; background: #fafafd; color: var(--text); }
input::placeholder, textarea::placeholder { color: #7a7a85; opacity: 1; font-size: 13px; }
.gas-supporting { display: block; font-size: 13px; color: var(--muted-2); border-top: 1px solid #ececf2; margin: 19px 0 12px; padding-top: 14px; }
.gas-actions { margin-top: 22px; align-items: center; gap: 12px; }
.btn { border: 1px solid #dcdce5; border-radius: 6px; min-height: 44px; padding: 10px 15px; font: 600 13px var(--font); color: var(--brand); background: #fff; transition: background .15s; }
.btn:hover { background: #f1f5fd; }
.btn-primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: #0059b3; }
.btn-primary:disabled { background: #b6cbea; border-color: #b6cbea; color: #314865; opacity: 1; }
.btn-secondary { background: #edf4ff; border-color: transparent; }
.btn-quiet { border-color: transparent; color: var(--muted-2); }
.paste { flex: 1 1 170px; font-size: 13px; }
.paste summary { color: var(--brand); padding: 12px 0; font-weight: 500; }
.paste[open] { flex-basis: 100%; }
.paste textarea { font-family: var(--mono); font-size: 13px; }
.calc-actions { border-top: 1px solid #ececf2; margin-top: 22px; padding-top: 21px; align-items: center; flex-wrap: wrap; gap: 7px; }
#calcBtn { min-width: 170px; font-size: 13px; }
.action-hint { margin-left: auto; font-size: 13px; color: var(--muted-2); }
.disclaimer-notice { font-size: 13px; line-height: 1.65; margin-top: 16px; }
.disclaimer-notice a { text-underline-offset: 3px; }
.workflow-note { display: flex; gap: 10px; margin: 22px 3px 0; max-width: 900px; color: var(--muted-2); }
.workflow-note svg { width: 17px; height: 17px; margin-top: 2px; }
.workflow-note p { font-size: 13px; margin: 0; line-height: 1.7; }
.workflow-note strong { font-weight: 600; color: var(--muted); }
.input-errors { padding: 13px 16px 13px 32px; border-radius: 6px; background: #fff0ee; color: #b42318; margin-top: 16px; font-size: 13px; }
.input-errors li.error { color: #b42318; }
.msg-ok { color: #256d3c; font-size: 13px; }
[aria-invalid="true"] { border-color: #b42318 !important; background: #fff6f5 !important; }
#results { margin-top: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.results-head { margin-bottom: 16px; }
.results-head h2 { margin: 0; }
.result-context, .fluid-context { padding: 12px 15px; border-radius: 6px; background: #f5f5f9; font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.stale-notice { display: flex; justify-content: space-between; align-items: center; gap: 15px; background: #fff5df; border: 1px solid #eed39b; border-radius: 6px; padding: 13px 16px; margin-bottom: 16px; font-size: 13px; color: #755119; }
.empty-state { text-align: center; max-width: 420px; margin: 40px auto 50px; }
.empty-state svg { width: 48px; height: 48px; color: #92929d; margin-bottom: 17px; }
.empty-state h3 { font-size: 18px; letter-spacing: -.5px; }
.empty-state p { font-size: 13px; color: var(--muted-2); margin: 12px 0 23px; }
.calc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sum-card { border-radius: 6px; background: #fff; padding: 22px; min-width: 0; border: 1px solid var(--border); }
.sum-card:last-child { background: #edf4ff; border-color: #d4e4fb; }
.sum-l { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.sum-v { font-size: 24px; font-weight: 650; letter-spacing: -.65px; }
.sum-d { font-size: 13px; }
.sev-2, .agree-differ, .cond-fair { border-left-color: #b96d00; }
.panel { border-radius: 6px; padding: 18px; margin-top: 14px; }
.panel h3 { font-size: 15px; font-weight: 650; line-height: 1.5; }
.panel table { font-size: 13px; }
.panel th, .panel td { padding: 8px; }
.detail-grid { gap: 14px; margin-top: 18px; }
.detail-grid .panel { margin-top: 0; }
.analysis-details { border: 1px solid var(--border); border-radius: 6px; background: #fff; margin-top: 18px; padding: 0; }
.analysis-details > summary { position: relative; list-style: none; padding: 22px 48px 22px 22px; font-size: 15px; font-weight: 650; color: var(--text); min-height: 64px; }
.analysis-details > summary::-webkit-details-marker { display: none; }
.analysis-details > summary::after { content: ""; position: absolute; right: 24px; top: 27px; width: 8px; height: 8px; border-right: 1.5px solid var(--brand); border-bottom: 1.5px solid var(--brand); transform: rotate(45deg); }
.analysis-details[open] > summary { border-bottom: 1px solid var(--border); margin: 0; }
.analysis-details[open] > summary::after { transform: rotate(225deg); top: 31px; }
.analysis-details > .panel { margin: 18px; background: #f8f8fc; border: 0; border-radius: 6px; }
.analysis-details > .detail-grid { padding: 20px; margin: 0; gap: 20px; }
.analysis-details .detail-grid > .panel { background: #f8f8fc; border: 0; padding: 20px; border-radius: 6px; }
.penta-plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; margin: 20px 0; }
.penta { max-width: none; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.penta figcaption { font-size: 13px; margin-top: 12px; color: var(--text); font-weight: 550; }
.penta svg { stroke: none; fill: none; stroke-width: 0; }
.penta svg text { stroke: none; }
.condition > p { font-size: 13px; }
.condition .setup-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin: 24px 0; gap: 16px; }
.params { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.param { font-size: 13px; gap: 7px; }
.param input { max-width: none; }
.params-extra summary { padding: 15px 0; font-size: 13px; color: var(--brand); }
.cond-result { margin-top: 24px; }
.cond-result table { font-size: 13px; }
.cond-result th, .cond-result td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.method { margin-top: 0; }
.method p, .disclaimer p { font-size: 13px; line-height: 1.8; }
#guideView .card + .card { margin-top: 22px; }
.footer { margin: 15px 36px 0; padding: 18px 0 25px; display: flex; justify-content: space-between; gap: 15px; border-color: #dedee6; font-size: 13px; }
.gate { background: rgb(232 232 240 / 80%); backdrop-filter: blur(12px); }
.gate-box { border-radius: 6px; padding: 30px; box-shadow: 0 25px 80px rgb(25 25 45 / 17%); width: min(590px, 100%); max-height: calc(100dvh - 32px); }
.gate-brand .brand-logo { height: 20px; }
.gate-brand { margin-bottom: 22px; }
.gate-box > .app-icon { margin-bottom: 18px; width: 48px; height: 48px; border-radius: 6px; }
.gate-box h2 { font-size: 24px; letter-spacing: -.8px; }
.gate-text p { font-size: 13px; line-height: 1.65; }
.gate-version { font-size: 13px; }
.gate-check { padding: 13px; border-radius: 6px; background: var(--soft); font-size: 13px; align-items: flex-start; }
.gate-check input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brand); }
#gateBtn { width: 100%; font-size: 15px; min-height: 48px; }
body:has(.gate:not([hidden])) { overflow: hidden; }
dialog { border: 1px solid var(--border); border-radius: 6px; padding: 26px; width: min(420px, calc(100% - 32px)); box-shadow: 0 20px 80px rgb(0 0 0 / 20%); }
dialog::backdrop { background: rgb(20 20 35 / 30%); backdrop-filter: blur(5px); }
dialog h2 { font-size: 18px; }
dialog p { font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.skip-link { position: fixed; top: -100px; left: 240px; z-index: 150; background: white; padding: 12px; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript-notice { position: fixed; inset: 10px 10px auto; z-index: 200; background: white; border: 2px solid #b42318; padding: 20px; border-radius: 6px; }
@media (min-width: 1600px) { #workspace { padding-top: 48px; } .input-layout { grid-template-columns: 320px minmax(0, 1fr); } .card { padding: 30px; } .gas-grid { gap: 18px; } }
@media (max-width: 1150px) and (min-width: 761px) { .app-sidebar { width: 190px; padding-inline: 10px; } .app-content { margin-left: 190px; } #workspace { padding: 28px 22px; } .workspace-bar { padding-inline: 22px; } .input-layout { grid-template-columns: minmax(0, 1fr); } .calc-setup .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .setup-note { display: none; } .footer { margin-inline: 22px; } }
@media (max-width: 760px) {
  .app-sidebar { inset: auto 0 0; width: auto; padding: 7px 8px max(9px, env(safe-area-inset-bottom)); background: rgb(249 249 252 / 96%); backdrop-filter: blur(18px); border: 0; border-top: 1px solid #dddde5; }
  .sidebar-brand, .sidebar-product, .sidebar-bottom { display: none; }
  .app-nav { flex-direction: row; gap: 4px; }
  .nav-item { flex: 1; flex-direction: column; gap: 4px; justify-content: center; min-height: 50px; font-size: 13px; padding: 5px 2px; }
  .nav-item svg { width: 23px; height: 23px; }
  .nav-item.is-active { background: #e9f1ff; box-shadow: none; }
  .nav-dot { position: absolute; top: 4px; left: calc(50% + 12px); width: 5px; height: 5px; }
  .app-content { margin-left: 0; padding-bottom: 85px; }
  .workspace-bar { min-height: 52px; padding: 12px 20px; font-size: 13px; }
  .workspace-bar > span:first-child > span { margin: 0 7px; }
  .local-status { font-size: 0; gap: 0; }
  .local-status > span { width: 7px; height: 7px; }
  #workspace { padding: 25px 16px 12px; }
  .workspace-title { margin-bottom: 23px; align-items: flex-start; gap: 10px; }
  h1 { font-size: 24px; letter-spacing: -.9px; line-height: 1.15; }
  .workspace-title p { font-size: 13px; max-width: 310px; line-height: 1.6; }
  .unit-pill { font-size: 13px; padding: 5px 7px; margin-top: 3px; }
  .input-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .card { padding: 20px; border-radius: 6px; }
  .calc-setup .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 12px; }
  .calc-setup .field:first-child, #equipmentField, #insulationField { grid-column: 1 / -1; }
  .calc-setup .field:last-child { grid-column: 1 / -1; }
  .field select, .field input, .param input { font-size: 15px; }
  .setup-note { display: none; }
  .section-description { margin-bottom: 20px; }
  h2 { font-size: 18px; }
  .gas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 13px; }
  .sample-header { row-gap: 11px; }
  .sample-header h3 { width: 100%; }
  .date-field { flex: 1; }
  .date-field input { flex: 1; min-width: 0; width: auto; font-size: 15px; min-height: 44px; }
  .gas-field input { height: 48px; }
  .gas-label small { font-size: 13px; }
  .calc-actions { gap: 8px; }
  #calcBtn { min-width: 0; flex: 1; min-height: 48px; }
  .action-hint { width: 100%; text-align: center; margin-top: 5px; }
  .gas-actions > .btn { width: 100%; }
  .gas-actions .paste { flex-basis: 100%; }
  .example-picker summary .muted { display: none; }
  .workflow-note { margin: 19px 3px 0; }
  .calc-summary { grid-template-columns: minmax(0, 1fr); }
  .stale-notice { flex-direction: column; align-items: flex-start; }
  .penta { max-width: 100%; flex-basis: 210px; }
  .panel { padding: 14px; }
  .panel th, .panel td { padding: 7px; }
  .footer { margin: 13px 20px 0; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
  .footer > span:nth-child(2) { width: 100%; order: 3; }
  .footer > span:last-child { margin-left: auto; }
  .gate { padding: 12px; }
  .gate-box { padding: 24px; max-height: calc(100dvh - 24px); border-radius: 6px; }
  .gate-check { font-size: 13px; }
  .skip-link { left: 12px; }
}
@media (max-width: 350px) { .card { padding: 16px; } .unit-pill { display: none; } .calc-setup .setup-grid { grid-template-columns: minmax(0, 1fr); } h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print {
  body { background: white; font-size: 10pt; }
  .app-sidebar, .workspace-bar, .workspace-title, .footer, .gate, dialog, #statusMessage, .no-print, .skip-link { display: none !important; }
  .app-content { margin: 0; padding: 0; }
  #workspace { padding: 0; max-width: none; }
  #results[hidden], #conditionView[hidden], #guideView[hidden] { display: block !important; }
  .card { box-shadow: none; padding: 12px; margin: 0 0 14px; border-radius: 0; }
  .condition > .fluid-context { display: block; }
  .method { break-before: page; }
  .calc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel, .sum-card { overflow: visible; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .btn, .empty-state { display: none !important; }
  .analysis-details > summary { color: #111; }
  .analysis-dirty #resultsBody, .analysis-dirty #resultContext { display: none !important; }
  .analysis-dirty #staleNotice { display: block !important; }
  .footer { display: flex !important; margin: 18px 0 0; padding: 10px 0; font-size: 8pt; }
  .footer > span:not(:first-child) { display: none; }
}
