/* Portál Můžeš – minimalistický vzhled: šalvějový podklad, písmo Inter, jeden fialový akcent,
   tenké linky bez stínů. Stav materiálu ukazuje barevná tečka. */

/* Inter (SIL OFL 1.1, viz fonts/Inter-OFL.txt) je přibalený, aby portál fungoval i bez internetu.
   Proměnné písmo 400–700, sady latin a latin-ext (čeština). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-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: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-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 {
  --paper: #f3f5f1;
  --surface: #ffffff;
  --side: #e9ede6;
  --ink: #1b1f1c;
  --muted: #5d655f;
  --line: #dde2db;
  --field: #f7f9f6;
  --accent: #5b4a8a;
  --accent-ink: #ffffff;
  --accent-soft: #ece8f5;
  --agent: #2f6b8a;
  --agent-soft: #e2eef4;
  --ok: #2f7a4a;
  --ok-soft: #e1f0e6;
  --danger: #a3352b;
  --danger-soft: #f8e5e2;
  /* Stavy materiálu */
  --st-napad: #c99a1e;
  --st-zadano: #3f78b5;
  --st-odevzdano: #8a5cc2;
  --st-editovano: #2f8a83;
  --st-korektura: #d0663f;
  --st-po_korekture: #b4782f;
  --st-zlom: #c25a7a;
  --st-popisky: #6a5ad0;
  --st-hotovo: #3a8a57;
  --hot: #d0663f;
  --good: #3a8a57;
  /* Rubriky podle pořadí v čísle */
  --r0: #3b3f3c;
  --r1: #2f8a83;
  --r2: #c4862a;
  --r3: #c25a7a;
  --r4: #4f6fb8;
  --r5: #6f7d72;
  --r6: #a8afa9;
  --r7: #8a6a3f;
  --rx: #a8afa9;
  --radius: 10px;
  --gap: 12px; /* jednotná mezera mezi kartami a panely */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 208px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151815;
    --surface: #1c201c;
    --side: #111411;
    --ink: #e8ece8;
    --muted: #a3ada5;
    --line: #2c322d;
    --field: #181b18;
    --accent: #b8a8e8;
    --accent-ink: #151815;
    --accent-soft: #2a2540;
    --agent: #8cc3dd;
    --agent-soft: #1f2f38;
    --ok: #8fd0a4;
    --ok-soft: #1f3326;
    --danger: #f08a7c;
    --danger-soft: #3a2220;
    --st-napad: #e0bd55;
    --st-zadano: #79aee6;
    --st-odevzdano: #b896e6;
    --st-editovano: #5cc1b8;
    --st-korektura: #ec9372;
    --st-po_korekture: #e0aa66;
    --st-zlom: #e58aa5;
    --st-popisky: #a99cf0;
    --st-hotovo: #74c48f;
    --hot: #ec9372;
    --good: #74c48f;
  --r0: #c9cfca;
  --r1: #5cc1b8;
  --r2: #e3ad5c;
  --r3: #e58aa5;
  --r4: #8ea8e8;
  --r5: #9aa79d;
  --r6: #5d655f;
  --r7: #c9a57a;
  --rx: #5d655f;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #151815;
  --surface: #1c201c;
  --side: #111411;
  --ink: #e8ece8;
  --muted: #a3ada5;
  --line: #2c322d;
  --field: #181b18;
  --accent: #b8a8e8;
  --accent-ink: #151815;
  --accent-soft: #2a2540;
  --agent: #8cc3dd;
  --agent-soft: #1f2f38;
  --ok: #8fd0a4;
  --ok-soft: #1f3326;
  --danger: #f08a7c;
  --danger-soft: #3a2220;
  --st-napad: #e0bd55;
  --st-zadano: #79aee6;
  --st-odevzdano: #b896e6;
  --st-editovano: #5cc1b8;
  --st-korektura: #ec9372;
  --st-po_korekture: #e0aa66;
  --st-zlom: #e58aa5;
  --st-popisky: #a99cf0;
  --st-hotovo: #74c48f;
  --hot: #ec9372;
  --good: #74c48f;
  --r0: #c9cfca;
  --r1: #5cc1b8;
  --r2: #e3ad5c;
  --r3: #e58aa5;
  --r4: #8ea8e8;
  --r5: #9aa79d;
  --r6: #5d655f;
  --r7: #c9a57a;
  --rx: #5d655f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 15.5px/1.55 var(--font-ui);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
code { font-family: var(--font-mono); font-size: 0.86em; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.lead { font-size: 1.05rem; font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* --- Kostra: levý panel + horní lišta --- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--side);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  padding: 2px 8px 24px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font: 700 15px/1 var(--font-ui);
}

.brand-name { font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }

.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.sidebar nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
}

.sidebar nav a:hover { color: var(--ink); background: var(--surface); }

