/* Sidequests — expediční deník. Skelet ve stylu bedigit.cz (monochrom, uppercase
   tracking labely, číslované položky, pill tvary) + topografická/mapová atmosféra. */

:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f5f2;
  --bg-raise: #ffffff;
  --ink: #0e100f;
  /* Alfy jsou v obou režimech naladěné na stejný kontrastní poměr:
     ink-70 ≈ 6.5:1, ink-45 ≈ 4.5:1 (drobné mono labely), ink-35 ≈ 3.6:1
     (placeholdery, patička), ink-25 je čistá dekorace. */
  --ink-70: rgba(14, 16, 15, .68);
  --ink-45: rgba(14, 16, 15, .58);
  --ink-35: rgba(14, 16, 15, .51);
  --ink-25: rgba(14, 16, 15, .3);
  --line: rgba(14, 16, 15, .12);
  --line-soft: rgba(14, 16, 15, .07);
  --accent: #6b5c33;          /* zvětralá mosaz — barva vrstevnic */
  --accent-ink: #ffffff;
  --topo: rgba(14, 16, 15, .055);
  --shadow: 0 1px 2px rgba(14,16,15,.04), 0 12px 32px -18px rgba(14,16,15,.22);
  --radius: 14px;
}

:root[data-theme="dark"] {
  --bg: #0d0f0f;
  --bg-raise: #141716;
  --ink: #eceae5;
  --ink-70: rgba(236, 234, 229, .64);
  --ink-45: rgba(236, 234, 229, .5);
  --ink-35: rgba(236, 234, 229, .43);
  --ink-25: rgba(236, 234, 229, .25);
  --line: rgba(236, 234, 229, .13);
  --line-soft: rgba(236, 234, 229, .07);
  --accent: #c9a961;
  --accent-ink: #14120c;
  --topo: rgba(236, 234, 229, .05);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 44px -22px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

/* Prvky s `display: flex/grid` v pravidle níž by jinak přebily atribut hidden
   a zůstaly viset na obrazovce (menu, toast, lišta značek). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .35s ease, color .35s ease;
}

/* — topografické pozadí: soustředné vrstevnice + jemná mřížka — */
.topo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 82% 8%, transparent 0 26px, var(--topo) 26px 27px),
    repeating-radial-gradient(circle at 12% 78%, transparent 0 34px, var(--topo) 34px 35px),
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 88px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 88px 100%;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 92%);
  opacity: .85;
}

.wrap {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ————————————————————————— hlavička ————————————————————————— */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line-soft);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 66px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand__mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { font-size: 13px; font-weight: 650; letter-spacing: .17em; text-transform: uppercase; }
.brand__text em {
  font-style: normal; font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-45);
}

.bar__right { display: flex; align-items: center; gap: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-25); flex: none; }
.chip--store[data-state="cloud"] .dot { background: #3fa87a; box-shadow: 0 0 0 3px rgba(63,168,122,.16); }
.chip--store[data-state="local"] .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.chip--store[data-state="error"] .dot { background: #c5533f; box-shadow: 0 0 0 3px rgba(197,83,63,.18); }

.iconbtn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-45);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.iconbtn:hover { background: var(--line-soft); color: var(--ink); border-color: var(--line); }
.ico { width: 18px; height: 18px; }
:root[data-theme="dark"] .ico--moon { display: none; }
:root:not([data-theme="dark"]) .ico--sun { display: none; }

.menu { position: relative; }
.menu__pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 196px;
  padding: 6px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu__pop button, .menu__pop a {
  appearance: none; border: 0; background: transparent;
  text-align: left; text-decoration: none;
  padding: 9px 11px; border-radius: 8px;
  font: inherit; font-size: 13.5px; color: var(--ink-70);
  cursor: pointer;
}
.menu__pop button:hover, .menu__pop a:hover { background: var(--line-soft); color: var(--ink); }
.menu__pop--wide { min-width: 254px; left: 0; right: auto; }
.menu__label {
  margin: 4px 11px 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu__sep { height: 1px; border: 0; background: var(--line-soft); margin: 6px 5px; }

.menu__list {
  display: flex !important; flex-direction: column; gap: 2px;
  width: 100%;
}
.menu__list.is-active { background: var(--line-soft); }
.menu__list.is-active .menu__list-name { color: var(--ink); }
.menu__list-name { font-size: 13.5px; }
.menu__list-meta {
  font-family: var(--mono); font-size: 9px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-35);
}

/* — přepínač seznamů v hlavičce — */
.switcher { flex: 0 1 auto; min-width: 0; margin-left: 4px; }
.switcher__btn {
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 7px 10px 7px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.switcher__btn:hover { border-color: var(--ink-25); background: var(--line-soft); }
.switcher__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher__badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase;
}
.switcher__chev { width: 15px; height: 15px; flex: none; color: var(--ink-35); }

/* — avatar uživatele — */
.avatar {
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
}
.avatar:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent); }

