/* Dash serves every file of webapp/assets/ automatically.
   Layout: a masthead, then per tab a control sidebar on the left and result cards on the right.
   One light theme on purpose: the Mach field figures are rendered on white. */
:root {
  --page: #f3f5f8;          /* cool grey ground */
  --panel: #ffffff;
  --ink: #1c2530;           /* text, and the CFD curve */
  --muted: #5a6675;
  --rule: #dde2e9;
  --accent: #1f4f82;        /* deep blue: tabs, sliders, links */
  --model-a: #2a78d6;
  --model-b: #eb6834;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Dash 4 components */
  --Dash-Fill-Interactive-Strong: var(--accent);
  --Dash-Text-Strong: var(--ink);
  --Dash-Stroke-Strong: #aeb7c2;
  --Dash-Stroke-Weak: var(--rule);
  color-scheme: light;
}

body { background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 15px;
       line-height: 1.5; margin: 0; }
.page { max-width: 1480px; margin: 0 auto; padding-inline: 24px; padding-block: 0 48px; }

/* masthead */
.masthead { padding-block: 32px 20px; display: grid; gap: 6px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
           text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.2;
     text-wrap: balance; }
.lede { margin: 0; max-width: 68ch; color: var(--muted); font-size: 16px; }

/* tabs */
.tabs { border-bottom: 1px solid var(--rule); }
.tabs .tab.tab { background: transparent; border: 0 !important; border-bottom: 2px solid transparent !important;
           padding: 10px 4px; margin-right: 28px; color: var(--muted); font-weight: 600;
           font-size: 15px; width: auto; flex: 0 0 auto; }
.tabs .tab.tab-selected { border-bottom: 2px solid var(--accent) !important; color: var(--ink);
                    background: transparent; }

/* tab body: sidebar + results */
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px;
             padding-top: 24px; align-items: start; }
.controls { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
            padding: 20px; display: grid; gap: 18px; position: sticky; top: 16px; }
.results { display: grid; gap: 20px; min-width: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }

h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 18px; }
.controls h3 { font-size: 13px; font-family: var(--sans); text-transform: uppercase;
               letter-spacing: 0.08em; color: var(--muted); border-bottom: 1px solid var(--rule);
               padding-bottom: 6px; }
.controls label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.md p { margin: 0; }                        /* dcc.Markdown wraps its text in <p> */
.slider .md { font-size: 14px; }
.slider { display: grid; gap: 2px; }
.field-group { display: grid; gap: 6px; }
.hint, .notes { color: var(--muted); font-size: 13px; margin: 0; }
.notes p { margin: 0 0 8px; }
.toggle label { font-weight: 400; }
.toggle input { accent-color: var(--accent); }

.swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch-a { background: var(--model-a); }
.swatch-b { background: var(--model-b); }

/* result cards */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
        padding: 18px 20px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.caption { margin: 0; color: var(--muted); font-size: 14px; max-width: 80ch; }
/* Mach field panels: one row per kind of field, the colour bar at the end of each row */
.fields { display: grid; gap: 10px; }
.field-row { display: grid; gap: 8px;
             align-items: end; }
.fields-single { max-width: 560px; }
.field-row figure { margin: 0; display: grid; gap: 4px; }
.field-row figcaption { font-family: var(--serif); font-size: 14px; text-align: center; }
.field-row figure img { width: 100%; aspect-ratio: 4 / 3; border: 1px solid #b8c0ca; display: block; }
.colorbar { width: 64px; align-self: center; }

/* the case being shown */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 28px; }
.case-name { font-family: var(--serif); font-weight: 600; font-size: 19px; }
.note { color: var(--muted); font-size: 14px; }
.chip { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
        padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.chip-training { color: #4a5563; border-color: #c5ccd5; background: #f0f2f5; }
.chip-interpolation { color: #1f4f82; border-color: #a9c3e0; background: #eaf1f9; }
.chip-extrapolation { color: #8a4a06; border-color: #e5c197; background: #fbf1e5; }
.chip-none { color: var(--muted); border-color: var(--rule); background: transparent;
             border-style: dashed; }

/* number tables */
.numbers { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.numbers th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
              font-weight: 600; text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--ink); }
.numbers th, .numbers td { white-space: nowrap; }
.numbers td:first-child { white-space: normal; }
.numbers td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--rule); }
.numbers td:first-child, .numbers th:first-child { text-align: left; color: var(--muted); }
.card:has(.numbers) { overflow-x: auto; }

/* models tab */
.model-list { display: grid; gap: 2px; }
.model-list label { font-weight: 400; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.model-list label:has(input:checked) { background: #e8eef6; color: var(--accent); font-weight: 600; }
.model-list input { accent-color: var(--accent); }
.diagram { max-width: 100%; height: auto; justify-self: start; }
.settings td { text-align: left; white-space: normal; vertical-align: top; }
.settings td:first-child { width: 32%; }
.figures { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.figures figure { margin: 0; display: grid; gap: 6px; }
.figures img { width: 100%; }
.figure-wide { flex: 1 1 100%; max-width: 900px; }
.figure-narrow { flex: 0 1 360px; }
.figures figcaption { color: var(--muted); font-size: 14px; }

@media (max-width: 1100px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .page { padding-inline: 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .controls { position: static; }
  h1 { font-size: 24px; }
}
.footer { margin-block: 32px 24px; color: var(--muted); font-size: 14px; }
