:root { color-scheme: light; font-family: Arial, Helvetica, sans-serif; color: #202629; background: #e9eef1; font-size: 16px; --primary: #49636f; --line: #879399; }
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.badge { display: inline-block; border-radius: 12px; background: #9d321f; color: #fff; padding: 2px 6px; font-size: .7rem; text-decoration: none; }
#general-dialog { overflow: hidden; width: min(760px, calc(100% - 24px)); }
#general-dialog .dialog-header { flex-shrink: 0; }
#general-dialog > [role="tabpanel"] { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
#general-dialog h3 { margin: 10px 0; font-size: 1rem; }
.general-brand { display: flex; align-items: center; gap: 16px; flex-shrink: 0; padding: 10px 0; }
.general-brand-icon { width: 80px; height: 80px; flex-shrink: 0; object-fit: cover; border-radius: 18px; box-shadow: 0 3px 12px #20343c24; }
#general-dialog .general-brand h3 { font-size: 1.2rem; }
.general-brand #general-version { display: block; margin-top: 5px; font-size: .875rem; font-weight: normal; color: #53626a; }
#general-dialog p { margin: 8px 0; }
.info-tabs { display: flex; flex-shrink: 0; overflow-x: auto; gap: 3px; border-bottom: 1px solid #879399; margin-bottom: 8px; }
.info-tabs button { flex: 1 0 auto; border: 0; min-height: 44px; padding: 8px; color: #344e5a; background: #e5edf2; }
.info-tabs [aria-selected="true"] { color: white; background: #49636f; }
.scroll-box { overflow: auto; flex: 1; min-height: 0; border: 1px solid #b8c8d0; border-radius: 5px; padding: 12px; background: #fff; overscroll-behavior: contain; }
#eula-scroll { white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.65 Arial, Helvetica, sans-serif; margin: 0 0 10px; }
#general-dialog #eula-panel { overflow-y: auto; }
#eula-scroll { flex: 1 0 120px; min-height: 120px; }
.action-button { flex-shrink: 0; align-self: flex-start; padding: 10px 16px; min-height: 44px; border: 1px solid #344e5a; border-radius: 6px; background: #49636f; color: #fff; }
#eula-required { border-left: 4px solid #9d321f; padding-left: 10px; }
.support-scroll { overflow: auto; min-height: 0; padding: 0 4px 8px; }
.support-actions { display: flex; flex-wrap: wrap; }
#support-transcript article { padding: 12px; margin-bottom: 8px; border: 1px solid #c4d2db; background: white; border-radius: 6px; overflow-wrap: anywhere; }
#support-transcript p { white-space: pre-wrap; }
#support-message { width: 100%; resize: vertical; font: inherit; padding: 10px; border: 1px solid #879399; border-radius: 5px; }
#privacy-frame { height: 100%; }
@media (max-height: 600px) { #general-panel { overflow-y: auto !important; } #version-content { flex: none; min-height: 110px; max-height: 180px; } }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #096baf; outline-offset: 3px; }
.app-shell { max-width: 680px; height: 100vh; height: 100dvh; margin: auto; display: flex; flex-direction: column; overflow: hidden; background: #fafbfc; box-shadow: 0 0 24px #20343c12; }
.app-header, .section-title, footer { flex-shrink: 0; }
.app-header { padding: max(18px, env(safe-area-inset-top)) 18px 18px; background: #e5eff8 url('./assets/title.png') center / cover; }
h1 { margin: 0; font-size: 1.3rem; color: #344e5a; line-height: 1.4; }
#version-button { margin-left: .2em; padding: 0 4px; min-height: 44px; border: 0; border-radius: 4px; background: transparent; color: inherit; font-size: .75em; font-weight: normal; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #879da9; }
#version-button:hover { background: #dfe7eb; }
#version-dialog { height: auto; max-height: calc(100dvh - 32px); overflow: hidden; }
#version-dialog .dialog-header { flex-shrink: 0; padding-bottom: 8px; border-bottom: 1px solid #c4d2db; }
#version-content { overflow-y: auto; min-height: 0; }
#version-content li { margin-block: 8px; line-height: 1.4; }
.reports-button svg { width: 26px; height: 26px; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.section-title { display: flex; align-items: center; gap: 12px; background: var(--primary); color: #fff; padding: 4px 18px; }
h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.section-title h2 > span[aria-hidden] { margin-right: 8px; }
.info { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; font-size: 1.35rem; color: inherit; text-decoration: none; }
.reports-button { margin-left: auto; flex-shrink: 0; width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; }
.reports-button[data-evidence="higher-order"] { color: #39ff14; }
.reports-button[data-evidence="observed"] { color: #00d4ff; }
.reports-button[hidden] { display: none; }
#reports-dialog { width: min(1100px, calc(100% - 24px)); height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); padding: 12px; overflow: hidden; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 6px; border: 1px solid #c4d2db; border-radius: 8px; background: #e2ebf2; }
.report-toolbar [role="tablist"] { display: flex; gap: 4px; }
.report-toolbar [role="tab"] { min-height: 44px; padding: 8px; border: 0; border-bottom: 3px solid transparent; border-radius: 5px; background: transparent; color: #344e5a; font-weight: 600; }
.report-toolbar [aria-selected="true"] { border-bottom-color: #344e5a; background: #49636f; color: #fff; }
.report-toolbar #close-reports { border: 1px solid #879da9; background: #fff; color: #294554; }
.report-toolbar #close-reports:hover { background: #f0f5f8; }
#reports-status { flex-shrink: 0; margin: 8px 0; }
#reports-notice { flex-shrink: 0; margin: 8px 0 0; padding: 8px 12px; background: #e09d9d; color: #271919; }
#report-panel { display: flex; flex: 1; min-height: 0; }
#report-frame { width: 100%; height: 100%; border: 0; background: white; }
#report-frame[hidden] { display: none; }
.calculator { padding: 16px 10px 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.calculator-controls { flex-shrink: 0; max-height: 65%; overflow-y: auto; padding-top: 8px; }
.results-viewport { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 3px 3px 12px; }
.input-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 2px 4px 22px; }
.altitude-label { position: relative; display: block; width: 144px; }
.altitude-label span { position: absolute; top: -8px; left: 9px; padding: 0 4px; font-size: .875rem; background: #fafbfc; color: #344e5a; }
input { width: 100%; border: 1px solid #6f7d85; border-radius: 5px; padding: 17px 12px 12px; background: transparent; color: #354f58; font-weight: 600; min-height: 54px; }
input[aria-invalid="true"] { border-color: #a32626; }
.range { font-size: .875rem; color: #53626a; margin: 0; }
.error { font-size: .875rem; color: #a32626; margin: -8px 4px 16px; line-height: 1.5; }
.table-frame { padding: 8px; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 5px; line-height: 1.4; }
thead { background: #d37373; color: #271919; }
th { font-weight: 600; text-align: left; }
tbody th { width: 42%; }
thead th:nth-child(2), td:nth-child(2) { text-align: right; white-space: nowrap; }
td:nth-child(3) { white-space: nowrap; }
tbody tr:nth-child(odd) { background: #ededed; }
tbody tr:nth-child(even) { background: #fff; }
.footer-controls { padding: 10px 14px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.eula-acceptance { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; flex-shrink: 0; }
#eula-accepted { color: #285b3e; font-size: .875rem; font-weight: 600; }
.text-button { border: 0; border-radius: 5px; background: transparent; color: #344e5a; font-size: .875rem; font-weight: 600; min-height: 44px; padding: 8px 12px; }
.text-button:hover { background: #dfe7eb; }
.units { display: flex; }
.units button { min-width: 62px; min-height: 44px; background: white; border: 1px solid #76858c; font-size: .875rem; font-weight: 600; color: #293f4a; }
.units button:first-child { border-radius: 8px 0 0 8px; }
.units button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.units button[aria-pressed="true"] { background: #536976; color: white; }
.offline-row { min-height: 32px; padding: 0 16px 8px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; color: #53626a; font-size: .8125rem; }
.bottom-tabs { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-top: 1px solid #dce2e6; padding-bottom: env(safe-area-inset-bottom); }
.bottom-tabs a { white-space: nowrap; scroll-margin-inline: 8px; }
#duct-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 4px 18px; }
#duct-inputs[hidden], #mach2-field[hidden] { display: none; }
.bottom-tabs a { flex: 1 0 auto; min-height: 52px; padding: 16px 12px 12px; text-align: center; font-size: .875rem; text-decoration: none; color: #344e5a; border-bottom: 3px solid transparent; font-weight: 600; }
.bottom-tabs a[aria-current="page"] { border-color: var(--primary); background: #e9eff2; }
.flow-inputs { display: contents; }
.small-field { width: 104px; }
.has-flow .altitude-label { width: 104px; }
.shock-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 4px 4px 22px; }
.flow-message { background: #edf2f4; border-left: 3px solid var(--primary); padding: 14px; font-size: .9375rem; line-height: 1.5; }
.flow-section { margin-bottom: 16px; }
.flow-section h3 { font-size: .9375rem; margin: 0 0 8px 4px; color: #344e5a; }
.flow-table { min-width: 400px; }
.flow-table th:first-child { width: auto; }
.shock-table { min-width: 470px; }
.flow-table td:not(:first-child), .flow-table thead th:not(:first-child) { white-space: nowrap; text-align: right; }
.flow-table td.units-cell, .flow-table thead th.units-cell { text-align: left; }
.isentropic-table { table-layout: fixed; }
.isentropic-table thead th:nth-child(1) { width: 24%; }
.isentropic-table thead th:nth-child(2) { width: 25%; }
.isentropic-table thead th:nth-child(3) { width: 27%; }
.isentropic-table thead th:nth-child(4) { width: 24%; }
dialog { width: min(640px, calc(100% - 24px)); height: min(760px, calc(100dvh - 32px)); padding: 18px; border: 1px solid #879399; border-radius: 14px; background: #fafbfc; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #142b3c80; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; }
dialog p { font-size: .875rem; line-height: 1.5; }
iframe { width: 100%; flex: 1; min-height: 100px; border: 1px solid #dce2e6; background: #fff; }
@media (max-width: 359px) { .calculator { padding-inline: 6px; } .table-frame { padding: 4px; } th, td { padding: 9px 3px; } tbody th { width: 37%; } .input-row { gap: 10px; } }
@media (min-width: 700px) { .calculator { padding: 24px 24px 0; } th, td { padding: 12px 10px; } }
@media (max-height: 600px) {
  .app-header { padding-block: 6px; }
  .section-title { padding-block: 0; }
  .calculator { padding-top: 4px; }
  .input-row, .shock-inputs { margin-bottom: 10px; }
  .footer-controls { padding-block: 0; }
  .offline-row { min-height: 22px; padding-bottom: 2px; }
  .bottom-tabs a { min-height: 44px; padding-block: 12px 8px; }
}

button.info { background: transparent; border: 0; cursor: pointer; }
#help-dialog { height: auto; max-height: calc(100dvh - 32px); overflow: auto; }

/* Compact calculator chrome; keep offline status and retry in General. */
.app-header { padding: env(safe-area-inset-top, 0px) 12px 0; }
.app-header h1 { font-size: 1.15rem; line-height: 40px; }
#version-button { min-height: 32px; line-height: 1.4; }
.property-group th { background: #dce6ec; color: #344e5a; padding-block: 6px; }
@media (max-width: 430px) {
  .shock-inputs { flex-wrap: nowrap; gap: 6px; }
  .has-flow .shock-inputs .altitude-label { width: 82px; flex: 0 0 82px; }
  .shock-inputs .units { flex: 1; min-width: 0; }
  .shock-inputs .units button { min-width: 0; flex: 1; padding-inline: 5px; font-size: .72rem; }
  .isentropic-table { min-width: 0; table-layout: auto; font-size: .79rem; }
  .isentropic-table th, .isentropic-table td { padding-inline: 3px; }
  .isentropic-table thead th { width: auto !important; white-space: normal !important; }
}

/* Controls use 80% of their previous height, with unchanged text size. */
.info-tabs button, .action-button, .text-button, .units button,
.report-toolbar [role="tab"] { min-height: 35.2px; }
.info-tabs button, .text-button, .report-toolbar [role="tab"] { padding-block: 4px; }
.action-button { padding-block: 5.6px; }
.info { min-height: 35.2px; }
.reports-button { height: 35.2px; }
.bottom-tabs a { min-height: 41.6px; padding-block: 10.8px 6.8px; }
#version-button .badge { margin-left: 10px; line-height: 1.4; vertical-align: middle; }
.app-header h1 { line-height: 1.4; min-height: 40px; display: flex; align-items: center; flex-wrap: wrap; column-gap: 4px; }
#version-button { display: inline-flex; align-items: center; flex-wrap: wrap; row-gap: 3px; }
#angle-label { white-space: nowrap; }
@media (max-height: 600px) {
  .bottom-tabs a { min-height: 35.2px; padding-block: 7.6px 3.6px; }
}
@media (max-width: 430px) {
  .oblique-table, .normal-table, .conic-table { min-width: 0; font-size: .75rem; }
  .oblique-table th, .oblique-table td, .normal-table th, .normal-table td,
  .conic-table th, .conic-table td { padding-inline: 2px; }
  .oblique-table thead th, .normal-table thead th, .conic-table thead th { white-space: normal !important; }
  .oblique-table th:first-child, .normal-table th:first-child, .conic-table th:first-child { width: 17%; }
  .conic-table .units-cell { font-size: .7rem; }
}

/* Preserve the angle selector's space when wave input determines the branch. */
#strength-control[hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.app-shell { position: relative; }
.tool-snapshot { position: absolute; left: 0; width: 100%; background: #fafbfc; pointer-events: none; z-index: 2; }

@media (max-width: 430px) {
  .fanno-table, .rayleigh-table { min-width: 0; font-size: .75rem; }
  .fanno-table th, .fanno-table td, .rayleigh-table th, .rayleigh-table td { padding-inline: 2px; }
  .fanno-table thead th, .rayleigh-table thead th { white-space: normal !important; }
  .flow-section:first-child .fanno-table th:first-child,
  .flow-section:first-child .rayleigh-table th:first-child { width: 17%; }
}
