/* Figtree – uložené přímo na webu (funguje i offline) */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bin-ring: transparent;
  --bg: #f4f6f3;
  --card: #ffffff;
  --text: #1c2420;
  --muted: #5f6b64;
  --line: #e2e7e3;
  --accent: #15803d;
  --accent-ink: #ffffff;
  --accent-soft: #e5f3ea;
  --warn-bg: #fff7e0;
  --warn-line: #f2d27a;
  --err-bg: #fde8e8;
  --err-line: #f1a5a5;
  --today: #eef8f1;
  --danger: #b91c1c;
  --warn-ink: #a16207;
  --hero-1: #15803d;
  --hero-2: #166534;
  --hero-ink: #ffffff;
  --toast-bg: #1c2420;
  --toast-fg: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 2px 10px rgb(0 0 0 / .04);
  color-scheme: light;
  /* okraje telefonu (výřez, gesta) */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1412;
    --card: #18201c;
    --text: #e7ece9;
    --muted: #9aa69f;
    --line: #2a342f;
    --accent: #34c46a;
    --accent-ink: #062611;
    --accent-soft: #1d3326;
    --warn-bg: #2f2812;
    --warn-line: #6b5720;
    --err-bg: #3a1a1a;
    --err-line: #7a3434;
    --today: #1a2b21;
    --danger: #f87171;
    --warn-ink: #facc15;
    --hero-1: #166534;
    --hero-2: #14532d;
    --toast-bg: #e7ece9;
    --toast-fg: #0f1412;
    --shadow: none;
    --bin-ring: rgb(255 255 255 / .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1412;
  --card: #18201c;
  --text: #e7ece9;
  --muted: #9aa69f;
  --line: #2a342f;
  --accent: #34c46a;
  --accent-ink: #062611;
  --accent-soft: #1d3326;
  --warn-bg: #2f2812;
  --warn-line: #6b5720;
  --err-bg: #3a1a1a;
  --err-line: #7a3434;
  --today: #1a2b21;
  --danger: #f87171;
  --warn-ink: #facc15;
  --hero-1: #166534;
  --hero-2: #14532d;
  --toast-bg: #e7ece9;
  --toast-fg: #0f1412;
  --shadow: none;
  --bin-ring: rgb(255 255 255 / .22);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.wrap {
  max-width: 760px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* hlavička */
.top {
  background: var(--accent);
  color: var(--accent-ink);
  padding-block: 12px;
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
}
/* pruh nad lepící hlavičkou (pod výřezem telefonu) */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--accent);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { width: 30px; height: 30px; fill: currentColor; flex: none; }
.top h1 { font-size: 1.15rem; }
.top .sub { margin: 2px 0 0; font-size: .8rem; opacity: .85; }
.top .icon-btn { color: var(--accent-ink); }
.top .icon-btn:hover { background: rgb(255 255 255 / .15); }

main { padding-top: 16px; padding-bottom: 8px; display: grid; gap: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card > h2 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.card p { margin: 6px 0 12px; }

/* tlačítka */
button { font: inherit; color: inherit; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; flex: none;
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 9px 14px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer; text-decoration: none; font-size: .925rem;
}
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--accent-soft); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px; }

input[type=search] {
  width: 100%; font: inherit; padding: 10px 12px; margin: 4px 0 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 0; }

