/* =========================================================================
   pod.css — the pod's own panels: the kW trend, missions, the inspector,
   and the console's colours. Loaded after style.css; scrollbars stay
   hidden everywhere, as on the rest of the site.
   ========================================================================= */

/* =========================================================================
   OPERATOR DISPLAYS — MEMORY / STATE (pod/console.js) and the trend
   (pod/trend.js). One design language, after the high-performance HMI
   idea (ISA-101):
   - snow-white ground, grey for a plant that is behaving;
   - colour only for an abnormal state, and always with its priority shape
     (P1 red square, P2 amber triangle, P3 grey circle) and number;
   - Snow blue for exactly two things: the live-value pointer and PM-01's
     line on the trend — plus the Snow mark;
   - one face, Inter, self-hosted, with tabular, slashed-zero figures for
     every reading; large type only for the plant status and PM-01's kW;
   - hairlines and white space, not boxes, separate the groups.
   ========================================================================= */
@font-face {
  font-family: "SnowInter";
  src: url("fonts/inter-Regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "SnowInter";
  src: url("fonts/inter-Medium.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "SnowInter";
  src: url("fonts/inter-SemiBold.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "SnowInterDisplay";
  src: url("fonts/inter-display-SemiBold.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
:root {
  --hm-snow: #ffffff;
  --hm-frost: #f1f4f7;
  --hm-band: #dce3e9;
  --hm-rule: #e3e8ed;
  --hm-line: #c5cdd4;
  --hm-ink: #17212b;
  --hm-slate: #55626f;
  --hm-mist: #8c98a4;
  --hm-blue: #0366d6;
  --hm-p1: #c8102e;
  --hm-p2: #e89a00;
  --hm-p2-ink: #8f5b00;
  --hm-face: "SnowInter", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hm-display: "SnowInterDisplay", "SnowInter", "Inter", system-ui, sans-serif;
}

/* ------------------------------------------------- shared: priority shapes */
.hm-pr {
  flex: none;
  display: inline-block;
  vertical-align: -2px;
  overflow: visible;
}
.hm-pr text {
  font: 700 8.5px var(--hm-face);
}
.hm-pr.p1 rect {
  fill: var(--hm-p1);
}
.hm-pr.p1 text {
  fill: #fff;
}
.hm-pr.p2 path {
  fill: var(--hm-p2);
}
.hm-pr.p2 text {
  fill: var(--hm-ink);
}
.hm-pr.p3 circle {
  fill: #fff;
  stroke: var(--hm-slate);
  stroke-width: 1.3;
}
.hm-pr.p3 text {
  fill: var(--hm-slate);
}
.hm-pr.ok rect {
  fill: none;
  stroke: var(--hm-mist);
  stroke-width: 1.5;
}
.snow-mark {
  flex: none;
  display: block;
}

/* --------------------------------------------------------- panel buttons */
.panel-max,
#timebase.trend .tr-min,
#timebase.trend .tr-max {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--hm-line);
  border-radius: 3px;
  background: var(--hm-snow);
  color: var(--hm-slate);
  cursor: pointer;
}
.panel-max:hover,
#timebase.trend .tr-min:hover,
#timebase.trend .tr-max:hover {
  color: var(--hm-ink);
  border-color: var(--hm-ink);
}
.panel-max:focus-visible,
#timebase.trend button:focus-visible,
#timebase.trend select:focus-visible {
  outline: 2px solid var(--hm-blue);
  outline-offset: 1px;
}

/* ===================================================== MEMORY / STATE */
#terminal-state .state-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* the same content inset as the trend panel: 14px inside its 1px border */
#terminal-state {
  padding: 12px 15px;
}
#state-data {
  font-family: var(--hm-face);
  font-size: 12px;
  color: var(--hm-ink);
  container-type: inline-size;
}
.hm {
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum", "zero";
}
.hm small {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--hm-mist);
}

