/* client/styles/00-tokens.css */
/* Design tokeny – motiv WANET (světlý/tmavý). Komponenty i aplikace používají jen tyto proměnné. */
:root {
  --font-scale: 1;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* stupnice písma 12 / 14 / 16 / 20 (koncepce A, krok 1); xs jen pro drobné popisky (nadpisy oddílů, datum v liště) */
  --fs-xs: calc(11px * var(--font-scale));
  --fs: calc(14px * var(--font-scale));
  --fs-sm: calc(12px * var(--font-scale));
  --fs-lg: calc(16px * var(--font-scale));
  --fs-xl: calc(20px * var(--font-scale));
  --ctl: calc(32px * var(--font-scale));       /* výška ovládacích prvků */
  --ctl-sm: calc(26px * var(--font-scale));
  --row: calc(34px * var(--font-scale));       /* výška řádku tabulky */
  --r: 12px;
  --r-sm: 8px;
  --r-xs: 5px;
  --taskbar: calc(48px * var(--font-scale));
  --titlebar: calc(36px * var(--font-scale));

  --bg: #f4f3f0;
  --bg-2: #ebe9e4;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  /* řádky nastavení (návrh 3. 11.) */
  --canvas: #f5f4f1;
  --card: #ffffff;
  --line-soft: #efede8;
  --faint: #9a958c;
  --in-bg: #ffffff;
  --in-line: #cfcac1;
  --surface-3: #f1efea;
  --line: #e6e3dc;
  --line-2: #d9d5cc;
  --fg: #1c1b1a;
  --fg-2: #4b4844;
  --muted: #6f6b64; /* 5,2 : 1 na bílé (dřív 3,6 : 1) */
  --brand: #9b0030;
  --brand-hover: #7e0027;
  --brand-soft: #fbe9ee;
  --brand-ink: #5c001d;
  --cream: #f3eee6;
  --ok: #178a4c;
  --ok-soft: #e4f5ea;
  --warn: #c7760a;
  --warn-soft: #fff1dc;
  --bad: #c92a2a;
  --bad-soft: #fde7e7;
  --info: #2b6cb0;
  --info-soft: #e5eefa;
  --sh-1: 0 1px 2px rgba(28, 27, 26, 0.05), 0 1px 1px rgba(28, 27, 26, 0.03);
  --sh-2: 0 8px 24px rgba(28, 27, 26, 0.1), 0 2px 6px rgba(28, 27, 26, 0.06);
  --sh-win: 0 18px 50px rgba(28, 27, 26, 0.22), 0 2px 8px rgba(28, 27, 26, 0.1);
  --sh-win-focus: 0 24px 60px rgba(28, 27, 26, 0.3), 0 2px 8px rgba(28, 27, 26, 0.12);
  --glass: rgba(244, 243, 240, 0.94);
  --glass-line: rgba(28, 27, 26, 0.08);
  --wallpaper: linear-gradient(135deg, #5c001d 0%, #9b0030 45%, #c9496d 100%);
  --selection: var(--brand-soft);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --bg-2: #181818;
  --surface: #1d1d1d;
  --surface-2: #242424;
  --canvas: #141414;
  --card: #1f1f1f;
  --line-soft: #292929;
  --faint: #77736c;
  --in-bg: #171717;
  --in-line: #3e3e3e;
  --surface-3: #2a2a2a;
  --line: #2c2c2c;
  --line-2: #383838;
  --fg: #ececea;
  --fg-2: #c3c1bc;
  --muted: #8d8a84;
  --brand: #d92e5a; /* bílý text na tlačítku ≥ 4,5 : 1 (kontrola 23. 11.) */
  --brand-hover: #f04b74;
  --brand-soft: #3a1420;
  --brand-ink: #ffd3de;
  --brand-text: #ff7a99; /* text v barvě systému na tmavém podkladu (počty nepřečtených), kontrast ≥ 4,5 : 1 */
  --ok-soft: #0f2d1c;
  --warn-soft: #3a2608;
  --bad-soft: #3a1515;
  --info-soft: #132742;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --sh-2: 0 8px 24px rgba(0, 0, 0, 0.5);
  --sh-win: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px #383838;
  --sh-win-focus: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px #4a4a4a;
  --glass: rgba(24, 24, 24, 0.94);
  --glass-line: rgba(255, 255, 255, 0.08);
  --wallpaper: linear-gradient(135deg, #1a0008 0%, #5c001d 55%, #9b0030 100%);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"],
  :root:not([data-theme]) {
    --bg: #121212;
    --bg-2: #181818;
    --surface: #1d1d1d;
    --surface-2: #242424;
    --canvas: #141414;
    --card: #1f1f1f;
    --line-soft: #292929;
    --faint: #77736c;
    --in-bg: #171717;
    --in-line: #3e3e3e;
    --surface-3: #2a2a2a;
    --line: #2c2c2c;
    --line-2: #383838;
    --fg: #ececea;
    --fg-2: #c3c1bc;
    --muted: #8d8a84;
    --brand: #d92e5a; /* bílý text na tlačítku ≥ 4,5 : 1 (kontrola 23. 11.) */
    --brand-hover: #f04b74;
    --brand-soft: #3a1420;
    --brand-ink: #ffd3de;
    --brand-text: #ff7a99; /* text v barvě systému na tmavém podkladu (počty nepřečtených), kontrast ≥ 4,5 : 1 */
    --ok-soft: #0f2d1c;
    --warn-soft: #3a2608;
    --bad-soft: #3a1515;
    --info-soft: #132742;
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --sh-2: 0 8px 24px rgba(0, 0, 0, 0.5);
    --sh-win: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px #383838;
    --sh-win-focus: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px #4a4a4a;
    --glass: rgba(24, 24, 24, 0.94);
    --glass-line: rgba(255, 255, 255, 0.08);
    --wallpaper: linear-gradient(135deg, #1a0008 0%, #5c001d 55%, #9b0030 100%);
    color-scheme: dark;
  }
}

/* branding zákazníka: akcent (omezený jen na akcentovou barvu) */
:root[data-branded] {
  --brand: var(--brand-custom);
  --brand-hover: var(--brand-custom);
}

:root[data-density="compact"] {
  --ctl: calc(28px * var(--font-scale));
  --row: calc(28px * var(--font-scale));
}

/* client/styles/10-base.css */
/* Základ: reset, typografie, tlačítka, pole, odznaky, tabulka */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  /* aplikace: žádné přiblížení stránky dvojitým klepnutím ani štípnutím (čitelnost řeší velikost písma v Přizpůsobit) */
  touch-action: manipulation;
}
body {
  font: var(--fs) / 1.45 var(--font);
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
#app {
  height: 100%;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-xl);
}
h2 {
  font-size: var(--fs-lg);
}
h3 {
  font-size: var(--fs);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--fs-sm);
  margin-top: 14px;
}
p {
  margin: 0 0 10px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: var(--fs-sm);
}
.mono {
  font-family: var(--mono);
  font-size: 0.95em;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-xs);
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  vertical-align: -0.2em;
}
.icon.big {
  width: 2.4em;
  height: 2.4em;
}

