/* Dziennik Malucha 2.0 — jeden, telefoniczny układ (PWA). Styl inspirowany UniFi: granat, niebieski akcent, szkło. */
:root {
    --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --nav-h: 68px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07090f;
    --bg-2: #0b1019;
    --surface: rgba(18, 24, 37, .74);
    --surface-solid: #121826;
    --surface-2: rgba(30, 39, 58, .62);
    --surface-3: rgba(255, 255, 255, .045);
    --border: rgba(148, 163, 184, .11);
    --border-strong: rgba(148, 163, 184, .2);
    --text: #eef2f8;
    --text-2: #b6c1d3;
    --muted: #7c89a0;
    --primary: #2f80ff;
    --primary-2: #66a6ff;
    --primary-soft: rgba(47, 128, 255, .16);
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #f43f5e;
    --shadow: 0 12px 32px rgba(0, 0, 0, .38);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
    --aurora-1: rgba(47, 128, 255, .22);
    --aurora-2: rgba(139, 92, 246, .16);
    --aurora-3: rgba(20, 184, 166, .12);
    --tint: 18%;
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2f8;
    --bg-2: #f6f8fc;
    --surface: rgba(255, 255, 255, .86);
    --surface-solid: #ffffff;
    --surface-2: rgba(237, 242, 249, .95);
    --surface-3: rgba(15, 23, 42, .035);
    --border: rgba(15, 23, 42, .08);
    --border-strong: rgba(15, 23, 42, .14);
    --text: #0e1626;
    --text-2: #334155;
    --muted: #64748b;
    --primary: #006fff;
    --primary-2: #2d87ff;
    --primary-soft: rgba(0, 111, 255, .1);
    --ok: #16a34a;
    --warn: #d97706;
    --danger: #e11d48;
    --shadow: 0 10px 28px rgba(15, 23, 42, .08);
    --shadow-sm: 0 3px 10px rgba(15, 23, 42, .06);
    --aurora-1: rgba(0, 111, 255, .14);
    --aurora-2: rgba(139, 92, 246, .1);
    --aurora-3: rgba(20, 184, 166, .08);
    --tint: 13%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; background: var(--bg); }
body {
    margin: 0; min-height: calc(100dvh / var(--ui-zoom, 1)); background: var(--bg); color: var(--text); font-family: var(--font);
    font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.ic { width: 22px; height: 22px; flex: none; display: block; }
[hidden] { display: none !important; }

/* tło — „zorza” */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: .9;
    animation: drift 28s var(--ease) infinite alternate; }
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--aurora-1), transparent 62%); top: -38vmax; left: -22vmax; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--aurora-2), transparent 62%); top: -30vmax; right: -34vmax; animation-delay: -9s; }
.aurora i:nth-child(3) { background: radial-gradient(circle, var(--aurora-3), transparent 62%); bottom: -45vmax; left: -10vmax; animation-delay: -17s; }
@keyframes drift { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.08); } }

.app {
    max-width: 560px; margin: 0 auto; min-height: calc(100dvh / var(--ui-zoom, 1));
    padding: 0 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px);
}

/* górny pasek */
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 -16px 10px; padding: calc(env(safe-area-inset-top) + 14px) 16px 10px;
    background: var(--bg);
}
/* zasłona nad nagłówkiem (gumowe przewijanie) i łagodne wygaszenie treści przewijanej pod nagłówek */
.topbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--bg); pointer-events: none; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none;
    background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent)); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
    background: linear-gradient(135deg, #2f80ff, #8b5cf6 70%, #14b8a6); box-shadow: 0 6px 18px rgba(47, 128, 255, .35);
    color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em; position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45), transparent 70%);
    transform: translateX(-120%); animation: shine 6s ease-in-out infinite 2s; }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .08em; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: ping 2s infinite; }