.sidebar nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title { font-size: 1.05rem; margin: 0; flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.user-name { color: var(--muted); font-size: 0.9rem; }

.content { padding: 28px; max-width: 1120px; width: 100%; }
.content-wide { max-width: 1500px; }
/* Stránkové sekce: mezi nimi může stát dialog, proto ~ a ne +. */
.content section:not([class]) ~ section:not([class]) { margin-top: 32px; }
.content .form-sections, .content .form-sections + section { margin-top: 28px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.topbar .menu-btn, .sidebar-backdrop { display: none; }
.crumb { color: var(--muted); text-decoration: none; font-weight: 400; }
.crumb:hover { color: var(--accent); }

/* --- Prvky --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.93rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); border-color: var(--line); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-small { min-height: 30px; padding: 3px 10px; font-size: 0.86rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover { background: var(--side); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

/* --- Formuláře --- */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 0.82rem; color: var(--muted); }

.field input,
.field select,
.field textarea,
.table input,
.table select,
.add-person select,
.add-person input,
.note-new textarea,
.note textarea,
.search input {
  font: inherit;
  padding: 8px 11px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus,
.table input:focus, .table select:focus, .add-person select:focus, .add-person input:focus,
.note-new textarea:focus, .note textarea:focus, .search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field textarea, .note-new textarea, .note textarea { resize: vertical; line-height: 1.5; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
fieldset.address { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 0; margin: 0 0 14px; }
fieldset.address legend { padding: 0 6px; font-size: 0.86rem; }
.field-row .field { flex: 1 1 150px; min-width: 0; }
.field-row .field-grow { flex: 3 1 240px; }
.input-narrow { max-width: 110px; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0; }
.form-inline .field { margin: 0; flex: 1 1 200px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 460px; }

.alert { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.alert p { margin: 0 0 6px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--ok-soft); color: var(--ink); }

.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret code {
  background: var(--surface);
  padding: 6px 8px;
  border-radius: 6px;
  word-break: break-all;
  flex: 1 1 260px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}

.empty p { margin: 4px 0; }

.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge-human { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.badge-agent { border-color: transparent; background: var(--agent-soft); color: var(--agent); }
.badge-ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }

/* Filtr jako řada tlačítek: aktivní má jemné podbarvení */
.segmented { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.segmented a {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.segmented a:hover { color: var(--ink); background: var(--side); }
.segmented a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.segmented .count { opacity: 0.75; font-size: 0.85em; margin-left: 2px; }

/* --- Přehled aktivity --- */

.activity { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item .badge { margin-top: 2px; min-width: 56px; text-align: center; }
.activity-body { min-width: 0; overflow-wrap: anywhere; }

/* --- Tabulka --- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.table form { margin: 0; }

/* --- Přihlášení --- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* --- Dlaždice čísel --- */

.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.issue-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.issue-tile:hover { border-color: var(--accent); }
.issue-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.issue-label { font-weight: 700; font-size: 1.65rem; line-height: 1.1; letter-spacing: -0.02em; }
.issue-theme { color: var(--muted); margin-bottom: 8px; }
.issue-stats { display: flex; gap: 18px; margin: 0; }
.issue-stats dt { font-size: 0.78rem; color: var(--muted); order: 2; }
.issue-stats div { display: flex; flex-direction: column; }
.issue-stats dd { margin: 0; font-weight: 600; }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.progress span { display: block; height: 100%; background: var(--accent); }

/* --- Pracovní prostor čísla --- */

.issue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.issue-title { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -0.02em; }
.issue-deadlines { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0; }
.issue-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.milestone-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; overflow-x: auto; overflow-y: hidden; }
.tabs a {
  padding: 0 0 10px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tabs .step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.tabs a[aria-current="page"] .step { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.prep-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.part { margin-top: 28px; }
.part-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.part-head h3 { margin: 0; font-size: 1.05rem; }
.part-head .btn { margin-left: auto; }
.part-empty { margin: 4px 0; }
.group-label { font-size: 0.95rem; font-weight: 600; margin: 14px 0 8px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.tile:hover { border-color: var(--accent); }
.tile.kind-volne { border-style: dashed; background: transparent; color: var(--muted); }
.tile-top { display: flex; gap: 8px; align-items: center; min-height: 18px; }
.tile-pages { margin-left: auto; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.tile-title { font-weight: 600; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.tile-people { color: var(--muted); }
.tile-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: auto; padding-top: 2px; }

.code {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.code-quiet { color: var(--muted); font-weight: 500; letter-spacing: 0; }
.chip { font-size: 0.74rem; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip-notes { border-color: transparent; padding: 0; margin-left: auto; }

/* Stav: barevná tečka a popisek */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--muted)); }
.status-napad { --st: var(--st-napad); }
.status-zadano { --st: var(--st-zadano); }
.status-odevzdano { --st: var(--st-odevzdano); }
.status-editovano { --st: var(--st-editovano); }
.status-korektura { --st: var(--st-korektura); }
.status-po_korekture { --st: var(--st-po_korekture); }
.status-zlom { --st: var(--st-zlom); }
.status-popisky { --st: var(--st-popisky); }
.status-hotovo { --st: var(--st-hotovo); }

/* --- Řídicí panel čísla --- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.panel + .panel, .tab-body > .panel { margin-top: var(--gap); }
.panel h3 { margin: 0 0 14px; }
.panel-sub { margin-top: 26px !important; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: 0.84rem; }
.kpi-hot .kpi-value { color: var(--hot); }

.timeline { position: relative; height: 86px; margin: 26px 8px 4px; }
.timeline-axis, .timeline-done { position: absolute; left: 0; top: 7px; height: 2px; background: var(--line); }
.timeline-axis { right: 0; }
.timeline-done { background: var(--accent); }
.timeline-now { position: absolute; top: -18px; height: 34px; width: 2px; background: var(--accent); transform: translateX(-1px); }
.timeline-now span { position: absolute; top: -2px; left: 6px; font-size: 0.72rem; font-weight: 600; color: var(--accent); }
.milestone {
  position: absolute;
  top: 0;
  width: 120px;
  margin-left: -60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}
.milestone i { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); margin-bottom: 6px; }
.milestone .ms-date { font-variant-numeric: tabular-nums; }
.ms-past i { background: var(--accent); border-color: var(--accent); }
.ms-next { color: var(--ink); font-weight: 600; }
.ms-next i { border-color: var(--hot); box-shadow: 0 0 0 5px color-mix(in srgb, var(--hot) 20%, transparent); }

.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); }
.dash-side { display: grid; gap: var(--gap); align-content: start; }
.dash-side > .panel, .plan-side > .panel, .postprod > .panel { margin-top: 0; }

.rub { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.9rem; color: var(--ink); white-space: nowrap; }
.rub::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--rc, var(--rx)); flex-shrink: 0; }

.rubric-rows { display: grid; gap: 12px; }
.rubric-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.rubric-num { text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.stack i { display: block; height: 100%; transform-origin: left; animation: grow 0.7s ease-out both; }
.stack .st-napad { background: var(--st-napad); }
.stack .st-zadano { background: var(--st-zadano); }
.stack .st-odevzdano { background: var(--st-odevzdano); }
.stack .st-editovano { background: var(--st-editovano); }
.stack .st-korektura { background: var(--st-korektura); }
.stack .st-po_korekture { background: var(--st-po_korekture); }
.stack .st-zlom { background: var(--st-zlom); }
.stack .st-popisky { background: var(--st-popisky); }
.stack .st-hotovo { background: var(--st-hotovo); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.att-action { margin-left: auto; align-self: center; }
.ms-done i { background: var(--good) !important; border-color: var(--good) !important; }
.ms-action { font-size: 0.72rem; font-weight: 600; }
.attention li:last-child { border-bottom: 0; }
.attention a { color: var(--ink); font-weight: 500; text-decoration: none; }
.attention a:hover { color: var(--accent); }
.att-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--muted); }
.att-hot .att-dot { background: var(--hot); }
.att-warn .att-dot { background: var(--st-napad); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--side);
  color: var(--muted);
  border: 1px solid var(--line);
  position: relative;
}
.avatar-agent { background: var(--agent-soft); color: var(--agent); border-color: transparent; }
.avatar.online::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  border: 2px solid var(--surface);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.feed-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--muted); margin-left: auto; }
.presence .avatar { width: 24px; height: 24px; }
.feed { list-style: none; margin: 0 0 10px; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; font-size: 0.92rem; animation: feed-in 0.35s ease both; }
.feed li strong { font-weight: 500; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* --- Příprava: pás stran a rubriky --- */

.ribbon-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; margin-bottom: var(--gap); }
.ribbon-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ribbon-head h3 { margin: 0; }
.ribbon, .ribbon-nums { display: grid; grid-template-columns: repeat(var(--spreads), minmax(0, 1fr)); gap: 3px; }
.spread { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.spread-single { grid-template-columns: 1fr; }
.page {
  display: block;
  height: 48px;
  border-radius: 2px;
  background: var(--field);
  border: 1px solid var(--line);
  border-bottom: 3px solid color-mix(in srgb, var(--rc, var(--line)) 45%, var(--line));
  transition: transform 0.12s, opacity 0.12s;
}
.page-full { background: var(--rc); border-color: transparent; opacity: 0.9; }
.page-idea { opacity: 0.4; }
.page-full:hover, .page.is-hl { transform: translateY(-4px); opacity: 1; }
.prep.has-hl .page-full:not(.is-hl) { opacity: 0.2; }
.ribbon-nums { margin-top: 4px; font-size: 0.68rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

.lanes { display: grid; gap: var(--gap); }
[data-drag-id][draggable="true"] { cursor: grab; }
[data-drag-id].is-dragging { opacity: 0.45; }
.is-dragging-card [data-drop-url] { transition: box-shadow 0.12s, background-color 0.12s; }
.lane.is-drop { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.lane {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.lane-meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.lane-cap-text { margin-top: 4px; }
.over-text { color: var(--hot); font-weight: 600; }
.cap { display: flex; width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.cap i { display: block; height: 100%; background: var(--rc); transform-origin: left; animation: grow 0.6s ease-out both; }
.cap .cap-over { background: var(--hot); }
.lane-add { margin-top: 6px; margin-left: -10px; }
.blocks { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 0;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  /* Jemný nádech barvy rubriky místo barevného okraje */
  border: 1px solid color-mix(in srgb, var(--rc) 22%, var(--line));
  background: color-mix(in srgb, var(--rc) 7%, var(--surface));
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s, transform 0.12s;
}
.block:hover, .block.is-hl { border-color: var(--rc); transform: translateY(-1px); }
.block.st-napad { background: var(--surface); border-style: dashed; }
.block.is-reserve { background: transparent; border-style: dotted; opacity: 0.8; }
.block-title { font-weight: 500; line-height: 1.3; }
.block-meta { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; flex-wrap: wrap; }
.block-pages { margin-left: auto; color: var(--muted); white-space: nowrap; }
.block-people { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.block-notes { margin-left: auto; }

/* --- Flatplanning --- */

.plan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--gap); align-items: start; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px 12px; }
.plan-spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px; min-width: 0; }
.plan-spread-single { grid-template-columns: minmax(0, 1fr); width: calc(50% - 1px); }
.plan-spread-single:first-child { margin-left: auto; }
.plan-page {
  position: relative;
  min-width: 0;
  height: 128px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  transition: background 0.12s, border-color 0.12s;
}
.plan-page.is-drop { border-color: var(--accent); background: var(--accent-soft); }
.plan-page.is-overfull { border-color: var(--hot); }
.plan-num { position: absolute; top: 2px; left: 5px; font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
  padding: 4px 5px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--rc) 28%, var(--line));
  background: color-mix(in srgb, var(--rc) 12%, var(--surface));
  font-size: 0.74rem;
  line-height: 1.25;
  cursor: grab;
}
.seg.seg-idea { border-style: dashed; background: var(--surface); }
.seg.is-locked { cursor: default; }
.seg.is-dragging { opacity: 0.35; }
.seg-title { color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.seg-title:hover { color: var(--accent); }
.seg-cont { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seg-cont::before { content: "→ "; }
.seg-tools { display: flex; align-items: center; gap: 2px; }
.seg-pages { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 1.6em; text-align: center; }
.seg-btn {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.seg-btn:hover { background: var(--surface); color: var(--ink); }
.seg-btn-quiet { margin-left: auto; opacity: 0.55; }
.is-locked .seg-btn { color: var(--ink); }

.plan-side { display: grid; gap: var(--gap); position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.tray { transition: background 0.12s, border-color 0.12s; }
.tray.is-drop { border-color: var(--accent); background: var(--accent-soft); }
.tray-item {
  display: flex;
  flex-direction: column;
  padding: 7px 9px;
  margin-bottom: 6px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--rc) 22%, var(--line));
  background: color-mix(in srgb, var(--rc) 7%, var(--surface));
  cursor: grab;
}
.tray-item .rub { white-space: normal; font-weight: 500; }
.tray-item.is-reserve { background: transparent; border-style: dotted; }
.plan-page.is-cover { background: var(--field); }
.plan-page.is-cover .plan-num { font-weight: 600; color: var(--ink); }
.ads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ads li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.86rem; }
.ads a { color: var(--ink); text-decoration: none; }
.ads a:hover { color: var(--accent); }
.ad-page { position: relative; width: 26px; height: 36px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); overflow: hidden; }
.ad-page i { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--rx) 55%, var(--surface)); }
.ad-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.checks li { position: relative; padding: 5px 0 5px 16px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.checks .check-warn::before { background: var(--hot); }
.checks a { color: var(--ink); text-decoration: none; }
.checks a:hover { color: var(--accent); }

.plan-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.plan-form .field { margin: 0; }

/* --- Postprodukce --- */

.postprod { display: grid; gap: var(--gap); }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.subnav a { padding: 4px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.subnav a:hover { background: var(--side); color: var(--ink); }
.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.panel-head .btn, .panel-head > a:last-child { margin-left: auto; }
.ok-line { color: var(--ok); font-weight: 500; }
.row-title { color: var(--ink); font-weight: 500; text-decoration: none; }
.row-title:hover { color: var(--accent); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { border-bottom: 0; padding-top: 12px; }
\.fee-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; white-space: nowrap; }
.fee-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.fee-status-vyplaceno::before { background: var(--good); }
.fee-status-domluveno::before { background: var(--st-napad); }
.fee-zruseno td { color: var(--muted); text-decoration: line-through; }
.fee-zruseno td.row-actions { text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: 0.86rem; }

/* --- Produkce --- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prod-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.prod-filter { display: flex; flex-wrap: wrap; gap: 4px; }
.prod-filter .pf {
  font: inherit;
  font-size: 0.8rem;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.prod-filter .pf b { font-weight: 600; color: var(--ink); margin-left: 2px; }
.prod-filter .pf:hover { border-color: var(--muted); }
.prod-filter .pf.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prod-filter .pf.is-on b { color: var(--accent-ink); }
.prod-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.prod.list-hidden .prod-split { grid-template-columns: minmax(0, 1fr); }
.prod.list-hidden .prod-list { display: none; }
.prod-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
}
.prod-list h5 {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--field);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
.prod-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s;
}
.prod-item:hover { background: var(--field); }
.prod-row { display: flex; align-items: flex-start; gap: 2px; }
.prod-row > .prod-item { flex: 1 1 auto; min-width: 0; }
.prod-pick { display: flex; padding: 11px 2px 0 0; cursor: pointer; }
.prod-pick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.prod-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prod-actions form { display: contents; }
.link-like { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Zlom: PDF se značkami */
:root { --mk-oprava: #d62828; --mk-doplnit: #1f9a4d; --mk-zvyraznit: #f5c518; --mk-poznamka: #3367d9; }
.mk-oprava { --mk: var(--mk-oprava); }
.mk-doplnit { --mk: var(--mk-doplnit); }
.mk-zvyraznit { --mk: var(--mk-zvyraznit); }
.mk-poznamka { --mk: var(--mk-poznamka); }
.layout { display: grid; gap: var(--gap); }
.layout-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer; }
.tool i { width: 10px; height: 10px; border-radius: 50%; background: var(--mk); }
.tool[aria-pressed="true"] { border-color: var(--mk); box-shadow: inset 0 0 0 1px var(--mk); background: color-mix(in srgb, var(--mk) 10%, var(--surface)); }
.layout-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--gap); align-items: start; }
.layout-pages { display: grid; gap: var(--gap); }
.pdf-page { position: relative; width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 10px rgb(0 0 0 / 0.06); }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page-no { position: absolute; right: 8px; bottom: 6px; font-size: 0.72rem; color: #8a8f88; pointer-events: none; }
.mark-layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.mark { position: absolute; padding: 0; border: 2px solid var(--mk); background: color-mix(in srgb, var(--mk) 12%, transparent); border-radius: 2px; cursor: pointer; }
.mark.mk-zvyraznit { border-color: transparent; background: color-mix(in srgb, var(--mk) 40%, transparent); mix-blend-mode: multiply; }
.mark.is-ghost { pointer-events: none; border-style: dashed; }
.mark.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }
.mark.is-pin { width: 22px !important; height: 22px !important; margin: -22px 0 0 -2px; border-radius: 11px 11px 11px 2px; background: var(--mk); border: 0; }
.mark-no { position: absolute; top: -9px; left: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--mk); color: #fff; font-size: 0.66rem; font-weight: 600; line-height: 16px; text-align: center; }
.mark.mk-zvyraznit .mark-no { color: #3a2e00; }
.mark.is-pin .mark-no { position: static; display: block; background: none; line-height: 22px; }
.mark-pop { position: absolute; z-index: 5; width: min(280px, 90%); margin-top: 6px; padding: 10px; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.15); cursor: default; }
.mark-pop textarea { width: 100%; font: inherit; font-size: 0.9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); resize: vertical; }
.mark-pop-actions { display: flex; gap: 6px; }
.layout-side { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.layout-side h5 { margin: 0 0 8px; }
.mark-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.mark-item { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.mark-item.is-on { border-color: var(--accent); background: var(--accent-soft); }
.mark-item-head { display: flex; gap: 6px; align-items: center; }
.mark-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--mk); color: #fff; font-size: 0.66rem; font-weight: 600; }
.mark-dot.mk-zvyraznit { color: #3a2e00; }
.mark-text { margin: 6px 0 0; font-size: 0.9rem; white-space: pre-wrap; }
.mark-tools { display: flex; gap: 10px; margin-top: 4px; }
.mark-tools .link-like { background: none; border: 0; padding: 0; font: inherit; }
.page-note .field { margin-bottom: 8px; }
.page-note-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 6px; }
.next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.print-done { background: var(--ok-soft); }

/* Rozesílka výtisků */
.ship-list { display: grid; gap: 8px; }
.ship { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
.ship.is-complete { background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.ship > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 0; cursor: pointer; }
.ship[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ship-title { font-weight: 600; }
.ship-ok { color: var(--good); font-weight: 600; }
.ship-others { border-style: dashed; }
.ship-table { margin-bottom: 8px; }
.ship-add { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(140px, 1.5fr) 80px minmax(100px, 1fr) 64px minmax(100px, 1fr) auto; gap: 6px; margin: 4px 0 8px; }
.ship-add input { min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.9rem; }
.ship-foot { display: flex; gap: 16px; align-items: center; padding: 6px 0 12px; }
@media (max-width: 900px) { .ship-add { grid-template-columns: 1fr 1fr; } }

/* Nápady: zápisník a karty */
.ideas-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
.pad { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 18px; min-height: 560px; }
.pad-tabs { display: flex; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pad-tabs > a { padding: 6px 0 9px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pad-tabs > a[aria-current="page"] { color: var(--ink); border-color: var(--accent); font-weight: 500; }
.pad-tabs .push { margin-left: auto; }
.pad-new { display: flex; gap: 6px; align-items: center; padding-bottom: 6px; }
.new-topic input { width: 160px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.86rem; }
.meetings { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.meeting-chip { padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.meeting-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.nb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.nb-head h3 { margin: 0; font-size: 1.2rem; }
.nb-head .push { margin-left: auto; }
.nb-actions { display: flex; gap: 6px; }
.nb-doc { display: grid; gap: 1px; }
.nb-h { margin: 12px 0 4px; font-weight: 600; }
.nb-p { margin: 4px 0; }
.nb-line { display: flex; gap: 10px; align-items: baseline; padding: 3px 8px; margin: 0 -8px; border-radius: 6px; }
.nb-line:hover, .nb-line:focus-within { background: var(--field); }
.nb-t { flex: 1; }
.nb-h-actions { display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity 0.12s; }
.nb-line:hover .nb-h-actions, .nb-line:focus-within .nb-h-actions, .nb-h-actions:has(.chip) { opacity: 1; }
.nb-line.is-conv .nb-t { color: var(--muted); }
.nb-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 0 0 0 8px; color: var(--muted); }
.nb-add input { flex: 1; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; }
.nb-add input:focus { border-style: solid; outline: none; border-color: var(--accent); background: var(--field); }
.nb-edit { display: grid; gap: 8px; }
.nb-edit .nb-title, .topic-title { font: inherit; font-size: 1.1rem; font-weight: 600; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); }
.nb-edit textarea, .topic-form textarea { width: 100%; font: inherit; line-height: 1.6; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); resize: vertical; }
.topics { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.topic-list { display: grid; gap: 6px; align-content: start; }
.topic-item { display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.topic-item b { font-weight: 500; font-size: 0.92rem; line-height: 1.3; }
.topic-item.is-on { border-color: var(--accent); background: var(--accent-soft); }
.topic-item.is-conv { opacity: 0.65; }
.topic-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.76rem; color: var(--muted); }
.chip-ok { border-color: transparent; background: var(--ok-soft); color: var(--good); text-decoration: none; }
.topic-rozpracovany { border-color: transparent; background: color-mix(in srgb, var(--st-napad) 22%, var(--surface)); color: var(--ink); }
.topic-pripraveny { border-color: transparent; background: var(--ok-soft); color: var(--good); }
.topic-detail { border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; }
.topic-form { display: grid; gap: 8px; margin-top: 6px; }
.topic-state { display: flex; gap: 8px; align-items: center; }
.topic-state select { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.86rem; }
.sec-h { margin: 14px 0 6px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.sec-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.topic-links { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.topic-links li { display: flex; gap: 8px; align-items: baseline; }
.link-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 6px; }
.link-add input { min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.88rem; }
.topic-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.86rem; }
.topic-history li { display: flex; gap: 8px; align-items: center; }
.topic-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.topic-actions .push { margin-left: auto; display: flex; gap: 6px; }
.btn-danger-text { color: var(--danger); }
.archive { display: grid; gap: 6px; }
.archive-item { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.archive-item summary { display: flex; gap: 8px; align-items: center; padding: 8px 0; cursor: pointer; }
.archive-item summary .push { margin-left: auto; }
.archive-actions { display: flex; gap: 4px; }
.archive-body { white-space: pre-wrap; font: inherit; font-size: 0.9rem; margin: 0 0 10px; color: var(--muted); }
.idea-cards { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.idea-cards .part { margin-top: 14px; }
.idea-cards .tile-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cards-label { margin: 0 0 6px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dropbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.drop { border: 1.5px dashed var(--line); border-radius: 8px; padding: 6px 8px; text-align: center; font-size: 0.78rem; color: var(--muted); background: var(--surface); overflow: hidden; }
.drop b { display: block; color: var(--ink); font-size: 0.86rem; }
.drop span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-dragging-card .drop { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.drop.is-drop { border-color: var(--accent); border-style: solid; background: var(--accent-soft); color: var(--ink); }
.idea-card { display: grid; gap: 4px; }
.idea-card .tile { height: 100%; }
.idea-card.is-fresh .tile { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent); }
.assign select { width: 100%; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); font: inherit; font-size: 0.82rem; }
.carry { display: grid; gap: 3px; padding: 10px 12px; border-radius: 8px; background: var(--ok-soft); margin-bottom: 12px; }
@media (max-width: 1100px) { .ideas-layout { grid-template-columns: 1fr; } .idea-cards { position: static; max-height: none; } }
@media (max-width: 760px) { .topics { grid-template-columns: 1fr; } .topic-detail { border-left: 0; padding-left: 0; } .link-add { grid-template-columns: 1fr; } }

/* E-maily */
.recipients { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; padding: 4px 0; }
.recipients-more summary { cursor: pointer; color: var(--muted); margin-top: 6px; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mail-list li:last-child { border-bottom: 0; }
.mail-status { font-size: 0.78rem; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); white-space: nowrap; }
.mail-test { background: color-mix(in srgb, var(--st-napad) 18%, var(--surface)); }
.mail-chyba { background: var(--danger-soft); color: var(--danger); }
.mail-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 12px; }
.mail-meta dt { color: var(--muted); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { white-space: pre-wrap; font: inherit; background: var(--field); border-radius: 8px; padding: 14px 16px; margin: 0; }
.mail-template { margin-bottom: var(--gap); }
.mail-template h3 { margin: 0 0 12px; }
.field-hint { margin: -8px 0 12px; }
.prod-item.is-on { background: color-mix(in srgb, var(--rc) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, var(--line)); }
.prod-item-title { font-weight: 500; line-height: 1.3; }
.prod-item-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.prod-item-flags { display: flex; gap: 10px; flex-wrap: wrap; }
.prod-item-flags .ok { color: var(--good); }
.prod-item-flags .warn { color: var(--hot); }
.chip-agent { border-color: transparent; background: var(--agent-soft); color: var(--agent); }
.steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.steps i { height: 4px; border-radius: 2px; background: var(--line); }
.steps i.done { background: var(--accent); opacity: 0.55; }
.steps i.now { background: var(--accent); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

.prod-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; min-width: 0; }
.prod-title { font-size: 1.35rem; margin: 4px 0 8px; letter-spacing: -0.015em; }
.prod-head-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-form select { font: inherit; font-size: 0.82rem; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--muted); }
.dtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 14px 0 14px; overflow-x: auto; overflow-y: hidden; }
.dtabs a { padding: 0 0 8px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.prod-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.prod-bar .push, .ship > summary .push, .panel-head .push, .prod-toolbar .push, .mark-item-head .push { margin-left: auto; }
.upload-inline { margin: 0; }
.doc {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.04rem;
  line-height: 1.7;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  max-width: 76ch;
  overflow-wrap: anywhere;
}
.doc h2, .doc h3, .doc h4 { font-family: var(--font-ui); margin: 1em 0 0.3em; }
.doc p { margin: 0 0 0.8em; }
.doc blockquote { margin: 0.6em 0; padding-left: 14px; border-left: 2px solid var(--line); color: var(--muted); }
.doc ins { background: #d9f2df; color: #1d5e33; text-decoration: none; border-radius: 2px; }
.doc del { background: #f8dcd8; color: #8f2a1f; border-radius: 2px; }
:root[data-theme="dark"] .doc ins { background: #1f3a28; color: #9fe0b2; }
:root[data-theme="dark"] .doc del { background: #3e2320; color: #f2a497; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .doc ins { background: #1f3a28; color: #9fe0b2; }
  :root:not([data-theme="light"]) .doc del { background: #3e2320; color: #f2a497; }
}
.diff-toggle { margin-bottom: 12px; }
.diff-toggle summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.proposal { border: 1px solid color-mix(in srgb, var(--agent) 35%, var(--line)); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: color-mix(in srgb, var(--agent) 5%, var(--surface)); }
.proposal-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.proposal-actions { margin-left: auto; display: flex; gap: 6px; }
.next-step { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 10px 14px; margin: 14px 0; border-radius: 10px; background: var(--accent-soft); }
.prod-sub { margin: 20px 0 6px; font-size: 0.9rem; }
.versions, .files { list-style: none; margin: 0; padding: 0; }
.versions li, .files li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; flex-wrap: wrap; }
.versions .push { margin-left: auto; }
.version-odmitnuto { opacity: 0.55; }
.upload-box { border: 1px dashed var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 10px; justify-items: start; }
.upload-box form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert-warn { background: color-mix(in srgb, var(--st-napad) 18%, var(--surface)); color: var(--ink); }

.editor { display: grid; gap: 10px; }
.editor-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; position: sticky; top: 64px; z-index: 2; background: var(--surface); padding: 6px 0; }
.editor-hint { margin-left: auto; }
.editor-area { min-height: 420px; max-width: none; outline: none; background: var(--surface); }
.editor-area:focus { border-color: var(--accent); }
.editor-note { flex: 1 1 260px; font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--field); display: flex; flex-direction: column; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--side); }
.photo figcaption { padding: 8px; }
.caption-form { display: grid; gap: 6px; }
.caption-form textarea { font: inherit; font-size: 0.88rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; }
.caption-form textarea:placeholder-shown { border-color: color-mix(in srgb, var(--st-napad) 60%, var(--line)); }
.photo-meta { overflow-wrap: anywhere; }
.photo-actions { display: flex; gap: 6px; }
.ads-wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.check-inline input { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- Nahrávání přetažením --- */

[data-dropzone] { position: relative; }
.prod-list[data-dropzone] { position: sticky; } /* seznam zůstává přilepený */
[data-dropzone].is-dragover::after {
  content: attr(data-drop-label);
  position: absolute;
  inset: -6px;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent);
  color: var(--accent);
  font-weight: 600;
  pointer-events: none;
}
[data-dropzone].is-uploading { opacity: 0.6; pointer-events: none; }
.drop-hint { color: var(--muted); font-size: 0.86rem; }

/* Krátké potvrzení dole na obrazovce */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Modální okno a materiál --- */

.modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 48px rgb(0 0 0 / 18%);
}

.modal-narrow { width: min(560px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(20 24 20 / 40%); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 { margin: 0 0 16px; padding-right: 36px; }

.material-head { margin-bottom: 16px; padding-right: 36px; }
.material-title { font-size: 1.4rem; margin: 4px 0 0; letter-spacing: -0.015em; }
.material-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; }
.material-side section { margin-bottom: 22px; }
.people-list, .link-list { list-style: none; margin: 0 0 10px; padding: 0; }
.people-list li, .link-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.people-list form { margin: 0 0 0 auto; }
.add-person { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.add-person input { grid-column: 1 / -1; }
.add-person .btn { justify-self: start; }

.notes { display: flex; flex-direction: column; gap: 14px; }
.note { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; }
.note:has(.badge-agent) { border-left-color: var(--agent); }
.note-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; color: var(--muted); }
.note-meta strong { color: var(--ink); font-weight: 500; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-tools { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.note-tools details { flex: 1 1 100%; }
.note-tools summary { cursor: pointer; color: var(--muted); width: fit-content; }
.note-tools form { margin-top: 6px; }
.revisions { margin: 6px 0 0; padding-left: 18px; }
.revisions li { margin-bottom: 8px; }
.note-new { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.two-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.two-cols section + section { margin-top: 28px; }

/* --- Mobil --- */

@media (max-width: 760px) {
  .layout-body { grid-template-columns: 1fr; }
  .layout-side { position: static; max-height: none; }
  .topbar .menu-btn { display: inline-grid; }
  .user-name { display: none; }
  .topbar { padding: 8px 12px; }
  .content { padding: 18px 16px; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.15s ease-out;
    width: 240px;
  }

  .sidebar-open .sidebar { transform: none; box-shadow: 0 0 24px rgb(0 0 0 / 25%); }

  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgb(0 0 0 / 30%);
  }

  .material-cols, .two-cols { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px; max-height: calc(100vh - 16px); width: calc(100vw - 16px); }
  .issue-head .btn { width: 100%; }
  .tile-grid { grid-template-columns: 1fr; }
  .input-narrow { max-width: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash, .lane { grid-template-columns: 1fr; }
  .rubric-row { grid-template-columns: 96px minmax(0, 1fr) 64px; }
  /* Na mobilu je cesta čísla svislý seznam milníků. */
  .timeline { height: auto; margin: 0; display: grid; gap: 8px; }
  .timeline-axis, .timeline-done, .timeline-now { display: none; }
  .milestone { position: static; width: auto; margin: 0; flex-direction: row; gap: 10px; text-align: left; font-size: 0.86rem; left: auto !important; }
  .milestone i { margin: 0; flex-shrink: 0; }
  .milestone .ms-date { min-width: 84px; }
  .ribbon { grid-template-columns: repeat(18, minmax(0, 1fr)); row-gap: 6px; }
  .ribbon-nums { display: none; }
  .milestone-fields { grid-template-columns: 1fr; }
  .plan-layout { grid-template-columns: 1fr; }
  .prod-split { grid-template-columns: 1fr; }
  .prod-list { position: static; max-height: 340px; }
  .prod-detail { padding: 14px; }
  .doc { padding: 12px 14px; }
  .row-actions { text-align: left; white-space: normal; }
  .plan-side { position: static; max-height: none; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Tabulka jako karty */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 3px 0; }
  .table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.drop-area { min-height: 160px; }