/* tlačítka */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctl);
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover {
  background: var(--brand-hover);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.danger {
  color: var(--bad);
}
.btn.danger.primary {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn.sm {
  height: var(--ctl-sm);
  padding: 0 9px;
  font-size: var(--fs-sm);
}
.btn.wide {
  width: 100%;
}
.btn .icon {
  width: 1.15em;
  height: 1.15em;
}

/* pole */
.input {
  width: 100%;
  height: var(--ctl);
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}
.input.sm {
  height: var(--ctl-sm);
  font-size: var(--fs-sm);
  width: auto;
}
textarea.input {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  min-height: 60px;
}
select.input {
  padding-right: 28px;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input:read-only:not(select):not(button) {
  background: var(--surface-2);
}
.field {
  display: block;
  margin: 0 0 10px;
}
.field-label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 500;
}
.field-label .req {
  color: var(--bad);
}
/* posuvník u čísla s rozsahem (Field::slider) a šedá zděděná hodnota (Field::placeholder) */
.field-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-slider[hidden] {
  display: none;
}
.field-slider .field-num-short {
  width: 7em;
  flex: none;
}
.field-range {
  flex: 1;
  min-width: 80px;
  accent-color: var(--brand);
}
.field-range-end {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.field-view.placeholder {
  color: var(--muted);
  font-style: italic;
}
.input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.field-help {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 4px;
}
.field-error {
  font-size: var(--fs-sm);
  color: var(--bad);
  margin-top: 4px;
  min-height: 0;
}
.field.invalid .input {
  border-color: var(--bad);
}
.field-view {
  min-height: var(--ctl);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}
.field-view.multiline {
  min-height: 60px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  margin: 0;
}
.check.inline {
  margin: 8px 0 4px;
  font-size: var(--fs-sm);
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* odznaky a avatary */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  background: var(--surface-3);
  color: var(--fg-2);
  line-height: 1.5;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad,
.badge.error {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge.info {
  background: var(--info-soft);
  color: var(--info);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  flex: none;
}
.badge.count {
  background: var(--brand);
  color: #fff;
  padding: 0 5px;
  min-width: 16px;
  justify-content: center;
  font-size: 10px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* tabulka */
table.t {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs);
}
table.t th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--fg-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  height: var(--row);
  white-space: nowrap;
  user-select: none;
}
table.t th.right,
table.t td.right {
  text-align: right;
}
table.t th.center,
table.t td.center {
  text-align: center;
}
table.t td {
  padding: 0 10px;
  height: var(--row);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
table.t tbody tr:hover td {
  background: var(--surface-2);
}
table.t tbody tr.selected td {
  background: var(--selection);
}
table.t tbody tr.cursor td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}
table.t th.sortable {
  cursor: pointer;
}
table.t th.sortable:hover {
  color: var(--fg);
}
.th-label {
  margin-right: 4px;
}
.sort-icon {
  width: 0.9em;
  height: 0.9em;
  color: var(--brand);
}
.th-resize {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}
table.t th {
  position: sticky;
}
table.t th:hover .th-resize {
  background: var(--line-2);
}
.cell-check {
  color: var(--ok);
}
.cell-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}
.cell-thumb {
  height: calc(var(--row) - 8px);
  border-radius: 3px;
  vertical-align: middle;
}

/* flash a drobnosti */
.flash {
  background: var(--bad-soft);
  color: var(--bad);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  margin-bottom: 10px;
}
.flash.ok {
  /* potvrzení (heslo nastavené) – ne červeně jako chyba */
  color: var(--ok, #2e7d32);
  background: color-mix(in srgb, var(--ok, #2e7d32) 10%, transparent);
  border-color: color-mix(in srgb, var(--ok, #2e7d32) 35%, transparent);
}
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
/* jednotný překryv načítání (loader() v components/misc) */
.iw-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-2, var(--bg)) 75%, transparent);
  transition: opacity 0.15s;
}
.iw-loader.pending {
  opacity: 0;
}
.iw-loader .spinner {
  margin: 0;
}
.iw-loader-track {
  width: min(240px, 70%);
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.iw-loader-bar {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.15s;
}
.iw-loader-detail {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  height: 100%;
}
.error-state .icon.big {
  color: var(--warn);
}
.error-title {
  font-weight: 600;
  color: var(--fg);
}
.error-id {
  font-size: var(--fs-sm);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* režim čtení: nápověda a hvězdička povinného pole patří k úpravám (kontrola 3. 11.) */
.record-view:not(.editing) .field .req,
.record-view:not(.layout-rows):not(.editing) .field .field-help {
  display: none;
}
.record-view:not(.editing) .field-bool input[type="checkbox"] {
  pointer-events: none;
}

.bool-mark {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: var(--fg-2);
}
.bool-mark[hidden] {
  display: none;
}

/* client/styles/20-components.css */
/* Komponenty: menu, dialog, toast, ribbon, záložky, strom, dělený panel, stavový řádek */

/* menu */
iw-menu {
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  max-width: min(360px, calc(100vw - 16px));
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  font-size: var(--fs);
  outline: none;
  animation: pop 0.1s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}
.menu-item {
  display: grid;
  grid-template-columns: 16px 20px 1fr auto 14px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: var(--ctl);
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
}
.menu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-item:hover,
.menu-item.focus {
  background: var(--surface-2);
}
.menu-item.disabled {
  opacity: 0.45;
  cursor: default;
}
.menu-item.danger {
  color: var(--bad);
}
.menu-check,
.menu-icon,
.menu-arrow {
  display: inline-flex;
  justify-content: center;
  color: var(--fg-2);
}
.menu-item.danger .menu-icon {
  color: var(--bad);
}
.menu-check .icon {
  color: var(--brand);
}
.menu-shortcut {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-left: 16px;
}
.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

/* dialog */
dialog.iw-dialog {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px); /* i dialog se zadanou šířkou (AI 640 px) se vejde na telefon */
  box-shadow: var(--sh-win);
  font: inherit;
}
dialog.iw-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}
dialog.iw-dialog form {
  position: relative;
  padding: 18px 20px 16px;
}
.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.dialog-close:hover {
  background: var(--bg-2);
  color: var(--fg);
}
.dialog-close + .dialog-body {
  padding-right: 28px; /* dialog bez nadpisu: text ne pod křížkem */
}
.dialog-title {
  padding-right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.dialog-title .icon {
  color: var(--warn);
}
.dialog-body {
  margin-bottom: 14px;
}
.dialog-buttons {
  display: flex;
  flex-wrap: wrap; /* víc tlačítek (AI: Zrušit, Znovu, Kopírovat, Odpovědět) – zalomit, ne oříznout */
  justify-content: flex-end;
  gap: 8px;
}

/* toast */
.toast-host {
  position: fixed;
  right: 16px;
  bottom: calc(var(--taskbar) + 12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10001;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-left-width: 4px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
  pointer-events: auto;
  cursor: pointer;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.ok {
  border-left-color: var(--ok);
}
.toast.ok .icon {
  color: var(--ok);
}
.toast.warn {
  border-left-color: var(--warn);
}
.toast.warn .icon {
  color: var(--warn);
}
.toast.error {
  border-left-color: var(--bad);
}
.toast.error .icon {
  color: var(--bad);
}
.toast.info {
  border-left-color: var(--info);
}

/* ribbon */
iw-ribbon {
  display: block;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  user-select: none;
}
.ribbon-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  min-height: calc(var(--ctl-sm) + 8px);
}
.ribbon-tabs {
  display: flex;
  gap: 2px;
}
.ribbon-tab {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  cursor: pointer;
}
.ribbon-tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.ribbon-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  margin-left: auto;
  flex: 0 0 auto;
}
/* kompaktní lišta: malá tlačítka přímo v hlavičkovém pruhu (místo oušek) */
.ribbon-bar,
.ribbon-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ribbon-row::-webkit-scrollbar,
.ribbon-bar::-webkit-scrollbar {
  display: none;
}
.ribbon-bar {
  flex: 0 1 auto;
}
.ribbon-sep {
  width: 1px;
  height: 18px;
  background: var(--line-2);
  margin: 0 4px;
  flex: 0 0 auto;
}
.ribbon-collapse,
.ribbon-search-toggle {
  flex: 0 0 auto;
  width: var(--ctl-sm);
  height: var(--ctl-sm);
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ribbon-collapse:hover,
.ribbon-search-toggle:hover {
  background: var(--surface-3);
  color: var(--fg);
}
/* sbalený ribbon: jen hlavička; kliknutí na ouško dočasně vysune tělo přes obsah */
iw-ribbon.collapsed:not(.peek) .ribbon-body {
  display: none;
}
iw-ribbon.collapsed.peek {
  position: relative;
}
iw-ribbon.collapsed.peek .ribbon-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  box-shadow: var(--sh-2);
  border-bottom: 1px solid var(--line);
}
/* mobil: jeden posuvný řádek, hledání jako lupa */
iw-ribbon.mobile .ribbon-body {
  padding: 4px 8px;
}
iw-ribbon.mobile .ribbon-right .search-wrap {
  display: none;
}
iw-ribbon.mobile.search-open .ribbon-right .search-wrap {
  display: flex;
  position: absolute;
  left: 8px;
  right: 44px;
  top: 4px;
  width: auto;
  z-index: 2;
}
iw-ribbon.mobile .ribbon-head {
  position: relative;
}
.ribbon-head:has(.ribbon-tabs[hidden]):has(.ribbon-bar[hidden]) {
  min-height: 0;
}
/* panel odspodu */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
  box-shadow: var(--sh-win);
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.18s ease-out;
}
@keyframes sheet-in {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.sheet-body {
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-body .ribbon-control,
.sheet-body .ribbon-control .input.sm,
.sheet-body .filter.range .input.sm {
  width: 100%;
  max-width: none;
}
.ribbon-body {
  display: flex;
  gap: 4px;
  padding: 6px 8px 4px;
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ribbon-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
  border-right: 1px solid var(--line);
}
.ribbon-group:last-child {
  border-right: 0;
}
.ribbon-group-items {
  /* malá tlačítka po dvou v sloupcích: mřížka (flex se zalomením do sloupců šířku dalších sloupců nezapočítá a přetéká do vedlejší skupiny) */
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, var(--ctl-sm));
  gap: 2px;
  align-items: start;
  justify-items: start;
}
.ribbon-group-items:has(.ribbon-btn:not(.small)) {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  max-height: none;
}
.ribbon-group-label {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}
.ribbon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.ribbon-btn .ribbon-icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
}
.ribbon-btn.small {
  flex-direction: row;
  min-width: 0;
  height: var(--ctl-sm);
  padding: 0 8px;
  gap: 6px;
}
.ribbon-btn.small .ribbon-icon {
  width: 16px;
  height: 16px;
}
.ribbon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
}
.ribbon-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.ribbon-btn.danger .ribbon-icon {
  color: var(--bad);
}
.ribbon-btn.primary .ribbon-icon {
  color: var(--brand);
}
.ribbon-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ribbon-caret {
  width: 10px;
  height: 10px;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 8px;
  height: var(--ctl-sm);
  width: 220px;
  color: var(--muted);
}
/* vlastní ✕ v poli hledání (HeadSearch); nativní ✕ prohlížeče skrytý, ať nejsou dvě */
.search-wrap .input.search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-wrap .search-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--text, #222) 10%, transparent); color: var(--text, #222); cursor: pointer; }
.search-wrap .search-clear:hover { background: color-mix(in srgb, var(--text, #222) 18%, transparent); }
.search-wrap .search-clear[hidden] { display: none; }
.fchip.removable .fchip-label { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* šipka „Kde hledat“ v poli hledání (Pošta) */
.search-wrap .search-scope-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: -4px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.search-wrap .search-scope-btn:hover { background: var(--hover, color-mix(in srgb, var(--text) 8%, transparent)); color: var(--text); }
/* hledání probíhá (HeadSearch): místo lupy kolečko */
.search-wrap .search-spin {
  display: none;
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.search-wrap.busy .search-spin {
  display: inline-block;
}
.search-wrap.busy > .icon:first-child {
  display: none;
}
.search-wrap .input.search {
  border: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: var(--fs-sm);
}

/* záložky */
iw-tabs {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  min-width: 0;
}
/* víc záložek, než se vejde (telefon, úzké okno): posouvá se jen pruh záložek, ne celé okno; linka je stín,
   aby ji podtržení aktivní záložky překrylo i v posuvném pruhu */
.tabs-head {
  display: flex;
  gap: 2px;
  box-shadow: inset 0 -1px 0 var(--line);
  padding: 0 4px;
  flex: 0 0 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin; /* na počítači je vidět, že další záložky jsou vpravo */
}
.tab {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--fg-2);
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  flex: 0 0 auto;
  white-space: nowrap;
}
.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.tabs-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.tab-panel {
  padding: 14px 16px;
}

/* dělený panel */
iw-split {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
iw-split.first-hidden > .split-first,
iw-split.first-hidden > .split-handle,
iw-split.overlay > .split-handle {
  display: none;
}
iw-split.overlay > .split-first {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: min(280px, 80%) !important;
  box-shadow: var(--sh-2);
}
.split-first {
  flex: 0 0 220px;
  min-width: 120px;
  overflow: auto;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.split-handle {
  width: 7px;
  margin: 0 -3px;
  cursor: col-resize;
  z-index: 1;
  position: relative;
  flex: none;
  outline: none;
  touch-action: none;
}
.split-handle:focus-visible::before { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); } /* fokus z klávesnice vidět */
.split-handle::before {
  /* úchyt uprostřed, ať je předěl vidět i bez najetí */
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 28px;
  margin: -14px 0 0 -1.5px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.35;
}
.split-handle:hover,
.split-handle:focus-visible {
  background: var(--brand-soft);
}
/* nad sebou */
iw-split.vertical {
  flex-direction: column;
}
iw-split.vertical > .split-first {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 120px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}
iw-split.vertical > .split-handle {
  width: auto;
  height: 7px;
  margin: -3px 0;
  cursor: row-resize;
}
iw-split.vertical > .split-handle::before {
  width: 28px;
  height: 3px;
  margin: -1.5px 0 0 -14px;
}
iw-split.vertical > .split-second {
  min-height: 0;
}
.split-second {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* strom */
iw-tree {
  display: block;
  padding: 6px 4px;
  font-size: var(--fs);
  user-select: none;
}
/* jednotný vzhled stromů (Správa serveru i firmy, Soubory, výběr složky; Pošta převzala totéž – náhled 4. 11., varianta B/P2):
   řádek 28 px (dotyk 32), odsazení 16 px, ikony v barvě textu, výběr = jemný podklad + svislý proužek + tučně */
.tree-row {
  --tree-row: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--tree-row);
  padding-right: 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  color: var(--fg);
}
@media (pointer: coarse) {
  .tree-row {
    --tree-row: 32px;
  }
}
.tree-row:hover {
  background: var(--surface-3);
}
.tree-row.selected {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  font-weight: 600;
}
.tree-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.tree-row.selected .tree-icon {
  color: var(--brand);
}
.tree-row.drop {
  outline: 2px dashed var(--brand);
}
iw-tree .tree-toggle {
  width: 16px;
  flex: none;
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
}
iw-tree .tree-toggle .icon {
  width: 12px;
  height: 12px;
}
.tree-icon {
  flex: none;
  color: var(--fg-2);
}
.tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stavový řádek */
.statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--ctl-sm);
  padding: 0 10px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--fg-2);
  flex: 0 0 auto;
}
.status-part:empty {
  display: none;
}
.status-part:last-child {
  margin-left: auto;
}
.pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ovládací prvky v ribbonu, štítky filtrů, vysouvací panel */
.ribbon-group.has-controls .ribbon-group-items {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  max-height: calc(2 * var(--ctl-sm) + 6px);
  max-width: 560px;
  gap: 4px 6px;
}
.ribbon-control {
  display: inline-flex;
  align-items: center;
}
.ribbon-control .input.sm {
  min-width: 100px;
  max-width: 170px;
}
.ribbon-control .filter.range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ribbon-control .filter.range .input.sm {
  min-width: 0;
  width: 122px;
}
.filter-dash {
  color: var(--muted);
}
.filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--ctl-sm);
  padding: 0 6px 0 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
}
.chip-label {
  color: var(--fg-2); /* kontrast i v tmavém vzhledu (kontrola 23. 11.) */
}
.chip .icon {
  width: 12px;
  height: 12px;
}
.ribbon-popover {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  animation: pop 0.1s ease-out;
}
.ribbon-popover .ribbon-control,
.ribbon-popover .ribbon-btn {
  width: 100%;
  justify-content: flex-start;
}
.ribbon-popover .ribbon-control .input.sm {
  max-width: none;
  width: 100%;
}
/* posuvný řádek: položky se nikdy nesmršťují ani nelámou – řádek se posouvá */
.ribbon-row > .ribbon-btn,
.ribbon-row > .ribbon-control,
.ribbon-bar > .ribbon-btn {
  flex: 0 0 auto;
}
.ribbon-body > .ribbon-group {
  flex: 0 0 auto;
}
.sheet-body .filter.range {
  flex-wrap: wrap;
}
.sheet-body .filter.range .input.sm {
  flex: 1 1 120px;
  width: auto;
}

/* adresní řádek (okna typu Průzkumník): navigace + cesta pod ribbonem */
iw-addressbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}
iw-addressbar .crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 6px;
  padding: 0 6px;
  height: var(--ctl-sm);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  overflow: hidden;
  white-space: nowrap;
}
.crumb {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--fg);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
}
.crumb:hover {
  background: var(--surface-2);
}
.crumb-sep {
  width: 12px;
  height: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}
.tree-toggle.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.address-extra {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

/* složená pole: opakované řádky, štítky, obrázek */
.rows-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.rows-row .input {
  width: auto;
  min-width: 0;
}
.rows-row .btn {
  flex: 0 0 auto;
  padding: 0 6px;
}
.rows-view-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.rows-type {
  color: var(--muted);
  font-size: var(--fs-sm);
  min-width: 70px;
}
.tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.tag-chip {
  gap: 6px;
  height: var(--ctl);
  padding: 0 10px 0 12px;
  border-radius: 999px;
  font-size: var(--fs);
}
.tag-x {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0 2px;
  color: var(--muted);
}
.tags-add {
  display: flex;
  gap: 6px;
}
.tags-add[hidden] {
  display: none;
}
.tags-input {
  flex: 1;
  min-width: 0;
}
.tags-ok {
  flex: 0 0 auto;
  width: var(--ctl);
  padding: 0;
  justify-content: center;
}
/* Přílohy záznamu (Field::attachments – Poznámky) */
.attach-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* soubor přetahovaný na okno se záznamem s přílohami */
.record-view.attach-drop .record-body {
  outline: 2px dashed var(--brand);
  outline-offset: -6px;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.attach-item .attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  text-align: left;
}
.image-field {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.image-box {
  width: 112px;
  height: 112px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-empty {
  color: var(--muted);
}
@media (max-width: 600px) {
  .rows-row {
    flex-wrap: wrap;
  }
}

/* režim výběru (dotyk): zaškrtávátko před položkou */
.sel-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--line-2);
  background: var(--surface);
  color: transparent;
  flex: 0 0 auto;
  margin-right: 6px;
  vertical-align: middle;
}
.sel-check .icon {
  display: none;
  width: 14px;
  height: 14px;
}
tr.selected .sel-check,
.tile.selected .sel-check,
.desktop-icon.selected .sel-check {
  background: var(--brand);
  border-color: var(--brand);
}
tr.selected .sel-check .icon,
.tile.selected .sel-check .icon,
.desktop-icon.selected .sel-check .icon {
  display: block;
  color: #fff;
  stroke: #fff;
}
.di-check {
  position: absolute;
  left: -6px;
  top: -6px;
}
.tile .sel-check {
  position: absolute;
  left: 6px;
  top: 6px;
  margin: 0;
}
.tile {
  position: relative;
}

/* barva: vzorník + vlastní */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.color-swatch.selected {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.color-swatch.custom {
  background: var(--c, var(--surface-2));
  color: var(--fg);
  border-style: dashed;
  border-color: var(--line-2);
}
.color-swatch.custom.selected {
  border-style: solid;
  border-color: var(--fg);
}
.color-swatch.custom .icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}
.color-custom {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.color-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-size: var(--fs-sm);
}
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* seznam: levý panel vrstev (zaškrtávátka s barvou) a dlaždice */
.list-view.has-side iw-split {
  flex: 1;
  min-height: 0;
}
.list-view.has-side .list-content {
  height: 100%;
}
.list-side {
  padding: 10px;
  font-size: var(--fs-sm);
  overflow: auto;
  height: 100%;
}
.list-side h3 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.layer input {
  accent-color: var(--brand);
  margin: 0;
}
.layer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.layer .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* cíl přetažení řádků (stejně jako složky ve stromu) */
.layer.drop {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
/* dialog „Přesunout do…“ – výběr vrstvy */
.layer-pick {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 50vh;
  overflow: auto;
}
.layer-pick .layer {
  padding: 6px 4px;
  border-radius: 4px;
}
.layer-pick .layer:hover {
  background: var(--surface-2);
}
/* obnovený rozpracovaný záznam: lišta nad formulářem */
.record-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: var(--fs-sm);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-bottom: 1px solid var(--line);
}
.record-notice span {
  flex: 1;
}
/* pomoc s textem (kap. 34): tlačítko AI u pole a dialog s návrhem */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  border-radius: 999px;
  padding: 0 7px;
  height: 20px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.75;
}
.ai-btn .icon {
  width: 13px;
  height: 13px;
}
.ai-btn:hover,
.field:focus-within .ai-btn {
  opacity: 1;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}
.ai-off .ai-btn {
  display: none;
}
.ai-dialog {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow: auto;
}
.ai-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ai-text {
  white-space: pre-wrap;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}
.ai-original .ai-text {
  max-height: 140px;
  overflow: auto;
  background: transparent;
  border: 1px dashed var(--line);
}
.ai-result .ai-text {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
/* práce AI: tři tečky (13. 11.) */
.busy-dots { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.busy-dots > span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: 0.25; animation: busy-dot 1.2s infinite ease-in-out; }
.busy-dots > span:nth-child(2) { animation-delay: 0.2s; }
.busy-dots > span:nth-child(3) { animation-delay: 0.4s; }
@keyframes busy-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .busy-dots > span { animation: none; opacity: 0.6; } }
.ai-working {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 8px 0;
}
.ai-note {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-note .icon {
  width: 14px;
  height: 14px;
}
.ai-error {
  color: var(--bad);
}
.icon.spin {
  animation: ai-spin 1.4s linear infinite;
}
@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}
iw-cards {
  display: block;
  height: 100%;
  overflow: auto;
  outline: none;
  padding: 10px;
  box-sizing: border-box;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.card {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: default;
  user-select: none;
  min-width: 0;
}
.card:hover {
  background: var(--surface-2);
}
.card.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.card-media {
  flex: 0 0 auto;
}
.card-img,
.card-initials {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 600;
  font-size: 18px;
}
.card-body {
  min-width: 0;
  flex: 1;
}
.card-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub,
.card-line {
  font-size: var(--fs-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-badge {
  margin-top: 4px;
}
.card .sel-check {
  position: absolute;
  left: 6px;
  top: 6px;
  margin: 0;
}
.card.selected .sel-check {
  background: var(--brand);
  border-color: var(--brand);
}
.card.selected .sel-check .icon {
  display: block;
  color: #fff;
  stroke: #fff;
}
@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* zaškrtávátka po skupinách */
.checks-field {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 18px;
}
.checks-group {
  break-inside: avoid;
}
.checks-group h3 {
  margin: 8px 0 4px;
}
.checks-group .check {
  display: flex;
  padding: 3px 0;
}
.checks-field.view .check input {
  display: none;
}
.checks-field.view .check::before {
  content: "•";
  color: var(--brand);
  margin-right: 6px;
}

/* výběr s barevnými tečkami (kalendář, adresář) a tečka v nabídce */
.menu-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.color-select-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; }
.color-select-btn .color-select-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-select-btn .chevron { width: 14px; height: 14px; transform: rotate(90deg); opacity: 0.6; }
.color-select .cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.color-select .cal-dot.empty { background: transparent; border: 1px dashed var(--line-2); }
.color-select-view { display: flex; align-items: center; gap: 8px; }
/* štítek ze společného seznamu (Nastavení → Štítky): barva štítku */
.tag-chip.colored { background: color-mix(in srgb, var(--tag) 16%, var(--surface)); color: var(--fg); box-shadow: inset 3px 0 0 var(--tag); }
/* dialog odkazu pro lidi mimo firmu */
.link-dlg { display: flex; flex-direction: column; gap: 4px; min-width: 0; } /* šířku dává dialog – min-width větší než dialog = vodorovné posouvání (13. 11.) */
.link-dlg p { overflow-wrap: anywhere; }
.link-url-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.link-url-row .input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: var(--fs-sm); }

/* sloupcový graf (components/chart.ts) */
.chart { display: flex; flex-direction: column; gap: 8px; position: relative; }
.chart-band { fill: var(--surface-2); pointer-events: none; }
.chart-hit { cursor: crosshair; touch-action: pan-x pan-y; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--sh-2); font-size: var(--fs-sm); white-space: nowrap; }
.chart-tip-head { color: var(--muted); margin-bottom: 2px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.chart-tip-name { color: var(--muted); }
.chart-legend { display: flex; gap: 16px; font-size: var(--fs-sm); color: var(--muted); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-scroll { overflow-x: auto; }
.chart-svg { display: block; max-width: none; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { stroke: var(--line-2, var(--line)); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-bar:hover { opacity: 0.8; }

/* okno Logy (views/logview.ts): textový výpis */
.log-view { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.log-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.log-field { display: flex; flex-direction: column; gap: 2px; }
.log-field .input { min-width: 0; }
.log-tools .log-field:nth-child(5) { flex: 1 1 200px; }
.log-lines { flex: 1; min-height: 0; overflow: auto; padding: 6px 12px; font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: 12px; line-height: 1.5; white-space: pre; background: var(--surface); }
.log-line { min-height: 18px; }
.log-follow { align-self: center; margin-bottom: 6px; }
.log-line.fresh { animation: log-fresh 2s ease-out; }
@keyframes log-fresh { from { background: var(--warn-soft); } to { background: transparent; } }
.log-line.ok { color: var(--ok, #2b8a3e); }
.log-line.warn { color: var(--warn, #b8860b); }
.apppw-warn { color: var(--warn, #b8860b); } /* R15: port pro tiskárny vypnutý */
.log-line.bad { color: var(--danger, #c92a2a); }
.log-foot { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-top: 1px solid var(--line); }

/* tlačítko akce v hlášce (Zpět po smazání) */
.toast-action {
  margin-left: 10px;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}

/* buňky tabulky: jeden řádek s výpustkou (celá hodnota v bublině) – široký obsah nevytlačí panel detailu */
iw-table td {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-icon .icon {
  width: 20px;
  height: 20px;
}

/* výběr období přehledu (components/period.ts): Den · Týden · Měsíc · Rok | ‹ název období › */
.period {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.period-units {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.period-units button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--fg-2);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 28px;
}
.period-units button:hover {
  color: var(--fg);
}
.period-units button[aria-checked="true"] {
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), inset 0 -2px 0 var(--brand);
}
.period-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  position: relative;
}
.period-arrow,
.period-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  border-radius: 6px;
  cursor: pointer;
}
.period-arrow {
  width: 32px;
  justify-content: center;
}
.period-label {
  padding: 0 10px;
  font-weight: 600;
  min-width: 9.5rem;
  justify-content: center;
}
.period-arrow:hover,
.period-label:hover {
  background: var(--surface-3);
}
.period-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
}
.period-label .icon {
  width: 16px;
  height: 16px;
  color: var(--fg-2);
}
/* skryté pole data – jen pro kalendář prohlížeče (showPicker) pod názvem období */
.period-date {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
:root[data-mode="mobile"] .chrome-bar .list-filters:has(.period) {
  flex-wrap: wrap;
}
@media (pointer: coarse) {
  .period-units button {
    min-height: 34px;
  }
  .period-arrow,
  .period-label {
    min-height: 38px;
  }
  .period-arrow {
    width: 38px;
  }
}

/* seznam změn z deníku (components/journal.ts): Aktivita, Historie, Vlastnosti */
.jr-list { display: flex; flex-direction: column; padding: 4px 0 8px; }
.jr-day { position: sticky; top: 0; z-index: 1; padding: 10px 14px 6px; background: var(--surface); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.jr-day::first-letter { text-transform: uppercase; }
.jr-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 8px 14px; border: 0; background: none; text-align: left; font: inherit; color: var(--fg); border-radius: var(--r-sm); }
.jr-row:hover { background: var(--surface-2); }
.jr-row.sub { padding-left: 30px; }
.jr-group { cursor: pointer; }
.jr-group.open { background: var(--surface-2); }
.jr-chev { flex: none; color: var(--muted); align-self: center; transition: transform .15s; }
.jr-group.open .jr-chev { transform: rotate(180deg); }
.jr-badge { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.jr-badge .icon { width: 16px; height: 16px; }
.jr-new { background: var(--ok-soft); color: var(--ok); }
.jr-edit { background: var(--info-soft); color: var(--info); }
.jr-del { background: var(--bad-soft); color: var(--bad); }
.jr-move { background: var(--surface-3); color: var(--fg-2); }
.jr-share { background: var(--warn-soft); color: var(--warn); }
.jr-send { background: var(--brand-soft); color: var(--brand-text, var(--brand)); }
.jr-dot { flex: none; width: 8px; height: 8px; margin: 7px 12px 0 0; border-radius: 50%; background: var(--line-2); }
.jr-main { flex: 1; min-width: 0; }
.jr-line { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.jr-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.jr-title.link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--fg); cursor: pointer; text-align: left; }
.jr-title.link:hover { color: var(--brand-text, var(--brand)); text-decoration: underline; }
.jr-title.gone { text-decoration: line-through; color: var(--fg-2); }
.jr-where { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-meta { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-lines { margin: 4px 0 0; padding: 0 0 0 16px; font-size: var(--fs-sm); color: var(--fg-2); }
.jr-lines li { margin: 1px 0; overflow-wrap: anywhere; }
.jr-thumb { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.jr-acts { flex: none; display: flex; gap: 2px; align-self: center; opacity: 0; transition: opacity .1s; }
.jr-row:hover .jr-acts, .jr-row:focus-within .jr-acts { opacity: 1; }
.jr-acts .lbl { display: none; }
@media (pointer: coarse) { .jr-acts { opacity: 1; } }
.jr-empty { padding: 24px; text-align: center; }
.jr-list.single .jr-row { padding: 8px 6px; }
.jr-list.single .jr-day { padding-left: 6px; background: transparent; position: static; }

/* formátovaný text ve formuláři (Field::html, components/richtext.ts) */
.rte { width: 100%; }
.rte-edit { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.rte-edit[hidden] { display: none; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.rte-editor { min-height: 140px; max-height: 360px; overflow: auto; padding: 8px 10px; outline: none; line-height: 1.45; word-break: break-word; contain: paint; }
.rte-editor:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.rte-editor img, .rte-view img { max-width: 100%; cursor: pointer; }
.rte-editor table td { outline: 1px dashed var(--line); } /* hranice buněk jen při psaní, do zprávy nejdou */
.rte-view { line-height: 1.45; word-break: break-word; overflow: auto; max-height: 360px; }
.rte-view[hidden] { display: none; }
.rte-table-dlg { display: flex; gap: 12px; }

/* otevřená nabídka: rámy (tělo zprávy, PDF) neberou kliknutí – klik do nich nabídku zavře (components/menu.ts) */
.menu-open iframe { pointer-events: none; }

/* řádek / karta, na kterou ukazuje číslo ve stromu (_tone: chyba červeně, čeká na rozhodnutí oranžově – nález 22) */
tr.tone-bad:not(.selected) > td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
tr.tone-warn:not(.selected) > td { background: color-mix(in srgb, var(--warn) 12%, transparent); }
tr.tone-bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.tone-warn > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.card.tone-bad:not(.selected) { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); box-shadow: inset 3px 0 0 var(--bad); }
.card.tone-warn:not(.selected) { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--warn); }

/* client/styles/30-window.css */
/* Okno (Win 11 styl): zaoblené rohy, jemný stín, titulek s tlačítky vpravo */
.windows-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.windows-layer > * {
  pointer-events: auto;
}
iw-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-win);
  overflow: hidden;
  min-width: 320px;
  min-height: 200px;
  outline: none;
  transition: opacity 0.12s, transform 0.12s;
  animation: win-in 0.14s ease-out;
}
@keyframes win-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}
/* okno čeká na popis a obsah (nejvýš 250 ms, pak s kolečkem) – neviditelné, objeví se plynule až hotové (nález 14) */
iw-window.opening {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  animation: none;
}
iw-window.focused {
  box-shadow: var(--sh-win-focus);
  border-color: var(--line-2);
}
iw-window:not(.focused) .win-titlebar {
  color: var(--muted);
}
iw-window.minimized {
  opacity: 0;
  transform: translateY(40px) scale(0.9);
  pointer-events: none;
}
iw-window.closing {
  opacity: 0;
  transform: scale(0.97);
}
iw-window.maximized {
  border-radius: 0;
  border: 0;
}
iw-window.dragging {
  transition: none;
  user-select: none;
}
iw-window.has-modal {
  pointer-events: none;
  filter: saturate(0.7) brightness(0.96);
}
iw-window.modal {
  z-index: 5000 !important;
}
iw-window.dirty .win-title::after {
  content: " •";
  color: var(--brand);
}
.win-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--titlebar);
  padding: 0 4px 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  user-select: none;
  cursor: default;
  flex: 0 0 auto;
}
iw-window.focused .win-titlebar {
  background: var(--surface);
}
.win-icon {
  display: inline-flex;
  color: var(--brand);
}
.win-title {
  flex: 1;
  font-weight: 600;
  font-size: var(--fs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-identity {
  font-size: var(--fs-sm);
  color: var(--warn);
  font-weight: 600;
}
iw-window.run-as {
  border-color: var(--warn);
}
.win-buttons {
  display: flex;
}
.win-btn {
  width: calc(var(--titlebar) + 8px);
  height: calc(var(--titlebar) - 5px); /* záhlaví má 1px čáru: lichá výška → tlačítko na celých pixelech (ostrý křížek, 13. 11.) */
  border: 0;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
}
.win-btn .icon {
  width: 14px;
  height: 14px;
}
.win-btn:hover {
  background: var(--surface-3);
  color: var(--fg);
}
.win-btn.close:hover {
  background: var(--bad);
  color: #fff;
}
.win-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.win-resize {
  position: absolute;
  z-index: 3;
}
.win-resize.n,
.win-resize.s {
  left: 8px;
  right: 8px;
  height: 6px;
  cursor: ns-resize;
}
.win-resize.n {
  top: -3px;
}
.win-resize.s {
  bottom: -3px;
}
.win-resize.e,
.win-resize.w {
  top: 8px;
  bottom: 8px;
  width: 6px;
  cursor: ew-resize;
}
.win-resize.e {
  right: -3px;
}
.win-resize.w {
  left: -3px;
}
.win-resize.ne,
.win-resize.nw,
.win-resize.se,
.win-resize.sw {
  width: 12px;
  height: 12px;
}
.win-resize.ne {
  top: -4px;
  right: -4px;
  cursor: nesw-resize;
}
.win-resize.nw {
  top: -4px;
  left: -4px;
  cursor: nwse-resize;
}
.win-resize.se {
  bottom: -4px;
  right: -4px;
  cursor: nwse-resize;
}
.win-resize.sw {
  bottom: -4px;
  left: -4px;
  cursor: nesw-resize;
}
iw-window.maximized .win-resize,
iw-window.force-max .win-resize {
  display: none;
}
.snap-hint {
  position: absolute;
  inset: 0;
  border: 2px solid var(--brand);
  background: var(--brand-soft);
  opacity: 0.5;
  border-radius: var(--r-sm);
  pointer-events: none;
  z-index: 9000;
}
.snap-hint[data-zone="left"] {
  right: 50%;
}
.snap-hint[data-zone="right"] {
  left: 50%;
}

/* pohledy uvnitř okna */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.list-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}
.list-view.loading .list-content {
  opacity: 0.6;
}
iw-table {
  display: block;
  position: relative;
}
.table-scroll {
  overflow: auto;
}
.table-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.filter.range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.filter-label {
  color: var(--muted);
}
.record-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.record-view .tab-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  align-content: flex-start;
}
/* záložka s vloženým oknem (Seznam): bez okrajů formuláře, výška celé záložky */
.record-view .tab-panel.record-embed {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap; /* zalamování formuláře by seznam zúžilo na šířku obsahu */
  min-height: 320px;
  height: 100%;
}
.record-view .tab-panel.record-embed > .view {
  flex: 1;
  min-height: 0;
  width: 100%;
}
.record-view .field.w-full {
  flex: 1 1 100%;
}
.record-view .field.w-half {
  flex: 1 1 calc(50% - 8px);
  min-width: 200px;
}
.record-view .field-bool {
  padding-top: 6px;
}
.record-view:not(.editing) .field-bool input {
  pointer-events: none;
}

/* mobil / tablet: okna přes celou plochu, větší cíle */
:root[data-mode="mobile"] iw-window {
  border-radius: 0;
  border: 0;
}
:root[data-mode="mobile"] .win-btn.max {
  display: none; /* na mobilu jsou okna vždy přes celou plochu; minimalizovat zůstává */
}
:root[data-mode="mobile"] .record-view .field.w-half {
  flex-basis: 100%;
}
:root[data-mode="tablet"] .win-btn,
:root[data-mode="mobile"] .win-btn {
  width: 44px;
}
@media (pointer: coarse) {
  :root {
    --ctl: calc(40px * var(--font-scale));
    --row: calc(40px * var(--font-scale));
  }
}

/* konzole správy (kap. 38): strom vlevo, hlavička s drobečky, stránka; detail (nový záznam) přes celou šířku */
.console-view iw-split.console-split {
  flex: 1;
  min-height: 0;
}
.console-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.console-search-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 8px 4px 2px 8px;
}
.console-search {
  flex: 1;
  min-width: 0;
  height: var(--ctl-sm);
}
.console-results {
  margin: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  max-height: 50%;
  overflow: auto;
  flex: 0 0 auto;
}
.console-results-group {
  padding: 6px 8px 2px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.console-result {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
.console-result:hover,
.console-result.active {
  background: var(--surface-3);
}
.console-result .result-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.console-result .result-sub {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}
.tree-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
}
.tree-dot.ok {
  background: var(--ok);
}
.tree-dot.warn {
  background: var(--warn);
}
.tree-dot.bad {
  background: var(--bad);
}
.tree-dot.info {
  background: var(--info);
}
.tree-dot.off {
  background: var(--line-2);
}
.tree-label.muted {
  color: var(--muted);
}
.console-nav iw-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
/* počty ve stromu podle významu: problém = červený odznak, prostý počet = šedé číslo, nepřečtené = tučně v barvě systému */
.tree-badge {
  margin-left: auto;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.tree-badge.bad {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.tree-badge.count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.tree-badge.unread {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-text, var(--brand));
}
.console-head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
  min-width: 0;
}
.console-crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.console-crumbs .crumb.current {
  font-weight: 600;
}
.console-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.console-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.console-body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}
.console-page,
.console-detail {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.console-page {
  flex: 1 1 auto;
}
.console-detail {
  flex: 1 1 auto;
  background: var(--surface);
}
.console-detail-layer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.console-detail-layer[hidden] {
  display: none;
}
.console-body.has-detail .console-page {
  display: none;
}
.console-body.has-detail .console-detail {
  flex: 1 1 100%;
}
.console-page > .view,
.console-detail-layer > .view {
  flex: 1;
  min-height: 0;
}

/* konzole: přehled skupiny (Systém, Pošta…) – dlaždice podřízených položek */
.console-group {
  padding: 20px 24px 32px;
  overflow: auto;
  background: var(--canvas); /* stejný podklad jako stránky nastavení (karty na plátně) */
  min-height: 100%;
}
.console-group > * {
  max-width: 880px;
}
.console-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: var(--fs-lg);
  font-weight: 600;
}
.console-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.console-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.console-tile:hover {
  background: var(--surface-3);
}
.console-tile.muted {
  color: var(--muted);
}
.console-tile-icon {
  display: flex;
  color: var(--brand);
}
.console-tile-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* bloky formuláře (Field::group), úzká pole (Field::narrow), jednotky (Field::unit) – návrh 6, 3. 11. 2026 */
.record-view .field-group {
  flex: 1 1 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2, var(--surface));
  padding: 6px 14px 4px;
  margin: 4px 0 12px;
  min-width: 0;
}
.record-view .field-group[hidden] {
  display: none;
}
.record-view .field-group-title {
  font-weight: 600;
  font-size: var(--fs);
  color: var(--brand);
  padding: 0 6px;
}
.record-view .field-group-help {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0 0 6px;
}
.record-view .field-group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  align-items: flex-start;
}
.record-view .field-group-body > .field.w-half {
  flex-basis: calc(50% - 12px); /* mezera bloku je 24 px – dvě poloviny vedle sebe (dřív se zalamovaly) */
}
.record-view .field.w-auto {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}
.record-view .field.w-auto .input {
  width: 9em;
}
.record-view .field.w-auto .field-slider {
  width: 26em;
  max-width: 100%;
}
.record-view .field.w-auto .field-slider .field-num-short {
  width: 5em;
}
.field-unit-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-unit-wrap[hidden] {
  display: none;
}
.field-unit {
  color: var(--muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.field-tip {
  margin-left: 4px;
  font-weight: 400;
}
:root[data-mode="mobile"] .record-view .field.w-auto {
  flex: 1 1 100%;
}

/* ------------------------------------------------------------------ řádky nastavení (návrh vzhledu 3. 11. 2026)
   Stránka nastavení = karty s řádky: popisek + popis | doplněk (posuvník, původ hodnoty) | hodnota | jednotka.
   Sloupce jsou stálé (stejné na celé stránce), takže čísla i jednotky jsou pod sebou bez ohledu na délku popisku. */
.layout-rows {
  --c-aux: 15rem;
  --c-val: 7rem;
  --c-unit: 5rem;
  background: var(--canvas);
}
.layout-rows .record-body,
.tab-panel.layout-rows {
  container-type: inline-size;
}
.tab-panel.layout-rows {
  background: var(--canvas);
}
/* sloupec doplňku (posuvník, původ hodnoty) jen tam, kde ho záložka potřebuje – jinak místo pro popisky (úzké okno) */
.layout-rows .tab-panel:not(:has(.frow-range, .frow-source)),
.tab-panel.layout-rows:not(:has(.frow-range, .frow-source)) {
  --c-aux: 0px;
}
.layout-rows > .record-body > iw-tabs > .tabs-body > .tab-panel:not(.record-embed),
.tab-panel.layout-rows {
  display: block;
  padding: 20px 24px 32px;
}
/* záložka s vloženým seznamem (Deník, Přihlášení…) zůstává seznamem – bez podkladu karet */
.layout-rows > .record-body > iw-tabs > .tabs-body > .tab-panel.record-embed {
  background: var(--surface);
}
.layout-rows .fgroup {
  max-width: 880px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
}
.layout-rows .fgroup[hidden] {
  display: none;
}
.layout-rows .fgroup-head h3 {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.layout-rows .fgroup-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 72ch;
}
.layout-rows .fcard {
  display: block;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
/* řádek */
.layout-rows .frow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--c-aux) var(--c-val) var(--c-unit);
  align-items: center;
  column-gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-soft);
  position: relative;
  margin: -1px 0 0; /* linka nad prvním viditelným řádkem zajede pod okraj karty (overflow) – i když první řádky schová režim čtení */
  min-width: 0;
}
.layout-rows .fcard > .frow:first-child {
  border-top: 0;
}
.layout-rows .frow[hidden] {
  display: none;
}
/* detail v režimu čtení: prázdné řádky a bloky bez hodnoty se schovají (jako u karty záznamu) */
.record-view.hide-empty:not(.editing) > .record-body > iw-tabs > .tabs-body > .tab-panel > .fgroup > .fcard > .frow.is-empty,
.record-view.hide-empty:not(.editing) > .record-body > iw-tabs > .tabs-body > .tab-panel > .fgroup:not(:has(.frow:not(.is-empty):not([hidden]))) {
  display: none;
}
.layout-rows .frow.frow-follows {
  border-top: 0;
  padding-top: 0;
  min-height: 44px;
}
.layout-rows .frow.changed::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.frow-label {
  min-width: 0;
}
.frow-name {
  display: block;
  font-size: 14px;
  color: var(--fg);
  font-weight: 400;
}
.frow-follows .frow-name {
  padding-left: 16px;
}
.frow-conn {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 4px;
  padding: 0 6px;
  margin-right: 6px;
}
.frow-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.frow-tip {
  margin-left: 6px;
}
/* nápověda ⓘ: tlačítko s ručičkou, bublina po kliknutí (components/tip.ts) */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}
.info-tip:hover,
.info-tip[aria-expanded="true"] {
  color: var(--brand);
}
.info-tip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.info-tip .icon {
  width: 15px;
  height: 15px;
}
.tip-bubble {
  position: fixed;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: min(360px, calc(100vw - 16px));
  padding: 10px 8px 10px 12px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.16);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  text-transform: none;
}
.tip-text {
  flex: 1;
  min-width: 0;
}
.tip-close {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 2px;
  margin: -2px 0 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}
.tip-close:hover {
  background: var(--surface-3);
  color: var(--fg);
}
.tip-close .icon {
  width: 14px;
  height: 14px;
}
.frow-aux {
  min-width: 0;
}
.frow-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.frow-range .field-range {
  flex: 1;
  min-width: 60px;
  accent-color: var(--brand);
}
.frow-end {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.frow-source {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 10px;
  padding: 1px 8px;
  justify-self: end;
  float: right;
}
.frow-value {
  min-width: 0;
}
.frow-value .input {
  width: 100%;
}
.frow-num .frow-value .input,
.frow-num .frow-value .field-view {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.frow-num .frow-value .input {
  appearance: textfield;
  -moz-appearance: textfield;
}
.frow-num .frow-value .input::-webkit-inner-spin-button,
.frow-num .frow-value .input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.frow-value .field-view {
  border: 0;
  padding: 0 11px;
  font-style: normal;
  display: flex;
  align-items: center;
}
.frow-num .frow-value .field-view {
  justify-content: flex-end;
}
/* text (adresa serveru, název…): hodnota přes sloupce doplňku, hodnoty i jednotky */
.frow-text .frow-value {
  grid-column: 2 / 5;
}
.frow-text .frow-aux,
.frow-text .frow-unit {
  display: none;
}
.frow-text .frow-value .field-view {
  padding: 0;
}
.frow-value .field-view.placeholder {
  font-style: normal;
  color: var(--faint);
}
.frow-unit {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
/* výběr: šířka podle nejdelší volby (aspoň sloupce hodnota + jednotka), zarovnaný vpravo */
.frow-select .frow-value {
  grid-column: 2 / 5;
  justify-self: end;
  width: auto;
  min-width: calc(var(--c-val) + var(--c-unit) + 12px);
  max-width: 100%;
}
.frow-select .frow-value .input {
  width: 100%;
}
.frow-select .frow-aux {
  display: none;
}
.frow-select .frow-unit {
  display: none;
}
/* přepínač vpravo (sloupce 3–4) */
.frow-bool .frow-switch {
  grid-column: 3 / 5;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.frow-bool .frow-unit {
  display: none;
}
.switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  order: 2;
  width: 40px;
  height: 20px;
  border-radius: 10px;
  border: 1px solid var(--in-line);
  background: var(--in-bg);
  position: relative;
  transition: background 0.15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.15s, background 0.15s;
}
.switch-input:checked + .switch-track {
  background: var(--brand);
  border-color: var(--brand);
}
.switch-input:checked + .switch-track::after {
  left: 23px;
  background: #fff;
}
.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.switch-input:disabled + .switch-track {
  opacity: 0.6;
  cursor: default;
}
.switch-text {
  order: 1;
  font-size: 13px;
  color: var(--muted);
}
/* široké prvky: popisek nahoře, prvek přes celou šířku */
.layout-rows .frow.frow-wide {
  display: block;
}
.layout-rows .frow-wide .frow-label {
  margin-bottom: 6px;
}
/* víceřádková hodnota v režimu čtení (poznámka, chyba úlohy): text bez čárkované linky */
.layout-rows .frow-wide .field-view {
  border: 0;
  padding: 0;
  min-height: 0;
}
/* chyba pod hodnotou, zarovnaná k pravému okraji hodnotového sloupce */
.layout-rows .frow .field-error {
  grid-column: 1 / -1;
  text-align: right;
  padding-right: var(--c-unit);
}
.layout-rows .frow.invalid .input {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}
/* stavový řádek (Field::status – Zdraví instalace): čip + text, podrobnosti šedě, odkazy na řádky v souhrnu */
.fstatus-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
}
.fstatus-main .badge {
  flex: 0 0 auto;
}
.fstatus-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.fstatus-detail {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fstatus-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
}
.fstatus-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.layout-rows .frow.flash {
  animation: frow-flash 1.6s ease-out;
}
@keyframes frow-flash {
  0%, 30% { background: color-mix(in srgb, var(--brand) 12%, transparent); }
  100% { background: transparent; }
}
/* stupnice bloku */
.fscale {
  margin: 8px 0 0;
}
.fscale-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-3);
}
.fscale-bar .seg {
  display: block;
  height: 100%;
}
.fscale-bar .tone-ok {
  background: var(--ok);
}
.fscale-bar .tone-warn {
  background: var(--warn);
}
.fscale-bar .tone-bad {
  background: var(--bad);
}
.fscale-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}
.fscale-legend .tone-ok::before,
.fscale-legend .tone-warn::before,
.fscale-legend .tone-bad::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}
.fscale-legend .tone-ok::before {
  background: var(--ok);
}
.fscale-legend .tone-warn::before {
  background: var(--warn);
}
.fscale-legend .tone-bad::before {
  background: var(--bad);
}
/* počet neuložených změn v záhlaví */
.rec-changes {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  align-self: center;
  margin-right: 6px;
  flex: none;
  cursor: help;
}
.rec-changes:empty {
  display: none;
}
.rec-changes::before {
  content: "●";
  margin-right: 5px;
  font-size: 9px;
  vertical-align: 2px;
}
/* úzký obsah (telefon, úzké okno) */
@container (max-width: 600px) {
  .layout-rows .frow {
    grid-template-columns: minmax(0, 1fr) 6rem 4.5rem;
  }
  .layout-rows .frow-value {
    grid-column: 2;
  }
  .layout-rows .frow-unit {
    grid-column: 3;
  }
  .layout-rows .frow-aux {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .layout-rows .frow-aux:empty {
    display: none;
  }
  .layout-rows .frow-aux:has(.frow-source) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 4px;
  }
  .layout-rows .frow:has(.frow-source) .frow-value,
  .layout-rows .frow:has(.frow-source) .frow-unit {
    grid-row: 1 / span 2;
  }
  .frow-source {
    float: none;
  }
  .layout-rows > .record-body > iw-tabs > .tabs-body > .tab-panel:not(.record-embed),
  .tab-panel.layout-rows {
    padding: 12px;
  }
  .layout-rows .frow-select .frow-value,
  .layout-rows .frow-bool .frow-switch,
  .layout-rows .frow-text .frow-value {
    grid-column: 2 / 4;
  }
  .layout-rows .frow-select .frow-value {
    min-width: 0;
    justify-self: stretch;
  }
}
@container (max-width: 420px) {
  .layout-rows .frow:has(.frow-desc) .frow-label {
    grid-column: 1 / -1;
  }
  .layout-rows .frow:has(.frow-desc):has(.frow-source) .frow-value,
  .layout-rows .frow:has(.frow-desc):has(.frow-source) .frow-unit {
    grid-row: 2;
  }
  .frow-bool .switch-text {
    display: none;
  }
  /* delší text (stav, jméno serveru): pod popisek přes celou šířku */
  .layout-rows .frow-text .frow-label,
  .layout-rows .frow-text .frow-value {
    grid-column: 1 / -1;
  }
}

.record-view .tab-empty {
  padding: 16px 4px;
  font-size: var(--fs-sm);
}
.record-view.editing .tab-empty {
  display: none;
}

/* konzole na telefonu: adresní řádek jen s cestou (← je v záhlaví, příkazy konzole v ⋮), strom přes ztmavenou stránku */
:root[data-mode="mobile"] .console-view iw-addressbar > .btn {
  display: none;
}
.console-split.overlay:not(.first-hidden) > .split-second::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.28);
}
.console-split > .split-second {
  position: relative;
}

.console-split.overlay:not(.first-hidden) .fab {
  display: none; /* vysunutý strom: plovoucí tlačítko stránky by leželo přes něj */
}

/* boční panel záznamu (13. 11.; RecordWindow::aside – Kalendář: náhled dne) a pole schovaná za „Přidat …“ */
.record-body.with-aside:not(.aside-compact) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 38%); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; }
.record-body.with-aside:not(.aside-compact) > iw-tabs, .record-body.with-aside:not(.aside-compact) > .record-aside { grid-row: 2; }
.record-body.with-aside:not(.aside-compact) > :not(iw-tabs):not(.record-aside) { grid-column: 1 / -1; grid-row: 1; } /* lišta konceptu, vizitka */
.record-body.with-aside:not(.aside-compact) > iw-tabs { min-width: 0; }
.record-body.with-aside:not(.aside-compact) > .record-aside { border-left: 1px solid var(--line); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.record-view .field.reveal-hidden { display: none; }
.record-view .rec-reveal { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--brand); font: inherit; padding: 6px 0; cursor: pointer; margin-right: 16px; }
.record-view .rec-reveal[hidden], .record-view:not(.editing) .rec-reveal { display: none; }
:root[data-mode="mobile"] .record-view .field-group-body > .field.w-half { flex-basis: 100%; }

