/* ───────────────────────────────────────────────────────────────────────────
   Můj chytrý kurník — mobile-first UI
   ─────────────────────────────────────────────────────────────────────────── */

:root {
    --amber:        #f5a623;
    --amber-dark:   #e2890a;
    --amber-soft:   #fff3dd;
    --green:        #3ea15b;
    --green-soft:   #e4f4e9;
    --red:          #e25555;
    --red-soft:     #fdeaea;

    --bg:           #f6f1e7;
    --bg-2:         #efe7d6;
    --surface:      #ffffff;
    --ink:          #2b2620;
    --ink-soft:     #6f675b;
    --ink-faint:    #a59c8c;
    --line:         #ece4d4;

    --radius:       18px;
    --radius-sm:    12px;
    --shadow:       0 6px 22px rgba(80, 60, 20, 0.08);
    --shadow-sm:    0 2px 8px rgba(80, 60, 20, 0.06);

    --tabbar-h:     64px;
    --topbar-h:     56px;
    --maxw:         640px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:        #1c1a16;
        --bg-2:      #23201a;
        --surface:   #2a2620;
        --ink:       #f3ece0;
        --ink-soft:  #c2b8a6;
        --ink-faint: #8a8072;
        --line:      #3a352c;
        --amber-soft:#3a2f17;
        --green-soft:#1f3326;
        --red-soft:  #3a2020;
        --shadow:    0 6px 22px rgba(0, 0, 0, 0.35);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

a { color: var(--amber-dark); text-decoration: none; }
a:active { opacity: 0.7; }

h1, h2, h3 { margin: 0; line-height: 1.25; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.main {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}
.main--guest {
    padding-bottom: 32px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.app .main--app { padding-top: calc(var(--topbar-h) + 12px); }

/* ── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px; padding-right: 16px;
    z-index: 50;
}
@media (prefers-color-scheme: dark) {
    .topbar { background: rgba(42, 38, 32, 0.82); }
}
.topbar__brand { display: flex; align-items: center; color: var(--ink); font-weight: 700; }
.topbar__logo-img { height: 30px; width: auto; display: block; }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__account {
    display: flex; align-items: center; gap: 6px;
    color: var(--ink); font-weight: 700;
    padding: 6px 12px; border-radius: 10px; background: var(--bg-2);
    -webkit-tap-highlight-color: transparent;
}
.topbar__account:active { opacity: 0.8; }
.topbar__account-ico { font-size: 15px; }
.topbar__user { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tabbar ─────────────────────────────────────────────────────────────────── */
.tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 50;
}
@media (prefers-color-scheme: dark) {
    .tabbar { background: rgba(42, 38, 32, 0.9); }
}
.tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 600;
    padding-top: 6px;
}
.tabbar__ico { font-size: 22px; filter: grayscale(0.4); opacity: 0.7; transition: transform .12s; }
.tabbar__ico--svg { filter: none; opacity: 1; display: flex; align-items: center; justify-content: center; }
.tabbar__ico--svg .navico { display: block; }
.tabbar__item.is-active { color: var(--amber-dark); }
.tabbar__item.is-active .tabbar__ico { filter: none; opacity: 1; transform: translateY(-1px) scale(1.08); }

/* ── Page ───────────────────────────────────────────────────────────────────── */
.page { display: flex; flex-direction: column; gap: 16px; }
.page__head { display: flex; flex-direction: column; gap: 2px; }
.headbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page__head--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.page__eyebrow { margin: 0; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.page__title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page__date { color: var(--amber-dark); }

.section-head { margin-top: 4px; }
.section-head__title { font-size: 15px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.section-head--counts { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mini-counts { display: flex; align-items: center; gap: 12px; }
.mini-counts__item { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: var(--ink); }
.mini-counts__item .hen { display: block; }

.back-link { display: inline-block; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }

.muted { color: var(--ink-faint); }
.mb { margin-bottom: 8px; }
.mt { margin-top: 12px; }
.hint { color: var(--ink-faint); font-size: 13px; text-align: center; margin: 4px 0 0; }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    border: 1px solid var(--line);
}
.card__title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
/* Karty s nastavením: rovnoměrné odsazení nadpisů a polí. */
.card--settings { display: flex; flex-direction: column; gap: 13px; }
.card--settings .card__title--section { margin-bottom: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card__head .card__title { margin-bottom: 0; }
.card__link { font-size: 13px; font-weight: 600; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--tight { gap: 8px; }

/* ── Stat grid ──────────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.stat__value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat__label { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.stat--accent {
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dark) 100%);
    border-color: transparent;
    color: #fff;
}
.stat--accent .stat__label { color: rgba(255,255,255,0.9); }
.stat__trend { margin-top: 6px; }

/* tři hodnoty v jedné kartě přes celou šířku */
.stat3 { display: flex; align-items: stretch; }
.stat3__item { flex: 1; min-width: 0; text-align: center; padding: 0 4px; }
.stat3__item + .stat3__item { border-left: 1px solid var(--line); }
.stat3__value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat3__label { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.2; }
.stat3__value--warn { color: var(--red); }
.stat3__trend { margin-top: 12px; text-align: center; }
.stat3__trend-note { font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.stat3__item-trend { margin-top: 6px; }
.stat3__item-trend .trend { font-size: 10.5px; padding: 1px 6px; }

/* celkem za celou dobu (nahoře) */
.total-all { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.total-all__label { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.total-all__value { font-size: 22px; font-weight: 800; color: var(--amber-dark); }
.flock-counts { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flock-counts__label { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.flock-counts__items { display: flex; align-items: center; gap: 10px; }
.flock-counts .cnt {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 18px; font-weight: 800; color: var(--ink);
    background: var(--amber-soft); border-radius: 999px; padding: 2px 14px 2px 4px;
}
.flock-counts .cnt .hen { display: block; }

/* pokrytí záznamů + doplnění */
.coverage__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.coverage__title { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.coverage__count { font-size: 14px; font-weight: 800; color: var(--ink); }
.coverage__bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.coverage__fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-dark)); border-radius: 999px; transition: width .3s; }
.coverage__done { margin: 10px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--green); }
.stat--accent .stat__trend .trend { background: rgba(255,255,255,0.22); color: #fff; }
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid--3 .stat { padding: 12px 10px; }
.stat-grid--3 .stat__value { font-size: 24px; }
.stat-grid--3 .stat__label { font-size: 12px; }

/* ── Dlaždice „vajec dnes" ───────────────────────────────────────────────────── */
.eggcard--accent {
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dark) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px rgba(226,137,10,0.32);
}
.eggcard--link { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.eggcard__big { font-size: 46px; font-weight: 800; line-height: 1; color: var(--amber-dark); }
.eggcard--accent .eggcard__big { color: #fff; }
.eggcard--accent .eggcard__label { color: rgba(255,255,255,0.92); }

/* ── Posuvník čísel (výběr počtu vajec prstem) ───────────────────────────────── */
.eggset { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; }
.eggpick__wrap { position: relative; width: 100%; }
.eggpick__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.eggpick__viewport::-webkit-scrollbar { display: none; }
.eggpick__track { display: flex; padding-inline: calc(50% - 27px); }
.eggpick__item {
    flex: 0 0 54px; width: 54px; height: 58px;
    scroll-snap-align: center;
    border: none; background: none; cursor: pointer;
    font-size: 34px; font-weight: 800; line-height: 1;
    color: var(--amber-dark);
    font-variant-numeric: tabular-nums;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, opacity;
}
.eggpick__marker {
    position: absolute; top: 50%; left: 50%;
    width: 58px; height: 56px;
    transform: translate(-50%, -50%);
    border: 2px solid var(--amber);
    border-radius: 15px;
    pointer-events: none;
}
.eggset__unit { font-size: 13px; color: var(--ink-soft); }
.eggset__warn {
    font-size: 12px; font-weight: 700;
    color: var(--red); background: var(--red-soft);
    border-radius: 10px; padding: 5px 12px; margin-top: 2px;
    text-align: center; white-space: nowrap;
}

/* Varianta na plnobarevné dlaždici */
.eggset--accent .eggpick__item { color: #fff; }
.eggset--accent .eggpick__marker { border-color: #fff; }
.eggset--accent .eggset__unit { color: rgba(255,255,255,0.9); }
.eggset--accent .eggset__warn { background: #fff; color: var(--red); }

/* ── Stránka „dnes" ──────────────────────────────────────────────────────────── */
.todaycard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.todaycard__name { font-size: 17px; font-weight: 700; color: var(--ink); }
.todaycard__count { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; color: var(--ink); }
.todaycard__count .cnt {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--amber-soft); border-radius: 999px;
    padding: 2px 12px 2px 4px;
}
.todaycard__count .hen { display: block; }

/* ── Sparkbars (mini graf) ──────────────────────────────────────────────────── */
.sparkbars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 110px;
    padding-top: 14px;
}
.sparkbars__col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.sparkbars__bar {
    width: 100%;
    max-width: 22px;
    background: var(--amber-soft);
    border-radius: 6px 6px 4px 4px;
    position: relative;
    min-height: 3px;
    transition: height .3s ease;
}
.sparkbars__bar.is-today { background: linear-gradient(to top, var(--amber-dark), var(--amber)); }
.sparkbars__num {
    position: absolute;
    top: -14px; left: 50%; transform: translateX(-50%);
    font-size: 10px; font-weight: 700; color: var(--ink-soft);
}

/* ── Kalendář snášky ────────────────────────────────────────────────────────── */
.eggcal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.eggcal__dow {
    text-align: center;
    font-size: 11px; font-weight: 700;
    color: var(--ink-soft);
    padding-bottom: 2px;
}
.eggcal__cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    overflow: hidden;
}
.eggcal__cell--empty { border-color: transparent; background: transparent; }
.eggcal__cell.is-today { border-color: var(--amber); border-width: 2px; }
.eggcal__fill {
    position: absolute; inset: 0;
    background: var(--amber);
    pointer-events: none;
}
.eggcal__day {
    position: absolute; top: 3px; left: 5px;
    font-size: 10px; font-weight: 600; color: var(--ink-soft);
    z-index: 1;
}
.eggcal__num {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: var(--ink);
    z-index: 1;
}

/* Listování měsíci nad kalendářem */
.monthnav { display: flex; align-items: center; gap: 6px; }
.monthnav__title { margin: 0; min-width: 9.5em; text-align: center; }
.monthnav__btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); font-size: 18px; font-weight: 700;
    line-height: 1; cursor: pointer;
}
.monthnav__btn:hover { border-color: var(--amber); color: var(--amber-dark); }
.monthnav__btn.is-disabled { opacity: .35; pointer-events: none; }

/* ── Quick entry ────────────────────────────────────────────────────────────── */
.quick {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "info info" "stepper save";
    gap: 12px;
    align-items: center;
}
.quick__info { grid-area: info; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.quick__name { font-size: 16px; font-weight: 700; color: var(--ink); }
.quick__status { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.quick--done .quick__status { color: var(--green); }
.quick--done { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.quick .stepper { grid-area: stepper; }
.quick__save { grid-area: save; }

/* ── Stepper ────────────────────────────────────────────────────────────────── */
.stepper {
    display: inline-flex;
    align-items: stretch;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.stepper__btn {
    width: 40px; height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 9px;
    font-size: 22px; font-weight: 700;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.stepper__btn:active { transform: scale(0.92); }
.stepper__input {
    width: 56px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 20px; font-weight: 800;
    color: var(--ink);
    -moz-appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--lg { width: 100%; justify-content: space-between; }
.stepper--lg .stepper__input { flex: 1; font-size: 24px; }
.stepper--lg .stepper__btn { width: 52px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: linear-gradient(135deg, var(--amber), var(--amber-dark)); color: #fff; box-shadow: 0 4px 12px rgba(226,137,10,0.3); }
.btn--secondary { background: var(--bg-2); color: var(--ink); }
.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 14px; }

.btn-icon {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    border-radius: 10px;
    font-size: 18px; color: var(--ink-soft);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.btn-icon:active { transform: scale(0.9); }
.btn-icon--bordered { border: 1px solid var(--line); background: var(--surface); }
.btn-icon--danger { color: var(--red); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--check { display: flex; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink); }
.field--check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--amber); }
.field.is-disabled { opacity: .5; }
.field__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.field__opt { font-weight: 500; color: var(--ink-faint); }
.field__hint { font-size: 12px; color: var(--ink-soft); }
.field__hint.is-hidden { visibility: hidden; }
.card__title--section { margin: 0 0 12px; font-size: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input, .select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px; /* >=16px aby iOS nezoomoval */
    font-family: inherit;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-soft);
    background: var(--surface);
}
textarea.input { resize: vertical; min-height: 48px; }

/* ── Disclosure (přidat hejno) ──────────────────────────────────────────────── */
.disclosure__summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--amber-dark);
    font-size: 15px;
}
.disclosure__summary::-webkit-details-marker { display: none; }

/* ── List ───────────────────────────────────────────────────────────────────── */
.list { padding: 4px 16px; }
.list__row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.list__row:last-child { border-bottom: none; }
.list__main { font-size: 15px; }
.list__value { font-weight: 700; color: var(--ink); }
.miss-input { width: 84px; text-align: center; padding: 8px 10px; }

/* ── Coop card ──────────────────────────────────────────────────────────────── */
.coop-card { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.coop-card__ico {
    width: 48px; height: 48px; flex: 0 0 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber-soft); border-radius: 14px;
    color: var(--amber-dark);
}
.coop-card__ico .navico { display: block; }
.coop-card__body { flex: 1; min-width: 0; }
.coop-card__name { font-size: 17px; font-weight: 700; }
.coop-card__meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.coop-card__meta .cmeta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.coop-card__meta .cmeta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.coop-card__meta .cmeta strong { color: var(--ink); font-weight: 800; }
.coop-card__meta .cmeta .hen { display: block; }
.coop-card__chev { font-size: 26px; color: var(--ink-faint); line-height: 1; }

/* ── Administrace ─────────────────────────────────────────────────────────────── */
.topbar__admin { font-size: 18px; line-height: 1; padding: 2px 4px; text-decoration: none; }
.impersonate {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px; padding: 10px 14px;
    background: var(--amber-soft); border: 1px solid var(--amber);
    border-radius: var(--radius-sm); font-size: 14px; color: var(--amber-dark);
}
.impersonate__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impersonate__exit { flex: 0 0 auto; font-weight: 700; text-decoration: underline; }
.coop-card__meta.admin-meta { flex-direction: row; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.admin-meta--sub { font-size: 12px; color: var(--ink-faint); }
.loglist { list-style: none; margin: 0; padding: 0; }
.loglist__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.loglist__item:last-child { border-bottom: 0; }

/* ── Flock ──────────────────────────────────────────────────────────────────── */
.flock { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.flock__avatar {
    width: 46px; height: 46px; flex: 0 0 46px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber-soft); border-radius: 12px; overflow: hidden;
}
.flock__body { flex: 1; min-width: 0; }
.flock__breed { font-size: 15px; font-weight: 700; }
.flock__meta { font-size: 13px; color: var(--ink-soft); }
.hen { display: block; }

/* ── Výběr plemene (mřížka karet) ───────────────────────────────────────────── */
.breedgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
    gap: 10px;
}
.breedcard { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.breedcard input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.breedcard__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    text-align: center;
    height: 100%;
    transition: border-color .12s, background .12s, transform .08s;
}
.breedcard:active .breedcard__inner { transform: scale(0.96); }
.breedcard input:checked + .breedcard__inner {
    border-color: var(--amber);
    background: var(--amber-soft);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.18);
}
.breedcard input:focus-visible + .breedcard__inner { border-color: var(--amber-dark); }
.breedcard__img {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-2);
    border-radius: 12px;
}
.breedcard__img--plus { font-size: 30px; color: var(--ink-faint); font-weight: 300; }
.breedcard__name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.breedcard__egg { font-size: 10.5px; color: var(--ink-faint); }
.breedcard--custom .breedcard__inner { border-style: dashed; }
.breedgrid--sm { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.breedgrid--sm .breedcard__img { width: 52px; height: 52px; }

/* ── Výběr barevné kombinace (rozbalovací) ───────────────────────────────────── */
.colorpick { position: relative; }
.colorpick__toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border: 1px solid var(--line); background: var(--bg);
    border-radius: 12px; cursor: pointer; font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.colorpick__preview {
    width: 42px; height: 42px; flex: 0 0 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--amber-soft); border-radius: 10px;
}
.colorpick__preview .hen { display: block; }
.colorpick__current { flex: 1; text-align: left; font-size: 15px; font-weight: 700; color: var(--ink); }
.colorpick__chev { color: var(--ink-faint); transition: transform .15s; }
.colorpick.is-open .colorpick__chev { transform: rotate(180deg); }
.colorpick__panel {
    margin-top: 8px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); padding: 8px 10px;
    max-height: 56vh; overflow: auto;
}
.colorcat { margin-bottom: 6px; }
.colorcat__title {
    font-size: 11.5px; font-weight: 800; color: var(--ink-soft);
    text-transform: uppercase; letter-spacing: 0.04em; margin: 8px 2px 4px;
}
.colorgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.colorcard {
    border: 2px solid var(--line); background: var(--surface); border-radius: 12px;
    padding: 8px 4px; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    -webkit-tap-highlight-color: transparent; transition: transform .08s, border-color .12s, background .12s;
}
.colorcard:active { transform: scale(0.95); }
.colorcard.is-sel { border-color: var(--amber); background: var(--amber-soft); }
.colorcard__img {
    width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-2); border-radius: 10px;
}
.colorcard__img .hen { display: block; }
.colorcard__name { font-size: 11px; font-weight: 700; line-height: 1.15; text-align: center; color: var(--ink); }

/* ── Poloha kurníku (mapa) ───────────────────────────────────────────────────── */
.geo { display: flex; flex-direction: column; gap: 8px; }
.geo__search { display: flex; flex-wrap: wrap; gap: 8px; }
.geo__search .input { flex: 1 1 160px; min-width: 0; }
.geo__search .btn { flex: 0 0 auto; }
.geo__map {
    width: 100%; height: 220px;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    position: relative; z-index: 0;
    background: var(--bg-2);
}
.geo__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.geo__coords { font-size: 12px; color: var(--ink-faint); }

/* ── Počasí ──────────────────────────────────────────────────────────────────── */
.page__title--row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wtemp { color: var(--ink); font-weight: 800; font-size: 17px; white-space: nowrap; }
.coop-weather {
    font-size: 13px; font-weight: 700; color: var(--ink-soft);
    background: var(--amber-soft); border-radius: 10px; padding: 8px 12px;
}
.coop-weather strong { color: var(--ink); }
.daylen { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.daylen strong { color: var(--ink); }

/* ── Chips (druh, vzor) ──────────────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; }
.chips--wrap { flex-wrap: wrap; }
.chip { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; flex: 1; }
.chips--wrap .chip { flex: 0 0 auto; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.chip__label {
    display: block;
    text-align: center;
    padding: 10px 14px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-size: 14px; font-weight: 700;
    color: var(--ink-soft);
    transition: border-color .12s, background .12s, color .12s;
}
.chip input:checked + .chip__label {
    border-color: var(--amber);
    background: var(--amber-soft);
    color: var(--amber-dark);
}

/* ── Vlastní vzhled ──────────────────────────────────────────────────────────── */
.custom-builder {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: var(--bg-2);
    border-radius: 14px;
}

/* ── Štítek ──────────────────────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    color: var(--ink-soft);
    background: var(--bg-2);
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 4px;
    vertical-align: middle;
}
.flock { color: var(--ink); }
.flock__edit { font-size: 18px; color: var(--ink-faint); flex: 0 0 auto; }
.flock__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink); }

/* indikátor barvy kroužku ve výpisu */
.ring-dot {
    display: inline-block; width: 11px; height: 11px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.22); margin-right: 5px; vertical-align: middle;
}

/* výběr barvy kroužku ve formuláři */
.rings { display: flex; flex-wrap: nowrap; gap: 8px; }
.ring {
    position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent;
    border: none; background: none; padding: 0; line-height: 0;
}
.ring input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.ring__dot {
    display: block; width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--line);
    transition: box-shadow .12s, border-color .12s;
}
.ring__dot--none {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-2); color: var(--ink-faint); font-size: 13px;
}
.ring__dot--custom {
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    background: conic-gradient(#e25555, #f59e0b, #f5c542, #3ea15b, #3b82f6, #8b5cf6, #e25555);
}
.ring.is-sel .ring__dot { border-color: var(--amber-dark); box-shadow: 0 0 0 3px var(--amber-soft); }

/* ── Skupina kusů + jednotlivé kusy ──────────────────────────────────────────── */
.group__head { display: flex; align-items: center; gap: 12px; }
.group__body { flex: 1; min-width: 0; }
.group__name { font-size: 16px; font-weight: 700; }
.group__meta { font-size: 13px; color: var(--ink-soft); }
.birds { margin-top: 10px; border-top: 1px solid var(--line); }
.bird {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.bird:last-child { border-bottom: none; }
.bird__main {
    flex: 1; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
    color: var(--ink);
}
.bird__age { font-weight: 700; font-size: 14px; }
.bird__name {
    font-size: 12px; font-weight: 700; color: var(--amber-dark);
    background: var(--amber-soft); padding: 1px 8px; border-radius: 999px;
}
.bird__note { font-size: 13px; color: var(--ink-faint); }
.bird .btn-icon { width: 34px; height: 34px; font-size: 20px; }

/* ── Filters / segmented ────────────────────────────────────────────────────── */
.filters { display: flex; flex-direction: column; gap: 10px; }
.segmented {
    display: flex;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}
.segmented__item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px; font-weight: 700;
    color: var(--ink-soft);
    border-radius: 9px;
}
.segmented__item.is-active { background: var(--surface); color: var(--amber-dark); box-shadow: var(--shadow-sm); }

.chart-wrap { position: relative; width: 100%; cursor: pointer; }
.chart-expand {
    position: absolute; top: 2px; right: 2px; z-index: 1;
    width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-2); color: var(--ink-soft); border-radius: 8px; font-size: 14px;
    pointer-events: none;
}
.chart-toggles { display: flex; gap: 8px; margin-top: 10px; }
.chart-toggle {
    border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
    border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; -webkit-tap-highlight-color: transparent; font-family: inherit;
    transition: background .12s, border-color .12s, color .12s;
}
.chart-toggle.is-on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-dark); }

/* detail kliknuté skupiny stáří */
.age-detail { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.age-detail__title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.age-detail__row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.age-detail__row:last-child { border-bottom: none; }

/* ── Graf na celou obrazovku (na šířku) ──────────────────────────────────────── */
.chart-modal {
    position: fixed; inset: 0; z-index: 200;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.chart-modal[hidden] { display: none; }
.chart-modal__close {
    position: absolute; z-index: 2;
    top: calc(env(safe-area-inset-top) + 10px); right: 14px;
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: var(--bg-2); color: var(--ink); font-size: 20px; cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.chart-modal__stage {
    position: absolute;
    left: 10px; right: 10px;
    top: calc(env(safe-area-inset-top) + 60px);
    bottom: calc(env(safe-area-inset-bottom) + 60px);
}
.chart-modal__stage canvas { display: block; }
.chart-modal__toggles {
    position: absolute; z-index: 2;
    top: calc(env(safe-area-inset-top) + 12px); left: 14px;
    display: flex; gap: 8px;
}
.chart-modal__range {
    position: absolute; z-index: 2;
    bottom: calc(env(safe-area-inset-bottom) + 12px);
    left: 50%; transform: translateX(-50%);
    width: calc(100% - 28px); max-width: 420px;
}
.segmented__item { border: none; background: transparent; cursor: pointer; font-family: inherit; }

/* ── Trend (nárůst/pokles) ───────────────────────────────────────────────────── */
.trend {
    display: inline-block;
    font-size: 12px; font-weight: 800;
    padding: 2px 9px;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}
.trend--up   { color: var(--green); background: var(--green-soft); }
.trend--down { color: var(--red);   background: var(--red-soft); }
.trend--flat { color: var(--ink-soft); background: var(--bg-2); }
.card__title .trend { margin-left: 6px; }


/* ── Poznámky ────────────────────────────────────────────────────────────────── */
.note-form { display: flex; flex-direction: column; gap: 10px; }
.note-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.note-filter__btn {
    border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
    border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.note-filter__btn.is-on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-dark); }
.note__topic { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); margin-bottom: 3px; }
.note__text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; }
.note__body { flex: 1; min-width: 0; }
.note__link { display: block; color: var(--ink); }
.note__meta { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.note__date { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.note__extra { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.note__extra a { font-weight: 700; }
.note .btn-icon { width: 32px; height: 32px; font-size: 20px; }

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 32px 20px; }
.empty__ico { font-size: 48px; margin-bottom: 8px; }
.empty__title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.empty__text { color: var(--ink-soft); margin: 0 0 18px; }

/* ── Flash ──────────────────────────────────────────────────────────────────── */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px; font-weight: 600;
    border: 1px solid transparent;
}
.flash--success { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.flash--error   { background: var(--red-soft);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 30%, transparent); }

/* ── Auth ───────────────────────────────────────────────────────────────────── */
.auth { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.auth__hero { text-align: center; }
.auth__logo {
    width: 72px; height: 72px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 38px;
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    border-radius: 22px;
    box-shadow: 0 8px 22px rgba(226,137,10,0.35);
}
.auth__title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.auth__brand-text { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth__logo-img { display: block; height: 46px; width: auto; }
.auth__subtitle { color: var(--ink-soft); margin: 6px 0 0; }
.auth__card { box-shadow: var(--shadow); }
.auth__alt { text-align: center; margin: 16px 0 0; font-size: 14px; color: var(--ink-soft); }
.auth__alt a { font-weight: 700; }
.auth__hint { text-align: center; margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.auth__hint a { font-weight: 700; }
.auth__demo-cta {
    margin-top: 16px; padding: 16px;
    background: var(--amber-soft);
    border: 2px dashed var(--amber);
    border-radius: 16px; text-align: center;
}
.auth__demo-text { font-size: 14px; font-weight: 700; color: var(--amber-dark); margin-bottom: 10px; }

/* ── Větší obrazovky / PC ─────────────────────────────────────────────────────
   Mobilní rozvržení je full-width. Na širších oknech srovnáme horní lištu do
   středové kolony (ať není „rozlezlá") a spodní navigaci uděláme jako vznášející
   se vycentrovaný panel místo lišty přilepené úplně dolů. */
@media (min-width: 760px) {
    .app .topbar {
        padding-left: calc((100% - var(--maxw)) / 2 + 16px);
        padding-right: calc((100% - var(--maxw)) / 2 + 16px);
    }
    .app .tabbar {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: var(--maxw);
        bottom: 20px;
        height: var(--tabbar-h);
        padding-bottom: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
    }
    .app .main--app {
        padding-bottom: calc(var(--tabbar-h) + 20px + 24px);
    }
}