/* ————————————————————————— hero ————————————————————————— */

.hero { padding: 58px 0 34px; }

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.02;
  letter-spacing: -.03em;
  font-weight: 500;
}

.stats {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 34px;
}
.stat {
  flex: 1 1 130px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 60%, transparent);
}
.stat b {
  display: block;
  font-size: 27px; font-weight: 500; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-45);
}
.stat--wide { flex: 2 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 11px; }
.progress { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .45s cubic-bezier(.2,.7,.2,1); }

/* ————————————————————————— zápis nového sidequestu ————————————————————————— */

.compose { margin-bottom: 26px; }

.compose form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  padding: 6px 6px 6px 0;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.compose form:focus-within { border-color: var(--ink-25); }

.compose__row { display: flex; align-items: center; gap: 4px; }
.compose__num {
  width: 52px; flex: none; text-align: center;
  font-family: var(--mono); font-size: 15px; color: var(--accent);
}
.compose__title {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 16.5px; color: var(--ink);
  padding: 12px 0;
}
.compose__title::placeholder { color: var(--ink-35); }

.compose__more { padding: 4px 14px 10px 52px; display: grid; gap: 8px; }
.compose__more textarea, .compose__more input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font: inherit; font-size: 14px; color: var(--ink);
  padding: 9px 12px;
  outline: none;
  resize: vertical;
}
.compose__more textarea:focus, .compose__more input:focus { border-color: var(--ink-25); }
.compose__more ::placeholder { color: var(--ink-35); }

.linkbtn {
  appearance: none; border: 0; background: transparent;
  margin: 0 0 4px 52px; padding: 4px 0;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-45); cursor: pointer;
}
.linkbtn:hover { color: var(--ink); }

.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-70);
  font: inherit;
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-25); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn__arrow { transition: transform .25s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ————————————————————————— filtry ————————————————————————— */

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

.tabs { display: flex; gap: 2px; }
.tab {
  appearance: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent;
  padding: 8px 15px;
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-45);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background-color .2s, color .2s;
}
.tab:hover { background: var(--line-soft); color: var(--ink-70); }
.tab i {
  font-style: normal; font-family: var(--mono); font-size: 10px;
  color: var(--ink-25);
  font-variant-numeric: tabular-nums;
}
.tab.is-active { background: var(--ink); color: var(--bg); }
.tab.is-active i { color: color-mix(in srgb, var(--bg) 60%, transparent); }

.search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-45);
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--ink-25); }
.search input {
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 13.5px; color: var(--ink);
  width: 168px;
}
.search input::placeholder { color: var(--ink-35); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }

.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.tagbtn {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent;
  padding: 5px 11px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-45);
  transition: all .2s;
}
.tagbtn:hover { color: var(--ink); border-color: var(--ink-25); }
.tagbtn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ————————————————————————— trasa / seznam sidequestů ————————————————————————— */

.route { padding: 18px 0 40px; }

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

.quest {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: start;
  gap: 0 14px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.quest:last-child { border-bottom: 1px solid var(--line-soft); }

/* přerušovaná linka trasy mezi zastávkami */
.quest::before {
  content: "";
  position: absolute;
  left: 25px; top: 46px; bottom: -2px;
  width: 1px;
  background: repeating-linear-gradient(var(--line) 0 3px, transparent 3px 8px);
}
.quest:last-child::before { display: none; }

.quest__stop {
  grid-row: 1 / span 2;
  width: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative; z-index: 1;
}

.check {
  appearance: none; cursor: pointer;
  width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--ink-25);
  border-radius: 50%;
  background: var(--bg);
  display: grid; place-items: center;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.check:hover { border-color: var(--accent); transform: scale(1.08); }
.check::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 1.8px solid var(--accent-ink);
  border-bottom: 1.8px solid var(--accent-ink);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform .2s cubic-bezier(.3,1.5,.5,1);
}
.quest.is-done .check { background: var(--accent); border-color: var(--accent); }
.quest.is-done .check::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.quest__num {
  font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .1em;
  color: var(--ink-35);
  font-variant-numeric: tabular-nums;
}