/* client/styles/35-chrome.css */
/* ================= koncepce A (postup 60): záhlaví okna s ovládáním, lišta příkazů, štítky filtrů, detail vpravo, telefon =================
   Pravidla: ☰ vždy vlevo nahoře; pořadí ☰ · název · hlavní akce · akce nad výběrem · ⋯ · hledání · ⚙; neaktivní akce se schovají.
   Zatím jen okna s chrome 'bar' (živý vzor Kontakty). */
iw-window.has-header .win-titlebar {
  height: 48px;
  gap: 6px;
  padding-left: 8px;
}
.win-head-start,
.win-head-main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.win-head-start:empty,
.win-head-main:empty {
  display: none;
}
.win-head-main {
  flex: 1 1 0; /* šířka podle zbylého místa, ne podle počtu tlačítek – jinak se lišta s přetékáním do ⋯ zužuje a „co se vejde“ nesedí (konzole s cestou, nález 13) */
  min-width: 0;
}
iw-window.has-header .win-title {
  flex: 0 0 auto;
  max-width: 240px;
  font-size: calc(15px * var(--font-scale));
  margin-right: 6px;
}
iw-window.has-header .win-head-main:empty + .win-buttons {
  margin-left: auto;
}
.head-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.head-btn .icon {
  width: 20px;
  height: 20px;
}
.head-btn:hover {
  background: var(--surface-3);
  color: var(--fg);
}
.head-btn.head-menu {
  color: var(--brand);
}
.head-spacer {
  flex: 1;
}
.head-sel-count {
  flex: 1;
  font-weight: 600;
  font-size: calc(15px * var(--font-scale));
}
.win-head-main .head-search {
  flex: 0 1 260px;
  min-width: 120px;
  height: 34px;
  width: auto;
  border-radius: 999px;
  padding: 0 12px;
}
.win-head-main .head-search .input.search {
  font-size: var(--fs);
}

/* lišta příkazů */
iw-commandbar {
  display: block;
  flex: 1 1 0; /* šířka nezávislá na obsahu – jinak by se s přetékáním do ⋯ přelévala */
  min-width: 0;
  overflow: hidden;
}
.cbar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.cbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: var(--fs);
  cursor: pointer;
  flex: 0 0 auto;
}
.cbar-btn[hidden],
.cbar-sep[hidden] {
  display: none;
}
.cbar-btn .icon {
  width: 18px;
  height: 18px;
  color: var(--fg-2);
}
.cbar-btn .cbar-caret {
  width: 12px;
  height: 12px;
}
/* rozdělené tlačítko (Odeslat ▾): hlavní akce a šipka těsně u sebe, mezi nimi tenká dělicí linka */
.cbar-split {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
}
.cbar-split[hidden] {
  display: none;
}
.cbar-split > .cbar-split-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.cbar-split > .cbar-split-caret {
  padding: 0 7px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: inset 1px 0 0 rgb(255 255 255 / 0.35);
}
.cbar-split > .cbar-split-caret:not(.primary) {
  box-shadow: inset 1px 0 0 var(--line);
}
.cbar-split > .cbar-split-caret .cbar-caret {
  width: 14px;
  height: 14px;
}
/* staré okno psaní (patička): Odeslat + šipka */
.mail-send-split {
  display: inline-flex;
}
.mail-send-split > .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.mail-send-split > .btn + .btn {
  padding: 0 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: inset 1px 0 0 rgb(255 255 255 / 0.35);
}
.cbar-btn:hover:not(:disabled) {
  background: var(--surface-3);
}
.cbar-btn:disabled,
.cbar-btn:disabled .icon {
  color: var(--muted);
  cursor: default;
}
.cbar-btn.primary {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  padding: 0 14px;
}
.cbar-btn.primary .icon {
  color: #fff;
}
.cbar-btn.primary:disabled,
.cbar-btn.primary:disabled .icon {
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 500;
}
.cbar-btn.primary:hover:not(:disabled) {
  background: var(--brand);
  filter: brightness(1.1);
}
.cbar-btn.danger:hover:not(:disabled) .icon {
  color: var(--bad);
}
.cbar-btn.active {
  background: var(--brand-soft);
}
.cbar-more .icon {
  color: var(--fg);
}
.cbar-sep {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--line);
  flex: 0 0 auto;
}

/* štítky filtrů nad seznamem */
.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.list-filters[hidden] {
  display: none;
}
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  max-width: 100%;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
}
.fchip-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.fchip .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.fchip:hover {
  background: var(--surface-2);
}
.fchip.active {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand);
  font-weight: 600;
}
.fchip.clear {
  border-style: dashed;
  color: var(--muted);
}

/* seznam + detail vpravo */
.chrome-bar .list-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  height: 100%;
}
/* dělení seznam / detail drží šířku okna – široká tabulka posouvá uvnitř, ne za okraj okna (nález 13) */
.chrome-bar .list-body > .list-detail-split {
  min-width: 0;
}
/* uložená šířka seznamu (tažením v širším okně) nesmí v užším okně vytlačit detail ani přetéct */
.list-detail-split:not(.detail-off) > .split-first {
  max-width: calc(100% - 300px);
}
.list-detail-split > .split-first {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  min-width: 260px;
}
.list-detail-split > .split-first > .list-content {
  flex: 1;
  height: auto;
}
.list-detail-split > .split-second {
  display: flex;
  min-width: 0;
  min-height: 0; /* detail vpravo roluje uvnitř (Úkoly, 13. 11.) */
}
.list-detail-split.detail-off > .split-second,
.list-detail-split.detail-off > .split-handle,
.list-view.is-empty > .list-body > .list-detail-split > .split-second,
.list-view.is-empty > .list-body > .list-detail-split > .split-handle {
  display: none;
}
.list-detail-split.detail-off > .split-first,
.list-view.is-empty > .list-body > .list-detail-split > .split-first {
  flex: 1 1 auto !important;
  width: auto !important;
  border-right: 0;
}
.list-detail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.list-detail > .empty-state {
  margin: auto;
}
.record-view.in-pane {
  flex: 1;
  min-height: 0;
}