/* --- the header: status, which pod, PM-01 */
.hm-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--hm-ink);
}
.hm-status {
  display: flex;
  align-items: center;
  gap: 9px;
}
.hm-status > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-status b {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
}
.hm-status.p1 b {
  color: var(--hm-p1);
}
.hm-status.p2 b {
  color: var(--hm-p2-ink);
}
.hm-status span {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--hm-slate);
}
.hm-cnt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hm-cnt b {
  font-size: 12px !important;
  color: var(--hm-ink) !important;
}
.hm-pod {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--hm-rule);
}
.hm-pod b {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-pod span {
  font-size: 11px;
  color: var(--hm-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-head-kw {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.hm-head-kw > span {
  font-size: 11px;
  color: var(--hm-slate);
}
.hm-head-kw b {
  font: 600 22px/1 var(--hm-display);
  letter-spacing: -0.01em;
}
.hm-head-kw b u,
.hm-v u,
.hm-pc u {
  margin-left: 3px;
  font-family: var(--hm-face);
  font-size: 0.62em;
  font-weight: 500;
  text-decoration: none;
  color: var(--hm-slate);
}
.hm-head-kw.dead b {
  color: var(--hm-p1);
}
.hm-head-kw small {
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--hm-slate);
}
.hm-head-kw small i {
  width: 1px;
  height: 9px;
  background: var(--hm-line);
}
@container (max-width: 420px) {
  .hm-pod {
    display: none;
  }
  .hm-head {
    grid-template-columns: auto 1fr;
  }
}

/* --- section titles */
.hm-g > header,
.hm-alarms > header,
#timebase.trend .tr-side h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--hm-line);
}
.hm h3,
#timebase.trend .tr-side h3 {
  margin: 0;
  font: 600 12.5px var(--hm-face);
  color: var(--hm-ink);
}
.hm-doc {
  font-size: 11px;
  color: var(--hm-mist);
}
.hm-gs {
  margin-left: auto;
  font-size: 11px;
  color: var(--hm-slate);
  align-self: center;
}

/* --- alarms */
.hm-alarms {
  margin-top: 14px;
}
.hm-alarms ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hm-alarms li {
  display: grid;
  grid-template-columns: 14px auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--hm-rule);
  line-height: 1.35;
}
.hm-alarms li .hm-pr {
  align-self: start;
  margin-top: 1px;
}
.hm-alarms li b {
  font-weight: 600;
  white-space: nowrap;
}
.hm-alarms li span {
  color: var(--hm-slate);
}
.hm-alarms li.p1 b {
  color: var(--hm-p1);
}
.hm-quiet,
.hm-more {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--hm-slate);
}

/* --- groups */
.hm-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 28px;
  margin-top: 18px;
}
@container (min-width: 640px) {
  .hm-dock .hm-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (min-width: 960px) {
  .hm-dock .hm-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.hm-g {
  min-width: 0;
}

/* --- an indicator: label | scale | value | (sparkline) | flag */
.hm-ind,
.hm-st,
.hm-ld {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  /* flush with the panel's content edge, like every rule on the trend */
  padding: 2px 0;
  margin: 0;
  border-bottom: 1px solid var(--hm-rule);
}
/* The priority shape sits just LEFT of the value, so every value ends on
   the panel's content edge — the same right edge as the trend's numbers. */
.hm-ind {
  grid-template-columns: minmax(0, 1fr) 76px 14px 68px;
}
.hm-st {
  grid-template-columns: minmax(0, 1fr) 14px auto;
}
.hm-ind > .hm-f,
.hm-st > .hm-f {
  order: 1;
}
.hm-ind > .hm-v,
.hm-st > .hm-t {
  order: 2;
}
.hm-ld {
  grid-template-columns: minmax(0, 1fr) 64px 60px 34px;
}
.hm-l {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--hm-ink);
}
.hm-v,
.hm-t,
.hm-pc {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.hm-t {
  font-weight: 500;
}
.hm-pc {
  font-weight: 500;
  color: var(--hm-slate);
}
.hm-f {
  display: flex;
  justify-content: center;
}
.hm-spk {
  display: none;
}
.hm .ab.p1 {
  background: rgba(200, 16, 46, 0.055);
}
.hm .ab.p2 {
  background: rgba(232, 154, 0, 0.09);
}
.hm .ab.p1 .hm-v,
.hm .ab.p1 .hm-t {
  color: var(--hm-p1);
}

/* the scale: track, normal band, limits, pointer */
.hm-sc {
  position: relative;
  height: 6px;
  background: var(--hm-frost);
}
.hm-sc i {
  position: absolute;
  display: block;
}
.hm-nb {
  top: 0;
  bottom: 0;
  background: var(--hm-band);
}
.hm-fl {
  left: 0;
  top: 2px;
  height: 2px;
  background: var(--hm-mist);
}
.hm-tk {
  top: -3px;
  width: 1px;
  height: 12px;
}
.hm-tk.w {
  background: var(--hm-p2);
}
.hm-tk.a {
  background: var(--hm-p1);
}
.hm-pt {
  top: -4px;
  width: 3px;
  height: 14px;
  margin-left: -1.5px;
  background: var(--hm-blue);
  box-shadow: 0 0 0 1px var(--hm-snow);
}
.ab.p1 .hm-pt {
  background: var(--hm-p1);
}
.ab.p2 .hm-pt {
  background: var(--hm-p2-ink);
}
/* advisory (P3): outside its band with no alarm behind it — the grey
   circle and a slate pointer, no fill: advice, not an alarm */
.ab.p3 .hm-pt {
  background: var(--hm-slate);
}

/* where the power goes: plain shares, one tone */
.hm-lb {
  height: 6px;
  background: var(--hm-frost);
}
.hm-lb i {
  display: block;
  height: 100%;
  background: var(--hm-slate);
}

.hm-big {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--hm-rule);
}
.hm-big b {
  font: 600 20px/1.1 var(--hm-display);
}
.hm-big span {
  font-size: 11.5px;
  color: var(--hm-slate);
}

/* --- rack elevation */
.hm-racks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px 8px;
  margin-top: 8px;
}
.hm-rack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-rk {
  font-size: 11px;
  font-weight: 600;
  color: var(--hm-slate);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--hm-ink);
  margin-bottom: 1px;
}
.hm-slot {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 4px;
  background: var(--hm-frost);
  outline-offset: -1.5px;
}
.hm-slot.ab.p1 {
  outline: 1.5px solid var(--hm-p1);
}
.hm-slot.ab.p2 {
  outline: 1.5px solid var(--hm-p2);
}
.hm-slot.ab.p3 {
  outline: 1px dashed var(--hm-mist);
}
.hm-ab {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hm-ab i,
.hm-kab i {
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid var(--hm-slate);
  box-sizing: border-box;
}
.hm-ab i.on,
.hm-kab i.on {
  background: var(--hm-slate);
}
.hm-sl {
  height: 4px;
  background: var(--hm-snow);
}
.hm-sl i {
  display: block;
  height: 100%;
  background: var(--hm-slate);
}
.hm-sv {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
}
.hm-slot.off .hm-sv {
  color: var(--hm-mist);
  font-weight: 500;
}
.hm-slot.ab.p1 .hm-sv {
  color: var(--hm-p1);
}
.hm-key {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--hm-mist);
}
.hm-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hm-kab {
  display: inline-flex;
  gap: 2px;
}
.hm-kbar {
  display: inline-block;
  width: 14px;
  height: 4px;
  background: var(--hm-slate);
}
.hm-status em {
  font-style: normal;
}

