/* techscope portál
   Smer (unslop od Damira Sokolovského, @heydamir, CC BY 4.0): presný, vecný, pokojný. Svet: technický výkres a terminál.
   Jedna téma pre klienta, tím aj majiteľa. Tiché grafitové plochy s jemným modrastým nádychom, jediný akcent je značková
   modrá #2447F5. Farba len v momentoch: priebeh projektu, platby, mapa modulov. Podpis: mono kódy položiek (M03, v1.1).
   Písmo Urbanist (web techscope.sk), čísla a kódy JetBrains Mono, logo <_ JetBrains Mono 800. */

@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/urbanist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/urbanist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/jetbrains-mono-500-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url("fonts/jetbrains-mono-800.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* neutrálna rampa (ink): pozadie, plochy, linky, tri úlohy textu */
  --deep: #07080d; --bg: #0b0d14; --surface: #11141c; --raised: #1a1e28; --raised-2: #232835;
  --text: #eef0f5; --body: #a3a9b8; --muted: #7d8599;
  --line: rgba(238,240,245,.08); --line-2: rgba(238,240,245,.12);
  /* jediný akcent: značková modrá; ako text na tmavom svetlejší odtieň kvôli kontrastu */
  --accent: #2447F5; --accent-ink: #FFFFFF; --accent-text: #8EA2FF; --accent-soft: rgba(36,71,245,.16);
  --ok: #4cc38a; --warn: #d9a54a; --bad: #ef6b6e; --info: var(--accent-text);
  /* staré názvy premenných, ktoré používajú šablóny */
  --glass: var(--surface); --glass-2: var(--raised); --glass-3: var(--raised-2);
  --blue: var(--accent); --cyan: var(--accent-text); --white: var(--text); --ink: var(--bg);
  --a1: var(--accent); --a1-ink: var(--accent-ink); --a2: var(--accent); --a2-ink: var(--accent-ink);
  --primary: var(--accent); --primary-ink: var(--accent-ink); --active: var(--raised-2); --active-ink: var(--text);
  --link: var(--accent-text); --link-hover: #B8C5FF; --dot: var(--accent-text);
  --r-xl: 16px; --r-lg: 16px; --r-md: 12px; --r-sm: 8px; --r-ctl: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: "Urbanist", system-ui, sans-serif; font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg); font-feature-settings: "tnum" 1; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: 0; }
p, ul, ol, dl, figure { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Rozloženie: ikonové menu + obsah ---------- */
.app { display: flex; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; flex: 0 0 72px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 16px 0; background: var(--deep); border-right: 1px solid var(--line); z-index: 5; }
.rail__logo { width: 44px; height: 40px; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-family: var(--mono); font-weight: 800; font-size: 16px; color: var(--text); }
.rail__logo img { display: block; width: 36px; height: 36px; }
.rail__tag { font-size: 11px; font-weight: 500; line-height: 16px; color: var(--muted); }
.rail__nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.rail__item { position: relative; width: 44px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; color: var(--muted); border: 0; background: none; cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.rail__item:hover { color: var(--text); background: var(--surface); }
.rail__item[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.rail__item svg { width: 18px; height: 18px; }
.rail__dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); }
.rail__item[aria-current="page"] .rail__dot { background: var(--accent-text); }
.rail__item .tip { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 4px 8px; border-radius: 6px;
  background: var(--raised-2); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .12s var(--ease); }
.rail__item:hover .tip, .rail__item:focus-visible .tip { opacity: 1; }
.rail__spacer { flex: 1; }
.rail__me { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--raised-2); color: var(--text); font-weight: 500; font-size: 13px; margin-top: 4px; }
.rail form { margin: 0; }

.main { flex: 1; min-width: 0; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 32px 32px 80px; display: flex; flex-direction: column; gap: 24px; }
.wrap > * { min-width: 0; max-width: 100%; }

