/* Organize: the page's stylesheet. Mobile-first: the base rules are the PHONE layout; media queries add the
   tablet (700px+) and desktop (1100px+) layouts.

   COLOURS: never write a colour directly in a rule. Every colour is a variable defined in `:root` (light
   theme) and overridden in `:root[data-theme="dark"]` (dark theme, black background). The page is light
   unless the user picked dark (theme.js sets data-theme before the first paint).

   CONTENTS (search for the line)
     variables and dark theme   hidden-attribute rule        top bar and page frame
     forms and buttons          task board                   shopping cart
     remarks (urgency colours)  bottom navigation (phones)   popup
     toast                      top bar actions              login screen
     list switcher              popups: sharing, admin       tablet layout
     desktop layout             "new" marks (notifications)  theme button

   The administrator documentation viewer has its own file, docs.css. */

:root {
  color-scheme: light;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1c2333;
  --muted: #657089;
  --border: #dfe3ec;
  --accent: #2f5fe3;
  --accent-strong: #2449b8;
  --accent-soft: #e8eefe;
  --accent-border: #cbd8fb;
  --danger: #c8323f;
  --danger-soft: #fdecee;
  --short: #d9822b;
  --long: #2e9d6a;

  --field: #ffffff;            /* background of inputs */
  --focus: #2f5fe3;            /* keyboard focus ring */
  --on-accent: #ffffff;        /* text on the primary (blue) button */
  --accent-hover: #2449b8;
  --danger-border: #f0c2c7;
  --star: #d08a12;
  --ok-bg: #e8f6ee; --ok-border: #bfe3cd; --ok-text: #1d6b43;
  --badge-bg: #c8323f; --badge-text: #ffffff;
  --toast-bg: #1c2333; --toast-text: #ffffff; --toast-border: rgba(255, 255, 255, 0.4);
  --remark-when: #556078;
  --remark-overdue-bg: #fdecee; --remark-overdue-border: #f0c2c7; --remark-overdue-text: #b02a37;
  --remark-soon-bg: #fff2e0;    --remark-soon-border: #f6d3a5;
  --remark-later-bg: #e8f6ee;   --remark-later-border: #bfe3cd;
  --remark-none-bg: #e8eefe;    --remark-none-border: #cbd8fb;
  --shadow-lift: 0 8px 24px rgba(20, 30, 60, 0.18);
  --shadow-modal: 0 20px 60px rgba(20, 30, 60, 0.3);
  --backdrop: rgba(20, 30, 60, 0.4);

  /* the translucent "bubble" around each section on a computer / tablet, and the soft light behind it */
  --panel-bg: rgba(255, 255, 255, 0.58);
  --panel-border: rgba(31, 45, 90, 0.09);
  --panel-shadow: 0 10px 34px rgba(31, 45, 90, 0.10);
  --glow-a: rgba(47, 95, 227, 0.13);
  --glow-b: rgba(46, 157, 106, 0.11);

  /* items that someone else just added (highlighted during the first visit only) */
  --new-bg: #e1f6e8; --new-border: #7cc99c; --new-ring: rgba(46, 157, 106, 0.38);
  --new-tag-bg: #c8323f; --new-tag-text: #ffffff;

  --radius: 14px;
  --tap: 44px; /* minimum touch target (Apple guideline) */
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.06), 0 4px 14px rgba(20, 30, 60, 0.05);
  --gutter: 16px;
}