/* --- maximised: the whole window is the display */
#terminal-state.maxed {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--hm-snow);
  overflow: hidden;
}
#terminal-state.maxed .state-header {
  flex: none;
  height: 52px;
  margin: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--hm-line);
  letter-spacing: 0;
}
#terminal-state.maxed .state-header > span {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 13px var(--hm-face);
  color: var(--hm-slate);
}
#terminal-state.maxed .state-header > span b {
  font-weight: 600;
  color: var(--hm-ink);
}
#terminal-state.maxed .state-header > span > span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-right: 10px;
  vertical-align: -2px;
  background: var(--hm-line);
}
#terminal-state.maxed #state-data {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 32px;
  font-size: 12.5px;
  scrollbar-width: none;
}
#terminal-state.maxed #state-data::-webkit-scrollbar {
  display: none;
}
.hm-full .hm-head {
  padding-bottom: 16px;
}
.hm-full .hm-status b {
  font-size: 20px;
}
.hm-full .hm-pod b {
  font-size: 14px;
}
.hm-full .hm-head-kw b {
  font-size: 34px;
}
.hm-full .hm-body {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 40px;
  margin-top: 22px;
}
.hm-full .hm-side {
  position: sticky;
  top: 0;
  align-self: start;
}
.hm-full .hm-alarms {
  margin-top: 0;
}
.hm-full .hm-side .hm-g {
  margin-top: 30px;
}
.hm-full .hm-groups {
  display: block;
  margin-top: 0;
  columns: 340px;
  column-gap: 40px;
}
.hm-full .hm-g {
  break-inside: avoid;
  margin-bottom: 26px;
}
.hm-full .hm-ind {
  grid-template-columns: minmax(0, 1fr) 96px 64px 14px 72px;
}
.hm-full .hm-ind > .hm-spk {
  order: 1;
}
.hm-full .hm-ind > .hm-f {
  order: 2;
}
.hm-full .hm-ind > .hm-v {
  order: 3;
}
.hm-full .hm-spk {
  display: block;
  width: 64px;
  height: 16px;
}
.hm-full span.hm-spk {
  display: block;
}
.hm-spk path {
  fill: none;
  stroke: var(--hm-slate);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.hm-full .hm-racks {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}
@media (max-width: 900px) {
  .hm-full .hm-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .hm-full .hm-side {
    position: static;
  }
}

/* --- the power path */
.hm-path {
  display: flex;
  align-items: stretch;
  margin-top: 20px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--hm-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.hm-path::-webkit-scrollbar {
  display: none;
}
.hm-pn {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 118px;
  padding: 9px 12px 10px;
  border: 1px solid var(--hm-line);
  border-top: 2px solid var(--hm-ink);
  background: var(--hm-snow);
}
.hm-pn-tag {
  font-size: 11px;
  color: var(--hm-slate);
  white-space: nowrap;
}
.hm-pn-v {
  font: 600 17px/1.2 var(--hm-display);
  white-space: nowrap;
}
.hm-pn-s {
  font-size: 11px;
  color: var(--hm-mist);
  white-space: nowrap;
}
.hm-pn.ab {
  padding-right: 30px;
}
.hm-pn-f {
  position: absolute;
  top: 7px;
  right: 8px;
}
.hm-pn-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
}
.hm-pn-row b {
  font-weight: 600;
}
.hm-pn-row span {
  font-weight: 600;
}
.hm-pn-row.dead span {
  color: var(--hm-mist);
}
.hm-pn.ab.p1 .hm-pn-row.dead span {
  color: var(--hm-p1);
}
.hm-pn.ab.p2 .hm-pn-row.dead span {
  color: var(--hm-p2-ink);
}
.hm-pn.dead {
  border-top-color: var(--hm-mist);
}
.hm-pn.dead .hm-pn-v {
  color: var(--hm-mist);
}
.hm-pn.ab.p1 {
  border-color: var(--hm-p1);
  border-top-color: var(--hm-p1);
  background: rgba(200, 16, 46, 0.04);
}
.hm-pn.ab.p2 {
  border-color: var(--hm-p2);
  border-top-color: var(--hm-p2);
  background: rgba(232, 154, 0, 0.06);
}
.hm-pn.ab.p1 .hm-pn-v {
  color: var(--hm-p1);
}
.hm-pl {
  position: relative;
  flex: 1 1 40px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hm-pl span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(50% + 5px);
  text-align: center;
  font-size: 10.5px;
  color: var(--hm-slate);
  white-space: nowrap;
}
.hm-pl i {
  position: relative;
  display: block;
  height: 0;
  margin-right: 6px;
  border-top: 1.5px solid var(--hm-ink);
}
.hm-pl i::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -5px;
  border: 4px solid transparent;
  border-left: 6px solid var(--hm-ink);
}
.hm-pl.heat i {
  border-top: 2px dotted var(--hm-slate);
}
.hm-pl.heat i::after {
  border-left-color: var(--hm-slate);
}
.hm-pl.dead i {
  border-top: 1.5px dashed var(--hm-line);
}
.hm-pl.dead i::after {
  border-left-color: var(--hm-line);
}
.hm-pl.dead span {
  color: var(--hm-mist);
}