.live.is-off { color: var(--warn); }
.live.is-off i { animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.icon-btn { width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center;
    color: var(--text-2); box-shadow: var(--shadow-sm); transition: transform .2s var(--spring), background .2s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn .ic { width: 20px; height: 20px; }

/* widoki */
.view { display: none; animation: viewIn .38s var(--ease); }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-title { margin: 4px 2px 14px; }
.page-title h1 { font-size: 26px; font-weight: 780; letter-spacing: -.03em; }

/* karty */
.card {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 700; }
.card-head small { color: var(--muted); font-size: 12.5px; }
.glow-border::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(47, 128, 255, .7), rgba(139, 92, 246, .35) 40%, transparent 60%, rgba(20, 184, 166, .45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 20px 4px 10px; }
.section-head h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); }
.section-head small { color: var(--muted); font-size: 11.5px; text-align: right; }

/* hero: liczniki od posiłku / snu */
.hero { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; padding: 16px 12px; overflow: hidden; }
.hero-divider { width: 1px; background: var(--border); margin: 6px 0; }
.hero-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-width: 0; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); stroke: color-mix(in srgb, var(--text) 8%, transparent); }
.ring .value { stroke: var(--ring, var(--primary)); transition: stroke-dashoffset 1.1s var(--ease), stroke .6s; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring) 55%, transparent)); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 0; }
.ring-center strong { font-size: 22px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.05; white-space: nowrap; }
.ring-center strong i { font-style: normal; font-size: .58em; font-weight: 700; color: var(--text-2); margin-left: 1px; }
.ring-center small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }
.ring-icon { position: absolute; left: 50%; top: -2px; transform: translate(-50%, -30%); width: 30px; height: 30px; border-radius: 10px;
    display: grid; place-items: center; color: #fff; background: var(--ring); box-shadow: 0 4px 14px color-mix(in srgb, var(--ring) 50%, transparent); }
.ring-icon .ic { width: 17px; height: 17px; }
.hero-title { font-size: 13px; font-weight: 700; color: var(--text); }
.hero-sub { font-size: 12px; color: var(--muted); line-height: 1.35; min-height: 2.7em; padding: 0 2px; }
.hero-item.is-sleeping .ring-icon { animation: breathe 3.2s ease-in-out infinite; }
.hero-item.is-sleeping .ring .value { animation: glowPulse 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, -30%) scale(1.12); } }
@keyframes glowPulse { 50% { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ring) 80%, transparent)); } }
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #c4b5fd; opacity: 0; animation: twinkle 3.6s infinite; }
@keyframes twinkle { 30% { opacity: .9; } 60% { opacity: 0; } }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 2px 0 8px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px 11px; position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.kpi::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; border-radius: 2px; background: var(--c); opacity: .85; }
.kpi small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font-size: 21px; font-weight: 780; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .kpi-last { display: block; font-size: 11px; font-style: normal; color: var(--muted); margin-top: 1px; }
.kpi .kpi-last b { color: var(--text); font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 2px; }
.chips-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 11px 6px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.chip .ic { width: 15px; height: 15px; color: var(--c); }
.chip.is-on { color: var(--text); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) var(--tint), var(--surface-solid)); }

/* kafelki */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 104px;
    padding: 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); text-align: left;
    box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: transform .22s var(--spring), border-color .25s, box-shadow .25s; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.tile:active, .tile.is-pressed { transform: scale(.95); }
.tile-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--c);
    background: color-mix(in srgb, var(--c) var(--tint), transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.tile-icon .ic { width: 23px; height: 23px; }
.tile b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.tile small { font-size: 11.5px; color: var(--muted); margin-top: -7px; font-variant-numeric: tabular-nums; }
.tile .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: color-mix(in srgb, var(--c) 35%, transparent);
    animation: ripple .6s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.tile.is-done { border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent), var(--shadow-sm); }
