/* Kamienica — tokeny, reset, typografia i komponenty wspolne.
   Kolory tylko przez tokeny; ciemny motyw przez prefers-color-scheme oraz html[data-theme]. */

/* Uklad: aplikacja mobilna; na komputerze telefon(y) w ramce + panel demo. */
:root {
  --bg: #F2F3F8;
  --surface: #FFFFFF;
  --surface-2: #EEF0F6;
  --surface-3: #E2E5EF;
  --ink: #12152A;
  --ink-2: #3B4060;
  --muted: #646A8A;
  --line: #E0E3EE;
  --line-2: #CDD2E1;

  --accent: #4B46E3;
  --accent-press: #3D38C9;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECEBFF;
  --accent-text: #4038D0;

  --ok: #16A34A;      --ok-soft: #E3F5EA;      --ok-text: #137A3A;
  --warn: #E08A00;    --warn-soft: #FDF1DC;    --warn-text: #935800;
  --danger: #DC2E2E;  --danger-soft: #FDE6E6;  --danger-text: #B42121;
  --info: #0B84D6;    --info-soft: #E1F1FC;    --info-text: #0A64A3;
  --violet: #8B3FD9;  --violet-soft: #F2E8FD;  --violet-text: #7432BA;
  --teal: #0F9488;    --teal-soft: #DDF4F1;    --teal-text: #0B7268;
  --idle: #8A90A8;    --idle-soft: #EDEFF5;    --idle-text: #5A607C;

  --hero-1: #2A2690;
  --hero-2: #4B46E3;
  --hero-ink: #FFFFFF;
  --hero-ink-2: rgba(255, 255, 255, 0.78);
  --hero-d1: #8F1D1D;
  --hero-d2: #D33A2C;
  --hero-o1: #0E5C3A;
  --hero-o2: #18925A;

  --scrim: rgba(12, 14, 30, 0.42);
  --glass: rgba(255, 255, 255, 0.94);
  --push-bg: rgba(250, 250, 255, 0.94);
  --toast-bg: #1A1D33;
  --toast-ink: #FFFFFF;
  --focus: #4B46E3;
  --shadow-1: 0 1px 2px rgba(18, 21, 42, 0.06), 0 2px 8px rgba(18, 21, 42, 0.04);
  --shadow-2: 0 12px 32px rgba(18, 21, 42, 0.16), 0 2px 8px rgba(18, 21, 42, 0.08);

  --av-1: #4B46E3; --av-2: #0F9488; --av-3: #D2552D; --av-4: #8B3FD9;
  --av-5: #0B84D6; --av-6: #C2367A; --av-7: #5B7A1E; --av-8: #9A6400;

  --stage-bg: #E6E8F1;
  --stage-glow: #F7F8FC;
  --bezel: #0B0C14;
  --bezel-edge: #2A2D3D;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-xs: 8px;
  --r-s: 12px;
  --r: 16px;
  --r-l: 20px;
  --r-xl: 26px;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0E19;
    --surface: #151829;
    --surface-2: #1C2035;
    --surface-3: #262B44;
    --ink: #EDEFFA;
    --ink-2: #C2C7DD;
    --muted: #8F96B4;
    --line: #252A42;
    --line-2: #343A58;
    --accent: #5E5AF5;
    --accent-press: #4F4BE0;
    --accent-ink: #FFFFFF;
    --accent-soft: #24234F;
    --accent-text: #A9A6FF;
    --ok: #2FC26A;      --ok-soft: #12301F;      --ok-text: #5FD98F;
    --warn: #F0A43A;    --warn-soft: #382A12;    --warn-text: #F5B95F;
    --danger: #F2635E;  --danger-soft: #3A1A1D;  --danger-text: #FF8A85;
    --info: #42A7F0;    --info-soft: #102A40;    --info-text: #7CC2F5;
    --violet: #B07BF5;  --violet-soft: #2A1C40;  --violet-text: #C9A3FA;
    --teal: #2CC7B6;    --teal-soft: #0F2F2C;    --teal-text: #5ED8CA;
    --idle: #7D84A2;    --idle-soft: #20243A;    --idle-text: #A3A9C4;
    --hero-1: #221F66;
    --hero-2: #4642D0;
    --hero-d1: #6E1616;
    --hero-d2: #B83227;
    --hero-o1: #0B4A2F;
    --hero-o2: #157A4B;
    --scrim: rgba(0, 0, 0, 0.58);
    --glass: rgba(21, 24, 41, 0.94);
    --push-bg: rgba(38, 42, 66, 0.95);
    --toast-bg: #EDEFFA;
    --toast-ink: #12152A;
    --focus: #A9A6FF;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
    --av-1: #6C68FF; --av-2: #24B3A5; --av-3: #E5734B; --av-4: #A874F0;
    --av-5: #3C9FE8; --av-6: #E0569A; --av-7: #7E9E36; --av-8: #C48A1C;
    --stage-bg: #07080F;
    --stage-glow: #161931;
    --bezel: #000000;
    --bezel-edge: #2C3048;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0C0E19;
  --surface: #151829;
  --surface-2: #1C2035;
  --surface-3: #262B44;
  --ink: #EDEFFA;
  --ink-2: #C2C7DD;
  --muted: #8F96B4;
  --line: #252A42;
  --line-2: #343A58;
  --accent: #5E5AF5;
  --accent-press: #4F4BE0;
  --accent-ink: #FFFFFF;
  --accent-soft: #24234F;
  --accent-text: #A9A6FF;
  --ok: #2FC26A;      --ok-soft: #12301F;      --ok-text: #5FD98F;
  --warn: #F0A43A;    --warn-soft: #382A12;    --warn-text: #F5B95F;
  --danger: #F2635E;  --danger-soft: #3A1A1D;  --danger-text: #FF8A85;
  --info: #42A7F0;    --info-soft: #102A40;    --info-text: #7CC2F5;
  --violet: #B07BF5;  --violet-soft: #2A1C40;  --violet-text: #C9A3FA;
  --teal: #2CC7B6;    --teal-soft: #0F2F2C;    --teal-text: #5ED8CA;
  --idle: #7D84A2;    --idle-soft: #20243A;    --idle-text: #A3A9C4;
  --hero-1: #221F66;
  --hero-2: #4642D0;
  --hero-d1: #6E1616;
  --hero-d2: #B83227;
  --hero-o1: #0B4A2F;
  --hero-o2: #157A4B;
  --scrim: rgba(0, 0, 0, 0.58);
  --glass: rgba(21, 24, 41, 0.94);
  --push-bg: rgba(38, 42, 66, 0.95);
  --toast-bg: #EDEFFA;
  --toast-ink: #12152A;
  --focus: #A9A6FF;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  --av-1: #6C68FF; --av-2: #24B3A5; --av-3: #E5734B; --av-4: #A874F0;
  --av-5: #3C9FE8; --av-6: #E0569A; --av-7: #7E9E36; --av-8: #C48A1C;
  --stage-bg: #07080F;
  --stage-glow: #161931;
  --bezel: #000000;
  --bezel-edge: #2C3048;
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; align-items: stretch; }
button:disabled { cursor: default; }
a { color: var(--accent-text); }
img, svg { display: block; }
img { max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.icon { flex: none; }

/* ---------- tony (chip, kafelek ikony, banery) ---------- */
.t-accent { --tone: var(--accent); --tone-soft: var(--accent-soft); --tone-text: var(--accent-text); }
.t-ok     { --tone: var(--ok); --tone-soft: var(--ok-soft); --tone-text: var(--ok-text); }
.t-warn   { --tone: var(--warn); --tone-soft: var(--warn-soft); --tone-text: var(--warn-text); }
.t-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); --tone-text: var(--danger-text); }
.t-info   { --tone: var(--info); --tone-soft: var(--info-soft); --tone-text: var(--info-text); }
.t-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); --tone-text: var(--violet-text); }
.t-teal   { --tone: var(--teal); --tone-soft: var(--teal-soft); --tone-text: var(--teal-text); }
.t-idle   { --tone: var(--idle); --tone-soft: var(--idle-soft); --tone-text: var(--idle-text); }