.state-empty {
  font-family: var(--hm-face);
  font-size: 12px;
  line-height: 1.5;
  color: var(--hm-slate);
}

/* ================================================================ TREND */
#timebase.trend {
  width: 384px;
  padding: 12px 14px 12px;
  border-radius: 4px;
  border: 1px solid var(--hm-line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.04), 0 6px 16px rgba(23, 33, 43, 0.08);
  font-family: var(--hm-face);
  font-size: 12px;
  color: var(--hm-ink);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum", "zero";
}
#timebase.trend .tr-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
#timebase.trend .tr-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
}
#timebase.trend .tr-t-max {
  display: none;
}
#timebase.trend .tr-status {
  font-size: 11.5px;
}
#timebase.trend .tr-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#timebase.trend .tr-st b {
  font-weight: 600;
}
#timebase.trend .tr-st.p1 b {
  color: var(--hm-p1);
}
#timebase.trend .tr-st.p2 b {
  color: var(--hm-p2-ink);
}
#timebase.trend .tr-hbtns {
  display: flex;
  gap: 4px;
}
#timebase.trend .tr-now {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hm-ink);
}
#timebase.trend .tr-big {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#timebase.trend .tr-bl {
  font-size: 11px;
  color: var(--hm-slate);
}
#timebase.trend .tr-big b {
  font: 600 26px/1 var(--hm-display);
  letter-spacing: -0.01em;
}
#timebase.trend .tr-big b u {
  margin-left: 3px;
  font: 500 14px var(--hm-face);
  text-decoration: none;
  color: var(--hm-slate);
}
#timebase.trend .tr-big.dead b {
  color: var(--hm-p1);
}
#timebase.trend .tr-sub {
  display: flex;
  gap: 14px;
  margin: 0;
}
#timebase.trend .tr-sub div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
#timebase.trend .tr-sub dt {
  font-size: 11px;
  color: var(--hm-slate);
}
#timebase.trend .tr-sub dd {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}
#timebase.trend .tr-chart {
  display: block;
  width: 100%;
  height: 150px;
  background: var(--hm-snow);
  cursor: crosshair;
}
#timebase.trend .tr-tbox,
#timebase.trend .tr-cap,
#timebase.trend .tr-side {
  display: none;
}
#timebase.trend .tr-key {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  margin: 6px 0 2px;
  font-size: 11px;
  color: var(--hm-slate);
}
#timebase.trend .tr-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#timebase.trend .tr-sw {
  flex: none;
}
#timebase.trend .tr-controls {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hm-rule);
}
#timebase.trend .tr-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#timebase.trend .tr-row + .tr-row {
  margin-top: 7px;
}
#timebase.trend .tr-seg {
  display: inline-flex;
}
#timebase.trend .tr-seg .tr-btn + .tr-btn {
  margin-left: -1px;
}
#timebase.trend .tr-btn {
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border-radius: 0;
  border: 1px solid var(--hm-line);
  background: var(--hm-snow);
  color: var(--hm-ink);
  font: 500 11px var(--hm-face);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