/* Dark theme (chosen with the moon/sun button; the page starts light). Black background, muted colours. */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* neutral surfaces: black page, near-black cards */
  --bg: #000000;
  --surface: #131315;
  --field: #0a0a0c;
  --text: #d9dade;
  --muted: #8d909c;
  --border: #26272c;

  /* highlights (selected tab, links, main button): a clearer blue than before, still not glaring */
  --accent: #4565c4;
  --accent-hover: #3b58aa;
  --accent-strong: #8fb0ff;
  --accent-soft: #1b2a55;
  --accent-border: #35508f;
  --focus: #8fb0ff;
  --on-accent: #ffffff;

  --danger: #ee8c98;
  --danger-soft: #3a1c22;
  --danger-border: #6a303a;
  --short: #d8914a;
  --long: #4cb585;
  --star: #e0b64a;
  --ok-bg: #153a28; --ok-border: #2f7a52; --ok-text: #7be0a8;
  --badge-bg: #b8505c; --badge-text: #ffffff;
  --toast-bg: #2a2b31; --toast-text: #e6e6ea; --toast-border: rgba(255, 255, 255, 0.25);

  /* long-term notes by urgency: red / orange / green / blue, dark but clearly coloured */
  --remark-when: #b3b6c2;
  --remark-overdue-bg: #3d1f26; --remark-overdue-border: #7a3a46; --remark-overdue-text: #ff9aa8;
  --remark-soon-bg: #3b2c14;    --remark-soon-border: #8a6425;
  --remark-later-bg: #153a28;   --remark-later-border: #2f7a52;
  --remark-none-bg: #1b2a55;    --remark-none-border: #35508f;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.8);
  --backdrop: rgba(0, 0, 0, 0.65);

  --panel-bg: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.10);
  --panel-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
  --glow-a: rgba(69, 101, 196, 0.17);
  --glow-b: rgba(76, 181, 133, 0.08);

  --new-bg: #123824; --new-border: #2f8a5c; --new-ring: rgba(76, 181, 133, 0.42);
  --new-tag-bg: #b8505c; --new-tag-text: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

/* A class like .banner { display: flex } would otherwise beat the browser's hidden-attribute rule. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100dvh;
  /* room for the fixed bottom navigation on phones */
  padding-bottom: calc(var(--tap) + 28px + env(safe-area-inset-bottom));
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.25rem; margin-bottom: 12px; }
h3 { font-size: 1rem; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar and page frame ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(12px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left));
}
.topbar h1 { font-size: 1.15rem; }

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--gutter) max(var(--gutter), env(safe-area-inset-right)) var(--gutter) max(var(--gutter), env(safe-area-inset-left));
}

.panel { display: none; margin-bottom: 24px; }
body[data-view="tasks"] #view-tasks,
body[data-view="cart"] #view-cart,
body[data-view="remarks"] #view-remarks { display: block; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid var(--danger-border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px;
}
.banner[hidden] { display: none; }

.empty { color: var(--muted); margin: 8px 2px; }

/* ---------- forms and buttons ---------- */

input[type="text"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px; /* 16px or more stops iOS Safari from zooming on focus */
}
textarea { resize: vertical; min-height: 160px; }

button {
  min-height: var(--tap);
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }

.add-form { display: flex; gap: 8px; margin-bottom: 12px; }
.add-form input[type="text"] { flex: 1; min-width: 0; }
.remark-form { flex-wrap: wrap; }
.remark-form input[type="text"] { flex: 1 1 100%; }
.remark-form input[type="datetime-local"] { flex: 1 1 200px; width: auto; }

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

/* ---------- task board ---------- */

/* Phone: Krátkodobé and Dlhodobé are stacked, one below the other, both visible (no switching).
   Tablet and desktop put them side by side (see the media query further down). */
.board { display: flex; flex-direction: column; gap: 16px; }

.column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.column[data-bucket="short"] { border-top-color: var(--short); }
.column[data-bucket="long"] { border-top-color: var(--long); }