/* vysunutý panel (úzké okno): klepnutí vedle zavře */
.chrome-bar .side-backdrop {
  display: none;
}
.chrome-bar.side-open iw-split.overlay > .split-second > .side-backdrop {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.28);
}

/* dvouřádkový seznam (vedle detailu, telefon): avatar · jméno / telefon · e-mail */
iw-cards.rows {
  padding: 0;
}
iw-cards.rows .cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
iw-cards.rows .card {
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
iw-cards.rows .card.selected {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
iw-cards.rows .card-img,
iw-cards.rows .card-initials {
  width: 40px;
  height: 40px;
  font-size: 15px;
}
iw-cards.rows .card-body {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-sm);
  color: var(--muted);
}
iw-cards.rows .card-title {
  font-size: var(--fs);
  color: var(--fg);
}
iw-cards.rows .card-sub,
iw-cards.rows .card-line {
  display: inline;
}
iw-cards.rows .card-sub + .card-line::before,
iw-cards.rows .card-line + .card-line::before {
  content: " · ";
}
iw-cards.rows .card-sub:empty {
  display: none;
}
iw-cards.rows .card-sub:empty + .card-line::before {
  content: none;
}
iw-cards.rows .card-badge {
  display: none;
}
iw-cards.rows .card .sel-check {
  position: static;
  flex: 0 0 auto;
}

/* vizitka záznamu a skrytí prázdných polí v režimu čtení */
.record-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px 10px;
  text-align: center;
}
.record-card[hidden] {
  display: none;
}
.record-card-media img,
.record-card-media .card-initials {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 28px;
  font-weight: 600;
}
.record-card-title {
  font-size: calc(20px * var(--font-scale));
  font-weight: 700;
  margin-top: 6px;
}
.record-card-sub {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.record-card-acts {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.quick-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  padding: 8px 6px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink); /* čitelné i v tmavém režimu */
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.quick-act .icon {
  width: 20px;
  height: 20px;
}
.quick-act:hover:not(:disabled) {
  filter: brightness(0.96);
}
.quick-act:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}
.record-view.hide-empty:not(.editing) > .record-body > iw-tabs > .tabs-body > .tab-panel > .field.is-empty {
  display: none;
}
.record-view.chrome-bar:not(.editing) .field .ai-btn {
  display: none; /* AI pomáhá při psaní, ne při čtení */
}

/* telefon: horní lišta, plovoucí tlačítko, spodní lišta hromadných akcí */
.fab,
.sel-bar {
  display: none;
}
:root[data-mode="mobile"] iw-window.has-header .win-titlebar {
  height: 56px;
}
:root[data-mode="mobile"] iw-window.has-header .win-buttons,
:root[data-mode="mobile"] iw-window.has-header .win-icon {
  display: none;
}
:root[data-mode="mobile"] iw-window.has-header .win-title {
  flex: 1 1 auto;
  min-width: 0; /* dlouhý název se zkrátí (…), tlačítka vpravo zůstanou celá – připomínka 13, 10. 11. */
  max-width: none;
  font-size: 17px;
}
:root[data-mode="mobile"] iw-window.has-header .win-head-main {
  flex: 0 0 auto;
}
:root[data-mode="mobile"] iw-window.sel-mode .win-title,
:root[data-mode="mobile"] iw-window.search-open .win-title {
  display: none;
}
:root[data-mode="mobile"] iw-window.sel-mode .win-head-main,
:root[data-mode="mobile"] iw-window.search-open .win-head-main {
  flex: 1 1 auto;
}
:root[data-mode="mobile"] iw-window.search-open .head-search {
  flex: 1;
  height: 40px;
}
:root[data-mode="mobile"] iw-window.sel-mode .win-titlebar {
  background: var(--brand-soft);
}
:root[data-mode="mobile"] .head-btn {
  width: 44px;
  height: 44px;
}
:root[data-mode="mobile"] .chrome-bar .list-filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
:root[data-mode="mobile"] .fchip {
  height: 36px;
  flex: 0 0 auto;
}
:root[data-mode="mobile"] .chrome-bar .list-status {
  display: none;
}
:root[data-mode="mobile"] .chrome-bar {
  position: relative;
}
:root[data-mode="mobile"] .chrome-bar .fab:not([hidden]) {
  display: inline-flex;
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--sh-2);
}
:root[data-mode="mobile"] .chrome-bar .fab .icon {
  width: 20px;
  height: 20px;
}
:root[data-mode="mobile"] .chrome-bar .sel-bar:not([hidden]) {
  display: flex;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sel-act {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 12px;
}
.sel-act .icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
}
.sel-act.danger .icon {
  color: var(--bad);
}
:root[data-mode="mobile"] iw-cards.rows .card {
  min-height: 64px;
}
:root[data-mode="mobile"] .chrome-bar iw-cards.rows {
  padding-bottom: 84px; /* poslední řádek nesmí zakrýt plovoucí tlačítko */
}
:root[data-mode="mobile"] .record-view.chrome-bar .record-card-media img,
:root[data-mode="mobile"] .record-view.chrome-bar .record-card-media .card-initials {
  width: 96px;
  height: 96px;
}
@media (pointer: coarse) {
  .cbar-btn {
    height: 40px;
  }
  .quick-act {
    min-height: 56px;
  }
}
:root[data-mode="mobile"] .chrome-bar.side-open .fab {
  display: none !important;
}
.select-all-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.select-all-bar[hidden] {
  display: none;
}

/* plynulý seznam: zástupci nenačtených řádků, tabulka se posouvá sama */
iw-table.virtual {
  height: 100%;
  display: flex;
  flex-direction: column;
}
iw-table.virtual > .table-scroll {
  flex: 1;
  min-height: 0;
}
.chrome-bar .list-content:has(> iw-table.virtual) {
  overflow: hidden;
}
.ph-bar {
  height: 10px;
  width: 60%;
  margin: 5px 0;
  border-radius: 5px;
  background: var(--surface-3);
}
.ph-bar.short {
  width: 35%;
}
.card.ph {
  pointer-events: none;
}
.card.ph .card-initials {
  color: transparent;
}
tr.ph td {
  height: 33px;
}
tr.v-pad td {
  padding: 0;
  border: 0;
}

/* abeceda A–Z u pravého okraje seznamu */
.az-host {
  position: relative;
}
.az-index {
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 2px;
  z-index: 3;
  width: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 600;
  color: var(--brand);
  user-select: none;
  touch-action: none;
  cursor: pointer;
}
.az-index[hidden],
.az-bubble[hidden] {
  display: none;
}
.az-index:hover {
  background: var(--surface-2);
}
.az-l {
  line-height: 1;
  padding: 1px 0;
}
.az-l.off {
  color: var(--line-2);
}
.az-bubble {
  position: absolute;
  right: 40px;
  z-index: 4;
  min-width: 52px;
  height: 52px;
  padding: 0 8px;
  margin-top: -20px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-2);
  pointer-events: none;
}
.az-host:has(> .az-index:not([hidden])) iw-cards.rows .card {
  padding-right: 28px;
}
:root[data-mode="mobile"] .az-index {
  width: 26px;
  font-size: 11px;
}

/* úzké okno na PC (< 640 px): hledání z lupy přes lištu, Zobrazení v ⋯ (telefon má vlastní horní lištu) */
.head-search-btn {
  display: none;
}
:root:not([data-mode="mobile"]) iw-window.narrow:not(.pc-search) .win-head-main .head-search {
  display: none;
}
:root:not([data-mode="mobile"]) iw-window.narrow .head-search-btn {
  display: inline-flex;
}
:root:not([data-mode="mobile"]) iw-window.narrow.pc-search .head-search-btn,
:root:not([data-mode="mobile"]) iw-window.narrow.pc-search .win-head-main iw-commandbar,
:root:not([data-mode="mobile"]) iw-window.narrow .head-gear {
  display: none;
}
:root:not([data-mode="mobile"]) iw-window.narrow.pc-search .win-head-main .head-search {
  flex: 1;
}
.az-index.az-cramped {
  display: none;
}

/* detail s vizitkou se posouvá jako celek, záložky zůstanou přilepené nahoře (postup 65) */
.record-view.has-card .record-body {
  overflow: auto;
  display: block;
}
.record-view.has-card iw-tabs {
  display: block;
  min-height: 0;
}
.record-view.has-card .tabs-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}
.record-view.has-card .tabs-body {
  overflow: visible;
}
/* nízký detail: vizitka v jednom řádku */
.record-view.card-compact .record-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 10px 16px;
}
.record-view.card-compact .record-card-media img,
.record-view.card-compact .record-card-media .card-initials {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.record-view.card-compact .record-card-title {
  margin: 0;
  font-size: calc(16px * var(--font-scale));
}
.record-view.card-compact .record-card-text {
  flex: 1;
  min-width: 0;
}
.record-view.card-compact .record-card-acts {
  margin: 0;
  gap: 6px;
}
.record-view.card-compact .quick-act {
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border-radius: 50%;
}
.record-view.card-compact .quick-act span {
  display: none;
}
/* nadpis oddílu v nabídce (⋯: Vybrané / Kontakty / Zobrazení) */
.menu-head {
  padding: 6px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

/* telefon: řádky složených polí (adresa: typ, ulice, město, PSČ, stát) pod sebou přes celou šířku; čitelné písmo (postup 67) */
:root[data-mode="mobile"] .rows-row:has(> :nth-child(4)) {
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
:root[data-mode="mobile"] .rows-row:has(> :nth-child(4)) > .input {
  flex: 1 1 100% !important;
}
:root[data-mode="mobile"] .rows-row:has(> :nth-child(4)) > select.input {
  flex: 1 1 0 !important;
  order: -2;
}
:root[data-mode="mobile"] .rows-row:has(> :nth-child(4)) > .btn {
  order: -1;
}
:root[data-mode="mobile"] .input,
:root[data-mode="mobile"] .record-view .field-view {
  font-size: 16px; /* iPhone při menším písmu v poli přibližuje stránku */
}
:root[data-mode="mobile"] .rows-row:not(:has(> :nth-child(4))) > select.input {
  flex: 0 0 104px !important; /* typ (Mobil, Práce…) úzký, hodnota (číslo, e-mail) dostane zbytek */
}
:root[data-mode="mobile"] .rows-row:not(:has(> :nth-child(4))) > select.input.wide-select {
  flex: 2 1 0 !important; /* sloupec s dlouhými volbami (Příští pracovní den v…) */
  min-width: 0;
}
:root[data-mode="mobile"] .rows-row:not(:has(> :nth-child(4))) > select.input.wide-select ~ input.input {
  flex: 1 1 0 !important;
  min-width: 0;
}

/* prázdný seznam: jeden stav přes celé okno s cestou dál (Nový kontakt, Vymazat hledání) */
.list-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.list-content > .empty-state {
  margin: auto;
}

/* klávesnice v dlaždicích: kurzor (šipky) je vidět jen při ovládání klávesnicí */
iw-cards:focus-visible .card.cursor {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* dotyk (tablet, telefon): cíle aspoň 44 px (koncepce A, krok 1) */
:root:is([data-mode="tablet"], [data-mode="mobile"]) .fchip {
  height: 44px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .head-btn,
:root:is([data-mode="tablet"], [data-mode="mobile"]) iw-commandbar .cbar-btn {
  min-width: 44px;
  height: 44px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .head-search {
  height: 44px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) iw-menu .menu-item,
:root:is([data-mode="tablet"], [data-mode="mobile"]) .iw-dialog .dialog-buttons .btn {
  min-height: 44px;
}
/* telefon: tlačítka pod sebou přes celou šířku, hlavní nahoře (13. 11.) */
:root[data-mode="mobile"] .iw-dialog .dialog-buttons {
  flex-direction: column-reverse;
  align-items: stretch;
}
:root[data-mode="mobile"] .iw-dialog .dialog-close {
  width: 44px;
  height: 44px;
  top: 4px;
  right: 4px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .quick-act {
  min-width: 56px;
  min-height: 56px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .record-view.card-compact .quick-act {
  min-width: 44px;
  min-height: 44px;
}
/* abeceda: úzká na pohled, ale pás pro prst 44 px */
:root:is([data-mode="tablet"], [data-mode="mobile"]) .az-index {
  width: 44px;
  align-items: flex-end;
  padding-right: 8px;
  border-radius: 0;
  background: transparent;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .az-host:has(> .az-index:not([hidden])) iw-cards.rows .card {
  padding-right: 48px;
}
/* telefon: plovoucí „+ Nový…“ nesmí zakrýt konec abecedy */
:root[data-mode="mobile"] .chrome-bar:has(> .fab:not([hidden])) .az-index {
  bottom: 84px;
}

/* tlačítko lišty jen s ikonou (‹ › v Kalendáři) */
.cbar-btn.icon-only {
  padding: 0 8px;
}
.cbar-btn.icon-only .cbar-label {
  display: none;
}

/* středně široké okno (640–900 px): hledání užší, ať lišta pobere Upravit a akce nad výběrem */
:root:not([data-mode="mobile"]) iw-window.compact:not(.narrow) .win-head-main .head-search {
  flex: 0 1 170px;
  min-width: 110px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .list-empty-actions .btn {
  min-height: 44px;
}
.sel-act span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* konzole správy na počítači: cesta (drobečky) místo titulku okna, ← → vedle ní (návrh 1, 3. 11. 2026) */
iw-window.crumb-title .win-icon,
iw-window.crumb-title .win-title {
  display: none;
}
iw-window.crumb-title .win-head-start {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
iw-window.crumb-title .win-head-start .btn.sm {
  width: 28px;
  height: 28px;
  padding: 0;
}
iw-window.crumb-title .console-crumbs {
  margin-left: 4px;
  max-width: 46vw;
  flex: 0 1 auto;
}
iw-window.crumb-title .console-crumbs .crumb {
  border: 0;
  background: none;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 2em;
  flex: 0 1 auto;
}
iw-window.crumb-title .console-crumbs .crumb:hover {
  background: var(--surface-3);
  color: var(--fg);
}
iw-window.crumb-title .console-crumbs .crumb.crumb-root {
  color: var(--fg);
  font-weight: 600;
  flex-shrink: 0;
}
iw-window.crumb-title .console-crumbs .crumb.current {
  color: var(--fg);
  font-weight: 600;
  flex-shrink: 0;
  max-width: 260px;
}
iw-window.crumb-title .console-crumbs .crumb-sep {
  flex: none;
  color: var(--muted);
}

.list-detail-split > .split-first {
  min-width: 0;
  overflow: hidden;
}

/* client/styles/40-shell.css */
/* Plocha, hlavní panel, Start, zámek */
.desktop {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.desktop.taskbar-top {
  flex-direction: column-reverse;
}
.desktop-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  user-select: none; /* dvojklik na plochu neoznačí popisky ikon (připomínka 19, 10. 11.) */
  -webkit-user-select: none;
}
.desktop-area iw-window {
  user-select: text; /* v oknech výběr textu zůstává (lišty a ovládání si ho vypínají samy) */
  -webkit-user-select: text;
}
.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background: var(--wallpaper);
  background-size: cover;
  background-position: center;
  transition: background 0.3s;
}
.desktop-area.drop::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: var(--r);
  pointer-events: none;
}
.desktop-icons {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 96px);
  grid-auto-columns: 92px;
  gap: 6px;
  align-content: start;
  justify-content: start;
}
.desktop-icons[data-size="small"] {
  grid-template-rows: repeat(auto-fill, 72px);
  grid-auto-columns: 76px;
}
.desktop-icons[data-size="large"] {
  grid-template-rows: repeat(auto-fill, 120px);
  grid-auto-columns: 112px;
}
.di-shared {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--sh-1);
}
.di-icon {
  position: relative;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: var(--fs-sm);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.8), 0 1px 6px rgba(0, 0, 0, 0.6);
  cursor: default;
  width: 100%;
  overflow: hidden;
}
.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.desktop-icon.selected {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}
.di-icon {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}
.desktop-icons[data-size="small"] .di-icon {
  width: 30px;
  height: 30px;
}
.desktop-icons[data-size="large"] .di-icon {
  width: 60px;
  height: 60px;
}
.di-icon .icon {
  width: 100%;
  height: 100%;
  stroke-width: 1.6;
}
.di-shortcut {
  position: relative;
  display: inline-flex;
  width: 100%;
  height: 100%;
}
.di-arrow {
  position: absolute;
  left: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  background: #fff;
  color: var(--brand);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.di-arrow .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.di-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.di-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

/* hlavní panel */
.taskbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--taskbar);
  padding: 0 8px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--glass-line);
  z-index: 9500;
  flex: 0 0 auto;
  user-select: none;
}
.desktop.taskbar-top .taskbar {
  border-top: 0;
  border-bottom: 1px solid var(--glass-line);
}
.tb-left,
.tb-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.tb-left {
  flex: 1;
}
.desktop.taskbar-center .tb-left {
  justify-content: center;
}
.tb-start,
.tb-pin,
.tb-tray-btn,
.tb-user,
.tb-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--taskbar) - 10px);
  min-width: calc(var(--taskbar) - 10px);
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  position: relative;
}
.tb-start:hover,
.tb-pin:hover,
.tb-tray-btn:hover,
.tb-user:hover,
.tb-clock:hover,
.tb-task:hover {
  background: var(--surface-3);
}
.tb-start.active {
  background: var(--surface-3);
}
.tb-logo {
  width: 22px;
  height: 22px;
  color: var(--brand);
}
.tb-pin .icon,
.tb-tray-btn .icon {
  width: 20px;
  height: 20px;
}
.tb-pin .icon {
  color: var(--brand);
}
.tb-pinned {
  display: flex;
  gap: 2px;
  padding-right: 6px;
  margin-right: 4px;
  border-right: 1px solid var(--glass-line);
}
.tb-pinned:empty {
  display: none;
}
.tb-running {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
:root[data-mode="mobile"] .tb-running,
:root[data-mode="tablet"] .tb-running {
  /* víc oken než se vejde: posuv prstem, bez posuvníku */
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
:root[data-mode="mobile"] .tb-running::-webkit-scrollbar {
  display: none;
}
:root[data-mode="mobile"] .tb-running .tb-task {
  flex: none;
  scroll-snap-align: start;
}
.tb-task {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--taskbar) - 10px);
  max-width: 200px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent; /* nový vzhled: plochá tlačítka (jako Windows 11), bez karet a stínů */
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  position: relative;
}
/* běžící okno: krátká šedá čárka dole; aktivní: delší čárka v barvě značky + jemné pozadí */
.tb-task::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: var(--muted);
  transform: translateX(-50%);
  transition: width 0.15s ease, background 0.15s ease;
}
.tb-task .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
  flex: 0 0 auto;
}
.tb-task-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-task.active {
  background: var(--surface-3);
}
.tb-task.active::after {
  width: 18px;
  background: var(--brand);
}
.tb-task.minimized {
  opacity: 0.7;
}
.tb-task .badge.count {
  position: absolute;
  top: 2px;
  right: 2px;
}
.tb-tray {
  display: flex;
  gap: 2px;
}
.tb-tray-btn .badge.count {
  position: absolute;
  top: 2px;
  right: 2px;
}
.toast.clickable {
  cursor: pointer;
}
.tb-conn {
  display: inline-flex;
  padding: 0 6px;
  color: var(--muted);
}
.tb-conn.bad {
  color: var(--bad);
}
.tb-clock {
  flex-direction: column;
  line-height: 1.15;
  font-size: var(--fs-sm);
  padding: 0 10px;
}
.tb-time {
  font-weight: 600;
}
.tb-date {
  color: var(--muted);
  font-size: 11px;
}

/* Start */
.start-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--taskbar) + 10px);
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - var(--taskbar) - 30px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--glass-line);
  border-radius: var(--r);
  box-shadow: var(--sh-win);
  z-index: 9600;
  animation: start-in 0.14s ease-out;
  overflow: hidden;
}
.desktop:not(.taskbar-center) .start-menu {
  left: 10px;
  transform: none;
}
.desktop.taskbar-top .start-menu {
  bottom: auto;
  top: calc(var(--taskbar) + 10px);
}
@keyframes start-in {
  from {
    opacity: 0;
    transform: translateX(var(--sx, -50%)) translateY(10px);
  }
}
.desktop:not(.taskbar-center) .start-menu {
  --sx: 0;
}
.start-search {
  height: var(--ctl);
  border-radius: 999px;
  padding: 0 16px;
}
.start-section {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--fg-2);
  margin-top: 4px;
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  overflow: auto;
  max-height: 300px;
}
.start-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: center;
}
.start-tile:hover {
  background: var(--surface-3);
}
.start-tile .icon.big {
  width: 32px;
  height: 32px;
  color: var(--brand);
}
.start-tile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.start-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-line);
}
.start-user {
  flex: 1;
  font-weight: 500;
}

/* zámek a znovupřihlášení */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--wallpaper);
  color: #fff;
}
.lock-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.35);
}
.lock-screen > * {
  position: relative;
}
.lock-clock {
  font-size: 64px;
  font-weight: 200;
  letter-spacing: -0.02em;
}
.lock-date {
  font-size: 18px;
  margin: -8px 0 18px;
  opacity: 0.85;
}
.start-empty {
  grid-column: 1 / -1;
  padding: 12px 4px;
}
.lock-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
  color: var(--fg);
  background: var(--surface);
  padding: 24px;
  border-radius: var(--r);
  box-shadow: var(--sh-win);
}
.lock-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
}
.lock-name {
  font-size: var(--fs-lg);
  font-weight: 600;
}
.lock-hint {
  text-align: center;
  font-size: var(--fs-sm);
}

/* přizpůsobení */
.personalize .field {
  margin-bottom: 12px;
}
.personalize input[type="range"] {
  width: 100%;
}

/* mobil */
:root[data-mode="mobile"] .desktop-icons {
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, 84px);
  grid-template-rows: none;
  grid-auto-columns: auto;
}
:root[data-mode="mobile"] .tb-task {
  max-width: 48px;
  padding: 0 12px;
}
:root[data-mode="mobile"] .tb-clock .tb-date,
:root[data-mode="mobile"] .tb-conn {
  display: none;
}
:root[data-mode="mobile"] .start-menu {
  left: 8px;
  right: 8px;
  width: auto;
  transform: none;
}

