/* abcPlan — quiet UI, zinc + indigo */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --accent-hover: #4338ca;

  --c-evergreen: #6366f1;
  --c-trendy: #f97316;
  --c-vlastni: #a855f7;
  --c-sezonni: #10b981;
  --c-recyklace: #06b6d4;
  --c-kviz: #ec4899;
  --c-published: #16a34a;
  --c-empty: #e4e4e7;

  --tint-red: #fef2f2;
  --tint-green: #f0fdf4;
  --tint-amber: #fffbeb;
  --tint-blue: #eff6ff;

  --col-good: #16a34a;
  --col-bad: #dc2626;
  --col-warn: #d97706;
  --col-good-text: #166534;
  --col-bad-text: #991b1b;
  --col-warn-text: #92400e;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-lg: 0 1px 2px rgba(0,0,0,0.04), 0 8px 16px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.10);
  --shadow-modal: 0 0 0 1px rgba(0,0,0,0.05), 0 4px 8px rgba(0,0,0,0.04), 0 16px 32px rgba(0,0,0,0.12), 0 40px 72px rgba(0,0,0,0.16);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #27272a;
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --text-3: #a1a1aa;
  --text-4: #71717a;
  --accent: #818cf8;
  --accent-light: rgba(99, 102, 241, 0.18);
  --accent-hover: #a5b4fc;

  --c-empty: #3f3f46;

  --tint-red: rgba(220, 38, 38, 0.12);
  --tint-green: rgba(22, 163, 74, 0.10);
  --tint-amber: rgba(245, 158, 11, 0.10);
  --tint-blue: rgba(59, 130, 246, 0.12);

  --col-good: #4ade80;
  --col-bad: #f87171;
  --col-warn: #fbbf24;
  --col-good-text: #4ade80;
  --col-bad-text: #f87171;
  --col-warn-text: #fbbf24;

  --shadow: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-lg: 0 1px 3px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.4), 0 24px 48px rgba(0,0,0,0.5);
  --shadow-modal: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 8px rgba(0,0,0,0.4), 0 16px 32px rgba(0,0,0,0.5), 0 40px 80px rgba(0,0,0,0.6);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px; letter-spacing: -0.5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 6px rgba(79, 70, 229, 0.3);
}
.brand-name {
  font-weight: 400; font-size: 15px; color: var(--text-2);
  letter-spacing: -0.3px;
}
.brand-name strong { font-weight: 700; color: var(--text); }
.brand-version {
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--text-4); background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px; margin-left: auto;
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-4); text-transform: uppercase;
  padding: 14px 10px 6px;
}
.nav-group-label:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--text-2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.15s var(--ease-spring);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-light); color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}
.nav-item .material-symbols-outlined { font-size: 18px; }