.quest__body { grid-column: 2; min-width: 0; }

.quest__title {
  margin: 0;
  font-size: 19px; font-weight: 500; letter-spacing: -.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.quest.is-done .quest__title { color: var(--ink-45); text-decoration: line-through; text-decoration-thickness: 1px; }

.quest__detail {
  margin: 7px 0 0;
  font-size: 14.5px; color: var(--ink-70);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.quest__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.tag {
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-45);
}
.tag--date { border-style: dashed; }

/* záznam ze sidequestu */
.log {
  margin-top: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--bg-raise) 70%, transparent);
}
.log__label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.log__text { margin: 0; font-size: 14px; color: var(--ink-70); white-space: pre-wrap; overflow-wrap: anywhere; }
.log__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.log__links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none;
  font-size: 12px; color: var(--ink-70);
  max-width: 100%;
  transition: border-color .2s, color .2s;
}
.log__links a:hover { border-color: var(--accent); color: var(--ink); }
.log__links svg { width: 13px; height: 13px; flex: none; opacity: .6; }
.log__links span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* akce */
.quest__acts {
  grid-column: 3; grid-row: 1;
  display: flex; gap: 1px;
  opacity: 0;
  transition: opacity .2s;
}
.quest:hover .quest__acts,
.quest:focus-within .quest__acts { opacity: 1; }
@media (hover: none) { .quest__acts { opacity: 1; } }

.act {
  appearance: none; cursor: pointer;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink-35);
  transition: color .2s, background-color .2s;
}
.act:hover { color: var(--ink); background: var(--line-soft); }
.act--del:hover { color: #c5533f; }
.act svg { width: 15px; height: 15px; }
.act[disabled] { opacity: .3; cursor: default; }

/* inline editace */
.edit { grid-column: 2 / -1; display: grid; gap: 8px; }
.edit input, .edit textarea {
  width: 100%;
  border: 1px solid var(--ink-25); border-radius: 10px;
  background: var(--bg-raise);
  font: inherit; color: var(--ink);
  padding: 10px 12px;
  outline: none; resize: vertical;
}
.edit input:first-child { font-size: 17px; font-weight: 500; }
.edit__actions { display: flex; gap: 6px; }

/* ————————————————————————— prázdný stav, patička ————————————————————————— */

.empty { padding: 70px 20px; text-align: center; color: var(--ink-35); }
.empty svg { width: 64px; height: 64px; }
.empty p { margin: 14px 0 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; }

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-35);
}

/* ————————————————————————— dialog ————————————————————————— */

.sheet {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-raise);
  color: var(--ink);
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.5);
}
.sheet::backdrop { background: rgba(8,9,9,.62); backdrop-filter: blur(3px); }
.sheet form { padding: 26px 26px 22px; }
.sheet__eyebrow {
  margin: 0;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent);
}
.sheet h2 { margin: 8px 0 20px; font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45);
}
.field textarea {
  width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14.5px;
  padding: 10px 12px; outline: none; resize: vertical;
}
.field textarea:focus { border-color: var(--ink-25); }
.field textarea::placeholder { color: var(--ink-35); }
.field--date input {
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14.5px;
  padding: 9px 12px; outline: none;
  color-scheme: light dark;
}
.field--date input:focus { border-color: var(--ink-25); }

.sheet__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.sheet__actions--split { justify-content: space-between; }
.sheet__body { padding: 26px 26px 22px; }
.sheet--small { width: min(420px, calc(100vw - 32px)); }