.tile .done-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: var(--c); color: #fff; animation: pop .5s var(--spring); }
.tile .done-check .ic { width: 15px; height: 15px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1); } }
.tile.is-live { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.tile.is-live::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%); animation: livePulse 2.8s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .35; } }
/* ostatni kafelek sam w rzędzie — na całą szerokość, w poziomie */
.tiles > .tile:last-child:nth-child(3n + 1) { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.tiles > .tile:last-child:nth-child(3n + 1) small { margin-top: 0; }

/* oś czasu / wpisy — stała siatka: godzina | ikona | treść (ikony zawsze w jednej kolumnie) */
.list-card { padding: 6px 4px; }
.timeline, .history-day-list { position: relative; }
.entry {
    position: relative; display: grid; grid-template-columns: 46px 40px minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
    width: 100%; padding: 9px 10px; border: 0; background: none; text-align: left; border-radius: 14px; transition: background .2s;
}
.entry:active { background: var(--surface-3); }
.entry-time { font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }
.entry-icon { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--c);
    background: color-mix(in srgb, var(--c) var(--tint), var(--surface-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); }
.entry-icon .ic { width: 21px; height: 21px; }
.entry-main { min-width: 0; }
.entry-main b { display: block; font-size: 14.5px; font-weight: 680; line-height: 1.2; }
.entry-main span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.entry-go { color: var(--muted); opacity: .55; }
.entry-go .ic { width: 16px; height: 16px; }
.timeline .entry:not(:last-child)::before, .history-day-list .entry:not(:last-child)::before {
    content: ""; position: absolute; left: calc(10px + 46px + 10px + 20px - 1px); top: 44px; bottom: -14px; width: 2px; border-radius: 2px;
    background: linear-gradient(var(--c), color-mix(in srgb, var(--c) 0%, transparent)); opacity: .35;
}
.entry.is-new { animation: slideIn .55s var(--spring); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px) scale(.98); } }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .ic { width: 34px; height: 34px; margin: 0 auto 8px; opacity: .6; }

/* historia */
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 15px; background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 10px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: color-mix(in srgb, var(--primary) 60%, transparent); box-shadow: 0 0 0 4px var(--primary-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon .ic, .search-clear .ic { width: 18px; height: 18px; color: var(--muted); }
.search-clear { border: 0; background: none; padding: 4px; display: grid; }
.filters { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600;
    color: var(--text-2); transition: all .2s; }
.filter.is-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.history-day { margin-bottom: 12px; }
.history-day-head { position: sticky; top: calc(env(safe-area-inset-top) + 62px); z-index: 5; display: flex; justify-content: space-between; align-items: baseline;
    padding: 8px 6px 6px; background: linear-gradient(var(--bg) 70%, transparent); }
.history-day-head b { font-size: 13.5px; font-weight: 720; }
.history-day-head { gap: 10px; }
.history-day-head small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.history-day .card { padding: 4px; margin: 0; }
.sentinel { height: 1px; }

/* raporty */
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); background: color-mix(in srgb, var(--text) 6%, transparent);
    gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { border: 0; background: none; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 650; color: var(--muted); white-space: nowrap; transition: all .2s; }
.segmented button.is-active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented-wide { display: flex; width: 100%; margin-bottom: 12px; }
.segmented-wide button { flex: 1; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 18px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar-col { position: relative; width: 100%; max-width: 34px; height: var(--h, 4%); min-height: 4px; border-radius: 9px 9px 5px 5px;
    background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 45%, transparent)); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 30%, transparent);
    transform-origin: bottom; animation: grow .8s var(--spring) backwards; animation-delay: calc(var(--i) * 60ms); }
.bar-col em { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.bar small { font-size: 10.5px; color: var(--muted); white-space: nowrap; text-align: center; line-height: 1.25; }
.bar.is-today small { color: var(--primary); font-weight: 700; }
@keyframes grow { from { transform: scaleY(0); } }
.nas-status { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-3);
    background: color-mix(in srgb, var(--text) 4%, transparent); margin-bottom: 12px; }
.nas-status .nas-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c, var(--ok));
    background: color-mix(in srgb, var(--c, var(--ok)) 16%, transparent); }
