/* =====================================================
   Schuzo.cz — vzhled
   Barva obce přichází v proměnných --brand, --brand-dark, --brand-light, --brand-soft
   (vypisuje je hlavička podle nastavení obce). Mobil napřed.
   ===================================================== */

:root {
  --brand: #1f5f8b; --brand-dark: #164464; --brand-light: #e4ecf1; --brand-soft: #8fafc5;
  --bg: #f5f6f4; --surface: #fff; --text: #1d2327; --muted: #69737a; --line: #e3e6e3; --line-strong: #cfd4d0;
  --green: #1d7a46; --green-bg: #e3f3e9; --amber: #9a5b00; --amber-bg: #fdf0d8; --red: #b4282e; --red-bg: #fbe5e5;
  --blue: #1e5b9a; --blue-bg: #e3edf8; --mute-bg: #eef0ee;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 1px 1px rgba(20, 30, 25, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.text-green { color: var(--green); } .text-amber { color: var(--amber); } .text-red { color: var(--red); }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.hint { font-size: .875rem; color: var(--muted); }

/* ---------- Záhlaví ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: none; }
.brand-mark-lg { width: 96px; height: 96px; font-size: 2.6rem; border-radius: 20px; }
.brand-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mainnav { display: none; gap: 4px; margin-left: 8px; }
.mainnav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
.mainnav a svg { width: 18px; height: 18px; }
.mainnav a:hover { background: var(--bg); color: var(--text); }
.mainnav a.active { background: var(--brand-light); color: var(--brand-dark); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.usermenu { margin-left: auto; position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px; border-radius: 999px; cursor: pointer; font: inherit; color: var(--text); }
.usermenu-btn:hover { background: var(--bg); }
.usermenu-name { display: none; font-weight: 500; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 240px; padding: 6px; }
.usermenu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu-head strong, .usermenu-head span { display: block; }
.usermenu-head span { color: var(--muted); font-size: .875rem; }
.usermenu-pop a, .usermenu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--bg); }

/* Spodní lišta na mobilu */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }

