/* Tokens follow the IBM Carbon Design System: g10 theme in light, g100 theme in dark. */
:root {
  --background: #f4f4f4; --layer: #ffffff; --layer-2: #f4f4f4; --layer-accent: #e0e0e0; --layer-hover: #e8e8e8; --field: #f4f4f4;
  --border-subtle: #e0e0e0; --border-strong: #8d8d8d; --border-inverse: #161616;
  --text: #161616; --text-secondary: #525252; --text-helper: #6f6f6f; --text-on-inverse: #ffffff; --inverse: #393939;
  --interactive: #0f62fe; --link: #0f62fe; --focus: #0f62fe; --highlight: #edf5ff;
  --shell: #161616; --shell-text: #f4f4f4; --shell-muted: #c6c6c6;
  --success: #24a148; --success-text: #198038; --success-bg: #defbe6;
  --error: #da1e28; --error-text: #da1e28; --error-bg: #fff1f1;
  --tag-bg: #e0e0e0; --tag-text: #161616; --tag-blue-bg: #d0e2ff; --tag-blue-text: #002d9c; --tag-green-bg: #a7f0ba; --tag-green-text: #044317;
  --series-1: #8a3ffc; --series-2: #0072c3; --series-3: #198038; --series-4: #d02670; --series-5: #b28600;

  /* Plan drawing. The names stay because the 2D plan and the 3D scene read them. */
  --paper: var(--background); --sheet: var(--layer); --ink: #161616; --muted: #525252; --line: #c6c6c6;
  --oak: #c9995f; --oak-soft: #e6cfae; --glass: #0072c3; --hypo: #ba4e00; --outside: #e0e0e0; --circ: #f2f4f8; --verr: #262626;
  --z-cafe: #ffd9be; --z-dedie: #d0e2ff; --z-nomade: #defbe6; --z-reunion: #e8daff; --z-event: #ffd6e8; --furn: #ffffff; --furn-line: #393939;
  --good: #198038; --bad: #da1e28;
  --wall-thin: #6f6f6f; --z-prive: #a6c8ff; --z-studio: #fcf4d6; --z-booth: #bae6ff; --z-kitchen: #fff1f1; --z-wc: #e5f6ff;
  --wood: #e3cfae; --bar: #4a3f36; --sofa: #a9c2ad; --sofa-2: #7f9f87; --booth: #343a3f; --leaf: #198038; --leaf-2: #42be65;

  --f-body: "IBM Plex Sans", system-ui, sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --s2: 4px; --s3: 8px; --s4: 12px; --s5: 16px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #161616; --layer: #262626; --layer-2: #393939; --layer-accent: #393939; --layer-hover: #333333; --field: #393939;
    --border-subtle: #393939; --border-strong: #6f6f6f; --border-inverse: #f4f4f4;
    --text: #f4f4f4; --text-secondary: #c6c6c6; --text-helper: #a8a8a8; --text-on-inverse: #161616; --inverse: #f4f4f4;
    --interactive: #4589ff; --link: #78a9ff; --focus: #ffffff; --highlight: #001d6c;
    --shell: #161616; --shell-text: #f4f4f4; --shell-muted: #a8a8a8;
    --success: #42be65; --success-text: #42be65; --success-bg: #071908;
    --error: #fa4d56; --error-text: #ff8389; --error-bg: #2d0709;
    --tag-bg: #525252; --tag-text: #f4f4f4; --tag-blue-bg: #0043ce; --tag-blue-text: #d0e2ff; --tag-green-bg: #0e6027; --tag-green-text: #a7f0ba;
    --series-1: #8a3ffc; --series-2: #1192e8; --series-3: #24a148; --series-4: #ee5396; --series-5: #b28600;
    --ink: #f4f4f4; --muted: #c6c6c6; --line: #525252;
    --oak: #c08c50; --oak-soft: #5b4630; --glass: #33b1ff; --hypo: #ff832b; --outside: #393939; --circ: #262626; --verr: #c6c6c6;
    --z-cafe: #5e2900; --z-dedie: #002d9c; --z-nomade: #044317; --z-reunion: #491d8b; --z-event: #740937; --furn: #393939; --furn-line: #e0e0e0;
    --good: #42be65; --bad: #ff8389;
    --wall-thin: #a8a8a8; --z-prive: #0043ce; --z-studio: #483700; --z-booth: #003a6d; --z-kitchen: #750e13; --z-wc: #012749;
    --wood: #7a6247; --bar: #2a221c; --sofa: #5d7a63; --sofa-2: #465e4c; --booth: #121619; --leaf: #42be65; --leaf-2: #6fdc8c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: #161616; --layer: #262626; --layer-2: #393939; --layer-accent: #393939; --layer-hover: #333333; --field: #393939;
  --border-subtle: #393939; --border-strong: #6f6f6f; --border-inverse: #f4f4f4;
  --text: #f4f4f4; --text-secondary: #c6c6c6; --text-helper: #a8a8a8; --text-on-inverse: #161616; --inverse: #f4f4f4;
  --interactive: #4589ff; --link: #78a9ff; --focus: #ffffff; --highlight: #001d6c;
  --shell: #161616; --shell-text: #f4f4f4; --shell-muted: #a8a8a8;
  --success: #42be65; --success-text: #42be65; --success-bg: #071908;
  --error: #fa4d56; --error-text: #ff8389; --error-bg: #2d0709;
  --tag-bg: #525252; --tag-text: #f4f4f4; --tag-blue-bg: #0043ce; --tag-blue-text: #d0e2ff; --tag-green-bg: #0e6027; --tag-green-text: #a7f0ba;
  --series-1: #8a3ffc; --series-2: #1192e8; --series-3: #24a148; --series-4: #ee5396; --series-5: #b28600;
  --ink: #f4f4f4; --muted: #c6c6c6; --line: #525252;
  --oak: #c08c50; --oak-soft: #5b4630; --glass: #33b1ff; --hypo: #ff832b; --outside: #393939; --circ: #262626; --verr: #c6c6c6;
  --z-cafe: #5e2900; --z-dedie: #002d9c; --z-nomade: #044317; --z-reunion: #491d8b; --z-event: #740937; --furn: #393939; --furn-line: #e0e0e0;
  --good: #42be65; --bad: #ff8389;
  --wall-thin: #a8a8a8; --z-prive: #0043ce; --z-studio: #483700; --z-booth: #003a6d; --z-kitchen: #750e13; --z-wc: #012749;
  --wood: #7a6247; --bar: #2a221c; --sofa: #5d7a63; --sofa-2: #465e4c; --booth: #121619; --leaf: #42be65; --leaf-2: #6fdc8c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 400 14px/1.43 var(--f-body); letter-spacing: .16px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
h1 { font-weight: 300; font-size: 32px; line-height: 40px; letter-spacing: 0; margin: 0; text-wrap: balance; }
h2 { font-weight: 600; font-size: 16px; line-height: 22px; letter-spacing: 0; margin: 0; }
p { margin: 0; }
.helper { font-size: 12px; line-height: 16px; letter-spacing: .32px; color: var(--text-helper); }
.lede { max-width: 72ch; color: var(--text-secondary); font-size: 16px; line-height: 24px; letter-spacing: 0; }

/* UI shell header */
.shell { position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; gap: var(--s5); padding: 0 var(--s5); background: var(--shell); color: var(--shell-text); border-bottom: 1px solid #393939; }
.shell-name { color: var(--shell-text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-name b { font-weight: 600; margin-right: 6px; }
.shell-name:hover { text-decoration: none; }
.shell-meta { margin-left: auto; color: var(--shell-muted); font-size: 12px; letter-spacing: .32px; white-space: nowrap; }
@media (max-width: 671px) { .shell-meta { display: none; } }

/* Contained tabs */
.tabs { position: sticky; top: 48px; z-index: 19; background: var(--layer-accent); }
.tabs-inner { display: flex; overflow-x: auto; scrollbar-width: none; max-width: 1584px; margin: 0 auto; }
.tab { flex: 1 0 auto; min-width: 150px; display: grid; gap: 2px; padding: 10px var(--s5) 10px; color: var(--text-secondary); background: var(--layer-accent); border-right: 1px solid var(--border-strong); box-shadow: inset 0 2px 0 transparent; }
.tab:last-child { border-right: 0; }
.tab:hover { text-decoration: none; background: var(--layer-hover); color: var(--text); }
.tab[aria-current="page"] { background: var(--background); color: var(--text); box-shadow: inset 0 2px 0 var(--interactive); border-right-color: transparent; }
.tab-name { font-size: 14px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.tab-sub { font-size: 12px; line-height: 16px; letter-spacing: .32px; white-space: nowrap; }
.tab-ebe { font-variant-numeric: tabular-nums; font-weight: 600; }
.tab-ebe.is-bad { color: var(--error-text); }
.tab-ebe.is-good { color: var(--success-text); }

/* Page grid */
.wrap { max-width: 1584px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s9); }
.page { display: grid; gap: var(--s5); min-width: 0; align-content: start; }
.page-head { display: grid; gap: var(--s3); padding: var(--s3) 0 var(--s3); }
.scn { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--s7); align-items: start; }
.side { position: sticky; top: 112px; max-height: calc(100vh - 112px - 16px); overflow-y: auto; background: var(--layer); scrollbar-width: thin; }
.side-inner { display: grid; gap: var(--s5); padding: var(--s5); }
@media (max-width: 1055px) {
  .scn { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .side { position: static; max-height: none; order: 1; }
  .scn > .page { display: contents; }
  .scn > .page > :nth-child(n+4) { order: 2; }
}

/* Tiles */
.tile { background: var(--layer); padding: var(--s5); display: grid; gap: var(--s5); min-width: 0; align-content: start; }
.tile-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: baseline; justify-content: space-between; }
.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 1311px) { .panels { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1055px) { .panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 799px) { .panels, .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* KPIs */
.verdict, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
.verdict { grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(160px, 1fr)); }
@media (max-width: 799px) { .verdict { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kpi-lead, .verdict > .kpi:last-child:nth-child(even) { grid-column: 1 / -1; } }
.kpi { background: var(--layer); padding: var(--s5); display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.kpi-label { font-size: 12px; line-height: 16px; letter-spacing: .32px; color: var(--text-secondary); }
.kpi-value { font-size: 28px; line-height: 36px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kpi-lead .kpi-value { font-size: 42px; line-height: 50px; font-weight: 300; }
.kpi-lead.is-good .kpi-value { color: var(--success-text); }
.kpi-lead.is-bad .kpi-value { color: var(--error-text); }
.facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); color: var(--text-secondary); }
.facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Content switcher and buttons */
button { font: inherit; letter-spacing: inherit; color: var(--text); cursor: pointer; }
.switcher { display: flex; flex-wrap: wrap; border: 1px solid var(--border-inverse); }
.switcher > button { flex: 1 1 0; min-height: 40px; padding: var(--s3) var(--s5); background: transparent; border: 0; border-left: 1px solid var(--border-strong); text-align: left; color: var(--text-secondary); }
.switcher > button:first-child { border-left: 0; }
.switcher > button:hover { background: var(--layer-hover); color: var(--text); }
.switcher > button[aria-pressed="true"], .switcher > button[aria-checked="true"] { background: var(--inverse); color: var(--text-on-inverse); }
.switcher > button[aria-pressed="true"] + button, .switcher > button[aria-checked="true"] + button { border-left-color: transparent; }
.switcher-sm { display: inline-flex; width: fit-content; max-width: 100%; }
.switcher-sm > button { flex: 0 0 auto; min-height: 32px; padding: 4px var(--s4); font-size: 14px; }
.switcher-wide > button { display: grid; gap: 2px; padding: var(--s4) var(--s5); }
.switcher-wide > button span { font-weight: 600; }
.switcher-wide > button small { font-size: 12px; line-height: 16px; letter-spacing: .32px; opacity: .85; }
@media (max-width: 671px) { .switcher-wide { flex-direction: column; } .switcher-wide > button { border-left: 0; border-top: 1px solid var(--border-strong); } .switcher-wide > button:first-child { border-top: 0; } }
@media (pointer: coarse) { .switcher > button, .switcher-sm > button { min-height: 44px; } }
button.link { background: none; border: 0; padding: 0; color: var(--link); font-size: inherit; }
button.link:hover { text-decoration: underline; }

/* Slider with number input */
.slider { display: grid; gap: var(--s3); }
.slider-label { display: flex; align-items: center; gap: var(--s3); font-size: 12px; line-height: 16px; letter-spacing: .32px; color: var(--text-secondary); }
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: var(--s4); align-items: center; }
.slider-unit { font-size: 12px; color: var(--text-helper); min-width: 44px; }
input[type="range"] { width: 100%; margin: 0; accent-color: var(--interactive); }
.num-input { width: 72px; height: 32px; padding: 0 var(--s3); font: 400 14px var(--f-body); font-variant-numeric: tabular-nums; color: var(--text); background: var(--field); border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; }
.num-input:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (pointer: coarse) { .num-input { height: 44px; } }

/* Accordion */
.accordion { border-top: 1px solid var(--border-subtle); }
.accordion:last-child { border-bottom: 1px solid var(--border-subtle); }
.accordion summary { list-style: none; display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding: 0 var(--s2); cursor: pointer; font-size: 14px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 6px; transition: transform 110ms cubic-bezier(.2, 0, .38, .9); }
.accordion[open] summary::before { transform: rotate(45deg); }
.accordion summary:hover { background: var(--layer-hover); }
.summary-figure { margin-left: auto; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.accordion-body { display: grid; gap: var(--s5); padding: var(--s3) 0 var(--s5); }
.side .accordion { margin: 0 calc(-1 * var(--s5)); padding: 0 var(--s5); }

/* Data table */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px var(--s5); border-bottom: 1px solid var(--border-subtle); vertical-align: top; line-height: 18px; }
thead th { background: var(--layer-accent); font-weight: 600; color: var(--text); border-bottom: 0; padding-top: 11px; padding-bottom: 11px; white-space: nowrap; }
tbody tr:hover > * { background: var(--layer-hover); }
tbody th { font-weight: 400; }
th.r { text-align: right; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.code { font-family: var(--f-mono); font-size: 12px; }
td small.unit, tbody th small { display: block; font-size: 12px; line-height: 16px; letter-spacing: .32px; color: var(--text-helper); font-weight: 400; }
tr.strong > * { font-weight: 600; }
tr.group > th { background: var(--layer-2); font-weight: 600; font-size: 12px; letter-spacing: .32px; color: var(--text-secondary); padding-top: 6px; padding-bottom: 6px; }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--border-strong); }
.is-bad { color: var(--error-text); }
.is-good { color: var(--success-text); }
table.pl th small { margin-top: 2px; }
.tbl-compare th[scope="row"] { position: sticky; left: 0; background: var(--layer); z-index: 1; min-width: 180px; }
.tbl-compare tbody tr:hover > th[scope="row"] { background: var(--layer-hover); }
.tbl-compare td.cur, .tbl-compare th.cur { background: var(--highlight); }
.tbl-compare thead th.cur { box-shadow: inset 0 -2px 0 var(--interactive); }
.tbl-compare td.best { font-weight: 600; }

/* Tags and notifications */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s3); border-radius: 12px; font-size: 12px; letter-spacing: .32px; white-space: nowrap; background: var(--tag-bg); color: var(--tag-text); }
.tag-blue, .tag.st-m { background: var(--tag-blue-bg); color: var(--tag-blue-text); }
.tag-green { background: var(--tag-green-bg); color: var(--tag-green-text); }
.tag.st-h { background: #ffd9be; color: #5e2900; }
.slider-label .tag { height: 18px; padding: 0 6px; }
.notification { padding: var(--s4) var(--s5); border-left: 3px solid; font-size: 14px; color: var(--text); }
.notification.is-success { border-color: var(--success); background: var(--success-bg); }
.notification.is-error { border-color: var(--error); background: var(--error-bg); }
.notification ul { margin: var(--s3) 0 0; padding-left: 18px; }

/* Structured list */
.structured { list-style: none; margin: 0; padding: 0; }
.structured li { display: block; padding: var(--s4) 0; border-top: 1px solid var(--border-subtle); max-width: 80ch; }
.structured li:first-child { border-top: 0; padding-top: 0; }
.structured li b { font-weight: 600; }
.structured.with-tags li { display: flex; gap: var(--s4); align-items: baseline; }
.structured .tag { flex: none; }

/* Plans, legend, meter */
.plan2d svg { width: 100%; height: auto; display: block; }
.three { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--layer-2); touch-action: none; }
.legend, .chart-legend { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); font-size: 12px; letter-spacing: .32px; color: var(--text-secondary); }
.legend span, .chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border: 1px solid var(--line); display: inline-block; flex: none; }
.occ { display: inline-flex; align-items: center; gap: var(--s3); }
.meter { display: inline-block; width: 88px; height: 8px; background: var(--layer-accent); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--interactive); }
.meter i.full { background: var(--text); }
.pct { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Chart */
.chart { margin: 0; display: grid; gap: var(--s4); max-width: 880px; }
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .axis { font: 11px var(--f-body); fill: var(--text-helper); }
.chart .axis-strong { fill: var(--text-secondary); }
.chart .end-label { font: 600 12px var(--f-body); fill: var(--text); }
.tip { position: absolute; top: 8px; transform: translateX(12px); background: var(--inverse); color: var(--text-on-inverse); padding: var(--s3) var(--s4); display: grid; gap: 2px; font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.tip span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.tip .sw { border-color: transparent; }

@media (max-width: 671px) {
  .wrap { padding: var(--s5) var(--s5) var(--s8); }
  h1 { font-size: 28px; line-height: 36px; }
  .kpi-lead .kpi-value { font-size: 36px; line-height: 44px; }
  .kpi-value { font-size: 24px; line-height: 32px; }
  .tab { min-width: 132px; }
  table.pl th small { max-width: 30ch; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Icons and toggletips */
.icon { flex: none; display: inline-block; vertical-align: -3px; }
.info { position: relative; display: inline-flex; align-items: center; color: var(--text-helper); cursor: help; border-radius: 2px; }
.info:hover, .info:focus-visible { color: var(--text); }
.info:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.info::after { content: attr(data-tip); position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; padding: var(--s3) var(--s4); background: var(--inverse); color: var(--text-on-inverse); font-size: 12px; line-height: 16px; letter-spacing: .32px; font-weight: 400; text-transform: none; white-space: normal; text-align: left; box-shadow: 0 2px 6px rgb(0 0 0 / .3); display: none; pointer-events: none; }
.info:hover::after, .info:focus-visible::after { display: block; }
th .info::after, .kpi .info::after { left: auto; right: -8px; transform: none; }
.kpi-label { display: flex; align-items: center; gap: var(--s2); }
.kpi-label .icon { color: var(--text-helper); }
.kpi-value small { font-size: 14px; color: var(--text-helper); margin-left: 2px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { color: var(--text-helper); }
.icon-title { display: flex; align-items: center; gap: var(--s3); }
.notification { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: start; }
.notification > .icon { margin-top: 2px; }
.notification.is-success > .icon { color: var(--success); }
.notification.is-error > .icon { color: var(--error); }
.notification ul { grid-column: 2; }
.accordion summary .icon { color: var(--text-secondary); }
.side-hint { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
button.link { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.more summary { cursor: pointer; color: var(--link); font-size: 14px; width: fit-content; }
.more p { margin: var(--s3) 0 0; max-width: 72ch; color: var(--text-secondary); }