.nas-status b { display: block; font-size: 13.5px; }
.nas-status small { display: block; color: var(--muted); font-size: 12px; word-break: break-word; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid transparent;
    font-weight: 700; font-size: 14.5px; transition: transform .18s var(--spring), filter .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #8b5cf6));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 38%, transparent); }
.btn-soft { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost { background: none; border-color: var(--border); color: var(--text-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-block { width: 100%; margin: 6px 0 10px; }
.reports-list { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.report-group { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 4px 4px; }
.report { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.report:active { background: var(--surface-3); }
.report .r-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.report b { display: block; font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report small { color: var(--muted); font-size: 11.5px; }
.report .r-dl { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--border); }
.report .r-dl .ic { width: 18px; height: 18px; }
.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.date-range label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 7px; border-radius: 999px; border: 1px solid var(--border);
    background: none; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all .2s; }
.type-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .4; }
.type-chip.is-on { color: var(--text); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.type-chip.is-on i { opacity: 1; }

/* ustawienia */
.settings { padding: 6px; }
.setting { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; background: none; text-align: left; border-radius: 14px; }
.setting-link:active { background: var(--surface-3); }
.setting-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--primary); background: var(--primary-soft); }
.setting-icon.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.setting-text { flex: 1; min-width: 0; }
.setting-text strong { display: block; font-size: 14.5px; }
.setting-text small { display: block; color: var(--muted); font-size: 12.5px; }
.setting-chevron { color: var(--muted); }
.setting-chevron .ic { width: 18px; height: 18px; }
.settings .segmented-wide { margin: 4px 10px 10px; width: calc(100% - 20px); }
.about { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; }
/* rozmiar interfejsu */
.scale-value { margin-left: auto; padding: 4px 10px; border-radius: 999px; font-weight: 750; font-size: 13.5px; color: var(--primary);
    background: var(--primary-soft); font-variant-numeric: tabular-nums; min-width: 58px; text-align: center; }
.scale-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; padding: 4px 10px 2px; }
.scale-step { height: 44px; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center;
    font-weight: 800; color: var(--text-2); transition: transform .18s var(--spring); }
.scale-step:active { transform: scale(.9); }
.a-small { font-size: 13px; } .a-big { font-size: 21px; }
#scaleRange { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; margin: 0; cursor: pointer; --p: 38%; }
#scaleRange::-webkit-slider-runnable-track { height: 8px; border-radius: 6px;
    background: linear-gradient(90deg, var(--primary) var(--p), color-mix(in srgb, var(--text) 12%, transparent) var(--p)); }
#scaleRange::-moz-range-track { height: 8px; border-radius: 6px; background: color-mix(in srgb, var(--text) 12%, transparent); }
#scaleRange::-moz-range-progress { height: 8px; border-radius: 6px; background: var(--primary); }
#scaleRange::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff;
    border: 0; box-shadow: 0 0 0 4px var(--primary-soft), 0 3px 10px rgba(0, 0, 0, .35); }
#scaleRange::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0;
    box-shadow: 0 0 0 4px var(--primary-soft), 0 3px 10px rgba(0, 0, 0, .35); }
#scaleRange:focus-visible { outline: none; }
#scaleRange:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 35%, transparent); }
.scale-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 8px; }
.scale-foot small { color: var(--muted); font-size: 12px; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 700; font-size: 13px; padding: 6px 2px; white-space: nowrap; flex: none; }

/* dolna nawigacja */
.tabbar {
    position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 10px);
    width: min(528px, calc(100% - 24px)); height: var(--nav-h); display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border-strong);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.tabbar button { position: relative; z-index: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; transition: color .25s; }
.tabbar button b { font-weight: 650; }
.tabbar button .ic { width: 23px; height: 23px; transition: transform .35s var(--spring); }
.tabbar button.is-active { color: var(--primary); }
.tabbar button.is-active .ic { transform: translateY(-1px) scale(1.08); }
.tab-indicator { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 16px;
    background: var(--primary-soft); transition: transform .45s var(--spring); }