#timebase.trend .tr-seg .tr-btn:first-child,
#timebase.trend .tr-play {
  border-radius: 3px 0 0 3px;
}
#timebase.trend .tr-seg .tr-btn:last-child {
  border-radius: 0 3px 3px 0;
}
#timebase.trend .tr-play {
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
}
#timebase.trend .tr-btn:hover {
  position: relative;
  border-color: var(--hm-ink);
}
#timebase.trend .tr-btn.on {
  position: relative;
  background: var(--hm-ink);
  border-color: var(--hm-ink);
  color: var(--hm-snow);
}
#timebase.trend .tr-lab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  color: var(--hm-slate);
}
#timebase.trend .tr-weather {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--hm-line);
  border-radius: 3px;
  background: var(--hm-snow);
  font: 500 11.5px var(--hm-face);
  color: var(--hm-ink);
}
#timebase.trend .tr-clock {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 11px;
  color: var(--hm-slate);
  white-space: nowrap;
}
#timebase.trend .tr-clock b {
  font-size: 12px;
  font-weight: 600;
  color: var(--hm-ink);
}

/* --- maximised: a full trend display */
#timebase.trend.maxed {
  position: fixed;
  inset: 0;
  width: auto;
  z-index: 950;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: 52px auto minmax(0, 1fr) auto;
  grid-template-areas:
    "head head"
    "now side"
    "charts side"
    "controls side";
  column-gap: 40px;
  padding: 0 28px 20px;
  border: 0;
  border-radius: 0;
  background: var(--hm-snow);
  box-shadow: none;
  font-size: 12.5px;
}
#timebase.trend.maxed .tr-head {
  grid-area: head;
  margin: 0 -28px;
  padding: 0 28px;
  border-bottom: 1px solid var(--hm-line);
}
#timebase.trend.maxed .tr-t-dock {
  display: none;
}
#timebase.trend.maxed .tr-t-max {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hm-slate);
}
#timebase.trend.maxed .tr-t-max b {
  font-weight: 600;
  color: var(--hm-ink);
}
#timebase.trend.maxed .tr-t-max > span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-right: 10px;
  vertical-align: -2px;
  background: var(--hm-line);
}
#timebase.trend.maxed .tr-status {
  font-size: 13px;
}
#timebase.trend.maxed .tr-min {
  display: none;
}
#timebase.trend.maxed .tr-now {
  grid-area: now;
  margin: 20px 0 0;
  padding-bottom: 16px;
}
#timebase.trend.maxed .tr-big b {
  font-size: 40px;
}
#timebase.trend.maxed .tr-big b u {
  font-size: 18px;
}
#timebase.trend.maxed .tr-sub {
  gap: 28px;
}
#timebase.trend.maxed .tr-sub dd {
  font-size: 15px;
}
#timebase.trend.maxed .tr-charts {
  grid-area: charts;
  display: grid;
  grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
  gap: 18px;
  min-height: 0;
  padding-top: 16px;
}
#timebase.trend.maxed .tr-chartbox {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#timebase.trend.maxed .tr-cap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
#timebase.trend.maxed .tr-cap b {
  font-weight: 600;
}
#timebase.trend.maxed .tr-cap span {
  font-size: 11.5px;
  color: var(--hm-mist);
}
#timebase.trend.maxed .tr-chart {
  flex: 1;
  height: auto;
  min-height: 0;
}
#timebase.trend.maxed .tr-key {
  display: none;
}
#timebase.trend.maxed .tr-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
  padding-top: 12px;
}
#timebase.trend.maxed .tr-controls .tr-row {
  margin: 0;
}
#timebase.trend.maxed .tr-controls .tr-row:last-child {
  flex: 1;
  max-width: 560px;
}
#timebase.trend.maxed .tr-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 0;
  padding: 20px 0 0 28px;
  border-left: 1px solid var(--hm-rule);
  overflow-y: auto;
  scrollbar-width: none;
}
#timebase.trend.maxed .tr-side::-webkit-scrollbar {
  display: none;
}
#timebase.trend .tr-tab {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
#timebase.trend .tr-tab caption {
  text-align: left;
  font-size: 11px;
  color: var(--hm-mist);
  padding-bottom: 2px;
}
#timebase.trend .tr-tab th,
#timebase.trend .tr-tab td {
  padding: 5px 0;
  border-bottom: 1px solid var(--hm-rule);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
