/* Hubnutí — vzhled. Barvy Kyosun (fialová + zelená), mobil na prvním místě, na počítači dva sloupce. */
:root {
  --fialova: #5b2a86; --fialova-sv: #7c3a9e; --fialova-tm: #3f1d63;
  --zelena: #5f9a1c; --zelena-sv: #76b729;
  --cervena: #c0392b; --oranzova: #b9690b;
  --text: #241b33; --tlumena: #6f6480; --linka: rgba(91, 42, 134, .14);
  --pozadi: #f6f2fa; --karta: #fff;
  --stin: 0 6px 24px -10px rgba(58, 24, 99, .22);
  --r: 18px;
  --dole: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--text); background: var(--pozadi);
  min-height: 100dvh; -webkit-tap-highlight-color: transparent;
}
body.s-listem { overflow: hidden; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 700; margin: 18px 0 8px; color: var(--tlumena); text-transform: uppercase; letter-spacing: .04em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.tlumene { color: var(--tlumena); }
.male { font-size: 13px; }
.nacitam { color: var(--tlumena); text-align: center; padding: 40px 0; }
.chyba-text { color: var(--cervena); font-size: 14px; font-weight: 600; }
.chyba-text:empty { display: none; }

/* ---------- rozvržení ---------- */
.obsah { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(92px + var(--dole)); }
.sloupec { display: flex; flex-direction: column; gap: 14px; }
.karta { background: var(--karta); border-radius: var(--r); padding: 18px; box-shadow: var(--stin); border: 1px solid var(--linka); }
.karta-vyzva { border: 2px solid var(--fialova); }
.chyba-karta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin-top: 40px; }
.prazdno { color: var(--tlumena); padding: 6px 0; }