/* mřížka ikon s explicitními pozicemi, výběr rámečkem, dlaždice tapet */
.desktop-icons {
  grid-auto-flow: column dense;
}
.marquee {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 2;
}
.wp-tiles {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.wp-tile {
  width: 56px;
  height: 36px;
  border: 2px solid var(--line-2);
  border-radius: var(--r-xs);
  background-size: cover;
  cursor: pointer;
}
.wp-tile:hover {
  border-color: var(--brand);
}
/* tabulka souborů – Soubory i okno Vybrat soubor (proto v jádře, ne v CSS aplikace) */
.files-table .name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: none;
}
.files-table .name-cell .icon {
  color: var(--brand);
  flex: 0 0 auto;
}
.files-table .w-date {
  width: 170px;
}
.files-table .w-type {
  width: 180px;
}
.files-table .w-size {
  width: 100px;
}
.files-table tr.drop td {
  background: var(--brand-soft);
}
.files-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.files-table th .sort-icon {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .files-table td {
  height: 44px;
}
.picker-list {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  outline: none;
}
/* Vybrat soubor: seznam a náhled vedle sebe (připomínka 20, 10. 11.) */
.picker-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.picker-preview {
  width: 240px;
  flex: 0 0 auto;
  border-left: 1px solid var(--line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  overflow: auto;
  word-break: break-word;
}
.picker-preview[hidden],
.picker-view.narrow .picker-preview,
:root[data-mode="mobile"] .picker-preview {
  display: none;
}
.picker-thumb-box {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.picker-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-1, 0 1px 3px rgb(0 0 0 / 0.15));
  background: var(--surface);
}
.picker-thumb-icon {
  width: 72px;
  height: 72px;
  color: var(--fg-2);
}
.picker-prev-name {
  font-weight: 600;
}
.picker-list .files-table tr[data-id] {
  cursor: default;
}
/* telefon: v okně výběru jen název a datum */
:root[data-mode="mobile"] .picker-list th:nth-child(3),
:root[data-mode="mobile"] .picker-list td:nth-child(3),
:root[data-mode="mobile"] .picker-list th:nth-child(4),
:root[data-mode="mobile"] .picker-list td:nth-child(4) {
  display: none;
}
.picker-list.drop {
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
}
.picker-buttons {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.personalize .check {
  display: flex;
  margin: 6px 0;
}

.personalize-view {
  padding: 16px 18px;
  overflow: auto;
}

/* okno Nahrávání */
.upload-view {
  padding: 12px 14px;
  gap: 8px;
}
.up-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.up-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.up-row {
  display: grid;
  grid-template-columns: 20px 1fr auto 90px;
  grid-template-areas: "i n s st" "i b b b";
  align-items: center;
  gap: 2px 8px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.up-row .icon {
  grid-area: i;
  color: var(--brand);
}
.up-name {
  grid-area: n;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up-size {
  grid-area: s;
}
.up-state {
  grid-area: st;
  text-align: right;
}
.up-state .icon.ok {
  color: var(--ok);
}
.up-row.error {
  background: var(--bad-soft);
}
.up-row.error .up-state {
  color: var(--bad);
}
.up-bar {
  grid-area: b;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.up-bar.total {
  height: 8px;
}
.up-bar-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.15s;
}
.up-row.ok .up-bar-fill {
  background: var(--ok);
}

/* Spustit jako: pruh nahoře */
.runas-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  border-radius: 0 0 var(--r) var(--r);
  background: var(--warn);
  color: #1d1d1f;
  font-size: var(--fs-sm);
  box-shadow: var(--sh-2);
}

.start-grid[hidden],
.start-section[hidden] {
  display: none;
}

/* štítky ikon na ploše (globální štítky) */
.di-tags { display: flex; gap: 3px; justify-content: center; }
.di-tag { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); }

/* Můj účet (shell/account.ts): stránky vlevo, obsah vpravo; telefon = stránky nahoře jako pruh */
.view.account-view {
  display: flex;
  flex-direction: row;
  height: 100%;
  min-height: 0;
  background: var(--surface);
}
.acc-nav {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
}
.acc-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  font: inherit;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.acc-nav-item:hover {
  background: var(--surface-3);
}
.acc-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-text, var(--brand));
  font-weight: 600;
}
.acc-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 18px 22px 24px;
}
.acc-title {
  margin: 0 0 14px;
  font-size: var(--fs-lg);
}
.acc-page h3 {
  margin: 18px 0 8px;
  font-size: var(--fs);
}
.acc-page > h3:first-child {
  margin-top: 0;
}
/* oddíly stránky (Zabezpečení: heslo / otisk prstu / e-maily …) – odsazení a dělicí čára; nadpis oddílu bez
   vlastního odsazení (dřív :first-child nadpisu v oddílu odsazení vynuloval a oddíly se slepily) */
.acc-sec {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.acc-email-row > .acc-btns {
  flex: none;
  flex-direction: row;
  gap: 6px;
}
.acc-sec > h3:first-child {
  margin-top: 0;
}
.acc-page .field {
  margin-bottom: 10px;
  max-width: 420px;
}
.acc-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.avatar.xl {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.acc-name {
  font-size: var(--fs-lg);
  font-weight: 600;
}
.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  border-bottom: 1px solid var(--line-soft);
}
.acc-label {
  flex: 0 0 140px;
}
.acc-row select {
  max-width: 220px;
}
.acc-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 6px 0;
}
.acc-check .check {
  display: flex;
}
.acc-check > .muted {
  flex-basis: 100%;
  padding-left: 26px;
}
/* Můj účet → Úložiště */
.st-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) 2fr auto;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}
.st-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}
.st-bar > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
}
.st-size {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.st-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.st-actions select {
  max-width: 260px;
}
.st-top-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
}
.st-top-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .st-row {
    grid-template-columns: 1fr auto;
  }
  .st-row .st-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
.acc-error {
  color: var(--bad);
  margin: 4px 0 8px;
  min-height: 1em;
}
.acc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.acc-link:hover {
  background: var(--surface-2);
}
/* Zabezpečení → E-maily (13. 11.): řádky jako odkazy níž – rámeček, odsazení, tlačítko vpravo */
.acc-emails {
  margin-bottom: 6px;
}
.acc-email-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.acc-email-row > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
}
.acc-email-row > .btn {
  flex: none;
}
.acc-notify-email .acc-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 520px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
}
.acc-link > span {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.acc-list {
  display: flex;
  flex-direction: column;
  max-width: 560px;
}
.acc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.acc-item-main {
  flex: 1;
  min-width: 0;
}
.acc-tag {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: var(--fs-xs);
}
.acc-tag.muted {
  background: var(--surface-3);
  color: var(--fg-2);
}
.account-view .personalize .field {
  max-width: 420px;
}
/* barva systému */
.accent-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.accent-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
  cursor: pointer;
}
.accent-swatch.on {
  box-shadow: 0 0 0 2px var(--fg);
}
.accent-custom input {
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
:root[data-mode="mobile"] .view.account-view {
  flex-direction: column;
}
:root[data-mode="mobile"] .acc-nav {
  flex: none;
  flex-direction: row;
  overflow-x: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 6px;
}
:root[data-mode="mobile"] .acc-nav-item {
  flex: none;
  min-height: 36px;
}
:root[data-mode="mobile"] .acc-body {
  padding: 14px 14px 20px;
}
:root[data-mode="mobile"] .acc-label {
  flex-basis: 110px;
}

/* dialog Vytvořit zástupce */
.sc-dialog .field {
  margin-bottom: 12px;
}
.sc-dialog .row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sc-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.sc-folder span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sc-icon {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--fg-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sc-icon:hover {
  background: var(--surface-3);
}
.sc-icon.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text, var(--brand));
}
.sc-dialog .check {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tb-clock[hidden] {
  display: none;
}

/* Centrum oznámení (K6) */
.notice-center {
  position: fixed;
  z-index: 9000;
  width: min(400px, calc(100vw - 16px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--surface, var(--bg));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.notice-center.mobile {
  left: 8px;
  right: 8px;
  bottom: 64px;
  width: auto;
  max-height: calc(100vh - 120px);
}
.notice-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.notice-head .spacer {
  flex: 1;
}
.notice-list {
  overflow-y: auto;
  flex: 1;
}
.notice-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 8px;
  padding: 9px 8px 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.notice-row:hover,
.notice-row:focus-visible {
  background: var(--hover, var(--brand-soft));
}
.notice-row.unread .notice-text {
  font-weight: 600;
}
.notice-row.unread .notice-ic {
  color: var(--brand);
}
.notice-ic {
  padding-top: 2px;
  color: var(--muted);
}
.notice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.notice-empty {
  padding: 18px 14px;
}
.notice-session {
  border-top: 1px solid var(--line-soft);
  padding: 6px 14px 10px;
  max-height: 30%;
  overflow-y: auto;
}
.notice-session-row {
  padding: 3px 0;
}
.badge.notices {
  background: var(--brand);
}
/* telefon: Soubory a Vybrat soubor dvouřádkově jako ostatní seznamy (soupis C.6) – název, pod ním datum a velikost;
   řazení je v nabídce ⋯ (Řadit podle) */
:root[data-mode="mobile"] .files-table thead {
  display: none;
}
:root[data-mode="mobile"] .files-table,
:root[data-mode="mobile"] .files-table tbody {
  display: block;
  width: 100%;
}
:root[data-mode="mobile"] .files-table tr[data-id] {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  row-gap: 1px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}
:root[data-mode="mobile"] .files-table tr[data-id] td {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
}
:root[data-mode="mobile"] .files-table tr[data-id] td.name-cell {
  grid-column: 1 / -1;
}
:root[data-mode="mobile"] .files-table tr[data-id] td:nth-child(2) {
  padding-left: 28px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
:root[data-mode="mobile"] .files-table tr[data-id] td:nth-child(3) {
  display: none;
}
:root[data-mode="mobile"] .files-table tr[data-id] td:nth-child(4) {
  display: block; /* jiné pravidlo pro telefon velikost skrývá – tady patří do druhého řádku */
  font-size: var(--fs-sm);
  color: var(--muted);
}
:root[data-mode="mobile"] .files-table tr[data-id].selected {
  background: var(--brand-soft);
}
:root[data-mode="mobile"] .files-table tr.vpad,
:root[data-mode="mobile"] .files-table tr.vpad td {
  display: block;
  padding: 0;
  border: 0;
}

/* Start – příkazy z hledání (K6, S18) */
.start-cmds { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.start-cmd { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: var(--radius-sm, 6px); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.start-cmd:hover, .start-cmd:focus-visible { background: var(--hover, rgba(127, 127, 127, .12)); }
.start-cmd > span:nth-child(2) { flex: 1; }

/* Kód pomoci (R6) */
.support-code { font: 600 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 12px; margin-bottom: 8px; border-radius: var(--radius-sm, 6px); background: var(--brand-soft, rgba(127, 127, 127, .12)); user-select: all; }
.acc-support .acc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }

/* okno Připomenutí (13. 11.) – přes všechna okna, nebere klávesnici; proužek = tlačítka ještě neaktivní */
:root:not([data-mode="mobile"]) .reminder-panel .rem-head { cursor: move; } /* přesunout za horní lištu */
.reminder-panel.dragging { user-select: none; opacity: 0.96; }
.reminder-panel {
  position: fixed;
  z-index: 15000;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--r);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.reminder-panel .rem-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px; flex-wrap: wrap; }
.reminder-panel .rem-title { font-weight: 600; font-size: var(--fs-lg); display: inline-flex; align-items: center; gap: 4px; }
.reminder-panel .rem-tabs { display: flex; gap: 4px; }
.reminder-panel .rem-tab { border: 0; background: none; padding: 4px 10px; border-radius: 999px; color: var(--muted); cursor: pointer; font: inherit; }
.reminder-panel .rem-tab.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.reminder-panel .rem-n { margin-left: 6px; font-size: var(--fs-xs); background: var(--line); color: var(--fg); border-radius: 999px; padding: 0 6px; }
.reminder-panel .rem-head .spacer, .reminder-panel .rem-foot .spacer { flex: 1; }
.reminder-panel .rem-arm { height: 3px; background: transparent; }
.reminder-panel.arming .rem-arm { background: var(--brand); transform-origin: left; animation: rem-arm var(--arm, 1500ms) linear forwards; }
@keyframes rem-arm { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.reminder-panel .rem-list { overflow: auto; flex: 1; padding: 4px 0; }
.reminder-panel .rem-empty { padding: 18px 16px; }
.reminder-panel .rem-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line-soft); }
.reminder-panel .rem-row input[type=checkbox] { margin-top: 3px; }
.reminder-panel .rem-body { flex: 1; min-width: 0; cursor: default; }
.reminder-panel .rem-name { font-weight: 600; overflow-wrap: anywhere; }
.reminder-panel .rem-meta { margin-top: 2px; }
.reminder-panel .rem-wake { color: var(--info); display: inline-flex; align-items: center; gap: 4px; }
.reminder-panel .rem-ic { color: var(--muted); margin-top: 2px; }
.reminder-panel .rem-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.reminder-panel .rem-change { padding: 0 14px 10px 42px; }
.reminder-panel .rem-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--canvas); flex-wrap: wrap; }
.reminder-panel .rem-snooze-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reminder-panel .rem-custom { display: flex; align-items: center; gap: 6px; }
.reminder-panel .rem-custom[hidden], .reminder-panel .rem-custom [hidden] { display: none; }
.reminder-panel .rem-cnum { width: 70px; }
.reminder-panel select, .reminder-panel input[type=number], .reminder-panel input[type=datetime-local] { height: var(--ctl); }
.reminder-panel .rem-close { background: var(--bad); color: #fff; border-color: var(--bad); }
.reminder-panel .btn:disabled { opacity: 0.45; }
.toast-host { z-index: 15001; } /* bublina „Zavřeno · Vrátit“ nad oknem Připomenutí */
.notice-center .notice-reminders { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
@media (max-width: 720px) {
  .reminder-panel { top: auto; bottom: calc(var(--taskbar) + 8px); width: calc(100vw - 16px); max-height: 80vh; }
  .reminder-panel .rem-foot { justify-content: flex-end; }
}

/* client/styles/50-login.css */
/* Přihlášení: vlevo vínový panel s větrem, vpravo formulář (podle it.wanet.cz/prihlaseni) */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: auto;
  background: var(--bg);
}
.login-art {
  background: var(--brand-ink);
  background: linear-gradient(160deg, var(--brand-ink) 0%, var(--brand) 100%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-art canvas.wind {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.login-art > :not(canvas):not(.deco) {
  position: relative;
  z-index: 1;
}
.login-art .wlogo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.login-art .wlogo svg {
  width: 56px;
  height: 56px;
}
.login-art .brand-logo {
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
}
.login-art .big {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 520px;
}
.login-art .art-sub {
  opacity: 0.8;
  max-width: 420px;
  margin-top: 14px;
  font-size: var(--fs-lg);
}
.login-art .art-foot {
  opacity: 0.7;
  font-size: 12px;
}
.login-art .art-foot a {
  color: #fff;
}
.login-art .deco {
  position: absolute;
  right: -140px;
  bottom: -140px;
  width: 520px;
  opacity: 0.08;
}
.login-form {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-form .box {
  width: 100%;
  max-width: 380px;
}
.login-form h1 {
  font-size: 24px;
  margin-bottom: 4px;
}
.login-form .lead {
  margin: 0 0 16px;
}
.login-form .btn.wide {
  height: 38px;
  margin-top: 18px;
}
.login-form .foot {
  font-size: 12px;
  text-align: center;
  margin-top: 14px;
}
.login-form .mlogo {
  display: none;
}
.login-fields.hidden-form {
  display: none;
}
.account-tiles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.account-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "a n" "a l";
  column-gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.account-tile:hover {
  background: var(--surface-2);
  border-color: var(--brand);
}
.account-tile .avatar,
.account-chosen .avatar {
  grid-area: a;
}
.account-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.account-row .account-tile {
  flex: 1;
  min-width: 0;
}
.account-row .tile-remove {
  display: none;
  font-size: 18px;
  line-height: 1;
}
.account-tiles.editing .tile-remove {
  display: inline-flex;
}
.account-tiles.editing .account-tile {
  cursor: default;
}
.account-tiles.editing .account-tile:hover {
  background: var(--surface);
  border-color: var(--line-2);
}
.account-tiles .foot,
.login-fields .foot:has(.list-back) {
  margin-top: 4px;
}
.login-field-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.list-help {
  margin: 0;
}
.account-chosen {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "a n" "a l";
  column-gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  margin-bottom: 12px;
}
.tile-name {
  grid-area: n;
  font-weight: 600;
}
.tile-login {
  grid-area: l;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.powered-logo {
  display: inline-flex;
  color: var(--muted);
}
.powered-logo svg {
  height: 11px;
  width: auto;
}
.powered-logo:hover {
  color: var(--brand);
}
@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-art {
    display: none;
  }
  .login-form {
    padding: 28px 16px;
    align-content: start;
  }
  .login-form .mlogo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand);
    font-size: 22px;
    font-weight: 650;
    margin: 4px 0 24px;
  }
  .login-form .mlogo svg {
    width: 34px;
    height: 34px;
  }
}
@media (pointer: coarse) {
  .login-form input:not([type="checkbox"]) {
    font-size: 16px;
  }
}

/* apps/Ai/client/ai.css */
/* Asistent (kap. 34) */
.ai-view { display: flex; flex-direction: column; height: 100%; background: var(--surface); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.ai-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.ai-msg.user { align-self: flex-end; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ai-msg .ai-working { margin-top: 6px; }
.ai-action { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.ai-examples { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ai-example { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: var(--fs-sm); color: inherit; }
.ai-example:hover { background: var(--surface-2); }
.ai-foot { border-top: 1px solid var(--line); padding: 8px 10px; }
.ai-compose { display: flex; gap: 8px; align-items: flex-end; }
.ai-input { flex: 1; resize: none; min-height: 40px; }
.ai-buttons { display: flex; flex-direction: column; gap: 4px; }
.ai-send .icon { width: 18px; height: 18px; }
.ai-status { margin-top: 4px; }
.ai-error { color: var(--bad); }
.ai-action.ai-done { flex-direction: column; align-items: stretch; gap: 4px; }
.ai-done-head { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ai-changes { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; }
.ai-change.derived { background: color-mix(in srgb, var(--warn) 14%, transparent); border-radius: 4px; padding: 0 4px; margin-left: -4px; }
.ai-check { font-size: var(--fs-xs, 0.8em); }
.ai-done-buttons { display: flex; gap: 6px; padding-left: 22px; margin-top: 2px; }

/* apps/Aktivita/client/aktivita.css */
/* Aktivita: karty Dnes / Aktivita; Dnes = karty oddílů aplikací, Aktivita = proud změn s filtry (components/journal). */
.aktivita-view { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); }
.akt-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.akt-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.akt-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--fg-2); cursor: pointer; }
.akt-tab .icon { width: 16px; height: 16px; }
.akt-tab.active { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: var(--sh-1); }
.akt-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.akt-filters[hidden] { display: none; }
.akt-filter { display: flex; flex-direction: column; gap: 2px; }
.akt-filter select { min-width: 120px; }
.akt-body { flex: 1; min-height: 0; overflow-y: auto; }
.akt-loading { padding: 24px; text-align: center; }
.akt-older { display: block; margin: 8px auto 16px; }
.akt-end { padding: 8px 14px 16px; text-align: center; }

.akt-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding: 14px; align-items: start; }
.akt-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--card, var(--surface)); padding: 10px 6px 6px; display: flex; flex-direction: column; min-width: 0; }
.akt-card-head { display: flex; align-items: center; gap: 8px; padding: 2px 8px 8px; }
.akt-card-ic { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text, var(--brand)); }
.akt-card-ic .icon { width: 16px; height: 16px; }
.akt-card-title { flex: 1; font-weight: 600; }
.akt-card-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--surface-3); color: var(--fg-2); font-size: var(--fs-xs); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.akt-items { display: flex; flex-direction: column; }
.akt-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none; font: inherit; color: var(--fg); text-align: left; }
.akt-item.link { cursor: pointer; }
.akt-item.link:hover { background: var(--surface-2); }
.akt-item-ic { flex: none; width: 24px; display: inline-flex; justify-content: center; color: var(--muted); }
.akt-color { flex: none; width: 4px; align-self: stretch; min-height: 28px; border-radius: 2px; margin: 0 10px 0 4px; }
.akt-item-main { flex: 1; min-width: 0; }
.akt-item-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akt-item-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akt-item-time { flex: none; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.akt-item.now { background: var(--brand-soft); }
.akt-item.now .akt-item-text { font-weight: 600; }
.akt-item.past { opacity: .55; }
.akt-item.late .akt-item-time { color: var(--bad); font-weight: 600; }
.akt-item.warn .akt-item-ic { color: var(--warn); }
.akt-empty { padding: 6px 8px 8px; }
.akt-more { align-self: flex-end; margin-top: 2px; }
.akt-more .icon { width: 14px; height: 14px; }

.akt-history { height: 100%; overflow-y: auto; padding: 8px 10px; background: var(--surface); }
.akt-history-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; }

@media (max-width: 640px) {
  .akt-top { padding: 8px 10px; }
  .akt-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .akt-filter span { display: none; } /* popisky jsou v nabídce (Všichni, Vše, Všechny aplikace, Posledních 7 dní) */
  .akt-filter select { min-width: 0; width: 100%; }
  .akt-today { grid-template-columns: 1fr; padding: 10px; }
  .jr-row { padding: 8px 10px; }
}

/* apps/Chat/client/chat.css */
/* Chat: rozhovory vlevo, zprávy v bublinách vpravo (moje vpravo, cizí vlevo – jako Zprávy na Androidu), psaní dole
   (telefon: seznam / rozhovor přes celou obrazovku). */
.chat-view { display: flex; flex-direction: column; height: 100%; min-height: 0; --bub-mine: var(--brand-soft); --bub-theirs: var(--surface-3); --bub-r: 18px; --bub-r-in: 5px; }
.chat-view > iw-split { flex: 1; min-height: 0; }