/* ---------- typografia ekranow ---------- */
.h-hello { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.h-screen { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.h-detail { font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.lead { color: var(--muted); font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 700; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px;
  font-size: 16px; font-weight: 700; letter-spacing: -0.005em;
  background: var(--surface-2); color: var(--ink);
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent-press); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-white { background: #FFFFFF; color: #2A2690; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; gap: 6px; }
.btn-md { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn .spin { animation: spin 0.9s linear infinite; }

.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; color: var(--ink); position: relative; flex: none;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--surface-2); }

.link-btn {
  display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 2px;
  font-size: 14px; font-weight: 700; color: var(--accent-text);
}

/* ---------- liczniki ---------- */
.badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #FFFFFF;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.badge-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- chipy ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 13px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--tone-soft, var(--surface-2)); color: var(--tone-text, var(--ink-2));
}
.chip .icon { width: 14px; height: 14px; }
.chip-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--idle)); }
.chip-line { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* filtry przewijane poziomo */
.filters {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 2px 16px 4px;
  scroll-padding-inline: 16px;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; height: 36px; padding: 0 14px; border-radius: 18px;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
.filter .count { font-size: 12px; opacity: .7; }

/* ---------- segmentowy przelacznik ---------- */
.seg {
  display: flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--surface-2);
}
.seg > button {
  flex: 1 1 0; min-width: 0; min-height: 38px; padding: 0 8px; border-radius: 10px;
  font-size: 14px; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .15s ease, color .15s ease;
}
.seg > button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; line-height: 20px;
  background: var(--surface-3); color: var(--ink-2);
}
.seg > button[aria-pressed="true"] .count { background: var(--accent-soft); color: var(--accent-text); }
.seg .count.is-hot { background: var(--danger); color: #FFFFFF; }
.seg-sm > button { min-height: 32px; font-size: 13px; }

/* ---------- karty i sekcje ---------- */
.card {
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
}
.card-pad { padding: 16px; }
.card-flat { box-shadow: none; }
.card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-l { display: flex; flex-direction: column; gap: 20px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.hstack { display: flex; align-items: center; gap: 10px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 32px; }
.sec-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- wiersze listy ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px;
  text-align: left; color: inherit; text-decoration: none; position: relative;
  -webkit-tap-highlight-color: transparent;
}
button.row:active, a.row:active { background: var(--surface-2); }
.rows > .row + .row::before {
  content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line);
}
.rows.rows-plain > .row + .row::before { left: 16px; }
.row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.row-trail { flex: none; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.row-amount { font-weight: 800; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.row .chev { color: var(--line-2); }
.card > .rows:first-child > .row:first-child { border-top-left-radius: var(--r-l); border-top-right-radius: var(--r-l); }
.card > .rows:last-child > .row:last-child { border-bottom-left-radius: var(--r-l); border-bottom-right-radius: var(--r-l); }

/* kafelek ikony */
.tile {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--ink-2));
}
.tile-l { width: 48px; height: 48px; border-radius: 14px; }
.tile-s { width: 32px; height: 32px; border-radius: 10px; }