/* karta dolna (formularze) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 14, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    animation: fadeIn .25s ease; }
.sheet-backdrop.is-closing { animation: fadeOut .22s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
    position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%); max-height: calc(92dvh / var(--ui-zoom, 1)); display: flex; flex-direction: column;
    transform: translateX(-50%); background: var(--surface-solid); border: 1px solid var(--border-strong); border-bottom: 0;
    border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, .4); animation: sheetIn .42s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-closing { animation: sheetOut .26s ease forwards; }
@keyframes sheetIn { from { transform: translate(-50%, 100%); } }
@keyframes sheetOut { to { transform: translate(-50%, 100%); } }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 9px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px 10px; flex: none; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head small { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.sheet-head h3 { font-size: 19px; font-weight: 760; }
.sheet-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--c, var(--primary));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--c, var(--primary)) 40%, transparent); flex: none; }
.sheet-body { padding: 4px 16px 12px; overflow-y: auto; overscroll-behavior: none; flex: 1; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--border); flex: none; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn-danger { flex: 0 0 auto; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 2px 6px; }
.input, .field input, .field select, .field textarea, .date-range input {
    width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-strong);
    background: var(--surface-2); outline: 0; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .date-range input:focus {
    border-color: color-mix(in srgb, var(--primary) 65%, transparent); box-shadow: 0 0 0 4px var(--primary-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* dawka podstawiona z ostatniego podania — widać, że to propozycja */
