/* =========================================================
   Nabídky klimatizací: tmavá pracovní deska, světlý list
   Aplikace je noční modrá deska jako obě ukázky. Jediný světlý předmět
   je papír: proužek s cenou dole a z něj náhled nabídky. Ledová barva
   jen pro hlavní akce, „trubku“ sestavy a tečku „upraveno“.
   Tokeny převzaté z navrh-klimatizace/styles.css.
   ========================================================= */

:root {
  color-scheme: dark;
  --night: #0b1530;
  --deep: #101d3d;
  --field: #15254a;
  --raised: #1c2f5a;
  --line: #213661;
  --line-2: #33508a;
  --line-hover: #4a69a6;
  --text: #eef3ff;
  --text-2: #d2dcf2;
  --muted: #9fb0d4;
  --placeholder: #6a7ca6;
  --ice: #7ff0ff;
  --ice-ink: #05121c;
  --ice-dim: rgba(127, 240, 255, 0.14);
  --ice-pale: #d8fbff;
  --ice-hover: #b5f7ff;
  --alert: #ff8a8a;
  --paper: #ffffff;
  --ink: #14203d;
  --narrow: 72%;
  --sloupec: 560px;
  --okraj: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-stretch: var(--narrow); }
h1 { font-size: 30px; line-height: 1.1; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 800; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 700; }
p { margin: 0; }