/* ---- seznam rozhovorů */
.chat-side { height: 100%; overflow-y: auto; padding: 6px; background: var(--bg-2); }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 4px 8px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chat-side-add { width: 26px; height: 26px; padding: 0; }
.chat-side-empty { padding: 2px 8px 6px; }
.chat-room { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); cursor: pointer; position: relative; min-height: 56px; }
.chat-room:hover { background: var(--surface-3); }
.chat-room.active { background: var(--brand-soft); }
.chat-room-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-room-name { display: flex; align-items: center; gap: 4px; }
.chat-room-name .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-time { flex: none; margin-left: 6px; font-size: var(--fs-xs); color: var(--muted); }
.chat-room-sub { display: flex; align-items: center; gap: 6px; }
.chat-room-last { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--muted); }
.chat-room.unread .chat-room-name .n { font-weight: 700; }
.chat-room.unread .chat-room-last { color: var(--fg); font-weight: 600; }
.chat-room.unread .chat-room-time { color: var(--brand-text, var(--brand)); font-weight: 600; }
.chat-room.muted .chat-room-name .n { color: var(--fg-2); }
.chat-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: var(--fs-xs); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chat-badge.quiet { background: var(--surface-3); color: var(--fg-2); }

.chat-ava { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text, var(--brand)); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.chat-ava.sm { width: 30px; height: 30px; font-size: 12px; }
.chat-ava.sym { border-radius: 12px; background: var(--surface-3); color: var(--fg-2); }
.chat-ava.sym .icon { width: 18px; height: 18px; }
.chat-ava .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-2); background: var(--line); display: none; }
.chat-ava.online .dot { display: block; background: var(--ok); }

/* ---- rozhovor */
.chat-conv { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); position: relative; }
.chat-conv.drop { outline: 2px dashed var(--brand); outline-offset: -6px; }
.chat-conv-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); min-height: 56px; }
.chat-conv-head:empty { display: none; }
.chat-conv-name { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 4px; border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: var(--fs-lg); font-weight: 600; color: var(--fg); min-width: 0; }
.chat-conv-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-name:hover { background: var(--surface-3); }
.chat-conv-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; outline: none; }
.chat-loading, .chat-first { text-align: center; padding: 24px; }
.chat-older { display: block; margin: 4px auto 8px; }
.chat-day { display: flex; justify-content: center; margin: 16px 16px 8px; }
.chat-day span { padding: 3px 12px; border-radius: 12px; background: var(--surface-3); color: var(--fg-2); font-size: var(--fs-xs); font-weight: 600; }
.chat-day span::first-letter { text-transform: uppercase; }
.chat-sys { display: flex; justify-content: center; padding: 4px 16px; font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.chat-sys.deleted span { font-style: italic; }
.chat-sys.flash span { background: var(--brand-soft); border-radius: 8px; }

/* zpráva: řádek s bublinou u kraje, série navazujících zpráv těsně pod sebou */
.chat-msg { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 1px 16px; }
.chat-msg.first { margin-top: 10px; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.flash .chat-bubble, .chat-msg.flash .chat-media { box-shadow: 0 0 0 3px var(--brand); transition: box-shadow .3s; }
.chat-ava-gap { flex: none; width: 30px; }
.chat-col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(72%, 560px); min-width: 0; }
.chat-msg.mine .chat-col { align-items: flex-end; }
.chat-name { padding: 0 12px 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }

.chat-bubble { position: relative; max-width: 100%; padding: 8px 12px; border-radius: var(--bub-r); background: var(--bub-theirs); color: var(--fg); line-height: 1.4; overflow-wrap: anywhere; }
.chat-msg.mine .chat-bubble { background: var(--bub-mine); }
/* zaoblení v sérii: strana u kraje je u navazujících bublin méně kulatá */
.chat-msg.theirs:not(.first) .chat-bubble { border-top-left-radius: var(--bub-r-in); }
.chat-msg.theirs:not(.last) .chat-bubble { border-bottom-left-radius: var(--bub-r-in); }
.chat-msg.mine:not(.first) .chat-bubble { border-top-right-radius: var(--bub-r-in); }
.chat-msg.mine:not(.last) .chat-bubble { border-bottom-right-radius: var(--bub-r-in); }
.chat-bubble.emoji-only { background: none !important; padding: 0 2px; font-size: 34px; line-height: 1.2; }
.chat-bubble.deleted { background: none; border: 1px dashed var(--line-2); color: var(--muted); font-style: italic; font-size: var(--fs-sm); padding: 5px 10px; }
.chat-text { white-space: pre-wrap; }
.chat-text a { color: var(--brand-text, var(--brand)); text-decoration: underline; }
.chat-edited { display: inline-block; margin-left: 6px; font-size: var(--fs-xs); color: var(--muted); }
.chat-quote { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-width: 120px; text-align: left; margin: 0 0 6px; padding: 5px 10px; border: 0; border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--surface) 65%, transparent); border-radius: 8px; color: var(--fg-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; overflow: hidden; }
.chat-quote b { font-size: var(--fs-xs); color: var(--brand-text, var(--brand)); }
.chat-quote span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* obrázky a soubory: mimo bublinu – náhled se zaoblením, soubor jako dlaždice */
.chat-media { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; max-width: 100%; }
.chat-msg.mine .chat-media { align-items: flex-end; }
.chat-msg.theirs .chat-media { align-items: flex-start; }
.chat-img { padding: 0; border: 0; border-radius: 14px; background: var(--surface-3); cursor: zoom-in; overflow: hidden; }
.chat-img img { display: block; max-width: min(300px, 62vw); max-height: 260px; }
.chat-file { display: inline-flex; align-items: center; gap: 10px; max-width: 320px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; cursor: pointer; color: var(--fg); text-align: left; }
.chat-file:hover { background: var(--surface-2); }
.chat-file-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--bub-theirs); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-2); }
.chat-msg.mine .chat-file-ic { background: var(--bub-mine); color: var(--brand-text, var(--brand)); }
.chat-file-txt { display: flex; flex-direction: column; min-width: 0; }
.chat-file-txt .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chat-file-txt .small { color: var(--muted); }
.chat-link.denied { opacity: .65; cursor: default; }

/* reakce pod bublinou */
.chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 8px 0; position: relative; z-index: 1; }
.chat-react { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--fg); box-shadow: var(--sh-1); }
.chat-react .e { font-size: 14px; line-height: 1; }
.chat-react .n { font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }
.chat-react.mine { border-color: var(--brand); background: var(--brand-soft); }
.chat-react:hover { background: var(--surface-2); }

/* čas a Doručeno / Přečteno: pod poslední bublinou série; u ostatních po najetí (telefon: klepnutí) */
.chat-stamp { display: none; gap: 6px; padding: 2px 10px 0; font-size: 11px; color: var(--muted); }
.chat-msg.last .chat-stamp, .chat-msg.has-receipt .chat-stamp, .chat-msg.show-time .chat-stamp { display: flex; }
.chat-receipt:empty { display: none; }
.chat-receipt::before { content: "·"; margin-right: 6px; }

/* akce po najetí: hned vedle bubliny (cizí zpráva → vpravo od ní, moje → vlevo), místo drží i bez najetí – nic neposkočí */
.chat-acts { flex: none; align-self: center; display: flex; visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.chat-msg:hover .chat-acts, .chat-acts:focus-within { visibility: visible; }
.chat-msg.is-deleted .chat-acts { display: none; }
@media (pointer: coarse) { .chat-acts { display: none; } } /* telefon: akce dlouhým stiskem */
.chat-typing { min-height: 18px; padding: 0 16px 2px; font-style: italic; }

/* ---- psaní: zaoblené pole se smajlíkem uvnitř, sponka vedle, kulaté Odeslat */
.chat-composer { padding: 6px 10px 10px; background: var(--surface); }
.chat-ctxbar, .chat-files-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 6px 8px; font-size: var(--fs-sm); color: var(--fg-2); }
.chat-ctxbar { margin: 0 6px 6px; padding: 6px 6px 6px 10px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 8px; }
.chat-ctx-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 14px; max-width: 280px; background: var(--surface); }
.chat-chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-chip.link { border-style: dashed; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-compose-row > .btn { flex: none; width: 42px; height: 42px; min-width: 42px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.chat-input-wrap { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; padding: 2px 6px 2px 4px; border: 1px solid var(--in-line, var(--line-2)); border-radius: 22px; background: var(--in-bg, var(--surface)); }
.chat-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.chat-input-wrap .chat-emoji { flex: none; width: 36px; height: 36px; min-width: 36px; padding: 0; margin: 1px 0; border-radius: 50%; }
textarea.input.chat-input { flex: 1; resize: none; height: 38px; min-height: 38px; max-height: calc(1.4em * 5 + 16px); line-height: 1.4; padding: 8px 4px; border: 0; background: none; box-shadow: none; outline: none; }

/* výběr emoji (emoji.ts): nad tlačítkem, na telefonu panel odspodu */
.emoji-pop { position: fixed; z-index: 10002; width: 344px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--sh-2); overflow: hidden; animation: pop .1s ease-out; }
.emoji-pop.sheet { left: 0; right: 0; bottom: 0; width: auto; border-radius: var(--r) var(--r) 0 0; padding-bottom: env(safe-area-inset-bottom); }
.emoji-backdrop { position: fixed; inset: 0; z-index: 10001; background: rgba(0, 0, 0, .25); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 6px; height: 232px; overflow-x: hidden; overflow-y: auto; align-content: start; }
.emoji-pop.sheet .emoji-grid { height: 40vh; }
.emoji-head { grid-column: 1 / -1; padding: 2px 4px 4px; }
.emoji-btn { width: 100%; min-width: 0; padding: 0; height: 38px; border: 0; background: none; border-radius: 8px; font-size: 22px; line-height: 1; cursor: pointer; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--surface-3); }
.emoji-tabs { display: flex; border-top: 1px solid var(--line-soft); padding: 4px; gap: 2px; }
.emoji-tab { flex: 1; height: 34px; border: 0; background: none; border-radius: 8px; font-size: 18px; cursor: pointer; opacity: .6; }
.emoji-tab:hover { background: var(--surface-3); opacity: 1; }
.emoji-tab.active { background: var(--brand-soft); opacity: 1; }

/* rychlé reakce (najetí → smajlík, dlouhý stisk / pravé tlačítko nad nabídkou) */
.chat-quick-pop { position: fixed; z-index: 10002; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--sh-2); padding: 3px; animation: pop .1s ease-out; }
.chat-quick { display: flex; gap: 2px; }
iw-menu .chat-quick { padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.chat-quick-btn { width: 38px; height: 38px; border: 0; background: none; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chat-quick-btn:hover { background: var(--surface-3); transform: scale(1.12); }
.chat-quick-btn.on { background: var(--brand-soft); }
.chat-quick-btn.more { font-size: 16px; color: var(--fg-2); }

/* ---- dialogy, hledání */
.chat-dlg { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chat-dlg > p { margin: 0; }
.chat-picker { display: flex; flex-direction: column; gap: 6px; }
.chat-pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.chat-pick { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; min-height: 44px; }
.chat-pick:hover { background: var(--surface-3); }
.chat-pick > span:nth-of-type(2) { flex: 1; }
.chat-members { max-height: 240px; overflow-y: auto; }
.chat-member { display: flex; align-items: center; gap: 10px; padding: 5px 2px; }
.chat-member .n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-browse { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.chat-browse-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.chat-results { flex: 1; overflow-y: auto; padding: 10px 14px; }
.chat-results-head { padding: 4px 2px 10px; }
.chat-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 8px 6px; font: inherit; color: var(--fg); cursor: pointer; }
.chat-result:hover { background: var(--surface-3); }
.chat-meta { display: flex; align-items: baseline; gap: 8px; }

/* úzké okno / telefon */
.chat-view.narrow .chat-msg { padding-left: 8px; padding-right: 8px; }
.chat-view.narrow .chat-col { max-width: 82%; }
.chat-view.narrow .chat-conv-head { padding: 6px 10px; min-height: 50px; }
.chat-view.narrow .chat-composer { padding: 6px 6px 8px; }
.chat-view.narrow > iw-split > .split-first { flex: 1 1 auto !important; width: auto !important; max-width: none !important; border-right: 0; }
.chat-view.narrow > iw-split > .split-handle { display: none; }

/* zavřít rozhovor (najetí myší; telefon: dlouhý stisk → Zavřít) a oddíl Starší */
.chat-room-close { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--fg-2); box-shadow: var(--sh-1); display: none; align-items: center; justify-content: center; cursor: pointer; }
.chat-room-close .icon { width: 12px; height: 12px; }
.chat-room:hover .chat-room-close, .chat-room:focus-within .chat-room-close { display: inline-flex; }
.chat-room-close:hover { background: var(--surface-3); color: var(--fg); }
@media (pointer: coarse) { .chat-room:hover .chat-room-close { display: none; } }
.chat-older-head { width: 100%; border: 0; background: none; font: inherit; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; margin-top: 6px; }
.chat-older-head:hover { color: var(--fg); }
.chat-picker.disabled { opacity: .45; pointer-events: none; }
.chat-dlg .check { display: flex; gap: 8px; align-items: center; }

/* zmínky @Jméno: ve zprávě zvýrazněné (vlastní výrazněji), napovídání nad polem pro psaní */
.chat-mention {
  color: var(--accent);
  font-weight: 600;
}
.chat-mention.me {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: var(--r-xs);
  padding: 0 2px;
}
.chat-composer {
  position: relative;
}
.chat-mention-pop {
  position: absolute;
  left: 8px;
  bottom: 100%;
  z-index: 20;
  min-width: 200px;
  max-width: calc(100% - 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.chat-mention-item {
  text-align: left;
  background: none;
  border: 0;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
}
.chat-mention-item.active,
.chat-mention-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* apps/Desktop/client/desktop.css */
/* Správce úloh, O systému, Vlastnosti */
.tasks-view { display: flex; flex-direction: column; min-height: 0; }
.tasks-view > iw-tabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tasks-view .tab-panel { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.tasks-view iw-table { flex: 1; min-height: 0; }
.about-view,
.props-view {
  padding: 18px 20px;
  overflow: auto;
}
.about-head,
.props-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.about-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-mark {
  width: 34px;
  height: 34px;
}
.props-head .icon.big {
  color: var(--brand);
  width: 44px;
  height: 44px;
}
.about-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
.about-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.about-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 10px);
  background: var(--surface);
  text-align: center;
}
.about-app .icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
}
.about-app.system .icon {
  color: var(--fg-2);
}
.about-app-name {
  font-weight: 600;
  line-height: 1.2;
}
.about-app-ver {
  font-size: var(--fs-sm);
}
.about-foot {
  margin-top: 16px;
}

/* Vlastnosti: sdílení a verze */
.props-view iw-tabs {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.share-row.expired .share-name {
  color: var(--muted);
  text-decoration: line-through;
}
.share-row .icon {
  color: var(--brand);
}
.share-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-row select {
  width: auto;
}
.share-add {
  margin-top: 14px;
}
.share-add .row > * {
  flex: 0 1 auto;
}
.share-add .subj {
  min-width: 140px;
  max-width: 220px;
}
.share-until {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.version-actions {
  white-space: nowrap;
}
.version-actions .btn {
  padding: 0 6px;
}

/* Hesla aplikací */
.apppw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.apppw-row .icon {
  color: var(--brand);
}
.apppw-info {
  flex: 1;
  min-width: 0;
}
.apppw-list {
  margin: 12px 0;
}
.apppw-new {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--ok-soft);
}
.apppw-secret {
  display: flex;
  align-items: center;
  gap: 8px;
}
.apppw-secret code {
  font-size: 18px;
  letter-spacing: 0.04em;
  font-family: var(--mono);
  user-select: all;
}
.apppw-guide {
  margin-top: 18px;
}
/* synchronizace zařízení: karta služby = hodnoty + QR, pod tím postup */
.sync-card,
.apppw-section {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sync-card h3,
.apppw-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.sync-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sync-values {
  flex: 1 1 320px;
  min-width: 0;
}
.sync-values code {
  font-family: var(--mono);
  user-select: all;
  word-break: break-all;
}
.sync-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.sync-qr {
  width: 132px;
  height: 132px;
  padding: 6px;
  background: #fff;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.sync-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sync-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: var(--fs-sm);
}
.sync-steps li {
  margin: 2px 0;
}
.apppw-guide code {
  font-family: var(--mono);
  user-select: all;
}

/* Dvoufázové ověření */
.totp-qr {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  margin: 6px 0;
}
.totp-secret {
  font-family: var(--mono);
  user-select: all;
}
.totp-setup .input {
  width: 140px;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-align: center;
}
.totp-backup {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
}
.totp-codes {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 4px 24px;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 15px;
}

/* Připojení zařízení (záložky: postup, hesla aplikací, ruční nastavení) */
.dev-view { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.dev-view > iw-tabs { flex: 1; min-height: 0; }
.dev-view .tab-panel { padding: 14px 16px; overflow: auto; }
.dev-intro { margin: 0 0 12px; }
.dev-platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dev-platform { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.dev-platform .icon { width: 18px; height: 18px; }
.dev-platform:hover { background: var(--surface-2); }
.dev-platform.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.dev-card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.dev-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: var(--fs-lg); }
.dev-card-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); }
.dev-card-ic .icon { width: 18px; height: 18px; }
.dev-card-body { display: flex; gap: 16px; align-items: flex-start; }
.dev-steps { flex: 1; min-width: 0; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.dev-steps li::marker { font-weight: 700; color: var(--brand); }
.dev-step-text { line-height: 1.45; }
.dev-step-values { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.dev-steps .btn { margin-top: 8px; }
.dev-value { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 8px; padding: 2px 0; }
.dev-value code, .dev-box code { overflow-wrap: anywhere; background: var(--surface-2); padding: 3px 8px; border-radius: var(--r-xs, 4px); }
.dev-qr-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 140px; text-align: center; }
.dev-qr { background: #fff; padding: 6px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.dev-secret { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--ok); background: var(--ok-soft); border-radius: var(--r-sm); }
.dev-secret-val { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.dev-secret-val code { font-size: var(--fs-lg); letter-spacing: 0.04em; background: var(--surface); padding: 4px 10px; border-radius: var(--r-xs, 4px); }
.dev-pw-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dev-pw-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.dev-pw-ic { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface-2); flex: none; }
.dev-pw-info { flex: 1; min-width: 0; }
.dev-pw-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: var(--fs-xs); background: var(--surface-2); color: var(--muted); }
.dev-badge .icon { width: 12px; height: 12px; }
.dev-badge.ok { background: var(--ok-soft); color: var(--ok); }
.dev-badge.warn { background: var(--warn-soft); color: var(--warn); }
.dev-boxes { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.dev-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
:root[data-mode="mobile"] .dev-card-body { flex-direction: column; }
:root[data-mode="mobile"] .dev-value { grid-template-columns: 1fr auto; }
:root[data-mode="mobile"] .dev-value > .muted { grid-column: 1 / -1; }
.dev-card h3 { text-transform: none; letter-spacing: normal; }

/* Sdílet… – lidé ve firmě + odkazy mimo firmu (připomínka 30. 10. večer) */
.share-dlg { display: flex; flex-direction: column; gap: 20px; overflow: auto; }
.share-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-md, 14px); }
.share-links { display: flex; flex-direction: column; gap: 10px; }
.link-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md, 8px); background: var(--surface); }
.link-row.fresh { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.link-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.link-row-what { font-weight: 600; }
.link-row-head .spacer { flex: 1; }
.share-dlg .link-url-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-dlg .link-url-row .input { flex: 1 1 260px; min-width: 0; font-family: var(--mono, monospace); font-size: var(--fs-sm, 12px); }
.share-links-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Soubory jako disk: poznámky pod postupem */
.dev-notes {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

/* apps/Kalendar/client/kalendar.css */
/* Kalendář */
.cal-view {
  /* výplň události = barva kalendáře míchaná s podkladem (pastel), rámeček sytější; v tmavém motivu víc barvy */
  --ev-mix: 30%;
  --ev-mix-hover: 44%;
  --ev-line: 55%;
  --off-bg: color-mix(in srgb, var(--fg) 4%, transparent);
}
:root[data-theme="dark"] .cal-view {
  --ev-mix: 42%;
  --ev-mix-hover: 56%;
  --ev-line: 70%;
  --off-bg: color-mix(in srgb, var(--fg) 5%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .cal-view,
  :root:not([data-theme]) .cal-view {
    --ev-mix: 42%;
    --ev-mix-hover: 56%;
    --ev-line: 70%;
    --off-bg: color-mix(in srgb, var(--fg) 5%, transparent);
  }
}
.cal-view iw-split {
  min-height: 0;
}
.cal-side {
  padding: 10px;
  font-size: var(--fs-sm);
}
.cal-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.cal-mini-title {
  font-weight: 600;
  text-transform: capitalize;
}
.cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}
.cal-mini-dow {
  color: var(--muted);
  font-size: var(--fs-xs);
  padding: 2px 0;
}
.cal-mini-day {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-xs);
  padding: 3px 0;
  border-radius: var(--r-xs);
  cursor: pointer;
  color: var(--fg);
}
.cal-mini-day.other {
  color: var(--muted);
  opacity: 0.6;
}
.cal-mini-day.in-range {
  background: var(--brand-soft);
}
.cal-mini-day.today {
  font-weight: 700;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.cal-mini-day:hover {
  background: var(--surface-3);
}
.cal-cals {
  margin-top: 14px;
}
.cal-cal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.cal-cal.drop {
  outline: 2px dashed var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.cal-cal input {
  accent-color: var(--brand);
  margin: 0;
}
.cal-cal-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--ev, var(--brand));
}
.cal-head {
  padding: 8px 14px 4px;
}
.cal-title {
  margin: 0;
  font-size: var(--fs-lg);
}
.cal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* den / týden */
.cal-days {
  display: grid;
  border-bottom: 1px solid var(--line);
}
.cal-dayhead {
  border: 0;
  background: transparent;
  font: inherit;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  color: var(--fg);
}
.cal-dayhead .dow {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-transform: capitalize;
}
.cal-dayhead .num {
  font-size: var(--fs-xl);
  font-weight: 600;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 50%;
}
.cal-dayhead.today .num {
  background: var(--brand);
  color: #fff;
}
.cal-dayhead.off .dow,
.cal-dayhead.off:not(.today) .num,
.cal-month-dow.off {
  opacity: 0.6;
}
.cal-allday {
  display: grid;
  border-bottom: 1px solid var(--line);
  min-height: 26px;
  background: var(--surface-2);
}
.cal-gutter-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 4px 6px;
  text-align: right;
}
.cal-allday-lanes {
  display: grid;
  gap: 2px;
  padding: 2px;
  grid-auto-rows: 20px;
}
.cal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}
.cal-grid {
  display: grid;
  position: relative;
}
.cal-gutter {
  position: relative;
}
.cal-hour-label {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.cal-col {
  position: relative;
  border-left: 1px solid var(--line);
  touch-action: pan-y;
}
.cal-col.today {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
}
.cal-col.off-day {
  background: var(--off-bg);
}
.cal-off {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--off-bg);
  pointer-events: none;
}
.cal-hour {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}
.cal-hour::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent);
}
.cal-ev {
  position: absolute;
  box-sizing: border-box;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--ev) var(--ev-mix), var(--surface));
  border: 1px solid color-mix(in srgb, var(--ev) var(--ev-line), var(--surface));
  color: var(--fg);
  padding: 2px 5px;
  font-size: var(--fs-sm);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  z-index: 1;
  line-height: 1.25;
}
.cal-ev:hover,
.cal-ev.dragging {
  z-index: 3;
  box-shadow: var(--sh-2);
  background: color-mix(in srgb, var(--ev) var(--ev-mix-hover), var(--surface));
}
.cal-ev.ro,
.cal-chip.ro {
  cursor: default;
  border-style: dotted;
}
.cal-ev.tentative,
.cal-chip.tentative {
  border-style: dashed;
}
.cal-ev.cancelled .cal-ev-title,
.cal-chip.cancelled,
.cal-agenda-row.cancelled .cal-agenda-title {
  text-decoration: line-through;
  opacity: 0.7;
}
.cal-ev-time {
  font-size: var(--fs-xs);
  color: color-mix(in srgb, var(--fg) 70%, transparent);
}
.cal-ev-title {
  font-weight: 600;
}
/* krátký termín: čas a název na jednom řádku, název zkrácený třemi tečkami */
.cal-ev.short {
  display: flex;
  gap: 4px;
  align-items: baseline;
  white-space: nowrap;
  padding-top: 1px;
}
.cal-ev.short .cal-ev-time {
  flex: none;
}
.cal-ev.short .cal-ev-title {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cal-ev.short .cal-ev-loc {
  display: none;
}
.cal-ev-loc {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}
.cal-now {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--bad);
  z-index: 2;
  pointer-events: none;
}
.cal-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
}
.cal-sel {
  position: absolute;
  left: 2px;
  right: 2px;
  background: var(--brand-soft);
  border: 1px dashed var(--brand);
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  color: var(--brand);
  padding: 2px 4px;
  z-index: 2;
  pointer-events: none;
}

