:root {
  --canvas: #f5e4c6;
  --header-cream: #f6e4c7;
  --surface: #fffdf9;
  --surface-soft: #f6f1e9;
  --sage-50: #f0f4ec;
  --sage-100: #dfe9d9;
  --sage-300: #a9bca2;
  --sage-500: #6f8768;
  --sage-700: #485e44;
  --ink: #20251f;
  --muted: #62685f;
  --border: #e3ddd3;
  --shadow: 0 8px 28px rgb(46 52 43 / 8%);
  /* Společná stupnice UI: rem respektuje nastavení textu, horní meze chrání široké obrazovky. */
  --text-caption: clamp(.625rem, .55rem + .3vw, .8125rem);
  --text-xs: clamp(.6875rem, .6rem + .32vw, .875rem);
  --text-sm: clamp(.75rem, .67rem + .35vw, 1rem);
  --text-body: clamp(.875rem, .77rem + .44vw, 1.125rem);
  --text-lg: clamp(1rem, .86rem + .55vw, 1.375rem);
  --text-section: clamp(1.125rem, .97rem + .65vw, 1.5rem);
  --text-title: clamp(1.75rem, 1.48rem + 1.1vw, 2.625rem);
  --text-display: clamp(1.5625rem, 1.05rem + 2.2vw, 2.875rem);
  --line-body: 1.45;
  --line-compact: 1.3;
  --space-xs: clamp(.25rem, .18rem + .28vw, .5rem);
  --space-sm: clamp(.5rem, .36rem + .54vw, .875rem);
  --space-md: clamp(.75rem, .55rem + .8vw, 1.375rem);
  --space-lg: clamp(1rem, .74rem + 1.04vw, 1.875rem);
  --content-gutter: clamp(.75rem, .45rem + 1.45vw, 2.625rem);
  --icon-sm: clamp(1rem, .86rem + .54vw, 1.375rem);
  --icon-size: clamp(1.375rem, 1.2rem + .7vw, 1.875rem);
  --icon-lg: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --control-size: clamp(44px, 2.35rem + 1.65vw, 3.75rem);
  --field-size: max(var(--control-size), 3em);
  --radius-sm: clamp(.5rem, .4rem + .4vw, .875rem);
  --radius: clamp(1.25rem, 1.1rem + .55vw, 1.625rem);
  --app-max: 1500px;
  --content-max: 1250px;
  --dialog-max: clamp(24rem, 19rem + 18vw, 35rem);
  --nav-width: 240px;
  /* Výška pojme header.png v poměru 103,73 % šířky bez oříznutí horní hrany. */
  --mobile-header-height: calc(34.58vw + env(safe-area-inset-top, 0px));
  --mobile-safe-bottom: max(0px, calc(env(safe-area-inset-bottom, 0px) - 20px));
  --mobile-footer-graphic-height: clamp(96px, 24vw, 176px);
  --mobile-footer-height: calc(var(--mobile-footer-graphic-height) + var(--mobile-safe-bottom));
  --mobile-footer-add-size: clamp(56px, 15vw, 118px);
  --menu-item-radius: clamp(.85rem, 2.8vw, 1.35rem);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  color-scheme: light;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 0;
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: var(--text-body);
  line-height: var(--line-body);
  overflow-wrap: anywhere;
}

