:root {
  --bg: #f3f5f3; --surface: #fff; --surface-2: #f7f9f7; --ink: #15211e; --muted: #667470; --line: #e3e8e4;
  --accent: #1f6f5c; --accent-ink: #fff; --accent-soft: #e2f1ec;
  --ok: #1f7a4a; --ok-bg: #e0f3e7; --warn: #8f5f08; --warn-bg: #fbeed0; --bad: #b3372a; --bad-bg: #fbe3df; --info: #23609f; --info-bg: #e0ecf9; --mute-bg: #eceeeb;
  --r: 16px; --r-sm: 11px;
  --shadow: 0 1px 2px rgba(16, 32, 28, .05), 0 6px 20px rgba(16, 32, 28, .05);
  --shadow-up: 0 2px 4px rgba(16, 32, 28, .08), 0 12px 28px rgba(16, 32, 28, .1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1413; --surface: #172120; --surface-2: #1c2826; --ink: #e9efed; --muted: #94a3a0; --line: #27332f;
    --accent: #5cc2a5; --accent-ink: #072019; --accent-soft: #1b3a32;
    --ok: #7fd3a0; --ok-bg: #1a3a28; --warn: #ebc36d; --warn-bg: #3b3013; --bad: #f29585; --bad-bg: #43201a; --info: #8fbaf0; --info-bg: #1b2f4e; --mute-bg: #24302d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-up: 0 8px 24px rgba(0, 0, 0, .45); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.3rem; letter-spacing: -.02em; } h2 { font-size: 1.2rem; letter-spacing: -.015em; } h3 { font-size: 1rem; }
small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
code { background: var(--mute-bg); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
[hidden] { display: none !important; }
.sp { flex: 1; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.neg { color: var(--bad); } .pos { color: var(--ok); } .best { color: var(--ok); } .mutedtxt { color: var(--muted); font-weight: 400; }

/* ---------- układ ---------- */
#app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
#nav { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
#nav .brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; font-size: 1.1rem; color: var(--ink); letter-spacing: -.02em; }
#nav .brand img { width: 34px; height: 34px; border-radius: 10px; }
#nav a:not(.brand) { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; }
#nav a:not(.brand):hover { background: var(--mute-bg); color: var(--ink); }
#nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
#wrap { min-width: 0; }
#top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 5; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.ok i { background: var(--ok); } .sync.warn i { background: var(--warn); } .sync.bad i { background: var(--bad); } .sync.bad { color: var(--bad); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
#main { padding: 8px 28px 72px; max-width: 1240px; display: flex; flex-direction: column; gap: 16px; }
#bottom { display: none; }

/* ---------- karty i kafelki ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card > h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h3 > a, .card > h3 > button, .card > h3 > .acts { margin-left: auto; font-weight: 500; font-size: .85rem; }
.card.arch, li.arch { opacity: .55; }
.sect { display: flex; align-items: center; gap: 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 8px 2px -4px; font-weight: 700; }
.sect em { font-style: normal; background: var(--mute-bg); border-radius: 99px; padding: 1px 9px; letter-spacing: 0; font-weight: 600; }
.sect .b { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile span { color: var(--muted); font-size: .8rem; display: block; }
.tile b { font-size: 1.35rem; font-variant-numeric: tabular-nums; display: block; letter-spacing: -.02em; }
.tile.bad b { color: var(--bad); }

/* kafelki modułów (start, menu, szybkie dodawanie) */
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mtile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; cursor: pointer; min-width: 0; transition: transform .12s, box-shadow .12s, border-color .12s; }
.mtile:hover { border-color: var(--accent); box-shadow: var(--shadow-up); transform: translateY(-2px); }
.mtile:active { transform: scale(.98); }
.mtile b { font-size: 1rem; }
.mt-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 8px; }
.mt-n { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--bad); color: #fff; font-style: normal; font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.mtiles.pick { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* start */
.hero { flex-direction: row; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px; }
.hero-txt { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.hero-txt p { color: var(--muted); }
.hero-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 1 1 100%; }
.hero-nums a { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; color: var(--ink); min-width: 0; }
.hero-nums span { font-size: .78rem; color: var(--muted); display: block; }
.hero-nums b { font-size: 1.2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { --p: 0; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--mute-bg) 0); flex: none; }
.ring b { background: var(--surface); width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; letter-spacing: -.02em; }
.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attn a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); min-height: 52px; }
.attn a > span { flex: 1; min-width: 0; }
.attn em { font-style: normal; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.at-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--mute-bg); color: var(--muted); }
.attn .bad .at-ic { background: var(--bad-bg); color: var(--bad); } .attn .warn .at-ic { background: var(--warn-bg); color: var(--warn); } .attn .info .at-ic { background: var(--info-bg); color: var(--info); }
.chev { color: var(--muted); width: 18px; height: 18px; }
.allgood { display: flex; align-items: center; gap: 10px; color: var(--ok); font-weight: 600; }
.welcome { padding: 26px; }

