/* Списки дизайн-системи «Karte» (docs/15-design.md): групи фоном, а не
   рамками; чипи-фільтри; рядок з точкою стану. Компоненти ядра — модуль
   лише ставить клас. */

/* Група: заокруглений блок на --card, рядки розділяє тонка лінія. */
.group { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.group > li + li { box-shadow: inset 0 1px 0 var(--line); }

/* Чипи-фільтри. Вибраний — світлий: це не дія, а те, що зараз показано. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--fill); color: var(--muted);
  font: 500 13px var(--sans); cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip .n { font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--bg); }

/* Рядок списку: точка стану, назва (600), час праворуч; під ними місце
   (--muted) і, якщо є, рядок дії (--action: хто їде). */
.entry { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; column-gap: 11px; row-gap: 2px;
  align-items: baseline; width: 100%; padding: 11px 14px; text-align: left;
  background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.entry:hover { background: var(--fill); }
.entry.sel { background: var(--action-soft); }
.entry > .dot { grid-row: 1; width: 8px; height: 8px; border-radius: 50%; background: var(--off); align-self: center; }
.entry > .dot.crit { background: var(--crit); }
.entry > .dot.warn { background: var(--warn); }
.entry > .dot.ok   { background: var(--ok); }
.entry > .t { grid-column: 2; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry > time { grid-column: 3; grid-row: 1; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry > .s, .entry > .a { grid-column: 2 / 4; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry > .s { color: var(--muted); }
.entry > .a { color: var(--action); }

/* Verlauf: закрита заявка — тонкий рядок «що · хто», час праворуч. */
.entry.thin { align-items: center; padding: 7px 14px; }
.entry.thin > .dot { width: 6px; height: 6px; }
.entry.thin > .t { font-size: 13px; font-weight: 400; color: var(--muted); }
.entry.thin > .t b { font-weight: 500; color: var(--ink); }
.sidecol-body + .sidecol-body:not(:empty) { margin-top: 14px; }
.sidecol-body > .grp-label { margin: 0 0 6px; }

/* Група «ключ — значення» (картка заявки): ті самі .kv, але на --card. */
.kvs { background: var(--card); border-radius: 12px; padding: 0 16px; }
.kvs .kv { padding: 13px 0; font-size: 15px; }
.kvs .kv > b { font-weight: 400; }
.kvs .kv > b.dim { color: var(--muted); }
/* Рядок-посилання окремою групою: іконка й текст кольору дії. */
.linkrow { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--card); color: var(--action); text-decoration: none; font-size: 15px; font-weight: 500; }
.linkrow .ico { width: 20px; height: 20px; }
/* Стос груп у картці: проміжок між блоками, підпис групи ближче до своєї групи. */
.vstack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vstack > .grp-label { margin: 6px 0 -6px; }
/* Вибір символу (core/icon-picker.js): поточний і сітка по 44 px. */
.icon-pick { display: flex; flex-direction: column; gap: 10px; }
.icon-pick-now { display: inline-flex; align-items: center; gap: 10px; flex: 1; color: var(--muted); font-size: 14px; }
.icon-pick-now .ico { width: 40px; height: 40px; padding: 9px; border-radius: var(--r); background: var(--fill); color: var(--action); }
.icon-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick-grid[hidden] { display: none; }
.icon-pick-cell { height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink); cursor: pointer; }
.icon-pick-cell .ico { width: 22px; height: 22px; }
.icon-pick-cell:hover { border-color: var(--line-str); }
.icon-pick-cell.on { border-color: var(--action); background: var(--action-soft); color: var(--action); }
/* Підпис над групою: тихий, без великих літер. */
.grp-label { margin-bottom: -8px; padding: 0 4px; font-size: 11.5px; font-weight: 600; color: var(--dim); }

/* Поле пошуку з іконкою (журнал заходу). На огляді пошуку немає. */
.searchbox { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--fill); }
.searchbox:focus-within { box-shadow: 0 0 0 2px var(--action); }
.searchbox .ico { width: 18px; height: 18px; flex: none; color: var(--muted); }
.searchbox input { flex: 1; min-width: 0; min-height: 42px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 15px; }
.searchbox input:focus { outline: none; }

/* Рядок заявки з окремим значком «на плані» праворуч: рядок відкриває
   заявку, значок — показує її мітку на плані. */
.entry-li { display: flex; align-items: stretch; }
.entry-li > .entry { flex: 1; min-width: 0; }
.entry-go { flex: none; width: 46px; display: grid; place-items: center; padding: 0; border: 0;
  background: none; color: var(--muted); cursor: pointer; box-shadow: inset 1px 0 0 var(--line); }
.entry-go:hover, .entry-go:focus-visible { color: var(--action); background: var(--fill); outline: none; }
.entry-go .ico { width: 19px; height: 19px; }

/* Попередження в колонці огляду (шлюз мовчить): заокруглене, як групи. */
.sidecol-box .banner { border-radius: 10px; font-weight: 500; }
.sidecol-box .banner + .banner { margin-top: 6px; }
/* Коробка попередження не стискається колонкою (інакше налазить на заявки). */
.sidecol-box.alertbox { flex: none; padding-bottom: 6px; }

/* Рядок «назва — значення — копіювати» (картка шлюзу): значення моно, з
   переносом, кнопка копіювання праворуч. */
.copyrow { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr) 36px; align-items: center;
  gap: 10px; padding: 9px 0; font-size: 13.5px; }
.copyrow + .copyrow { box-shadow: inset 0 1px 0 var(--line); }
.copyrow .k { color: var(--muted); }
.copyrow .v { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.copyrow .icon-btn .ico { width: 17px; height: 17px; }
/* Приклад листа: моноширинне поле на --fill. */
textarea.codebox { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 12.5px; line-height: 1.45;
  background: var(--fill); border: 0; border-radius: 10px; padding: 10px 12px; }
/* Останній лист від роутера: те саме поле, лише для читання. */
pre.codebox { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.45;
  background: var(--fill); border-radius: 10px; padding: 10px 12px; }
.gwout:empty { display: none; }
/* Поля всередині групи (схема листа, пороги). */
.kvs.pad-form { padding: 12px 16px 2px; }
.sheet.gwcard .body, .sheet.stack .body { display: flex; flex-direction: column; gap: 12px; }
.sheet.gwcard .grp-label, .sheet.stack .grp-label { margin: 10px 0 -4px; }
.sheet.gwcard .grp-label:first-child, .sheet.stack .grp-label:first-child { margin-top: 0; }
/* Галочка «Einrichtung» на картці шлюзу: точка стану й підпис (ADR 0031). */
.kv .tick { display: inline-flex; align-items: center; gap: 8px; }
/* «Erweitert»: згорнута група — рідше потрібне, але не сховане. */
details.more > summary { cursor: pointer; list-style: none; padding: 6px 4px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '›'; display: inline-block; width: 14px; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
.more-body { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
/* Майстер роутера (ADR 0034): крок — номер у кружку на --fill, шлях меню
   роутера 14/600 і пояснення --muted; під кроком група значень (.kvs з
   .copyrow) і пастки жовтою смугою, заокругленою, як групи. */
.wiz-step { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.wiz-step .main { flex: 1; min-width: 0; }
.wiz-step .t { font-size: 14px; font-weight: 600; }
.wiz-step .s { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.wiz-n { flex: none; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  background: var(--fill); color: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wiz .banner { border-radius: 10px; font-weight: 500; }
.wiz a { color: var(--action); }
/* Перелік-довідник (види заявок, види точок): як налаштування iOS/macOS.
   Роздільник — волосина лише між рядками, з відступом до початку тексту.
   Рядок — уся кнопка: точка важливості, назва, тихий другий рядок,
   значення праворуч і шеврон. Додати — останній тихий рядок групи. */
.glist { --sep: 16px; list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.glist.dots { --sep: 36px; }
.glist > li { position: relative; }
.glist > li + li::before { content: ''; position: absolute; top: 0; left: var(--sep); right: 0; height: 1px; background: var(--line); pointer-events: none; }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 14px 10px 16px;
  background: none; border: 0; border-radius: 0; color: var(--ink); font: inherit; font-size: 15px; text-align: left; }
button.lrow { cursor: pointer; }
button.lrow:hover, button.lrow:focus-visible { background: var(--fill); outline: none; }
.lrow > .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; color: var(--off); }
.lrow > .dot.crit { color: var(--crit); }
.lrow > .dot.warn { color: var(--warn); }
.lrow .main { flex: 1; min-width: 0; }
.lrow .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow > .v { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow > .chev { flex: none; width: 16px; height: 16px; margin-left: -4px; color: var(--dim); }
.lrow.add { color: var(--action); }
.lrow.add > .ico { flex: none; width: 18px; height: 18px; }
.glist.dots .lrow.add > .ico { margin: 0 -5px 0 -5px; }
/* Друга сходинка в аркуші виду: підпис і група під полями. */
.sheet .glist { margin-top: 6px; }
.sheet .grp-label.mt { margin-top: var(--gap); }

/* «Мої точки» (docs/15-design.md, ADR 0039). Знак — зірочка: заповнена
   кольору --mine — своє, контур --dim — ні. */
.ico.mine { color: var(--mine); }
.ico.mine svg, .lrow.pick.on > .star svg { fill: currentColor; }
/* «Zuständig für» на аркуші учасника: рядки-перемикачі. */
.assign { margin-top: 6px; }
.assign > .grp-label { margin-bottom: 8px; }
.assign > div { display: flex; flex-direction: column; gap: 10px; }
.assign .glist { margin-top: 0; }
.assign .note { margin: 0; }
.lrow > .star { flex: none; width: 20px; height: 20px; color: var(--dim); }
.lrow.pick.on > .star { color: var(--mine); }
.lrow.pick:disabled { cursor: default; }
.lrow.pick:disabled:hover { background: none; }
.lrow.pick.via > .star { opacity: .55; }
.lrow.pick.busy > .star { opacity: .35; }

/* ─── Live-Werte: картки, як у Trello (docs/15-design.md «Live-Werte») ───
   Сітка карток на --card; уся картка — кнопка; згори мітка стану. */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tcards.sm { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px;
  background: var(--card); border: 0; border-radius: 12px; color: var(--ink); font: inherit;
  text-align: left; cursor: pointer; box-shadow: var(--edge, none);
  transition: transform .15s ease, box-shadow .15s ease; }
.tcard:hover, .tcard:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-sm); outline: none; }
.tlabel { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; font-weight: 600;
  color: var(--off); min-width: 0; }
.tlabel > i { flex: none; width: 36px; height: 6px; border-radius: 3px; background: currentColor; }
.tlabel > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlabel.ok { color: var(--ok); } .tlabel.warn { color: var(--warn); } .tlabel.crit { color: var(--crit); }
.tcard .tt { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .tt .pill { font-family: var(--sans); font-weight: 500; }
.tcard .tc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 10px 0 2px; }
.tstats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tstats b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tstats span { font-size: 12px; color: var(--muted); }
.tfoot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 10px;
  font-size: 12px; color: var(--muted); }
.tfoot > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Плитка приладу: смужка стану ліворуч, велике значення, графік. */
.tcard.dev { padding: 12px 14px; border-left: 4px solid var(--off); }
.tcard.dev.ok { border-left-color: var(--ok); }
.tcard.dev .tlabel { margin-bottom: 2px; }
.tcard.dev .tlabel > i { width: 22px; height: 5px; }
.tcard .tv { margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tcard .tv small { margin-left: 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tcard.dev.off .tv { color: var(--dim); }
.tcard .tspark { margin-top: 6px; }
.tcard .tspark svg { display: block; width: 100%; height: 30px; }
.tcard .tspark svg * { vector-effect: non-scaling-stroke; }

/* ─── Live-Werte → «Eingang»: консоль (Terminal на Mac / PowerShell) ─── */
.console { border-radius: 12px; overflow: hidden; background: var(--console-bg); box-shadow: var(--edge, none); }
/* Вибір шлюзу в рядку вкладок праворуч — менший чіп, як вибір заходу. */
.tabs .projchip.sm { height: 30px; max-width: 46vw; padding: 0 9px 0 11px; }
.tabs .projchip.sm .n { font-size: 13.5px; }
/* «+ Gateway hinzufügen» — остання картка, як «Karte hinzufügen» у Trello;
   підказка про нові датчики — тиха плитка з пунктиром. */
.tcard.add, .tcard.hint { align-items: center; justify-content: center; min-height: 120px; text-align: center;
  background: none; border: 1.5px dashed var(--line-str); box-shadow: none; }
.tcard.add { color: var(--action); font-weight: 600; }
.tcard.add:hover { background: var(--fill); }
.tcard.hint { cursor: default; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.tcard.hint:hover { transform: none; box-shadow: none; }
.tcard.dev.warn { border-left-color: var(--warn); }
.tcard.dev .btn { align-self: stretch; }
.console-body { height: calc(100dvh - 130px); min-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 6px 12px; font: 12.5px/1.5 var(--mono); color: var(--console-ink); }
.console-body .none { padding: 4px 8px; color: var(--console-dim); }
.cl { display: block; width: 100%; padding: 3px 8px; border: 0; border-radius: 4px; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; white-space: pre-wrap; word-break: break-word; }
.cl:hover, .cl:focus-visible { background: rgba(255,255,255,.06); outline: none; }
.cl > span + span { margin-left: 1.2ch; }
.cl .ct, .cl .cb { color: var(--console-dim); }
.cl .cg { color: var(--console-gw); }
.cl .cr.ok { color: var(--ok); } .cl .cr.warn { color: var(--warn); } .cl .cr.crit { color: var(--crit); } .cl .cr.off { color: var(--console-dim); }
.cl .cb { display: block; margin-left: 0 !important; padding-left: 10ch; font-size: 11.5px; }
.console-cursor { display: flex; align-items: center; gap: 1ch; padding: 3px 8px; color: var(--console-dim); }
.console-cursor i { width: .6em; height: 1.1em; background: var(--console-ink); animation: console-blink 1.1s steps(1) infinite; }
@keyframes console-blink { 50% { opacity: 0; } }
@media (max-width: 760px) {
  .tcards { grid-template-columns: 1fr; }
  .tcards.sm { grid-template-columns: 1fr 1fr; }
  .tabs .projchip.sm { max-width: 34vw; }
  /* Три вкладки й чіп мають вміститися в 390 px без прокрутки рядка. */
  .tabs:has(.projchip.sm) { padding: 0 8px; gap: 2px; }
  .tabs:has(.projchip.sm) .tab { padding: 0 9px; }
  .tabs:has(.projchip.sm) .tabs-extra { padding-left: 6px; }
  .tabs .projchip.sm .st { display: none; }
  .console-body { height: calc(100dvh - 150px); }
  .cl .cb { padding-left: 0; }
}

/* ─── «Angemeldete Geräte»: компактна картка сесії ───
   Іконка пристрою в квадраті 40 px ліворуч, три-чотири рядки, праворуч
   «Beenden». Своя — підсвічена кольором дії; автоматичний вхід — блідий. */
.scards { display: flex; flex-direction: column; gap: 6px; }
.scard { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card); }
.scard.on { background: var(--action-soft); }
.scard.bot { opacity: .78; }
.scard .sdev { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--fill); color: var(--muted); }
.scard.on .sdev { color: var(--action); }
.scard .sdev .ico { width: 24px; height: 24px; }
.scard .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scard .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.scard .t .k { font-size: 12px; color: var(--muted); }
.scard .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.scard .ua { font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard > .btn { flex: none; align-self: center; }