/* chipy */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: .925rem; user-select: none;
}
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .x { font-weight: 700; opacity: .8; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #888); flex: none; }
.small-chips .chip { padding: 4px 10px; font-size: .825rem; }
.small-chips .chip[aria-pressed=true] { background: var(--card); color: var(--text); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.small-chips .chip[aria-pressed=false] { opacity: .55; }
.group-title { margin: 14px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.mine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.mine .chip { background: var(--card); cursor: default; }

/* hero */
.hero {
  border-radius: var(--radius); padding: 16px 18px; color: var(--hero-ink);
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  box-shadow: var(--shadow);
}
.hero h2 { font-size: 1.3rem; }
.hero p { margin: 4px 0 0; opacity: .95; }
.hero-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgb(255 255 255 / .18); border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 600;
}
.hero-pill .bin { width: 30px; height: 30px; }
.hero-pill small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; line-height: 1.2; }
.hero-block { margin-top: 14px; }
.hero-calm { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.hero-calm p { color: var(--muted); }
.hero-calm .hero-pill { background: var(--bg); border: 1px solid var(--line); }
.hero .hero-label {
  margin: 0 0 2px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.hero h2 { text-wrap: balance; }
/* klidná karta: lísteček z kalendáře + co se sváží */
.hero-main { display: flex; align-items: center; gap: 16px; }
.hero-info { min-width: 0; }
.hero-calm h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.hero-calm .hero-items { margin-top: 10px; }
.cal-leaf {
  flex: none; width: 78px; display: grid; justify-items: center;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg); box-shadow: 0 2px 0 var(--line);
  font-variant-numeric: tabular-nums;
}
.cal-month {
  width: 100%; text-align: center; padding: 3px 0 2px;
  background: var(--c); color: #fff; box-shadow: inset 0 -1px 0 var(--bin-ring);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.cal-leaf.light .cal-month { color: #1c2420; }
.cal-day { font-size: 2.3rem; font-weight: 800; line-height: 1; padding-top: 6px; }
.cal-dow { font-size: .75rem; color: var(--muted); padding: 2px 0 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-rel { color: var(--accent); white-space: nowrap; }
/* další druhy odpadu – kompaktní seznam pod hlavní kartou */
.hero-next {
  list-style: none; margin: 14px 0 0; padding: 12px 0 0;
  border-top: 1px solid rgb(255 255 255 / .25);
  display: grid; gap: 6px; font-size: .9rem;
}
.hero-calm .hero-next { border-top-color: var(--line); }
.hero-next li { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 8px; }
.hero-next b { font-weight: 600; }
.hero-next li > span:last-child { opacity: .85; }
.hero-calm .hero-next li > span:last-child { color: var(--muted); opacity: 1; }
.bin.bin-sm { width: 22px; height: 22px; }

/* ikonka popelnice v barvě typu */
.bin {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c, #888); display: inline-grid; place-items: center; flex: none;
  box-shadow: inset 0 0 0 1px var(--bin-ring);
}
.bin svg { width: 60%; height: 60%; fill: #fff; }
.bin.light svg { fill: #1c2420; }

/* týden */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.week-title { text-align: center; }
.week-title h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 6px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg); border-radius: 10px;
  padding: 7px 12px; cursor: pointer; font-size: .9rem;
}
.filter-btn svg { width: 16px; height: 16px; fill: var(--muted); }
.filter-btn[aria-expanded=true] { border-color: var(--accent); }
.filter-count:not(:empty) { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 700; }
#type-filter { margin: 4px 0 8px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.seg button[aria-checked=true] { background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / .12); font-weight: 600; }

.days { list-style: none; margin: 8px 0 0; padding: 0; }
.day { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day.today { background: var(--today); border-radius: 10px; border-top-color: transparent; }
.day.today + .day { border-top-color: transparent; }
.day.past { opacity: .55; }
.day-name { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.day-name small { display: block; font-weight: 400; color: var(--muted); }
.day-name .tag { display: inline-block; margin-top: 2px; font-size: .7rem; background: var(--accent); color: var(--accent-ink); padding: 0 6px; border-radius: 6px; }
.day-empty { color: var(--muted); font-size: .9rem; align-self: center; }
/* sloučené prázdné dny – nízký řádek */
.day-gap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-block: 7px; }
.day-gap .day-name { font-weight: 600; color: var(--muted); }
.day-gap .day-name small { display: inline; margin-left: 4px; font-size: .78rem; }
.day-gap .day-empty { font-size: .85rem; }
.day-gap .day-empty::before { content: "· "; }
.week-empty { padding: 10px 6px; }
.ev-list { display: grid; gap: 8px; }
.ev { display: flex; gap: 10px; align-items: flex-start; }
.ev .bin { width: 30px; height: 30px; margin-top: 1px; }
.ev-body { min-width: 0; }
.ev-title { font-weight: 600; }
.ev-title a { color: inherit; text-decoration: none; }
.ev-title a:hover { text-decoration: underline; }
.ev-meta { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.ev-meta mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 3px; }
.ev.cancelled .ev-title { text-decoration: line-through; }
.ev .cancel-note { color: var(--danger); font-size: .85rem; font-weight: 600; }

/* připomínky – sbalitelná sekce */
#remind > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 8px;
}
#remind > summary::-webkit-details-marker { display: none; }
#remind > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.summary-text { display: grid; gap: 2px; min-width: 0; }
.chevron { width: 24px; height: 24px; fill: var(--muted); flex: none; transition: transform .2s; }
#remind[open] .chevron { transform: rotate(180deg); }
.remind-body { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .chevron { transition: none; } }
.remind-item { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.remind-item:first-of-type { border-top: 0; }
.remind-item p { margin: 4px 0 10px; }
.remind-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center;
}
.remind-icon svg { width: 20px; height: 20px; fill: var(--accent); }
.badge { font-size: .7rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.badge-exp { background: var(--warn-bg); color: var(--warn-ink); }
.preview-note { margin: 0 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); font-size: .875rem; }
.preview #btn-notif, .preview #btn-install, .preview #btn-share { display: none; }
.cal-links { display: grid; gap: 8px; }
.cal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cal-row strong { min-width: 110px; }
.cal-row .btn { padding: 6px 10px; font-size: .85rem; }

/* hlášky */
.notice { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--card); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.notice-error { background: var(--err-bg); border-color: var(--err-line); }
.notice h2 { font-size: 1rem; margin-bottom: 6px; }
.notice ul { margin: 0; padding-left: 18px; }

.foot { color: var(--muted); font-size: .8rem; padding-block: 6px 24px; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-fg); padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25); z-index: 50; max-width: calc(100% - 32px);
}

@media (max-width: 420px) {
  .day { grid-template-columns: 54px 1fr; gap: 8px; }
}
