/* =====================================================================
   Noty skupiny – dizajn „Notový rukopis“
   Grafit a notový papier, jediná výrazná farba je červená ceruzka
   (to, čo sa deje teraz: aktívne, pripnuté, hrať). Podpis: notová osnova
   pod nadpismi a skúškové značky (rámčekové čísla) v poradí skladieb.
   Tmavý režim = pódium, svetlý = slnko. Prepína sa ikonou v lište.
   ===================================================================== */
:root {
  /* papier (svetlý režim, slnko) */
  --bg: #edf1f0;
  --card: #fbfcfc;
  --sunken: #e2e8e7;
  --ink: #131a21;
  --muted: #56626d;
  --line: #cdd6da;
  --line-strong: #9eaeb9;
  --staff: #b5c3cc;
  --accent: #c0342a;          /* červená ceruzka */
  --accent-ink: #ffffff;
  --accent-soft: #f6dcd8;
  --accent-text: #a52a21;
  --blue: #2d64a8;            /* modrá ceruzka – skúšky */
  --violet: #6a5a98;
  --ok: #237046;
  --warn: #8f5300;
  --warn-soft: #f6e6c8;
  --danger: #b42318;
  /* lišta (grafit v oboch režimoch) */
  --rail: #151c23;
  --rail-ink: #dce4e9;
  --rail-muted: #8e9ca8;
  --rail-hover: #222c36;
  --shadow: 0 6px 20px -8px rgb(19 26 33 / .28), 0 2px 4px -2px rgb(19 26 33 / .12);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  --rail-w: 232px;
  --tabbar-h: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1116; --card: #151b22; --sunken: #10151b; --ink: #e8edf1; --muted: #98a6b2;
    --line: #26313c; --line-strong: #3a4957; --staff: #2c3946;
    --accent: #ff6b57; --accent-ink: #1c0805; --accent-soft: #3a1a16; --accent-text: #ff8a79;
    --blue: #74a7ea; --violet: #a897db; --ok: #5fc78c; --warn: #f0ad4e; --warn-soft: #33270f; --danger: #ff7a6e;
    --rail: #090c10; --rail-ink: #dce4e9; --rail-muted: #7f8d99; --rail-hover: #161d25;
    --shadow: 0 8px 24px -8px rgb(0 0 0 / .6), 0 2px 4px -2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1116; --card: #151b22; --sunken: #10151b; --ink: #e8edf1; --muted: #98a6b2;
  --line: #26313c; --line-strong: #3a4957; --staff: #2c3946;
  --accent: #ff6b57; --accent-ink: #1c0805; --accent-soft: #3a1a16; --accent-text: #ff8a79;
  --blue: #74a7ea; --violet: #a897db; --ok: #5fc78c; --warn: #f0ad4e; --warn-soft: #33270f; --danger: #ff7a6e;
  --rail: #090c10; --rail-ink: #dce4e9; --rail-muted: #7f8d99; --rail-hover: #161d25;
  --shadow: 0 8px 24px -8px rgb(0 0 0 / .6), 0 2px 4px -2px rgb(0 0 0 / .4);
  color-scheme: dark;
}
@media (pointer: coarse) { :root { --tap: 52px; } }