.den-hlava { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 2px; }
.den-hlava > div { text-align: center; flex: 1; }
.den-hlava.jen-nadpis { display: block; }
.sipka { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linka); background: var(--karta); font-size: 24px; line-height: 1; color: var(--fialova); flex: none; }
.sipka:disabled { opacity: .3; cursor: default; }
.pripominka { display: block; background: #fff6e5; border: 1px solid #f0d49b; color: #7a4a00; border-radius: 14px; padding: 12px 16px; font-weight: 600; text-decoration: none; }

/* ---------- přehled dne ---------- */
.prehled { display: flex; align-items: center; gap: 16px; }
.kruh { position: relative; width: 150px; height: 150px; flex: none; }
.kruh svg { width: 100%; height: 100%; display: block; }
.kruh-draha { fill: none; stroke: #ece4f4; stroke-width: 16; }
.kruh-plneni { fill: none; stroke: var(--zelena-sv); stroke-width: 16; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.kruh-pres .kruh-plneni { stroke: var(--cervena); }
.kruh-stred { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.kruh-stred strong { font-size: 36px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kruh-pres .kruh-stred strong { color: var(--cervena); }
.kruh-popis { font-size: 13px; color: var(--tlumena); margin-bottom: 2px; }
.kruh-jednotka { font-size: 13px; color: var(--tlumena); margin-top: 2px; }
.prehled-cisla { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.radek-cisel { display: flex; flex-direction: column; }
.radek-cisel span { font-size: 13px; color: var(--tlumena); }
.radek-cisel strong { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pruh { height: 9px; background: #ece4f4; border-radius: 9px; overflow: hidden; margin-top: 6px; }
.pruh i { display: block; height: 100%; background: var(--fialova-sv); border-radius: 9px; transition: width .5s ease; }
.pruh i.splneno { background: var(--zelena-sv); }

/* ---------- tlačítka ---------- */
.tl { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--linka); background: var(--karta); font-weight: 650; color: var(--fialova); text-decoration: none; }
.tl svg { flex: none; }
.tl:active { transform: translateY(1px); }
.tl:disabled { opacity: .5; cursor: default; }
.tl-hlavni { background: var(--fialova); border-color: var(--fialova); color: #fff; }
.tl-velke { min-height: 60px; font-size: 18px; width: 100%; box-shadow: 0 10px 24px -12px rgba(91, 42, 134, .7); }
.tl-nebezpecne { color: var(--cervena); border-color: rgba(192, 57, 43, .35); }
.odkaz-tl { background: none; border: 0; color: var(--tlumena); font-size: 13px; text-decoration: underline; padding: 8px 0 8px 8px; }
.akce { display: flex; flex-direction: column; gap: 10px; }
.akce-dve { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tlacitka { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.tlacitka .tl-hlavni { flex: 1; }

/* ---------- seznam jídel ---------- */
.jidla { list-style: none; padding: 0; display: flex; flex-direction: column; }
.jidla li + li { border-top: 1px solid var(--linka); }
.jidlo { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; background: none; border: 0; text-align: left; }
.jidlo img, .jidlo-bezfotky { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: #f1eaf7; }
.jidlo-bezfotky { display: flex; align-items: center; justify-content: center; color: var(--fialova-sv); }
.jidlo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jidlo-text strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jidlo-text small { color: var(--tlumena); font-size: 13px; }
.jidlo-kcal { text-align: right; font-weight: 750; font-size: 18px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.1; }
.jidlo-kcal small { font-size: 11px; font-weight: 500; color: var(--tlumena); }
.stitky { display: flex; flex-wrap: wrap; gap: 8px; }
.stitek { border: 1px solid var(--linka); background: #faf7fd; border-radius: 12px; padding: 8px 12px; text-align: left; display: flex; flex-direction: column; max-width: 100%; font-weight: 600; font-size: 14px; }
.stitek small { color: var(--tlumena); font-weight: 500; }

/* ---------- formuláře ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tlumena); }
input[type=text], input[type=password], input[type=time], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(91, 42, 134, .28); background: #fff; font-size: 16px; font-weight: 500; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(124, 58, 158, .35); outline-offset: 1px; }
form { display: flex; flex-direction: column; gap: 14px; }
.mrizka-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.popisek { font-size: 13px; font-weight: 600; color: var(--tlumena); margin-bottom: 6px; }

/* ---------- list (spodní panel) ---------- */
.list-pozadi { position: fixed; inset: 0; background: rgba(36, 27, 51, .5); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.list { background: var(--pozadi); width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; animation: nahoru .22s ease; }
@keyframes nahoru { from { transform: translateY(40px); opacity: 0; } }
.list-hlava { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.list-hlava h2 { margin: 0; font-size: 20px; }
.krizek { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(91, 42, 134, .1); font-size: 26px; line-height: 1; color: var(--fialova); }
.list-telo { overflow-y: auto; padding: 8px 18px calc(22px + var(--dole)); display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.nahled { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; }
.citace { background: #fff; border-radius: 12px; padding: 10px 14px; border-left: 4px solid var(--fialova-sv); }
.prubeh { text-align: center; color: var(--tlumena); font-weight: 600; }
.tocitko { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #e2d6ee; border-top-color: var(--fialova); margin: 6px auto 0; animation: toc 1s linear infinite; }
@keyframes toc { to { transform: rotate(360deg); } }
.jistota { font-size: 14px; border-radius: 12px; padding: 10px 14px; background: #eef6e2; color: #3d6410; }
.jistota-nizka { background: #fdecea; color: #8a2a20; }
.jistota-stredni { background: #fff6e5; color: #7a4a00; }
.porce { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.porce button { min-height: 44px; border-radius: 12px; border: 1px solid var(--linka); background: #fff; font-weight: 650; }
.porce button.aktivni { background: var(--fialova); color: #fff; border-color: var(--fialova); }
.polozky { list-style: none; padding: 0; background: #fff; border-radius: 14px; border: 1px solid var(--linka); }
.polozky li + li { border-top: 1px solid var(--linka); }
.polozka { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text); font-size: 15px; }
.polozka input { width: 22px; height: 22px; flex: none; accent-color: var(--fialova); }
.polozka-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.polozka-text small { color: var(--tlumena); font-weight: 500; }
.polozka-kcal { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.polozky .vypnuto { opacity: .45; }
.upresnit summary { font-weight: 650; color: var(--fialova); padding: 8px 0; cursor: pointer; }
.upresnit[open] { display: flex; flex-direction: column; gap: 10px; }

/* ---------- váha ---------- */
.vazeni-radek { display: flex; gap: 10px; }
.vstup-kg { position: relative; flex: 1; }
.vstup-kg input { font-size: 26px; font-weight: 750; min-height: 60px; padding-right: 48px; font-variant-numeric: tabular-nums; }
.vstup-kg span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--tlumena); font-weight: 600; }
.vazeni-radek .tl { min-height: 60px; }
.dlazdice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cislo { padding: 14px 16px; display: flex; flex-direction: column; }
.cislo span { font-size: 13px; color: var(--tlumena); }
.cislo strong { font-size: 24px; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cislo small { font-size: 12px; color: var(--tlumena); }
.vyhled { font-weight: 600; border-left: 5px solid var(--oranzova); }
.vyhled-ok { border-left-color: var(--zelena-sv); }
.graf svg { width: 100%; height: auto; display: block; }
.graf-mrizka { stroke: #ece4f4; stroke-width: 1; }
.graf-popis { font-size: 15px; fill: var(--tlumena); }
.graf-cil { stroke: var(--zelena); stroke-width: 2; stroke-dasharray: 6 6; }
.graf-cil-popis { fill: var(--zelena); font-weight: 600; }
.graf-bod { fill: #c9b3dd; }
.graf-trend { fill: none; stroke: var(--fialova); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.graf figcaption { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--tlumena); margin-top: 8px; }
.leg::before { content: ''; display: inline-block; vertical-align: middle; margin-right: 6px; }
.leg-trend::before { width: 18px; height: 4px; background: var(--fialova); border-radius: 4px; }
.leg-bod::before { width: 8px; height: 8px; background: #c9b3dd; border-radius: 50%; }
.vazeni-seznam { list-style: none; padding: 0; }
.vazeni-seznam li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; }
.vazeni-seznam li + li { border-top: 1px solid var(--linka); }
.vazeni-seznam span { flex: 1; }
.vazeni-seznam strong { font-variant-numeric: tabular-nums; }
.vazeni-seznam small { color: var(--tlumena); width: 78px; text-align: right; }

/* ---------- týden ---------- */
.sloupce-plocha { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 180px; align-items: end; }
.sloupec-den { display: flex; align-items: flex-end; justify-content: center; height: 100%; min-width: 0; }
.sloupec-den i { position: relative; width: 100%; max-width: 46px; background: var(--zelena-sv); border-radius: 8px 8px 3px 3px; display: block; }
.sloupec-den i.pres { background: var(--cervena); }
.sloupec-den i.prazdny { background: #e2d6ee; }
.sloupec-cislo { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 3px; font-size: 11px; font-style: normal; font-weight: 650; color: var(--tlumena); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sloupce-strop { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--fialova); height: 0; pointer-events: none; z-index: 1; }
.sloupce-dny { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 6px; text-align: center; }
.sloupce-dny small { font-size: 12px; color: var(--tlumena); }
.sloupce figcaption { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--tlumena); margin-top: 10px; }
.leg-strop::before { width: 18px; height: 0; border-top: 2px dashed var(--fialova); }
.leg-pres::before { width: 10px; height: 10px; background: var(--cervena); border-radius: 3px; }
.leg-ok::before { width: 10px; height: 10px; background: var(--zelena-sv); border-radius: 3px; }
.prehled-seznam { list-style: none; padding: 0; }
.prehled-seznam li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; }
.prehled-seznam li + li { border-top: 1px solid var(--linka); }
.prehled-seznam strong { text-align: right; font-variant-numeric: tabular-nums; }
.prehled-seznam small { grid-column: 1 / -1; color: var(--tlumena); font-size: 12px; }
.rady { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.rada { padding: 12px 14px; border-radius: 12px; background: #f4eefa; border-left: 5px solid var(--fialova-sv); font-weight: 550; }
.rada-ok { background: #eef6e2; border-left-color: var(--zelena-sv); }
.rada-data, .rada-kcal, .rada-bilkoviny { background: #fff6e5; border-left-color: var(--oranzova); }

/* ---------- nastavení ---------- */
.notif-radek { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linka); }
.notif-radek input[type=time] { width: 116px; flex: none; }
.prepinac { flex: 1; flex-direction: row; align-items: center; gap: 12px; color: var(--text); font-size: 15px; }
.prepinac input { width: 24px; height: 24px; flex: none; accent-color: var(--fialova); }
.prepinac span { display: flex; flex-direction: column; }
.prepinac small { color: var(--tlumena); font-weight: 500; font-size: 12px; }
.karta > .tl { margin-top: 12px; }
.karta > p + p, .karta > p + .tl, .karta > p + .tlacitka { margin-top: 10px; }
.stav-ok { color: #3d6410; font-weight: 650; }
.navod { background: #fff6e5; border-radius: 12px; padding: 12px 14px; color: #5e3a00; }
.navod ol { padding-left: 20px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- přihlášení ---------- */
.obsah-prihlaseni { min-height: 100dvh; display: flex; align-items: center; padding-bottom: 40px; }
.prihlaseni { width: 100%; align-items: stretch; text-align: center; padding: 28px 22px; }
.prihlaseni .logo { margin: 0 auto; border-radius: 18px; }

/* ---------- spodní lišta ---------- */
.lista { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--linka); padding: 6px 8px calc(6px + var(--dole)); }
.lista a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 52px; color: var(--tlumena); text-decoration: none; font-size: 11px; font-weight: 650; border-radius: 12px; }
.lista a.aktivni { color: var(--fialova); background: rgba(91, 42, 134, .08); }

.hlaska { position: fixed; left: 50%; bottom: calc(86px + var(--dole)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.hlaska-chyba { background: var(--cervena); }

/* ---------- úzký telefon ---------- */
@media (max-width: 370px) {
  .prehled { flex-direction: column; align-items: stretch; }
  .kruh { margin: 0 auto; }
}

/* ---------- počítač: lišta nahoře, širší plocha ---------- */
@media (min-width: 900px) {
  body { background: linear-gradient(160deg, #f6f2fa 0%, #efe6f7 60%, #eaf3de 100%) fixed; }
  .lista { top: 0; bottom: auto; grid-template-columns: repeat(4, auto); justify-content: center; gap: 6px; border-top: 0; border-bottom: 1px solid var(--linka); padding: 8px; }
  .lista a { flex-direction: row; gap: 8px; padding: 0 18px; min-height: 44px; font-size: 15px; }
  .obsah { max-width: 760px; padding-top: 86px; padding-bottom: 48px; }
  .obsah-prihlaseni { max-width: 440px; padding-top: 0; }
  .akce { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
  .akce-dve { display: contents; }
  .akce-dve .tl { min-height: 60px; }
  .akce > p { grid-column: 1 / -1; }
  .dlazdice { grid-template-columns: repeat(4, 1fr); }
  .kruh { width: 190px; height: 190px; }
  .kruh-stred strong { font-size: 44px; }
  .prehled { gap: 36px; padding: 26px 30px; }
  .list-pozadi { align-items: center; }
  .list { border-radius: 24px; max-height: 86dvh; }
  .hlaska { bottom: 32px; }
}