.sidebar-foot {
  margin-top: auto; padding: 10px 4px 4px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.link-btn { background: none; border: none; color: var(--text-3); font-size: 12px; padding: 0; font-family: inherit; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ===== Main ===== */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.topbar #page-subtitle { font-size: 12px; margin-top: 2px; }
.topbar-end { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.theme-toggle {
  width: 32px; height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--text-2); cursor: pointer;
  transition: all 0.15s var(--ease-spring);
  will-change: transform;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); transform: translateY(-0.5px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .material-symbols-outlined { font-size: 18px; }

#view-root { padding: 20px 24px; }

/* ===== Common ===== */
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.row { display: flex; gap: 8px; align-items: center; }

.btn {
  height: 32px; padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  transition: all 0.15s var(--ease-spring);
  will-change: transform;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-4); transform: translateY(-0.5px); }
.btn:active { transform: translateY(0); }
.btn .material-symbols-outlined { font-size: 16px; }
.btn-primary {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(0,0,0,0.06);
}
.btn-primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 14px rgba(79, 70, 229, 0.28);
}
.btn-danger {
  background: #dc2626; color: white; border-color: #dc2626;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(0,0,0,0.06);
}
.btn-danger:hover {
  background: #b91c1c; border-color: #b91c1c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 14px rgba(220, 38, 38, 0.28);
}
.day-actions { display: flex; gap: 8px; }
.btn-count { opacity: 0.85; font-weight: 600; margin-left: 2px; font-variant-numeric: tabular-nums; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }

.seg {
  display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; border: 1px solid var(--border);
}
.seg button {
  height: 26px; padding: 0 14px; border: none; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; border-radius: 7px;
  transition: all 0.2s var(--ease-spring);
  font-family: inherit;
}
.seg button:hover:not(.active) { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px var(--border); }

input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  height: 34px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); font-family: inherit; font-size: 13px; color: var(--text); width: 100%;
  transition: border-color 0.15s var(--ease-soft), box-shadow 0.15s var(--ease-soft);
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 72px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-light); }
input::placeholder, textarea::placeholder { color: var(--text-4); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card-h { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px; }

/* ===== Filters ===== */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { width: auto; min-width: 140px; }

/* ===== Table ===== */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.tbl th { background: var(--surface-2); color: var(--text-3); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; padding-top: 11px; padding-bottom: 11px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }

/* ===== Status pills ===== */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: 0.1px; }
.pill-good { background: #dcfce7; color: #166534; }
.pill-bad { background: #fee2e2; color: #991b1b; }
.pill-info { background: #dbeafe; color: #1e40af; }
.pill-progress { background: #fef3c7; color: #92400e; }
.pill-proposed { background: #f4f4f5; color: #52525b; }

/* ===== 3-channel status chips ===== */
.ch-row { display: inline-flex; gap: 2px; flex-shrink: 0; }
.ch { width: 16px; height: 16px; border-radius: 5px; font-size: 9px; font-weight: 700; display: inline-grid; place-items: center; color: white; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18); }
.ch-done { background: #16a34a; }
.ch-wait { background: #e4e4e7; color: #71717a; }
.ch-error { background: #dc2626; }

.ch-detail { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.ch-detail-row { display: flex; align-items: center; gap: 10px; }
.ch-detail-name { font-weight: 500; flex: 1; }
.ch-detail-state { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.ch-state-done { background: #dcfce7; color: #166534; }
.ch-state-wait { background: #e4e4e7; color: #52525b; }
.ch-state-error { background: #fee2e2; color: #991b1b; }

/* ===== Tier badges ===== */
.tier-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.3px; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; margin-left: 4px; vertical-align: middle; }
.tier-must { background: #fee2e2; color: #991b1b; }
.tier-nice { background: #dbeafe; color: #1e40af; }

/* ===== Web chip + favicon ===== */
.webchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.webchip-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--text-4); flex-shrink: 0; }
.web-fav {
  display: inline-grid; place-items: center;
  border-radius: 6px; color: white;
  flex-shrink: 0; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.12);
}
.web-fav .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 500; }
.web-fav-img {
  flex-shrink: 0; border-radius: 6px; display: inline-block;
  object-fit: contain; background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ===== Web filter (popover) ===== */
.web-filter-wrap { position: relative; display: inline-flex; }
.week-nav .web-filter-wrap { margin-right: 8px; padding-right: 8px; border-right: 1px solid var(--border); }

.wf-button {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer;
  transition: all 0.15s var(--ease-spring);
}
.wf-button:hover { background: var(--surface-2); border-color: var(--text-4); transform: translateY(-0.5px); }
.wf-button:active { transform: translateY(0); }
.wf-button.wf-button-filtered { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.wf-icon { font-size: 16px; color: inherit; opacity: 0.7; }
.wf-button-label { font-weight: 600; }
.wf-dots { display: inline-flex; gap: 2px; padding-left: 6px; border-left: 1px solid var(--border); height: 18px; align-items: center; }
.wf-tiny-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.wf-button-counter { padding-left: 6px; border-left: 1px solid var(--border); color: var(--text-3); font-size: 12px; font-weight: 500; min-width: 90px; }
.wf-button.wf-button-filtered .wf-button-counter { color: var(--accent); font-weight: 600; }
.wf-chevron { font-size: 18px; color: var(--text-4); transition: transform 0.15s; }
.wf-chevron.open { transform: rotate(180deg); }

.wf-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 320px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popoverIn 0.16s var(--ease-spring);
  transform-origin: top left;
}
@keyframes popoverIn {
  0%   { opacity: 0; transform: translateY(-4px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.wf-popover-head {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.wf-popover-title { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
.wf-quick { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.wf-quick .link-btn { font-weight: 500; }
.wf-quick .link-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.wf-list { max-height: 360px; overflow-y: auto; padding: 4px 0; }
.wf-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  font-size: 13px; cursor: pointer; user-select: none;
  border-left: 2px solid transparent;
}
.wf-item:hover { background: var(--surface-2); }
.wf-item.on { border-left-color: var(--accent); }
.wf-item.on .wf-name { color: var(--text); font-weight: 500; }
.wf-item .wf-name { color: var(--text-3); flex: 1; }
.wf-check {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong);
  display: inline-grid; place-items: center; background: var(--surface);
  flex-shrink: 0;
}
.wf-check .material-symbols-outlined { font-size: 12px; font-weight: 800; color: white; opacity: 0; }
.wf-check.on { background: var(--accent); border-color: var(--accent); }
.wf-check.on .material-symbols-outlined { opacity: 1; }
.wf-item .webchip-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }

/* ===== Week view ===== */
.week-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-title { font-weight: 600; font-size: 14px; padding: 0 12px; min-width: 220px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text-3); }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; }

.week-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-grid .gh, .week-grid .gc, .week-grid .gw {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  min-height: 64px;
}
.week-grid .gh { background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; padding: 8px 10px; min-height: auto; display: flex; flex-direction: column; gap: 2px; }
.week-grid .gh.today { color: var(--accent); }
.week-grid .gh-day { font-size: 10px; }
.week-grid .gh-date { font-size: 13px; }
.week-grid .gw { background: var(--surface-2); display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }
.week-grid > *:nth-child(8n) { border-right: none; }
.week-grid > *:last-child, .week-grid > *:nth-last-child(-n+8) { /* keep bottom borders for simplicity */ }

.cell {
  cursor: pointer;
  background: var(--surface);
  transition: filter 0.15s var(--ease-soft), box-shadow 0.18s var(--ease-soft);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  padding: 8px 10px;
  min-height: 78px;
}
.cell:hover { filter: brightness(0.985); }
[data-theme="dark"] .cell:hover { filter: brightness(1.1); }
.cell-neutral { background: var(--surface); }
.cell-red { background: var(--tint-red); box-shadow: inset 3px 0 0 #dc2626; }
.cell-green { background: var(--tint-green); box-shadow: inset 3px 0 0 #16a34a; }
.cell-blue { background: var(--tint-blue); box-shadow: inset 3px 0 0 #3b82f6; }
.cell.today { box-shadow: inset 0 3px 0 #f59e0b; }
.cell-red.today { box-shadow: inset 3px 0 0 #dc2626, inset 0 3px 0 #f59e0b; }
.cell-green.today { box-shadow: inset 3px 0 0 #16a34a, inset 0 3px 0 #f59e0b; }
.cell-blue.today { box-shadow: inset 3px 0 0 #3b82f6, inset 0 3px 0 #f59e0b; }
.cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; box-shadow: 0 0 0 4px var(--accent-light), 0 4px 16px rgba(79, 70, 229, 0.12); border-radius: 2px; }

.cell-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 22px; }
.cell-count-big { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.3px; }
.cell-count-big .cb-tot { color: var(--text-4); font-weight: 500; font-size: 12px; }
.cell-count-big.cb-bad { color: #991b1b; }
.cell-count-big.cb-bad .cb-tot { color: #b91c1c; opacity: 0.55; }
.cell-count-big.cb-ok { color: #166534; }
.cell-count-big.cb-ok .cb-tot { color: #16a34a; opacity: 0.6; }
.cell-count-big.cb-info { color: #1e40af; }
.cell-count-big.cb-info .cb-tot { color: #3b82f6; opacity: 0.6; }

.cell-status-ic { width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.cell-status-ic .material-symbols-outlined { font-size: 13px; font-variation-settings: 'wght' 700; }
.cell-ic-bad { background: #dc2626; color: white; }
.cell-ic-ok { background: #16a34a; color: white; }
.cell-ic-info { background: #3b82f6; color: white; }

.cell-bar {
  position: relative; height: 6px; border-radius: 999px;
  background: var(--c-empty); overflow: visible; display: flex;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
}
.bar-seg { height: 100%; transition: width 0.4s var(--ease-soft); }
.bar-seg:first-child { border-radius: 999px 0 0 999px; }
.bar-seg:last-child { border-radius: 0 999px 999px 0; }
.bar-seg:first-child:last-child { border-radius: 999px; }
.bs-done { background: linear-gradient(180deg, #22c55e, #16a34a); }
.bs-prog { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.bs-err { background: linear-gradient(180deg, #ef4444, #dc2626); }
.bar-tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--text-2); border-radius: 1px; opacity: 0.6;
  pointer-events: none;
}

.cell-meta { display: flex; gap: 8px; font-size: 11px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cm-item { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; line-height: 1; }
.cm-item .material-symbols-outlined { font-size: 13px; font-variation-settings: 'FILL' 1; }
.cm-done { color: #16a34a; }
.cm-prog { color: #d97706; }
.cm-err  { color: #dc2626; }
.cm-empty { color: var(--text-3); font-weight: 500; padding-left: 2px; }

/* legend cell swatch for red/green/neutral */
.legend-cell { display: inline-block; width: 16px; height: 12px; border-radius: 2px; border: 1px solid var(--border); background: var(--surface); vertical-align: middle; margin-right: 2px; }
.legend-red { background: var(--tint-red); box-shadow: inset 3px 0 0 #dc2626; border-color: #fecaca; }
.legend-green { background: var(--tint-green); box-shadow: inset 3px 0 0 #16a34a; border-color: #bbf7d0; }
.legend-divider { width: 1px; height: 14px; background: var(--border); margin: 0 4px; }

/* ===== Day detail (under week grid) ===== */
.day-detail { margin-top: 20px; box-shadow: var(--shadow-sm); border-radius: var(--radius-lg); }
.day-detail-h {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.day-detail-h.status-red { background: var(--tint-red); border-color: #fecaca; box-shadow: inset 4px 0 0 #dc2626; }
.day-detail-h.status-green { background: var(--tint-green); border-color: #bbf7d0; box-shadow: inset 4px 0 0 #16a34a; }
.day-detail-h.status-blue { background: var(--tint-blue); border-color: #bfdbfe; box-shadow: inset 4px 0 0 #3b82f6; }
.day-detail-h .day-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-big-date { font-size: 22px; font-weight: 700; letter-spacing: -0.6px; }
.day-meta { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }

.sections-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.section-box { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px; min-height: 140px; position: relative; }
.section-box.section-bad { background: var(--tint-red); }
.section-box.section-bad::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #dc2626; }
.section-box.section-good { background: var(--tint-green); }
.section-box.section-good::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #16a34a; }
.section-box.section-info { background: var(--tint-blue); }
.section-box.section-info::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3b82f6; }
.sections-grid > .section-box:nth-child(4n) { border-right: none; }
.sections-grid > .section-box:nth-last-child(-n+3) { border-bottom: none; }
.sections-grid > .section-box:last-child { border-right: none; }
.sections-grid > .section-box:nth-child(3n) { border-right: none; }
.sections-grid > .section-box:nth-last-child(-n+3) { border-bottom: none; }

.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 1px 2px rgba(0,0,0,0.12); }
.section-icon .material-symbols-outlined { font-size: 15px; font-variation-settings: 'FILL' 1; }
.section-title { font-size: 13px; font-weight: 600; }
.section-sub { font-size: 11px; color: var(--text-3); }
.section-count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.slot-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12px; }
.slot-row:first-of-type { border-top: none; }
.slot-num { color: var(--text-4); font-variant-numeric: tabular-nums; font-size: 11px; width: 18px; }
.slot-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-add { color: var(--accent); cursor: pointer; display: flex; align-items: center; gap: 4px; font-weight: 500; }
.slot-add:hover { text-decoration: underline; }
.slot-row.empty { color: var(--text-3); }
.slot-row.empty-must .slot-add { color: #dc2626; }
.slot-row.done .slot-title { color: var(--text-3); }
.slot-row.err .slot-title { color: #991b1b; }
.slot-row .slot-title { display: inline-block; cursor: pointer; }
.slot-row[data-id] { cursor: pointer; }
.slot-row[data-id]:hover .slot-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* List view — underline article topic on row hover */
.tbl tbody tr[data-id]:hover td:nth-child(4) { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* web pick has red indicator */
.web-pick .red-dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: #dc2626; margin-left: 6px; vertical-align: middle; }

/* Web pick row for day detail */
.web-pickrow { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 18px; background: var(--surface); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.web-pick { padding: 4px 10px; border-radius: var(--radius); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text-2); border: 1px solid transparent; }
.web-pick:hover { background: var(--surface-2); }
.web-pick.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent-light); }

/* ===== Seasonal recommendations card ===== */
.season-card { margin-bottom: 16px; }
.season-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.season-row:first-of-type { border-top: none; padding-top: 4px; }
.season-icon { width: 28px; height: 28px; border-radius: var(--radius); background: var(--c-sezonni); color: white; display: grid; place-items: center; }
.season-icon .material-symbols-outlined { font-size: 16px; }
.season-body { flex: 1; min-width: 0; }
.season-topic { font-weight: 500; font-size: 13px; }
.season-meta { font-size: 11px; color: var(--text-3); }
.progress { width: 120px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--c-sezonni); }
.progress-label { font-size: 11px; color: var(--text-3); width: 38px; text-align: right; }

/* ===== Month view ===== */
.month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.month-grid .mh { background: var(--surface-2); padding: 8px 10px; font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.month-grid .mh:nth-child(7) { border-right: none; }
.mday {
  min-height: 90px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: var(--surface);
}
.mday:hover { background: #fbfbfb; }
.mday.other { background: #fafafa; color: var(--text-4); }
.mday.today { box-shadow: inset 0 3px 0 #f59e0b; }
.mday-red { background: var(--tint-red); box-shadow: inset 3px 0 0 #dc2626; }
.mday-green { background: var(--tint-green); box-shadow: inset 3px 0 0 #16a34a; }
.mday-blue { background: var(--tint-blue); box-shadow: inset 3px 0 0 #3b82f6; }
.mday-red.today { box-shadow: inset 3px 0 0 #dc2626, inset 0 3px 0 #f59e0b; }
.mday-blue.today { box-shadow: inset 3px 0 0 #3b82f6, inset 0 3px 0 #f59e0b; }
.mday.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.mday-h { display: flex; justify-content: space-between; align-items: center; }
.mday-num { font-size: 13px; font-weight: 500; }
.mday-cnt { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mday-slots { display: flex; flex-wrap: wrap; gap: 2px; }
.mday-slots .slot { width: 7px; height: 7px; }
.mday-rules { display: flex; gap: 3px; margin-top: auto; }
.mday-rules .ric { width: 16px; height: 16px; border-radius: 3px; background: var(--c-sezonni); color: white; display: grid; place-items: center; }
.mday-rules .ric .material-symbols-outlined { font-size: 12px; }
.month-grid .mday:nth-child(7n+1):nth-of-type(n) { /* last col gets no right border via :nth-of-type — simpler: */ }
.month-grid > .mday:nth-child(7n+7) { border-right: none; }
.month-grid > .mh:nth-last-child(-n+7) + * { } /* noop */

/* ===== Year view ===== */
.timeline-card { padding: 16px 20px 8px; margin-bottom: 16px; }
.timeline-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.timeline-stats { display: flex; gap: 16px; }
.ts-item { text-align: right; }
.ts-num { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ts-lbl { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }

.timeline-svg { width: 100%; height: auto; display: block; overflow: visible; aspect-ratio: 1200 / 180; }
.tl-val { font-size: 13px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; font-family: 'Inter', sans-serif; }
.tl-val-weak { fill: #dc2626; }
.tl-val-now { fill: #16a34a; }
.tl-bang { font-size: 13px; font-weight: 800; fill: white; font-family: 'Inter', sans-serif; }
.tl-lbl { font-size: 12px; fill: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; font-family: 'Inter', sans-serif; }
.tl-lbl-now { fill: #16a34a; font-weight: 700; }
.tl-axis { font-size: 11px; fill: var(--text-4); font-weight: 500; font-family: 'Inter', sans-serif; }

/* pulse animation for current month marker */
.tl-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: tlPulse 2.2s ease-out infinite;
}
@keyframes tlPulse {
  0%   { transform: scale(0.6); opacity: 0.55; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.year-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  align-items: start;
}
.year-month {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all 0.18s var(--ease-soft);
  box-shadow: var(--shadow-sm);
}
.year-month:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.year-month.now { border-color: #16a34a; box-shadow: 0 0 0 1px #16a34a; background: linear-gradient(180deg, #f0fdf4 0%, var(--surface) 55%); }
.year-month.now .year-now-tag { color: #16a34a; border-color: #16a34a; }
.year-month.now .year-month-title:hover .year-month-name { color: #16a34a; }

.year-month-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.year-month-title {
  display: flex; align-items: baseline; gap: 6px;
  background: none; border: none; padding: 4px 0; margin: 0; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
}
.year-month-title:hover .year-month-name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.year-month-name { font-weight: 600; font-size: 14px; color: var(--text); }
.year-month-year { font-size: 11px; color: var(--text-3); }
.year-month-actions { display: flex; align-items: center; gap: 4px; }
.year-now-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent); background: white; padding: 2px 5px; border-radius: 3px; text-transform: uppercase; border: 1px solid var(--accent); margin-left: 4px; }
.year-count-pill { font-size: 11px; font-weight: 600; padding: 2px 7px; background: var(--surface-2); border-radius: 999px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.year-add { width: 24px; height: 24px; border-radius: 4px; color: var(--text-3); }
.year-add:hover { background: var(--accent); color: white; }
.year-add .material-symbols-outlined { font-size: 16px; }

.yr-rules { display: flex; flex-direction: column; }
.yr-row {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center;
  padding: 5px 4px; margin: 0 -4px; border-radius: 4px;
  font-size: 12px; cursor: pointer;
}
.yr-row:hover { background: var(--surface-2); }
.yr-topic { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.yr-est { font-size: 11px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }

.year-empty {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px 4px; color: var(--text-3); font-size: 12px; font-weight: 500;
  background: none; border: 1px dashed var(--border-strong); border-radius: 6px;
  font-family: inherit; cursor: pointer;
  transition: all 0.1s;
}
.year-empty.year-empty-cta:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.year-empty .material-symbols-outlined { font-size: 16px; }

.yr-multi { font-size: 10px; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }

/* Month multi-picker in rule modal */
.month-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mp-chip {
  height: 32px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius); font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--text-2); cursor: pointer; text-transform: capitalize;
  transition: all 0.1s;
}
.mp-chip:hover { background: var(--surface-2); }
.mp-chip.on { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }

/* ===== Modal ===== */
.modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 1000; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(24,24,27,0.32);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  pointer-events: auto; display: grid; place-items: center; z-index: 100;
  animation: modalBackdropIn 0.18s ease-out;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 520px; max-width: 92vw; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  animation: modalIn 0.22s var(--ease-spring);
}
.modal::before {
  content: ''; position: absolute; left: 12px; right: 12px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
[data-theme="dark"] .modal::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.55); }

@keyframes modalIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalBackdropIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { background: none; border: none; padding: 4px; cursor: pointer; color: var(--text-3); border-radius: 7px; display: grid; place-items: center; transition: all 0.15s var(--ease-spring); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Modal banner */
.modal-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 12px; font-weight: 500; line-height: 1.4;
}
.banner-bad { background: var(--tint-red); color: var(--col-bad-text); border: 1px solid rgba(220,38,38,0.25); }
.banner-bad .material-symbols-outlined { font-size: 16px; }

/* Locked field (web display, read-only) */
.locked-field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-2);
}
.locked-content { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; color: var(--text); }
.lock-ic { color: var(--text-4); font-size: 16px; }

/* Tag for AI tool context labels */
.ctx-tag {
  display: inline-block; padding: 1px 6px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 3px; font-size: 11px; font-weight: 600; vertical-align: middle; margin-left: 4px;
}

/* Channel state toggle inside article modal */
.ch-toggle button { padding: 0 8px; height: 22px; font-size: 11px; }
.ch-detail-row .seg { margin-left: auto; }

/* Time field: ASAP checkbox + time input */
.time-group {
  display: flex; gap: 0; align-items: stretch;
  border: 1.5px solid var(--accent); border-radius: 12px;
  overflow: hidden; background: var(--surface);
}
.time-group:focus-within { box-shadow: 0 0 0 3px var(--accent-light); }
.time-group input[type="time"] {
  flex: 1; border: none; border-radius: 0; background: transparent;
  padding: 0 12px; font-size: 13px; font-weight: 500;
}
.time-group input[type="time"]:focus { box-shadow: none; }
.time-group input[type="time"]:disabled { background: var(--surface-2); opacity: 0.55; }
.time-asap-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 100%;
  border: none; border-left: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0; letter-spacing: 0.3px;
}
.time-asap-toggle:has(input:checked) { background: var(--accent); color: white; }
.time-asap-toggle:has(input:checked) input { accent-color: white; }
.time-asap-toggle input { accent-color: var(--accent); cursor: pointer; }

/* Required tag in field labels */
.req-tag {
  display: inline-block; padding: 1px 6px;
  background: #fee2e2; color: #991b1b;
  border-radius: 3px; font-size: 10px; font-weight: 700; vertical-align: middle; margin-left: 4px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
[data-theme="dark"] .req-tag { background: rgba(220, 38, 38, 0.22); color: #fca5a5; }

/* Date locked field — compact */
.locked-field.date-locked .locked-content span:last-child { font-size: 12.5px; }

/* Save button locked / disabled state */
.btn:disabled { cursor: not-allowed; }
.btn-primary:disabled, .btn-primary.locked {
  background: var(--surface-2); color: var(--text-4); border-color: var(--border-strong);
}
.btn-primary:disabled:hover, .btn-primary.locked:hover {
  background: var(--surface-2); color: var(--text-4);
}
.save-lock { font-size: 14px; }

/* Slot time at end of slot-row */
.slot-time {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  font-variant-numeric: tabular-nums; padding: 1px 6px;
  background: var(--surface-2); border-radius: 3px; line-height: 1.4;
  min-width: 40px; text-align: center;
}
.slot-time-asap { color: var(--text-4); font-weight: 500; font-size: 10px; letter-spacing: 0.3px; }

/* radio group for section type */
.radio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.radio-card { padding: 9px; border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; background: var(--surface); transition: all 0.15s var(--ease-spring); }
.radio-card:hover { background: var(--surface-2); transform: translateY(-1px); }
.radio-card.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.radio-card .dot { width: 10px; height: 10px; border-radius: 3px; }

/* ===== Capacity admin extras ===== */
.tier-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.tier-info { display: flex; align-items: center; gap: 10px; }
.tier-info .section-icon { width: 24px; height: 24px; }
.tier-toggle button { font-size: 11px; padding: 0 8px; height: 24px; }

.cap-num { font-variant-numeric: tabular-nums; }
.cap-num.cap-nice { color: var(--text-3); }

.cap-edit-grid { display: flex; flex-direction: column; gap: 8px; }
.cap-edit-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; background: var(--surface-2); border-radius: var(--radius); transition: opacity 0.15s; }
.cap-edit-row.inactive { opacity: 0.45; }
.cap-edit-toggle { display: grid; place-items: center; padding: 4px; cursor: pointer; }
.cap-edit-toggle input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.cap-edit-label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.cap-edit-label .section-icon { display: inline-grid; place-items: center; border-radius: 4px; color: white; }
.cap-edit-inputs { display: flex; gap: 6px; }
.cap-edit-inputs .field { width: 64px; }
.cap-edit-inputs .field-label { text-align: center; }
.cap-edit-inputs input { text-align: center; }

/* Section editor card */
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tier-row {
  display: grid !important;
  grid-template-columns: 24px 20px 1fr auto;
  gap: 10px;
  align-items: center;
  transition: background 0.1s, opacity 0.15s;
}
.tier-row.dragging { opacity: 0.4; }
.tier-row.drop-target { background: var(--accent-light); box-shadow: inset 0 -2px 0 var(--accent); }

.tier-pos {
  font-size: 13px; font-weight: 700; color: var(--text-3); text-align: right;
  font-variant-numeric: tabular-nums;
}
.drag-handle {
  display: grid; place-items: center; color: var(--text-4); cursor: grab;
  user-select: none;
}
.drag-handle:hover { color: var(--text-2); }
.drag-handle:active { cursor: grabbing; }
.drag-handle .material-symbols-outlined { font-size: 18px; }
.tier-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.tier-reorder { display: flex; flex-direction: column; gap: 0; }
.reorder-btn { width: 22px; height: 18px; padding: 0; color: var(--text-4); border-radius: 3px; }
.reorder-btn:hover:not(:disabled) { background: var(--surface); color: var(--accent); }
.reorder-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.reorder-btn .material-symbols-outlined { font-size: 16px; }
.tier-actions { display: flex; align-items: center; gap: 4px; }
.tier-actions .icon-btn { width: 26px; height: 26px; color: var(--text-3); border-radius: 4px; }
.tier-actions .icon-btn:hover { background: var(--surface); color: var(--text); }
.tier-actions .icon-btn[data-del]:hover { color: #dc2626; }
.tier-actions .icon-btn .material-symbols-outlined { font-size: 14px; }

/* Capacity table — disabled cell */
.cap-off { color: var(--text-4); text-align: center; font-variant-numeric: tabular-nums; }
/* Platform chips list (Republikace admin) */
.platforms-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.platform-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 4px 5px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text);
}
.platform-chip .material-symbols-outlined { color: var(--text-3); }
.platform-del {
  background: none; border: none; padding: 2px; margin-left: 2px;
  display: grid; place-items: center; color: var(--text-4); cursor: pointer; border-radius: 999px;
}
.platform-del:hover { background: var(--surface); color: #dc2626; }
.platform-del .material-symbols-outlined { font-size: 14px; color: inherit; }
.platform-add { display: inline-flex; }
.platform-add input {
  height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px dashed var(--border-strong); background: transparent;
  font-size: 12px; min-width: 220px;
}
.platform-add input:focus { border-style: solid; }

.rep-plat-count {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  background: var(--surface-2); border-radius: 999px; color: var(--text-3);
  white-space: nowrap;
}

.web-edit-cell { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; }
.web-edit-cell:hover { background: var(--surface-2); }
.web-edit-ic { font-size: 14px; color: var(--text-4); opacity: 0; transition: opacity 0.15s; }
.web-edit-cell:hover .web-edit-ic { opacity: 1; color: var(--accent); }
.cap-head { display: inline-flex; align-items: center; gap: 6px; }
.cap-head-ic { width: 16px; height: 16px; border-radius: 3px; color: white; display: inline-grid; place-items: center; }
.cap-head-ic .material-symbols-outlined { font-size: 11px; }

/* Section modal — icon + color grids */
.icon-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.ic-btn {
  width: 100%; aspect-ratio: 1; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 9px; display: grid; place-items: center; color: var(--text-2); cursor: pointer;
  transition: all 0.15s var(--ease-spring);
}
.ic-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.ic-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ic-btn .material-symbols-outlined { font-size: 16px; }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.col-btn {
  width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 9px; cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.1);
}
.col-btn:hover { transform: scale(1.08); }
.col-btn.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset, 0 2px 6px rgba(0,0,0,0.15); }

/* Seasonal recommendation panel (in day detail) */
.rec-panel {
  background: linear-gradient(180deg, #eef2ff 0%, var(--surface) 100%);
  border: 1px solid var(--accent-light); border-radius: var(--radius-lg);
  padding: 10px 14px; margin: 12px 0;
}
[data-theme="dark"] .rec-panel {
  background: linear-gradient(180deg, rgba(99,102,241,0.12) 0%, var(--surface) 100%);
  border-color: rgba(99,102,241,0.3);
}
.rec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rec-title { font-weight: 600; font-size: 13px; color: var(--text); }
.rec-list { display: flex; flex-direction: column; gap: 4px; }
.rec-row {
  display: grid; grid-template-columns: 1fr 240px auto; gap: 12px; align-items: center;
  padding: 6px 8px; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.rec-row:hover { border-color: var(--border-strong); }
.rec-info { min-width: 0; }
.rec-topic { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-progress { display: flex; align-items: center; gap: 8px; }
.rec-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; }
.rec-bar-done { height: 100%; background: #16a34a; }
.rec-bar-linked { height: 100%; background: #818cf8; }
.rec-count { font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.rec-add { padding: 0 10px; height: 26px; font-size: 12px; }
.rec-add .material-symbols-outlined { font-size: 14px; }
.rec-empty { background: var(--surface); border-style: dashed; }
.rec-full { background: var(--tint-green); }
.rec-empty .rec-topic { color: var(--text-2); }

/* Year mini progress bar in rule rows */
.yr-row { grid-template-columns: 16px 1fr 70px auto !important; }
.yr-mini-bar {
  height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex;
}
.yr-mini-done { height: 100%; background: #16a34a; }
.yr-mini-linked { height: 100%; background: #818cf8; }
.yr-prog-empty .yr-mini-bar { background: #fee2e2; }
[data-theme="dark"] .yr-prog-empty .yr-mini-bar { background: rgba(220,38,38,0.18); }
.yr-prog-full .yr-est { color: #16a34a; }
.yr-prog-empty .yr-est { color: #dc2626; }

/* ===== Evergreens databáze ===== */
.eg-summary { padding: 16px 20px; margin-bottom: 16px; }

.eg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  align-items: start;
}
.eg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s var(--ease-soft), transform 0.18s var(--ease-soft);
}
.eg-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.eg-card-h {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.eg-card-web { display: flex; align-items: center; gap: 8px; min-width: 0; }
.eg-card-name { font-weight: 600; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-card-actions { display: flex; align-items: center; gap: 4px; }
.eg-count-pill {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  background: var(--surface-2); border-radius: 999px; color: var(--text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.eg-add { width: 24px; height: 24px; border-radius: 4px; color: var(--text-3); }
.eg-add:hover { background: var(--accent); color: white; }
.eg-add .material-symbols-outlined { font-size: 16px; }

.eg-list { display: flex; flex-direction: column; }
.eg-row {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: flex-start;
  padding: 8px 6px; margin: 0 -6px; border-radius: 4px;
  font-size: 12px; cursor: pointer;
  transition: background 0.1s;
}
.eg-row + .eg-row { border-top: 1px solid var(--border); }
.eg-row:hover { background: var(--surface-2); }
.eg-row-ic {
  font-size: 14px; color: #16a34a; margin-top: 1px;
  font-variation-settings: 'FILL' 1;
}
.eg-row.eg-inactive .eg-row-ic { color: var(--text-4); }
.eg-row.eg-inactive { opacity: 0.55; }
.eg-row-body { min-width: 0; }
.eg-row-topic { font-weight: 600; font-size: 12.5px; color: var(--text); line-height: 1.35; }
.eg-row-brief { margin-top: 2px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.eg-row-uses {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap; align-self: center;
}
.eg-row:hover .eg-row-topic { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* Used items in evergreen modal */
.eg-used { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; max-height: 160px; overflow-y: auto; }
.eg-used-row { font-size: 12px; padding: 3px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.eg-used-row:first-child { border-top: none; }

/* about page */
.prose { max-width: 760px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.prose h2 { color: var(--text); font-size: 16px; margin-top: 24px; }
.prose ul { padding-left: 20px; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.prose kbd {
  display: inline-block; padding: 1px 6px; font-family: ui-monospace, monospace; font-size: 11px;
  background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px; color: var(--text);
}
.prose ol { padding-left: 20px; }
.prose ol li { margin-bottom: 4px; }
.prose ul ul { margin: 4px 0; }

/* ============ DARK MODE OVERRIDES ============ */
[data-theme="dark"] .brand-mark { background: var(--accent); color: #0a0a0a; }

[data-theme="dark"] .pill-good { background: rgba(22, 163, 74, 0.18); color: #4ade80; }
[data-theme="dark"] .pill-bad { background: rgba(220, 38, 38, 0.18); color: #fca5a5; }
[data-theme="dark"] .pill-progress { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
[data-theme="dark"] .pill-proposed { background: var(--surface-2); color: var(--text-3); }

[data-theme="dark"] .ch-state-done { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
[data-theme="dark"] .ch-state-wait { background: var(--surface-2); color: var(--text-3); }
[data-theme="dark"] .ch-state-error { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }

[data-theme="dark"] .ch-wait { background: var(--border-strong); color: var(--text-3); }
[data-theme="dark"] .ch-detail { background: var(--surface-2); }

[data-theme="dark"] .tier-must { background: rgba(220, 38, 38, 0.22); color: #fca5a5; }
[data-theme="dark"] .tier-nice { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }

[data-theme="dark"] .day-detail-h.status-red { border-color: rgba(220, 38, 38, 0.4); }
[data-theme="dark"] .day-detail-h.status-green { border-color: rgba(22, 163, 74, 0.4); }
[data-theme="dark"] .day-detail-h.status-blue { border-color: rgba(59, 130, 246, 0.4); }
[data-theme="dark"] .pill-info { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
[data-theme="dark"] .cell-count-big.cb-info { color: #93c5fd; }
[data-theme="dark"] .cell-count-big.cb-info .cb-tot { color: #93c5fd; }
[data-theme="dark"] .legend-red { border-color: rgba(220, 38, 38, 0.4); }
[data-theme="dark"] .legend-green { border-color: rgba(22, 163, 74, 0.4); }

[data-theme="dark"] .cell-count-big.cb-bad { color: #fca5a5; }
[data-theme="dark"] .cell-count-big.cb-bad .cb-tot { color: #fca5a5; }
[data-theme="dark"] .cell-count-big.cb-ok { color: #4ade80; }
[data-theme="dark"] .cell-count-big.cb-ok .cb-tot { color: #4ade80; }
[data-theme="dark"] .cm-done { color: #4ade80; }
[data-theme="dark"] .cm-prog { color: #fbbf24; }
[data-theme="dark"] .cm-err { color: #fca5a5; }

[data-theme="dark"] .cell:hover { filter: brightness(1.15); }
[data-theme="dark"] .cell.today { box-shadow: inset 0 3px 0 #fbbf24; }
[data-theme="dark"] .week-grid .gh.today { color: #fbbf24; }
[data-theme="dark"] .cell-red.today { box-shadow: inset 3px 0 0 #dc2626, inset 0 3px 0 #fbbf24; }
[data-theme="dark"] .cell-green.today { box-shadow: inset 3px 0 0 #16a34a, inset 0 3px 0 #fbbf24; }

[data-theme="dark"] .mday.today { box-shadow: inset 0 3px 0 #fbbf24; }
[data-theme="dark"] .mday.other { background: #0c0c0e; color: var(--text-4); }

[data-theme="dark"] .year-month.now {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.12) 0%, var(--surface) 55%);
}
[data-theme="dark"] .year-now-tag { background: var(--surface); color: #4ade80; border-color: #4ade80; }
[data-theme="dark"] .year-month.now { border-color: #4ade80; box-shadow: 0 0 0 1px #4ade80; }

[data-theme="dark"] .yr-multi { background: var(--accent-light); color: var(--accent); }

[data-theme="dark"] .tl-val { fill: var(--text); }
[data-theme="dark"] .tl-val-weak { fill: #fca5a5; }
[data-theme="dark"] .tl-val-now { fill: #4ade80; }
[data-theme="dark"] .tl-lbl { fill: var(--text-3); }
[data-theme="dark"] .tl-lbl-now { fill: #4ade80; }
[data-theme="dark"] .tl-axis { fill: var(--text-4); }

[data-theme="dark"] .modal { box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.6); }

[data-theme="dark"] .mp-chip.on { color: #0a0a0a; }
[data-theme="dark"] .btn-primary { color: #0a0a0a; }
[data-theme="dark"] .btn-primary:hover { color: #0a0a0a; }
[data-theme="dark"] .wf-button.wf-button-filtered { color: var(--accent); }
[data-theme="dark"] .wf-check.on { color: #0a0a0a; }
[data-theme="dark"] .wf-check.on .material-symbols-outlined { color: #0a0a0a; opacity: 1; }
[data-theme="dark"] .year-add:hover { color: #0a0a0a; }

[data-theme="dark"] .section-icon { color: white; }
[data-theme="dark"] .cell-ic-bad, [data-theme="dark"] .cell-ic-ok { color: white; }

/* timeline area gradient adjusted for dark */
[data-theme="dark"] .timeline-svg { /* gradient stops still inline #4f46e5 */ }

/* ============================================================
   CALM MODE — UI/UX facelift toggleable via body.cp-calm
   Méně barev, víc typografie a prostoru pro 6+ hodin denně.
   ============================================================ */

/* Toggle button active state */
.theme-toggle#calm-toggle.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ----- Cells: status only via left bar, no bg tint ----- */
body.cp-calm .cell-red,
body.cp-calm .cell-blue,
body.cp-calm .cell-green {
  background: var(--surface);
}
body.cp-calm .cell-red { box-shadow: inset 3px 0 0 #dc2626; }
body.cp-calm .cell-blue { box-shadow: inset 3px 0 0 #3b82f6; }
body.cp-calm .cell-green { box-shadow: inset 3px 0 0 #16a34a; }

/* Today: amber stripe pryč, indikace skrz column header */
body.cp-calm .cell.today { box-shadow: none; }
body.cp-calm .cell-red.today { box-shadow: inset 3px 0 0 #dc2626; }
body.cp-calm .cell-blue.today { box-shadow: inset 3px 0 0 #3b82f6; }
body.cp-calm .cell-green.today { box-shadow: inset 3px 0 0 #16a34a; }
body.cp-calm .week-grid .gh.today {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* Past dny zeslabit — neruší aktuální fokus */
body.cp-calm .cell-past { opacity: 0.65; transition: opacity 0.18s; }
body.cp-calm .cell-past:hover { opacity: 1; }

/* Counter: bold neutral, jen "needs action" červené */
body.cp-calm .cell-count-big.cb-ok,
body.cp-calm .cell-count-big.cb-info {
  color: var(--text);
}
body.cp-calm .cell-count-big.cb-ok .cb-tot,
body.cp-calm .cell-count-big.cb-info .cb-tot {
  color: var(--text-4);
  opacity: 1;
}
body.cp-calm .cell-count-big.cb-bad { color: #991b1b; }
body.cp-calm .cell-count-big.cb-bad .cb-tot { color: #b91c1c; opacity: 0.55; }

/* Status ikona: jen pro red (akce!) a green (motivace), modrý "+" skryt */
body.cp-calm .cell-status-ic.cell-ic-info { display: none; }
body.cp-calm .cell-status-ic { width: 16px; height: 16px; }
body.cp-calm .cell-status-ic .material-symbols-outlined { font-size: 12px; }

/* Progress bar: monochromatic (jen done zelená + zbytek šedý) */
body.cp-calm .bar-seg.bs-prog,
body.cp-calm .bar-seg.bs-err { background: #d4d4d8; }
[data-theme="dark"] body.cp-calm .bar-seg.bs-prog,
[data-theme="dark"] body.cp-calm .bar-seg.bs-err { background: #52525b; }
body.cp-calm .cell-bar { background: var(--surface-2); }

/* Meta řádek: tlumenější barvy */
body.cp-calm .cm-done { color: #16a34a; opacity: 0.82; }
body.cp-calm .cm-prog { color: var(--text-3); }
body.cp-calm .cm-err {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
  padding: 1px 6px; border-radius: 999px; gap: 2px;
}
[data-theme="dark"] body.cp-calm .cm-err {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.15);
}
body.cp-calm .cm-empty { color: var(--text-4); }

/* Den header v Týdnu — uvolnit barevnou intensitu */
body.cp-calm .week-grid .gh { color: var(--text-3); font-weight: 600; }
body.cp-calm .week-grid .gh-date { color: var(--text-2); font-weight: 600; }
body.cp-calm .week-grid .gh.today .gh-day,
body.cp-calm .week-grid .gh.today .gh-date { color: var(--accent); }

/* ----- Day detail: section boxes bez plného tintu ----- */
body.cp-calm .section-box.section-bad,
body.cp-calm .section-box.section-good,
body.cp-calm .section-box.section-info {
  background: var(--surface);
}
body.cp-calm .day-detail-h.status-red,
body.cp-calm .day-detail-h.status-green,
body.cp-calm .day-detail-h.status-blue {
  background: var(--surface);
}
body.cp-calm .day-detail-h.status-red { box-shadow: inset 4px 0 0 #dc2626; border-color: var(--border); }
body.cp-calm .day-detail-h.status-green { box-shadow: inset 4px 0 0 #16a34a; border-color: var(--border); }
body.cp-calm .day-detail-h.status-blue { box-shadow: inset 4px 0 0 #3b82f6; border-color: var(--border); }

/* Slot row hover — subtle bg + underline */
body.cp-calm .slot-row[data-id]:hover { background: var(--surface-2); }

/* Pill harmonization in calm */
body.cp-calm .pill-bad { background: var(--surface-2); color: #991b1b; }
body.cp-calm .pill-good { background: var(--surface-2); color: #166534; }
body.cp-calm .pill-info { background: var(--surface-2); color: #1e40af; }
[data-theme="dark"] body.cp-calm .pill-bad { background: var(--surface-2); color: #fca5a5; }
[data-theme="dark"] body.cp-calm .pill-good { background: var(--surface-2); color: #4ade80; }
[data-theme="dark"] body.cp-calm .pill-info { background: var(--surface-2); color: #93c5fd; }

/* ----- Micro-celebration: jemný flash zelené při dokončení titulků ----- */
@keyframes calmFlash {
  0%   { background: rgba(22, 163, 74, 0.22); transform: translateX(0); }
  35%  { background: rgba(22, 163, 74, 0.18); }
  100% { background: transparent; }
}
.slot-row.celebrate {
  animation: calmFlash 1.0s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 4px;
}
[data-theme="dark"] .slot-row.celebrate {
  animation: calmFlashDark 1.0s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes calmFlashDark {
  0%   { background: rgba(74, 222, 128, 0.18); }
  100% { background: transparent; }
}

/* ============================================================
   2026 GLOBAL POLISH — scrollbars, selection, motion-safety
   ============================================================ */

/* Thin, subtle scrollbars (Linear/Cron style) */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-4);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* Branded text selection */
::selection { background: rgba(99, 102, 241, 0.22); color: inherit; }
[data-theme="dark"] ::selection { background: rgba(129, 140, 248, 0.32); }

/* Smooth in-page scrolling */
html { scroll-behavior: smooth; }

/* Crisp Material Symbols rendering */
.material-symbols-outlined {
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Respect reduced-motion — disable animations & spring transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tl-pulse { animation: none !important; }
}

/* =====================================================================
   v71 — přírůstky pro serverovou verzi:
   stav ukládání, toasty, přihlašovací obrazovka
   ===================================================================== */

/* ---- stav ukládání v topbaru ---- */
.sync-state {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft), background 0.2s var(--ease-soft);
}
.sync-state .material-symbols-outlined { font-size: 16px; }
.sync-state[data-state="idle"] { color: var(--text-4); }
.sync-state[data-state="pending"],
.sync-state[data-state="saving"] {
  color: var(--col-warn-text);
  border-color: color-mix(in srgb, var(--col-warn) 35%, var(--border));
  background: var(--tint-amber);
}
.sync-state[data-state="saving"] .material-symbols-outlined { animation: sync-spin 1.1s linear infinite; }
.sync-state[data-state="error"] {
  color: var(--col-bad-text);
  border-color: color-mix(in srgb, var(--col-bad) 45%, var(--border));
  background: var(--tint-red);
}
@keyframes sync-spin { to { transform: rotate(360deg); } }

.foot-link { color: var(--text-3); text-decoration: underline; }
.foot-link:hover { color: var(--accent); }

/* ---- toasty ---- */
.toast-root {
  position: fixed; z-index: 200;
  right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 420px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; line-height: 1.45;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s var(--ease-soft), transform 0.24s var(--ease-spring);
}
.toast.in { opacity: 1; transform: none; }
.toast-ok { border-left: 3px solid var(--col-good); }
.toast-error { border-left: 3px solid var(--col-bad); }
.toast-info { border-left: 3px solid var(--accent); }

/* ---- přihlášení ---- */
.login-body {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
}
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .brand-name { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }
.login-lead { margin: 14px 0 20px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input[type="text"],
.login-form input[type="password"] { width: 100%; }
.login-submit { justify-content: center; margin-top: 4px; }
.login-error {
  margin-bottom: 16px; padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--col-bad) 40%, var(--border));
  border-left-width: 3px;
  background: var(--tint-red);
  color: var(--col-bad-text);
  font-size: 13px;
}
.login-foot { margin: 22px 0 0; text-align: center; }