#timebase.trend .tr-tab th {
  text-align: left;
  font-weight: 500;
}
#timebase.trend .tr-tab th .tr-sw {
  margin-right: 7px;
  vertical-align: 1px;
}
#timebase.trend .tr-tab tr:first-of-type td {
  padding-top: 0;
  font-size: 11px;
  color: var(--hm-slate);
  border-bottom-color: var(--hm-line);
}
#timebase.trend .tr-tab td:nth-child(2) {
  font-weight: 600;
}
#timebase.trend .tr-energy {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 0;
}
#timebase.trend .tr-energy dt {
  font-size: 11px;
  color: var(--hm-slate);
}
#timebase.trend .tr-energy dd {
  margin: 2px 0 0;
  font: 600 20px var(--hm-display);
}
#timebase.trend .tr-energy div:last-child {
  text-align: right;
}
#timebase.trend .tr-energy div:last-child dd {
  font: 600 14px var(--hm-face);
  margin-top: 7px;
}
#timebase.trend .tr-energy u {
  font: 500 12px var(--hm-face);
  text-decoration: none;
  color: var(--hm-slate);
}
#timebase.trend .tr-events {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
#timebase.trend .tr-events li {
  display: grid;
  grid-template-columns: 14px 52px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--hm-rule);
  font-size: 11.5px;
  line-height: 1.35;
}
#timebase.trend .tr-events li .hm-pr {
  align-self: start;
  margin-top: 1px;
}
#timebase.trend .tr-events time {
  color: var(--hm-slate);
}
#timebase.trend .tr-events .tr-none {
  display: block;
  color: var(--hm-slate);
}
@media (max-width: 1000px) {
  #timebase.trend.maxed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px auto minmax(360px, 1fr) auto auto;
    grid-template-areas: "head" "now" "charts" "controls" "side";
    overflow-y: auto;
  }
  #timebase.trend.maxed .tr-side {
    padding-left: 0;
    border-left: 0;
  }
}

body.trend-hidden #timebase {
  display: none;
}
#trend-tab {
  position: absolute;
  top: 58px;
  right: 0;
  z-index: 60;
  display: none;
  padding: 10px 8px;
  border: 1px solid var(--hm-line);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: var(--hm-snow);
  cursor: pointer;
  user-select: none;
}
body.trend-hidden #trend-tab {
  display: flex;
}
#trend-tab span {
  writing-mode: vertical-rl;
  font: 600 9px var(--hm-face);
  letter-spacing: 0.16em;
  color: var(--hm-slate);
}

/* --------------------------------------------------------------- missions */
#missions {
  position: absolute;
  top: 44px;
  left: 12px;
  z-index: 6;
  width: 300px;
  max-height: calc(100% - 120px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px 10px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(110, 130, 150, 0.28);
  box-shadow: 0 6px 18px rgba(20, 30, 40, 0.1);
  font: 11.5px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #24292e;
}
#missions::-webkit-scrollbar {
  display: none;
}
#missions .ms-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #57606a;
}
#missions .ms-head b {
  color: #1f2a35;
}
#missions .ms-cur {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: 0;
  color: #1a7f37;
  font-weight: 600;
}
#missions .ms-tog {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 12px;
  cursor: pointer;
  color: #57606a;
}
#missions .ms-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}
#missions .ms-item {
  text-align: left;
  border: 1px solid transparent;
  background: rgba(240, 244, 248, 0.9);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  cursor: pointer;
  color: #24292e;
}
#missions .ms-item:hover {
  border-color: rgba(26, 154, 224, 0.5);
  background: #fff;
}
#missions .ms-item.done {
  color: #1a7f37;
}
#missions .ms-hint {
  margin-top: 8px;
  font-size: 10.5px;
  color: #7d8b98;
}
#missions .ms-brief {
  margin: 8px 0;
  line-height: 1.45;
  color: #3b4855;
}
#missions .ms-goal {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  line-height: 1.35;
  color: #3b4855;
}
#missions .ms-goal i {
  font-style: normal;
  width: 14px;
  color: #8a97a3;
}
#missions .ms-goal em {
  font-style: normal;
  color: #b86206;
  font-weight: 700;
}
#missions .ms-goal.ok {
  color: #1a7f37;
}
#missions .ms-goal.ok i {
  color: #1a7f37;
  font-weight: 800;
}
#missions .ms-acts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
#missions .ms-acts button {
  border: 1px solid rgba(110, 130, 150, 0.34);
  background: #fff;
  border-radius: 6px;
  padding: 4px 9px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
#missions .ms-acts .ms-setup {
  background: #1f2a35;
  color: #fff;
  border-color: #1f2a35;
}
#missions .ms-acts .ms-next {
  background: #1a7f37;
  color: #fff;
  border-color: #1a7f37;
}
/* the HUD moves under the missions' top edge */
#hud {
  z-index: 7;
}