/* ---------- Stránka ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 20px 16px 96px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back { display: inline-block; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.back:hover { color: var(--brand); }
.footer { max-width: 1160px; margin: 0 auto; padding: 0 16px 90px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .8rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-title { font-size: 1.05rem; font-weight: 650; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card form + .card-title, .form .card-title:not(:first-of-type) { margin-top: 22px; }
.card-link { margin-left: auto; font-size: .875rem; font-weight: 500; }
.card-note { background: var(--brand-light); border-color: transparent; }
.card-review { border-left: 4px solid var(--amber); }
.card-fold > summary { cursor: pointer; font-weight: 600; }
.card-fold[open] > summary { margin-bottom: 12px; }
.pad { padding: 18px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--mute-bg); color: var(--muted); font-size: .78rem; font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.h3 { font-size: 1rem; font-weight: 650; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.grid-2 { display: grid; gap: 0 16px; }
.layout-2 { display: grid; gap: 0 16px; }
.empty-state { text-align: center; padding: 60px 16px; }
.empty-state h1 { margin-bottom: 10px; }

/* ---------- Tlačítka ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; background: var(--mute-bg); color: var(--text); line-height: 1.2; }
.btn:hover { filter: brightness(.97); color: var(--text); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; filter: none; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--brand-dark); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--muted); font: inherit; display: inline-grid; place-items: center; text-decoration: none; }
.icon-btn:hover:not([disabled]) { color: var(--brand); border-color: var(--brand-soft); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 240px; padding: 6px; }
.dropdown-pop.form { padding: 14px; min-width: 280px; }
.dropdown-pop > a, .dropdown-pop > form > button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-pop > a:hover, .dropdown-pop > form > button:hover { background: var(--bg); }

/* ---------- Odznaky, avatary ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-mute { background: var(--mute-bg); color: var(--muted); }
.avatar { --h: 200; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: .8rem; font-weight: 700; background: hsl(var(--h) 45% 88%); color: hsl(var(--h) 45% 28%); }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-none { background: var(--mute-bg); color: var(--muted); }

/* ---------- Hlášky ---------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; overflow-wrap: anywhere; }
.flash-ok { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.callout { display: block; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; text-decoration: none; color: var(--text); }
.callout-amber { background: var(--amber-bg); }
.callout-blue { background: var(--blue-bg); }
a.callout:hover { color: var(--text); filter: brightness(.98); }
.callout-go { font-weight: 600; color: var(--amber); white-space: nowrap; }
.devbox { margin: 14px 0; padding: 12px; border: 2px dashed var(--amber); border-radius: 8px; background: var(--amber-bg); font-size: .9rem; overflow-wrap: anywhere; }

/* ---------- Formuláře ---------- */
.form-narrow { max-width: 680px; }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
legend.field-label { padding: 0; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
input[type=color] { width: 72px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
input[type=file] { font: inherit; max-width: 100%; }
.field-short input { max-width: 220px; }
.form-row { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.form-row .field { flex: 1 1 160px; }
.form-row .grow { flex: 2 1 220px; }
.form-row > .btn { margin-bottom: 16px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.checklist { display: grid; gap: 2px; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.checklist .check { margin: 0; padding: 6px 0; }
.slots { display: grid; gap: 8px; }
.or { color: var(--muted); font-size: .875rem; margin: -6px 0 10px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 1.1rem; padding: 6px 8px; opacity: .6; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .92rem; background: var(--surface); }
.seg input:checked + span { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-light); }

/* Nápověda u pole */
.fhelp { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mute-bg); color: var(--muted); font-size: .72rem; font-weight: 700; cursor: help; flex: none; }
.fhelp:hover, .fhelp:focus { background: var(--brand-light); color: var(--brand-dark); outline: none; }
.fhelp-pop { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(300px, 80vw); background: #1d2327; color: #fff; font-size: .82rem; font-weight: 400; line-height: 1.45; padding: 10px 12px; border-radius: 8px; z-index: 40; text-align: left; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.fhelp-extra { display: block; margin-top: 6px; color: #c9d1d4; font-size: .78rem; }
.fhelp:hover .fhelp-pop, .fhelp:focus .fhelp-pop { display: block; }

/* ---------- Seznamy ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list-sub { display: block; color: var(--muted); font-size: .85rem; }
.list > li.is-done a { text-decoration: line-through; color: var(--muted); }
.doc-row, .comment-mini { display: flex; gap: 10px; align-items: flex-start; }
.docicon { flex: none; width: 36px; height: 40px; border-radius: 6px; display: grid; place-items: center; font-size: .62rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: #7b858b; }
.docicon-pdf { background: #c7362f; } .docicon-doc { background: #2b62b8; } .docicon-xls { background: #1f7a45; } .docicon-img { background: #8a5ab8; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { background: var(--surface); color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); font-weight: 600; }
.search input { min-width: 220px; }

.topic-row, .meet-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.topic-row:first-child { border-top: 0; }
.topic-row:hover, .meet-row:hover { background: #fafbfa; color: var(--text); }
.topic-row-main { flex: 1; min-width: 0; }
.topic-row-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.meet-list { margin: 0 -18px -18px; }
.meet-row-date { flex: none; width: 64px; text-align: center; background: var(--brand-light); color: var(--brand-dark); border-radius: 8px; padding: 6px 4px; line-height: 1.2; }
.meet-row-date .d { display: block; font-weight: 700; }
.meet-row-date .t { display: block; font-size: .78rem; }
.meet-row-body { flex: 1; min-width: 0; }

.nextmeet { display: flex; gap: 14px; text-decoration: none; color: var(--text); align-items: flex-start; }
.nextmeet:hover { color: var(--text); }
.nextmeet-date { flex: none; width: 70px; text-align: center; background: var(--brand); color: #fff; border-radius: 10px; padding: 8px 4px; }
.nextmeet-day { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.nextmeet-mon { display: block; font-size: .8rem; }
.nextmeet-stats { font-size: .9rem; }

/* ---------- Tabulky ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table thead th { border-top: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfa; }
.table-sm th, .table-sm td { padding: 8px 12px; font-size: .9rem; }
.table tr.is-inactive td { opacity: .55; }
.cell-user { display: inline-flex; align-items: center; gap: 8px; }
.cell-actions { text-align: right; white-space: nowrap; }

/* Hlasování o termínu */
.poll { border-collapse: collapse; width: 100%; }
.poll th, .poll td { padding: 8px; border-top: 1px solid var(--line); text-align: center; }
.poll thead th { border-top: 0; }
.poll-slot span, .poll-slot strong { display: block; line-height: 1.25; }
.poll-slot span { font-size: .78rem; color: var(--muted); font-weight: 500; }
.poll-user { text-align: left !important; white-space: nowrap; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.poll-me { background: var(--brand-light); }
.poll-sum { font-size: .9rem; }
.poll-choice { display: inline-flex; flex-direction: column; gap: 3px; }
.pc { cursor: pointer; }
.pc input { position: absolute; opacity: 0; pointer-events: none; }
.pc span { display: block; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: .78rem; background: var(--surface); min-width: 70px; }
.pc-ano input:checked + span { background: var(--green-bg); border-color: var(--green); color: var(--green); font-weight: 700; }
.pc-mozna input:checked + span { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); font-weight: 700; }
.pc-ne input:checked + span { background: var(--red-bg); border-color: var(--red); color: var(--red); font-weight: 700; }
.vote { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: .85rem; }
.vote-ano { background: var(--green-bg); color: var(--green); }
.vote-mozna { background: var(--amber-bg); color: var(--amber); }
.vote-ne { background: var(--red-bg); color: var(--red); }
.vote-none { color: var(--line-strong); }
.slot-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* Matice přečtení */
.matrix { border-collapse: collapse; width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-top: 1px solid var(--line); }
.matrix thead th { border-top: 0; }
.matrix-user { text-align: center; font-size: .78rem; font-weight: 500; }
.matrix-user span:not(.avatar) { display: block; margin-top: 3px; }
.matrix-doc { text-align: left; font-weight: 500; min-width: 200px; }
.matrix-cell { text-align: center; }

/* Program schůzky */
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda-item { border-top: 1px solid var(--line); padding: 14px 0; }
.agenda-item:first-child { border-top: 0; padding-top: 0; }
.agenda-head { display: flex; gap: 10px; align-items: flex-start; }
.agenda-no { flex: none; width: 28px; font-weight: 700; color: var(--brand); font-size: 1.05rem; }
.agenda-title { flex: 1; min-width: 0; }
.agenda-title > a { font-weight: 650; font-size: 1.02rem; margin-right: 4px; }
.agenda-meta { font-size: .85rem; color: var(--muted); margin-top: 2px; display: flex; gap: 4px; flex-wrap: wrap; }
.agenda-tools { display: flex; gap: 4px; flex: none; }
.agenda-note { margin: 10px 0 0 38px; background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
.agenda-note-label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.agenda-task { margin: 6px 0 0 38px; font-size: .92rem; }
.agenda-edit { margin: 10px 0 0 38px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fcfcfb; }
.agenda-edit > summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); }
.agenda-edit[open] > summary { margin-bottom: 12px; }
.task-quick { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.add-item { margin-top: 14px; }
.add-item > summary, .upload > summary { list-style: none; display: inline-flex; }
.add-item > summary::-webkit-details-marker, .upload > summary::-webkit-details-marker { display: none; }
.add-item[open] > summary, .upload[open] > summary { margin-bottom: 14px; }
.upload { margin-top: 14px; }

.tasklist > li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-main { flex: 1; min-width: 180px; }
.task-row { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: flex-start; }
.task-row:first-child { border-top: 0; }
.task-row.is-done strong { text-decoration: line-through; color: var(--muted); }
.task-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.task-note { font-size: .9rem; background: var(--bg); padding: 6px 10px; border-radius: 6px; margin-top: 6px; }
.task-row:target, .agenda-item:target { background: var(--brand-light); border-radius: 8px; }

/* Podklady */
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.doclist li:first-child { border-top: 0; padding-top: 0; }
.doc-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc-main > a { font-weight: 600; margin-right: 4px; }
.doc-old { opacity: .6; }
.doc-title { font-size: 1.25rem; overflow-wrap: anywhere; }
.viewer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer iframe { display: block; width: 100%; height: 78vh; border: 0; }
.viewer img { display: block; margin: 0 auto; }
.viewer-msg { padding: 40px 20px; text-align: center; }

/* Diskuse */
.thread { display: grid; gap: 12px; margin-bottom: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-body { background: var(--bg); border-radius: 4px 12px 12px 12px; padding: 9px 13px; max-width: 100%; min-width: 0; }
.msg-mine .msg-body { background: var(--brand-light); }
.msg-head { font-size: .85rem; margin-bottom: 2px; }
.msg-text { overflow-wrap: anywhere; }
.comment-form { border-top: 1px solid var(--line); padding-top: 14px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 12px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline-note { font-size: .92rem; margin: 6px 0; }
.prose { font-size: 1.02rem; }

.logo-preview { display: grid; place-items: center; padding: 10px 0 16px; }
.logo-preview img { max-height: 120px; }

/* ---------- Přihlášení ---------- */
body.auth { background: linear-gradient(160deg, var(--brand-light) 0%, var(--bg) 55%); min-height: 100vh; }
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo { width: 88px; height: 88px; object-fit: contain; }
.auth-mark { width: 72px; height: 72px; border-radius: 18px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 2rem; }
.auth-title { margin-top: 12px; font-weight: 700; font-size: 1.15rem; }
.auth-card { background: var(--surface); border-radius: 14px; padding: 26px 22px; box-shadow: 0 8px 30px rgba(20, 40, 30, .08); }
.auth-h1 { font-size: 1.35rem; margin-bottom: 10px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .92rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 22px; }
.auth-sent-icon { font-size: 2.4rem; color: var(--brand); text-align: center; }

/* ---------- Širší obrazovky ---------- */
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .slots { grid-template-columns: 1fr 1fr; }
  .usermenu-name { display: inline; }
}
@media (min-width: 900px) {
  .mainnav { display: flex; }
  .tabbar { display: none; }
  .page { padding: 28px 24px 48px; }
  .footer { padding: 0 24px 32px; }
  h1 { font-size: 1.7rem; }
  .layout-2 { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
@media (max-width: 560px) {
  .page-head { align-items: stretch; }
  .page-actions .btn { flex: 1 1 auto; }
  .agenda-note, .agenda-task, .agenda-edit { margin-left: 0; }
  .topic-row { flex-wrap: wrap; }
  .topic-row-badges { justify-content: flex-start; }
  .search, .search input { width: 100%; min-width: 0; }
  .task-row { flex-wrap: wrap; }
  .task-side { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .dropdown-pop { right: auto; left: 0; }
  .dropdown-right .dropdown-pop { left: auto; right: 0; }
}
@media print {
  .topbar, .tabbar, .footer, .page-actions, .agenda-tools, .agenda-edit, .add-item { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Zasedání (fáze 2) ---------- */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.stepper li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mute-bg); font-size: .75rem; font-weight: 700; }
.stepper li.done { color: var(--green); border-color: transparent; background: var(--green-bg); }
.stepper li.done span { background: var(--green); color: #fff; }
.stepper li.current { color: #fff; background: var(--brand); border-color: var(--brand); }
.stepper li.current span { background: #fff; color: var(--brand); }
.row-links { display: flex; flex-wrap: wrap; gap: 8px; }
.council-items { display: grid; gap: 0; }
.citem { border-top: 1px solid var(--line); padding: 14px 0; }
.citem:first-child { border-top: 0; padding-top: 0; }
.citem:target { background: var(--brand-light); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.citem-head { display: flex; gap: 10px; align-items: flex-start; }
.citem-edit { margin: 10px 0 0 38px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fcfcfb; }
.citem-edit > summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); }
.citem-edit[open] > summary { margin-bottom: 12px; }
.resbox { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 14px 6px; margin: 0 0 14px; background: var(--surface); min-width: 0; }
.resbox legend { font-weight: 700; padding: 0 6px; font-size: .92rem; }
.res-auto { font-weight: 600; font-style: italic; background: var(--bg); padding: 8px 12px; border-radius: 6px; }
.part { margin-bottom: 12px; }
.part-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.part-head select { width: auto; min-width: 180px; }
.part-letter { font-size: 1.05rem; }
.part-task { margin-top: 8px; }
.res-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vote-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0 6px; border-top: 1px dashed var(--line-strong); margin-top: 6px; }
.vote-row label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; }
.vote-row input { width: 74px; min-height: 40px; }
.att-doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 10px; }
.att-doc .check { margin: 0; }
.attendance { display: grid; gap: 8px; margin-bottom: 12px; }
.att-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.att-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.seg-sm span { padding: 5px 10px; font-size: .85rem; }
.res-view { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0 38px; font-style: italic; }
.prose.small { font-size: .95rem; margin: 8px 0 0 38px; }
.danger-zone { margin: 24px 0 0; text-align: right; }
.res-row { display: flex; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.res-row:first-child { border-top: 0; }
.res-no { flex: none; width: 58px; text-align: center; background: var(--brand-light); color: var(--brand-dark); border-radius: 8px; padding: 6px 4px; height: fit-content; }
.res-no strong { display: block; font-size: 1.3rem; line-height: 1.1; }
.res-no span { font-size: .75rem; }
.res-main { flex: 1; min-width: 0; }
.res-text { margin: 6px 0; }
.res-contract { margin-top: 6px; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input[type=date] { width: auto; min-height: 34px; padding: 4px 8px; }
.search select { width: auto; min-height: 44px; }
.search { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.search input[type=search] { min-width: 280px; }
@media (max-width: 720px) { .search { flex-wrap: wrap; } .search input[type=search] { min-width: 0; } }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .citem-edit, .res-view, .prose.small { margin-left: 0; }
  .part-head select { min-width: 0; flex: 1; }
}
.settings-tabs { margin-bottom: 18px; }