.field input.is-prefilled { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 7%, var(--surface-2)); }
.field-hint { display: block; margin: 5px 2px 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.amount { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 14px; }
.amount button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center; }
.amount button:active { transform: scale(.92); }
.amount output { min-width: 150px; text-align: center; font-size: 42px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.amount output small { font-size: 18px; color: var(--muted); font-weight: 650; margin-left: 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.quick button { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 650; font-size: 13.5px;
    font-variant-numeric: tabular-nums; transition: all .18s; }
.quick button.is-active { background: var(--c, var(--primary)); color: #fff; border-color: transparent; }
.quick button small { color: inherit; opacity: .65; margin-left: 4px; font-weight: 600; }
.when { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.when button { padding: 7px 11px; border-radius: 11px; border: 1px solid var(--border-strong); background: none; font-size: 13px; font-weight: 650; color: var(--text-2); }
.when button.is-active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 50%, transparent); color: var(--primary); }
.when input { width: 110px; min-height: 36px; padding: 6px 10px; border-radius: 11px; }
/* pamięć: wyszukiwarka zapamiętanych pozycji */
.memory { margin: -4px 0 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-3); background: color-mix(in srgb, var(--text) 3%, transparent);
    max-height: 238px; overflow-y: auto; overscroll-behavior: none; }
.memory-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 8px 12px 6px; font-size: 11px; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: .07em; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.memory-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--border); }
.memory-item:last-child { border-bottom: 0; }
.memory-pick { border: 0; background: none; text-align: left; padding: 10px 0; min-width: 0; }
.memory-pick b { display: block; font-size: 14.5px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-pick b mark { background: color-mix(in srgb, var(--c, var(--primary)) 28%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; }
.memory-pick small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-count { font-size: 11.5px; font-weight: 700; color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent);
    padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.memory-forget { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.memory-forget .ic { width: 15px; height: 15px; }
.memory-new { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border: 0; background: none; text-align: left; font-weight: 650; color: var(--c, var(--primary)); }
.memory-new .ic { width: 18px; height: 18px; }
.memory-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; }
.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.input-wrap input { padding-left: 42px; }
.confirm-delete { animation: shake .4s; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none;
    border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.pw-eye .ic { position: static; transform: none; width: 19px; height: 19px; }
.pw-meter { height: 18px; margin: -8px 2px 12px; position: relative; }
.pw-meter i { display: block; height: 4px; width: 0; border-radius: 3px; transition: width .3s var(--ease), background .3s; }
.pw-meter small { font-size: 11.5px; color: var(--muted); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* powiadomienie */
.toast { position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translate(-50%, calc(-100% - 40px)); display: flex; align-items: center; gap: 10px;
    max-width: calc(100% - 32px); padding: 10px 10px 10px 14px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow); font-weight: 650; font-size: 14px; visibility: hidden; opacity: 0; pointer-events: none;
    transition: transform .45s var(--spring), opacity .25s ease, visibility 0s linear .45s; }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; opacity: 1; pointer-events: auto; transition: transform .45s var(--spring), opacity .2s ease, visibility 0s; }
.toast .t-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.toast.is-error .t-icon { background: var(--danger); }
.toast .t-icon .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.toast button { border: 0; background: var(--primary-soft); color: var(--primary); font-weight: 750; padding: 6px 10px; border-radius: 10px; display: inline-flex; gap: 5px; align-items: center; }
.toast button .ic { width: 15px; height: 15px; }

@media (min-width: 500px) {
    .kpis { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 380px) {
    .ring { width: 98px; height: 98px; }
    .ring-center strong { font-size: 21px; }
    .tiles { gap: 8px; }
    .tile { min-height: 96px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── 2.1: nagłówek ze zdjęciem ─────────────────────────────────────────────── */
.brand-mark.has-photo { background: var(--surface-2); padding: 0; }
.brand-mark.has-photo::after { display: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.muted-note { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 2px 10px; }
.muted-note .ic { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 13px; border-radius: 11px; }
.btn-sm .ic { width: 16px; height: 16px; }
.icon-btn-sm { width: 34px; height: 34px; border-radius: 11px; box-shadow: none; flex: none; }
.icon-btn-sm .ic { width: 16px; height: 16px; }
.icon-btn-sm.ok { color: var(--ok); }
.segmented button .ic { width: 15px; height: 15px; display: inline-block; vertical-align: -3px; margin-right: 5px; }
.setting[disabled] { opacity: .55; }
.setting-icon[style*="--sc"] { color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); }
.link-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.link-btn .ic { width: 16px; height: 16px; }
.link-btn.danger { color: var(--danger); }

/* wpisy: autor, oczekujące (offline) */
.entry-author { font-style: normal; font-size: 11px; font-weight: 650; color: var(--muted); margin-left: 7px; padding: 1px 7px; border-radius: 999px;
    background: color-mix(in srgb, var(--text) 7%, transparent); vertical-align: 1px; }
.entry.is-pending { opacity: .75; }
.entry.is-pending .entry-icon { outline: 2px dashed color-mix(in srgb, var(--warn) 70%, transparent); outline-offset: 2px; }
.entry-pending { font-style: normal; color: var(--warn); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; }
.entry-pending .ic { width: 12px; height: 12px; }

/* okno potwierdzenia */
.confirm-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 14, .55);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
.confirm-overlay.is-closing { animation: fadeOut .18s ease forwards; }
.confirm-card { width: min(380px, 100%); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 22px; padding: 20px 18px 16px;
    box-shadow: var(--shadow); text-align: center; animation: pop .35s var(--spring); }
.confirm-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 10px; color: var(--warn);
    background: color-mix(in srgb, var(--warn) 15%, transparent); }
.confirm-card p { margin: 0 0 16px; font-size: 15px; line-height: 1.45; font-weight: 550; }

/* leki — odstępy */
.meds-card { margin: 12px 0 0; padding: 14px 14px 8px; }
.meds-card .card-head { margin-bottom: 6px; }
.med-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.med-row:first-of-type { border-top: 0; }
.med-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--mc); background: color-mix(in srgb, var(--mc) 15%, transparent); }
.med-icon .ic { width: 19px; height: 19px; }
.med-text b { display: block; font-size: 14px; }
.med-text small { display: block; color: var(--muted); font-size: 11.5px; }
.med-bar { height: 5px; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); margin-top: 6px; overflow: hidden; }
.med-bar i { display: block; height: 100%; border-radius: inherit; background: var(--mc); transition: width .8s var(--ease); }
.med-state { font-size: 12px; font-weight: 750; color: var(--mc); white-space: nowrap; font-variant-numeric: tabular-nums; }
.med-row.is-ready { --mc: var(--ok); }
.med-row.is-wait { --mc: #f59e0b; }
.med-row.is-limit { --mc: var(--danger); }
.med-info { margin: -4px 0 14px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.med-info.is-wait { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.med-info-top { display: flex; gap: 10px; align-items: flex-start; }
.med-info-top .ic { width: 20px; height: 20px; color: var(--ok); flex: none; margin-top: 1px; }
.med-info.is-wait .med-info-top .ic { color: var(--warn); }
.med-info-top b { display: block; font-size: 13.5px; }
.med-info-top small { display: block; color: var(--text-2); font-size: 12.5px; }
.med-info-set { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 2px; font-size: 13px; color: var(--muted); }
.med-info-set label { display: inline-flex; align-items: center; gap: 6px; }
.med-info-set .input { width: 64px; min-height: 36px; padding: 6px 8px; border-radius: 10px; text-align: center; }
.med-info .muted-note { margin: 6px 0 0; font-size: 11.5px; }

/* wykres snu dzień po dniu */
.sleep-chart { display: flex; flex-direction: column; gap: 6px; }
.sc-axis, .sc-row { display: grid; grid-template-columns: 52px 1fr 56px; align-items: center; gap: 8px; }
.sc-axis div { position: relative; height: 14px; }
.sc-axis i { position: absolute; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-axis i:first-child { transform: none; }
.sc-axis i:last-child { transform: translateX(-100%); }
.sc-label { font-size: 12px; font-weight: 700; line-height: 1.1; }
.sc-label small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.sc-row.is-today .sc-label { color: var(--primary); }
.sc-bar { position: relative; height: 20px; border-radius: 7px; background: color-mix(in srgb, var(--text) 6%, transparent); overflow: hidden; }
.sc-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.sc-seg { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    box-shadow: 0 0 10px rgba(139, 92, 246, .35); transform-origin: left; animation: growX .7s var(--spring) backwards; animation-delay: calc(var(--i) * 35ms); }
.sc-seg.is-live { background: repeating-linear-gradient(135deg, #8b5cf6 0 6px, #a78bfa 6px 12px); }
@keyframes growX { from { transform: scaleX(0); } }
.sc-total { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* trendy */
.trend-chart { margin-top: 2px; }
.trend-svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend-line { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.4s var(--ease) forwards; filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--c) 45%, transparent)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.trend-dot { fill: var(--surface-solid); stroke: var(--c); stroke-width: 2.4; }
.trend-val { font-size: 10px; font-weight: 750; fill: var(--text-2); text-anchor: middle; font-family: var(--font); }
.trend-lbl { font-size: 9.5px; fill: var(--muted); text-anchor: middle; font-family: var(--font); }

/* siatki centylowe WHO */
.growth-chart { margin: 6px 0 4px; }
.growth-svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.g-grid { stroke: color-mix(in srgb, var(--text) 8%, transparent); stroke-width: 1; }
.g-axis { font-size: 9.5px; fill: var(--muted); }
.g-band { fill: color-mix(in srgb, var(--c) 9%, transparent); }
.g-band-in { fill: color-mix(in srgb, var(--c) 13%, transparent); }
.g-curve { fill: none; stroke: color-mix(in srgb, var(--c) 45%, transparent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.g-median { stroke: color-mix(in srgb, var(--c) 80%, transparent); stroke-width: 1.8; stroke-dasharray: none; }
.g-pc { font-size: 9px; fill: var(--muted); font-weight: 700; }
.g-path { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; opacity: .8; }
.g-point { fill: var(--c); stroke: var(--surface-solid); stroke-width: 2.4; filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--c) 60%, transparent)); }
.g-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 6px; }
.g-legend i { display: inline-block; width: 16px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.lg-band { background: color-mix(in srgb, var(--c, var(--primary)) 22%, transparent); }
.lg-band.lg-out { background: color-mix(in srgb, var(--c, var(--primary)) 10%, transparent); }
.lg-med { height: 2px !important; vertical-align: 3px !important; background: var(--text-2); }
.growth-list { margin-top: 10px; }
.g-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 7px 2px; border-top: 1px solid var(--border); font-size: 13px; }
.g-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.g-row small { color: var(--ok); font-weight: 650; min-width: 76px; text-align: right; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.measure-grid .field span { font-size: 10.5px; }
.g-last { display: flex; flex-direction: column; gap: 4px; margin: -2px 2px 14px; font-size: 13px; color: var(--text-2); }
.g-last small { color: var(--muted); }
@media (max-width: 420px) { .measure-grid { grid-template-columns: 1fr 1fr; } }

/* profil dziecka */
.child-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.child-photo { width: 72px; height: 72px; border-radius: 22px; overflow: hidden; flex: none; display: grid; place-items: center; color: var(--primary);
    background: linear-gradient(135deg, color-mix(in srgb, #2f80ff 25%, transparent), color-mix(in srgb, #8b5cf6 25%, transparent));
    box-shadow: 0 8px 22px rgba(47, 128, 255, .25); }
.child-photo img { width: 100%; height: 100%; object-fit: cover; }
.child-photo .ic { width: 34px; height: 34px; }
.child-info strong { display: block; font-size: 18px; font-weight: 760; }
.child-info small { display: block; color: var(--muted); font-size: 13px; }
.child-photo-actions { display: flex; gap: 14px; margin-top: 6px; }

/* przypomnienia */
.switch { display: inline-block; vertical-align: middle; position: relative; width: 44px; height: 26px; border-radius: 999px; flex: none; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    transition: transform .3s var(--spring); }
.switch.is-on { background: var(--ok); }
.switch.is-on i { transform: translateX(18px); }
.push-card { padding: 6px 6px 12px; }
.push-card .muted-note { margin: 2px 12px 8px; }
.push-card .btn-row { padding: 6px 10px 0; }
.rem-list { border-top: 1px solid var(--border); margin: 4px 0; }
.rem-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-bottom: 1px solid var(--border); }
.rem-row > .ic { width: 20px; height: 20px; color: var(--muted); flex: none; margin: 0 12px 0 12px; }
.rem-switch { display: flex; flex: none; border: 0; background: none; padding: 0; cursor: pointer; }
.rem-text { flex: 1; min-width: 0; }
.rem-text b { display: block; font-size: 14px; }
.rem-text small { display: block; font-size: 11.5px; color: var(--muted); }
.rem-input { width: auto; min-height: 36px; padding: 6px 8px; border-radius: 10px; font-size: 14px; }
.rem-quiet { flex-wrap: wrap; }
.rem-range { display: flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; padding-left: 54px; color: var(--muted); font-size: 13px; }
.rem-range .rem-input { flex: 1; max-width: 140px; }

/* zapamiętane pozycje */
.memory-manage { display: flex; align-items: center; gap: 7px; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--border); background: none;
    color: var(--muted); font-size: 12.5px; font-weight: 650; }
.memory-manage .ic { width: 15px; height: 15px; }
.mem-section { display: flex; align-items: center; gap: 6px; margin: 14px 2px 8px; font-size: 11.5px; font-weight: 750; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em; }
.mem-section .ic { width: 15px; height: 15px; }
.merge-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); font-size: 14px; }
.merge-card s { color: var(--muted); }
.merge-card small { color: var(--muted); font-size: 11px; }
.merge-arrow { color: var(--c); font-weight: 800; margin: 0 3px; }
.mem-list { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.mem-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--border); }
.mem-item:last-child { border-bottom: 0; }
.mem-item .input { flex: 1; min-height: 38px; padding: 6px 10px; border-radius: 10px; }
.mem-item.will-merge .input { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.mem-text { flex: 1; min-width: 0; }
.mem-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-text small { display: block; color: var(--muted); font-size: 11.5px; }

/* konta */
.acc-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.acc-item.is-off { opacity: .55; }
.acc-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.acc-avatar .ic { width: 19px; height: 19px; }
.acc-main .acc-avatar { background: linear-gradient(135deg, #2f80ff, #8b5cf6); }
.acc-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px 48px; border-bottom: 1px solid var(--border); }