/* plakietki, paski, komunikaty */
.b { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 650; white-space: nowrap; background: var(--mute-bg); color: var(--muted); }
.b.ok { background: var(--ok-bg); color: var(--ok); } .b.warn { background: var(--warn-bg); color: var(--warn); } .b.bad { background: var(--bad-bg); color: var(--bad); } .b.info { background: var(--info-bg); color: var(--info); }
.chips { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.bar { height: 7px; background: var(--mute-bg); border-radius: 9px; overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.prog { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; color: var(--ink); font-size: .92rem; font-weight: 600; padding: 6px 0; }
.prog.sub { font-weight: 400; font-size: .86rem; padding-left: 14px; color: var(--muted); }
.prog .bar { grid-column: 1 / -1; } .prog em { font-style: normal; color: var(--muted); font-size: .8rem; font-weight: 400; }
.note { background: var(--info-bg); color: var(--ink); border-radius: var(--r-sm); padding: 12px 14px; font-size: .9rem; }
.note.warn { background: var(--warn-bg); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.empty { color: var(--muted); font-size: .9rem; padding: 6px 0; list-style: none; }
.meta { color: var(--muted); font-size: .8rem; }
.err { color: var(--bad); font-size: .9rem; min-height: 1em; }
.crumbs { font-size: .9rem; color: var(--muted); }
.sumline { color: var(--muted); font-size: .86rem; }
.desc { white-space: pre-wrap; }

/* ---------- przyciski i pola ---------- */
.btn { font: inherit; font-size: .9rem; font-weight: 550; min-height: 40px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: border-color .12s, background .12s; }
.btn:hover { border-color: var(--accent); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: var(--bad-bg); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: .82rem; border-radius: 9px; }
.btn.big { min-height: 48px; font-size: 1rem; }
.btn.link { border: 0; background: none; color: var(--accent); }
.btn.add { width: 100%; border-style: dashed; color: var(--accent); background: transparent; }
.btn:disabled { opacity: .5; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; min-width: 36px; min-height: 36px; border-radius: 9px; }
.x:hover { background: var(--mute-bg); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ro .ed { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, select, textarea { font: inherit; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); padding: 0; flex: none; }
input[type=color] { padding: 3px; height: 42px; width: 100%; }
input.mini { width: 66px; min-height: 30px; padding: 3px 6px; }
.tile small input { vertical-align: baseline; }
.chk { display: inline-flex; gap: 10px; align-items: center; font-size: .92rem; min-height: 36px; }
.bar-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bar-top input[type=search] { flex: 1 1 200px; }
.bar-top .mon { min-width: 140px; text-align: center; text-transform: capitalize; }
.seg { display: inline-flex; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; }
.seg button { font: inherit; font-size: .86rem; border: 0; background: none; color: var(--muted); padding: 9px 14px; cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; margin: 0 -2px; }
.chiprow::-webkit-scrollbar { display: none; }
.chip { font: inherit; font-size: .88rem; font-weight: 550; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.chip em { font-style: normal; font-size: .76rem; background: var(--mute-bg); color: var(--muted); border-radius: 99px; padding: 1px 8px; font-weight: 650; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on em { background: rgba(255, 255, 255, .22); color: inherit; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 16px; color: var(--muted); white-space: nowrap; border-bottom: 2.5px solid transparent; font-weight: 550; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }

/* zwijane sekcje */
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: 28px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
.fold[open] > summary::after { transform: rotate(225deg); }
.fold > summary em { font-style: normal; font-size: .78rem; font-weight: 650; background: var(--mute-bg); color: var(--muted); border-radius: 99px; padding: 1px 9px; }
.fold-body { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.fold.card { gap: 0; }
.fold.plain > summary { font-weight: 550; font-size: .9rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px; }
.fold.plain[open] > summary { border-color: var(--accent); color: var(--ink); }

/* ---------- listy i tabele ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li > a { flex: 1; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; color: var(--ink); min-width: 0; align-items: center; min-height: 48px; }
.list li > a[href]:hover b { color: var(--accent); }
.list span { min-width: 0; } .list b { font-weight: 600; overflow-wrap: anywhere; }
.list em { font-style: normal; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--muted); }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { color: var(--ink); } td a:hover b { color: var(--accent); }
tr:last-child td { border-bottom: 0; }
#main > .tw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 24px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; align-items: baseline; }
.kv span { color: var(--muted); } .kv b { text-align: right; font-weight: 600; } .kv small { display: inline; }
.head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grid2 label, .modal label, #login label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); font-weight: 550; }
.static { padding: 9px 0; }
.subs { list-style: none; margin: 0; padding: 0; }
.subs li { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.subs li:first-child { border-top: 0; }
.subs label { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 0; cursor: pointer; }
.subs .done { text-decoration: line-through; color: var(--muted); }
.cmt { border-left: 3px solid var(--accent-soft); padding-left: 12px; } .cmt small { display: inline; }

/* kafelki pozycji */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; color: var(--ink); display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow); min-width: 0; transition: transform .12s, box-shadow .12s, border-color .12s; }
a.tcard:hover { border-color: var(--accent); box-shadow: var(--shadow-up); transform: translateY(-2px); }
.tcard.is-done { opacity: .62; }
.tcard img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--r-sm); }
.tcard select { font-size: .86rem; min-height: 38px; margin-top: 4px; }
.tc-top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-title { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.tc-prog { display: flex; align-items: center; gap: 10px; }
.tc-prog em { font-style: normal; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); font-size: .86rem; }
.tc-foot span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tc-foot span.neg { color: var(--bad); font-weight: 650; }
.tc-foot .ic { width: 16px; height: 16px; }
.tc-foot b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* oferty */
.offers { display: flex; flex-direction: column; gap: 10px; }
.offer { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.offer.chosen { border-color: var(--ok); background: var(--ok-bg); }
.offer.dead { opacity: .55; }
.of-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.of-price { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex: none; }
.of-price > b { font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.of-meta { font-size: .84rem; color: var(--muted); }
.of-note summary { cursor: pointer; font-size: .84rem; color: var(--accent); }
.of-note p { font-size: .86rem; padding-top: 6px; }

/* oś czasu, kalendarz, ceny, plany */
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.tl-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-left: 38%; }
.tl-row { display: grid; grid-template-columns: 38% 1fr; align-items: center; gap: 8px; padding: 6px 0; color: var(--ink); border-top: 1px solid var(--line); }
.tl-name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; height: 16px; background: var(--mute-bg); border-radius: 8px; }
.tl-bar { position: absolute; top: 3px; height: 10px; border-radius: 6px; background: var(--muted); }
.tl-bar.ok { background: var(--ok); } .tl-bar.warn { background: var(--warn); } .tl-bar.bad { background: var(--bad); } .tl-bar.info { background: var(--info); }
.tl-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.dow, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow span { padding: 8px 4px; font-size: .72rem; color: var(--muted); text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.day { min-height: 92px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 5px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; overflow: hidden; }
.day:nth-child(7n+1) { border-left: 0; }
.day:hover:not(.off) { background: var(--surface-2); }
.day.off { cursor: default; background: var(--bg); }
.day > span { font-size: .82rem; color: var(--muted); }
.day.today > span { background: var(--accent); color: var(--accent-ink); border-radius: 99px; width: 24px; height: 24px; display: grid; place-items: center; font-weight: 700; }
.ev { font-style: normal; font-size: .7rem; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.ev.warn { background: var(--warn-bg); color: var(--warn); } .ev.info { background: var(--info-bg); color: var(--info); } .ev.bad { background: var(--bad-bg); color: var(--bad); } .ev.mute { background: var(--mute-bg); color: var(--muted); }
.ev.off { text-decoration: line-through; opacity: .6; }
.day .more { font-style: normal; font-size: .7rem; color: var(--muted); }
.watch details { border-top: 1px solid var(--line); padding-top: 8px; }
.watch summary { cursor: pointer; }
.find { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.find .price { text-align: right; } .find .acts { grid-column: 1 / -1; }
.spark { width: 100%; max-width: 360px; height: 48px; color: var(--accent); display: block; }
.planbox { overflow: auto; max-height: 75vh; background: #fff; border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.planbox img { display: block; max-width: none; height: auto; }
.m3d { position: relative; height: min(62vh, 640px); min-height: 340px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.m3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.m3d canvas:active { cursor: grabbing; }
.m3d-hint { position: absolute; left: 10px; bottom: 8px; font-size: .74rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; pointer-events: none; }

.vizgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.viz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.viz:hover { border-color: var(--accent); }
.viz img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--mute-bg); }
.viz span { padding: 10px 12px; min-width: 0; } .viz b { overflow-wrap: anywhere; }
.sect .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }

/* ---------- okna i komunikaty ---------- */
.modal { border: 0; border-radius: 20px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.modal::backdrop { background: rgba(10, 20, 18, .5); backdrop-filter: blur(2px); }
.modal > form, .modal > div { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.modal .grid label { min-width: 0; }
.modal textarea, .modal input:not([type=checkbox]), .modal select { width: 100%; }
.modal .wide { grid-column: 1 / -1; }
.modal h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.modal .more > summary { cursor: pointer; color: var(--accent); font-weight: 650; padding: 6px 0; }
.modal .more[open] > summary { margin-bottom: 12px; }
.modal footer { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 2px; margin-bottom: -6px; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 99; width: min(520px, calc(100vw - 24px)); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: .9rem; box-shadow: var(--shadow-up); }
.toast.bad { background: var(--bad); color: #fff; }
#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
#login form { width: min(400px, 100%); align-items: stretch; text-align: center; padding: 30px 26px; gap: 14px; }
#login form img { margin: 0 auto; border-radius: 18px; } #login label { text-align: left; }

/* ---------- tablet i telefon ---------- */
@media (max-width: 1000px) {
  #app { display: block; }
  #nav { display: none; }
  #top { padding: 12px 18px; }
  #top .top-add { display: none; }
  #main { padding: 4px 18px calc(104px + env(safe-area-inset-bottom)); }
  #bottom { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; bottom: 0; left: 0; right: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 30; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  #bottom a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .7rem; font-weight: 600; padding: 6px 2px; color: var(--muted); border-radius: 12px; min-height: 52px; justify-content: center; }
  #bottom a.on { color: var(--accent); }
  #bottom a.on .ic { stroke-width: 2.3; }
  .fab { justify-self: center; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-up); transform: translateY(-12px); cursor: pointer; }
  .fab .ic { width: 26px; height: 26px; stroke-width: 2.4; }
  .fab:active { transform: translateY(-12px) scale(.94); }
  .mtiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  #top { padding: 10px 14px; } #top h1 { font-size: 1.2rem; }
  #main { padding-left: 14px; padding-right: 14px; gap: 14px; }
  input, select, textarea { font-size: 16px; }
  .card { padding: 16px; }
  .mtiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mtile { padding: 14px; }
  .cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .tile b { font-size: 1.12rem; }
  .cols { grid-template-columns: 1fr; }
  .hero { padding: 18px; gap: 14px; }
  .hero-nums { grid-template-columns: 1fr; gap: 8px; }
  .hero-nums a { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; }
  .hero-nums small { grid-column: 1 / -1; }
  .day { min-height: 56px; } .ev { font-size: 0; height: 6px; padding: 0; }
  .seg button { padding: 9px 11px; }
  /* okna jako arkusz wysuwany od dołu */
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .modal > form, .modal > div { padding: 20px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal .grid { grid-template-columns: minmax(0, 1fr); }
  .modal footer .btn { flex: 1; min-height: 46px; } .modal footer .sp { display: none; }
  /* tabele jako karty */
  table, tbody, tr, td { display: block; } thead { display: none; }
  tr { padding: 12px 14px; border-bottom: 1px solid var(--line); } tr:last-child { border-bottom: 0; }
  td, td.r { border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  td:not(:first-child):not(:empty)::before { content: attr(data-l) ": "; color: var(--muted); font-size: .8rem; }
  td[data-l=""]::before { content: none !important; }
  .tl-row { grid-template-columns: 1fr; } .tl-head { margin-left: 0; }
  .of-head { flex-direction: column; } .of-price { flex-direction: row; align-items: center; }
}

@media print {
  #nav, #top, #bottom, #toasts, .noprint, .page-tabs { display: none !important; }
  #app { display: block; } #main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card { border: 0; box-shadow: none; padding: 0; } .tw { overflow: visible; }
  table { font-size: 10px; } td, th { padding: 4px 6px; border-bottom: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
}
