/* Pixelmar asistent: prototyp. Styl podle iOS (Liquid Glass jen na navigaci a sheetech). */

:root {
  color-scheme: light dark;

  --bg: #F2F2F7;
  --group: #FFFFFF;
  --group-pressed: #E5E5EA;
  --text: #000000;
  --text-2: #6C6C70;          /* 5.2:1 na bílé */
  --sep: rgba(60, 60, 67, 0.2);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);

  /* Barvy Pixelmar jako akcenty (tečky, ikony) */
  --p1: #F4515A;
  --p2: #F5A623;
  --p3: #4AB4EC;
  --done: #4CC88E;
  --cal: #EC4CB8;

  /* Varianty pro text a výplně, aby kontrast splnil WCAG AA */
  --accent-text: #1677B0;
  --accent-fill: #1677B0;
  --on-accent: #FFFFFF;
  --red-text: #C8303B;
  --swipe-done: #187A4C;
  --swipe-later: #F5A623;
  --on-swipe-later: #000000;

  /* Sklo */
  --glass: rgba(255, 255, 255, 0.6);
  --glass-solid: #F9F9F9;
  --glass-edge: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --backdrop: rgba(0, 0, 0, 0.2);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --side: 16px;
  --r-group: 12px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-pop: cubic-bezier(0.34, 1.4, 0.64, 1);

  --font: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --group: #1C1C1F;
    --group-pressed: #2C2C2F;
    --text: #FFFFFF;
    --text-2: #98989F;        /* 5.9:1 na #1C1C1F */
    --sep: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);

    --accent-text: #4AB4EC;
    --accent-fill: #4AB4EC;
    --on-accent: #000000;
    --red-text: #F4515A;
    --swipe-done: #4CC88E;

    --glass: rgba(28, 28, 31, 0.55);
    --glass-solid: #1C1C1F;
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --backdrop: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
    --bg: #000000;
    --group: #1C1C1F;
    --group-pressed: #2C2C2F;
    --text: #FFFFFF;
    --text-2: #98989F;        /* 5.9:1 na #1C1C1F */
    --sep: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);

    --accent-text: #4AB4EC;
    --accent-fill: #4AB4EC;
    --on-accent: #000000;
    --red-text: #F4515A;
    --swipe-done: #4CC88E;

    --glass: rgba(28, 28, 31, 0.55);
    --glass-solid: #1C1C1F;
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --backdrop: rgba(0, 0, 0, 0.45);
  }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- základ ---------- */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/22px var(--font);
  letter-spacing: -0.41px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ico--sm { width: 17px; height: 17px; }
.ico--lg { width: 26px; height: 26px; }