button, a { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { color: inherit; font: inherit; }
input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
  min-height: var(--field-size);
  max-width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
textarea { resize: vertical; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

button, input:is([type="button"], [type="submit"], [type="reset"]) {
  -webkit-tap-highlight-color: transparent;
}
:focus {
  outline: none;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: var(--icon-size); height: var(--icon-size); flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}
.sidebar { display: none; }
.desktop-header, .desktop-add-button { display: none; }
.page {
  display: flex;
  min-width: 0;
  height: 100%;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.mobile-header {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--mobile-header-height);
  min-height: var(--mobile-header-height);
  padding: env(safe-area-inset-top, 0px) 16px 8px;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: transparent;
}
.mobile-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-color: transparent;
  background-image: url("../images/header.png");
  background-repeat: no-repeat;
  background-position: left bottom;
  /* Celý obrázek zůstává v původním poměru i při započtené iOS safe area. */
  /* Hrot srdce je v originálu na x=1047 z 2172 px; dorovnání na osu tlačítka +. */
  background-size: 103.73% auto;
  pointer-events: none;
}
.mobile-brand {
  position: absolute;
  z-index: 1;
  top: env(safe-area-inset-top, 0px);
  bottom: 0;
  left: 21%;
  width: 58%;
  border-radius: 18px;
}
.mobile-header .header-actions {
  position: absolute;
  z-index: 2;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 14px;
}
.mobile-header .icon-button {
  border: 1px solid rgb(72 94 68 / 12%);
  border-radius: var(--radius-sm);
  background: rgb(255 253 249 / 88%);
  color: var(--sage-700);
  box-shadow: 0 4px 14px rgb(72 94 68 / 12%);
  backdrop-filter: blur(8px);
}

.brand { display: inline-flex; align-items: center; gap: 9px; min-height: var(--control-size); font-weight: 780; font-size: var(--text-body); line-height: 1.05; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--sage-700); font-family: Georgia, serif; font-size: var(--text-display); font-weight: 400; line-height: .8; transform: rotate(-4deg); }
.header-actions { display: flex; gap: 8px; }
.icon-button, .profile-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 78%);
  cursor: pointer;
}
.icon-button:hover { background: var(--sage-50); }
.notification-badge {
  position: absolute;
  inset-block-start: 15%;
  inset-inline-end: 15%;
  display: grid;
  place-items: center;
  min-inline-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  min-block-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  padding-inline: .2em;
  transform: translate(50%, -50%);
  border: 2px solid #fffdf9;
  border-radius: 999px;
  background: #ae3936;
  color: #fff;
  font-size: var(--text-caption);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.mobile-header .notification-badge { inset-block-start: 8%; inset-inline-end: 8%; }

.mobile-menu {
  --menu-inset: clamp(1rem, 3.5vw, 1.85rem);
  --menu-button: clamp(2.75rem, 2.25rem + 2.5vw, 3.75rem);
  --menu-top: calc(58px + env(safe-area-inset-top, 0px));
  inset: var(--menu-top) 0 0;
  width: calc(min(480px, 100%) - 1.3rem);
  max-width: none;
  height: calc(100dvh - var(--menu-top));
  max-height: none;
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: clamp(1.15rem, 4vw, 1.85rem) clamp(1.15rem, 4vw, 1.85rem) 0 0;
  background: radial-gradient(ellipse at top, #fff8e8, #faeacf);
  color: var(--ink);
  box-shadow: 0 16px 48px rgb(38 50 35 / 34%);
}
.mobile-menu[open] {
  display: flex;
  flex-direction: column;
  animation: mobile-menu-in .32s cubic-bezier(.22, 1, .36, 1) both;
}
.mobile-menu::backdrop {
  position: fixed;
  inset: 0;
  background: rgb(33 39 24 / 46%);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.mobile-menu-header {
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  flex: none;
  padding: var(--space-sm) var(--menu-inset) clamp(1.75rem, 5vw, 2.65rem);
  background: linear-gradient(#f9dfb8, #f9edcf 75%, #fdf0d7);
}
.mobile-menu-header::before,
.mobile-menu-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.mobile-menu-header::before {
  background:
    linear-gradient(90deg, #fff5df 39%, rgb(255 248 225 / 56%) 58%, transparent 82%),
    url('../menu/krajina_s_detmi.png') center bottom .6rem / 100% auto no-repeat;
  mask-image: linear-gradient(#000 83%, transparent 97%);
}
.mobile-menu-header::after {
  inset-block-start: auto;
  height: clamp(1.35rem, 5vw, 2.5rem);
  background: url('../menu/spodni_vlna.svg') center bottom / 100% 100% no-repeat;
}
.mobile-menu-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-sm);
  background: url('../menu/oddelovac_srdce.svg') left bottom / 100% .45rem no-repeat;
  color: #526f32;
  font-size: var(--text-xs);
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mobile-menu-heading::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: var(--space-sm);
  left: 0;
  width: min(36%, 9.75rem);
  aspect-ratio: 590 / 248;
  background: url('../menu/krajina_s_detmi.png') left top / 245.76% auto no-repeat;
  /* Výřez původní větvičky odděluje lístky od krajiny pod nimi. */
  clip-path: polygon(0 0, 100% 0, 100% 40%, 89% 54%, 57% 59%, 48% 66%, 31% 73%, 17% 86%, 0 100%);
  pointer-events: none;
}
.mobile-menu-header h2 {
  margin: 0;
  color: #293d22;
  font-size: clamp(1.45rem, 1rem + 2.4vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.mobile-menu-header p {
  max-inline-size: min(74%, 34ch);
  margin: var(--space-xs) 0 0;
  color: #495740;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--line-compact);
}
.mobile-menu-tools {
  order: -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}
.mobile-menu-version {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid #638634;
  border-radius: calc(var(--menu-item-radius) / 2);
  background: #f5eed4;
  color: #2e4b24;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: var(--line-compact);
  box-shadow: 0 2px 5px rgb(66 80 32 / 12%);
}
.mobile-menu-version::before {
  content: "";
  flex: none;
  width: .85em;
  height: .65em;
  border-radius: 85% 0 85% 0;
  background: #527c20;
  transform: rotate(-25deg);
}
.mobile-menu-user {
  position: absolute;
  inset-block-start: calc(var(--space-sm) + var(--menu-button) - .125rem - 3px);
  inset-inline-end: calc(var(--menu-inset) + var(--menu-button) + var(--space-sm));
  display: flex;
  align-items: center;
  gap: .45rem;
  width: min(38%, 10rem);
  min-height: 1.8rem;
  min-width: 0;
  text-align: right;
}
.mobile-menu-user[hidden] { display: none; }
.mobile-menu-user-copy { display: grid; flex: 1 1 auto; grid-template-rows: repeat(2, minmax(0, 1fr)); align-content: center; min-width: 0; min-height: 1.8rem; gap: 0; line-height: 1.05; }
.mobile-menu-user-name,
.mobile-menu-user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-user-name { color: #293d22; font-size: var(--text-xs); font-weight: 800; }
.mobile-menu-user-role { color: #587c32; font-size: clamp(.62rem, 2.3vw, .75rem); font-weight: 650; }
.mobile-menu-user-photo { position: static; flex: none; width: 1.8rem; height: 1.8rem; border: 1px solid #fffdf8; border-radius: .42rem; object-fit: cover; background: #e8eee3; box-shadow: 0 2px 7px rgb(48 53 45 / 12%); }
.mobile-menu-user-photo[hidden] { display: none; }
.mobile-menu-header:has(.mobile-menu-user:not([hidden])) .mobile-menu-heading { padding-inline-end: min(38%, 10rem); }
.mobile-menu-header:has(.mobile-menu-user:not([hidden])) .mobile-menu-heading p { max-inline-size: 100%; }
.mobile-menu-mode-switcher {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: var(--space-sm) var(--menu-inset) 0;
  padding: 2px;
  border: 1px solid #fffdf8;
  border-radius: var(--radius-sm);
  background: #fff9ee;
  box-shadow: 0 3px 9px rgb(88 69 37 / 9%);
}
.mobile-menu-mode-switcher[hidden] { display: none; }
.mobile-menu-mode-switcher[data-mode-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mobile-menu-mode-button {
  display: flex;
  min-width: 0;
  min-height: clamp(1.35rem, 1.2rem + .7vw, 1.65rem);
  align-items: center;
  justify-content: center;
  gap: clamp(.2rem, .7vw, .5rem);
  padding: .1rem clamp(.2rem, .8vw, .65rem);
  border: 0;
  border-radius: max(.3rem, calc(var(--radius-sm) - .2rem));
  background: #efeee9;
  color: #365238;
  font-size: clamp(.7rem, .62rem + .34vw, .9rem);
  font-weight: 750;
  line-height: 1.15;
  cursor: pointer;
}
.mobile-menu-mode-button[hidden] { display: none; }
.mobile-menu-mode-button.is-active { background: linear-gradient(130deg, #638e30, #3e741f); color: #fffdf7; }
.mobile-menu-mode-icon { width: clamp(.8rem, .75rem + .25vw, 1rem); height: clamp(.8rem, .75rem + .25vw, 1rem); flex: none; }
.mobile-menu-mode-icon path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-menu-add[hidden],
.mobile-menu-mode-content[hidden] { display: none !important; }
.mobile-menu-empty {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md);
  border: 1px solid #e8dec9;
  border-radius: var(--menu-item-radius);
  background: #fff9ee;
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
}
.mobile-menu-close {
  display: grid;
  flex: none;
  width: var(--menu-button);
  height: var(--menu-button);
  place-items: center;
  padding: 0;
  border: 2px solid #a89566;
  border-radius: var(--radius-sm);
  background: #fffaf0;
  box-shadow: 0 3px 9px rgb(50 66 47 / 22%);
  cursor: pointer;
  appearance: none;
}
.mobile-menu-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  object-fit: contain;
  flex: none;
}
.mobile-menu-actions { flex: none; padding: var(--space-sm) var(--menu-inset) var(--space-md); }
.mobile-menu-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--menu-inset) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.mobile-menu-body::-webkit-scrollbar { display: none; }
.mobile-menu-add, .mobile-menu-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(var(--menu-button) + .35rem);
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 3px solid #fff7e9;
  border-radius: var(--menu-item-radius);
  color: #fff;
  font-size: var(--text-lg);
  font-weight: 850;
  line-height: var(--line-compact);
  box-shadow: 0 5px 13px rgb(66 80 32 / 26%);
  cursor: pointer;
}
.mobile-menu-add { background: linear-gradient(125deg, #74a70b, #458909 55%, #24580a); }
.mobile-menu-logout {
  margin-block-start: var(--space-md);
  background: linear-gradient(125deg, #ac3e38, #96312d 55%, #76231f);
  box-shadow: 0 5px 13px rgb(118 35 31 / 22%);
  opacity: 1;
  cursor: default;
}
.mobile-menu-add .mobile-menu-icon { filter: brightness(0) invert(1); }
.mobile-menu-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0 0 var(--space-sm);
  color: #475e3b;
  font-size: var(--text-xs);
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.mobile-menu-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #a2ae79, transparent);
}
.mobile-menu-list { display: grid; gap: var(--space-xs); margin: 0 0 var(--space-lg); padding: 0; list-style: none; }
.mobile-menu-list-secondary { margin-bottom: 0; }
.mobile-menu-list-secondary.mobile-menu-list-family { margin-bottom: var(--space-lg); }
.mobile-menu-link {
  display: grid;
  grid-template-columns: var(--menu-button) minmax(0, 1fr) var(--icon-sm);
  align-items: center;
  min-height: var(--menu-button);
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border: 2px solid transparent;
  border-radius: var(--menu-item-radius);
  background: #fff9ee;
  color: #2e392a;
  font-size: var(--text-body);
  font-weight: 750;
  line-height: var(--line-compact);
  overflow-wrap: anywhere;
  box-shadow: 0 4px 11px rgb(88 69 37 / 11%);
}
.mobile-menu-link-credit { grid-template-columns: var(--menu-button) minmax(0, 1fr) auto var(--icon-sm); }
.mobile-menu-credit-balance {
  justify-self: end;
  max-width: 7.5rem;
  padding: .35rem .55rem;
  overflow: hidden;
  border: 1px solid #e9e2d2;
  border-radius: .55rem;
  background: #fff9ee;
  color: #365d2f;
  font-size: clamp(.66rem, 2.2vw, .78rem);
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-menu-link:hover { background: #fffdf7; }
.mobile-menu-link.is-disabled,
.nav-link.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}
.nav-link[hidden],
.mobile-menu-link[hidden] {
  display: none !important;
}
.mobile-menu-link.is-active {
  border-color: #fffdf7;
  background: linear-gradient(100deg, #e9edce, #dfe6c4);
  color: #294c19;
}
.mobile-menu-link-icon {
  display: grid;
  min-height: calc(var(--menu-button) * .74);
  place-items: center;
  border-radius: clamp(.55rem, 1.8vw, .9rem);
  background: #eef0d4;
}
.mobile-menu-chevron { width: var(--icon-sm); height: var(--icon-sm); }
.mobile-menu-storage {
  display: grid;
  gap: var(--space-xs);
  margin-block-start: var(--space-md);
  padding: var(--space-sm);
  border: 1px solid #eee3cc;
  border-radius: var(--menu-item-radius);
  background: #fff9ee;
  color: var(--sage-700);
  box-shadow: 0 3px 9px rgb(88 69 37 / 8%);
}
.mobile-menu-storage-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xs);
}
.mobile-menu-storage-heading h3 { margin: 0; font-size: var(--text-body); overflow-wrap: anywhere; }
.mobile-menu-storage-usage { margin: 0; font-size: var(--text-sm); }
.mobile-menu-storage-remaining { margin: 0; font-size: var(--text-xs); }
.mobile-menu-storage-remaining[data-platform-summary="true"] { white-space: pre-line; }
.mobile-menu-storage-meter {
  display: block;
  width: 100%;
  height: clamp(.3rem, .65vw, .45rem);
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e0e8da;
}
.mobile-menu-storage-meter::-webkit-meter-bar { border: 0; background: #e0e8da; }
.mobile-menu-storage-meter::-webkit-meter-optimum-value { background: var(--sage-500); }
.mobile-menu-storage-meter::-moz-meter-bar { background: var(--sage-500); }
.mobile-menu-credit {
  margin: var(--space-md) 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

@keyframes mobile-menu-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .mobile-menu {
    width: min(28rem, calc(100% - 2.5rem));
  }
}

main {
  width: 100%;
  max-width: var(--content-max);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: calc(var(--mobile-header-height) + var(--space-lg)) var(--content-gutter) calc(var(--mobile-footer-height) + var(--space-lg));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
main::-webkit-scrollbar { display: none; }
.welcome {
  position: relative;
  margin-bottom: clamp(24px, 7vw, 34px);
  padding-right: 10%;
}
.welcome::after {
  content: none;
  position: absolute;
  pointer-events: none;
}
.eyebrow { display: none; margin: 0 0 8px; color: #464b45; font-size: var(--text-sm); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: var(--text-title); line-height: 1.12; letter-spacing: -.035em; }
.wave { display: inline-block; font-size: .78em; }
.lead { max-width: 390px; margin-bottom: 0; color: #3d433b; font-size: var(--text-body); line-height: 1.45; }

.family-strip {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 6px;
  margin: 0 -4px 18px;
}
.family-tree-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: #658b51;
  stroke-width: clamp(1.5px, .24vw, 2.25px);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.family-tree-leaves { fill: #91ab6b; stroke: none; }
.family-strip[data-family-tree]:has(> .family-tree-parents) {
  row-gap: clamp(1.75rem, 5vw, 2.75rem);
}
.family-tree-parents, .family-tree-children {
  --tree-card-gap: clamp(.6rem, 2.4vw, 1.75rem);
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--tree-card-gap);
  grid-column: 1 / -1;
}
.family-tree-parents { gap: clamp(.4rem, 1.5vw, 1rem); }
.family-tree-parents > [data-parent-role="matka"] { order: -1; }
.family-tree-parents > [data-parent-role="otec"] { order: 1; }
.family-tree-children {
  --tree-card-gap: clamp(1.1rem, 4.5vw, 2.75rem);
  flex-wrap: wrap;
  row-gap: var(--space-lg);
}
.family-tree-parents > .child-card, .family-tree-children > .child-card {
  flex: 0 0 calc((100% - 2 * var(--tree-card-gap)) / 3);
}
.family-parent-label { color: var(--muted); font-size: var(--text-xs); line-height: var(--line-compact); }
.family-block-label, .family-block-divider { display: none; }
.child-card { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.avatar { display: grid; place-items: center; width: clamp(64px, 21vw, 82px); aspect-ratio: 1; border: 4px solid white; border-radius: 50%; box-shadow: 0 5px 18px rgb(48 53 45 / 14%); background-color: #e8eee3; }
.child-profile-photo { object-fit: cover; }
.mock-crop { background-image: url("../images/design-reference.png"); background-repeat: no-repeat; }
.photo-eliska { background-size: 1770% auto; background-position: 81.8% 40.7%; }
.photo-matej { background-size: 1770% auto; background-position: 89.5% 40.7%; }
.child-info { display: flex; min-width: 0; flex-direction: column; }
.child-info strong { font-size: var(--text-body); line-height: 1.12; }
.child-info small { margin-top: 3px; color: #3f443e; font-size: var(--text-sm); line-height: 1.15; }
.child-chevron { display: none; }
.family-avatar { background: var(--sage-50); color: var(--sage-700); }
.family-avatar .icon { width: 34px; height: 34px; }
.parent-profile-photo.is-hidden,
.parent-avatar-fallback.is-hidden { display: none !important; }
.parent-avatar-fallback { position: relative; }
.parent-avatar-fallback .parent-photo-fallback-camera { position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; padding: 3px; border: 2px solid #fffdf9; border-radius: 50%; background: #f3f4e9; }
.parent-profile-photo.is-visible { display: block; }

.dashboard-grid { display: grid; gap: 18px; }
.primary-column { min-width: 0; }
.memory-hero {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  border-radius: 20px;
  color: white;
  background-color: #6e766a;
  background-size: 302% auto;
  background-position: 24.2% 57.8%;
  box-shadow: var(--shadow);
}
.memory-hero-link { position: absolute; z-index: 2; inset: 0; border-radius: inherit; }
.memory-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(20 27 22 / 12%), transparent 67%); pointer-events: none; }
.memory-hero-content { position: relative; z-index: 1; display: flex; min-height: 138px; flex-direction: column; justify-content: flex-start; padding: 15px 18px; }
.memory-hero-content p { margin-bottom: 4px; font-size: var(--text-sm); font-weight: 700; }
.memory-hero-content h2 { margin: 0; font-size: var(--text-lg); line-height: 1.15; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control-size); padding: 10px 16px; border-radius: 999px; font-size: var(--text-body); font-weight: 700; }
.button-light { display: none; align-self: flex-start; margin-top: 18px; background: white; color: var(--ink); }
.button .icon { width: 18px; height: 18px; }
.carousel-dots { position: absolute; z-index: 2; right: var(--space-md); bottom: var(--space-sm); display: flex; gap: var(--space-xs); }
.carousel-dots span {
  width: calc(var(--icon-lg) * .38);
  aspect-ratio: 1;
  border: 2px solid white;
  border-radius: 50%;
  background: transparent;
}
.carousel-dots .active { background: white; }

.panel { border: 1px solid rgb(255 255 255 / 88%); border-radius: var(--radius); background: rgb(255 253 249 / 88%); box-shadow: var(--shadow); }
.panel h2, .section-heading h2 { margin: 0; font-size: var(--text-lg); letter-spacing: -.02em; }
.title-icon { width: 24px; height: 24px; margin-right: 9px; color: var(--sage-700); vertical-align: -5px; }
.quick-panel { order: -1; padding: 14px; }
.quick-panel > h2 { display: none; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-action { display: flex; min-width: 0; min-height: 78px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 8px 3px; border: 0; border-radius: 15px; cursor: pointer; }
.quick-action:hover { filter: brightness(.97); transform: translateY(-1px); }
.quick-action .icon { width: 28px; height: 28px; }
.quick-action span { font-size: var(--text-sm); }
.tone-green { color: #176d62; background: #eef5ed; }
.tone-rose { color: #ae594c; background: #f9efed; }
.tone-peach { color: #b05b18; background: #fff1e6; }
.tone-amber { color: #db8215; background: #fff0df; }
.tone-purple { color: #684a8d; background: #f2eef8; }

.secondary-column { display: contents; }
.events-panel, .stats-panel { padding: 18px; }
.events-panel { display: none; }
.event-list { margin-top: 8px; }
.event-item { display: grid; grid-template-columns: 40px 1fr 24px; align-items: center; min-height: 62px; border-top: 1px solid var(--border); }
.event-item:first-child { border-top: 0; }
.event-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #d25b38; background: #fff0e9; }
.event-item:nth-child(2) .event-icon { color: #684a8d; background: #f2eef8; }
.event-item strong, .event-item small { display: block; }
.event-item strong { font-size: var(--text-body); }
.event-item small { color: var(--muted); }
.event-item > .icon { width: 18px; }

.memories-section { margin-top: 21px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.section-heading a { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-size); color: #414740; font-size: var(--text-sm); }
.section-heading a .icon { width: 17px; height: 17px; }
.memories-list { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 8px; overflow-x: auto; scrollbar-width: none; }
.memories-list::-webkit-scrollbar { display: none; }
.memory-card { min-width: 0; }
.memory-photo { position: relative; aspect-ratio: 1 / .96; border-radius: 11px; background-color: #ddd; }
.memory-snow { background-size: 1310% auto; background-position: 18.2% 83.1%; }
.memory-castle { background-size: 1310% auto; background-position: 27.7% 83.1%; }
.memory-cake { background-size: 1310% auto; background-position: 37.1% 83.1%; }
.memory-summer { background-size: 1310% auto; background-position: 46.7% 83.1%; }
.memory-card h3 { margin: 7px 1px 1px; font-size: var(--text-sm); line-height: var(--line-compact); }
.memory-card p { margin: 0 1px; color: var(--muted); font-size: var(--text-xs); }

.stats-panel { display: none; }
.stats-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; min-height: 105px; flex-direction: column; justify-content: center; padding: 12px 16px; border-radius: 16px; }
.stat .icon { width: 25px; height: 25px; margin-bottom: 8px; }
.stat strong { font-size: var(--text-section); }
.stat span { font-size: var(--text-sm); }

.bottom-nav {
  position: fixed;
  z-index: 20;
  top: calc(var(--visible-viewport-bottom, 100dvh) - var(--mobile-footer-height));
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  height: var(--mobile-footer-height);
  min-height: var(--mobile-footer-height);
  padding: 0 0 var(--mobile-safe-bottom);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.bottom-nav::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 100%;
  background: url("../images/footer.png") center 25% / 100% auto no-repeat;
  pointer-events: none;
}
.bottom-nav a {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 3px;
  padding: 4px 2px 6px;
  color: #334039;
  font-size: var(--text-caption);
  text-shadow: 0 1px 2px rgb(253 248 236 / 92%);
}
.bottom-nav a:nth-of-type(1) { grid-column: 1; }
.bottom-nav a:nth-of-type(2) { grid-column: 2; }
.bottom-nav a:nth-of-type(3) { grid-column: 4; }
.bottom-nav a:nth-of-type(4) { grid-column: 5; }
.bottom-nav a.is-active { color: var(--sage-700); font-weight: 700; }
.bottom-nav .icon {
  width: 36px;
  height: 36px;
  padding: 7px;
  border: 1px solid rgb(72 94 68 / 18%);
  border-radius: var(--radius-sm);
  background: rgb(255 253 249 / 86%);
  box-shadow: 0 3px 10px rgb(45 61 42 / 13%);
  backdrop-filter: blur(5px);
}
.bottom-nav a.is-active .icon {
  border-color: rgb(72 94 68 / 30%);
  background: rgb(232 239 227 / 94%);
  box-shadow: 0 3px 12px rgb(45 61 42 / 18%);
}
.footer-menu-button {
  position: absolute;
  z-index: 2;
  /* Střed kruhu v footer.png při background-position: center 25 %. */
  top: calc(7.2vw + var(--mobile-footer-height) / 4);
  left: 50%;
  width: var(--mobile-footer-add-size);
  height: var(--mobile-footer-add-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.footer-menu-button::before {
  content: "";
  position: absolute;
  width: 14.25vw;
  aspect-ratio: 1;
  border: clamp(2px, .68vw, 8px) solid #fff9e9;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 42% 24%, #638408, #355a09 80%);
}
.bottom-nav .footer-menu-button .icon {
  position: relative;
  width: clamp(22px, 6.8vw, 76px);
  height: clamp(22px, 6.8vw, 76px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: #fff;
}

@media (min-width: 560px) {
  .family-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .child-card { flex-direction: row; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgb(255 253 249 / 82%); text-align: left; box-shadow: 0 5px 20px rgb(48 53 45 / 6%); }
  .avatar { width: 72px; flex: 0 0 72px; }
  .child-info { flex: 1; }
  .child-chevron { display: block; width: 20px; }
  .memory-hero { min-height: 240px; }
  .memory-hero-content { min-height: 240px; justify-content: center; padding: 28px; }
  .memory-hero-content h2 { font-size: var(--text-title); }
  .button-light { display: inline-flex; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.6fr) minmax(290px, .9fr); }
  .secondary-column { display: flex; flex-direction: column; gap: 16px; }
  .quick-panel { order: initial; }
  .quick-panel > h2, .events-panel, .stats-panel { display: block; }
  .quick-panel > h2 { margin-bottom: 12px; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
      --mobile-footer-graphic-height: clamp(176px, 19vw, 214px);
    --mobile-footer-add-size: clamp(118px, 13vw, 142px);
    --tablet-header-button-size: clamp(52px, 6.25vw, 72px);
    --tablet-header-icon-size: clamp(26px, 3.1vw, 36px);
    --tablet-header-action-gap: clamp(10px, 1.4vw, 16px);
  }
  .mobile-header .header-actions {
    top: calc(env(safe-area-inset-top, 0px) + clamp(16px, 2vw, 24px));
    right: clamp(20px, 3vw, 36px);
    gap: var(--tablet-header-action-gap);
  }
  .mobile-header .icon-button {
    width: var(--tablet-header-button-size);
    height: var(--tablet-header-button-size);
  }
  .mobile-header .icon-button .icon {
    width: var(--tablet-header-icon-size);
    height: var(--tablet-header-icon-size);
  }
  .welcome {
    margin-bottom: 34px;
    padding-right: 35%;
  }
  .bottom-nav a {
    min-height: clamp(72px, 8.5vw, 92px);
    gap: clamp(4px, .7vw, 8px);
    padding: 6px 4px clamp(8px, 1.2vw, 14px);
    font-size: var(--text-xs);
  }
  .bottom-nav .icon {
    width: clamp(44px, 5.5vw, 58px);
    height: clamp(44px, 5.5vw, 58px);
    padding: clamp(8px, 1vw, 11px);
  }
}

@media (min-width: 1200px) {
  :root { --nav-width: 240px; }
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: auto;
    touch-action: auto;
  }
  body {
    height: auto;
    min-height: 100vh;
    padding: 24px clamp(20px, 3vw, 56px);
    overflow-x: hidden;
    overflow-y: visible;
    overscroll-behavior: auto;
    touch-action: auto;
  }
  .app-shell {
    display: grid;
    max-width: var(--app-max);
    margin-inline: auto;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    height: auto;
    min-height: calc(100dvh - 48px);
    border: 4px solid rgb(255 253 249 / 88%);
    border-radius: 36px;
    background: var(--canvas);
    box-shadow: 0 12px 36px rgb(83 63 33 / 16%), 0 2px 8px rgb(83 63 33 / 9%);
    overflow: clip;
    overscroll-behavior: auto;
    touch-action: auto;
  }
  .page {
    display: block;
    height: auto;
    min-height: calc(100dvh - 56px);
    overflow: visible;
  }
  .sidebar {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 106px;
    height: auto;
    min-height: calc(100dvh - 56px);
    padding: 24px 0 0;
    border-right: 1px solid rgb(226 219 210 / 76%);
    background: rgb(255 253 249 / 62%);
    overflow: clip;
  }
  .sidebar > nav {
    position: sticky;
    top: 24px;
    align-self: start;
    min-height: 0;
    max-height: calc(100dvh - 186px);
    padding: 0 16px 16px;
    overflow-y: auto;
  }
  .sidebar::after {
    content: "";
    display: block;
    height: 106px;
    width: 100%;
    /* Kompenzace průhledných okrajů: 41 px vlevo a 16 px dole v originálu. */
    background: url("../images/desktop/dekorace_panelu.png") right bottom -8px / 108.933% auto no-repeat;
    pointer-events: none;
  }
  .sidebar .brand { display: none; }
  .sidebar .brand-mark { width: 44px; height: 44px; font-size: var(--text-display); }
  .desktop-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 48px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border: 0;
    border-radius: 16px;
    background: var(--sage-500);
    color: white;
    font-weight: 750;
    box-shadow: 0 6px 18px rgb(72 94 68 / 22%);
    cursor: pointer;
  }
  .desktop-add-button .icon { width: 21px; height: 21px; }
  .nav-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .nav-link { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--control-size); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-size: var(--text-body); }
  .nav-link .icon { width: 21px; height: 21px; color: #5e594e; }
  .nav-link:hover { background: rgb(224 233 220 / 56%); }
  .nav-link.is-active { background: linear-gradient(90deg, #dce8d7, #e6ede3); font-weight: 700; }
  .nav-link.is-active .icon { color: var(--sage-700); }
  .nav-list-secondary { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
  .mobile-header, .bottom-nav { display: none; }
  .mobile-menu { display: none; }
  .desktop-header {
    position: relative;
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    isolation: isolate;
    background: var(--canvas);
  }
  .desktop-header::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: url("../images/desktop/header.png") center / cover no-repeat;
    pointer-events: none;
  }
  .desktop-brand-target {
    position: absolute;
    z-index: 2;
    top: 4px;
    bottom: 4px;
    left: 50%;
    width: 172px;
    transform: translateX(-50%);
  }
  .desktop-header-actions {
    position: absolute;
    z-index: 3;
    top: 22px;
    right: max(24px, calc((100% - 1250px) / 2 + 24px));
    display: flex;
    align-items: center;
    gap: 10px;
  }
  main {
    height: auto;
    min-height: 0;
    padding: 20px 28px 36px;
    overflow: visible;
    overscroll-behavior: auto;
  }
  .welcome {
    margin-bottom: 20px;
    padding: 0;
  }
  .eyebrow { display: block; }
  .lead { max-width: 560px; }
  .profile-button { width: auto; padding: 0 8px 0 4px; gap: 3px; }
  .profile-button > .icon { width: 16px; }
  .profile-photo { width: 36px; height: 36px; border-radius: 50%; background-size: 2550% auto; background-position: 70.5% 14.2%; }
  .family-strip { gap: 16px; margin: 0 0 24px; }
  .child-card { min-height: 84px; padding: 8px 14px 8px 8px; }
  .avatar { width: 68px; flex-basis: 68px; }
  .child-info strong { font-size: var(--text-body); }
  .child-info small { font-size: var(--text-sm); }
  .dashboard-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
  .primary-column, .secondary-column { min-width: 0; }
  .secondary-column { gap: 12px; }
  .memory-hero { min-height: 0; aspect-ratio: 1.95; }
  .memory-hero-content { min-height: clamp(250px, 20vw, 310px); padding: 30px; }
  .memory-hero-content p { font-size: var(--text-sm); letter-spacing: .08em; text-transform: uppercase; }
  .memory-hero-content h2 { font-size: var(--text-display); }
  .panel { border-radius: 20px; }
  .quick-panel, .events-panel, .stats-panel { padding: 14px 16px; }
  .quick-action { min-height: 62px; }
  .quick-action .icon { width: 24px; height: 24px; }
  .event-item { min-height: 48px; grid-template-columns: 36px minmax(0, 1fr) 18px; }
  .event-item strong { font-size: var(--text-sm); }
  .event-item small { font-size: var(--text-sm); }
  .stats-list { gap: 6px; }
  .stat { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 7px; min-height: 64px; padding: 8px; }
  .stat .icon { grid-row: 1 / 3; align-self: center; margin: 0; }
  .stat strong { font-size: var(--text-lg); }
  .stat span { font-size: var(--text-xs); }
  .memories-section { margin-top: 24px; }
  .memories-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; overflow: visible; }
  .memory-photo { border-radius: 13px; aspect-ratio: 1.25; }
  .stats-panel { margin-top: 0; }
}

@media (max-width: 374px) {
  .mobile-header { padding-inline: 12px; }
  .quick-action { min-height: 72px; }
  .quick-action span { font-size: var(--text-xs); }
  .avatar { border-width: 3px; }
  .child-info strong { font-size: var(--text-sm); }
  .child-info small { font-size: var(--text-caption); }
  .mobile-menu-mode-button { gap: 0; padding-inline: 2px; font-size: .67rem; }
  .mobile-menu-mode-icon { display: none; }
}

.prehled-obsah { display: contents; }
.prehled-obsah .overview-only { display: none; }

/* Nový obsah Přehledu; společný shell a desktop používají původní pravidla. */
@media (max-width: 1199px) {
  main:has(> .prehled-obsah) { padding-top: calc(var(--mobile-header-height) + 10px); }
  .prehled-obsah { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); }
  .prehled-obsah .dashboard-grid,
  .prehled-obsah .primary-column,
  .prehled-obsah .secondary-column { display: contents; }
  .prehled-obsah .welcome { grid-column: 1 / -1; order: 1; margin: 0; padding: 0; text-align: center; }
  .prehled-obsah .eyebrow { display: block; margin-bottom: 2px; color: #526f32; font-size: var(--text-xs); font-weight: 850; letter-spacing: .13em; line-height: 1.2; }
  .prehled-obsah .welcome .eyebrow::after {
    content: "";
    display: block;
    width: clamp(5rem, 18vw, 8rem);
    height: .45rem;
    margin: var(--space-xs) auto 0;
    background: url('../menu/oddelovac_srdce.svg') center / 100% 100% no-repeat;
  }
  .prehled-obsah h1 { margin-bottom: 2px; font-size: var(--text-title); font-weight: 850; line-height: 1.08; }
  .prehled-obsah .welcome h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
  }
  .prehled-obsah .welcome h1::before,
  .prehled-obsah .welcome h1::after {
    content: "";
    flex: 0 0 clamp(1.65rem, 9vw, 3rem);
    height: 1em;
    background: url('../images/overview/welcome-leaves.png') center / 210% auto no-repeat;
  }
  .prehled-obsah .welcome h1::before { transform: scaleX(-1); }
  .prehled-obsah .welcome .wave { display: none; }
  .prehled-obsah .lead { max-width: 580px; margin: 2px auto 0; font-size: var(--text-body); font-weight: 650; line-height: var(--line-compact); }
  .prehled-obsah .overview-lead-ending { display: block; }
  .prehled-obsah .family-strip { grid-column: 1 / -1; order: 2; gap: var(--space-sm); margin: 0; align-items: stretch; overflow: visible; container-type: inline-size; }
  .prehled-obsah .family-strip[data-family-tree] {
    --family-background: #fff8e9 url('../family/pozadi_rodina.png') center / 100% 100% no-repeat;
    width: min(calc(100% - .75rem), 48rem);
    justify-self: center;
    row-gap: var(--space-xs);
    padding: var(--space-sm) var(--space-sm) clamp(1.5rem, 4vw, 2.75rem);
    border: 2px solid #fffdf9;
    border-radius: var(--radius);
    background: var(--family-background);
    box-shadow: 0 5px 16px rgb(91 68 30 / 12%);
  }
  .prehled-obsah .family-tree-lines { display: none; }
  .family-block-label {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    margin: 0;
    color: #3d6027;
    font-size: var(--text-sm);
  }
  .family-block-label > span {
    display: flex;
    align-items: center;
    gap: clamp(.25rem, .8vw, .4rem);
    padding: clamp(.2rem, .6vw, .35rem) clamp(.5rem, 1vw, .75rem);
    border: 1px solid rgb(101 139 81 / 18%);
    border-radius: var(--radius-sm);
    background: #fff8e9;
    box-shadow: 0 2px 5px rgb(91 68 30 / 10%);
  }
  .family-block-label > span::before {
    content: "";
    width: var(--icon-sm);
    aspect-ratio: 1;
    background: url('../menu/nase_rodina.svg') center / contain no-repeat;
  }
  .family-block-parents-label,
  .family-block-children-label { gap: var(--space-xs); }
  .family-block-parents-label::before,
  .family-block-parents-label::after,
  .family-block-children-label::before,
  .family-block-children-label::after {
    content: "";
    flex: 0 1 clamp(2rem, 16%, 8rem);
    height: 1px;
    background: linear-gradient(to right, transparent, #658b51);
  }
  .family-block-parents-label::after,
  .family-block-children-label::after { transform: scaleX(-1); }
  .family-block-divider {
    display: none;
  }
  .family-tree-parents, .family-tree-children { gap: var(--space-md); }
  .family-tree-parents > .child-card { flex-basis: min(46%, 18rem); }
  .family-tree-children > .child-card { flex-basis: min(41%, 17rem); }
  .prehled-obsah .child-card { --profile-circle: max(64px, 22cqi); margin-top: calc(var(--profile-circle) / 4); position: relative; min-height: clamp(108px, 28vw, 146px); flex-direction: column; justify-content: center; gap: 9px; padding: calc(var(--profile-circle) * .75 + 12px) 6px 14px; overflow: visible; border: 2px solid #fffdf9; border-radius: 22px; background: linear-gradient(145deg, #fff9f7, #f8e4df); text-align: center; box-shadow: 0 5px 15px rgb(91 68 30 / 11%); }
  .prehled-obsah .family-tree-parents > .child-card,
  .prehled-obsah .family-tree-children > .child-card { padding-block-start: calc(var(--profile-circle) * .62 + 8px); }
  .prehled-obsah .family-tree-parents > .child-card { padding-block-start: calc(var(--profile-circle) * .57 + 6px); }
  .prehled-obsah .family-tree-children > .child-card .child-info { transform: translateY(clamp(6px, 1.2cqi, 12px)); }
  .prehled-obsah .child-card:hover { filter: brightness(1.015); }
  .prehled-obsah .child-card:active { filter: brightness(.98); }
  .prehled-obsah .child-card:is([data-tree-role="parent"], [data-tree-role="child"]) { background: var(--family-background); }
  .prehled-obsah .chronicle-profile { background: linear-gradient(145deg, #fbfcf5, #e5edcf); }
  .prehled-obsah .family-strip .avatar { position: absolute; z-index: 1; top: -2px; left: 50%; width: var(--profile-circle); height: var(--profile-circle); flex: none; overflow: hidden; background-image: none; border-width: 3px; transform: translate(-50%, -25%); }
  .prehled-obsah .family-strip .avatar { border-radius: 22px; }
  .prehled-obsah .family-tree-parents .child-card {
    --profile-circle: clamp(76px, 24cqi, 11rem);
  }
  .prehled-obsah .family-tree-parents .avatar { height: calc(var(--profile-circle) * .88); }
  .prehled-obsah .overview-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
  .prehled-obsah .overview-photo-placeholder { display: grid; width: 100%; height: 100%; min-height: inherit; place-items: center; color: #617355; background: #edf1e4; font-size: var(--text-title); font-weight: 700; }
  .prehled-obsah .child-info { flex: none; }
  .prehled-obsah .child-info strong { font-size: var(--text-body); font-weight: 850; line-height: 1.2; }
  .prehled-obsah .child-info small { font-size: var(--text-sm); line-height: 1.35; }
  .prehled-obsah .child-chevron { display: none !important; }
  .prehled-obsah .icon { display: none; }
  .prehled-obsah .overview-icon { display: inline-block; width: var(--icon-size); height: var(--icon-size); object-fit: contain; flex: 0 0 auto; }
  .prehled-obsah .family-avatar .overview-icon { width: 52%; height: 52%; }
  .prehled-obsah .memory-hero { grid-column: 1 / -1; order: 3; width: 100%; min-width: 0; min-height: 220px; aspect-ratio: 1.65; border: 2px solid #fffdf9; border-radius: var(--radius); background-image: none; }
  .prehled-obsah .overview-hero-photo { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% center; }
  .prehled-obsah .memory-hero::after { background: linear-gradient(90deg, rgb(14 28 17 / 75%), rgb(14 28 17 / 25%) 60%, transparent); }
  .prehled-obsah .overview-hero-copy { display: flex; height: 100%; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 20px 16px; }
  .prehled-obsah .overview-hero-eyebrow { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
  .prehled-obsah .overview-hero-eyebrow::before {
    content: "";
    width: var(--icon-sm);
    height: var(--icon-sm);
    background: currentColor;
    mask: url('../icons/overview/kalendar.svg') center / contain no-repeat;
  }
  .prehled-obsah .overview-hero-copy strong { font-size: var(--text-display); line-height: 1.08; letter-spacing: -.025em; }
  .prehled-obsah .overview-hero-cta { display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-size); padding: 9px 12px; border-radius: var(--radius); background: #fffbed; color: #254b26; font-size: var(--text-xs); font-weight: 750; }
  .prehled-obsah .overview-hero-cta .overview-icon { width: 16px; height: 16px; }
  .prehled-obsah .memory-hero .carousel-dots { display: flex; pointer-events: none; }
  .prehled-obsah .panel.quick-panel {
    grid-column: 1 / -1;
    order: 4;
    padding: var(--space-md) var(--space-md) var(--space-lg);
    position: relative;
    isolation: isolate;
    background: linear-gradient(105deg, #fff6e7, #f4f0d9);
    border: 0;
    box-shadow: 0 6px 14px rgb(91 68 30 / 15%);
    overflow: hidden;
  }
  .prehled-obsah .quick-panel::after {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background: url('../images/rp_pozadi.png') center 52% / 107% 176% no-repeat;
    /* Zachová spodní vlnu z původního podkladu a skryje jeho vestavěnou větvičku. */
    mask-image: linear-gradient(transparent 32%, #000 53%);
    pointer-events: none;
  }
  .prehled-obsah .quick-panel::before {
    content: "";
    position: absolute;
    inset-block-start: var(--space-sm);
    inset-inline-end: 0;
    z-index: -1;
    width: clamp(3.5rem, 27%, 10rem);
    aspect-ratio: 8 / 3;
    background: url('../images/overview/bnk/listky_vodorovne.png') left center / 112% auto no-repeat;
    filter: saturate(.62);
    opacity: .52;
    pointer-events: none;
  }
  .prehled-obsah .quick-panel > h2 { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 2px; color: #29351c; font-weight: 850; }
  .prehled-obsah .quick-panel-description { display: block; margin: 0 0 var(--space-md) calc(28px + var(--space-sm)); color: #42513b; font-size: var(--text-sm); line-height: var(--line-compact); }
  .prehled-obsah .quick-panel > h2 > .overview-icon { display: none; }
  .prehled-obsah .quick-panel > h2::before { content: ""; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: url('../images/footer.png') center 41% / 716% auto no-repeat; pointer-events: none; }
  .prehled-obsah .panel { min-width: 0; border: 2px solid #fffdf9; border-radius: 22px; background-color: #fffaf1; box-shadow: 0 5px 16px rgb(91 68 30 / 10%); }
  .prehled-obsah .panel h2 { font-size: var(--text-lg); }
  .prehled-obsah .title-icon { width: 22px; height: 22px; margin-right: 6px; }
  .prehled-obsah .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); }
  .prehled-obsah .quick-action { min-height: max(var(--control-size), 5.4em); gap: var(--space-xs); padding: var(--space-sm) 2px; border: 1px solid #fffdf9; border-radius: var(--radius); box-shadow: 0 4px 9px rgb(91 68 30 / 15%); }
  .prehled-obsah .quick-action .overview-icon { width: var(--icon-lg); height: var(--icon-lg); }
  .prehled-obsah .quick-action span { font-size: var(--text-sm); font-weight: 850; }
  .prehled-obsah .tone-green { background: #eaf2da; }
  .prehled-obsah .tone-rose { background: #fbe5e5; }
  .prehled-obsah .tone-peach { background: #ffe8d0; }
  .prehled-obsah .tone-amber { background: #fff0ce; }
  .prehled-obsah :is(.events-panel, .stats-panel) {
    --bnk-inset: var(--space-sm);
    --bnk-row-icon: clamp(1.35rem, .8rem + 2.15vw, 2.5rem);
    --bnk-art-slot: clamp(2rem, .65rem + 7vw, 5.5rem);
    display: flex;
    flex-direction: column;
    position: relative;
    order: 5;
    padding: var(--bnk-inset) var(--bnk-inset) calc(var(--bnk-inset) + clamp(.5rem, 2.6vw, 1.75rem));
    background: linear-gradient(150deg, #fffaf0, #fff5e4);
  }
  .prehled-obsah :is(.chronicle-profile, .events-panel, .stats-panel)::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: clamp(.5rem, 2.6vw, 1.75rem);
    border-radius: inherit;
    background: url('../images/overview/bnk/pozadi_karty.png') center 75% / 108% auto no-repeat;
    opacity: .46;
    pointer-events: none;
  }
  .prehled-obsah .chronicle-profile::after { height: clamp(.45rem, 1.55vw, 1.15rem); }
  .prehled-obsah .events-panel { grid-column: 1; }
  .prehled-obsah .stats-panel { grid-column: 2; }
  .prehled-obsah :is(.events-panel > h2, .stats-panel .section-heading > h2) {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: clamp(.9rem, .65rem + 1vw, 1.5rem);
    line-height: var(--line-compact);
    overflow-wrap: anywhere;
  }
  .prehled-obsah .events-panel h2 { --bnk-icon: url('../icons/overview/bnk/ikona_kalendar.svg'); --bnk-ink: #ae4939; }
  .prehled-obsah .stats-panel h2 { --bnk-icon: url('../icons/overview/bnk/ikona_kniha.svg'); --bnk-ink: #3e6733; }
  .prehled-obsah :is(.events-panel h2, .stats-panel h2, .stats-panel .stat)::before {
    content: "";
    flex: none;
    width: var(--bnk-row-icon);
    height: var(--bnk-row-icon);
    background-color: var(--bnk-ink, currentColor);
    mask: var(--bnk-icon) center / contain no-repeat;
    pointer-events: none;
  }
  .prehled-obsah :is(.events-panel h2, .stats-panel h2, .event-item-cake, .event-item-school, .stats-panel .stat) .overview-icon,
  .prehled-obsah .event-item > .overview-icon { display: none; }
  .prehled-obsah .event-list, .prehled-obsah .stats-panel .section-heading { margin: 0; }
  .prehled-obsah .event-list, .prehled-obsah .stats-list { margin-block-start: var(--space-sm); }
  .prehled-obsah .event-list { display: grid; flex: 1; grid-auto-rows: 1fr; gap: var(--space-sm); }
  .prehled-obsah .event-item {
    grid-template-columns: minmax(0, min(34%, var(--bnk-art-slot))) minmax(0, 1fr);
    gap: var(--space-xs);
    min-height: var(--control-size);
    padding: var(--space-xs);
    border: 0;
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
  }
  .prehled-obsah .event-item-cake {
    --bnk-event-art: url('../images/overview/bnk/narozeninovy_dort.png');
    background: #fceadd;
  }
  .prehled-obsah .event-item-school {
    --bnk-event-art: url('../images/overview/bnk/aktovka_knihy.png');
    background: #f3e9f5;
  }
  .prehled-obsah .event-icon { width: var(--bnk-row-icon); height: var(--bnk-row-icon); }
  .prehled-obsah :is(.event-item-cake, .event-item-school) .event-icon {
    align-self: stretch;
    width: auto;
    height: auto;
    background: var(--bnk-event-art) center / contain no-repeat;
    pointer-events: none;
  }
  .prehled-obsah .event-item strong { font-size: var(--text-sm); line-height: var(--line-compact); }
  .prehled-obsah .event-item .event-person { color: #526f32; font-size: var(--text-body); }
  .prehled-obsah .event-item small { margin-top: var(--space-xs); font-size: var(--text-sm); }
  .prehled-obsah .stats-panel .section-heading a { position: absolute; inset: 0; border-radius: inherit; color: transparent; font-size: 0; }
  .prehled-obsah .stats-list { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
  .prehled-obsah .stats-panel .stat {
    display: grid;
    grid-template-columns: var(--bnk-row-icon) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    align-content: center;
    column-gap: var(--space-sm);
    min-height: var(--control-size);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--bnk-ink);
    background-color: var(--bnk-tint);
  }
  .prehled-obsah .stats-panel .tone-green { --bnk-icon: url('../icons/overview/bnk/ikona_fotografie.svg'); --bnk-ink: #216044; --bnk-tint: #e7efd6; }
  .prehled-obsah .stats-panel .tone-purple { --bnk-icon: url('../icons/overview/bnk/ikona_video.svg'); --bnk-ink: #634087; --bnk-tint: #eee4f5; }
  .prehled-obsah .stats-panel .tone-amber { --bnk-icon: url('../icons/overview/bnk/ikona_milnik.svg'); --bnk-ink: #895007; --bnk-tint: #ffedc8; }
  .prehled-obsah .stats-panel .stat::before { grid-row: 1 / -1; }
  .prehled-obsah .stats-panel .stat strong { font-size: var(--text-lg); }
  .prehled-obsah .stats-panel .stat span { font-size: var(--text-sm); }
  .prehled-obsah .stats-panel .stat :is(strong, span) { line-height: 1.15; overflow-wrap: anywhere; }
  .prehled-obsah .memories-section { grid-column: 1 / -1; order: 6; margin: 2px 0 0; min-width: 0; }
  .prehled-obsah .section-heading { gap: 8px; margin-bottom: 10px; }
  .prehled-obsah .section-heading h2 { font-size: var(--text-section); }
  .prehled-obsah .section-heading a { font-size: var(--text-xs); min-height: var(--control-size); }
  .prehled-obsah .memories-list { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(112px, 30%); gap: 10px; padding-bottom: 8px; overflow-x: auto; }
  .prehled-obsah .memory-photo { aspect-ratio: 1; overflow: hidden; border: 2px solid #fffdf9; border-radius: 17px; background-image: none; background-color: #edf1e4; }
  .prehled-obsah .memory-photo .overview-photo-placeholder { font-size: var(--text-section); }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .family-tree-children:has(> :nth-child(3)) > .child-card { flex-basis: calc((100% - 2 * var(--space-md)) / 3); }
  .prehled-obsah .child-card { padding: calc(var(--profile-circle) * .75 + 18px) 12px 18px; gap: 12px; }
  .prehled-obsah .memory-hero { aspect-ratio: 2.25; min-height: 300px; }
  .prehled-obsah .overview-hero-copy { padding: 28px 32px; gap: 18px; }
  .prehled-obsah .overview-hero-cta { padding: 10px 18px; font-size: var(--text-body); }
  .prehled-obsah .memories-list { grid-auto-columns: minmax(150px, 23%); gap: 16px; }
}

/* Na nízkém displeji uvolní hlavička prostor tím, že se posouvá spolu s dokumentem. */
@media (max-width: 1199px) and (orientation: landscape) and (max-height: 600px) {
  html, body, .app-shell, .page { height: auto; min-height: 100dvh; overflow: visible; }
  .mobile-header { position: relative; flex: none; }
  main, main:has(> .prehled-obsah) { height: auto; overflow: visible; padding-top: var(--space-md); }
  html:has(.mobile-menu[open]) { scrollbar-width: none; }
  .mobile-menu {
    --menu-top: calc(env(safe-area-inset-top, 0px) + .5rem);
  }
  .mobile-menu-header { padding-block: .75rem 1.15rem; }
  .mobile-menu-eyebrow { padding-bottom: .4rem; }
  .mobile-menu-heading::before { display: none; }
  .mobile-menu-tools { position: absolute; inset: .4rem var(--menu-inset) auto auto; }
  .mobile-menu-user { inset-block-start: calc(.4rem + var(--menu-button) - .125rem - 3px); inset-inline-end: calc(.4rem + var(--menu-button) + var(--space-sm)); width: min(45%, 8rem); }
  .mobile-menu-heading { padding-inline-end: min(45%, 12rem); }
  .mobile-menu-header h2 { font-size: var(--text-lg); }
  .mobile-menu-header p { font-size: var(--text-xs); }
  .mobile-menu-actions { padding-block: .25rem .5rem; }
}

html:has(.orientation-notice[open]),
html:has(.orientation-notice[open]) body {
  overflow: hidden;
  overscroll-behavior: none;
}
.orientation-notice[open] {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  justify-items: center;
  align-items: center;
  gap: clamp(.15rem, 1.2dvh, .65rem);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(.2rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right))
    max(14dvh, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  overflow: hidden;
  border: 0;
  background:
    url('../images/otoceni/listky_levy_roh.png') left top / auto 29dvh no-repeat,
    url('../images/otoceni/listky_pravy_roh.png') right top / auto 29dvh no-repeat,
    var(--canvas);
  color: #173421;
  text-align: center;
}
.orientation-notice::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36dvh;
  background: url('../images/otoceni/spodni_krajina.png') center bottom / cover no-repeat;
  mask-image: linear-gradient(transparent, #000 32%);
  pointer-events: none;
}
.orientation-notice > * { position: relative; }
.orientation-logo {
  width: auto;
  height: 100%;
  max-height: 28dvh;
  object-fit: contain;
  /* Odřízne vodorovnou stopu v průhledném okraji PNG nad logem. */
  clip-path: inset(8% 0 0);
}
.orientation-illustrations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.25rem, 1vw, .9rem);
  height: 100%;
  min-height: 0;
}
.orientation-illustrations img {
  display: block;
  width: auto;
  max-width: 36vw;
  object-fit: contain;
  mask-image: radial-gradient(ellipse farthest-corner, #000 78%, transparent);
}
.orientation-phone-sideways { height: 76%; }
.orientation-arrow { height: 39%; }
.orientation-phone-upright { height: 100%; }
.orientation-copy h1 {
  margin: 0;
  font-size: clamp(1.05rem, 7.2dvh, 2.5rem);
  line-height: 1.1;
  text-shadow: 0 1px 2px #fff6e7, 0 0 7px #fff6e7;
}
.orientation-copy p {
  margin: .25em 0 0;
  font-size: clamp(.85rem, 4.7dvh, 1.45rem);
  line-height: 1.15;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .memory-hero::after { background: transparent; }
  .panel, .child-card, .bottom-nav { border: 1px solid CanvasText; }
}