.btn--danger { color: #c5533f; border-color: color-mix(in srgb, #c5533f 35%, transparent); }
.btn--danger:hover { color: #fff; background: #c5533f; border-color: #c5533f; }

/* ————————————————————————— sdílení a členové ————————————————————————— */

.field__label {
  margin: 0 0 8px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45);
}
.field__label--spaced { margin-top: 26px; }

.share__invite {
  padding: 15px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.share__code { display: flex; align-items: center; gap: 8px; }
.share__code code {
  flex: 1; min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-70);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share__code .btn { flex: none; }
.share__hint { margin: 10px 0 0; font-size: 12px; color: var(--ink-45); line-height: 1.5; }
.share__hint b { font-family: var(--mono); letter-spacing: .12em; color: var(--accent); }
.share__invite .linkbtn { margin: 8px 0 0; }

.members { list-style: none; margin: 0; padding: 0; }
.member {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.member:first-child { border-top: 0; }
.member__avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
}
.member__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member__info b { font-size: 14px; font-weight: 500; }
.member__info span {
  font-size: 12px; color: var(--ink-35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member__role {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-45);
}
.member__remove {
  flex: none;
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-35);
  font-size: 14px; cursor: pointer;
  transition: color .2s, background-color .2s;
}
.member__remove:hover { color: #c5533f; background: var(--line-soft); }

.tag--who { border-style: dashed; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ————————————————————————— toast ————————————————————————— */

/* Lišta pod hlavičkou. Drží si místo v layoutu (není fixed), takže nikdy
   nepřekryje ovládací prvky — a díky sticky zůstane vidět i při scrollování. */
.toast {
  position: sticky;
  /* sticky offset se počítá od margin boxu, proto se k výšce hlavičky (66px)
     přičítá i vlastní horní margin — jinak lišta zajede pod hlavičku */
  top: 90px;
  z-index: 30;
  display: flex; align-items: center; gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 9px 9px 9px 18px;
  /* Neutrální podklad — barevné je jen tlačítko, ne plocha kolem něj. */
  background: var(--bg-raise); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px -16px rgba(0,0,0,.45);
  font-size: 13.5px;
  animation: rise .25s cubic-bezier(.2,.9,.2,1);
}
.toast > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes rise { from { opacity: 0; transform: translateY(-10px); } }
.toast button {
  appearance: none; cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  padding: 7px 15px;
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  transition: filter .2s;
}
.toast button:hover { filter: brightness(1.12); }

/* ————————————————————————— mobil ————————————————————————— */

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 26px; }
  .brand__text b { display: none; }
  .brand { flex: none; }
  /* na mobilu zůstane jen tečka stavu — text by hlavičku roztrhal */
  .chip--store { padding: 8px; }
  .chip--store #storeLabel { display: none; }
  .switcher { flex: 1 1 auto; min-width: 0; }
  .switcher__btn { width: 100%; }
  .switcher__badge { display: none; }
  /* kotva zůstává na levé hraně přepínače — s `right: 0` by pop vylezl
     mimo obrazovku, protože přepínač začíná hned u loga */
  .menu__pop--wide { left: 0; right: auto; min-width: min(272px, calc(100vw - 40px)); }
  .sheet__body { padding: 22px 20px 18px; }
  .share__code { flex-direction: column; align-items: stretch; }
  .share__code .btn { justify-content: center; }
  .member__role { display: none; }
  .controls { flex-direction: column; align-items: stretch; }
  .search { justify-content: flex-start; }
  .search input { width: 100%; }
  .tabs { justify-content: space-between; }
  .tab { flex: 1; justify-content: center; padding: 9px 8px; }

  .quest { grid-template-columns: 36px 1fr; gap: 0 10px; padding: 18px 0; }
  .quest::before { left: 17px; top: 42px; }
  .quest__stop { width: 36px; }
  .quest__num { display: none; }
  .quest__acts { grid-column: 2; grid-row: 3; margin-top: 10px; margin-left: -6px; opacity: 1; }
  .quest__title { font-size: 17px; }
  .edit { grid-column: 2; }
  .compose__num { width: 40px; }
  .compose__more, .linkbtn { padding-left: 0; margin-left: 40px; }
  .compose__more { padding-right: 8px; }
}

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

/* ————————————————————————— stav, termín, komentáře ————————————————————————— */

.compose__due { display: flex; align-items: center; gap: 10px; }
.compose__due span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45); flex: none;
}
.compose__due input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; padding: 9px 12px; outline: none;
  color-scheme: light dark;
}
.compose__due input:focus { border-color: var(--ink-25); }

.edit__due { display: flex; align-items: center; gap: 10px; }
.edit__due span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45); flex: none;
}
.edit__due input {
  flex: 1;
  border: 1px solid var(--ink-25); border-radius: 10px;
  background: var(--bg-raise); color: var(--ink);
  font: inherit; padding: 9px 12px; outline: none;
  color-scheme: light dark;
}