h1, h2, h3, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- sklo ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- horní lišta ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  padding-top: var(--safe-t);
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.topbar__inner {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 calc(var(--side) + var(--safe-r)) 0 calc(var(--side) + var(--safe-l));
}
.topbar__title {
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms ease, transform 250ms var(--spring);
}
.topbar.is-scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 -0.5px 0 var(--sep);
}
@media (prefers-reduced-transparency: reduce) {
  .topbar.is-scrolled { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.topbar.is-scrolled .topbar__title { opacity: 1; transform: none; }

.iconbtn {
  position: absolute;
  right: calc(var(--side) - 8px + var(--safe-r));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--text);
}
.iconbtn:active { background: var(--fill); }
.iconbtn.is-spinning .ico,
.ptr.is-loading .ptr__ico { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- rozložení ---------- */

.layout { min-height: 100dvh; }

.content {
  padding: calc(var(--safe-t) + 44px) calc(var(--side) + var(--safe-r)) calc(var(--safe-b) + 120px) calc(var(--side) + var(--safe-l));
  max-width: 600px;
  margin: 0 auto;
  transition: transform 300ms var(--spring);
}

.detail-pane { display: none; }

/* Na počítači dva sloupce: seznam + detail */
@media (min-width: 900px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(380px, 480px) minmax(380px, 560px);
    justify-content: center;
    gap: 32px;
  }
  .content { margin: 0; max-width: none; width: 100%; }
  .detail-pane {
    display: block;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    padding: calc(var(--safe-t) + 44px + 56px) var(--side) 48px;
  }
  .detail-pane:empty::before {
    content: "Vyber úkol vlevo.";
    display: block;
    color: var(--text-2);
    padding: 12px 4px;
  }
}

/* ---------- velký nadpis ---------- */

.largetitle { padding: 6px 4px 0; }
.largetitle h1 {
  margin: 0;
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.37px;
}
.largetitle__sub {
  margin-top: 2px;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.24px;
  color: var(--text-2);
}

/* ---------- přepínač schránek ---------- */

.segmented {
  margin: 16px 0 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 2px;
  border-radius: 9px;
  background: var(--fill);
  position: relative;
}
.segmented button {
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.08px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  z-index: 1;
}
.segmented button[aria-pressed="true"] { font-weight: 600; }
.segmented__thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  border-radius: 7px;
  background: var(--group);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  transition: transform 300ms var(--spring);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .segmented__thumb { background: #636366; box-shadow: none; }
}
:root[data-theme="dark"] .segmented__thumb { background: #636366; box-shadow: none; }

/* ---------- skupiny (inset grouped) ---------- */

.section { margin-top: 24px; }
.section__header {
  padding: 0 4px 6px 16px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.08px;
  color: var(--text-2);
  text-transform: uppercase;
}
.group {
  background: var(--group);
  border-radius: var(--r-group);
  overflow: hidden;
}
.plan {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.24px;
}

/* řádek úkolu */
.row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  transition: height 320ms var(--spring), opacity 250ms ease;
}
.row__swipe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  padding: 0 20px;
  gap: 8px;
  opacity: 0; /* zobrazí se až při swipe, jinak by prosvítal okraj */
}
.row__swipe--done { background: var(--swipe-done); color: #fff; justify-content: flex-start; }
.row__swipe--later { background: var(--swipe-later); color: var(--on-swipe-later); justify-content: flex-end; }

.row__main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 16px 11px 12px;
  background: var(--group);
  will-change: transform;
  cursor: pointer;
}
.row__main.is-pressed { background: var(--group-pressed); }
.row + .row .row__main::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 50px;
  border-top: 0.5px solid var(--sep);
}

