/* Layout: one-column phone app — sticky header with "now" strip, scrolling day timeline, bottom tab bar. */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --ink: #14232e;
  --muted: #5d6f7c;
  --line: #dce4ea;
  --sky: #0b7891;          /* ČAS logo teal, darkened for white text */
  --sky-soft: #e0f2f7;
  --head: #e3f4fa;        /* header band: pale sky, lets the logo keep its own colours */
  --head-ink: #0b4f60;
  --head-btn: rgba(11,120,145,.10);
  --alert: #c0392b;
  --alert-soft: #fbe9e7;
  --now: #d9821f;          /* amber: what is happening now */
  --now-soft: #fbefdf;
  --dekati: #3f8a4f;       /* green: young scientists competition, as in the printed programme */
  --dekati-soft: #e4f2e6;
  --star: #c99a12;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e171e; --surface: #16222b; --ink: #e6edf2; --muted: #93a5b2; --line: #26353f;
    --head: #10242c; --head-ink: #e6f4f8; --head-btn: rgba(92,200,228,.14); --sky: #5cc8e4; --sky-soft: #143039; --alert: #f07b6e; --alert-soft: #3a1c19; --now: #f0a54a; --now-soft: #3a2a17;
    --dekati: #7cc58a; --dekati-soft: #1b3221; --star: #e8bd3c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e171e; --surface: #16222b; --ink: #e6edf2; --muted: #93a5b2; --line: #26353f;
  --head: #10242c; --head-ink: #e6f4f8; --head-btn: rgba(92,200,228,.14); --sky: #5cc8e4; --sky-soft: #143039; --alert: #f07b6e; --alert-soft: #3a1c19; --now: #f0a54a; --now-soft: #3a2a17;
  --dekati: #7cc58a; --dekati-soft: #1b3221; --star: #e8bd3c; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