/* -------------------------------------------------------------- inspector */
.pod-inspector {
  position: fixed;
  z-index: 200;
  width: 320px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(110, 130, 150, 0.3);
  box-shadow: 0 12px 34px rgba(20, 30, 40, 0.22);
  font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #24292e;
}
.pod-inspector::-webkit-scrollbar {
  display: none;
}
.pod-inspector .ins-head {
  display: flex;
  gap: 6px;
}
.pod-inspector .ins-tag {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 2px 4px;
  font: 800 15px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #1f2a35;
  background: transparent;
}
.pod-inspector .ins-tag:hover,
.pod-inspector .ins-tag:focus {
  border-color: rgba(110, 130, 150, 0.4);
  background: #fff;
  outline: none;
}
.pod-inspector .ins-x {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #6a737d;
}
.pod-inspector .ins-name {
  margin: 0 4px 8px;
  color: #57606a;
  font-size: 11.5px;
}
.pod-inspector .ins-read {
  border-top: 1px solid #eef1f4;
  padding-top: 6px;
}
.pod-inspector .ins-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}
.pod-inspector .ins-row span {
  color: #6a737d;
}
.pod-inspector .ins-row b {
  text-align: right;
  font: 700 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pod-inspector .ins-row b.hot {
  color: #c62f3b;
}
.pod-inspector .ins-row b.warn {
  color: #b86206;
}
.pod-inspector .ins-row b.good {
  color: #1a7f37;
}
.pod-inspector .ins-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}
.pod-inspector .ins-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #f1f3f5;
  font: 600 10.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #57606a;
}
.pod-inspector .ins-pin i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4cdd6;
}
.pod-inspector .ins-pin.on i {
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
}
.pod-inspector .ins-pin em {
  font-style: normal;
  font-weight: 500;
  color: #8a97a3;
}
.pod-inspector .ins-fields {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid #eef1f4;
}
.pod-inspector .ins-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pod-inspector .ins-field span {
  color: #3b4855;
}
.pod-inspector .ins-field em {
  font-style: normal;
  color: #8a97a3;
}
.pod-inspector .ins-field input,
.pod-inspector .ins-field select {
  width: 120px;
  height: 24px;
  border: 1px solid rgba(110, 130, 150, 0.4);
  border-radius: 5px;
  padding: 0 6px;
  font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
}
.pod-inspector .ins-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid #eef1f4;
}
.pod-inspector .ins-acts button {
  border: 1px solid rgba(110, 130, 150, 0.34);
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.pod-inspector .ins-acts button:hover {
  border-color: #1a9ae0;
  color: #0b6aa0;
}
.pod-inspector .ins-info {
  padding-top: 8px;
  border-top: 1px solid #eef1f4;
  line-height: 1.5;
  color: #57606a;
  font-size: 11.5px;
}

.pod-inspector .ins-manual {
  margin-top: 8px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: #0b6aa0;
  cursor: pointer;
}
.pod-inspector .ins-manual:hover {
  text-decoration: underline;
}

/* the pod field manual: show-on-board and mission links */
.wiki-onboard {
  margin: 4px 0 14px;
}
.wiki-showkind {
  border: 1px solid #1a9ae0;
  background: #eef8fe;
  color: #0b6aa0;
  border-radius: 6px;
  padding: 6px 12px;
  font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.wiki-showkind:hover {
  background: #1a9ae0;
  color: #fff;
}
.wiki-link.wiki-show::before {
  content: "◎ ";
  font-size: 0.85em;
}
.wiki-link.wiki-mission::before {
  content: "▶ ";
  font-size: 0.8em;
}

/* the toolbox gets more sections than it used to */
.inv-section {
  white-space: nowrap;
}

/* phones: the read-only viewer keeps the trend, drops the missions */
.phone #missions {
  display: none;
}
body.studio #missions {
  display: none;
}

/* assembly slots carry the pod's own badge */
.slot.assembly-slot::after {
  content: "KIT";
}

/* the pod switcher in the toolbar */
.tool-select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231f2a35'/%3E%3C/svg%3E") no-repeat right 11px center;
  -webkit-appearance: none;
  appearance: none;
  font-size: 13px;
  font-family: "Courier New", monospace;
  font-weight: 700;
  color: #24292e;
  cursor: pointer;
}
.tool-select:hover {
  border-color: #1a9ae0;
}
body.studio .tool-select {
  display: none;
}

/* =========================================================================
   SNOW AGENT POPOVER (pod/advice.js) — opens only when a priority shape is
   hovered or focused, or a label cut short by its column. One card, the
   same tokens as the displays: priority on the top edge, what happened,
   what to do, the live context, and a way to the part on the board.
   ========================================================================= */