.check {
  width: 44px;
  height: 44px;
  margin: -11px -6px -11px -8px;
  display: grid;
  place-items: center;
  flex: none;
}
.check__ring {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1.75px solid var(--text-2);
  display: grid;
  place-items: center;
  transition: background-color 200ms ease, border-color 200ms ease, transform 300ms var(--spring-pop);
}
.check__ring .ico {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 150ms ease, transform 300ms var(--spring-pop);
}
.row.is-done .check__ring {
  background: var(--done);
  border-color: var(--done);
  transform: scale(1.08);
}
.row.is-done .check__ring .ico { opacity: 1; transform: scale(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .row.is-done .check__ring .ico { color: #000; } }
:root[data-theme="dark"] .row.is-done .check__ring .ico { color: #000; }
.row.is-done .row__title { color: var(--text-2); }

.row__text { flex: 1; min-width: 0; }
.row__title {
  display: block;
  transition: color 200ms ease;
}
.row__meta {
  display: block;
  margin-top: 1px;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.24px;
  color: var(--text-2);
}
.row__meta .is-late { color: var(--red-text); }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot--P1 { background: var(--p1); }
.dot--P2 { background: var(--p2); }
.dot--P3 { background: var(--p3); }

/* řádek události z kalendáře */
.event {
  position: relative;
  display: flex;
  gap: 12px;
  min-height: 44px;
  padding: 11px 16px;
}
.event + .event::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.event__bar {
  width: 3px;
  border-radius: 2px;
  background: var(--cal);
  flex: none;
}
.event__time {
  width: 48px;
  flex: none;
  font-size: 15px;
  line-height: 22px;
  color: var(--text);
  font-weight: 500;
}
.event__time small {
  display: block;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  color: var(--text-2);
}
.event__title { display: block; }
.event__place {
  display: block;
  font-size: 15px;
  line-height: 20px;
  color: var(--text-2);
}

.empty {
  padding: 12px 16px;
  color: var(--text-2);
}

/* ---------- dock: tab bar a tlačítko + ---------- */

.dock {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 calc(var(--side) + var(--safe-r)) calc(max(var(--safe-b), 12px) + 4px) calc(var(--side) + var(--safe-l));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.tabbar, .fab { pointer-events: auto; }

.tabbar {
  display: flex;
  flex: 1;
  max-width: 380px;
  height: 62px;
  padding: 4px;
  border-radius: 31px;
  transition: height 300ms var(--spring), border-radius 300ms var(--spring), max-width 300ms var(--spring);
}
.tab {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  border-radius: 27px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: -0.08px;
  transition: background-color 200ms ease, color 200ms ease;
}
.tab.is-active {
  color: var(--text);
  font-weight: 600;
  background: var(--fill);
}
.tab span { transition: opacity 200ms ease, height 300ms var(--spring); }

.fab {
  width: 62px;
  height: 62px;
  border-radius: 31px;
  display: grid;
  place-items: center;
  color: var(--text);
  transition: width 300ms var(--spring), height 300ms var(--spring), transform 250ms var(--spring-pop);
}
.fab:active { transform: scale(0.92); }

/* Při scrollu dolů se tab bar zmenší */
.dock.is-compact .tabbar { height: 50px; max-width: 300px; border-radius: 25px; }
.dock.is-compact .tab span { opacity: 0; height: 0; overflow: hidden; }
.dock.is-compact .fab { width: 50px; height: 50px; }

@media (min-width: 900px) {
  .dock { justify-content: flex-start; padding-left: calc(50vw - 512px + var(--side)); }
  .dock.is-compact .tabbar { height: 62px; max-width: 380px; }
  .dock.is-compact .tab span { opacity: 1; height: auto; }
  .dock.is-compact .fab { width: 62px; height: 62px; }
}

/* ---------- pull to refresh ---------- */

.ptr {
  height: 0;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 20px;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}
.ptr__ico { width: 18px; height: 18px; transition: transform 100ms linear; }

/* ---------- bottom sheet ---------- */

.sheet-layer { position: fixed; inset: 0; z-index: 50; }
.sheet-layer[hidden] { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity 300ms ease;
}
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }

.sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: calc(100dvh - var(--safe-t) - 24px);
  max-width: 600px;
  margin: 0 auto;
  border-radius: 34px;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 380ms var(--spring);
  padding-bottom: max(var(--safe-b), 12px);
  overscroll-behavior: contain;
}
.sheet-layer.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }

.sheet__grabber {
  flex: none;
  height: 22px;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}
.sheet__grabber span {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--fill-2);
}
.sheet__body {
  overflow-y: auto;
  padding: 0 20px 8px;
  -webkit-overflow-scrolling: touch;
}

/* skupiny uvnitř sheetu jsou plné, ne skleněné */
.sheet .group, .detail-pane .group { background: var(--group); }

.detail__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0 16px;
}
.detail__head .check { margin: -9px -6px -9px -10px; }
.detail__title {
  flex: 1;
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: 0.35px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 11px 16px;
}
.field + .field::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.field__label { color: var(--text); }
.field__value { color: var(--text-2); text-align: right; display: flex; align-items: center; gap: 8px; }
.field__value .is-late { color: var(--red-text); }

.note {
  padding: 12px 16px;
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.24px;
}
.note__label {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
  margin-bottom: 2px;
}
.quote {
  margin: 0;
  position: relative;
  padding: 11px 16px 12px;
  font-size: 15px;
  line-height: 21px;
  letter-spacing: -0.24px;
  color: var(--text-2);
}