.column-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.count { background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.open-list { min-height: 56px; } /* an empty column is still a drop target */

.card {
  display: flex; align-items: center; gap: 4px;
  min-height: var(--tap);
  padding: 2px 10px 2px 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.card.sortable-ghost { opacity: 0.35; }
.card.sortable-chosen { box-shadow: var(--shadow-lift); }
.card.done .card-title { text-decoration: line-through; color: var(--muted); }
.card.done { opacity: 0.7; cursor: default; }

.check { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.card-title, .bubble-text, .remark-main {
  background: none; border: 0; padding: 0; text-align: left; border-radius: 6px; min-height: var(--tap);
}
.card-title { flex: 1; min-width: 0; word-break: break-word; }
.note-flag { color: var(--muted); display: inline-flex; }

.done-box { margin-top: 12px; }
.done-box summary { color: var(--muted); cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }

/* ---------- shopping cart ---------- */

.bubbles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.bubble {
  display: flex; align-items: center; gap: 2px;
  min-height: var(--tap);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  max-width: 100%;
}
/* The padding lives inside the button so the whole pill (not just the word) is tappable,
   and short words like "čaj" still get a 44px-wide target. */
.bubble-text { word-break: break-word; min-width: var(--tap); padding: 0 4px 0 14px; }
.bubble-remove {
  width: var(--tap); height: var(--tap); padding: 0; flex: none;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--muted);
}
.bubble-remove:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- remarks ---------- */

.remarks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.remark {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
}
.remark-main { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; }
.remark-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.remark-title { font-weight: 600; word-break: break-word; }
.remark-when { color: var(--remark-when); font-size: 0.9rem; }

/* The colour of a remark says how urgent its date is. */
.remark-overdue { background: var(--remark-overdue-bg); border-color: var(--remark-overdue-border); }   /* date already passed: light red */
.remark-soon    { background: var(--remark-soon-bg); border-color: var(--remark-soon-border); }   /* today up to 6 days away: light orange */
.remark-later   { background: var(--remark-later-bg); border-color: var(--remark-later-border); }   /* 7 or more days away: light green */
.remark-none    { background: var(--remark-none-bg); border-color: var(--remark-none-border); }   /* no date: light blue (listed last) */
.remark-overdue .remark-when { color: var(--remark-overdue-text); }

/* ---------- bottom navigation (phones) ---------- */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  gap: 6px;
}
.bottom-nav button { position: relative; flex: 1; border: 0; background: none; color: var(--muted); font-weight: 600; }
.bottom-nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- popup ---------- */

dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-modal);
  overflow: auto;
}
dialog::backdrop { background: var(--backdrop); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.dlg-heading { font-size: 1.1rem; margin: 0; color: var(--text); }
.dialog-actions { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.form-error { margin: 0; color: var(--danger); }
.form-error[hidden] { display: none; }

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

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--tap) + 28px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 24px);
  background: var(--toast-bg); color: var(--toast-text);
  padding: 8px 8px 8px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lift);
}
.toast[hidden] { display: none; }
.toast button { background: none; border: 1px solid var(--toast-border); color: var(--toast-text); min-height: 36px; }

/* ---------- top bar actions ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.who { color: var(--muted); font-size: 0.9rem; }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--badge-bg); color: var(--badge-text); font-size: 0.8rem; font-weight: 700;
}
#btn-invitations.attention { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* The four account/admin buttons sit in #topbar-menu. On tablet and computer the wrapper vanishes
   (display: contents), so the buttons are laid out directly in the top bar. On a phone it becomes a dropdown
   opened by the menu button (see the phone block below). */
.topbar-menu { display: contents; }
button.menu-toggle { display: none; position: relative; width: var(--tap); padding: 0; place-items: center; color: var(--muted); }
button.menu-toggle:hover { color: var(--text); }
button.menu-toggle .badge { position: absolute; top: -7px; right: -7px; }

/* ---------- login screen ---------- */

body[data-auth="loading"] main, body[data-auth="loading"] .bottom-nav,
body[data-auth="out"] main, body[data-auth="out"] .bottom-nav { display: none; }

.auth { display: grid; justify-items: center; padding: 24px var(--gutter); }
.auth-card {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.auth-card .check-row { flex-direction: row; align-items: center; min-height: var(--tap); }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.wide { width: 100%; }
.notice {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-strong);
}
.muted { color: var(--muted); }

/* ---------- list switcher above each section ---------- */

.board-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.board-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0 14px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.tab[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-strong); }
.tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20ch; }
.tab .meta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; font-weight: 400; }
.tab .meta .icon { width: 16px; height: 16px; }
.icon.filled { fill: currentColor; }
button.ghost:disabled { opacity: 1; cursor: default; background: none; }

/* combined "Všetky" view: which list an item comes from, and where new items go */
.list-chip {
  flex: none; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted); font-size: 0.75rem;
}
.remark-text .list-chip { align-self: flex-start; margin-top: 4px; }
.target-picker { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; }
.target-picker select { width: auto; max-width: 22ch; }
.tab .meta.star { color: var(--star); }
button.ghost[aria-pressed="true"] .icon { color: var(--star); }
button.ghost { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; background: none; border-color: transparent; color: var(--accent-strong); font-weight: 600; }
button.ghost:hover { background: var(--accent-soft); }

.no-board-msg { display: none; }
.panel.no-board .no-board-msg { display: block; }
.panel.no-board .board-body { display: none; }
.panel.readonly .add-form { display: none; }
.panel.readonly .card { cursor: default; }
.bubble-end { width: 14px; }

/* ---------- popups: sharing, invitations, administrator ---------- */