/* ---------- awatary ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--av, var(--av-1)); color: #FFFFFF; font-size: 14px; font-weight: 800; letter-spacing: 0.01em;
  user-select: none;
}
.avatar-s { width: 32px; height: 32px; font-size: 12px; }
.avatar-l { width: 56px; height: 56px; font-size: 19px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.av-1 { --av: var(--av-1); } .av-2 { --av: var(--av-2); } .av-3 { --av: var(--av-3); } .av-4 { --av: var(--av-4); }
.av-5 { --av: var(--av-5); } .av-6 { --av: var(--av-6); } .av-7 { --av: var(--av-7); } .av-8 { --av: var(--av-8); }

/* ---------- formularze ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.label .opt { font-weight: 600; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 13px;
  font-size: 16px; font-weight: 600; line-height: 1.4;
  background: var(--surface-2); border: 1.5px solid transparent; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.textarea { min-height: 112px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.select { appearance: none; background-image: none; padding-right: 40px; }
.select-wrap { position: relative; }
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
.error-text { font-size: 13px; font-weight: 700; color: var(--danger-text); }
.counter { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* przelacznik on/off */
.switch {
  position: relative; flex: none; width: 50px; height: 30px; border-radius: 15px;
  background: var(--surface-3); transition: background-color .18s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; width: 100%; text-align: left; }