.mailbox {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}
.field + .quote::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.mailbox-hint {
  padding: 8px 16px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  height: 50px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  background: var(--fill);
  color: var(--text);
  transition: transform 200ms var(--spring-pop), opacity 150ms ease;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn--primary { background: var(--accent-fill); color: var(--on-accent); grid-column: 1 / -1; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* rychlé přidání */
.quick__title {
  margin: 4px 0 12px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: 0.35px;
}
.quick__input {
  width: 100%;
  min-height: 96px;
  resize: none;
  border: 0;
  border-radius: var(--r-group);
  padding: 12px 16px;
  background: var(--group);
  color: var(--text);
  font: 400 17px/22px var(--font);
  letter-spacing: -0.41px;
}
.quick__input::placeholder { color: var(--text-2); }
.quick__hint {
  padding: 8px 16px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.quick__preview { margin-top: 16px; }
.toggle {
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--fill-2);
  position: relative;
  flex: none;
  transition: background-color 200ms ease;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform 250ms var(--spring);
}
.toggle[aria-checked="true"] { background: var(--done); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- kontextové menu ---------- */

.menu-layer { position: fixed; inset: 0; z-index: 60; }
.menu-layer[hidden] { display: none; }
.menu-backdrop { position: absolute; inset: 0; }
.menu {
  position: absolute;
  min-width: 230px;
  border-radius: 20px;
  padding: 6px;
  transform-origin: top right;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 260ms var(--spring-pop), opacity 160ms ease;
}
.menu-layer.is-open .menu { transform: none; opacity: 1; }
.menu__item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-radius: 14px;
  text-align: left;
}
.menu__item:active { background: var(--fill); }
.menu__item small { color: var(--text-2); font-size: 15px; }
.menu__date {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 15px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(max(var(--safe-b), 12px) + 82px);
  transform: translate(-50%, 16px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  padding: 0 8px 0 18px;
  border-radius: 22px;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 300ms var(--spring), opacity 200ms ease;
}
.toast[hidden] { display: none; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast button {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-weight: 600;
  color: var(--accent-text);
}

/* ---------- jiné záložky (v prototypu jen náznak) ---------- */

.waiting__days { color: var(--text-2); font-size: 15px; white-space: nowrap; }
.waiting__days.is-long { color: var(--red-text); }
.link-btn {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
  text-decoration: none;
}

/* ---------- oprava AI ---------- */

.text-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px auto 4px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-2);
}
.text-btn:active { background: var(--fill); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--fill);
  font-size: 15px;
  font-weight: 500;
}
.chip[aria-checked="true"] { background: var(--accent-fill); color: var(--on-accent); }

/* ---------- veletrhy: Ganttův diagram ---------- */

.legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 8px; border-radius: 4px; display: inline-block; }
.sw--season, .bar--season { background: var(--p3); }
.sw--off, .bar--off { background: color-mix(in srgb, var(--p3) 28%, transparent); }
.sw--fair, .bar--fair { background: var(--cal); }

.gantt { position: relative; }
.gantt__scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gantt__scroll::-webkit-scrollbar { display: none; }
.gantt__canvas { position: relative; padding-bottom: 6px; }
.gantt__months { position: relative; height: 30px; }
.gantt__months span {
  position: absolute;
  top: 7px;
  padding-left: 6px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
  white-space: nowrap;
}
.gantt__grid {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 0.5px solid var(--sep);
}
.gantt__today {
  position: absolute;
  top: 30px;
  bottom: 0;
  width: 0;
  border-left: 1.5px solid var(--text);
  z-index: 1;
}
.gantt__today::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4.75px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
}
.gantt__row {
  position: relative;
  height: 58px;
  border-top: 0.5px solid var(--sep);
  cursor: pointer;
}
.gantt__row:active { background: var(--fill); }
.gantt__label {
  position: sticky;
  left: 0;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  max-width: calc(100vw - 2 * var(--side) - 8px);
  padding: 7px 12px 0 14px;
  pointer-events: none;
}
.gantt__label b {
  font-size: 15px;
  line-height: 19px;
  letter-spacing: -0.24px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 0 3px var(--group), 0 0 3px var(--group);
}
.gantt__label small {
  font-size: 13px;
  line-height: 16px;
  color: var(--text-2);
  white-space: nowrap;
  text-shadow: 0 0 3px var(--group), 0 0 3px var(--group);
}
.gantt__row--load { cursor: default; height: 78px; }
.gantt__row--load:active { background: none; }
.load {
  position: absolute;
  bottom: 6px;
  border-radius: 3px 3px 1px 1px;
  background: var(--p3);
  opacity: 0.85;
}
.bar {
  position: absolute;
  top: 42px;
  height: 8px;
  border-radius: 4px;
}
.bar--fair { top: 39px; height: 14px; border-radius: 4px; min-width: 6px; }

