/* Sequoia Scientific – calculator kit (design "A"). One look for every instrument calculator. */
:root {
  --sc-text: #5e7196;      /* site slate blue */
  --sc-strong: #34466b;    /* values and numbers */
  --sc-muted: #66789a;
  --sc-navy: #273e6c;
  --sc-orange: #cf7938;    /* site accent */
  --sc-orange-dark: #b8652a;
  --sc-line: #e3e7ee;
  --sc-line-soft: #eef1f5;
  --sc-field: #f1f4f9;
  --sc-field-ro: #eceff4;
  --sc-page: #f6f8fb;
  --sc-ok: #3fa66b;        /* logging / on */
  --sc-warm: #e9a93e;      /* warm-up */
  --sc-sleep: #c4cbd6;     /* off / sleep */
  --sc-cond: "Open Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --sc-sans: Arial, Helvetica, sans-serif;
  --sc-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23cf7938' stroke-width='2'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: #e9edf3; color: var(--sc-text); font: 12px/16px var(--sc-sans); font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
a { color: var(--sc-orange); text-decoration: none; }
a:hover { color: var(--sc-orange-dark); }
button, input, select { font: inherit; color: inherit; }

/* ---------- Window ---------- */
.sc-window { max-width: 1040px; margin: 24px auto; background: #fff; border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 28, 56, .18); overflow: clip; }
.sc-head { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 10px 20px 10px 28px; background: #fff; border-bottom: 1px solid var(--sc-line); }
.sc-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; }
.sc-title h1 { margin: 0; font: 300 30px/1.1 var(--sc-cond); color: var(--sc-text); }
.sc-title p { margin: 0; font-size: 12px; color: var(--sc-muted); }
.sc-close { flex: none; width: 44px; height: 44px; border-radius: 22px; background: var(--sc-field); color: var(--sc-text); display: flex; align-items: center; justify-content: center; }
.sc-close:hover { background: #e3e8f0; color: var(--sc-strong); }
.sc-close:focus-visible { outline: 2px solid var(--sc-orange); outline-offset: 2px; }
.sc-body { display: flex; align-items: stretch; }
.sc-inputs { flex: 1; min-width: 0; padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; background: var(--sc-page); border-right: 1px solid var(--sc-line); }
.sc-results { width: 330px; flex: none; align-self: flex-start; position: sticky; top: 68px; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }

/* Inside the pop-up: the window fills the frame and only the body scrolls */
html.in-frame, html.in-frame body { height: 100%; background: #fff; }
html.in-frame .sc-window { margin: 0; max-width: none; height: 100%; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
html.in-frame .sc-head { position: static; flex: none; }
html.in-frame .sc-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
html.in-frame .sc-results { top: 0; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--sc-line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card > h2, .card-head > h2 { margin: 0; font: 700 18px/1.2 var(--sc-cond); color: var(--sc-text); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; }
details.card { gap: 0; }
details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary b { font: 700 18px/1.2 var(--sc-cond); color: var(--sc-text); }
details.card > summary span { flex: 1; font-size: 12px; color: var(--sc-muted); }
details.card > summary::after { content: ""; flex: none; align-self: center; width: 12px; height: 8px; background: var(--sc-arrow) no-repeat center; transition: transform .15s; }
details.card[open] > summary::after { transform: rotate(180deg); }
details.card[open] > summary { margin-bottom: 12px; }
summary:focus-visible { outline: 2px solid var(--sc-orange); outline-offset: 4px; border-radius: 4px; }

/* ---------- Layout helpers ---------- */
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.row4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1.7fr; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline .in { width: 130px; }
.inline .in.wide { width: 220px; }
.sched { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--sc-line-soft); }
.grp { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.grp > b { font: 700 15px/1.2 var(--sc-cond); color: var(--sc-text); }
.grp > .seg { justify-self: start; }
hr { border: 0; border-top: 1px solid var(--sc-line-soft); margin: 2px 0; }

/* ---------- Fields ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label.f > span { font-size: 12px; font-weight: 600; color: var(--sc-text); }
.in { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; background: var(--sc-field); border: 1px solid transparent; border-radius: 8px; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.in:focus-within { background: #fff; border-color: var(--sc-text); box-shadow: 0 0 0 3px rgba(94, 113, 150, .16); }
.in input, .in select { flex: 1; width: 100%; min-width: 0; height: 38px; padding: 0; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--sc-strong); }
.in select { cursor: pointer; -webkit-appearance: none; appearance: none; padding-right: 22px; background: var(--sc-arrow) no-repeat right 2px center; }
.in select.u { flex: none; width: auto; height: 28px; margin-right: -4px; padding: 0 18px 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--sc-orange); background-position: right 4px center; background-size: 9px 6px; }
.in select.u:hover { background-color: rgba(207, 121, 56, .10); }
.in em { font-style: normal; font-size: 12px; color: var(--sc-muted); white-space: nowrap; }
.in .v { flex: none; width: 40px; text-align: right; }
.in.ro { background: var(--sc-field-ro); }
.in.ro input { color: var(--sc-muted); }
.in input[type=number] { -moz-appearance: textfield; }
.in input::-webkit-outer-spin-button, .in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Tabs (segmented, e.g. Sensor A / Sensor B) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sc-field); border-radius: 10px; }
.tab { -webkit-appearance: none; appearance: none; border: 0; background: transparent; border-radius: 7px; min-height: 36px; padding: 7px 14px; display: flex; align-items: center; gap: 8px; font: 600 13px var(--sc-sans); color: var(--sc-muted); cursor: pointer; }
.tab:hover { color: var(--sc-strong); }
.tab[aria-selected=true] { background: #fff; color: var(--sc-strong); box-shadow: 0 1px 3px rgba(39, 62, 108, .16); }
.tab small { font-size: 12px; font-weight: 400; color: var(--sc-muted); }
.tab small::before { content: "\00b7\00a0"; }
.tab:focus-visible { outline: 2px solid var(--sc-orange); outline-offset: 2px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--sc-sleep); flex: none; }
.dot.on { background: var(--sc-ok); }
.panel { display: flex; flex-direction: column; gap: 14px; }
.pbody { display: flex; flex-direction: column; gap: 12px; }
.pbody.off { opacity: .4; pointer-events: none; }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.phead label.f { flex: 0 1 240px; }

/* Segmented choice (radio buttons) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--sc-field); border-radius: 9px; }
.seg label { position: relative; padding: 7px 14px; border-radius: 7px; font-size: 12px; color: var(--sc-text); cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--sc-text); color: #fff; font-weight: 700; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--sc-orange); outline-offset: 2px; }
.seg label:has(input:disabled) { opacity: .4; cursor: not-allowed; }

/* On/off switch */
.sw { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 12px; font-weight: 600; color: var(--sc-text); cursor: pointer; user-select: none; }
.sw input { -webkit-appearance: none; appearance: none; width: 40px; height: 24px; border-radius: 12px; background: #c4cbd4; position: relative; margin: 0; cursor: pointer; transition: background-color .15s; }
.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9px; background: #fff; transition: left .15s; }
.sw input:checked { background: var(--sc-ok); }
.sw input:checked::after { left: 19px; }
.sw input:focus-visible { outline: 2px solid var(--sc-orange); outline-offset: 2px; }

/* Timeline bar */
.tl { display: flex; flex-direction: column; gap: 6px; }
.tlbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; font: 700 11px var(--sc-sans); }
.tlbar div { display: flex; align-items: center; justify-content: center; min-width: 30px; overflow: hidden; white-space: nowrap; }
.tlbar .w { background: var(--sc-warm); color: #3b2a07; }
.tlbar .l { background: var(--sc-ok); color: #fff; }
.tlbar .s { background: #dfe4ec; color: var(--sc-strong); }
.tlnote { font-size: 12px; color: var(--sc-muted); }

/* ---------- Results ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: 12px; background: var(--sc-field); padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 4px; }
.hero-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--sc-orange); }
.hero-card h2 { margin: 0; font: 300 22px/1.2 var(--sc-cond); color: var(--sc-text); }
.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.hero b { font: 700 72px/1 var(--sc-cond); color: var(--sc-strong); }
.hero span { font: 300 28px/1.1 var(--sc-cond); color: var(--sc-strong); }
.alt { min-height: 20px; font: 700 15px/1.3 var(--sc-cond); color: var(--sc-text); }
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--sc-line-soft); }
.kv:last-child { border-bottom: 0; }
.kv > span { font-size: 12px; }
.kv > b { font: 700 18px/1.2 var(--sc-cond); color: var(--sc-strong); text-align: right; }
.energy { display: flex; flex-direction: column; gap: 8px; }
.sect { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.sect span:first-child { font-weight: 600; }
.sect span + span { color: var(--sc-muted); }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e7ebf1; }
.stack i { display: block; height: 100%; }
.leg { list-style: none; margin: 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.leg li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; gap: 8px; align-items: center; }
.leg i { width: 10px; height: 10px; border-radius: 3px; }
.leg .v { color: var(--sc-strong); }
.leg .p { color: var(--sc-muted); text-align: right; }
.msgs { list-style: none; margin: 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.msgs:empty { display: none; }
.msgs li { position: relative; padding: 7px 10px 7px 26px; border-radius: 8px; }
.msgs li::before { position: absolute; left: 10px; top: 7px; font-weight: 700; }
.msgs .ok { background: #e7f4ec; color: #2a7148; }
.msgs .ok::before { content: "\2713"; }
.msgs .warn { background: #fff3e2; color: #8a5200; }
.msgs .warn::before { content: "!"; }
.msgs .bad { background: #fdebe8; color: #a8231b; }
.msgs .bad::before { content: "!"; }
.fine { margin: 0; font-size: 11px; line-height: 15px; color: var(--sc-muted); }

/* ---------- Phone ---------- */
.mbar { display: none; }
@media (max-width: 820px) {
  .sc-window { margin: 0; border-radius: 0; box-shadow: none; }
  .sc-head { min-height: 60px; padding: 8px 12px 8px 16px; }
  .sc-title h1 { font-size: 23px; }
  .sc-title p { display: none; }
  .sc-body { flex-direction: column; }
  .sc-inputs { padding: 16px; border-right: 0; }
  .sc-results { width: auto; align-self: stretch; position: static; padding: 20px 16px 96px; border-top: 1px solid var(--sc-line); scroll-margin-top: 8px; }
  .hero b { font-size: 56px; }
  .mbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 5; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 18px; background: #fff; border: 1px solid var(--sc-line); border-radius: 30px; box-shadow: 0 8px 24px rgba(39, 62, 108, .2); color: var(--sc-strong); transition: opacity .2s, transform .2s; }
  .mbar b { font: 700 26px var(--sc-cond); }
  .mbar span { font: 300 18px var(--sc-cond); }
  .mbar button { border: 0; border-radius: 24px; background: var(--sc-orange); color: #fff; font: 700 15px var(--sc-cond); min-height: 44px; padding: 0 18px; cursor: pointer; }
  .mbar button:focus-visible { outline: 2px solid var(--sc-navy); outline-offset: 2px; }
  html.sc-results-visible .mbar { opacity: 0; transform: translateY(12px); pointer-events: none; }
}
@media (max-width: 560px) {
  .row4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row4 > :last-child { grid-column: 1 / -1; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .grp { grid-template-columns: 1fr; gap: 4px; }
  .inline .in, .inline .in.wide { width: 100%; }
  .card { padding: 14px; }
  .in { height: 44px; }
  .in input, .in select { font-size: 16px; }
  .phead label.f { flex: 1 1 auto; }
  /* Sensor tabs side by side on phones: name on top, sensor type underneath */
  .card-head .tabs { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .tab { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; row-gap: 0; justify-items: start; text-align: left; padding: 7px 10px; }
  .tab small { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab small::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }