/* Vizuál podle koncertního webu a Instagramu Temere musicantes:
   černá #0e0e0c, Bebas Neue + Alata, hranaté prvky, oranžová / tyrkysová / fialová. */
:root {
  --bg: #0e0e0c;
  --surface: #171715;
  --surface-2: #22221f;
  --ink: #ffffff;
  --ink-2: rgb(255 255 255 / 62%);
  --ink-3: rgb(255 255 255 / 40%);
  --line: rgb(255 255 255 / 12%);
  --line-strong: rgb(255 255 255 / 85%);

  --orange: rgb(255 117 31);
  --cyan: rgb(12 192 223);
  --purple: rgb(203 108 230);

  --yes: #3fd68b;
  --partial: #ffc233;
  --maybe: #a9b4c8;
  --no: #ff5a5f;
  --none: rgb(255 255 255 / 14%);

  --display: "Bebas Neue", "Oswald", Impact, sans-serif;
  --font: "Alata", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  min-height: 100vh;
  letter-spacing: .01em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: none; }
.dim { color: var(--ink-3); }

/* ---------- hlavička s logem ---------- */
.top {
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
  border-bottom: 2px solid var(--line-strong);
}
.top-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 16px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
/* logo: TEMERE + notová osnova, pod tím MUSICANTES */
.logo { display: inline-flex; flex-direction: column; font-family: var(--display); line-height: .82; color: #fff; }
.logo .l1 { display: flex; align-items: center; gap: 3px; font-size: 25px; letter-spacing: .02em; }
.logo .l2 { font-size: 25px; letter-spacing: .02em; }
.logo .staff {
  flex: 1; align-self: stretch; min-width: 22px; margin: 1px 0 3px;
  background: repeating-linear-gradient(to bottom, #fff 0 2px, transparent 2px 4.2px);
}
.brand-sub {
  font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--ink-3);
  border-left: 1px solid var(--line); padding-left: 14px; line-height: 1.2;
}
.me-chip {
  flex-shrink: 0; background: rgb(0 0 0 / 40%); border: 1.5px solid rgb(255 255 255 / 50%);
  color: #fff; padding: 7px 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; max-width: 46vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-chip:hover { border-color: rgb(255 255 255 / 90%); }
.me-chip.empty { background: var(--orange); border-color: var(--orange); color: #0e0e0c; }
.tabs {
  max-width: 880px; margin: 0 auto; padding: 0 8px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.tabs button {
  background: none; border: 0; color: var(--ink-3); font-family: var(--display); font-size: 20px; letter-spacing: .06em;
  padding: 6px 8px 7px; border-bottom: 3px solid transparent; white-space: nowrap; line-height: 1;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button[aria-current="page"] { color: #fff; border-bottom-color: var(--orange); }
.tabs button[hidden] { display: none; }
@media (max-width: 420px) { .brand-sub { display: none; } }

/* ---------- obecné ---------- */
main { padding-top: 18px; padding-bottom: 32px; }
.loading, .empty-state { color: var(--ink-3); text-align: center; padding: 40px 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.btn {
  background: rgb(0 0 0 / 40%); border: 1.5px solid rgb(255 255 255 / 50%); color: #fff;
  padding: 8px 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: rgb(0 0 0 / 60%); border-color: rgb(255 255 255 / 90%); }
.btn.primary { background: #fff; color: #0e0e0c; border-color: #fff; }
.btn.primary:hover { background: var(--orange); border-color: var(--orange); }
.btn.danger { color: var(--no); border-color: var(--no); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.link:hover { color: #fff; }
.muted { color: var(--ink-3); }
.pill-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
input[type=checkbox] { accent-color: var(--orange); }

.banner {
  background: var(--orange); color: #0e0e0c; padding: 14px 16px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.banner .btn { background: #0e0e0c; color: #fff; border-color: #0e0e0c; }

.month {
  font-family: var(--display); font-size: 30px; letter-spacing: .06em; color: #fff; line-height: 1;
  margin: 28px 0 10px; display: flex; align-items: baseline; gap: 10px;
}
.month::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.month .dim { font-size: 22px; }

/* ---------- karta akce (kompaktní řádek) ---------- */
.event {
  --tone: transparent;
  position: relative;
  background: color-mix(in srgb, var(--tone) 55%, var(--surface));
  border: 1px solid var(--line);
  padding: 10px 12px; margin-bottom: 8px;
}
.event.t-concert { --tone: var(--orange); border-color: transparent; }
.event.t-dress { --tone: var(--purple); border-color: transparent; }
.event.t-special { --tone: var(--cyan); border-color: transparent; }
.event.is-next:not(.t-concert, .t-dress, .t-special) { border: 2px solid var(--line-strong); }
.event.cancelled { background: var(--surface); border: 1px dashed var(--line); }
.event.cancelled .ev-date, .event.cancelled .ev-prog, .event.cancelled .type { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-3); }
.event.past { opacity: .75; }

.ev-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.ev-date { font-family: var(--display); line-height: .85; min-width: 54px; white-space: nowrap; }
.ev-date .day { font-size: 40px; }
.ev-date .mon { font-size: 22px; color: rgb(255 255 255 / 45%); }
.ev-date .wd { display: block; font-family: var(--font); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.ev-info { min-width: 0; padding-top: 2px; }
.ev-line1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; line-height: 1.15; }
.ev-line1 .type { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.ev-line1 .time { font-family: var(--display); font-size: 20px; letter-spacing: .04em; line-height: .9; }
.ev-prog { font-weight: 700; font-size: 15px; line-height: 1.25; margin-top: 3px; overflow-wrap: anywhere; }
.venue {
  display: block; margin-top: 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.venue::before { content: "↗ "; }
.venue:hover { color: #fff; }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ev-count { text-align: center; line-height: .85; }
.ev-count b { display: block; font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--yes); }
.t-concert .ev-count b, .t-dress .ev-count b, .t-special .ev-count b { color: #fff; }
.ev-count span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.icon-btn { background: rgb(0 0 0 / 35%); border: 1.5px solid rgb(255 255 255 / 40%); color: #fff; width: 30px; height: 30px; padding: 0; font-size: 14px; }
.icon-btn:hover { border-color: #fff; }
.ev-note { margin: 8px 0 0; padding: 5px 9px; background: rgb(0 0 0 / 35%); border-left: 3px solid #fff; font-size: 13px; white-space: pre-line; }
.badge {
  display: inline-block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  padding: 3px 6px 2px; border: 1.5px solid rgb(255 255 255 / 70%);
}
.badge.cancel { background: var(--no); border-color: var(--no); color: #0e0e0c; }
.badge.next { background: #fff; border-color: #fff; color: #0e0e0c; }

/* souhrn odpovědí */
.bar { display: flex; height: 5px; background: var(--none); gap: 2px; }
.bar span { display: block; min-width: 0; }
.bar .yes { background: var(--yes); }
.bar .partial { background: var(--partial); }
.bar .maybe { background: var(--maybe); }
.bar .no { background: var(--no); }
.bar .none { background: transparent; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; vertical-align: 1px; }
.dot.yes { background: var(--yes); } .dot.partial { background: var(--partial); } .dot.maybe { background: var(--maybe); } .dot.no { background: var(--no); } .dot.none { background: var(--none); }

/* moje odpověď */
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 34px; gap: 5px; margin-top: 9px; }
.seg .note-btn { font-size: 15px; letter-spacing: 0; color: var(--ink-2); }
.seg .note-btn.has { color: #fff; border-color: #fff; }
.seg button {
  background: rgb(0 0 0 / 40%); border: 1.5px solid rgb(255 255 255 / 40%); color: #fff;
  padding: 0 2px; min-height: 36px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 5px; line-height: 1.05; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.seg button:hover { border-color: rgb(255 255 255 / 90%); }
.seg button .sym { font-size: 15px; line-height: 1; letter-spacing: 0; }
.seg button[aria-pressed="true"] { color: #0e0e0c; border-color: #fff; font-weight: 700; }
.seg button[aria-pressed="true"].yes { background: var(--yes); }
.seg button[aria-pressed="true"].partial { background: var(--partial); }
.seg button[aria-pressed="true"].maybe { background: var(--maybe); }
.seg button[aria-pressed="true"].no { background: var(--no); }
@media (max-width: 400px) { .seg button { font-size: 9.5px; letter-spacing: .04em; gap: 3px; } .seg button .sym { font-size: 13px; } }
@media (max-width: 340px) { .seg button { flex-direction: column; gap: 1px; } }
.note-row { margin-top: 6px; display: flex; gap: 6px; }
.note-row input { flex: 1; min-width: 0; padding: 7px 10px; }
.ev-foot { margin-top: 4px; }
.link.small { font-size: 12px; text-decoration: none; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.link.small:hover { color: #fff; }
input[type=text], input[type=date], input[type=number], input[type=password], select, textarea {
  width: 100%; border: 1.5px solid rgb(255 255 255 / 30%); background: rgb(0 0 0 / 40%); color: #fff;
  border-radius: 0; padding: 9px 11px; font-size: 16px; /* iOS nezoomuje */
}
input::placeholder, textarea::placeholder { color: rgb(255 255 255 / 40%); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
select option { background: var(--surface); }

/* kdo přijde */
details.who { margin-top: 8px; }
details.who summary {
  cursor: pointer; list-style: none; display: grid; grid-template-columns: minmax(40px, 1fr) auto auto; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-2);
}
details.who summary:hover { color: #fff; }
.tally-short { display: flex; gap: 8px; white-space: nowrap; }
.who-lbl { letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.who-lbl::before { content: "+ "; }
details.who[open] .who-lbl::before { content: "− "; }
details.who summary::-webkit-details-marker { display: none; }
.who-sec { margin-top: 12px; }
.who-sec h4 { margin: 0 0 6px; font-family: var(--display); font-size: 18px; letter-spacing: .06em; font-weight: 400; line-height: 1; }
.who-sec h4 small { font-family: var(--font); font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }
.who-list { display: flex; flex-wrap: wrap; gap: 5px; }
.who-item { font-size: 13px; padding: 3px 8px; background: rgb(0 0 0 / 35%); border-left: 3px solid var(--none); }
.who-item.yes { border-left-color: var(--yes); }
.who-item.partial { border-left-color: var(--partial); }
.who-item.maybe { border-left-color: var(--maybe); }
.who-item.no { border-left-color: var(--no); color: var(--ink-3); text-decoration: line-through; }
.who-item.none { color: var(--ink-3); background: transparent; border: 1px dashed rgb(255 255 255 / 25%); }
.who-notes { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.who-notes li { margin: 4px 0; }
.who-notes b { color: #fff; }
.ev-admin { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---------- tabulka ---------- */
.grid-scroll {
  overflow: auto; border: 1px solid var(--line); background: var(--surface);
  max-height: calc(100vh - 190px); -webkit-overflow-scrolling: touch;
}
table.grid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; font-weight: 400; }
.grid thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 6px 4px 5px;
  min-width: 60px; vertical-align: bottom; line-height: 1; white-space: nowrap;
  font-family: var(--display); font-size: 19px; letter-spacing: .04em;
}
.grid thead th.t-concert { background: color-mix(in srgb, var(--orange) 55%, var(--surface)); }
.grid thead th.t-dress { background: color-mix(in srgb, var(--purple) 55%, var(--surface)); }
.grid thead th.t-special { background: color-mix(in srgb, var(--cyan) 55%, var(--surface)); }
.grid thead th.cancelled { text-decoration: line-through; color: var(--ink-3); }
.grid thead th .t { font-family: var(--font); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; display: block; color: rgb(255 255 255 / 60%); margin-bottom: 3px; }
.grid thead th .d { display: block; }
.grid thead th .tm, .grid thead th .pl {
  display: block; font-family: var(--font); font-size: 10.5px; letter-spacing: .02em; line-height: 1.2;
  white-space: normal; overflow-wrap: normal; word-break: normal; color: rgb(255 255 255 / 75%); margin-top: 3px;
}
.grid thead th .pl { color: rgb(255 255 255 / 55%); text-transform: uppercase; font-size: 9.5px; letter-spacing: .06em; }
.grid thead th:not(.name) { max-width: 130px; vertical-align: top; }
.grid thead th .tm { white-space: nowrap; }
.grid thead th .tm.long { white-space: normal; }
.grid thead th button { background: none; border: 0; padding: 0; width: 100%; }
.grid .name {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px 10px;
  white-space: nowrap; min-width: 96px; max-width: 36vw; overflow: hidden; text-overflow: ellipsis;
}
.grid thead th.name { z-index: 3; font-family: var(--font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.grid tr.me .name { background: #fff; color: #0e0e0c; font-weight: 700; }
.grid tr.sec th, .grid tr.sec td { background: var(--bg); }
.grid tr.sec th.name { padding: 8px 10px 4px; font-family: var(--display); font-size: 18px; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.grid td button {
  width: 100%; height: 34px; border: 0; background: none; font-size: 15px; font-weight: 700; position: relative; color: inherit;
}
.grid td button:disabled { cursor: default; }
.grid td.yes { background: color-mix(in srgb, var(--yes) 22%, transparent); color: var(--yes); }
.grid td.partial { background: color-mix(in srgb, var(--partial) 22%, transparent); color: var(--partial); }
.grid td.maybe { background: color-mix(in srgb, var(--maybe) 18%, transparent); color: var(--maybe); }
.grid td.no { background: color-mix(in srgb, var(--no) 20%, transparent); color: var(--no); }
.grid td .has-note::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; background: #fff; }
.grid tfoot td { position: sticky; bottom: 0; background: var(--surface-2); padding: 6px 2px 4px; color: var(--yes); font-family: var(--display); font-size: 20px; line-height: 1; }
.grid tfoot td.name { color: var(--ink-2); font-family: var(--font); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); margin: 10px 2px; }

/* ---------- členové / historie ---------- */
.card { background: var(--surface); border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }
.card h2 { font-family: var(--display); font-size: 28px; letter-spacing: .06em; line-height: 1; margin-bottom: 10px; }
.member-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-row.inactive input[type=text] { color: var(--ink-3); }
.member-row label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
@media (max-width: 600px) { .member-row { grid-template-columns: 1fr 1fr; } }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log time { color: var(--ink-3); font-size: 12px; display: block; letter-spacing: .04em; }

/* ---------- hromadné mazání v tabulce ---------- */
.select-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border: 1.5px solid var(--no); padding: 10px 12px; margin-bottom: 12px; font-size: 14px;
}
.btn.danger-fill { background: var(--no); border-color: var(--no); color: #0e0e0c; font-weight: 700; }
.btn.danger-fill:disabled { background: transparent; color: var(--no); }
.grid thead th .sel { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding-top: 2px; }
.grid thead th .sel input { width: 16px; height: 16px; margin: 0; accent-color: var(--no); }
.grid thead th.picked { background: var(--no); color: #0e0e0c; }
.grid thead th.picked .t { color: #0e0e0c; }
.grid td.picked { box-shadow: inset 0 0 0 999px rgb(255 90 95 / 18%); }

/* ---------- hromadné termíny ---------- */
.toolbar-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.repeat { display: grid; gap: 10px; padding: 12px; border: 1.5px dashed rgb(255 255 255 / 25%); }
.repeat [hidden] { display: none !important; }
.dates-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.dates-preview:empty { display: none; }
.date-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 5px 9px 4px; cursor: pointer;
  border: 1.5px solid rgb(255 255 255 / 45%); font-family: var(--display); font-size: 17px !important; letter-spacing: .05em !important;
  color: #fff !important; text-transform: uppercase; line-height: 1; }
.date-chip input { width: 14px; height: 14px; margin: 0; }
.date-chip:has(input:not(:checked)) { opacity: .4; text-decoration: line-through; }
.date-chip.busy { border-color: var(--partial); }
.extra-date { display: flex; gap: 6px; }
.extra-date input { flex: 1; min-width: 0; }

/* ---------- dialog ---------- */
dialog {
  border: 2px solid var(--line-strong); border-radius: 0; padding: 0; width: min(520px, calc(100vw - 24px));
  background: var(--bg); color: #fff; max-height: calc(100dvh - 24px); overflow-x: hidden;
}
dialog::backdrop { background: rgb(0 0 0 / 70%); }
.dlg { padding: 20px 18px 16px; }
.dlg h2 { font-family: var(--display); font-size: 38px; letter-spacing: .05em; line-height: .9; margin-bottom: 6px; }
.dlg .sub { color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.form label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.form .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form label, .form input, .form select, .form textarea { min-width: 0; }
.form .check { display: flex; align-items: center; gap: 8px; font-size: 15px; letter-spacing: .02em; text-transform: none; color: #fff; }
.form .check input { width: 20px; height: 20px; }
.form p.muted { font-size: 13px; margin: 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.dlg-actions .spacer { flex: 1; }
.pick-sec { margin: 14px 0 6px; font-family: var(--display); font-size: 20px; letter-spacing: .08em; line-height: 1; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.pick button { text-align: left; border: 1.5px solid rgb(255 255 255 / 25%); background: var(--surface); padding: 10px 12px; }
.pick button:hover { border-color: #fff; }
.pick button[aria-pressed="true"] { background: #fff; color: #0e0e0c; border-color: #fff; font-weight: 700; }

#toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: #0e0e0c; padding: 10px 16px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; z-index: 50;
  max-width: calc(100vw - 32px);
}
#toast.error { background: var(--no); }

.foot { text-align: center; padding-bottom: 32px; font-size: 13px; }

@media (min-width: 700px) {
  .event { padding: 12px 16px; }
  .ev-date .day { font-size: 46px; }
  .seg { max-width: 560px; }
  .logo .l1, .logo .l2 { font-size: 30px; }
}
