/* bs-custom — layout, fonts and the content no component shows (kit/COMPONENTS.md, "The
   sheet of the app"). Every control is a class of /ui.css; every colour is a variable of
   /tokens.css. Own classes carry the prefix bsc- (service), pm- (plant monitoring) or rc- (reconcile). */

/* Inter 4.001, shipped in the image (fonts/inter, SIL Open Font License 1.1). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter/Inter-Bold.woff2") format("woff2"); }

html { color-scheme: light; }
html.dark { color-scheme: dark; }

body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  font-variant-numeric: tabular-nums;
}

.bsc-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
  width: 100%;
  /* The whole width of the frame (feedback 21.11.2026): no cap. Forms and running text keep
     their own widths (--form-max-width, --prose-max-width). */
  padding: 1.5rem;
}
#view { display: contents; }
.bsc-stack { display: flex; flex-direction: column; gap: 1.5rem; }

@media (max-width: 48rem) {
  .bsc-page { padding: 1rem; }
}

/* ── plant-monitor: layout ─────────────────────────────────────────────────────────────── */
/* Cards side by side take the same height (feedback 21.11.2026). */
.pm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
.pm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.pm-grid-2 > *, .pm-grid-3 > * { height: 100%; box-sizing: border-box; }
.pm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.pm-pager__buttons { display: flex; gap: 0.5rem; }
.pm-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.pm-toolbar__field { flex: 1 1 14rem; max-width: 22rem; }
.pm-toolbar__select { min-width: 11rem; }
.pm-viewswitch { display: flex; gap: 0.5rem; }
.pm-row-status { min-width: 10.5rem; }
.pm-more { display: flex; justify-content: center; padding: 0.75rem; }
.pm-back { font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none; align-self: flex-start; }
.pm-back:hover { color: var(--foreground); }
.pm-cell-main { display: flex; flex-direction: column; }
.pm-cell-main a { color: var(--foreground); font-weight: 600; text-decoration: none; }
.pm-cell-main a:hover { text-decoration: underline; }
.pm-cell-sub { font-size: 0.8125rem; color: var(--muted-foreground); }
.pm-nowrap { white-space: nowrap; }
.pm-muted { color: var(--muted-foreground); }
.pm-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1rem; margin: 0; font-size: 0.875rem; }
.pm-dl dt { color: var(--muted-foreground); }
.pm-dl dd { margin: 0; }
.pm-toast {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); font-size: 0.875rem;
}
.pm-toast svg { width: 1rem; height: 1rem; flex: none; color: var(--status-ok-ink); }
.pm-bar { height: 0.875rem; }
.pm-w45 { width: 45%; } .pm-w50 { width: 50%; } .pm-w55 { width: 55%; } .pm-w60 { width: 60%; }
.pm-w65 { width: 65%; } .pm-w70 { width: 70%; } .pm-w80 { width: 80%; }