a { color: var(--ice); text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

.obrazovka {
  max-width: calc(var(--sloupec) + 2 * var(--okraj));
  margin: 0 auto;
  padding: 16px var(--okraj) 0;
}

/* ----- Tlačítka ----- */

.tl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.tl:hover { border-color: var(--line-hover); background: var(--raised); }
.tl:disabled { opacity: 0.45; cursor: not-allowed; }
.tl-hlavni { background: var(--ice); border-color: var(--ice); color: var(--ice-ink); font-weight: 700; }
.tl-hlavni:hover { background: var(--ice-hover); border-color: var(--ice-hover); }
.tl-tiche { background: transparent; border-color: transparent; color: var(--ice); padding: 0 8px; }
.tl-tiche:hover { background: var(--ice-dim); border-color: transparent; }
.tl-sirka { width: 100%; }

.lista-tl { display: flex; flex-wrap: wrap; gap: 8px; }

/* ----- Hlavička editoru ----- */

.hlava { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hlava-radek { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

.rezim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.rezim::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.rezim[data-rezim="server"]::before { background: var(--ice); }
.rezim[data-rezim="test"] { border-style: dashed; }

/* ----- Skupiny formuláře ----- */

.skupina { padding: 20px 0; border-bottom: 1px solid var(--line); }
.skupina-hlava { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.shrnuti { color: var(--text-2); overflow-wrap: anywhere; }

.pole { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; }
.pole label { color: var(--text-2); font-size: 14px; }
.pole :is(input, select, textarea),
.vstup {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.pole textarea { min-height: 180px; line-height: 1.45; resize: vertical; }
.pole :is(input, textarea)::placeholder { color: var(--placeholder); }
.pole :is(input, select, textarea):hover { border-color: var(--line-hover); }
.napoveda { color: var(--muted); font-size: 14px; }
.chyba-pole { color: var(--alert); font-size: 14px; }

.dvojice { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ----- Dlaždice sestavy ----- */

.dlazdice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.dlazdice button {
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--deep);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dlazdice button:hover { border-color: var(--line-hover); }
.dlazdice button[aria-checked="true"] { border-color: var(--ice); box-shadow: inset 0 0 0 1px var(--ice); background: var(--field); }
.dlazdice strong { font-size: 17px; font-stretch: var(--narrow); font-weight: 700; }
.dlazdice span { color: var(--muted); font-size: 14px; line-height: 1.3; }
.dlazdice svg { margin-bottom: 4px; }

/* ----- Jednotky a trubka ----- */

.jednotky { display: grid; gap: 0; margin: 0 0 8px; padding: 0; list-style: none; }

.jednotka {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0 10px 22px;
}
/* trubka: svislá ledová linka vlevo, u multisplitu spojuje všechny vnitřní */
.jednotka::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ice);
  opacity: 0.85;
}
.jednotka::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 30px;
  width: 12px;
  height: 2px;
  background: var(--ice);
}
.jednotky[data-typ="single"] .jednotka::before { top: 22px; bottom: auto; height: 18px; }
.jednotky[data-typ="single"] .jednotka::after { left: 0; top: 40px; width: 14px; height: 8px; background: transparent; border: 2px solid var(--ice); }
.jednotka[data-cast="single"]::before { top: 22px; bottom: auto; height: 18px; }
.jednotka[data-cast="single"]::after { left: 0; top: 40px; width: 14px; height: 8px; background: transparent; border: 2px solid var(--ice); }
.jednotka:first-child::before { top: 30px; }

.jednotka .vstup { min-height: 44px; padding: 8px 10px; }
.jednotka-cipy { grid-column: 1 / -1; }
.jednotka-cast { grid-column: 1 / -1; }

.cipy { display: flex; flex-wrap: wrap; gap: 6px; }
.cipy button {
  min-width: 52px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--deep);
  color: var(--text);
  font: inherit;
  font-stretch: var(--narrow);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.cipy button:hover { border-color: var(--line-hover); }
.cipy button[aria-checked="true"] { background: var(--ice); border-color: var(--ice); color: var(--ice-ink); }

.odebrat {
  width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.odebrat:hover { color: var(--text); border-color: var(--line-2); }

.venkovni {
  position: relative;
  padding: 10px 0 12px 22px;
}
.venkovni::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  height: 26px;
  width: 2px;
  background: var(--ice);
}
.venkovni::after {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  width: 14px;
  height: 10px;
  border: 2px solid var(--ice);
}
.venkovni-nazev { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 14px; }

.hlasky { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.hlasky li { padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--text-2); font-size: 14px; }
.hlasky li.blokuje { border-left-color: var(--alert); color: var(--text); }

details.znacky { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
details.znacky summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-2); }
.prepinace { display: grid; gap: 4px; padding: 4px 0 8px; }
.prepinac { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.prepinac input { width: 22px; height: 22px; accent-color: var(--ice); }
.prepinac small { color: var(--muted); }

/* ----- Materiál a práce ----- */

.segment { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.segment button { min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); font: inherit; cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--ice); color: var(--ice-ink); font-weight: 700; }

.material { display: grid; margin: 0; padding: 0; list-style: none; }
.polozka {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.polozka-nazev { position: relative; overflow-wrap: anywhere; }
.polozka-cena { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.polozka-jednotkova { color: var(--muted); font-size: 14px; }
.polozka.nula .polozka-nazev, .polozka.nula .polozka-cena { color: var(--muted); }
.polozka[data-upraveno] .polozka-nazev::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--ice);
  vertical-align: middle;
}

.krokovac { display: inline-flex; align-items: center; gap: 4px; }
.krokovac button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--deep);
  color: var(--text);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.krokovac button:hover { border-color: var(--line-hover); }
.krokovac label { position: relative; }
.krokovac input {
  width: 74px;
  height: 48px;
  padding: 0 26px 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-stretch: var(--narrow);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.krokovac .jednotka-pole { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

.soucet-materialu { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.poznamka { margin-top: 4px; color: var(--text-2); }

/* ----- Papírový proužek dole ----- */

.prouzek-misto { height: 112px; }
.prouzek {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 0 var(--okraj) env(safe-area-inset-bottom);
  pointer-events: none;
}
.prouzek-papir {
  max-width: var(--sloupec);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}
.prouzek-text { min-width: 0; font-variant-numeric: tabular-nums; }
.prouzek-text strong { display: block; font-stretch: var(--narrow); font-size: 17px; }
.prouzek-text span { display: block; font-size: 15px; overflow-wrap: anywhere; }
.prouzek .tl-hlavni { background: var(--ink); border-color: var(--ink); color: var(--paper); flex: 0 0 auto; }
.prouzek .tl-hlavni:hover { background: #24345e; }

/* ----- Náhled ----- */

.lista-horni {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -16px calc(-1 * var(--okraj)) 16px;
  padding: 8px var(--okraj);
  background: var(--night);
  border-bottom: 1px solid var(--line);
}
.lista-horni h1 { font-size: 22px; }

.souhrn { display: grid; gap: 12px; margin: 0 0 16px; }
.souhrn div { min-width: 0; }
.souhrn dt { color: var(--muted); font-size: 14px; }
.souhrn dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.souhrn .pole { margin: 4px 0 0; }

details.email-text summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--ice); }

.strany { display: grid; gap: 12px; margin: 16px 0; }
.strana-obal { position: relative; overflow: hidden; background: var(--paper); cursor: zoom-in; border: 0; padding: 0; display: block; }
.strana-obal .strana { transform-origin: 0 0; pointer-events: none; }

.akce-dole {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 calc(-1 * var(--okraj));
  padding: 12px var(--okraj) calc(12px + env(safe-area-inset-bottom));
  background: var(--night);
  border-top: 1px solid var(--line);
}
.akce-dole .tl-hlavni { flex: 1 1 180px; }

.zvetseni {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(5, 10, 24, 0.96);
}
.zvetseni-lista { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--okraj); color: var(--text-2); }
.zvetseni-ram { overflow: auto; padding: 0 var(--okraj) 24px; -webkit-overflow-scrolling: touch; }
.zvetseni-ram .strana { margin: 0 auto; }

/* ----- Hotovo, ceník, připojení ----- */

.blok-text { display: grid; gap: 12px; margin: 16px 0; }
.blok-text p { color: var(--text-2); }
.prilohy { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.prilohy li { overflow-wrap: anywhere; color: var(--text); }
.prilohy small { color: var(--muted); }

.sms-nahled { padding: 10px 12px; border-left: 2px solid var(--ice); background: var(--deep); color: var(--text-2); overflow-wrap: anywhere; }

.cenik-znacka { padding: 16px 0; border-bottom: 1px solid var(--line); }
.cenik-znacka h3 { margin-bottom: 8px; }
.cenik-tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.cenik-tab th, .cenik-tab td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cenik-tab th { color: var(--muted); font-weight: 600; font-size: 14px; }
.cenik-tab .num { text-align: right; white-space: nowrap; }

.pruh { padding: 12px; border: 1px dashed var(--line-2); border-radius: 4px; color: var(--text-2); }

.zaneprazdneno {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: var(--okraj);
  background: rgba(5, 10, 24, 0.85);
  color: var(--text);
  text-align: center;
}
.zaneprazdneno p { max-width: 320px; font-size: 18px; }

.oznameni {
  position: fixed;
  left: 50%;
  bottom: calc(124px + env(safe-area-inset-bottom));
  z-index: 15;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(calc(100% - 32px), var(--sloupec));
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--raised);
  color: var(--text);
}
.oznameni p { flex: 1; }

#tisk { display: none; }
#merici { position: absolute; left: -10000px; top: 0; width: 793px; }

@media (max-width: 420px) {
  h1 { font-size: 26px; }
  .dvojice { grid-template-columns: 1fr; }
  .krokovac input { width: 64px; }
}

@media (min-width: 1000px) {
  .prouzek-misto { height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; }
  .obrazovka, .prouzek, .oznameni, .zvetseni, .zaneprazdneno { display: none !important; }
  #tisk { display: block !important; }
}