.tag--planned {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.tag--due { border-style: dashed; }
.tag--due.is-soon { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag--due.is-late { color: #c5533f; border-color: color-mix(in srgb, #c5533f 45%, transparent); }

/* naplánované mají výraznější zastávku na trase */
.quest.is-planned .check { border-color: var(--accent); }
.act--plan.is-on { color: var(--accent); }
.act--chat[data-count] { position: relative; color: var(--accent); }
.act--chat[data-count]::after {
  content: attr(data-count);
  position: absolute; top: 1px; right: 1px;
  min-width: 13px; height: 13px; padding: 0 3px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: 8px; line-height: 1;
}

/* ————————————————————————— přetahování ————————————————————————— */

.quests.is-sortable .quest { cursor: grab; }
.quest.is-dragging { opacity: .45; cursor: grabbing; }
.quests.is-sortable .quest:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }

/* ————————————————————————— offline ————————————————————————— */

.offline {
  position: sticky; top: 74px; z-index: 31;
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 0;
  padding: 11px 16px;
  border: 1px solid color-mix(in srgb, #c5533f 40%, transparent);
  border-radius: 999px;
  background: var(--bg-raise);
  font-size: 13px; color: var(--ink-70);
}
.offline svg { width: 17px; height: 17px; flex: none; color: #c5533f; }
body.is-offline .compose form { opacity: .55; }

/* ————————————————————————— komentáře ————————————————————————— */

.chat {
  max-height: 46vh; overflow-y: auto;
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat__empty {
  margin: 0; padding: 18px 0; text-align: center;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-35);
}
.chat__item {
  padding: 10px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.chat__item--mine { border-left: 2px solid var(--accent); }
.chat__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.chat__head b { font-size: 12.5px; font-weight: 600; }
.chat__head span {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  color: var(--ink-35); flex: 1;
}
.chat__del {
  border: 0; background: transparent; color: var(--ink-25);
  font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 5px;
}
.chat__del:hover { color: #c5533f; background: var(--line-soft); }
.chat__item p { margin: 0; font-size: 14px; color: var(--ink-70); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ————————————————————————— graf v čase ————————————————————————— */

.timeline {
  display: grid; grid-template-columns: repeat(12, 1fr);
  align-items: end; gap: 5px;
  height: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 55%, transparent);
}
.timeline__col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.timeline__col i {
  display: block; width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--line);
  font-style: normal;
  font-family: var(--mono); font-size: 9px; color: var(--accent-ink);
  text-align: center; line-height: 1.6;
}
.timeline__col.has-value i { background: var(--accent); }
.timeline__col span {
  font-family: var(--mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-35);
}

@media (max-width: 600px) {
  .tab { padding: 9px 5px; font-size: 9px; letter-spacing: .06em; }
  .tab i { display: none; }
  .compose__due { flex-direction: column; align-items: stretch; gap: 6px; }
  .edit__due { flex-direction: column; align-items: stretch; gap: 6px; }
  .timeline { height: 118px; gap: 3px; padding: 10px 8px; }
  .timeline__col span { font-size: 7px; }
  .timeline__col i { font-size: 8px; }
}

/* ————————————————————————— profil ————————————————————————— */

.profile__head { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.profile__avatar {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--mono); font-size: 16px; font-weight: 600;
}
.profile__id { min-width: 0; }
.profile__id h2 { margin: 0 0 3px; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.profile__id p {
  margin: 0; font-size: 12.5px; color: var(--ink-35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.profile__bio {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  font-size: 14px; color: var(--ink-70); line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.profile__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.profile__stats .stat { padding: 12px 13px; }
.profile__stats .stat b { font-size: 21px; }

.profile__shared { margin-bottom: 18px; }
.profile__shared #profileSharedList { display: flex; flex-wrap: wrap; gap: 6px; }

.profile__photo {
  margin: 0 0 4px;
  font-size: 12px; line-height: 1.5; color: var(--ink-35);
}

.profile__danger { margin-top: 18px; }
.profile__row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.member__name {
  border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member__name:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 600px) {
  .profile__stats { grid-template-columns: 1fr; }
  .profile__row { justify-content: stretch; }
  .profile__row .btn { flex: 1; justify-content: center; }
}