/* společný čip (celodenní pruhy, měsíc): stejná pastelová výplň jako událost v mřížce */
.cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--ev) var(--ev-line), var(--surface));
  text-align: left;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--ev) var(--ev-mix), var(--surface));
  color: var(--fg);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.cal-chip:hover {
  background: color-mix(in srgb, var(--ev) var(--ev-mix-hover), var(--surface));
}
.cal-chip-time {
  color: color-mix(in srgb, var(--fg) 65%, transparent);
  font-size: var(--fs-xs);
  flex: 0 0 auto;
}
.cal-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* měsíc */
.cal-month {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cal-month-dow {
  padding: 4px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-transform: capitalize;
}
.cal-week {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  position: relative;
  min-height: 0;
}
.cal-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cal-cell.other {
  background: var(--surface-2);
  color: var(--muted);
}
.cal-cell.off-day:not(.other) {
  background: var(--off-bg);
}
.cal-cell-lanes {
  flex: 0 0 auto;
}
/* pruhy přes dny: vrstva nad buňkami týdne, pod číslem dne */
.cal-month-lanes {
  position: absolute;
  left: 0;
  right: 0;
  top: 27px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 21px;
  pointer-events: none;
  padding: 0 1px;
}
.cal-month-lanes .cal-chip {
  pointer-events: auto;
  margin: 0 3px 1px;
}
.cal-cell.drop {
  background: var(--brand-soft);
}
.cal-cell-num {
  align-self: flex-end;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  color: inherit;
}
.cal-cell.today .cal-cell-num {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.cal-more {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  padding: 0 6px;
}

/* agenda */
.cal-agenda {
  flex: 1;
  overflow: auto;
  padding: 6px 14px 20px;
}
.cal-agenda-day {
  margin-bottom: 14px;
}
.cal-agenda-date {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.cal-agenda-day.today .cal-agenda-date b {
  color: var(--brand);
}
.cal-agenda-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: var(--r-xs);
  cursor: pointer;
}
.cal-agenda-row:hover {
  background: var(--surface-2);
}
.cal-agenda-time {
  width: 110px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.cal-agenda-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* nastavení zobrazení (dialog) */
.cal-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.cal-settings-label {
  width: 130px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.cal-settings-days {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-settings-hours {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 600px) {
  .cal-dayhead .num {
    font-size: var(--fs-lg);
    width: 28px;
    height: 28px;
    line-height: 28px;
  }
  .cal-agenda-time {
    width: 80px;
  }
}

/* koncepce A: Dnes ‹ › u nadpisu období */
.cal-head.cal-head-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 4px;
}
.cal-head-nav .cal-title {
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* dotyk (tablet, telefon): cíle aspoň 44 px jako v Kontaktech (vzor, bod E8) */
:root:is([data-mode="tablet"], [data-mode="mobile"]) .cal-mini-day {
  min-height: 40px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .cal-cal {
  min-height: 44px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .cal-agenda-row {
  min-height: 44px;
}
:root:is([data-mode="tablet"], [data-mode="mobile"]) .cal-head-nav .btn {
  min-width: 44px;
  height: 44px;
}
:root[data-mode="mobile"] .cal-head-nav .cal-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* náhled dne v okně termínu (13. 11.) */
.cal-den { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--canvas); }
.cal-den.compact { height: auto; background: none; width: 100%; }
.cal-den-head { padding: 10px 12px 2px; text-transform: none; }
.cal-den-line { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 12px 8px; font-size: var(--fs-sm); }
.cal-den.compact .cal-den-line { padding: 2px 0 8px; }
.cal-den-line > span { display: inline-flex; align-items: center; gap: 4px; }
.cal-den-hit { color: var(--bad); font-weight: 600; }
.cal-den.compact .cal-den-head, .cal-den.compact .cal-den-allday, .cal-den.compact .cal-den-scroll { display: none; }
.cal-den-allday { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 6px; }
.cal-den-chip { font-size: var(--fs-sm); background: var(--surface); border-left: 3px solid var(--line); padding: 2px 6px; border-radius: 4px; }
.cal-den-chip.me { border-left-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.cal-den-scroll { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); }
.cal-den-grid { position: relative; margin-right: 6px; }
.cal-den-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--muted); }
.cal-den-hour > span { position: absolute; left: 6px; top: -1px; }
.cal-den-ev { position: absolute; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 4px; font-size: var(--fs-xs); padding: 1px 4px; color: var(--fg); }
.cal-den-ev-t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-den-me { position: absolute; left: 44px; right: 4px; background: var(--brand); color: #fff; border-radius: 4px; font-size: var(--fs-sm); padding: 2px 6px; cursor: grab; opacity: 0.92; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); z-index: 2; touch-action: none; }
.cal-den-me.hit { background: var(--bad); }
.cal-den-me.drag { cursor: grabbing; opacity: 0.75; }
.cal-den-me.ro { cursor: default; }
.cal-den-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-den-grip.top { top: 0; bottom: auto; }

/* náhled dne: vícedenní přepínač, Zobrazit jako (13. 11.) */
.cal-den-head { display: flex; align-items: center; gap: 4px; }
.cal-den-title { flex: 1; min-width: 0; text-align: center; }
.cal-den-ev.free { opacity: 0.55; border-style: dashed; }
.cal-den-ev.tentative { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(127, 127, 127, 0.14) 6px 12px); }

/* apps/Kontakty/client/kontakty.css */
/* Kontakty */
.kontakty-import {
  padding: 18px 20px;
  overflow: auto;
}
.kontakty-import .import-file {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kontakty-import .import-result {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* apps/Posta/client/posta.css */
/* Pošta: trojpanel (složky | seznam | náhled), hustý seznam, náhled v iframe */
.mail-view { display: flex; flex-direction: column; height: 100%; }
.mail-view > iw-split { flex: 1; min-height: 0; }
.mail-side { height: 100%; overflow: auto; padding: 6px 4px; font-size: var(--fs); }
/* složky jako strom (stejný vzhled jako iw-tree – náhled 4. 11., varianta P2): řádek 28 px, odsazení 16 px, výběr s proužkem */
.mail-folder { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; border-radius: 6px; cursor: pointer; user-select: none; position: relative; color: var(--fg); white-space: nowrap; }
@media (pointer: coarse) { .mail-folder { height: 32px; } }
.mail-folder:hover { background: var(--surface-3); }
.mail-folder.active { background: color-mix(in srgb, var(--brand) 8%, transparent); font-weight: 600; }
.mail-folder.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--brand); }
.mail-folder.drop { outline: 2px dashed var(--brand); }
.mail-folder .mail-pin-acc { font-weight: 400; font-size: 12px; }
.mail-side-sep { height: 1px; margin: 6px 8px; background: var(--line-soft); }
.mail-folder .icon { width: 16px; height: 16px; flex: none; }
.mail-folder .mail-folder-icon { color: var(--fg-2); }
.mail-folder.active .mail-folder-icon { color: var(--brand); }
.mail-folder .chev-box { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--muted); }
.mail-folder .chev-box:hover { background: var(--surface-3); }
.mail-folder .chev-box .chev { width: 12px; height: 12px; transition: transform 0.15s; }
.mail-folder .chev-box.open .chev { transform: rotate(90deg); }
.mail-single { flex: 1; min-height: 0; outline: none; }
.mail-nav { display: flex; gap: 2px; align-items: center; margin-bottom: 6px; }
.mail-headers-view { display: flex; flex-direction: column; height: 100%; }
.mail-headers-bar { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.mail-headers { flex: 1; margin: 0; padding: 10px 14px; overflow: auto; font: var(--fs-sm)/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.mail-att[draggable="true"] { cursor: grab; }
.mail-atts-all { margin-left: auto; }
.mail-banner-ar { margin: 6px 8px 0; }
.mail-banner.mail-banner-iw { margin: 6px 8px 0; flex-wrap: nowrap; }
.mail-banner-iw > span { flex: 1 1 auto; min-width: 0; }
.mail-banner-ro { margin: 6px 8px 0; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.mail-label { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 4px; font-size: var(--fs-xs, 11px); line-height: 16px; color: var(--label); background: color-mix(in srgb, var(--label) 15%, transparent); border: 1px solid color-mix(in srgb, var(--label) 40%, transparent); white-space: nowrap; vertical-align: middle; }
.mail-msg-subject .mail-label { margin-left: 6px; font-weight: 400; }
.mail-side-head { padding: 10px 8px 2px; text-transform: uppercase; letter-spacing: .04em; }
.mail-labels-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.mail-labels-row input[type=color] { width: 32px; height: 28px; padding: 0 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.mail-labels-row .input { flex: 1; min-width: 0; }
.mail-labels-row .mail-label-kw { flex: 0 0 120px; font-family: var(--mono); }
.mail-labels-foot { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.mail-thread-count { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--muted); font-size: var(--fs-xs, 11px); font-weight: 500; }
.mail-thread { display: flex; flex-direction: column; min-height: 0; }
.mail-thread-title { padding: 12px 14px 6px; font-size: var(--fs-lg); font-weight: 600; }
.mail-thread-item { border-top: 1px solid var(--line); }
.mail-thread-head { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; cursor: pointer; }
.mail-thread-head:hover { background: var(--surface-2); }
.mail-thread-meta { min-width: 0; flex: 1; }
.mail-thread-snippet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-thread-item.open .mail-thread-snippet { display: none; }
.mail-thread-body { display: none; }
.mail-thread-item.open .mail-thread-body { display: flex; flex-direction: column; min-height: 320px; }
.mail-thread-item.open .mail-thread-head { display: none; }
.mail-thread-body .mail-msg-body { min-height: 300px; }
.mail-invite { margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.mail-invite.cancel { border-left-color: var(--bad); }
.mail-invite-title { font-size: var(--fs-xs, 11px); text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.mail-invite-summary { font-weight: 600; font-size: var(--fs-lg); }
.mail-invite-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.mail-invite-actions .btn.active { outline: 2px solid var(--brand); }
.mail-sender { border: 0; background: none; padding: 0 2px; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; border-radius: 4px; }
.mail-sender:hover { background: var(--surface-2); }
.mail-sender.known b { text-decoration: underline dotted; text-underline-offset: 3px; }
.mail-sort { white-space: nowrap; flex: none; }
.mail-sort .mail-sort-label { font-size: var(--fs-sm); }
.mail-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-folder.has-unread .mail-folder-name { font-weight: 600; }
.mail-folder.all { margin-bottom: 6px; }
/* nepřečtené: tučné číslo v barvě systému (jako ve stromech), ne bublina */
.mail-unread { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brand-text, var(--brand)); font-variant-numeric: tabular-nums; }
.mail-unread.clickable { cursor: pointer; border-radius: 9px; padding: 0 5px; margin-right: -5px; }
.mail-unread.clickable:hover { background: var(--brand-soft, var(--surface-2)); text-decoration: underline; }
.mail-account { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; margin-top: 6px; border-radius: 6px; font-weight: 600; cursor: pointer; user-select: none; }
.mail-account:hover { background: var(--surface-3); }
.mail-account .chev { width: 12px; height: 12px; margin: 0 2px; transform: rotate(90deg); transition: transform 0.15s; color: var(--muted); }
.mail-account.collapsed .chev { transform: none; }
.mail-account-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-account-state { padding: 2px 8px 6px 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-sync-error { color: var(--bad); width: 14px; height: 14px; }
.mail-side-empty { padding: 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.cal-dot.small { width: 7px; height: 7px; margin-left: 6px; }

.mail-content { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.mail-content > iw-split { flex: 1; min-height: 0; }
.mail-content iw-split > .split-first { background: transparent; } /* seznam zpráv má vlastní pozadí, ne pozadí stromu */
.mail-content.pos-off .mail-list-wrap, .mail-content.pos-narrow .mail-list-wrap, .mail-content.pos-narrow .mail-preview { flex: 1; }
.mail-list-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
/* období při tažení posuvníku – vlevo od posuvníku, sleduje jeho polohu */
.mail-scroll-date { position: absolute; right: 18px; z-index: 4; padding: 5px 12px; border-radius: 999px; background: var(--text, #222); color: var(--bg, #fff); font-size: var(--fs-sm); font-weight: 600; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); pointer-events: none; white-space: nowrap; }
.mail-scroll-date[hidden] { display: none; }
/* Přejít na datum: rok a mřížka měsíců */
.mail-goto { display: flex; flex-direction: column; gap: 10px; }
.mail-goto-head { display: flex; align-items: center; justify-content: center; gap: 6px; }
.mail-goto-year { width: auto; min-width: 90px; font-weight: 600; text-align: center; }
.mail-goto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mail-goto-month { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.mail-goto-month:hover:not(:disabled) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.mail-goto-month:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.mail-goto-month.empty { opacity: 0.45; cursor: default; }
.mail-goto-name { font-weight: 600; }
.mail-goto-count { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.mail-goto-quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
:root[data-mode="mobile"] .mail-goto-grid { grid-template-columns: repeat(3, 1fr); }
.mail-list-wrap.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.mail-list-head { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); }
/* úzké okno / mobil: hledání na celou šířku, pod ním filtr, řazení a stránkování */
.mail-content.pos-narrow .mail-list-head { flex-wrap: wrap; }
.mail-content.pos-narrow .mail-search { flex-basis: calc(100% - 44px); order: 0; }
.mail-content.pos-narrow .mail-folders-btn { order: 0; }
.mail-content.pos-narrow .mail-filter, .mail-content.pos-narrow .mail-sort, .mail-content.pos-narrow .mail-pager { order: 1; }
.mail-content.pos-narrow .mail-pager { margin-left: auto; }
.mail-content.pos-narrow .mail-row { padding: 10px 8px; }
.mail-search { flex: 1; min-width: 120px; }
.mail-filter { width: auto; }
.mail-pager { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.mail-list { flex: 1; overflow: auto; outline: none; }
.mail-group { position: sticky; top: 0; z-index: 1; padding: 3px 10px; font-size: var(--fs-xs, 11px); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mail-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); cursor: default; }
/* řádek zprávy jako dlaždice v Kontaktech: posouvání ani dlouhý stisk neoznačí text (telefon) */
.mail-row { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (hover: hover) { .mail-row:hover { background: var(--surface-2); } }
.mail-row.selected { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.mail-row.cursor { box-shadow: inset 3px 0 0 var(--brand); }
.mail-row.unread .mail-from, .mail-row.unread .mail-subject { font-weight: 700; }
.mail-row.unread .mail-avatar { box-shadow: 0 0 0 2px var(--brand); }
.mail-avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.mail-avatar.big { width: 40px; height: 40px; font-size: var(--fs); }
/* Hustota „úsporná“ (Nastavení Pošty): nižší řádky, menší avatar */
.mail-compact .mail-row { padding: 3px 8px; gap: 6px; }
.mail-compact .mail-avatar { width: 24px; height: 24px; font-size: var(--fs-xs, 11px); }
.mail-row-main { flex: 1; min-width: 0; }
.mail-row-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { flex: none; font-size: var(--fs-sm); }
.mail-row-bottom { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; font-size: var(--fs-sm); }
.mail-subject { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.mail-preview-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.icon.tiny { width: 13px; height: 13px; flex: none; }
.mail-star { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--muted); opacity: 0.35; border-radius: 4px; flex: none; }
.mail-row:hover .mail-star, .mail-star.on { opacity: 1; }
.mail-star.on, .mail-star-on { color: #e0a000; }
.mail-star .icon { width: 16px; height: 16px; }

.mail-preview { height: 100%; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.mail-preview-empty { padding: 20px; display: flex; align-items: center; gap: 8px; }
.mail-msg-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.mail-msg-subject { font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; gap: 6px; }
/* Podrobné hledání */
.mail-adv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.mail-adv .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.mail-adv-wide { grid-column: 1 / -1; }
.mail-adv-period { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; }
.mail-adv-quick { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.mail-adv-checks { display: flex; gap: 16px; flex-wrap: wrap; }
:root[data-mode="mobile"] .mail-adv { grid-template-columns: 1fr; gap: 8px; }
.mail-find { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mail-find[hidden] { display: none; }
.mail-find-input { flex: 1; min-width: 80px; height: 30px; }
.mail-find.none .mail-find-input { border-color: var(--danger, #c0392b); }
.mail-find-count { min-width: 52px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
mark.mail-find-hit { background: #ffe58a; color: #1d1d1f; border-radius: 2px; } /* čitelné i v tmavém režimu */
mark.mail-find-hit.cur { background: #ff9f43; }
.mail-folder-chip { flex: none; font-size: var(--fs-xs, 11px); padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--text); margin-right: 4px; white-space: nowrap; }
.mail-partial { color: var(--warn, #b26a00); display: inline-flex; align-items: center; gap: 4px; }
.mail-list-wrap.searching .mail-list { opacity: 0.55; transition: opacity 0.15s 0.1s; }
.mail-msg-subject { flex-wrap: wrap; }
.mail-msg-subject-text { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; } /* úzký náhled: šipky a štítky pod předmět, ne předmět do sloupce */
.mail-msg-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; flex: none; font-weight: 400; align-self: flex-start; }
.mail-msg-nav .muted { margin-right: 4px; white-space: nowrap; }
.mail-msg-from { display: flex; gap: 10px; align-items: flex-start; }
.mail-msg-meta { min-width: 0; line-height: 1.4; }
.mail-addr { white-space: nowrap; }
.mail-msg-body { padding: 10px 14px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mail-atts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.mail-att { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 8px; cursor: pointer; font: inherit; color: inherit; }
.mail-att:hover { background: var(--surface-2); }
.mail-att .icon { width: 16px; height: 16px; }
.mail-banner { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.mail-banner.error { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.mail-frame { width: 100%; flex: 1; border: 0; min-height: 160px; background: #fff; border-radius: 4px; }
.mail-text { flex: 1; }
.mail-text { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0; }
.mail-back { margin-bottom: 4px; align-self: flex-start; }

/* psaní zprávy */
.mail-compose { display: flex; flex-direction: column; height: 100%; }
.mail-compose.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.mail-compose-head { padding: 8px 12px 4px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mail-compose-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.mail-compose-row-wrap { display: flex; align-items: center; gap: 6px; }
.mail-compose-row-wrap .mail-compose-row { flex: 1; min-width: 0; } /* Komu se zúží, Kopie / Skrytá zůstane celé (připomínka 10, 10. 11.) */
.mail-compose-row-wrap .mail-cc-toggle { flex: 0 0 auto; white-space: nowrap; }
.mail-compose-label { width: 64px; flex: none; color: var(--muted); font-size: var(--fs-sm); }
.mail-from-btn { flex: 1; }
.mail-addr-box { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); min-height: var(--ctl); cursor: text; }
.mail-addr-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mail-chips { display: contents; }
.mail-chip { display: inline-flex; align-items: center; gap: 2px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border-radius: 12px; padding: 1px 4px 1px 8px; font-size: var(--fs-sm); }
.mail-chip-x { border: 0; background: none; cursor: pointer; font-size: var(--fs); line-height: 1; padding: 0 4px; color: var(--muted); border-radius: 50%; }
.mail-chip-x:hover { color: var(--bad); }
.mail-addr-input { flex: 1; min-width: 120px; border: 0; outline: none; background: transparent; font: inherit; color: inherit; padding: 2px; }
.mail-subject-input { flex: 1; }
.mail-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mail-toolbar-spacer { flex: 1; }
.mail-editor-wrap { flex: 1; min-height: 160px; overflow: auto; display: flex; flex-direction: column; }
.mail-editor { flex: 1; padding: 10px 14px; outline: none; line-height: 1.45; word-break: break-word; contain: paint; } /* obsah nevyleze mimo editor (K4-01) */
.mail-editor blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.mail-editor .mail-sig { color: var(--muted); margin: 10px 0; }
.mail-editor-text { width: 100%; flex: 1; min-height: 160px; border: 0; border-radius: 0; resize: none; font: inherit; padding: 10px 14px; }
.mail-chip.invalid { background: var(--bad-soft); color: var(--bad); border: 1px dashed var(--bad); }
.mail-chip-text { cursor: text; }
.mail-compose-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; }
.mail-compose-atts:empty { display: none; }
.mail-compose-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.mail-send-status { padding: 8px 12px; background: color-mix(in srgb, var(--ok, #1f8a4c) 14%, var(--surface)); display: flex; align-items: center; gap: 8px; }
.mail-compose.sending .mail-compose-head, .mail-compose.sending .mail-toolbar, .mail-compose.sending .mail-editor-wrap, .mail-compose.sending .mail-compose-foot { opacity: 0.5; pointer-events: none; }

/* nové ovládání (vzor Kontakty, podklady/vzor-kontakty-kontrolni-seznam.md): režim výběru – místo avataru zaškrtnutí,
   stavový řádek dole, prázdný stav uprostřed, na telefonu řádky jako v Kontaktech a místo pro plovoucí tlačítko */
.mail-check { display: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); align-items: center; justify-content: center; flex: none; color: transparent; }
.mail-check .icon { width: 18px; height: 18px; }
.mail-list.select-mode .mail-avatar { display: none; }
.mail-list.select-mode .mail-check { display: flex; }
.mail-list.select-mode .mail-row.selected .mail-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.mail-list:has(> .empty-state) { display: flex; flex-direction: column; }
.mail-list > .empty-state { margin: auto; }
.chrome-bar .mail-list-wrap > .list-filters, .chrome-bar .mail-list-wrap > .list-status { flex: none; }
:root[data-mode="mobile"] .chrome-bar .mail-row { align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; }
:root[data-mode="mobile"] .chrome-bar .mail-avatar, :root[data-mode="mobile"] .chrome-bar .mail-check { width: 40px; height: 40px; font-size: var(--fs-lg); }
:root[data-mode="mobile"] .chrome-bar .mail-list { padding-bottom: 84px; }
:root[data-mode="mobile"] .chrome-bar .mail-star { min-width: 44px; min-height: 44px; }
/* Napsat v novém ovládání: akce v záhlaví, pole Od se nesmí roztáhnout přes okno; telefon – řádky polí jako Gmail / Outlook */
.mail-compose-foot[hidden], .mail-toolbar[hidden] { display: none; }
.mail-from-btn { min-width: 0; flex: 1; }
.mail-from-btn .color-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-compose-row > .input, .mail-compose-row > .mail-addr-box { min-width: 0; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-head { padding: 0 12px; gap: 0; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-row { min-height: 48px; border-bottom: 1px solid var(--line); }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-row-wrap { border-bottom: 1px solid var(--line); }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-row-wrap .mail-compose-row { border-bottom: 0; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-label { width: 56px; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-head .input { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-head { border-bottom: 0; }
/* štítky filtrů a stavový řádek přes celou šířku (nad seznamem i náhledem); prázdná složka bez náhledu */
.mail-view.chrome-bar iw-split > .split-second.mail-main { display: flex; flex-direction: column; }
.mail-view.chrome-bar .split-second.mail-main > .mail-content { flex: 1; height: auto; min-height: 0; }
.mail-view.chrome-bar .split-second.mail-main > .list-filters, .mail-view.chrome-bar .split-second.mail-main > .list-status, .mail-view.chrome-bar .split-second.mail-main > .select-all-bar { flex: none; }
.mail-content.is-empty iw-split > .split-second, .mail-content.is-empty iw-split > .split-handle { display: none; }
.mail-content.is-empty iw-split > .split-first { flex: 1 1 auto !important; width: auto !important; height: auto !important; }
/* Plynulý seznam (vzor Kontakty, C1): všechny řádky stejně vysoké (změřené), nenačtené jako zástupci */
.mail-list.virtual .mail-row { height: var(--mail-row-h, auto); overflow: hidden; }
.mail-row.ph { pointer-events: none; }
.mail-row.ph .mail-avatar { background: var(--surface-2); }
.mail-row.ph .mail-row-main { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.mail-vpad { flex: none; }
/* pole adres jako ostatní pole (rámeček, výška, písmo – vzor Kontakty): čip stejným písmem jako text pole */
.mail-chip { font-size: inherit; padding: 2px 4px 2px 10px; }
.mail-addr-input:focus, .mail-addr-input:focus-visible { outline: none; box-shadow: none; border: 0; }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-addr-box { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
:root[data-mode="mobile"] .mail-addr-input, :root[data-mode="mobile"] .mail-addr-box { font-size: 16px; } /* iPhone by při menším písmu přibližoval */
.mail-chip[draggable="true"] { cursor: grab; }
.mail-addr-box.drop { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* priorita a obrázky / tabulky v psaní */
.mail-prio-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px; border-radius: 10px; font-size: var(--fs-sm); background: var(--warn-soft); color: var(--warn); }
.mail-prio-badge[hidden] { display: none; }
.mail-prio-badge .icon { width: 14px; height: 14px; }
.mail-prio { display: inline-flex; color: var(--bad); }
.mail-editor img { max-width: 100%; cursor: pointer; }
.mail-editor table { border-collapse: collapse; }
.mail-editor td { border: 1px solid var(--line-2); padding: 4px 8px; min-width: 40px; }
.mail-table-dlg { display: flex; gap: 12px; }
.mail-table-dlg .field { flex: 1; }
/* stav odeslaných (K odeslání, Odeslané): ikona v řádku, pruh v hlavičce zprávy s výsledkem po příjemcích */
.mail-send-ic { display: inline-flex; flex: none; }
.mail-send-ic.ok, .mail-send-state.ok .mail-send-main, .mail-send-r.ok { color: var(--ok); }
.mail-send-ic.warn, .mail-send-state.warn .mail-send-main, .mail-send-r.warn { color: var(--warn); }
.mail-send-ic.bad, .mail-send-state.bad .mail-send-main, .mail-send-r.bad { color: var(--bad); }
.mail-send-ic.muted { color: var(--muted); }
.mail-send-state { border-radius: var(--r-sm); padding: 6px 10px; background: var(--surface-2); font-size: var(--fs-sm); }
.mail-send-state.ok { background: var(--ok-soft); }
.mail-send-state.warn { background: var(--warn-soft); }
.mail-send-state.bad { background: var(--bad-soft); }
.mail-send-main { display: flex; align-items: center; gap: 6px; }
.mail-send-main .icon { width: 16px; height: 16px; }
.mail-send-detail { margin-top: 2px; word-break: break-word; }
.mail-send-rcpt { list-style: none; margin: 4px 0 0; padding: 0; }
.mail-send-rcpt li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.mail-folder.outbox .mail-unread { color: var(--muted); font-weight: 400; font-size: 12px; } /* čekající zprávy = prostý počet */
.mail-folder.outbox.has-failed .mail-unread { color: #fff; background: var(--bad); border-radius: 9px; padding: 0 6px; min-width: 18px; line-height: 18px; text-align: center; font-size: 11px; font-weight: 600; } /* neodeslané / zadržené = problém */
/* chytrá příloha (odkaz na soubor) */
.mail-send-links { list-style: none; margin: 6px 0 0; padding: 0; }
.mail-send-links li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.mail-send-links li > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* podrobnosti doručení (rozbalit šipkou) */
.mail-send-more { margin-top: 6px; }
.mail-send-more > summary { cursor: pointer; font-size: var(--fs-sm, 12px); color: var(--muted); }
.mail-send-more > summary:hover { color: var(--fg); }
.mail-send-table { margin-top: 6px; width: 100%; font-size: var(--fs-sm, 12px); table-layout: fixed; }
.mail-send-table th:nth-child(2), .mail-send-table td:nth-child(2) { width: 90px; }
.mail-send-table th:nth-child(4), .mail-send-table td:nth-child(4) { width: 120px; }
.mail-send-table td, .mail-send-table th { font-size: var(--fs-sm, 12px); white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; overflow-wrap: anywhere; }
.mail-send-table td.mono { font-size: inherit; }
.mail-send-table td { vertical-align: top; padding: 4px 8px 4px 0; }
.mail-send-resp { word-break: break-word; }

/* přehled přijato / odesláno */
.stats-view { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.stats-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stats-tile { border: 1px solid var(--line); border-radius: var(--r-md, 8px); padding: 12px 14px; background: var(--surface); }
.stats-tile-label { font-size: var(--fs-sm); color: var(--muted); }
.stats-tile-main { font-size: 24px; font-weight: 600; margin: 2px 0; }
.stats-tile-sub { font-size: var(--fs-sm); color: var(--muted); }
.stats-tile.in .stats-tile-main { color: #1a73e8; }
.stats-tile.out .stats-tile-main { color: var(--brand); }
.stats-tile.bad .stats-tile-main { color: var(--danger, #c92a2a); }
.stats-t td.bad { color: var(--danger, #c92a2a); }
.stats-custom { display: flex; gap: 12px; }

/* telefon: Kopie / Skrytá jako viditelné tlačítko, popisky čitelné, prázdné pole s nápovědou (připomínka 3. 11.) */
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-cc-toggle { color: var(--brand); border: 1px solid var(--line-2); border-radius: 14px; padding: 2px 10px; font-weight: 600; background: var(--surface); }
:root[data-mode="mobile"] .mail-compose.chrome-bar .mail-compose-label { color: var(--fg-2); font-size: 14px; }
.mail-addr-input::placeholder { color: var(--faint); }
.mail-chips:not(:empty) + .mail-addr-input::placeholder { color: transparent; }

/* barva účtu ve složce Vše: proužek u levého okraje (tečka by vypadala jako „nepřečteno“) */
.mail-row {
  position: relative;
}
.mail-acc {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.keys-table {
  border-collapse: collapse;
  width: 100%;
}
.keys-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.keys-table td:first-child {
  width: 1%;
  white-space: nowrap;
}
.keys-table kbd {
  font: inherit;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}
.stats-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* telefon: táhlo rychlého posunu seznamu (připomínka 11, 10. 11.) */
.mail-fast-thumb { position: absolute; right: 2px; z-index: 5; width: 28px; height: 48px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 2px 8px rgb(0 0 0 / 0.2); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--fg-2); touch-action: none; }
.mail-fast-thumb[hidden] { display: none; }
.mail-fast-thumb.active { background: var(--brand); color: #fff; border-color: var(--brand); }
:root[data-mode="mobile"] .mail-scroll-date { right: 40px; }

/* šablony (K6) */
.tpl-manage { min-width: 0; }
.tpl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; min-height: 36px; border-bottom: 1px solid var(--line-soft); }

/* uložená hledání – Spravovat (13. 11.) */
.mail-saved-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.mail-saved-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.mail-saved-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* apps/Prohlizec/client/prohlizec.css */
/* Prohlížeč */
.viewer-body {
  position: relative; /* překryv načítání */
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg-2);
  display: flex;
}
.viewer-img-wrap {
  margin: auto;
  padding: 12px;
}
.viewer-img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  transform-origin: center;
  transition: transform 0.1s;
  box-shadow: var(--sh-2);
  background: var(--surface);
}
.viewer-img.zoomed {
  max-width: none;
  max-height: none;
}
.viewer-frame {
  flex: 1;
  border: 0;
  width: 100%;
  height: 100%;
}
/* čtečka PDF: stránky pod sebou, vykreslené jen viditelné */
.viewer-pdf {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 12px;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
}
.viewer-pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform-origin: center top;
  width: max-content;
  min-width: 100%;
}
.viewer-pdf-page {
  position: relative;
  background: #fff;
  box-shadow: var(--sh-2);
  flex: none;
}
.viewer-pdf-page canvas {
  display: block;
}
.viewer-pdf-num {
  user-select: none;
  z-index: 2;
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 11px;
  color: #9a9a9a;
  pointer-events: none;
}
.viewer-text {
  flex: 1;
  border: 0;
  resize: none;
  padding: 14px 16px;
  font: 13px/1.5 var(--mono);
  background: var(--surface);
  color: var(--fg);
  outline: none;
}
.viewer-text:read-only {
  background: var(--surface-2);
}
.viewer-media {
  margin: auto;
  max-width: 100%;
  max-height: 100%;
}

/* obrázek: posun a štípnutí prstem řeší komponenta, prohlížeč nesmí stránku přibližovat */
.viewer-img-wrap {
  touch-action: none;
  user-select: none;
  position: relative;
  margin: auto;
  padding: 12px;
  cursor: grab;
}
.viewer-img-wrap.dragging {
  cursor: grabbing;
}
.viewer-img,
.viewer-canvas {
  max-width: 100%;
  max-height: calc(100% - 24px);
  display: block;
  transform-origin: 0 0;
  box-shadow: var(--sh-2);
  background: var(--surface);
}
.viewer-stage {
  position: relative;
  display: inline-block;
  transform-origin: 0 0; /* přiblížení do bodu (setZoom) počítá od levého horního rohu */
}
.crop-frame {
  position: absolute;
  border: 1px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
}
.crop-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.4) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.4) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.4) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.4) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.4) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.4) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.4) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.4) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px));
  pointer-events: none;
}
.crop-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  touch-action: none;
}
.crop-handle.nw { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-handle.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-handle.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.crop-handle.n { left: calc(50% - 9px); top: -9px; cursor: ns-resize; }
.crop-handle.s { left: calc(50% - 9px); bottom: -9px; cursor: ns-resize; }
.crop-handle.w { left: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.crop-handle.e { right: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.viewer-view.editing .viewer-body {
  background: #2a2a2a;
}

@media (pointer: coarse) {
  .crop-handle {
    width: 28px;
    height: 28px;
  }
  .crop-handle.nw { left: -14px; top: -14px; }
  .crop-handle.ne { right: -14px; top: -14px; }
  .crop-handle.sw { left: -14px; bottom: -14px; }
  .crop-handle.se { right: -14px; bottom: -14px; }
  .crop-handle.n { left: calc(50% - 14px); top: -14px; }
  .crop-handle.s { left: calc(50% - 14px); bottom: -14px; }
  .crop-handle.w { left: -14px; top: calc(50% - 14px); }
  .crop-handle.e { right: -14px; top: calc(50% - 14px); }
}

/* nový vzhled: šipky na předchozí / další soubor po stranách (jako prohlížeč fotek ve Windows) */
.viewer-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 64px; display: grid; place-items: center; border: 0; border-radius: var(--r-md, 8px); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--fg); box-shadow: var(--sh-1); cursor: pointer; opacity: 0.75; z-index: 2; }
.viewer-nav:hover { opacity: 1; }
.viewer-nav:disabled { opacity: 0.25; cursor: default; }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-nav[hidden] { display: none; }

/* tabulka jen ke čtení (xlsx, xls, ods – 20. 11.): mřížka jako v Excelu, záhlaví a čísla řádků přilepené */
.sheet-view { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; background: var(--surface); }
.sheet-grid { flex: 1; min-height: 0; overflow: auto; outline: none; position: relative; user-select: none; }
.sheet-table td.sel { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.sheet-table th.sheet-colhead, .sheet-table th.sheet-rowhead, .sheet-table th.sheet-corner { cursor: default; }
.sheet-loading { padding: 16px; }
.sheet-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-sm); color: var(--fg); }
.sheet-table td, .sheet-table th {
  height: 22px; padding: 0 4px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 21px; vertical-align: bottom;
}
.sheet-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-table td.spill { overflow: visible; text-overflow: clip; position: relative; z-index: 1; }
.sheet-table .spill-text { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.sheet-table td.merged { background: var(--surface); }
.sheet-table td[rowspan], .sheet-table td[colspan] { vertical-align: middle; text-align: center; }
.sheet-table thead th { position: sticky; top: 0; z-index: 2; }
.sheet-table th { background: var(--surface-2); color: var(--muted); font-weight: 500; text-align: center; }
.sheet-table th.sheet-rowhead { position: sticky; left: 0; z-index: 1; text-align: right; padding-right: 6px; }
.sheet-table th.sheet-corner { position: sticky; left: 0; top: 0; z-index: 3; }
.sheet-table tr.sheet-pad td { padding: 0; border: 0; height: auto; }
.sheet-tabs { display: flex; gap: 2px; padding: 4px 6px 0; overflow-x: auto; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
.sheet-tab { border: 1px solid transparent; border-bottom: 0; background: none; color: var(--muted); padding: 4px 12px; border-radius: 6px 6px 0 0; font: inherit; font-size: var(--fs-sm); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sheet-tab:hover { color: var(--fg); background: var(--surface-3); }
.sheet-tab.active { background: var(--surface); color: var(--fg); border-color: var(--line); font-weight: 600; }

/* textová vrstva PDF (pdf.js TextLayer, 20. 11.): průhledný text nad plátnem – označit a kopírovat; pravidla podle
   pdf_viewer.css pdf.js 6 (měřítko --total-scale-factor nastaví čtečka na stránce) */
.viewer-pdf-page { --scale-round-x: 1px; --scale-round-y: 1px; }
.textLayer {
  position: absolute; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-align: initial;
  -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0;
  caret-color: CanvasText; z-index: 1; user-select: text;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1;
  --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { user-select: none; cursor: default; }
.textLayer ::selection { background: rgb(0 90 200 / 0.28); }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }

/* obsah ZIP archivu (20. 11.) */
.zip-view { width: 100%; height: 100%; overflow: auto; background: var(--surface); }
.zip-table { width: 100%; font-size: var(--fs-sm); }
.zip-table td, .zip-table th { padding: 4px 10px; white-space: nowrap; }
.zip-table td.zip-name { overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 70%; }
.zip-table .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--muted); }
.zip-note { padding: 8px 12px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); font-size: var(--fs-sm); }
.zip-empty { padding: 16px; }

/* apps/Soubory/client/soubory.css */
/* Průzkumník souborů */
.files-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
  position: relative;
}
.files-list.drop {
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, 110px);
  gap: 6px;
  padding: 10px;
  align-content: start;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  text-align: center;
  font-size: var(--fs-sm);
  cursor: default;
}
.tile:hover {
  background: var(--surface-2);
}
.tile.selected {
  background: var(--selection);
  border-color: var(--brand);
}
.tile.drop {
  outline: 2px dashed var(--brand);
}
.tile .icon.big {
  width: 44px;
  height: 44px;
  margin: 2px 0; /* stejně vysoko jako náhled (48 px) */
  flex: none;
  color: var(--brand);
  stroke-width: 1.5;
}
.tile img {
  flex: none;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}
.tile-name {
  max-width: 100%;
  /* vždy místo na dva řádky: dlaždice jsou stejně vysoké bez ohledu na název – plynulý seznam měří výšku jednou
     (dřív podle složky s krátkými názvy, delší název se pak ve složce jinde ořízl, nález 15) */
  line-height: 1.25;
  min-height: 2.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.upload-progress {
  padding: 4px 10px;
  font-size: var(--fs-sm);
  background: linear-gradient(90deg, var(--brand-soft) var(--p, 0%), transparent var(--p, 0%));
  border-top: 1px solid var(--line);
}

.tile { position: relative; }
.tile .restricted-badge { position: absolute; top: 6px; right: 6px; margin: 0; }
.restricted-badge { color: var(--warn, #b26b00); }
.shared-badge {
  width: 14px;
  height: 14px;
  color: var(--muted);
  margin-left: 2px;
}

/* telefon: dvouřádkově (jádro 40-shell.css) – název, pod ním datum a velikost; typ se nevejde */
:root[data-mode="mobile"] .files-view.chrome-bar .files-list th:nth-child(3),
:root[data-mode="mobile"] .files-view.chrome-bar .files-list td:nth-child(3) {
  display: none;
}

/* nové ovládání (vzor Kontakty): řazení klepnutím na hlavičku, dotykové cíle 44 px */
:root:is([data-mode="tablet"], [data-mode="mobile"]) .files-view iw-addressbar .btn {
  min-width: 44px;
  min-height: 44px;
}
:root[data-mode="mobile"] .files-view.chrome-bar .files-list {
  padding-bottom: 84px; /* poslední řádek nesmí zakrýt plovoucí tlačítko */
}

/* plynulý seznam (vzor Kontakty, C1): jen okno kolem posunu, řádky i dlaždice stejně vysoké (změřené) */
.files-list.virtual .files-table tr[data-id] { height: var(--files-row-h, auto); }
.files-list.virtual .tile { height: var(--files-row-h, auto); }
.files-table tr.vpad td { padding: 0; border: 0; }

/* podokno podrobností (vzor Kontakty D1, jako Průzkumník Windows): seznam vlevo, náhled a vlastnosti vpravo */
.files-detail-split > .split-first { display: flex; flex-direction: column; min-width: 260px; overflow: hidden; }
.files-detail-split > .split-second { display: flex; min-width: 0; border-left: 1px solid var(--line); }
.files-detail-split.detail-off > .split-second,
.files-detail-split.detail-off > .split-handle { display: none; }
.files-detail-split.detail-off > .split-first { flex: 1 1 auto !important; width: auto !important; }
.files-detail { flex: 1; min-width: 0; overflow: auto; padding: 0 16px 16px; background: var(--surface); }
.files-detail-card { padding-left: 0; padding-right: 0; }
.files-detail-card .record-card-title { word-break: break-word; font-size: calc(17px * var(--font-scale)); }
.files-detail-card .record-card-acts:empty { display: none; }
.files-detail-media { display: flex; align-items: center; justify-content: center; max-width: 100%; }
.files-detail-media .icon.huge { width: 72px; height: 72px; color: var(--brand); stroke-width: 1.3; }
.files-detail-img { max-width: 100%; max-height: 260px; border-radius: var(--r-sm); object-fit: contain; background: var(--surface-2); }
.files-detail-video { max-width: 100%; max-height: 260px; border-radius: var(--r-sm); background: #000; }
.files-detail-audio { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.files-detail-audio audio { max-width: 100%; }
.files-detail-text { width: 100%; max-height: 220px; overflow: hidden; margin: 0; padding: 8px 10px; font-size: var(--fs-xs, 11px); text-align: left; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: var(--r-sm); }
.files-detail .about-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); word-break: break-word; font-size: var(--fs-sm); }
.files-detail-sec { margin: 14px 0 6px; font-size: var(--fs-xs, 11px); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.files-detail-shares ul { list-style: none; margin: 0; padding: 0; }
.files-detail-shares li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.files-detail-hint { text-align: center; }

/* globální štítky: tečky za názvem, oddíl v podokně podrobností */
.files-tags { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.files-tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tag); flex: none; }
.files-detail-tags { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 8px 0; }
.files-tag-chip { border: 0; cursor: pointer; font: inherit; }
/* pomocné soubory programů (Zobrazení → Pomocné soubory): bledší, jako skryté soubory ve Windows */
.files-list tr.aux td, .files-list .tile.aux { opacity: 0.55; }