/* ── plant-monitor: log ────────────────────────────────────────────────────────────────── */
.pm-history { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.pm-history li {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.75rem; font-size: 0.875rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.pm-history li:last-child { border-bottom: 0; padding-bottom: 0; }
.pm-history time { color: var(--muted-foreground); }
.pm-history__body { display: flex; flex-direction: column; gap: 0.25rem; }
.pm-log__form { display: flex; flex-direction: column; gap: 0.5rem; max-width: var(--form-max-width); }
.pm-log__ref { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.pm-log__ref svg { width: 0.875rem; height: 0.875rem; }
.pm-log__text { white-space: pre-wrap; }

/* ── plant-monitor: map (Leaflet) ──────────────────────────────────────────────────────── */
.pm-map { display: flex; flex-direction: column; gap: 0.75rem; }
.pm-map__canvas {
  width: 100%; height: 30rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--muted); overflow: hidden;
}
.pm-map__canvas--tall { height: 36rem; }
.pm-map__skeleton { width: 100%; height: 30rem; }
.pm-map__canvas .leaflet-container { font-family: inherit; background: var(--muted); }
/* The tiles in grey, so the states of the plants stand out; inverted in the dark theme. */
.pm-map__canvas .leaflet-tile-pane { filter: grayscale(1) contrast(0.92) brightness(1.03); }
html.dark .pm-map__canvas .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(0.85) brightness(0.9); }
.pm-map__legend { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pm-map__pick { min-height: 4.5rem; }
.pm-pick-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.pm-pick-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pm-icon { background: none; border: 0; }
.pm-icon svg { display: block; overflow: visible; }
.pm-legend-key { width: 0.75rem; height: 0.75rem; flex: none; }
.pm-marker__shape { stroke: var(--background); stroke-width: 1.5; }
.pm-marker--ok .pm-marker__shape { fill: var(--status-ok); }
.pm-marker--degraded .pm-marker__shape { fill: var(--status-warn); }
.pm-marker--down .pm-marker__shape { fill: var(--status-error); }
.pm-marker--no_data .pm-marker__shape { fill: var(--background); stroke: var(--muted-foreground); stroke-width: 2; }
.pm-icon--picked .pm-marker__shape { stroke: var(--foreground); stroke-width: 3; }
.pm-icon--hq .pm-marker__shape { fill: var(--background); stroke: var(--foreground); stroke-width: 2; }

/* ── plant-monitor: yield chart ────────────────────────────────────────────────────────── */
.pm-chart { margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
/* Only the chart itself takes the width; the keys of the legend keep their size. */
.pm-chart__plot { display: block; width: 100%; height: auto; max-height: 26rem; }
.pm-chart__grid { stroke: var(--border); stroke-width: 1; }
.pm-chart__axis { fill: var(--muted-foreground); font-size: 13px; }
.pm-chart__bar { fill: var(--chart-2); }
.pm-chart__bar--low { fill: var(--status-warn); }
.pm-chart__bar--none { fill: none; stroke: var(--muted-foreground); stroke-dasharray: 2 2; }
.pm-chart__target { fill: none; stroke: var(--foreground); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pm-chart__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--foreground); }
.pm-chart__legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.pm-chart__key { display: block; flex: none; width: 1.5rem; height: 0.875rem; }

/* ── narrow screens: technicians on the road ───────────────────────────────────────────── */
@media (max-width: 64rem) {
  .pm-grid-2, .pm-grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  .pm-toolbar__field { max-width: none; }
  .pm-history li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pm-hide-sm { display: none; }
  .pm-map__canvas, .pm-map__canvas--tall, .pm-map__skeleton { height: 24rem; }
}
.pm-gap { margin-left: 0.75rem; }
.pm-small { font-size: 0.8125rem; margin: 0; }

/* ── reconcile: layout ─────────────────────────────────────────────────────────────────── */
.rc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
.rc-stack { display: flex; flex-direction: column; gap: 1rem; }
.rc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.rc-muted { color: var(--muted-foreground); }
.rc-small { font-size: 0.8125rem; }
.rc-nowrap { white-space: nowrap; }
.rc-text { min-width: 16rem; }
.rc-back { font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none; align-self: flex-start; }
.rc-back:hover { color: var(--foreground); }
.rc-skel { display: flex; flex-direction: column; gap: 0.5rem; }
.rc-bar { height: 0.875rem; }
.rc-w40 { width: 40%; } .rc-w55 { width: 55%; } .rc-w70 { width: 70%; }

/* The whole card of a file takes a dropped file. */
.rc-drop { height: 100%; }
.rc-drop[data-over="true"] { outline: 2px dashed var(--tenant-accent); outline-offset: 2px; }
.rc-file { width: 100%; }
/* The drop zone of a file: icon, text and button in the middle (feedback 21.11.2026). */
.rc-zone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 9rem; padding: 1.25rem; box-sizing: border-box; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--muted);
}
.rc-zone:focus-within { outline: var(--focus-width, 2px) solid var(--focus); outline-offset: var(--focus-offset, 2px); }
.rc-drop[data-over="true"] .rc-zone { border-color: var(--tenant-accent); }
.rc-zone--done { border-style: solid; background: var(--card); }
.rc-zone--error { border-color: var(--status-error-edge, var(--status-error)); }
.rc-zone__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.rc-zone__icon { display: inline-flex; color: var(--muted-foreground); }
.rc-zone__icon svg { width: 1.75rem; height: 1.75rem; }
.rc-zone--done .rc-zone__icon { color: var(--status-ok-ink); }
.rc-zone__text { font-weight: 600; font-size: 0.9375rem; }
.rc-zone__or { font-size: 0.8125rem; color: var(--muted-foreground); }
.rc-zone__name { font-weight: 600; overflow-wrap: anywhere; }
.rc-zone__button { cursor: pointer; }
.rc-check { width: 1rem; height: 1rem; margin: 0; accent-color: var(--tenant-accent); }
.rc-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 1rem; margin: 0; font-size: 0.875rem; }
.rc-dl dt { color: var(--muted-foreground); }
.rc-dl dd { margin: 0; overflow-wrap: anywhere; }