.sub { font-size: 1rem; margin: 6px 0 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-form .grow { flex: 1 1 200px; }
.inline-form > input[type="text"] { flex: 1 1 200px; width: auto; }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.member-name { flex: 1 1 160px; min-width: 0; word-break: break-word; }
.member select { width: auto; }
.pill { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 0.85rem; }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.pill.warn { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.icon-button { width: var(--tap); padding: 0; display: grid; place-items: center; color: var(--muted); }
.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.invite-result { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-border); }
.invite-result p { margin: 0 0 8px; }

@media (max-width: 699px) {
  .who { display: none; }

  /* Phone: ONE slim row (title, theme button, menu button). Pozvánky / Používatelia / Dokumentácia / Odhlásiť
     live in a dropdown that app.js opens with body[data-menu="open"]. */
  .topbar, .topbar-actions { flex-wrap: nowrap; }
  button.menu-toggle { display: grid; }
  .topbar-menu {
    display: none; position: absolute; top: calc(100% + 6px); right: max(var(--gutter), env(safe-area-inset-right));
    flex-direction: column; gap: 6px; min-width: 220px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  }
  body[data-menu="open"] .topbar-menu { display: flex; }
  .topbar-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; }

  /* The top bar also slides away while scrolling down (more room for the lists) and returns when scrolling
     up or at the top. app.js sets body[data-topbar="hidden"]; tablets and computers never hide it. */
  .topbar { transition: transform 0.25s ease; }
  body[data-topbar="hidden"] .topbar { transform: translateY(-100%); }
}

/* ---------- tablet: two task columns, two lower panels ---------- */

@media (min-width: 700px) {
  :root { --gutter: 24px; }
  body { padding-bottom: 32px; }

  .panel, body[data-view] .panel { display: block; }
  .bottom-nav { display: none; }

  .board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

  .lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .lower .panel { margin-bottom: 0; }

  /* Each section (Úlohy, Nákupný košík, Dlhodobé poznámky) sits in its own translucent, frosted "bubble",
     so the parts are clearly separated. The soft coloured light behind the page shows through it. */
  body {
    background-image:
      radial-gradient(900px 520px at 6% -8%, var(--glow-a), transparent 62%),
      radial-gradient(820px 540px at 100% 4%, var(--glow-b), transparent 58%);
    background-attachment: fixed;
  }
  .panel {
    padding: 20px 22px 22px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--panel-shadow);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
  }
  .panel > .panel-head { margin-bottom: 14px; }

  .toast { bottom: 24px; }
  .remark-form input[type="text"] { flex: 1 1 100%; }
}

/* ---------- desktop ---------- */

@media (min-width: 1100px) {
  :root { --gutter: 32px; }
  .topbar h1 { font-size: 1.3rem; }
  .card:hover { border-color: var(--accent-border); }
  .remark:hover { filter: brightness(0.97); }
  .remark-form input[type="text"] { flex: 1 1 auto; }
}

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

/* ---------- "new" marks: what someone else added ---------- */

/* section title with a red dot + number beside it (computer / tablet; a phone uses the bottom bar instead) */
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.badge-slot { display: inline-flex; }
.heading-badge {
  position: relative; display: grid; place-items: center;
  min-width: 24px; height: 24px; min-height: 24px; padding: 0 7px; border: 0; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-text);
  font-size: 0.8rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.heading-badge::after { content: ""; position: absolute; inset: -10px; } /* a bigger, finger-sized click area */
.heading-badge:hover { filter: brightness(1.12); }
@media (max-width: 699px) { .badge-slot { display: none; } }

/* red bubble with a number on a bottom-bar button (phone) */
.nav-label { position: relative; display: inline-block; }
.nav-badge {
  position: absolute; top: -12px; right: -20px;
  display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-text);
  font-size: 0.75rem; font-weight: 700; line-height: 1;
}
/* shopping cart and tasks: the new items are green, until the section is left */
.card.is-new, .bubble.is-new { background: var(--new-bg); border-color: var(--new-border); box-shadow: 0 0 0 2px var(--new-ring); }
/* long-term notes already use colours for urgency, so they get a red "Nové" tag instead */
.remark-new-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; vertical-align: middle;
  border-radius: 999px; background: var(--new-tag-bg); color: var(--new-tag-text);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}

/* ---------- theme button (moon / sun) ---------- */

/* Logged out: only the theme button is shown in the top bar. Logged in: [name] [theme] [buttons...]. */
body:not([data-auth="in"]) .topbar-actions > :not(#btn-theme) { display: none; }
button.theme-toggle { width: var(--tap); padding: 0; display: grid; place-items: center; color: var(--muted); }
button.theme-toggle:hover { color: var(--text); }
