@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f4f6f9; --surface: #ffffff; --sunken: #f0f3f7; --line: #e1e6ee; --line-strong: #cdd5e1;
  --ink: #0b1220; --text: #2a3343; --muted: #5b6779; --faint: #7f8a9d;
  --accent: #0055fe; --accent-hover: #0047d8; --accent-text: #0050ee; --accent-soft: #ebf1ff; --on-accent: #ffffff;
  --ok: #12764a; --ok-soft: #e4f4eb; --warn: #875400; --warn-soft: #fff1d0; --bad: #bb2e18; --bad-soft: #fdebe6; --on-bad: #ffffff;
  --shadow: 0 1px 2px rgb(11 18 32 / 0.05), 0 2px 6px -2px rgb(11 18 32 / 0.04);
  --r-card: 16px; --r-ctl: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050505; --surface: #0f1114; --sunken: #16191e; --line: #20242b; --line-strong: #2f343e;
    --ink: #f2f4f8; --text: #c9d0db; --muted: #949eaf; --faint: #737d8f;
    --accent: #0055fe; --accent-hover: #1f68ff; --accent-text: #86aaff; --accent-soft: #0f1d3b; --on-accent: #ffffff;
    --ok: #4fd296; --ok-soft: #0d2219; --warn: #f0c25a; --warn-soft: #272010; --bad: #ff917c; --bad-soft: #2c1410; --on-bad: #1d0905;
    --shadow: 0 0 0 transparent;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol { margin: 0; }
.plain { list-style: none; padding: 0; }
h1 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); line-height: 1.15; font-weight: 650; letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; }
h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.012em; color: var(--ink); }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; color: var(--ink); }
a { color: var(--accent-text); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 28px; height: 28px; stroke-width: 1.5; }