.add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--accent-text);
  font-weight: 600;
}
.add-row:active { background: var(--fill); }

/* formulář */
.field--input input, .field--input select {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 17px/22px var(--font);
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
}
.field--input input:focus, .field--input select:focus { outline: none; }
.field--dates { flex-direction: column; align-items: stretch; gap: 6px; }
.field__dates { display: flex; align-items: center; gap: 8px; }
.field__dates input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--fill);
  font-size: 15px;
  text-align: center;
  color: var(--text);
}
.field__sep { flex: none; }
.field__sep { font-size: 13px; color: var(--text-2); }

@media (min-width: 900px) {
  .layout:has(.gantt) { grid-template-columns: minmax(380px, 1100px); }
  .layout:has(.gantt) .detail-pane { display: none; }
}

/* ---------- omezení pohybu ---------- */

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

/* ---------- ostrá aplikace: přihlášení, nastavení, seznamy ---------- */

.login {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 72px) calc(var(--side) + var(--safe-r)) 48px calc(var(--side) + var(--safe-l));
}
.login .largetitle { padding-left: 4px; }
.login .group { margin-top: 24px; }
.login input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 17px/22px var(--font);
  padding: 11px 16px;
  min-height: 44px;
}
.login input:focus { outline: none; }
.login .btn { width: 100%; margin-top: 16px; }
.login .quick__hint { padding: 8px 16px 0; }
.code-input { letter-spacing: 6px; font-variant-numeric: tabular-nums; }

.nav-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 11px 16px;
  text-align: left;
}
.nav-row + .nav-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.nav-row:active { background: var(--group-pressed); }
.nav-row__value { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.back {
  position: absolute;
  left: calc(var(--side) - 8px + var(--safe-l));
  height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  color: var(--accent-text);
  font-size: 17px;
}
.back .ico { transform: rotate(180deg); width: 20px; height: 20px; }

.field--edit select, .field--edit input {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 400 17px/22px var(--font);
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
  max-width: 60%;
}
.field--edit select:focus, .field--edit input:focus { outline: none; color: var(--text); }
.field--edit input[type="date"] { min-width: 140px; }

.filtered__row {
  position: relative;
  padding: 11px 16px;
}
.filtered__row + .filtered__row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.filtered__who { display: block; }
.filtered__subj { display: block; color: var(--text-2); font-size: 15px; line-height: 20px; }
.filtered__why { display: block; color: var(--text-2); font-size: 13px; line-height: 18px; margin-top: 2px; }
.filtered__actions { display: flex; gap: 8px; margin-top: 8px; }
.pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--fill);
  font-size: 15px;
  font-weight: 500;
}
.pill--accent { color: var(--accent-text); }
.pill[disabled] { opacity: 0.5; }

.stat {
  display: flex;
  justify-content: space-between;
  padding: 11px 16px;
}
.warning {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r-group);
  background: var(--group);
  color: var(--red-text);
  font-size: 15px;
  line-height: 21px;
}
.textarea-plain {
  width: 100%;
  min-height: 72px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font: 400 17px/22px var(--font);
  padding: 11px 16px;
}
.textarea-plain:focus { outline: none; }
.field--edit .field__value { flex: 1; justify-content: flex-end; min-width: 0; }
.field--edit .field__value select { max-width: none; }
.code-input::placeholder { letter-spacing: 0; }
