/* StavApp – mobilní vzhled */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --text: #1d2321;
  --muted: #64706b;
  --line: #e2dfd8;
  --primary: #1f6f5c;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0ec;
  --accent: #f2b84b;
  --ok: #2e7d4f;
  --ok-soft: #e4f3ea;
  --warn: #9a6200;
  --warn-soft: #fdf1d9;
  --danger: #b3261e;
  --danger-soft: #fbe6e4;
  --info-soft: #e7eefb;
  --info: #2d55a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 2px 8px rgba(20, 30, 25, .04);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131715;
    --surface: #1c2220;
    --surface-2: #222a27;
    --text: #e8ece9;
    --muted: #9aa6a1;
    --line: #2f3835;
    --primary: #4cb79a;
    --primary-ink: #0d1a16;
    --primary-soft: #1d3530;
    --accent: #f2b84b;
    --ok: #6fcf97;
    --ok-soft: #1b3326;
    --warn: #f2c46b;
    --warn-soft: #3a2f17;
    --danger: #ff8a80;
    --danger-soft: #3d1f1d;
    --info-soft: #1d2840;
    --info: #9bb8f2;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: var(--primary); }
h1 { font-size: 1.4rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- rámec ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.who { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.main { max-width: 860px; margin: 0 auto; padding: 16px 16px 32px; }
.has-nav .main { padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; min-width: 0;
}
.nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a.active { color: var(--primary); }
@media (min-width: 900px) {
  .nav {
    position: sticky; top: 53px; bottom: auto; height: auto; padding: 0 16px;
    justify-content: center; gap: 4px; border-top: 0; border-bottom: 1px solid var(--line);
  }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 12px 16px; font-size: .92rem; border-bottom: 2px solid transparent; }
  .nav a.active { border-bottom-color: var(--primary); }
  .nav svg { width: 18px; height: 18px; }
  .has-nav .main { padding-bottom: 48px; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin: 4px 0 16px; }
.page-head .back { flex-basis: 100%; text-decoration: none; font-size: .92rem; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.list-card { padding: 8px 0; }
.list-card > h2, .list-card > p, .list-head { padding: 8px 16px; }

/* ---------- formuláře ---------- */
.form { display: grid; gap: 14px; }
.form label:not(.check):not(.radio-card) { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-weight: 400;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 12px 14px; display: grid; gap: 10px; }
legend { padding: 0 6px; font-weight: 700; }
.internal { background: var(--warn-soft); border-color: transparent; }
.field-static { margin: 0; }
.inline-form select { min-width: 200px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-block { width: 100%; }
.btn-small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-icon { width: 48px; padding: 0; font-size: 1.6rem; line-height: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-split { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions-split form { margin: 0; }
.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 10px 0;
}
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.flash-err { background: var(--danger-soft); color: var(--danger); }

/* ---------- štítky ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.st-draft { background: var(--surface-2); color: var(--muted); }
.st-preapproved { background: var(--info-soft); color: var(--info); border-color: transparent; }
.st-final { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.st-nobill { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.st-note { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.role-owner { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

/* ---------- týden ---------- */
.weeknav { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.weeknav-label { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.days { display: grid; gap: 10px; margin-top: 12px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; }
.day-name { font-weight: 750; margin-right: 6px; }
.day-tools { display: flex; align-items: center; gap: 10px; }
.day-total { font-weight: 700; }
.entry {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.entry:hover { background: var(--surface-2); }
.entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-job { font-weight: 650; }
.entry-desc { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.entry-hours { font-weight: 750; font-size: 1.05rem; }
.comments-count { font-size: .8rem; color: var(--muted); }

/* ---------- přehled ---------- */
.filters summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.filters[open] summary { margin-bottom: 12px; }
.filters .chips { margin-bottom: 14px; }
.grid-filters { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-filters .actions { grid-column: 1 / -1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-val { font-size: 1.35rem; font-weight: 750; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
.sumlist { list-style: none; margin: 0; padding: 0; }
.sumlist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.sumlist li:first-child { border-top: 0; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.list-head h2 { margin: 0; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bulk select { width: auto; min-width: 170px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row-item { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.row-item.is-inactive { opacity: .6; }
.row-check { display: flex; align-items: center; padding-left: 16px; }
.row-check input { width: 22px; height: 22px; accent-color: var(--primary); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.row-body:hover { background: var(--surface-2); }
.row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.row-hours { margin-left: auto; font-weight: 750; }
.row-job { font-weight: 600; font-size: .92rem; }
.row-desc { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.row-link { display: flex; align-items: center; padding: 0 16px; text-decoration: none; }
.depth-1 .row-body { padding-left: 34px; }
.depth-2 .row-body { padding-left: 52px; }
.depth-3 .row-body { padding-left: 70px; }

/* ---------- detail záznamu ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; }
.comments { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.comments li { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; max-width: 92%; }
.comments li.mine { background: var(--primary-soft); margin-left: auto; }
.c-head { margin-bottom: 2px; }
.comment-form { grid-template-columns: 1fr auto; align-items: end; }
.comment-form textarea { min-height: 48px; }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .9rem; }

/* ---------- lidé ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2px 14px; }
.perms.is-owner .perm-grid { opacity: .6; }
.lang-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 420px) { .lang-pick { grid-template-columns: 1fr; } }
.radio-card { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.radio-card input { width: 20px; height: 20px; accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- přihlášení ---------- */
.no-nav .main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth { width: 100%; max-width: 400px; }
.auth h1 { margin-bottom: 14px; text-align: center; }
.auth-logo { display: block; margin: 0 auto 10px; }
.langs { display: flex; justify-content: center; gap: 14px; margin: 16px 0 0; font-size: .9rem; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a.active { color: var(--primary); font-weight: 700; }

/* ---------- instalace na plochu ---------- */
[hidden] { display: none !important; }
.install { border-color: var(--primary); background: var(--primary-soft); }
.install-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.install-head img { border-radius: 10px; flex: 0 0 auto; }
.install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.install-close {
  flex: 0 0 auto; width: 36px; height: 36px; margin: -6px -6px 0 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.install-close:hover { background: var(--surface); color: var(--text); }
.install-steps { margin: 8px 0 0; padding-left: 1.3em; }
.install-steps li { margin: 4px 0; }
.install-or { margin: 12px 0 0; color: var(--muted); }
.install-done { margin: 0; font-weight: 600; color: var(--ok); }
.no-nav .install { width: 100%; max-width: 400px; }
.form + .install { margin-top: 14px; }

/* ---------- hodiny ---------- */
.hours-box { display: flex; flex-direction: column; gap: 8px; }
.hours-box > label { margin: 0; }
.hours-box p { margin: 0; }
.hours-input { text-align: center; font-size: 1.5rem; font-weight: 700; }
.hours-box .chip { min-width: 64px; }

/* ---------- fakturace a deník ---------- */
.flash-warn { background: var(--warn-soft); color: var(--warn); }
.field-title { margin: 0; font-weight: 600; font-size: .92rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.split summary { cursor: pointer; font-weight: 700; }
.split[open] summary { margin-bottom: 8px; }
.stat-internal .stat-val { color: var(--warn); }
.bill-summary { margin: 0; font-weight: 600; }
.bill-summary.warn { color: var(--warn); }
.bill-summary.bad { color: var(--danger); }

/* ---------- přehled: výběr lidí a týdny vedle sebe ---------- */
.main-wide { max-width: 1400px; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.tab { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.people-pick { border: 0; padding: 0; margin: 0; grid-column: 1 / -1; }
.people-pick legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.pick input { width: 18px; height: 18px; accent-color: var(--primary); }
.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.people-pick p { margin: 6px 0 0; }
.week-grid h2 { margin-bottom: 10px; }
.grid-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.hgrid { width: 100%; border-collapse: collapse; min-width: 760px; font-size: .9rem; }
.hgrid th, .hgrid td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.hgrid thead th { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.hgrid th.who { position: sticky; left: 0; background: var(--surface); min-width: 130px; z-index: 1; }
.hgrid td { width: 11%; }
.hgrid .we { background: var(--surface-2); }
.hgrid .out { opacity: .45; }
.hgrid td a { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; border-radius: 8px; }
.hgrid td a:hover strong { color: var(--primary); text-decoration: underline; }
.hgrid strong { font-size: 1.05rem; }
.hgrid .nb { color: var(--warn); font-weight: 600; font-size: .82rem; }
.hgrid .jobs { display: flex; flex-direction: column; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.hgrid .sum { white-space: nowrap; text-align: right; }
.hgrid .sum .nb { display: block; }
.hgrid tfoot th, .hgrid tfoot td { border-bottom: 0; font-weight: 700; }

/* ---------- dovolená ---------- */
.lv-pending { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.lv-approved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.lv-rejected { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.lv-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.leave-list { list-style: none; margin: 0; padding: 0; }
.leave-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.leave-item:first-child { border-top: 0; }
.leave-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.leave-when { font-weight: 700; }
.leave-note { font-size: .88rem; white-space: pre-wrap; }
.leave-side { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.leave-side .inline-form { display: flex; gap: 6px; }
.entry-leave { background: var(--ok-soft); }
.lv-cell { display: block; font-weight: 700; font-size: .82rem; padding: 2px 6px; border-radius: 6px; margin-bottom: 4px; }
.leave-sum summary { cursor: pointer; font-weight: 700; }
.leave-sum[open] summary { margin-bottom: 8px; }
.ltable { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.ltable th, .ltable td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.nav a { position: relative; }
.nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-style: normal; }
@media (min-width: 900px) { .nav-badge { position: static; margin-left: 4px; } }

/* ---------- profil přes jméno nahoře ---------- */
.topbar a.who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; border-radius: 999px; padding: 4px 8px; margin-right: -8px; }
.topbar a.who svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar a.who:hover, .topbar a.who.active { color: var(--primary); background: var(--primary-soft); }
@media (max-width: 420px) { .topbar a.who span { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---------- chat ---------- */
.chat-list { list-style: none; padding: 0; overflow: hidden; }
.chat-list li + li { border-top: 1px solid var(--line); }
.chat-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name meta" "last meta"; gap: 2px 10px; padding: 14px 16px; color: inherit; text-decoration: none; }
.chat-row:hover { background: var(--surface-2); }
.chat-row.closed { opacity: .65; }
.chat-name { grid-area: name; font-weight: 700; }
.chat-last { grid-area: last; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.chat-meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--primary); color: #fff; font-size: .8rem; line-height: 22px; text-align: center; }
.chat-head h1 { margin-bottom: 2px; }
.chat-box { padding: 12px; }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; align-self: flex-start; background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: var(--primary-soft); border-radius: 14px 14px 4px 14px; }
.msg.deleted { opacity: .6; }
.msg.flash-msg { outline: 2px solid var(--primary); }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: .8rem; margin-bottom: 2px; }
.msg-body { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.msg-body a { color: var(--primary); }
.msg-photos { display: grid; gap: 4px; margin: 4px 0; }
.msg-photos.n2 { grid-template-columns: 1fr 1fr; }
.msg-photos.n3 { grid-template-columns: 1fr 1fr 1fr; }
.ph { position: relative; margin: 0; }
.ph img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; border-radius: 10px; background: var(--line); }
.msg-photos.n1 .ph img { max-width: 360px; }
.ph-tag { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.ph-del { position: absolute; right: 4px; top: 4px; }
.ph-del button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 1.1rem; cursor: pointer; }
.msg-del { margin-top: 2px; text-align: right; }
.linkbtn { border: 0; background: none; color: var(--muted); font-size: .78rem; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.composer { position: sticky; bottom: calc(var(--nav-h, 64px) + 8px); z-index: 5; padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
@media (min-width: 900px) { .composer { bottom: 12px; } }
.composer-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: end; }
.composer textarea { resize: none; min-height: 46px; max-height: 180px; }
.photo-btn { position: relative; overflow: hidden; font-size: 1.3rem; padding: 0 14px; min-height: 46px; display: inline-flex; align-items: center; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.send-btn { min-height: 46px; }
.previews { display: flex; gap: 6px; overflow-x: auto; }
.pv { position: relative; flex: 0 0 auto; }
.pv img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.pv button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; cursor: pointer; }
.quality { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quality .field-title { grid-column: 1 / -1; }
.quality .radio-card span { display: flex; flex-direction: column; }
.quality small { font-weight: 400; font-size: .75rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery .ph img { aspect-ratio: 1; height: auto; }
.gallery figcaption { margin-top: 2px; }
.zoom { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.zoom[hidden] { display: none; }
.zoom-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
.zoom-img { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom pan-x pan-y; }
.zoom-img img { max-width: 100%; max-height: 100%; }
.zoom-img img:active { cursor: zoom-in; }
body.noscroll { overflow: hidden; }
.push-head { display: flex; gap: 12px; align-items: flex-start; }
.push-ico { font-size: 1.6rem; line-height: 1; }
.push-head p { margin: 2px 0 0; }

.msg-call { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.call-ico { font-size: 1.4rem; }
.chat-head { flex-wrap: wrap; }
.chat-head .head-actions { margin-left: auto; }

/* ---------- profilové fotky ---------- */
.av { display: inline-block; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: var(--line); vertical-align: middle; }
.av-ini { text-align: center; color: #fff; font-weight: 700; letter-spacing: .02em; background: hsl(160 45% 32%); }
.av.s28 { width: 28px; height: 28px; } .av-ini.s28 { line-height: 28px; font-size: 11px; }
.av.s30 { width: 30px; height: 30px; } .av-ini.s30 { line-height: 30px; font-size: 12px; }
.av.s34 { width: 34px; height: 34px; } .av-ini.s34 { line-height: 34px; font-size: 13px; }
.av.s36 { width: 36px; height: 36px; } .av-ini.s36 { line-height: 36px; font-size: 14px; }
.av.s44 { width: 44px; height: 44px; } .av-ini.s44 { line-height: 44px; font-size: 17px; }
.av.s96 { width: 96px; height: 96px; } .av-ini.s96 { line-height: 96px; font-size: 36px; }
.av-ini.h0 { background: hsl(0 55% 45%); } .av-ini.h30 { background: hsl(30 65% 42%); } .av-ini.h60 { background: hsl(50 70% 35%); }
.av-ini.h90 { background: hsl(90 45% 35%); } .av-ini.h120 { background: hsl(130 40% 33%); } .av-ini.h150 { background: hsl(160 45% 32%); }
.av-ini.h180 { background: hsl(185 55% 32%); } .av-ini.h210 { background: hsl(210 55% 42%); } .av-ini.h240 { background: hsl(240 40% 50%); }
.av-ini.h270 { background: hsl(270 40% 48%); } .av-ini.h300 { background: hsl(305 40% 42%); } .av-ini.h330 { background: hsl(335 55% 45%); }
.avatar-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.avatar-actions p { margin: 0; }
.av-big { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.row-with-av { display: flex !important; flex-direction: row !important; gap: 12px; align-items: center; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.topbar a.who .av { width: 30px; height: 30px; }
.msg-wrap { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; align-self: flex-start; }
.msg-wrap.mine { align-self: flex-end; }
.msg-wrap .msg { max-width: 100%; }
.msg-av { margin-bottom: 2px; }
.pick .av { margin-right: 2px; }