/* Rozvržení: jeden sloupec na telefonu, od 760 px širší, od 1100 px fronta a pravý sloupec */
.wrap { width: 100%; max-width: 752px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
main.wrap { padding-block: 24px max(40px, env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.hdr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; letter-spacing: -0.012em; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); flex: none; }
.mark .i { width: 18px; height: 18px; stroke-width: 2.25; }
.hdr-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.secbar { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.secbar .i { width: 18px; height: 18px; }
.secbar .good, .mh-pill .i { color: var(--ok); }
.mh-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.mh-pill .i { width: 16px; height: 16px; }
.hdr-user { display: none; align-items: center; gap: 10px; font-size: 14px; }
.hdr-user strong { color: var(--ink); font-weight: 600; }
.wide-only { display: none; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.hdr-user .avatar { width: 32px; height: 32px; font-size: 14px; }
@media (min-width: 760px) {
  .wrap { max-width: 892px; }
  .secbar, .hdr-user { display: flex; }
  .mh-pill { display: none; }
}
@media (min-width: 1100px) { .wide-only { display: inline; } }

.screen, .msg-grid, .msg-main, .side { display: grid; gap: 36px; min-width: 0; align-content: start; }
.side { display: none; gap: 16px; }
.screen-head { display: grid; gap: 10px; }
.section { display: grid; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.aside, .empty-line { font-size: 13.5px; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.day { display: grid; gap: 8px; }
.day + .day { margin-top: 12px; }
.day-label { font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--muted); font-size: 15px; max-width: 62ch; }
.with-icon { display: flex; align-items: flex-start; gap: 8px; }
.with-icon > .i { width: 18px; height: 18px; margin-top: 2px; color: var(--faint); }
.h-count { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.count.zero { background: var(--sunken); color: var(--muted); }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.status strong { color: var(--ink); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.dot.ok { background: var(--ok); }

/* Karty, seznamy, štítky */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 16px; }
@media (min-width: 560px) { .card { padding: 20px; } }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.info { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent-text); }

/* Tlačítka a pole (min. 44 px) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 120ms ease, transform 120ms ease; }
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(0.98); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn-quiet:hover { background: var(--accent-soft); }
.btn-lg { min-height: 52px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions .btn-primary { flex: 1 1 auto; }
@media (min-width: 560px) { .card-actions .btn-primary { flex: 0 0 auto; min-width: 148px; } }
.field { display: grid; gap: 6px; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
label { font-size: 14px; font-weight: 600; color: var(--ink); }
.hint { font-size: 13.5px; color: var(--muted); }
.counter { font-size: 13px; color: var(--faint); }
input[type="text"], textarea { width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); }
textarea { min-height: 136px; resize: vertical; line-height: 1.55; }
.rules { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.rules li { display: flex; gap: 8px; align-items: flex-start; }
.rules .i { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }

/* Hlášky */
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--bad-soft); }
.alert > .i { color: var(--bad); margin-top: 1px; }
.alert.warn { background: var(--warn-soft); }
.alert.warn > .i { color: var(--warn); }
.alert-body { display: grid; gap: 6px; font-size: 14.5px; }
.alert-title { font-size: 15.5px; font-weight: 650; color: var(--ink); }
.msg { padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ink); font-size: 15px; }
.msg:empty { display: none; }
.msg.bad { background: var(--bad-soft); }
@media (prefers-reduced-motion: no-preference) {
  .msg:not(:empty) { animation: rise 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 20px; text-align: center; }
.empty .i-lg { color: var(--ok); margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 15px; }

/* Návrhy */
.draft { display: grid; gap: 14px; }
.draft-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.draft-who { min-width: 0; display: grid; gap: 1px; }
.draft-who h3 { font-size: 17px; overflow-wrap: anywhere; }
.ctx { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.stamp { display: grid; justify-items: end; font-size: 13px; color: var(--faint); line-height: 1.35; }
.stamp b { font-weight: 600; color: var(--muted); }
.bubble { max-width: 76ch; padding: 14px 16px; border-radius: 14px; background: var(--sunken); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.editor { display: grid; gap: 14px; }
.editor textarea { max-width: 76ch; }
.paused { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.paused .i { width: 16px; height: 16px; color: var(--bad); }

/* Rozhodnuté: na telefonu řádky, od 760 px tabulka; posledních 5, zbytek po „Show all“ */
.drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; padding: 14px 16px; }
.d-main { grid-column: 1; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.d-who .id { font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.d-ctx { font-weight: 400; color: var(--muted); }
.d-what { grid-column: 1; font-size: 14px; color: var(--muted); }
.d-state { grid-column: 2; grid-row: 1 / span 2; }
.dhead { display: none; }
[data-collapsed] .more { display: none; }
.more-btn { justify-self: start; margin-left: -10px; }
@media (min-width: 760px) {
  .drow { grid-template-columns: 52px minmax(110px, 0.8fr) minmax(0, 1fr) minmax(0, 1.7fr) 156px; gap: 16px; align-items: center; padding: 12px 16px; }
  .d-main, .d-what { display: contents; }
  .d-dot, .d-sep { display: none; }
  .d-time { grid-column: 1; grid-row: 1; font-size: 14px; }
  .d-who { grid-column: 2; grid-row: 1; }
  .d-ctx { grid-column: 3; grid-row: 1; font-size: 14px; }
  .d-note { grid-column: 4; grid-row: 1; font-size: 14px; color: var(--text); }
  .d-state { grid-column: 5; grid-row: 1; justify-self: end; }
  .dhead { display: grid; padding-block: 9px; background: var(--sunken); font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .dhead span:last-child { justify-self: end; }
}

/* Pravý sloupec (jen data, která panel má) */
.side-card { display: grid; gap: 12px; padding: 16px 18px; }
.side-card h2 { font-size: 15px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.side-text { font-size: 14px; color: var(--muted); }
.hold-list { display: grid; gap: 10px; }
.hold-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hold-row > div { display: grid; min-width: 0; }
.hold-row b { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.hold-row .id { font-weight: 500; color: var(--faint); }
.hold-row > div > span { font-size: 13.5px; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: 14px; color: var(--text); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; }
.session-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Veřejné stránky: úzká karta uprostřed */
.public { display: grid; justify-items: center; gap: 16px; padding-top: clamp(8px, 6vh, 72px); }
.public-card { width: 100%; max-width: 420px; display: grid; gap: 20px; padding: 24px; }
@media (min-width: 560px) { .public-card { padding: 32px; } }
.public-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); }
.public-brand small { margin-left: auto; font-weight: 400; font-size: 13.5px; color: var(--muted); }
.assure { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.assure li { display: flex; gap: 10px; align-items: flex-start; }
.assure .i { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.public-foot { font-size: 13px; color: var(--faint); text-align: center; max-width: 420px; }
.stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; }
.stepper li { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.stepper li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); }
.stepper li.done { color: var(--muted); }
.stepper li.done::before, .stepper li[aria-current="step"]::before { background: var(--accent); }
.stepper li[aria-current="step"] { color: var(--ink); }
.code-step { display: grid; gap: 16px; }
.h-big { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.code { display: flex; justify-content: center; padding: 18px 12px; border-radius: 14px; background: var(--sunken); border: 1px solid var(--line); font-size: clamp(2.25rem, 1.8rem + 2vw, 2.75rem); font-weight: 650; letter-spacing: 0.08em; color: var(--ink); font-variant-numeric: tabular-nums; }
.saved { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ok); }
.saved .i { width: 18px; height: 18px; }

/* Od 1100 px: fronta a pravý sloupec; od 1600 px obsah do 1680 px a návrhy ve dvou sloupcích */
@media (min-width: 1100px) {
  .wrap { max-width: 1272px; }
  .msg-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 22vw, 420px); gap: 32px; align-items: start; }
  .side { display: grid; }
  .msg-status, .session-foot { display: none; }
}
@media (min-width: 1600px) {
  .wrap { max-width: 1712px; }
  .drafts { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
/* ---------- Navigace (jen se zapnutou poštou nebo kalendářem): nahoře od 760 px, na telefonu spodní lišta ---------- */
a.brand { min-height: 44px; text-decoration: none; }
.tabs { display: none; }
@media (min-width: 760px) {
  .tabs { display: flex; gap: 2px; margin: 0 0 -1px -12px; overflow-x: auto; scrollbar-width: none; }
  .tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; }
  .tabs a:hover { color: var(--ink); }
  .tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
  .tabs a[aria-current="page"] .i { color: var(--accent-text); }
}
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.tabbar ul { display: grid; list-style: none; margin: 0 auto; padding: 0; max-width: 560px; }
.tabbar .n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tabbar .n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabbar .n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar .n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabbar .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .i { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar a[aria-current="page"] .i { stroke-width: 2.1; }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 5px); display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; border: 2px solid var(--surface); background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .tabbar { display: none; } }
@media (max-width: 759px) { body[data-nav] main.wrap { padding-bottom: calc(60px + env(safe-area-inset-bottom) + 28px); } }

/* ---------- Společné pro nové obrazovky ---------- */
.soft { font-weight: 400; color: var(--muted); }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; }
a.row { color: inherit; text-decoration: none; }
a.row:hover { background: var(--sunken); }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-main > span { display: block; }
.row-title { font-weight: 600; color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.row-title > .i { vertical-align: -3px; margin-right: 6px; color: var(--faint); }
.row-sub { font-size: 14px; color: var(--muted); }
.tile { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--sunken); color: var(--ink); border: 1px solid var(--line); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn-danger-solid:hover { background: var(--bad); opacity: 0.92; }
.btn-quiet.btn-danger { color: var(--bad); }
.btn-quiet.btn-danger:hover { background: var(--bad-soft); }
.opt { font-weight: 400; color: var(--muted); }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.note > .i { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.inline-alert { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); font-size: 14.5px; color: var(--text); }
.inline-alert > .i { color: var(--bad); width: 18px; height: 18px; margin-top: 2px; }
.inline-alert.warn { background: var(--warn-soft); }
.inline-alert.warn > .i { color: var(--warn); }
.inline-alert b { color: var(--ink); font-weight: 650; }
.alert .btn { justify-self: start; margin-top: 4px; }
.status-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--text); }
.status-line .i { color: var(--ok); margin-top: 3px; }
.confirm { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bad-soft); font-size: 14.5px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pager { display: flex; gap: 8px; justify-content: space-between; }
select { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); }
input[type="date"], input[type="time"] { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: transparent; }
.field-row { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 10px; }
fieldset.checks { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.checks legend { padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.sub { margin-left: 30px; }
.field.sub { margin-bottom: 6px; }

/* ---------- Email ---------- */
.mail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 14px 16px; color: inherit; text-decoration: none; }
.mail-row:hover { background: var(--sunken); }
.mail-from { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mail-side { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); }
.mail-subj { grid-column: 1 / -1; color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.why { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.why b { color: var(--accent-text); font-weight: 650; white-space: nowrap; }
.mail-hidden .row-title, .mail-bad .row-title { font-weight: 500; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -4px; color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: 15px; justify-self: start; }
.detail { display: grid; gap: 20px; align-content: start; min-width: 0; }
.detail-head { display: grid; gap: 12px; }
.detail-title { font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.625rem); line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.meta-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14.5px; }
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.chk { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chk.ok { color: var(--ok); }
.chk.warn { color: var(--warn); }
.why-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14.5px; }
.why-box > .i { color: var(--accent-text); margin-top: 1px; }
.mail-card { display: grid; gap: 14px; }
.safe-strip { display: flex; gap: 8px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.safe-strip .i { width: 18px; height: 18px; color: var(--ok); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); line-height: 1.6; }
.link-text { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 1px 8px; border-radius: 7px; border: 1px dashed var(--line-strong); background: var(--sunken); color: var(--text); font-size: 14px; line-height: 1.6; white-space: nowrap; vertical-align: baseline; cursor: text; }
.link-text .i { width: 14px; height: 14px; color: var(--faint); }
.link-text b { font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.link-text.warn { border-color: var(--warn); background: var(--warn-soft); }
.link-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--warn); white-space: nowrap; }
.link-flag .i { width: 14px; height: 14px; }
.attach { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.attach > .i { width: 18px; height: 18px; color: var(--faint); margin-top: 1px; }
.attach-body { display: grid; gap: 6px; min-width: 0; }
.attach-list { display: grid; gap: 2px; }
.attach-list b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.send-panel { display: grid; gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--sunken); }
.send-panel h3 { font-size: 16px; }
.send-panel textarea { min-height: 92px; }
.wa-preview { display: grid; gap: 6px; }
.wa-from { font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.wa-bubble { justify-self: start; max-width: 60ch; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }

/* ---------- Calendar ---------- */
.proposal { display: grid; gap: 14px; }
.prop-head { display: flex; gap: 14px; align-items: center; }
.prop-head > div { min-width: 0; display: grid; gap: 2px; }
.prop-head h3 { font-size: 17px; overflow-wrap: anywhere; }
.date-tile { display: grid; justify-items: center; align-content: center; width: 52px; min-height: 58px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); line-height: 1.1; }
.date-tile .dw { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.date-tile b { font-size: 22px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.date-tile .mo { font-size: 11px; color: var(--muted); }
.src { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.src .i { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.conflict { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--warn); font-weight: 500; overflow-wrap: anywhere; }
.conflict .i { width: 18px; height: 18px; margin-top: 1px; }
.fits { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ok); font-weight: 500; }
.fits .i { width: 18px; height: 18px; }
.tl { display: grid; gap: 4px; }
.tl-track, .tl-axis { display: grid; }
.tl-track { grid-template-rows: 28px 28px; row-gap: 6px; padding-block: 6px; background-image: linear-gradient(to right, var(--line-strong) 1px, transparent 1px); border-right: 1px solid var(--line-strong); }
.tl-bar { display: flex; align-items: center; min-width: 0; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-bar.busy { background: var(--sunken); border: 1px solid var(--line-strong); color: var(--text); }
.tl-bar.new { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-text); }
.tl-overlap { grid-row: 1 / 3; margin-block: -3px; border: 1.5px dashed var(--warn); border-radius: 7px; z-index: 1; pointer-events: none; }
.tl-axis { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-axis span { grid-row: 1; justify-self: start; }
.tl-axis .mid { transform: translateX(-50%); }
.tl-axis .end { justify-self: end; }
.r1 { grid-row: 1; } .r2 { grid-row: 2; }
.tl-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); background-size: calc(200% / 2) 100%; }
.tl-c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); background-size: calc(200% / 4) 100%; }
.tl-c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); background-size: calc(200% / 6) 100%; }
.tl-c8 { grid-template-columns: repeat(8, minmax(0, 1fr)); background-size: calc(200% / 8) 100%; }
.tl-c10 { grid-template-columns: repeat(10, minmax(0, 1fr)); background-size: calc(200% / 10) 100%; }
.tl-c12 { grid-template-columns: repeat(12, minmax(0, 1fr)); background-size: calc(200% / 12) 100%; }
.tl-c14 { grid-template-columns: repeat(14, minmax(0, 1fr)); background-size: calc(200% / 14) 100%; }
.tl-c16 { grid-template-columns: repeat(16, minmax(0, 1fr)); background-size: calc(200% / 16) 100%; }
.tl-c18 { grid-template-columns: repeat(18, minmax(0, 1fr)); background-size: calc(200% / 18) 100%; }
.tl-c20 { grid-template-columns: repeat(20, minmax(0, 1fr)); background-size: calc(200% / 20) 100%; }
.tl-c22 { grid-template-columns: repeat(22, minmax(0, 1fr)); background-size: calc(200% / 22) 100%; }
.tl-c24 { grid-template-columns: repeat(24, minmax(0, 1fr)); background-size: calc(200% / 24) 100%; }
.from-1 { grid-column-start: 1; } .span-1 { grid-column-end: span 1; }
.from-2 { grid-column-start: 2; } .span-2 { grid-column-end: span 2; }
.from-3 { grid-column-start: 3; } .span-3 { grid-column-end: span 3; }
.from-4 { grid-column-start: 4; } .span-4 { grid-column-end: span 4; }
.from-5 { grid-column-start: 5; } .span-5 { grid-column-end: span 5; }
.from-6 { grid-column-start: 6; } .span-6 { grid-column-end: span 6; }
.from-7 { grid-column-start: 7; } .span-7 { grid-column-end: span 7; }
.from-8 { grid-column-start: 8; } .span-8 { grid-column-end: span 8; }
.from-9 { grid-column-start: 9; } .span-9 { grid-column-end: span 9; }
.from-10 { grid-column-start: 10; } .span-10 { grid-column-end: span 10; }
.from-11 { grid-column-start: 11; } .span-11 { grid-column-end: span 11; }
.from-12 { grid-column-start: 12; } .span-12 { grid-column-end: span 12; }
.from-13 { grid-column-start: 13; } .span-13 { grid-column-end: span 13; }
.from-14 { grid-column-start: 14; } .span-14 { grid-column-end: span 14; }
.from-15 { grid-column-start: 15; } .span-15 { grid-column-end: span 15; }
.from-16 { grid-column-start: 16; } .span-16 { grid-column-end: span 16; }
.from-17 { grid-column-start: 17; } .span-17 { grid-column-end: span 17; }
.from-18 { grid-column-start: 18; } .span-18 { grid-column-end: span 18; }
.from-19 { grid-column-start: 19; } .span-19 { grid-column-end: span 19; }
.from-20 { grid-column-start: 20; } .span-20 { grid-column-end: span 20; }
.from-21 { grid-column-start: 21; } .span-21 { grid-column-end: span 21; }
.from-22 { grid-column-start: 22; } .span-22 { grid-column-end: span 22; }
.from-23 { grid-column-start: 23; } .span-23 { grid-column-end: span 23; }
.from-24 { grid-column-start: 24; } .span-24 { grid-column-end: span 24; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; flex: none; }
.sw.busy { background: var(--sunken); border: 1px solid var(--line-strong); }
.sw.new { background: var(--accent-soft); border: 1px solid var(--accent); }
.sw.ovl { border: 1.5px dashed var(--warn); }
.ev { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 12px 16px; }
.ev-time { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ev-time small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.ev-main { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.ev-title { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.ev-sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ev.proposed { background: var(--accent-soft); }
.ev.proposed .ev-time { color: var(--accent-text); }
.ev .flag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--warn); }
.ev .flag .i { width: 14px; height: 14px; }
.ev .flag.info { color: var(--accent-text); }
.ev.private .ev-title, .ev.invite .ev-title { color: var(--muted); }
.ev.private .ev-sub { display: inline-flex; align-items: center; gap: 5px; }
.ev.private .ev-sub .i { width: 13px; height: 13px; }

/* ---------- Connections ---------- */
.conn { display: grid; gap: 14px; align-content: start; }
.conn-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.conn-id { min-width: 0; display: grid; gap: 1px; }
.conn-id h3 { font-size: 16.5px; }
.conn-id p { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 14px; color: var(--muted); }
.facts b { font-weight: 500; color: var(--ink); }
.does { font-size: 14px; color: var(--text); padding-top: 12px; border-top: 1px solid var(--line); }
.scope { display: grid; border-top: 1px solid var(--line); }
.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.scope-row + .scope-row { border-top: 1px solid var(--line); }
.scope-main { display: grid; gap: 6px; min-width: 0; }
.scope-main > b { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.scope-main > .soft { font-size: 13.5px; }
.scope + .does { border-top: 0; padding-top: 0; }
.ask-form { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.conn-pane { display: grid; gap: 36px; align-content: start; min-width: 0; }
.conn-grid { display: grid; gap: 12px; }
.conn-about { display: none; gap: 12px; align-content: start; padding: 20px; border-radius: var(--r-card); background: var(--sunken); border: 1px solid var(--line); }
.conn-about h3 { font-size: 15px; }
.conn-about ul { display: grid; gap: 10px; }
.conn-about li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; font-size: 14px; color: var(--text); }
.conn-about .i { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }

/* ---------- Security ---------- */
.sec-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; }
.sec-row .tile { width: 36px; height: 36px; border-radius: 10px; }
.sec-row .tile .i { width: 18px; height: 18px; }
.sec-main { min-width: 0; display: grid; gap: 1px; }
.sec-main b { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.sec-main span { font-size: 14px; color: var(--muted); }
.list > .confirm { border-radius: 0; }
.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; background: var(--sunken); }
.how-list { display: grid; gap: 12px; list-style: none; margin: 0; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--sunken); }
.seg-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.seg-tab:hover { color: var(--ink); }
.seg-tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
@media (min-width: 560px) { .seg { justify-self: start; display: inline-grid; grid-template-columns: repeat(2, auto); } }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: clip; }
.atable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.atable th, .atable td { padding: 10px 16px; text-align: left; vertical-align: top; }
.atable thead th { position: sticky; top: 0; z-index: 1; background: var(--sunken); font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.th-note { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--faint); }
.atable tbody tr + tr > * { border-top: 1px solid var(--line); }
.atable .grp th { padding-block: 8px; background: var(--bg); font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.a-time { width: 64px; color: var(--muted); }
.a-act { font-weight: 600; color: var(--ink); }
.a-item { color: var(--ink); overflow-wrap: anywhere; }
.a-key, .a-net { color: var(--muted); }
@media (min-width: 1100px) { .a-act, .a-key, .a-net { white-space: nowrap; } }
@media (max-width: 759px) {
  .atable thead { display: none; }
  .atable, .atable tbody { display: block; }
  .atable tr { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 12px 16px; }
  .atable tr.grp { display: block; padding: 0; }
  [data-collapsed] .atable tr.more { display: none; }
  .atable th, .atable td { padding: 0; border: 0; }
  .atable tbody tr + tr > * { border-top: 0; }
  .atable tbody tr + tr { border-top: 1px solid var(--line); }
  .atable .grp th { display: block; padding: 8px 16px; }
  .a-time { flex: 0 0 44px; width: auto; }
  .a-act { flex: 1 1 0; }
  .a-item { flex: 1 0 100%; }
  .a-key, .a-net { flex: 0 1 auto; font-size: 13.5px; }
  .a-key:not(:empty)::after { content: " passkey"; }
  .a-net:not(:empty)::before { content: "· "; }
}

/* ---------- Rozvržení obrazovek ---------- */
.mail-grid, .mail-list-pane, .cal-grid, .sec-grid, .sec-col { display: grid; gap: 36px; min-width: 0; }
.mail-list-pane, .sec-col { align-content: start; }
.cal-main { display: contents; }
.cal-needs { order: 1; } .cal-side { order: 2; } .cal-decided { order: 3; }
.mail-placeholder { display: none; }
.bubble, .mail-body, .why-box { max-width: 76ch; }
/* telefon a tablet: seznam, nebo e-mail, nikdy obojí */
@media (max-width: 1099px) {
  body[data-view="detail"] .mail-head, body[data-view="detail"] .mail-list-pane, body[data-view="list"] .mail-detail-pane { display: none; }
}
@media (min-width: 760px) {
  .conn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .conn-about { display: grid; }
}
@media (min-width: 1100px) {
  .narrow-only { display: none; }
  .mail-grid { grid-template-columns: clamp(340px, 24vw, 440px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .mail-row[aria-current="true"] { background: var(--accent-soft); }
  .mail-detail-pane { padding: 24px 28px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
  .mail-detail-pane .mail-card { padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
  .mail-body { max-width: 72ch; }
  .mail-placeholder { display: grid; align-content: center; min-height: 420px; }
  .cal-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 420px); gap: 32px; align-items: start; }
  .cal-main { display: grid; gap: 36px; min-width: 0; align-content: start; order: 1; }
  .sec-grid { grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 420px); gap: 32px; align-items: start; }
}
@media (min-width: 1600px) {
  .cal-needs .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .conn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mail-detail-pane > * { max-width: 880px; }
}

/* Od 1100 × 720 jako aplikace: stránka se neroluje, sloupce každý sám (app.js jim dá tabindex) */
.pane:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; border-radius: 6px; }
@media (min-width: 1100px) and (min-height: 720px) {
  html, body { height: 100%; }
  body[data-app] { display: flex; flex-direction: column; overflow: hidden; }
  body[data-app] .app-header { position: static; flex: none; }
  body[data-app] main.wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-block: 20px 0; }
  body[data-app] .screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 20px; }
  body[data-app] .fill { flex: 1 1 auto; min-height: 0; }
  /* Jen mřížky se sloupci (fronta, e-mail, kalendář, zabezpečení): jeden řádek přes celou výšku, každý sloupec roluje
     sám. Roletovací oblast sama (.pane.fill, Connections, aktivita) má řádky podle obsahu, jinak by sekce pod kartami
     začala uprostřed nich (řádek minmax(0, 1fr) se smrskne a karty z něj přetečou). */
  body[data-app] .fill:not(.pane) { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  body[data-app] .pane { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding: 2px 10px 24px 2px; margin: -2px -10px 0 -2px; }
  body[data-app] .mail-detail-pane { padding: 24px 28px 28px; margin: 0; }
  body[data-app] .mail-placeholder { height: 100%; min-height: 0; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