/* ---------- základ ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  caret-color: var(--accent);
}
@media (pointer: coarse) { body { font-size: 17px; } }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent-text); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem); line-height: 1.15; font-weight: 750; letter-spacing: -.025em;
  margin: .25rem 0 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; text-wrap: balance;
}
/* Podpis: notová osnova pod nadpisom stránky */
h1::after {
  content: ""; flex-basis: 100%; height: 13px; margin-top: .45rem;
  background: repeating-linear-gradient(to bottom, var(--staff) 0 1px, transparent 1px 3px);
  -webkit-mask: linear-gradient(to right, #000 0 70%, transparent);
          mask: linear-gradient(to right, #000 0 70%, transparent);
}
h2 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .85rem; }
h3 { font-weight: 650; }

/* ---------- lišta: PC = grafitová lišta vľavo, tablet a mobil = hore + navigácia dole ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20; background: var(--rail); color: var(--rail-ink);
  display: flex; align-items: center; gap: .5rem; min-height: 56px;
  padding: max(.4rem, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) .4rem max(16px, env(safe-area-inset-left));
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--rail-ink); text-decoration: none; font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; min-width: 0; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 30px; height: 22px; flex: none; }
.brand-mark path { stroke: var(--rail-muted); stroke-width: 1; fill: none; }
.brand-mark ellipse { fill: var(--accent); }

.who { display: flex; align-items: center; gap: .15rem; color: var(--rail-muted); font-size: .9rem; }
.who-name { padding: 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 44px; min-height: 44px; padding: 0 .6rem; border-radius: var(--radius-sm); border: 0; background: none;
  color: var(--rail-ink); font: inherit; cursor: pointer; text-decoration: none;
}
.icon-btn:hover, .icon-btn.active { background: var(--rail-hover); }
.btn-link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.nav-badge {
  position: absolute; top: 4px; right: 2px; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--rail);
}

.mainnav a {
  display: flex; align-items: center; gap: .75rem; color: var(--rail-muted); text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 600; position: relative;
}
.mainnav a:hover { color: var(--rail-ink); background: var(--rail-hover); }
.mainnav a.active { color: var(--rail-ink); background: var(--rail-hover); }
.mainnav a.active .icon { color: var(--accent); }

/* PC: lišta vľavo */
@media (min-width: 1024px) {
  .appbar {
    position: fixed; inset: 0 auto 0 0; width: var(--rail-w); flex-direction: column; align-items: stretch;
    padding: 1.1rem .85rem 1rem; gap: 1.25rem;
  }
  .brand { margin: 0 0 .25rem .45rem; font-size: 1.1rem; }
  .mainnav { display: grid; gap: .2rem; }
  .mainnav a { min-height: 46px; padding: 0 .85rem; }
  .mainnav a.active::before { content: ""; position: absolute; left: -.85rem; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .who { margin-top: auto; flex-wrap: wrap; border-top: 1px solid var(--rail-hover); padding-top: .85rem; gap: .25rem; }
  .who-name { flex-basis: 100%; order: -1; padding: 0 .5rem .4rem; color: var(--rail-ink); font-weight: 600; max-width: none; }
  .who-members { display: none; }
  .logout { margin-left: auto; }
  body:has(#topbar:not([hidden])) .page { margin-left: calc(var(--rail-w) + max(0px, (100vw - var(--rail-w) - 1000px) / 2)); }
}
/* Tablet a mobil: navigácia dole, na dosah palca */
@media (max-width: 1023.98px) {
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--rail);
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--rail-hover);
  }
  .mainnav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 4px 2px; font-size: .74rem; font-weight: 600; text-align: center; }
  .mainnav a > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mainnav a.active { background: none; }
  .mainnav a.active::before { content: ""; position: absolute; top: -6px; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .who-members { display: none; }
  .logout-label { display: none; }
  body:has(#topbar:not([hidden])) .page { padding-bottom: calc(var(--tabbar-h) + 2.5rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 599.98px) {
  .nav-members { display: none !important; }
  .who-members { display: inline-flex; }
  .who-name { display: none; }
  .mainnav { padding-left: max(2px, env(safe-area-inset-left)); padding-right: max(2px, env(safe-area-inset-right)); }
  .mainnav a { font-size: 11px; letter-spacing: -.015em; padding: 4px 0; }
  .tabs a { padding: 0 .75rem; }
}

/* Režim vystúpenia: len noty, žiadna lišta */
body.stage .appbar { display: none !important; }
body.stage .page { margin-left: 0 !important; padding-bottom: 0 !important; }

/* ---------- stránka a karty ---------- */
.page { max-width: 1000px; margin: 0 auto; padding: 1.5rem max(16px, env(safe-area-inset-right)) 4rem max(16px, env(safe-area-inset-left)); outline: none; }
@media (min-width: 1024px) { .page { padding: 2.25rem 2.5rem 4rem; } body:has(#topbar:not([hidden])) .page { margin-right: 0; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin: 0 0 1rem; }
@media (min-width: 700px) { .card { padding: 1.35rem 1.5rem; } }
.muted-card { opacity: .85; }
details.card > summary {
  cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; align-items: center; gap: .6rem;
  min-height: 44px; margin: -.35rem 0;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: ""; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .2s cubic-bezier(.2, .8, .2, 1); flex: none; margin: 0 .2rem;
}
details.card[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; margin: .25rem 0; font-weight: 550; }
.note { white-space: pre-wrap; background: var(--sunken); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.warn { color: var(--warn); font-weight: 650; }
.place { display: inline-flex; align-items: center; gap: .4rem; margin: .4rem 0; }
.place .icon { width: 20px; height: 20px; color: var(--muted); }

/* ---------- tlačidlá ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: .5rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn.danger, .btn-icon.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.small-btn { min-height: 44px; padding: .3rem .85rem; font-size: .9rem; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 1.15rem; cursor: pointer; text-decoration: none; padding: 0;
}
.btn-icon:hover { border-color: var(--line-strong); }
.btn-icon:disabled { opacity: .3; cursor: default; }
.btn-icon .icon { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.25rem; align-items: center; }
.card .actions { margin: 1.1rem 0 0; }
.actions > a:not(.btn) { font-weight: 650; display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- formuláre ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field-label { font-weight: 650; font-size: .92rem; }
.field-hint { color: var(--muted); font-size: .82rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .6rem .8rem; min-height: var(--tap);
  transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type=search] { padding-left: 2.6rem; background: var(--card) no-repeat .85rem 50% / 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e9ca8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10.5 17a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13zM15.5 15.5l4.5 4.5'/%3E%3C/svg%3E"); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: .65rem; align-items: center; min-height: 44px; font-weight: 550; }
.form-error { color: var(--danger); margin: 0; font-weight: 600; }
.form-error:empty { display: none; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: 1 / -1; } }

/* ---------- prihlásenie ---------- */
.login { max-width: 440px; margin: 10vh auto 0; display: grid; gap: .9rem; padding: 2rem 1.75rem; }
.login h1 { font-size: 1.9rem; justify-content: center; text-align: center; }
.login h1::after { -webkit-mask: linear-gradient(to right, transparent, #000 20% 80%, transparent); mask: linear-gradient(to right, transparent, #000 20% 80%, transparent); }
.login > p { text-align: center; margin: 0; }
.login .field { text-align: left; }
.login .btn { width: 100%; min-height: 54px; font-size: 1.05rem; }
.code-input { font-size: 1.5rem; font-weight: 650; letter-spacing: .14em; text-align: center; text-transform: uppercase; min-height: 60px; }

/* ---------- zoznamy ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); padding: .7rem 0; }
.list > li:first-child { border-top: 0; padding-top: .2rem; }
.list > li:last-child { padding-bottom: .1rem; }
.row { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.row-link { display: grid; gap: .15rem; text-decoration: none; color: inherit; flex: 1; min-width: 12rem; min-height: 44px; align-content: center;
  margin: -.35rem -.6rem; padding: .35rem .6rem; border-radius: var(--radius-sm); transition: background-color .15s; }
a.row-link:hover { background: var(--sunken); text-decoration: none; }
.row-link strong { font-size: 1.05rem; font-weight: 650; }
.row-main { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; flex: 1; }
.row-sub { color: var(--muted); font-size: .9rem; flex-basis: 100%; }
.row.cancelled strong { text-decoration: line-through; opacity: .7; }
.badge {
  display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 650; line-height: 1;
  padding: .3rem .55rem; border-radius: 99px; background: var(--sunken); color: var(--muted); border: 1px solid var(--line);
}
.badge .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge-ok { color: var(--ok); }

/* segmentové prepínače */
.tabs { display: inline-flex; gap: 2px; margin: 0 0 1.1rem; padding: 3px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 1rem; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 0 0 1px var(--line); }

/* ---------- harmonogram: skúškové značky ---------- */
.setlist { margin: 0; padding: 0; list-style: none; counter-reset: rehearsal; }
.setlist > li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.setlist > li:last-child { border-bottom: 0; }
.setlist:not(.edit) > li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .85rem; align-items: baseline; }
.setlist:not(.edit) > li > :not(:first-child) { grid-column: 2; }
.setlist:not(.edit) > li::before { counter-increment: rehearsal; content: counter(rehearsal); grid-row: span 3; }
.setlist:not(.edit) > li::before, .set-pos {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .3rem;
  border: 2px solid var(--ink); border-radius: 3px; font-weight: 800; font-size: .95rem; color: var(--ink); align-self: start; flex: none;
}
.set-pos { align-self: center; }
.setlist:not(.edit) > li:first-child::before { border-color: var(--accent); color: var(--accent-text); }
.setlist a { font-weight: 650; font-size: 1.1rem; }
.label-item { font-style: italic; color: var(--muted); }
.item-note { display: block; color: var(--muted); font-size: .9rem; }
.setlist.edit > li { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: .6rem; align-items: center; }
.item-title { font-weight: 650; display: flex; gap: .4rem; align-items: center; }
.item-buttons { display: flex; gap: .35rem; flex-wrap: wrap; }
@media (max-width: 640px) { .setlist.edit > li { grid-template-columns: 1fr auto; } .item-note-input { grid-column: 1 / -1; grid-row: 2; } }
.add-row { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: .6rem; margin-top: 1rem; }
@media (max-width: 640px) { .add-row { grid-template-columns: 1fr; } }

.code-card { background: var(--card); border: 2px dashed var(--accent); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 1rem; }
.code-card p { margin: .3rem 0; }
.code { font: 800 2rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; user-select: all; }

/* ---------- prehliadač nôt ---------- */
.viewer { margin-top: 1.1rem; background: var(--sunken); border-radius: var(--radius); padding: .6rem; }
.viewer:fullscreen { background: var(--bg); padding: .6rem; display: flex; flex-direction: column; }
.viewer-bar { display: flex; gap: .5rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: .6rem; }
.viewer-counter { min-width: 8rem; text-align: center; font-weight: 650; }
.viewer-stage { display: flex; justify-content: center; align-items: flex-start; min-height: 200px; overflow: auto; flex: 1; }
.viewer-page { background: #fff; box-shadow: var(--shadow); max-width: 100%; height: auto; border-radius: 2px; }
img.viewer-page { max-height: calc(100vh - 180px); object-fit: contain; }
.viewer:fullscreen img.viewer-page { max-height: calc(100vh - 70px); }

.toast {
  position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .8rem 1.2rem; border-radius: 12px; z-index: 50; font-weight: 600;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow); animation: toast-in .25s cubic-bezier(.2, .8, .2, 1);
}
@media (max-width: 1023.98px) { body:has(#topbar:not([hidden])):not(.stage) .toast { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); } }
.toast-error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ===== Nástenka, kalendár, novinky ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.posts { display: grid; gap: .75rem; }
.post { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.05rem; background: var(--card); }
.card .post { background: var(--bg); border-color: transparent; }
.post.pinned, .card .post.pinned { background: var(--card); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.post-title { margin: .25rem 0 .2rem; font-size: 1.1rem; letter-spacing: -.01em; }
.post-body { white-space: pre-wrap; margin: .3rem 0; overflow-wrap: anywhere; max-width: 70ch; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { color: var(--muted); font-size: .84rem; margin: .45rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; }
.post-link { font-weight: 650; display: inline-flex; align-items: center; gap: .3rem; }
.post-link .icon { width: 16px; height: 16px; }
.post-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.badge-pin { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.badge-new { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.btn-link-dark { background: none; border: 0; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 600; padding: .6rem 0; min-height: 44px; }
.sub-details { margin-top: 1rem; }
.sub-details > summary { cursor: pointer; font-weight: 650; color: var(--accent-text); margin-bottom: .6rem; min-height: 44px; display: flex; align-items: center; }

.notif.unread { background: color-mix(in srgb, var(--accent) 8%, transparent); margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 700px) { .notif.unread { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; } }
.notif-icon { width: 1.6rem; display: inline-flex; justify-content: center; color: var(--muted); }
.notif-icon .icon { width: 20px; height: 20px; }
.notif.unread .notif-icon { color: var(--accent); }
.notif-sub { white-space: pre-wrap; color: var(--ink); opacity: .8; }

.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.cal-title { margin: 0; min-width: 10rem; text-align: center; text-transform: capitalize; font-size: 1.25rem; }
.cal-arrow { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.cal-tabs { margin: 0 0 0 auto; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); margin: 0 0 .85rem; }
.cal-dot::before { content: ""; display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; background: var(--kind); }
.kind-vystupenie { --kind: var(--accent); --kind-ink: var(--accent-ink); }
.kind-skuska { --kind: var(--blue); --kind-ink: #fff; }
.kind-ine { --kind: var(--violet); --kind-ink: #fff; }
:root[data-theme="dark"] .kind-skuska, :root[data-theme="dark"] .kind-ine { --kind-ink: #0d1116; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.kind-skuska, .kind-ine) { --kind-ink: #0d1116; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font-size: .78rem; font-weight: 750; color: var(--muted); padding: .25rem 0 .4rem; letter-spacing: .02em; }
.cal-cell { min-height: 6rem; border: 1px solid var(--line); border-radius: 10px; padding: .3rem; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--card); }
.cal-cell.empty { border: 0; background: none; }
.cal-cell.weekend { background: var(--sunken); }
.cal-cell.past { opacity: .55; }
.cal-cell.today { border: 2px solid var(--accent); }
.cal-day { font-size: .82rem; font-weight: 750; color: var(--muted); padding: 0 .15rem; }
.cal-cell.today .cal-day { color: var(--accent-text); }
.cal-event { display: block; font-size: .76rem; font-weight: 600; line-height: 1.25; padding: .25rem .35rem; border-radius: 6px; text-decoration: none;
  color: var(--kind-ink); background: var(--kind); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { text-decoration: none; filter: brightness(1.08); }
.cal-event.cancelled { background: transparent; color: var(--muted); border: 1px dashed var(--muted); text-decoration: line-through; }
.cal-time { font-weight: 800; }
@media (max-width: 640px) {
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 4rem; padding: 2px; border-radius: 6px; }
  .cal-event { font-size: .66rem; padding: .12rem .2rem; border-radius: 4px; }
  .cal-time { display: none; }
  .cal-tabs { margin: 0; flex-basis: 100%; }
  .cal-title { min-width: 0; flex: 1; }
}

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

/* ---------- offline: indikátor, sťahovanie nôt, úložisko ---------- */
.net-pill {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .7rem; border-radius: 99px;
  font-size: .8rem; font-weight: 650; text-decoration: none; color: var(--rail-ink); background: var(--rail-hover); white-space: nowrap;
}
.net-pill:hover { text-decoration: none; filter: brightness(1.15); }
.net-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); flex: none; }
[data-state="off"] > .net-dot { background: var(--warn); }
[data-state="sync"] > .net-dot { background: var(--blue); animation: net-pulse 1s ease-in-out infinite alternate; }
[data-state="warn"] > .net-dot { background: var(--danger); }
@keyframes net-pulse { from { opacity: 1; } to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { [data-state="sync"] > .net-dot { animation: none; } }
.net-pill.compact { background: var(--sunken); color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 599.98px) { .appbar .net-pill .net-text { display: none; } .appbar .net-pill { min-width: 36px; justify-content: center; padding: 0; } }
@media (max-width: 899.98px) { .net-pill.compact .net-text { display: none; } .net-pill.compact { padding: 0 .6rem; } }
@media (min-width: 1024px) { .who .net-pill { flex-basis: 100%; order: -2; justify-content: flex-start; margin-bottom: .25rem; } }
.net-big { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; margin: 0 0 .5rem; }
.net-big .net-dot { width: .85rem; height: .85rem; }

.dl-panel { margin-top: .9rem; display: grid; gap: .5rem; }
.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.dl-info.dl-ok { color: var(--ok); }
.dl-bar, .meter { width: 100%; height: 10px; accent-color: var(--accent); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.gal-missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
  width: 100%; height: 100%; padding: 1.5rem; background: var(--sunken); color: var(--muted); border: 2px dashed var(--line-strong);
}
.gal-missing strong { color: var(--ink); font-size: 1.1rem; }