/* The result: toolbar, sortable heads, differences, groups, pages, sums. */
.rc-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.rc-toolbar__field { flex: 1 1 14rem; max-width: 22rem; }
.rc-toolbar__select { min-width: 12rem; }
.rc-sort { margin-inline: -0.5rem; }
.rc-table { max-height: 70vh; }
.rc-cell--diff { border-left: 3px solid var(--status-warn); }
.rc-diff { display: flex; flex-direction: column; gap: 0.125rem; white-space: nowrap; }
.rc-diff__a { color: var(--muted-foreground); }
.rc-diff__b { font-weight: 600; }
.rc-side { font-size: 0.75rem; color: var(--muted-foreground); }
.rc-group > tr:first-child > td { border-top: 2px solid var(--border); }
.rc-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.875rem; }
.rc-pager__buttons { display: flex; gap: 0.5rem; }
.rc-sums { display: grid; grid-template-columns: max-content max-content; gap: 0.25rem 1.5rem; margin: 0; font-size: 0.875rem; }
.rc-sums dt { color: var(--muted-foreground); }
.rc-sums dd { margin: 0; text-align: right; }
.rc-sums__total { font-weight: 600; }

@media (max-width: 64rem) {
  .rc-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  .rc-toolbar__field { max-width: none; }
}

/* ── service-report (pages-service.js, YouTrack BS-41) ─────────────────────────────────────
   Layout only; every colour is a variable of the instance. Mobile and desktop alike (E7). */
.sr-muted { color: var(--muted-foreground); }
.sr-small { font-size: 0.8125rem; }
.sr-show-sm { display: none; }
.sr-skel { display: flex; flex-direction: column; gap: 0.5rem; }
.sr-bar { height: 0.875rem; }
.sr-w40 { width: 40%; }
.sr-w55 { width: 55%; }
.sr-w70 { width: 70%; }
.sr-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.sr-toolbar__field { flex: 1 1 14rem; max-width: 24rem; }
.sr-toolbar__select { flex: 0 1 12rem; }
.sr-report-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
.sr-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1.25rem; margin: 0; font-size: 0.875rem; }
.sr-dl dt { color: var(--muted-foreground); }
.sr-dl dd { margin: 0; overflow-wrap: anywhere; }
.sr-list { margin: 0; padding-left: 1.25rem; }
.sr-list li + li { margin-top: 0.25rem; }
.sr-recorder { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding-block: 1rem; text-align: center; }
.sr-time { margin: 0; font-size: 2.5rem; font-weight: 700; letter-spacing: 0.02em; }
.sr-level { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 3rem; width: 100%; max-width: 20rem; }
.sr-level__bar { flex: 1 1 0; min-height: 3px; border-radius: 2px; background: var(--foreground); }
.sr-level__bar--idle { background: var(--border); }
.sr-record-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.sr-audio { width: 100%; max-width: 24rem; }
.sr-hint-list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; color: var(--muted-foreground); }
.sr-steps { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.sr-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.sr-form-grid > .sr-span-2 { grid-column: 1 / -1; }
.sr-span-all { grid-column: 1 / -1; margin: 0; }
.sr-items { display: flex; flex-direction: column; gap: 0.5rem; }
.sr-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; }
.sr-item--2 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) auto; }
.sr-item--1 { grid-template-columns: minmax(0, 1fr) auto; }
.sr-flag { border-left: 3px solid var(--status-warn); padding-left: 0.5rem; }
.sr-radios { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.sr-radio { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; }
.sr-radio input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--tenant-accent); }
.sr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.sr-transcript { margin: 0; white-space: pre-wrap; font-size: 0.875rem; }
.sr-details > summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; }
.sr-details[open] > summary { margin-bottom: 0.75rem; }
.sr-history { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.sr-history li { display: flex; flex-direction: column; gap: 0.125rem; padding-left: 0.75rem; border-left: 2px solid var(--border); }
.sr-history__who { font-weight: 600; }
.sr-changes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.125rem; margin: 0.5rem 0 0; font-size: 0.8125rem; }
.sr-changes dt { font-weight: 600; margin-top: 0.375rem; }
.sr-changes dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 64rem) {
  .sr-report-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  .sr-show-sm { display: inline; }
  .sr-toolbar__field, .sr-toolbar__select { flex: 1 1 100%; max-width: none; }
  .sr-form-grid { grid-template-columns: minmax(0, 1fr); }
  .sr-item, .sr-item--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sr-item > :first-child { grid-column: 1 / -1; }
  .sr-dl { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
  .sr-dl dd + dt { margin-top: 0.75rem; }
}