a { color: var(--sky); }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--head); }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--head); color: var(--head-ink); border-bottom: 1px solid var(--line); }
.top-in { padding-block: 10px 8px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.brand b { font: 700 19px/1.1 var(--font-display); letter-spacing: -.01em; }
.brand small { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { font-size: 12px; font-weight: 700; letter-spacing: .06em; border: 1.5px solid currentColor; border-radius: 99px; padding: 3px 9px; opacity: .9; }

.days { display: flex; gap: 6px; padding-block: 0 10px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day-btn { flex: 1 0 auto; border-radius: 10px; padding: 6px 10px; text-align: center; background: var(--head-btn); line-height: 1.15; }
.day-btn b { display: block; font-size: 14px; }
.day-btn span { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.day-btn[aria-pressed="true"] { background: var(--sky); color: var(--surface); }
.day-btn.today::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--now); margin: 3px auto 0; }

/* ---------- now strip ---------- */
.now { background: var(--now-soft); border-bottom: 1px solid var(--line); color: var(--ink); }
.now:empty { display: none; }
.now-in { padding-block: 10px; display: grid; gap: 4px; }
.now-row { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.now-tag { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--now); width: 62px; }
.now-row.next .now-tag { color: var(--muted); }
.now-txt { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.now-txt em { font-style: normal; color: var(--muted); }
.now-cd { flex: none; font: 600 12px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.now-btn { justify-self: start; font-size: 13px; font-weight: 600; color: var(--now); }
.sim { font-size: 11px; color: var(--now); font-weight: 700; }

/* ---------- main ---------- */
main { padding-block: 8px 96px; max-width: 760px; margin: 0 auto; }
.news { margin: 8px 0 4px; padding: 10px 12px; border-radius: var(--r); background: var(--sky-soft); border-left: 4px solid var(--sky); display: grid; gap: 6px; }
.news p { margin: 0; }
.news time { font: 600 12px var(--font-num); color: var(--muted); margin-right: 6px; }

.half { font: 800 11px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.chair { font-size: 12.5px; color: var(--muted); margin: 14px 0 4px 64px; display: flex; gap: 6px; align-items: center; }
.chair::before { content: ""; width: 14px; height: 1px; background: var(--muted); }
.note { margin: 10px 0 4px; font-size: 13px; color: var(--dekati); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.note::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--dekati); flex: none; }

.item { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); position: relative; }
.item:first-child { border-top: 0; }
.t { font: 600 13px/1.3 var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink); padding-top: 1px; }
.t small { display: block; color: var(--muted); font-weight: 400; }
.body { min-width: 0; text-align: left; display: grid; gap: 3px; }
.ttl { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.caps { text-transform: lowercase; }
.caps::first-letter { text-transform: uppercase; }
.spk { font-size: 13.5px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.badge { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; border-radius: 5px; padding: 2px 6px; background: var(--sky-soft); color: var(--sky); }
.badge.dek { background: var(--dekati-soft); color: var(--dekati); }
.badge.pl { background: var(--sky); color: var(--surface); }
.badge.live { background: var(--now); color: var(--surface); }
.item.break .ttl, .item.social .ttl { font-weight: 500; color: var(--muted); }
.item.break { padding-block: 7px; }
.item.dek::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--dekati); }
.item.past > .body, .item.past > .t { opacity: .5; }
.item.live { background: var(--now-soft); border-radius: var(--r); border-top-color: transparent; margin: 2px -10px; padding-inline: 10px; }
.item.live + .item { border-top-color: transparent; }
.star { width: 36px; height: 36px; display: grid; place-items: center; margin: -6px -8px 0 0; color: var(--line); }
.star svg { width: 22px; height: 22px; }
.star[aria-pressed="true"] { color: var(--star); }
.star:not([aria-pressed="true"]) { color: var(--muted); opacity: .45; }
.hasabs .body::after { content: attr(data-more); font-size: 12px; color: var(--sky); font-weight: 600; }

.empty { color: var(--muted); padding: 32px 4px; text-align: center; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- search ---------- */
.search { padding-block: 8px; }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.search input:focus { border-color: var(--sky); outline: none; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 2px; }
mark { background: var(--now-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.where { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.snip { font-size: 13px; color: var(--muted); }

/* ---------- posters ---------- */
.pn { font: 700 15px var(--font-num); color: var(--sky); }

/* ---------- info ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; }
.card h2 { font: 700 17px/1.2 var(--font-display); margin: 0 0 8px; text-wrap: balance; }
.card p { margin: 6px 0; }
.rows { display: grid; gap: 8px; }
.rowbtn { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; width: 100%; }
.rowbtn:first-child { border-top: 0; }
.rowbtn span:last-child { color: var(--muted); }
.legend { display: grid; gap: 6px; font-size: 13.5px; }
.legend div { display: flex; gap: 8px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.simbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.simbox input { font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.btn { border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 14px; background: var(--sky); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--sky); border: 1.5px solid var(--sky); }

/* ---------- detail sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet-bar { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 2; }
.sheet-bar-in { display: flex; align-items: center; gap: 8px; padding-block: 6px; max-width: 760px; margin: 0 auto; }
.back { display: flex; align-items: center; gap: 4px; font-weight: 600; color: var(--sky); padding: 8px 4px; }
.back svg { width: 20px; height: 20px; }
.sheet-bar .grow { flex: 1; }
.art { max-width: 760px; margin: 0 auto; padding-block: 16px 48px; }
.art .meta { font: 600 12.5px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.art h1 { font: 700 21px/1.25 var(--font-display); margin: 8px 0 10px; text-wrap: balance; overflow-wrap: anywhere; }
.abs { font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.abs > p:first-child { font-weight: 600; }
.abs p { margin: 0 0 .8em; }
.abs .aff { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 0 0 .3em; }
.abs .kw { font-size: 13px; font-style: italic; color: var(--muted); margin-top: .8em; }
.abs h4 { font: 800 12px/1 var(--font-body); letter-spacing: .1em; color: var(--sky); margin: 1.6em 0 .6em; }
.abs img { display: block; max-width: 100%; height: auto; margin: 12px auto 6px; border-radius: 6px; background: #fff; }
.abs .cap { font-size: 13px; color: var(--muted); line-height: 1.4; }
.abs table { border-collapse: collapse; font-size: 13px; }
.abs .tw { overflow-x: auto; margin: 10px 0; }
.abs td, .abs th { border: 1px solid var(--line); padding: 4px 6px; }
.abs math { font-size: 1.05em; }
.abs math[display="block"] { overflow-x: auto; max-width: 100%; }
.noabs { color: var(--muted); font-style: italic; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs-in { display: grid; grid-template-columns: repeat(6, 1fr); max-width: 760px; margin: 0 auto; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--sky); }
.tab { position: relative; }
.tab .cnt { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--alert); color: #fff; font: 700 10.5px/17px var(--font-body); text-align: center; }
.logo { height: 38px; width: auto; flex: none; }

.about-logo { display: block; width: 180px; max-width: 60%; margin: 2px 0 10px; }
.badge.cx { background: var(--alert); color: #fff; }
.badge.chg { background: var(--now); color: #fff; }
.badge.new { background: var(--sky); color: var(--surface); }
.chg-note { font-size: 12.5px; color: var(--now); font-weight: 600; }
.item.cancelled .chg-note { color: var(--alert); }
.item.chg { background: linear-gradient(90deg, var(--now-soft), transparent 70%); border-radius: var(--r); margin-inline: -10px; padding-inline: 10px; }
.item.cancelled { background: linear-gradient(90deg, var(--alert-soft), transparent 70%); }
.item.cancelled .ttl, .item.cancelled .spk, .item.cancelled .t, .cx-title { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .65; }
.chg-banner { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; margin: 8px 0 4px; padding: 10px 12px; border-radius: var(--r); background: var(--now-soft); border-left: 4px solid var(--now); text-align: left; }
.chg-banner span { color: var(--now); font-weight: 600; font-size: 13px; }
.chg-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--now-soft); }

@media (prefers-reduced-motion: no-preference) {
  .item.live { animation: glow 2.4s ease-in-out infinite alternate; }
  @keyframes glow { from { box-shadow: inset 0 0 0 1px transparent; } to { box-shadow: inset 0 0 0 1.5px var(--now); } }
}

.now-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.yearbtn { font: inherit; color: inherit; padding: 0 6px; margin-left: 2px; border-radius: 8px; background: var(--head-btn); }
.scope { display: flex; gap: 6px; margin-top: 8px; }
.scope button { flex: 1; padding: 7px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--sky); color: var(--sky); }
.scope button[aria-pressed="true"] { background: var(--sky); color: var(--surface); }
.yr { font: 700 13px var(--font-num); color: var(--sky); }

.abs ul.refs { padding-left: 1.2em; margin: 0 0 1em; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.abs ul.refs li { margin: 0 0 .55em; overflow-wrap: anywhere; }
.abs img.eq { display: block; margin: 8px 0; max-width: 100%; height: auto; border-radius: 0; }