/* ---------- Hlavička ---------- */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.head__title { margin-right: auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.head h1 { font-size: 32px; font-weight: 500; letter-spacing: 0; line-height: 1.15; overflow-wrap: anywhere; }
.head .crumb { font-size: 13px; color: var(--muted); }
.lead { font-size: 15px; color: var(--body); max-width: 70ch; }
.lead:empty { display: none; }

/* ---------- Pilulky, štítky, tlačidlá ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--r-ctl); background: transparent; border: 1px solid var(--line-2);
  color: var(--body); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.pill:hover { background: var(--surface); color: var(--text); }
.pill[aria-current="page"], .pill.is-on { background: var(--raised); color: var(--text); border-color: var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.pill--sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.pill select { border: 0; background: transparent; color: inherit; font-weight: 600; cursor: pointer; appearance: none; padding-right: 4px; }
.pill select option { color: #111214; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--raised); color: var(--body); }
.chip--a1, .chip--a2, .chip--soft { background: var(--raised); color: var(--text); }
.chip--new { background: var(--accent-soft); color: var(--accent-text); }
.chip--ok { background: transparent; color: var(--ok); padding-left: 0; }
.chip--warn { background: transparent; color: var(--warn); padding-left: 0; }
.chip--bad { background: transparent; color: var(--bad); padding-left: 0; }
.chip--ok::before, .chip--warn::before, .chip--bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--mono, .code { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0; border-radius: 4px; padding: 0 6px; height: 20px;
  display: inline-flex; align-items: center; background: transparent; color: var(--muted); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.code { vertical-align: 2px; margin-right: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-ctl); text-align: center; line-height: 1.2;
  border: 1px solid var(--line-2); background: var(--raised); color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06); transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--raised-2); color: var(--text); }
.btn:active { transform: scale(.98); }
.btn--primary, .btn--blue { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.btn--primary:hover, .btn--blue:hover { background: #3557F7; border-color: #3557F7; color: var(--accent-ink); }
.btn--outline { background: transparent; box-shadow: none; }
.btn--outline:hover { background: var(--surface); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--big { min-height: 48px; font-size: 15px; padding: 0 20px; }
.btn--block { width: 100%; }
.btn--danger { background: transparent; border-color: rgba(239,107,110,.35); color: var(--bad); box-shadow: none; }
.btn--danger:hover { background: rgba(239,107,110,.1); color: var(--bad); }
.btn--on-a1, .btn--on-a2 { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.iconbtn { width: 36px; height: 36px; flex: none; border-radius: var(--r-ctl); display: grid; place-items: center; background: transparent; border: 1px solid var(--line-2);
  color: var(--body); cursor: pointer; font-size: 16px; line-height: 1; transition: background-color .15s var(--ease), color .15s var(--ease); }
.iconbtn:hover { background: var(--surface); color: var(--text); }
.iconbtn svg { width: 16px; height: 16px; }
.arrow { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-2); }
.arrow svg { width: 14px; height: 14px; }
.textlink { font-weight: 500; font-size: 14px; }
.arr { display: inline-block; }

/* ---------- Karty ---------- */
.bento { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.g3 { flex: 3 1 300px; } .g4 { flex: 4 1 320px; } .g5 { flex: 5 1 380px; } .g6 { flex: 6 1 420px; } .g7 { flex: 7 1 480px; } .g8 { flex: 8 1 540px; } .g9 { flex: 9 1 640px; }
.card { position: relative; overflow: hidden; min-width: 0; border-radius: var(--r-xl); padding: 20px 24px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.card--raise { background: var(--surface); border-color: var(--line-2); }
.card--a1, .card--a2 { background: var(--surface); border-color: var(--line); color: var(--text); }
.card--flush { padding: 16px 20px 8px; }
a.card { text-decoration: none; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
a.card:hover { border-color: var(--line-2); background: #141823; color: var(--text); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.card__title { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text); }
.card__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.card__foot { position: relative; z-index: 1; margin-top: auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 32px; }
.card__push { flex: 1; }
.card .sub { font-size: 13px; color: var(--muted); }
.min-250 { min-height: 176px; } .min-210 { min-height: 160px; }

/* Dekorácie zo starého dizajnu (pruhy, bodky, kameň) sú zrušené: nič nehovorili o produkte. */
.pat { display: none; }
/* Polkruh platieb: zaplatené akcentom, vyfakturované svetlejšou šedou, zvyšok tichá stopa */
.half { position: absolute; z-index: 0; right: -64px; bottom: -132px; width: 264px; height: 264px; border-radius: 50%;
  background: conic-gradient(from 270deg, var(--accent) 0deg calc(var(--v1, 0) * 1.8deg),
    #5b6378 calc(var(--v1, 0) * 1.8deg) calc((var(--v1, 0) + var(--v2, 0)) * 1.8deg), var(--raised-2) 0 180deg, transparent 0); }
.half::after { content: ""; position: absolute; inset: 28px; border-radius: 50%; background: var(--surface); }

/* Čísla: stredná váha, tabuľkové číslice */
.num { font-size: 28px; font-weight: 500; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.num--xl { font-size: 40px; letter-spacing: -0.01em; }
.num--lg { font-size: 32px; }
.num small { font-size: .5em; font-weight: 400; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 400; color: var(--body); position: relative; z-index: 1; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.legend i.o { background: #5b6378; border: 0; }
.legend i.f { background: var(--raised-2); opacity: 1; }

/* Prúžok a kruh */
.bar { position: relative; height: 6px; border-radius: 3px; background: var(--raised-2); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 0%); border-radius: 3px; background: var(--accent); }
.ring { position: relative; width: 200px; height: 200px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) 0 calc(var(--v, 0) * 1%), var(--raised-2) 0); }
.ring::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: var(--surface); }
.ring__in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Priebeh projektu: trasa ako kótovaná čiara na výkrese */
.route { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 8px; position: relative; padding-top: 28px; }
.route::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; border-top: 1px dashed var(--line-2); }
.route::after { content: ""; position: absolute; left: 6px; top: 5px; height: 3px; width: calc(var(--p, 0%) - 6px); border-radius: 2px; background: var(--accent); }
.route__step { position: relative; font-size: 13px; color: var(--muted); }
.route__step::before { content: ""; position: absolute; left: 0; top: -28px; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); z-index: 1; }
.route__step.is-done::before { background: var(--accent); border-color: var(--accent); }
.route__step.is-current::before { background: var(--bg); border: 3px solid var(--accent); }
.route__step strong { display: block; color: var(--text); font-weight: 500; font-size: 14px; }
.route__step.is-current strong { color: var(--accent-text); }

/* ---------- Zoznamy a tabuľky ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card > .search, .col > .search { flex: none; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); outline: none; }
.search svg { width: 16px; height: 16px; flex: none; }
.rows { list-style: none; padding: 0; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); min-width: 0; }
.rows > .row:first-child, .rows > li:first-child > .row { border-top: 0; }
.row__icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.row__icon svg { width: 16px; height: 16px; }
.row__icon--a1, .row__icon--a2 { color: var(--accent-text); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 500; overflow-wrap: anywhere; }
.row__sub { display: block; font-size: 13px; color: var(--muted); }
.row__meta { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__act { font-weight: 500; font-size: 14px; white-space: nowrap; }
a.row { color: var(--text); text-decoration: none; border-radius: 8px; }
a.row:hover { background: var(--raised); color: var(--text); }
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 12px; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: rgba(238,240,245,.02); }
.table .right { text-align: right; }

/* ---------- Formuláre ---------- */
.field { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--deep); color: var(--text);
  transition: border-color .15s var(--ease); }
.field::placeholder { color: var(--muted); }
.field:hover { border-color: rgba(238,240,245,.18); }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
select.field { appearance: none; padding-right: 40px;
  background: var(--deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 L6 8 L10 4.5' fill='none' stroke='%237D8599' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
select.field option { color: #111214; }
textarea.field { resize: vertical; min-height: 96px; }
input[type="file"].field { padding: 8px; }
input[type="file"].field::file-selector-button { margin-right: 12px; min-height: 28px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.lbl { display: block; font-size: 13px; font-weight: 500; color: var(--body); margin: 0 0 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid > .full { grid-column: 1 / -1; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--body); cursor: pointer; }
.consent input, .checks input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.err-text { color: var(--bad); font-size: 13px; margin-top: 4px; }
.help { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Oznámenia ---------- */
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); font-weight: 400; font-size: 14px; color: var(--text); }
.notice::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--accent-text); }
.notice--ok::before { background: var(--ok); }
.notice--err::before { background: var(--bad); }
.notice--err { border-color: rgba(239,107,110,.3); }

/* ---------- Mazanie s potvrdením (bez JS dialógov) ---------- */
.del { display: inline-block; }
.del > summary { list-style: none; cursor: pointer; color: var(--bad); font-weight: 500; font-size: 13px; }
.del > summary::-webkit-details-marker { display: none; }
.del[open] > summary { margin-bottom: 8px; }
.del__form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 380px; padding: 12px 16px; border-radius: var(--r-md); background: var(--deep); border: 1px solid var(--line-2); }
.danger-zone { border-color: rgba(239,107,110,.3) !important; }

/* ---------- Kompatibilita: triedy používané v starších šablónach tímu ---------- */
.section { display: flex; flex-direction: column; gap: 14px; }
.section > h2, .h2 { font-size: 17px; font-weight: 500; }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.pad { padding: 20px 24px; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .wide { flex: 3 1 440px; min-width: 0; }
.split > .narrow { flex: 2 1 280px; min-width: 0; }
.muted, .empty { color: var(--muted); }
.body { color: var(--body); }
.small { font-size: 13px; }
.bad-text { color: var(--bad); }
.glass, .glass-light { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.stage { position: relative; border-radius: var(--r-xl); }
.stage__card { border-radius: var(--r-xl); padding: 8px; }
.stage__card--pad { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.mesh { display: none; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.fact__label { font-size: 13px; color: var(--muted); }
.fact__value { margin-top: 4px; font-size: 24px; font-weight: 500; letter-spacing: 0; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fact__value small { font-size: 15px; color: var(--muted); }
.fact__note { margin-top: 4px; font-size: 14px; color: var(--body); }
.list { display: flex; flex-direction: column; }
.list__row { display: flex; align-items: baseline; gap: 4px 20px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list > .list__row:first-child, .panel > .list__row:first-child { border-top: 0; }
a.list__row:hover, .list__row[aria-current="true"] { background: var(--raised); color: var(--text); }
.list__main { flex: 1 1 220px; min-width: 0; font-weight: 500; }
.list__sub { display: block; margin-top: 2px; font-weight: 400; font-size: 13px; color: var(--muted); }
.list__aside { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list__row--pay .list__main { font-weight: 500; color: var(--body); }
.rowlink { color: var(--text); }
.rowlink:hover { color: var(--link); }
.feed { display: grid; grid-template-columns: 110px 1fr; gap: 12px 20px; }
.feed time { font-size: 13px; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* Stav: bodka s významom + tichý text, nie svietiaca pilulka */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--body); }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.state--review::before, .state--issued::before { background: var(--accent-text); }
.state--approved::before, .state--paid::before { background: var(--ok); }
.state--in_dev::before { background: var(--warn); }
.state--returned::before, .state--overdue::before { background: var(--bad); }
.state--overdue { color: var(--bad); }
.state--planned, .state--waiting, .state--cancelled { color: var(--muted); }
.tablewrap { overflow-x: auto; }
.criteria, .steps { padding-left: 20px; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 22px; margin-top: 28px; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 2px; background: var(--line-2); }
.timeline::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; border-radius: 2px; width: var(--progress, 0%); background: var(--accent); }
.timeline span { font-size: 13px; color: var(--muted); }
.timeline .is-done { color: var(--text); }
.timeline .is-current { color: var(--accent-text); font-weight: 500; }
.task { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 20px; border-radius: var(--r-md); }
.task__text { flex: 1 1 280px; min-width: 0; }
.task__title { font-size: 15px; font-weight: 500; }
.task__meta { font-size: 13px; color: var(--muted); }
.task--none { color: var(--body); }
.doc { display: flex; flex-direction: column; gap: 32px; }
.doc h2 { font-size: 17px; margin-bottom: 12px; }
.doc ul { padding-left: 20px; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.doc .mod + .mod { margin-top: 18px; }
.doc .mod h3 { font-size: 15px; font-weight: 500; }
.doc .mod p { margin-top: 2px; color: var(--body); }
.meta { display: flex; flex-direction: column; gap: 16px; }
.meta dt { font-size: 13px; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.thread { display: flex; flex-direction: column; gap: 22px; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 72ch; }
.msg__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.msg__author { font-weight: 500; }
.msg__time { font-size: 13px; color: var(--muted); }
.msg__body { color: var(--body); white-space: pre-line; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: var(--glass-2); }
.msg--mine { align-self: flex-end; }
.msg--mine .msg__body { border-radius: 16px 16px 4px 16px; background: var(--accent-soft); }
.newtopic summary { list-style: none; }
.newtopic summary::-webkit-details-marker { display: none; }
.newtopic[open] summary { display: none; }
.inbox__row.is-unread .list__main { font-weight: 600; }
.inbox__row.is-unread::before { content: ""; width: 8px; height: 8px; flex: none; align-self: center; border-radius: 50%; background: var(--dot); }
.nav__count { display: inline-flex; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.copy { padding: 0; border: 0; background: none; color: var(--link); font-size: 13px; font-weight: 500; cursor: pointer; }
.plan__time { flex: 0 0 72px; font-size: 13px; font-family: var(--mono); color: var(--body); }
.lead-row { align-items: center; flex-wrap: wrap; }
.lead-quick { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.lead-quick select { width: auto; min-height: 40px; }
.lead-quick input { flex: 1 1 200px; min-height: 40px; }
.workbook { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-bar button { min-height: 32px; min-width: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--text); cursor: pointer; font-size: 14px; }
.editor-bar .swatch { width: 36px; padding: 0; }
.editor { min-height: 340px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--deep); line-height: 1.6; overflow-wrap: anywhere; }
.editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.editor:empty::before { content: "Píš poznámky z hovoru alebo vlož šablónu."; color: var(--muted); }
mark { border-radius: 3px; padding: 0 2px; color: #111214; }
mark[data-mark="yellow"], mark:not([data-mark]) { background: #FFF1A8; }
mark[data-mark="green"] { background: #C9F2DD; }
mark[data-mark="blue"] { background: #D6E2FF; }
mark[data-mark="pink"] { background: #FFD6E5; }
mark[data-mark="violet"] { background: #E7DDFF; }
.timeline-v { display: flex; flex-direction: column; gap: 18px; }
.tl { padding-left: 16px; box-shadow: inset 2px 0 0 var(--line-2); }
.tl__text { font-weight: 500; font-size: 14px; }
.tl__note { margin-top: 6px; font-size: 14px; color: var(--body); }
.tl__note ul, .tl__note ol { padding-left: 18px; }
.budget { display: grid; grid-template-columns: 180px 1fr 110px 120px; gap: 16px; align-items: center; }
.budget__bar { height: 6px; border-radius: 3px; background: var(--raised-2); overflow: hidden; }
.budget__bar span { display: block; height: 100%; background: var(--accent); }
.budget__spent { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.budget__input { min-height: 40px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.calc-inputs { display: flex; align-items: center; gap: 12px; }
.calc-inputs input[type=range] { flex: 1; accent-color: var(--accent); }
.calc-inputs .field { width: 110px; min-height: 40px; text-align: right; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.card.offer, .offer { flex-direction: row; flex: none; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; padding: 20px 24px; cursor: pointer; }
.offer:has(input:checked) { border-color: var(--accent); }
.offer input { width: 16px; height: 16px; margin-top: 4px; flex: none; accent-color: var(--accent); }
.offer--done { cursor: default; }
.offer__body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.offer__name { font-size: 17px; font-weight: 500; }
.offer__desc { color: var(--body); }
.offer__price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.offer__now { font-size: 28px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.offer__later { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.offer__meta { font-size: 14px; color: var(--body); }
.video { display: flex; flex-direction: column; gap: 8px; }
.video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #000; }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pay { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.pay__qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pay__qr svg { display: block; width: 200px; height: auto; border-radius: 12px; background: #FFFFFF; padding: 8px; }
.pay__data { flex: 1 1 260px; display: grid; gap: 12px; align-content: start; }
.col > .pay__data { flex: none; }
.pay__data dt { font-size: 13px; color: var(--muted); }
.pay__data dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; font-family: var(--mono); }

/* ---------- Prihlásenie a 2FA ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth__card { width: min(420px, 100%); padding: 32px; border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); }
.auth .logo, .logo { font-family: var(--mono); font-weight: 800; font-size: 18px; color: var(--text); }
.logo img { display: block; height: 32px; width: auto; }
.auth h1 { font-size: 28px; font-weight: 500; line-height: 1.15; }
.qr { align-self: center; padding: 12px; background: #FFFFFF; border-radius: 12px; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: var(--mono); font-size: 13px; word-break: break-all; padding: 2px 6px; border-radius: 6px; background: var(--glass-3); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px 20px; list-style: none; border-radius: var(--r-md); background: var(--deep); border: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }

/* ---------- Mobil: menu dole, karty pod sebou ---------- */
@media (max-width: 1100px) { .workbook { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { padding: 0 0 72px; }
  .wrap { padding: 20px 16px 48px; gap: 20px; }
  .rail { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; flex-direction: row; justify-content: center; padding: 8px 12px;
    border-right: 0; border-top: 1px solid var(--line); background: var(--deep); overflow: visible; }
  .rail__logo, .rail__tag, .rail__spacer, .rail__extra { display: none; }
  .rail__nav { flex-direction: row; margin: 0; gap: 4px; }
  .rail__item { width: 52px; height: 52px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .rail__me { display: none; }
  .first-mobile { order: -1; }
  /* na mobile ikona aj s krátkym popisom (bez neho nie je jasné, čo ktorá ikona robí) */
  .rail__item .tip { display: block; position: static; transform: none; opacity: 1; padding: 0; background: none; border: 0; box-shadow: none;
    font-size: 10px; line-height: 1.1; color: inherit; max-width: 52px; overflow: hidden; text-overflow: ellipsis; }
  /* dotykové ciele aspoň 44 px na výšku */
  .row__act, .copy, .textlink { display: inline-flex; align-items: center; min-height: 44px; }
  .head h1 { font-size: 28px; }
  .num--xl { font-size: 36px; }
  .facts, .form-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
}
@media (max-width: 560px) {
  .facts, .form-grid, .calc-grid { grid-template-columns: 1fr; }
  .feed { grid-template-columns: 1fr; gap: 2px 0; }
  .route { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .route::before, .route::after { display: none; }
  .budget { grid-template-columns: 1fr 88px; } .budget__bar { grid-column: 1 / -1; }
  .ring { width: 176px; height: 176px; }
  .row { flex-wrap: wrap; } .row__body { flex-basis: calc(100% - 48px); }
}

button.chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; }
button.chip:hover { color: var(--text); }

/* ---------- AI asistent: tiché tlačidlo vpravo dole (bez žiary, pulzu a iskry) ---------- */
body:has(.ai-fab) .wrap { padding-bottom: 96px; }  /* posledný riadok stránky nezakryje plávajúce tlačidlo AI */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--raised); color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transition: background-color .15s var(--ease), transform .12s var(--ease); }
.ai-fab svg { width: 18px; height: 18px; }
.ai-fab:hover { background: var(--raised-2); color: var(--text); }
.ai-fab:active { transform: scale(.97); }
.ai-fab__ring { display: none; }
.ai-fab__tip { position: absolute; right: 52px; white-space: nowrap; font-size: 13px; font-weight: 500; padding: 4px 8px; border-radius: 6px;
  background: var(--raised-2); border: 1px solid var(--line-2); color: var(--text); opacity: 0; transition: opacity .15s var(--ease); pointer-events: none; }
.ai-fab:hover .ai-fab__tip, .ai-fab:focus-visible .ai-fab__tip { opacity: 1; }

/* ---------- AI asistent: chat ---------- */
.wrap:has(.chatx) { padding-bottom: 24px; max-width: none; }
.chatx { position: relative; display: grid; grid-template-columns: 264px 1fr; height: calc(100vh - 56px); min-height: 520px;
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.chatx__side { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--deep); min-height: 0; }
.chatx__sidehead { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px; }
.chatx__brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; }
.chatx__brand svg { width: 16px; height: 16px; color: var(--muted); }
.chatx__new { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-ctl); font-weight: 500; font-size: 14px; color: var(--text);
  background: var(--raised); border: 1px solid var(--line-2); }
.chatx__new:hover { background: var(--raised-2); color: var(--text); }
.chatx__new svg { width: 16px; height: 16px; }
.chatx__label { margin: 16px 8px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.chatx__hist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chatx__item { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 8px; color: var(--body); }
.chatx__item:hover { background: var(--surface); color: var(--text); }
.chatx__item.is-on { background: var(--raised); color: var(--text); }
.chatx__item-t { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatx__item small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatx__none { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.chatx__topics { padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.chatx__topics summary { cursor: pointer; font-weight: 500; }
.chatx__topics p { margin: 8px 0 0; color: var(--body); white-space: pre-line; }
.chatx__veil { display: none; }

.chatx__main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; isolation: isolate; }
.chatx__dots { display: none; }
.chatx__bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chatx__title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chatx__title strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatx__title span { font-size: 13px; color: var(--muted); }
.chatx__left { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.chatx__iconbtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 0; cursor: pointer; font-size: 18px; line-height: 1;
  background: transparent; color: var(--body); list-style: none; }
.chatx__iconbtn::-webkit-details-marker { display: none; }
.chatx__iconbtn:hover { background: var(--raised); color: var(--text); }
.chatx__more { position: relative; }
.chatx__menu { position: absolute; right: 0; top: 40px; z-index: 5; padding: 4px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.chatx__menu button { white-space: nowrap; border: 0; background: transparent; color: var(--bad); font: inherit; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.chatx__menu button:hover { background: var(--raised-2); }

.chatx__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 20px 12px; scroll-behavior: smooth; }
.chatx__thread { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.chatx__flash { max-width: 760px; margin: 0 auto 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--raised); font-size: 14px; }
.chatx__flash.is-err { background: rgba(239,107,110,.08); color: var(--bad); }
.bub { display: flex; flex-direction: column; gap: 4px; max-width: 86%; animation: bubIn .3s var(--ease); }
.bub__body { padding: 12px 16px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 15px; }
.bub time { font-size: 12px; color: var(--muted); padding: 0 8px; font-family: var(--mono); }
.bub--user { align-self: flex-end; align-items: flex-end; }
.bub--user .bub__body { background: var(--raised-2); color: var(--text); border-bottom-right-radius: 4px; }
.bub--assistant { align-self: flex-start; }
.bub--assistant .bub__body { background: transparent; border: 0; color: var(--text); padding-left: 0; padding-right: 0; }
.bub--error .bub__body { background: rgba(239,107,110,.08); border: 1px solid rgba(239,107,110,.3); color: var(--bad); padding: 12px 16px; }
.bub--typing .bub__body { display: inline-flex; gap: 4px; padding: 12px 0; }
.bub--typing .bub__body span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite var(--ease); }
.bub--typing .bub__body span:nth-child(2) { animation-delay: .15s; }
.bub--typing .bub__body span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 70%, 100% { opacity: .35; } 35% { opacity: 1; } }
@keyframes bubIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.chatx__hello { max-width: 640px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chatx__hello[hidden] { display: none; }
.chatx__hello h1 { font-size: 28px; font-weight: 500; letter-spacing: 0; margin: 8px 0 0; }
.chatx__hello p { margin: 0; color: var(--body); }
.chatx__orb { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text); background: var(--raised); border: 1px solid var(--line-2); }
.chatx__orb svg { width: 20px; height: 20px; }
.chatx__sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chatx__sug { border: 1px solid var(--line-2); background: transparent; color: var(--body); font: inherit; font-size: 14px; font-weight: 400;
  padding: 8px 12px; border-radius: var(--r-ctl); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.chatx__sug:hover { background: var(--raised); color: var(--text); }

.chatx__composer { display: flex; align-items: flex-end; gap: 8px; width: calc(100% - 40px); max-width: 760px; margin: 8px auto 0; padding: 8px 8px 8px 12px;
  border-radius: var(--r-md); background: var(--deep); border: 1px solid var(--line-2); transition: border-color .15s var(--ease); }
.chatx__composer:focus-within { border-color: rgba(238,240,245,.24); }
.chatx__composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px;
  line-height: 1.5; padding: 8px 4px; max-height: 200px; }
.chatx__composer textarea::placeholder { color: var(--muted); }
.chatx__proj { display: inline-flex; align-items: center; gap: 6px; align-self: center; max-width: 42%; padding: 4px 8px; border-radius: 6px;
  background: var(--raised); color: var(--body); font-size: 13px; }
.chatx__proj svg { width: 14px; height: 14px; flex: none; }
.chatx__proj select { min-width: 0; max-width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 500; outline: 0; cursor: pointer; }
.chatx__proj select option { background: var(--raised); }
.chatx__send { flex: none; width: 36px; height: 36px; border-radius: var(--r-ctl); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--accent-ink);
  background: var(--accent); transition: background-color .15s var(--ease), transform .12s var(--ease), opacity .15s var(--ease); }
.chatx__send:hover { background: #3557F7; }
.chatx__send:active { transform: scale(.96); }
.chatx__send:disabled { opacity: .4; cursor: default; transform: none; }
.chatx__send svg { width: 16px; height: 16px; }
.chatx__fine { margin: 8px auto 16px; padding: 0 20px; text-align: center; font-size: 12px; color: var(--muted); }
.chatx__only-m { display: none; }
/* prázdna konverzácia: otázka v strede */
.chatx__main.is-empty .chatx__scroll { flex: 0 1 auto; margin-top: auto; padding-bottom: 24px; }
.chatx__main.is-empty .chatx__fine { margin-bottom: auto; padding-bottom: 40px; }

@media (max-width: 860px) {
  .ai-fab { right: 16px; bottom: 80px; }
  .ai-fab__tip { display: none; }
  .chatx { grid-template-columns: 1fr; height: calc(100dvh - 112px); }
  .chatx__side { position: absolute; inset: 0 auto 0 0; width: min(300px, 86%); z-index: 20; transform: translateX(-105%);
    transition: transform .3s var(--ease); box-shadow: 16px 0 40px rgba(0,0,0,.5); }
  .chatx.side-open .chatx__side { transform: none; }
  .chatx.side-open .chatx__veil { display: block; position: absolute; inset: 0; z-index: 15; background: rgba(0,0,0,.45); }
  .chatx__only-m { display: grid; }
  .chatx__scroll { padding: 20px 12px 8px; }
  .chatx__composer { width: calc(100% - 20px); }
  .bub { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .bub, .bub--typing .bub__body span { animation: none; } }

/* ---------- Fázy projektu: kategória = bodka s farbou, nie farebná plocha ---------- */
.ph--meeting { --ph: #7d8599; }
.ph--proposal { --ph: #6fb3d9; }
.ph--contract { --ph: #d9a54a; }
.ph--development { --ph: #8EA2FF; }
.ph--handover { --ph: #4cc38a; }
.card.ph { background: var(--surface); border-color: var(--line); }
.card.ph .bar > span { background: var(--accent); }
a.card.ph:hover { border-color: var(--line-2); }
.chip--ph { background: transparent; color: var(--body); padding: 0; height: auto; gap: 6px; font-size: 13px; }
.chip--ph::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ph); }
.phdot { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.phdot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ph); flex: none; }
.phlegend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Navigácia: 6 stálych kariet + mriežka aplikácií (+) ---------- */
details.apps, details.menu { position: relative; }
details.apps > summary, details.menu > summary { list-style: none; }
details.apps > summary::-webkit-details-marker, details.menu > summary::-webkit-details-marker { display: none; }
.rail__item.is-on, details.apps[open] > summary.rail__item { background: var(--raised); color: var(--text); }
.apps__panel { position: fixed; left: 84px; bottom: 16px; width: 336px; max-width: calc(100vw - 100px); max-height: calc(100vh - 32px);
  overflow-y: auto; padding: 16px; border-radius: var(--r-lg); background: var(--raised); border: 1px solid var(--line-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 60; transform-origin: left bottom; animation: pop-in .2s var(--ease); }
details.apps[open] > summary .tip { display: none; }
.apps__title { margin: 0 0 12px 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.apps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.apps__grid form { margin: 0; display: contents; }
.app-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 88px;
  padding: 12px 4px; border-radius: var(--r-md); line-height: 1.25;
  background: transparent; border: 1px solid transparent; color: var(--body); font: inherit; font-size: 13px; font-weight: 500; text-align: center;
  cursor: pointer; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.app-tile:hover { background: var(--raised-2); color: var(--text); }
.app-tile[aria-current="page"] { color: var(--text); background: var(--raised-2); }
.app-tile__ic { position: relative; width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--body); }
.app-tile__ic svg { width: 18px; height: 18px; }
.app-tile__me { background: var(--surface); color: var(--text); font-weight: 500; border-radius: 50%; }
.rail__big { display: none; flex-direction: column; align-items: center; gap: 4px; }
@media (min-width: 1440px) and (min-height: 760px) {
  .rail__big { display: flex; }
  .apps__grid .app-tile--small { display: none; }
}
body:has(details.apps[open]) .ai-fab { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Zoznam projektov: prepínač + hľadanie + filter ---------- */
.ptool { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ptool__search { flex: 1 1 220px; max-width: 360px; margin: 0; }
.ptool__search .field { min-height: 36px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-ctl); background: var(--deep); border: 1px solid var(--line-2); }
.seg__item { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; color: var(--body); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg__item:hover { color: var(--text); }
.seg__item.is-on { background: var(--raised-2); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.seg__n { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.menu__panel { position: absolute; left: 0; top: calc(100% + 8px); min-width: 224px; padding: 4px; border-radius: var(--r-md); background: var(--raised);
  border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 30; animation: pop-in .18s var(--ease); }
.menu--right .menu__panel { left: auto; right: 0; }
.menu__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--body); font-weight: 500; font-size: 14px; text-decoration: none; }
.menu__item:hover { background: var(--raised-2); color: var(--text); }
.menu__item.is-on { color: var(--text); }
.menu__item.is-on::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); }
.pgrp { display: flex; flex-direction: column; gap: 12px; }
.pgroup { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 15px; font-weight: 500; }

/* ---------- Detail projektu: ľavé menu zmizne, hore sa preklopí lišta projektu ---------- */
body.inproj .rail { display: none; }
.ptop { position: sticky; top: 0; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 0; margin: -32px 0 0;
  background: var(--bg); border-bottom: 1px solid var(--line); transform-origin: 50% 0; animation: ptop-flip .4s var(--ease) both; }
@keyframes ptop-flip { from { opacity: 0; transform: perspective(900px) rotateX(-28deg); } to { opacity: 1; transform: none; } }
body.inproj .main .wrap > :not(.ptop) { animation: ptop-content .4s var(--ease) both; }
@keyframes ptop-content { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ptop__back { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--body);
  font-weight: 500; font-size: 14px; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.ptop__back:hover { background: var(--surface); color: var(--text); }
.ptop__back svg { width: 16px; height: 16px; transform: rotate(-135deg); }
.ptop__name { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.ptop__name strong { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ptop__name .small { font-size: 12px; }
.ptop__tabs { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.ptop__tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--body); font-weight: 500; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s var(--ease), color .15s var(--ease); }
.ptop__tab:hover { color: var(--text); background: var(--surface); }
.ptop__tab[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.ptop__more svg { width: 14px; height: 14px; }
details.menu[open] > .ptop__more { background: var(--surface); color: var(--text); }
@media (max-width: 860px) {
  body.inproj .app { padding-bottom: 0; }
  details.apps { position: static; }
  .apps__panel { position: absolute; left: 8px; right: 8px; top: auto; bottom: calc(100% + 8px); width: auto; max-width: none; transform-origin: 50% 100%; }
  .ptop { margin-top: -20px; gap: 8px; }
  .ptop__tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .ptop__tabs .menu { position: static; }
  .ptop__tabs .menu__panel { position: fixed; left: 12px; right: 12px; top: auto; }
  .seg { width: 100%; } .seg__item { flex: 1; justify-content: center; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .ptop, body.inproj .main .wrap > :not(.ptop), .apps__panel, .menu__panel { animation: none; } }

/* Scope v klientskej zóne: moduly sa rozbalia na prečítanie */
details.scope-mod { border-top: 1px solid var(--line); padding: 12px 0; }
details.scope-mod > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.scope-mod > summary::-webkit-details-marker { display: none; }
details.scope-mod > summary::after { content: "+"; font-size: 18px; color: var(--muted); }
details.scope-mod[open] > summary::after { content: "–"; }
details.scope-mod > p, details.scope-mod > ul { margin-top: 8px; }

/* AI zhrnutie + Zobraziť detail */
.summary { margin: 0; }
.chip--ai { height: 20px; font-size: 12px; padding: 0 6px; border-radius: 4px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); vertical-align: 2px; }
details.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  color: var(--link); font-weight: 500; font-size: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "›"; transition: transform .15s var(--ease); }
details.more[open] > summary::after { transform: rotate(90deg); }
details.more[open] > summary { font-size: 0; } details.more[open] > summary::before { content: "Skryť detail"; font-size: 14px; }
details.more[open] > summary::after { font-size: 14px; }

/* Načítavací pásik s hláškami (loadbar.js): jeden akcent, žiadny dúhový prechod */
.loadbar { display: flex; flex-direction: column; gap: 8px; }
.loadbar__track { position: relative; display: block; height: 2px; border-radius: 1px; background: var(--raised-2); overflow: hidden; }
.loadbar__track > span { position: absolute; top: 0; bottom: 0; width: 32%; border-radius: 1px; background: var(--accent); animation: loadbar-run 1.4s var(--ease) infinite; }
@keyframes loadbar-run { from { left: -32%; } to { left: 100%; } }
.loadbar__text, [data-quips] { font-size: 13px; color: var(--muted); font-family: var(--mono); transition: opacity .18s var(--ease); }
.loadbar__text.is-swap, [data-quips].is-swap { opacity: 0; }
.loadbar--page { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0 20px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  align-items: center; text-align: center; }
.loadbar--page .loadbar__track { width: 100%; margin: 0 -20px; width: calc(100% + 40px); }
.loadbar--inline { padding: 8px 0 8px 16px; max-width: 320px; }
@media (prefers-reduced-motion: reduce) { .loadbar__track > span { animation-duration: 3s; } }
.bub__quip { display: block; margin: 4px 0 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.warnbox { display: flex; gap: 8px; align-items: baseline; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: var(--r-md); padding: 12px 16px; font-size: 14px; }
.warnbox::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); flex: none; transform: translateY(-2px); }

/* Mobil: polkruh platieb menší, aby neprekrýval legendu */
@media (max-width: 640px) {
  .half { width: 184px; height: 184px; right: -72px; bottom: -92px; }
  .half::after { inset: 22px; }
}

/* Prázdny podnadpis nezaberá miesto */
.lead:empty { display: none; }
