:root {
  --team: #043399;
  --bg: #F1F3EF;
  --surface: #FFFFFF;
  --ink: #10201A;
  --muted: #56645C;
  --accent: #0B7A4B;
  --accent-ink: #075233;
  --accent-soft: #E3F2EA;
  --hl: #FFD43B;
  --debt: #B35300;
  --debt-soft: #FFF0E3;
  --line: #DDE3DC;
  --line-soft: #EEF1ED;
  --border: #C9D1C8;
  --radius: 20px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
  --nav-h: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { padding: 48px 20px; text-align: center; color: var(--muted); }

.app { max-width: 600px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.page { padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 14px; }

/* hlavička */
.hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 4px; }
.hdr-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.hdr-sub .mini-logo { width: 22px; height: 18px; border-radius: 4px; vertical-align: -4px; margin-right: 6px; }
/* Týmová hlavička s logem (veřejná stránka, přihlášení) */
.team-hero { margin: 16px 16px 4px; padding: 16px; border-radius: 24px; background: var(--team); color: #fff; display: flex; align-items: center; gap: 14px; }
.team-hero .team-logo { width: 104px; height: auto; flex: none; display: block; }
.team-hero .hdr-sub { color: #C9D6F2; }
.team-hero .hdr-title { color: #fff; font-size: 28px; }
.team-hero .btn { margin-top: 10px; background: #fff; color: var(--team); border-color: #fff; }
.hdr-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: -0.02em; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 4px; margin: 10px 0 0 12px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: 12px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.avatar-dot { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--debt); border: 2px solid var(--bg); }
button.avatar { position: relative;  border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; background: var(--bg); border-radius: 12px; padding: 10px 12px; color: var(--muted); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; background: var(--line); color: var(--ink); }

h2.sec { margin: 6px 0 0; font-family: var(--display); font-weight: 600; font-size: 22px; }
h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* karty */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.tight { gap: 8px; }
.card.ink { background: var(--ink); color: #fff; }
.card.hl { background: var(--hl); }
.card.outline-hl { border: 2px solid var(--hl); }
.card.cancelled { opacity: 0.6; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.plus { color: var(--accent); }
.minus { color: var(--debt); }
.on-ink-minus { color: #FFB067; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* tlačítka */
.btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--ink); border-color: #AEB8AD; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); color: #fff; }
.btn.inkb { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.hl { background: var(--hl); border-color: var(--hl); color: var(--ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 6px; }
.btn.ghost.danger { color: var(--debt); }
.btn.danger:not(.ghost) { background: var(--debt); border-color: var(--debt); color: #fff; }
.nav a { position: relative; }
.nav .count { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--debt); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.btn.on-ink { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }
.btn.sm { min-height: 36px; font-size: 14px; padding: 0 10px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 50px; font-size: 16px; border-radius: 14px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }

.rsvp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rsvp .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.card.hl .rsvp .btn { background: transparent; border-color: rgba(16,32,26,0.35); }
.card.hl .rsvp .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(16,32,26,0.08); }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.badge.ink { background: var(--ink); color: #fff; }
.badge.hl { background: var(--hl); color: var(--ink); }
.badge.line { border: 1px solid var(--border); font-weight: 600; }
.badge.debt { background: var(--debt-soft); color: var(--debt); }
.badge.ok { background: var(--accent-soft); color: var(--accent-ink); }

/* formuláře */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { min-height: 46px; width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; background: var(--surface); font-size: 16px; }
.field textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--debt); }
.form { display: flex; flex-direction: column; gap: 12px; }
.err { background: var(--debt-soft); color: var(--debt); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }

/* seznamy */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line-soft); }
.list > li:first-child { border-top: 0; }
.list .link { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 52px; color: inherit; text-decoration: none; }
.list-card { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; }
.check-row { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; }
.check-row[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: #fff; }

/* rozpis */
.month { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-family: var(--display); font-weight: 600; font-size: 18px; }
.month::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ev { display: flex; gap: 12px; }
.ev-day { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 12px; }
.ev-day .wd { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.ev-day .dn { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; }
.ev .card { flex: 1; min-width: 0; }
.ev-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ev-title { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.15; }
.matches { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.55); border-radius: 12px; padding: 10px 12px; }
.matches .m { display: flex; gap: 12px; font-size: 15px; }
.matches .t { font-weight: 700; width: 44px; flex: none; }
.names { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* QR */
.qr { width: 156px; height: 156px; flex: none; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.pay-grid { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 14px; flex: 1; min-width: 160px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* navigace */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); }
.nav-inner { max-width: 600px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.nav a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* spodní panel */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(16,32,26,0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.grabber { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; }

.sticky-foot { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--surface); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 20px rgba(16,32,26,0.08); }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; max-width: calc(100% - 40px); box-shadow: 0 8px 24px rgba(16,32,26,0.25); }
.toast.error { background: var(--debt); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); color: var(--ink); text-decoration: none; border: 0; border-radius: 18px; padding: 14px 12px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; line-height: 1.2; text-align: left; cursor: pointer; }
.tile.primary { background: var(--accent); color: #fff; }
.tile:hover { color: inherit; }

.stat { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.result { display: inline-flex; width: 26px; height: 26px; border-radius: 7px; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.result.w { background: var(--accent); color: #fff; }
.result.l { background: var(--line); color: var(--ink); }
.result.d { background: var(--hl); color: var(--ink); }

details.sec-card { background: var(--surface); border-radius: var(--radius); padding: 0 16px; }
details.sec-card > summary { list-style: none; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 700; font-size: 16px; }
details.sec-card > summary::-webkit-details-marker { display: none; }
details.sec-card > summary .chev { transition: transform 0.15s; }
details.sec-card[open] > summary .chev { transform: rotate(180deg); }
details.sec-card > .body { padding: 0 0 16px; display: flex; flex-direction: column; gap: 12px; }
.item-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }

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

.cal-btn { align-self: flex-start; background: transparent; border-color: rgba(16,32,26,0.35); color: var(--ink); }
.card.hl .cal-btn { border-color: rgba(16,32,26,0.35); }
a.btn.lg { text-decoration: none; }
.card.hl .btn.ghost { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* veřejná stránka */
.app.public { padding-bottom: 24px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 6px; text-align: center; white-space: nowrap; }
.tbl td { padding: 10px 6px; text-align: center; border-top: 1px solid var(--line-soft); white-space: nowrap; }
.tbl .l { text-align: left; white-space: normal; min-width: 140px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl tr.ours td { background: #FFF6CF; font-weight: 700; }

/* Účet: kód pro další zařízení, návody */
.pair-code { font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: 0.08em; text-align: center; padding: 10px 0; background: var(--surface); border-radius: 14px; }
.pair-input { font-size: 24px !important; letter-spacing: 0.15em; text-align: center; font-weight: 700; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
.login-alt { display: flex; flex-direction: column; gap: 10px; }

/* Místo a navigace */
.place { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.jersey { font-family: var(--display); font-weight: 800; color: var(--accent); margin-right: 6px; letter-spacing: -0.01em; }
.avatar.num { font-family: var(--display); font-weight: 800; background: var(--ink); color: #fff; letter-spacing: -0.02em; }
.cf-status { display: flex; flex-direction: column; gap: 4px; }
.nav-place { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.nav-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.card.hl .place .btn, .card.hl .nav-place .btn { background: rgba(255,255,255,0.6); border-color: rgba(16,32,26,0.25); }