/* karty wyboru (radio) */
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 14px;
  border-radius: 15px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: left; transition: box-shadow .15s ease, background-color .15s ease;
}
.choice[aria-pressed="true"], .choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.choice .radio {
  width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--line-2);
  display: grid; place-items: center;
}
.choice[aria-pressed="true"] .radio, .choice[aria-checked="true"] .radio { box-shadow: inset 0 0 0 7px var(--accent); }
.checkbox {
  width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px var(--line-2); color: transparent;
}
[aria-checked="true"] > .checkbox, .checkbox.is-on { background: var(--accent); box-shadow: none; color: #FFFFFF; }

/* siatka kategorii */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat {
  display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px;
  border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 13.5px; font-weight: 700; line-height: 1.25; text-align: left;
}
.cat[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* ---------- paski postepu / mierniki ---------- */
.meter { display: block; height: 8px; border-radius: 4px; background: var(--tone-soft, var(--surface-3)); overflow: hidden; }
.meter > span { display: block; height: 100%; width: var(--p, 0%); border-radius: 4px; background: var(--tone, var(--accent)); transition: width .5s ease; }
.meter-thin { height: 6px; }
.meter-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.meter-row b { color: var(--ink); font-weight: 800; }

/* kafelki KPI */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 108px;
  border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  text-align: left; color: inherit; position: relative;
}
button.stat:active { background: var(--surface-2); }
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat-value.is-money { font-size: 22px; }
.stat-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-sub.is-bad { color: var(--danger-text); }
.stat .meter { margin-top: auto; }

/* ---------- banery ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--r-l);
  background: var(--tone-soft); color: var(--ink); text-align: left; width: 100%;
}
.banner .tile { background: var(--tone); color: #FFFFFF; }
.banner-title { display: block; font-weight: 800; font-size: 15px; color: var(--tone-text); }
.banner-text { display: block; font-size: 13.5px; color: var(--ink-2); }
.banner-solid { background: var(--danger); color: #FFFFFF; }
.banner-solid .banner-title, .banner-solid .banner-text { color: #FFFFFF; }
.banner-solid .tile { background: rgba(255, 255, 255, .2); }

/* ---------- puste stany ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px; }
.empty .tile { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 4px; }
.empty-title { font-weight: 800; font-size: 16px; }
.empty-text { color: var(--muted); font-size: 14px; max-width: 30ch; }

/* ---------- os czasu i wiadomosci ---------- */
.steps { display: flex; align-items: flex-start; gap: 0; }
.step { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; min-width: 0; }
.step::before {
  content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 3px; background: var(--surface-3); z-index: 0;
}
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: var(--accent); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface-3); color: var(--muted);
}
.step.is-done .step-dot, .step.is-current .step-dot { background: var(--accent); color: #FFFFFF; }
.step.is-current .step-dot { box-shadow: 0 0 0 5px var(--accent-soft); }
.step-label { font-size: 12.5px; font-weight: 800; line-height: 1.2; }
.step-time { font-size: 11.5px; color: var(--muted); line-height: 1.2; }

.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; gap: 3px; max-width: 86%; }
.msg-bubble {
  padding: 10px 13px; border-radius: 18px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--line);
}
.msg-meta { font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.msg.is-me { align-self: flex-end; align-items: flex-end; }
.msg.is-me .msg-bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.is-them .msg-bubble { border-bottom-left-radius: 6px; }
.event-line {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 10px;
  border-radius: 12px; background: var(--surface-2);
}
.event-line .icon { width: 14px; height: 14px; }

/* zdjecia */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); max-width: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #FFFFFF;
}
.photo-add {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--accent-text); font-size: 12.5px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--line-2);
  background: var(--surface); position: relative; overflow: hidden; cursor: pointer;
}
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* gwiazdki oceny */
.stars { display: flex; gap: 4px; }
.star-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--line-2); }
.star-btn.is-on { color: var(--warn); }
.star-btn.is-on .icon { fill: currentColor; }

/* ---------- animacje ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fresh { from { background-color: var(--accent-soft); } to { background-color: transparent; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--tone, var(--danger)); } 100% { box-shadow: 0 0 0 10px transparent; } }
.is-fresh { animation: fresh 2.4s ease-out; }

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