.hm-adv {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  margin: -3px;
  border-radius: 2px;
  cursor: help;
}
.hm-adv:hover,
.hm-adv[aria-describedby] {
  background: var(--hm-frost);
}
.hm-slot[data-adv] {
  cursor: help;
}
#adv-pop {
  position: fixed;
  z-index: 1000;
  width: 320px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px 10px;
  border: 1px solid var(--hm-line);
  border-top: 2px solid var(--hm-ink);
  border-radius: 3px;
  background: var(--hm-snow);
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.06), 0 10px 28px rgba(23, 33, 43, 0.13);
  font: 400 12px/1.45 var(--hm-face);
  color: var(--hm-ink);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
}
#adv-pop[hidden] {
  display: none;
}
#adv-pop.in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 150ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
#adv-pop.out {
  opacity: 0;
  transition: opacity 100ms ease-in;
}
#adv-pop[data-side="r"]:not(.in) {
  transform: translateX(-4px);
}
#adv-pop[data-side="l"]:not(.in) {
  transform: translateX(4px);
}
#adv-pop[data-side="t"]:not(.in) {
  transform: translateY(4px);
}
#adv-pop[data-side="b"]:not(.in) {
  transform: translateY(-4px);
}
#adv-pop.still {
  transform: none !important;
}
#adv-pop[data-p="1"] {
  border-top-color: var(--hm-p1);
}
#adv-pop[data-p="2"] {
  border-top-color: var(--hm-p2);
}
#adv-pop .adv-k {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--hm-slate);
}
#adv-pop h4 {
  margin: 6px 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
#adv-pop p {
  margin: 0 0 8px;
  color: var(--hm-slate);
}
#adv-pop .adv-do {
  margin: 0 0 8px;
}
#adv-pop .adv-do b {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hm-slate);
}
#adv-pop ol {
  margin: 0;
  padding-left: 17px;
}
#adv-pop ol li {
  margin: 2px 0;
}
#adv-pop ol li::marker {
  color: var(--hm-mist);
  font-weight: 600;
}
#adv-pop .adv-ctx {
  padding-left: 8px;
  border-left: 2px solid var(--hm-band);
  font-size: 11.5px;
  color: var(--hm-ink);
}
#adv-pop .adv-list {
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}
#adv-pop .adv-list li {
  display: grid;
  grid-template-columns: 14px auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  padding: 4px 0;
  border-top: 1px solid var(--hm-rule);
  font-size: 11.5px;
}
#adv-pop .adv-list .hm-pr {
  align-self: start;
  margin-top: 1px;
}
#adv-pop .adv-list b {
  font-weight: 600;
  white-space: nowrap;
}
#adv-pop .adv-list span {
  color: var(--hm-slate);
}
#adv-pop .adv-f {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--hm-rule);
}
#adv-pop .adv-agent {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--hm-mist);
}
#adv-pop .adv-agent i {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--hm-blue);
}
#adv-pop button {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--hm-line);
  border-radius: 3px;
  background: var(--hm-snow);
  font: 500 11px var(--hm-face);
  color: var(--hm-ink);
  cursor: pointer;
  white-space: nowrap;
}
#adv-pop button:hover {
  border-color: var(--hm-ink);
}
#adv-pop button:focus-visible {
  outline: 2px solid var(--hm-blue);
  outline-offset: 1px;
}
/* a label cut short: just the words */
#adv-pop.tip {
  width: auto;
  max-width: 360px;
  padding: 6px 9px;
  border-top-width: 1px;
}
#adv-pop .adv-tip {
  margin: 0;
  color: var(--hm-ink);
}
@media (prefers-reduced-motion: reduce) {
  #adv-pop,
  #adv-pop.in,
  #adv-pop.out {
    transform: none !important;
    transition: none;
  }
}

/* -------------------------------------------------- narrow screens / phones
   A phone has no room for the docked trend over the board, so the trend is
   one tap away instead: the kW TREND tab stays on the right edge, and a tap
   opens the trend full screen (pod/trend.js). Restore puts the tab back. */
@media (max-width: 720px) {
  body.read-only #timebase.trend:not(.maxed) {
    display: none !important;
  }
  body.read-only #trend-tab {
    display: flex !important;
    top: 12px;
  }
}
.phone #timebase.trend:not(.maxed) {
  display: none !important;
}
.phone #timebase.trend.maxed {
  display: grid !important;
}
.phone #trend-tab {
  display: flex !important;
  top: 12px;
}
body.trend-maxed #trend-tab {
  display: none !important;
}
/* the maximised trend on a phone-width screen */
@media (max-width: 600px) {
  #timebase.trend.maxed {
    padding: 0 16px 16px;
    column-gap: 0;
  }
  #timebase.trend.maxed .tr-head {
    margin: 0 -16px;
    padding: 0 16px;
  }
  #timebase.trend.maxed .tr-t-max b {
    display: none;
  }
  #timebase.trend.maxed .tr-t-max > span {
    white-space: nowrap;
  }
  #timebase.trend.maxed .tr-t-max > span::before {
    display: none;
  }
  #timebase.trend.maxed .tr-now {
    flex-wrap: wrap;
  }
  #timebase.trend.maxed .tr-sub {
    flex-wrap: wrap;
    gap: 10px 18px;
  }
  #timebase.trend.maxed .tr-controls {
    flex-wrap: wrap;
    gap: 10px;
  }
  #timebase.trend.maxed .tr-controls .tr-row:last-child {
    flex-basis: 100%;
  }
  #timebase.trend .tr-btn {
    white-space: nowrap;
  }
}
