/* Built in UI01 from docs/design/deals-monitor-design/docs/tokens.json */

/* Local fonts (UI01): Atkinson Hyperlegible Next 400/700, latin + latin-ext. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB06;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB06;
}

:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --ink: #141A17;
  --muted: #47504B;
  --line: #C5CBC6;
  --soft: #E6E9E5;
  --primary: #0B6B4C;
  --primary-soft: #E0F0E8;
  --primary-text: #08503A;
  --urgent-bg: #FFE2C2;
  --urgent-ink: #6B3300;
  --last-bg: #8A1F23;
  --last-ink: #FFFFFF;
  --paper-bg: #FFF4D6;
  --paper-line: #E3C977;
  --link: #0B57A4;
  --chart-server: #2a78d6;
  --chart-search: #eb6834;
  --chart-assistant: #1baf7a;
  --chart-service: #9AA19C;

  --font-app: "Atkinson Hyperlegible Next", sans-serif;
  --font-mail: system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;

  --radius-button: 12px;
  --radius-card: 14px;
  --radius-badge: 6px;

  --button-min-height: 56px;
  --touch-min: 48px;
  --phone-gutter: 20px;
  --desktop-max: 1120px;

  --focus-outline: 3px solid #0B57A4;
  --focus-offset: 2px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-app);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 400;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Typography roles (tokens.json "type"; rem so Android text zoom scales them). */
.t-screen-title { font-size: 1.875rem; line-height: 2.375rem; font-weight: 700; margin: 0; }
.t-order-title { font-size: 1.625rem; line-height: 2.125rem; font-weight: 700; margin: 0; }
.t-deadline { font-size: 1.5rem; line-height: 2rem; font-weight: 700; margin: 0; }
.t-card-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; margin: 0; }
.t-button { font-size: 1.1875rem; line-height: 1.625rem; font-weight: 700; }
.t-body { font-size: 1.125rem; line-height: 1.75rem; font-weight: 400; margin: 0; }
.t-meta { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 400; margin: 0; }
.t-small { font-size: 1rem; line-height: 1.5rem; font-weight: 400; margin: 0; }

.text-muted { color: var(--muted); }

/* Buttons and text links (UI02): min-height 56px, full width, focus outline from the base rule. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--button-min-height);
  padding: 12px 24px;
  box-sizing: border-box;
  width: 100%;
  border: 2px solid;
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 1.1875rem;
  line-height: 1.625rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--surface); border-color: var(--primary); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-on-dark { background: var(--surface); color: var(--ink); border-color: var(--surface); }
.btn-outline-on-dark { background: transparent; color: var(--surface); border-color: var(--surface); }
.icon { flex-shrink: 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-min);
  color: var(--link);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* /_ui gallery (UI01). */
.ui {
  max-width: var(--desktop-max);
  margin: 0 auto;
  padding: var(--space-24) var(--phone-gutter) var(--space-48);
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
.ui-section { display: flex; flex-direction: column; gap: var(--space-16); }

.ui-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-20);
}
.swatch { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.swatch-chip {
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.swatch-name { font-weight: 700; font-size: 1rem; line-height: 1.5rem; }
.swatch-desc { color: var(--muted); font-size: 1rem; line-height: 1.5rem; overflow-wrap: anywhere; }

.chip-bg { background: var(--bg); }
.chip-surface { background: var(--surface); }
.chip-ink { background: var(--ink); }
.chip-muted { background: var(--muted); }
.chip-line { background: var(--line); }
.chip-soft { background: var(--soft); }
.chip-primary { background: var(--primary); }
.chip-primary-soft { background: var(--primary-soft); }
.chip-primary-text { background: var(--primary-text); }
.chip-urgent-bg { background: var(--urgent-bg); }
.chip-urgent-ink { background: var(--urgent-ink); }
.chip-last-bg { background: var(--last-bg); }
.chip-last-ink { background: var(--last-ink); }
.chip-paper-bg { background: var(--paper-bg); }
.chip-paper-line { background: var(--paper-line); }
.chip-link { background: var(--link); }

.ui-type { display: flex; flex-direction: column; gap: var(--space-24); }
.type-row { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.type-row > .t-small { color: var(--muted); }
.type-row > p, .type-row > h1, .type-row > h2, .type-row > h3, .type-row > div { margin: 0; overflow-wrap: anywhere; }

/* /_ui button gallery (UI02). */
.ui-buttons { display: flex; flex-direction: column; gap: var(--space-12); }
.ui-dark {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-20);
  background: var(--ink);
  border-radius: var(--radius-card);
}
.ui-links { display: flex; flex-direction: column; gap: var(--space-8); }

/* Deadline line and block (UI03). Urgency is a text badge, colour only reinforces it. */
.dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 1.0625rem;
  line-height: 1.5rem;
}
.dl-when { font-weight: 700; }
.dl-rel { font-weight: 400; color: var(--muted); }
.dl-none { color: var(--muted); gap: 8px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-badge);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-urgent { background: var(--urgent-bg); color: var(--urgent-ink); }
.badge-last { background: var(--last-bg); color: var(--last-ink); }
.block-badge { background: var(--surface); }
.block-urgent { color: var(--urgent-ink); }
.block-last { color: var(--last-bg); }

.dl-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: 16px 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
}
.dl-block-urgent { background: var(--urgent-bg); color: var(--urgent-ink); border-color: var(--urgent-bg); }
.dl-block-last { background: var(--last-bg); color: var(--last-ink); border-color: var(--last-bg); }
.dl-block-label { font-size: 1rem; line-height: 1.5rem; }
.dl-block-when { font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
.dl-block-sub { font-size: 1.125rem; line-height: 1.75rem; }
.dl-block-urgent .dl-block-sub,
.dl-block-last .dl-block-sub { font-weight: 700; }

/* Notice card (UI04). The whole card is one link to /zlecenie/<id>. */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-20);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--ink);
  text-decoration: none;
}
.card-interested {
  padding: calc(var(--space-20) - 1px);
  border: 2px solid var(--primary);
}
.card-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 1.0625rem; line-height: 1.5rem; color: var(--muted); }
.card-reminder {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 1.0625rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: var(--primary-text);
}

/* /_ui card gallery (UI04). */
.ui-cards { display: flex; flex-direction: column; gap: var(--space-12); }

/* List page (UI05). */
.list { display: flex; flex-direction: column; }
.list-header { padding: var(--space-24) var(--phone-gutter) var(--space-8); }
.list-header-inner { display: flex; flex-direction: column; gap: 2px; }
.list-date { font-size: 1.125rem; line-height: 1.625rem; color: var(--muted); }
.list-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-8) var(--phone-gutter) var(--space-40);
}
.list-section { display: flex; flex-direction: column; gap: var(--space-12); }
.list-section-title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: var(--muted);
}
.list-cards { display: flex; flex-direction: column; gap: var(--space-12); }
.list-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-top: var(--space-8);
}
.list-footer-note {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--muted);
}
.list-footer-link { display: flex; justify-content: center; padding-top: var(--space-16); }
/* UI20 base: on the phone the sections stack and the aside is hidden; the footer carries actions. */
.list-main { display: flex; flex-direction: column; gap: var(--space-24); min-width: 0; }
.list-aside { display: none; }

/* Notice page (UI08/UI10). */
.notice-topbar { padding: 4px 12px 0; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--touch-min);
  color: var(--link);
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  text-decoration: none;
}
.notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
  padding: 4px var(--phone-gutter) var(--space-40);
}
/* UI21 base: the aside/main containers collapse (display:contents) on the phone and the order
   values restore the interleaved mobile sequence; the grid is a plain column with a 20px gap. */
.notice-grid { display: flex; flex-direction: column; gap: var(--space-20); }
.notice-aside,
.notice-main { display: contents; }
.nb-deadline { order: 1; }
.nb-head { order: 2; }
.nb-submission { order: 3; }
.nb-work { order: 4; }
.nb-why { order: 5; }
.nb-decision { order: 6; }
.nb-ask { order: 7; }
.nb-docs { order: 8; }
.nb-contact { order: 9; }
.nb-fulltitle { order: 10; }
.notice-head { display: flex; flex-direction: column; gap: var(--space-4); }
.notice-meta { font-size: 1.125rem; line-height: 1.625rem; color: var(--muted); }
.notice-section { display: flex; flex-direction: column; gap: var(--space-8); }
.notice-section-12 { gap: var(--space-12); }
.notice-h2 { margin: 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.why-box {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 1.0625rem;
  line-height: 1.625rem;
  overflow-wrap: anywhere;
}
.docs { display: flex; flex-direction: column; }
.doc-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: var(--button-min-height);
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--link);
  text-decoration: none;
}
.doc-name {
  flex-grow: 1;
  font-size: 1.125rem;
  line-height: 1.625rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.doc-type { font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.notice-published { margin: 0; font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.notice-404 { gap: var(--space-16); padding: var(--space-24) var(--phone-gutter) var(--space-40); }

/* Error screens (UI18): full page with a 48px icon, layout from the blad-link* mockups. */
.error-screen { display: flex; flex-direction: column; gap: var(--space-20); padding: 96px var(--phone-gutter) var(--space-40); }
.error-icon { color: var(--muted); }

/* "Jak złożyć ofertę" block (UI09). Paper sits on the paper background; platform/unknown on the surface. */
.submit-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-20);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.submit-paper { background: var(--paper-bg); border-color: var(--paper-line); }
.submit-head { display: flex; align-items: center; gap: 10px; }
.submit-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.submit-text { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }
.submit-address { margin: 0; font-size: 1.1875rem; line-height: 1.75rem; font-weight: 700; }
.submit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }

/* Decyzja (UI11): "Interesuje mnie / Nie dla mnie" and the "Interesuje Cię" confirmation. */
.react-buttons { display: flex; flex-direction: column; gap: var(--space-12); }
.react-form { margin: 0; }
.react-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-20);
  border: 2px solid var(--primary);
  border-radius: var(--radius-card);
  background: var(--primary-soft);
}
.react-head { display: flex; align-items: center; gap: 10px; color: var(--primary-text); }
.react-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.react-text { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }
.react-actions { padding-top: var(--space-4); }

/* List: "Ukryte" bar (UI12). Stays until the next navigation. */
.hidden-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-card);
}
.hidden-bar-text { margin: 0; font-size: 1.125rem; line-height: 1.625rem; }
.hidden-bar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }

/* List: nothing new (UI06). */
.list-empty {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24) var(--space-20);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.list-empty-title { margin: 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.list-empty-text { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }

/* List: loading (UI07). The skeleton is hidden until list.js reveals it after 300 ms. */
.list-loading { margin: 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 700; }
.list-loading[hidden] { display: none; }
.list-skeletons { display: flex; flex-direction: column; gap: var(--space-12); }
.list-skeletons[hidden] { display: none; }
.list-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-20);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.skeleton-bar { border-radius: 6px; background: var(--soft); }
.skeleton-bar-1 { width: 55%; height: 20px; }
.skeleton-bar-2 { width: 92%; height: 24px; }
.skeleton-bar-3 { width: 70%; height: 24px; }
.skeleton-bar-4 { width: 45%; height: 20px; }

/* Offline block (UI19): hidden in the shell; list.js unhides it when /api/list fails. */
.list-error { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-32) 0 0; }
.list-error[hidden] { display: none; }
.list-error-icon { color: var(--muted); }

/* "Tak to działa" card (UI14): shown on the first 3 visits; "Rozumiem" hides it permanently. */
.how-it-works {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-20);
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius-card);
}
.how-it-works-title { margin: 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.how-it-works-list {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.how-it-works-note { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }
.how-it-works-form { margin: 0; }

/* "Napisz do Mateusza" (UI15): the write screen. */
.napisz-topbar { padding: 4px 12px 0; }
.napisz { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-4) var(--phone-gutter) var(--space-40); }
.napisz-context { display: flex; flex-direction: column; gap: 2px; padding: var(--space-16) var(--space-20); border-radius: var(--radius-button); background: var(--soft); }
.napisz-context-label { font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.napisz-context-title { font-size: 1.125rem; line-height: 1.625rem; }
.napisz-mic { min-height: 80px; }
.napisz-mic--recording { background: var(--last-bg); color: var(--last-ink); border-color: var(--last-bg); }
.napisz-mic--processing { cursor: progress; }
.napisz-mic--processing:disabled { opacity: 1; }
.napisz-mic--processing svg { display: none; }
.napisz-mic--processing::before {
  content: ""; width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--primary);
  animation: napisz-spin 0.8s linear infinite;
}
@keyframes napisz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .napisz-mic--processing::before { animation: none; } }
.napisz-form--locked .napisz-textarea { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.napisz-form--locked button[type="submit"] { opacity: 0.5; cursor: not-allowed; }
.napisz-form { display: flex; flex-direction: column; gap: var(--space-20); margin: 0; }
.napisz-field { display: flex; flex-direction: column; gap: var(--space-8); }
.napisz-label { font-size: 1.125rem; line-height: 1.625rem; font-weight: 700; }
.napisz-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 128px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}
.napisz-error { margin: 0; font-size: 1.125rem; line-height: 1.75rem; font-weight: 700; color: var(--last-bg); }
.napisz-note { margin: 0; font-size: 1rem; line-height: 1.5rem; color: var(--muted); }

/* "Napisz do Mateusza" (UI17): the automatic reply screen. */
.napisz-reply-screen { padding-top: var(--space-32); }
.napisz-your {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-20);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.napisz-your-meta { font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.napisz-your-text { font-size: 1.125rem; line-height: 1.75rem; }
.napisz-reply {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-20);
  border-radius: var(--radius-card);
  background: var(--primary-soft);
  border: 2px solid var(--primary);
}
.napisz-reply-head { display: flex; align-items: center; gap: 10px; color: var(--primary-text); }
.napisz-reply-title { font-size: 1.25rem; line-height: 2rem; font-weight: 700; }
.napisz-reply-text { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }
.napisz-reply-note { font-size: 1rem; line-height: 1.5rem; color: var(--muted); }

/* Costs page (UI27–UI29): "Ile to kosztuje" on the phone. Reuses .notice-topbar/.back-link. */
.koszty {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: 4px var(--phone-gutter) var(--space-40);
}
.koszty-title { margin: 0; font-size: 1.75rem; line-height: 2.25rem; font-weight: 700; }
.koszty-desc { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; color: var(--muted); }
.koszty-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--space-20);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.koszty-card--headline { gap: var(--space-12); }
.koszty-per { gap: var(--space-4); }
/* UI30: the KPI row, the daily AI chart and the full operation table are desktop-only. */
.koszty-kpis,
.koszty-sec-daily,
.koszty-sec-fulltable { display: none; }
.koszty-month { font-size: 1.0625rem; line-height: 1.5rem; color: var(--muted); }
.koszty-amount { font-size: 2.75rem; line-height: 3.25rem; font-weight: 700; }
.koszty-compare-note { font-size: 1.125rem; line-height: 1.75rem; }
.koszty-savings {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-button);
  background: var(--primary-soft);
  color: var(--primary-text);
}
.koszty-savings span { font-size: 1.1875rem; line-height: 1.625rem; font-weight: 700; }

/* Comparison bars: one scale, width inline per data. */
.koszty-bars { display: flex; flex-direction: column; gap: 14px; }
.koszty-bar-row { display: flex; flex-direction: column; gap: 6px; }
.koszty-bar-head { display: flex; justify-content: space-between; font-size: 1.0625rem; line-height: 1.5rem; }
.koszty-track { height: 20px; background: var(--soft); border-radius: 4px; }
.koszty-fill { height: 20px; border-radius: 4px; }
.koszty-fill--ours { background: var(--chart-server); }
.koszty-fill--service { background: var(--chart-service); }

/* Cost split: 100% bar with three segments, then the legend rows. */
.koszty-split { display: flex; gap: 2px; }
.koszty-seg { min-width: 4px; height: 24px; border-radius: 4px; }
.koszty-seg--server { background: var(--chart-server); }
.koszty-seg--search { background: var(--chart-search); }
.koszty-seg--assistant { background: var(--chart-assistant); }
.koszty-split-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  padding: var(--space-12) 0;
  border-top: 1px solid var(--line);
}
.koszty-chip-wrap { padding-top: 6px; }
.koszty-chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.koszty-chip--sm { width: 12px; height: 12px; }
.koszty-chip--server { background: var(--chart-server); }
.koszty-chip--search { background: var(--chart-search); }
.koszty-chip--assistant { background: var(--chart-assistant); }
.koszty-split-name { display: flex; flex-direction: column; }
.koszty-small { font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.koszty-split-val { text-align: right; }

/* Month-by-month chart: legend on top, stacked 24px bars, total above the bar. */
.koszty-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.9375rem; line-height: 1.25rem; color: var(--muted); }
.koszty-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.koszty-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--space-8);
  height: 224px;
  border-bottom: 1px solid var(--line);
  padding: 0 4px;
}
.koszty-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.koszty-col-value { font-size: 0.9375rem; line-height: 1.25rem; font-weight: 700; }
.koszty-bar { width: 24px; display: flex; flex-direction: column; gap: 2px; }
.koszty-bar--current { opacity: 0.45; }
.koszty-layer { border-radius: 0; }
.koszty-layer--top { border-radius: 4px 4px 0 0; }
.koszty-layer--server { background: var(--chart-server); }
.koszty-layer--search { background: var(--chart-search); }
.koszty-layer--assistant { background: var(--chart-assistant); }
.koszty-col-label { font-size: 1rem; line-height: 1.375rem; color: var(--muted); }
.koszty-footnote { margin: 0; font-size: 1rem; line-height: 1.5rem; color: var(--muted); }

/* "Jedno trafne zlecenie" card. */
.koszty-per-amount { font-size: 2.25rem; line-height: 2.75rem; font-weight: 700; }
.koszty-per-note { font-size: 1.0625rem; line-height: 1.5rem; }

/* "Szczegóły dla ciekawych": native details/summary, collapsed by default. */
.koszty-details {
  padding: 4px var(--space-20) var(--space-16);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.koszty-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  cursor: pointer;
  font-size: 1.1875rem;
  line-height: 1.625rem;
  font-weight: 700;
  list-style: none;
}
.koszty-summary::-webkit-details-marker { display: none; }
.koszty-summary-toggle { color: var(--link); font-size: 1.0625rem; font-weight: 400; }
.koszty-toggle-open { display: none; }
.koszty-details[open] .koszty-toggle-open { display: inline; }
.koszty-details[open] .koszty-toggle-closed { display: none; }
.koszty-details-body { display: flex; flex-direction: column; gap: var(--space-12); padding-top: var(--space-8); }
.koszty-details-note { margin: 0; font-size: 1rem; line-height: 1.5rem; color: var(--muted); }
.koszty-table-wrap { overflow-x: auto; }
.koszty-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.koszty-table th {
  text-align: left;
  padding: 10px var(--space-8);
  font-size: 0.9375rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.koszty-th-num { text-align: right; white-space: nowrap; }
.koszty-table td {
  padding: 10px var(--space-8);
  font-size: 1rem;
  line-height: 1.375rem;
  vertical-align: top;
  border-bottom: 1px solid var(--soft);
}
.koszty-td-num { text-align: right; white-space: nowrap; }
.koszty-op { display: inline-flex; align-items: center; gap: var(--space-8); }
.koszty-dot { width: 10px; height: 10px; border-radius: 4px; flex-shrink: 0; }
.koszty-dot--search { background: var(--chart-search); }
.koszty-dot--assistant { background: var(--chart-assistant); }
.koszty-row-total td { font-weight: 700; }

/* UI20 + UI21: desktop layout at >= 900px. Below that the list and notice pages are identical
   to the phone. The header/topbar become a full-width white bar with centred content. */
@media (min-width: 900px) {
  /* List (UI20): sections in the left column, "Coś nie pasuje?" panel in a 320px right column. */
  .list-header { padding: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
  .list-header-inner {
    max-width: var(--desktop-max);
    margin: 0 auto;
    padding: 20px 40px;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-24);
  }
  .list-body { max-width: var(--desktop-max); margin: 0 auto; padding: var(--space-32) 40px var(--space-48); }
  .list-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
  .list-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding: var(--space-24);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
  }
  .list-aside-title { margin: 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
  .list-aside-text { margin: 0; font-size: 1.125rem; line-height: 1.75rem; }
  .list-aside-link { padding-top: var(--space-8); }
  .list-footer { display: none; }

  /* Notice (UI21): content in the left column, decision blocks in a sticky 400px right column. */
  .notice-topbar { padding: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
  .notice-topbar-inner { max-width: var(--desktop-max); margin: 0 auto; padding: 12px 40px 0; }
  .notice { max-width: var(--desktop-max); margin: 0 auto; padding: var(--space-32) 40px var(--space-48); }
  .notice-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; }
  .notice-main { display: flex; flex-direction: column; gap: var(--space-24); grid-column: 1; grid-row: 1; }
  .notice-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--space-16);
  }

  /* Costs (UI30): four KPI cards, two chart columns (chart+comparison / split+daily) and the
     full operation table. Phone-only blocks (headline, per-relevant, details) are hidden. */
  .koszty {
    display: grid;
    max-width: var(--desktop-max);
    margin: 0 auto;
    padding: var(--space-32) 40px var(--space-48);
    gap: var(--space-24);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "desc  desc"
      "kpis  kpis"
      "chart split"
      "comp  daily"
      "table table";
    align-items: start;
  }
  .koszty-title { grid-area: title; font-size: 1.875rem; line-height: 2.375rem; }
  .koszty-desc { grid-area: desc; }
  .koszty-kpis {
    grid-area: kpis;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-16);
  }
  .koszty-kpi {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-20);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
  }
  .koszty-kpi-label { font-size: 1rem; line-height: 1.375rem; color: var(--muted); }
  .koszty-kpi-value { font-size: 2rem; line-height: 2.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
  .koszty-kpi-sub { font-size: 1rem; line-height: 1.375rem; color: var(--muted); }

  .koszty-sec-chart { grid-area: chart; }
  .koszty-sec-comparison { grid-area: comp; }
  .koszty-sec-split { grid-area: split; }
  .koszty-sec-daily { grid-area: daily; display: flex; }
  .koszty-sec-fulltable { grid-area: table; display: flex; gap: var(--space-12); }
  .koszty-card--headline,
  .koszty-per,
  .koszty-details { display: none; }

  /* Daily AI chart: single search-colour bars, day labels N.MM, peak value above the tallest bar. */
  .koszty-daily-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 196px;
    border-bottom: 1px solid var(--line);
  }
  .koszty-daily-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  .koszty-daily-value { font-size: 0.875rem; line-height: 1.25rem; font-weight: 700; height: 1.25rem; font-variant-numeric: tabular-nums; }
  .koszty-daily-bar { width: 24px; background: var(--chart-search); border-radius: 4px 4px 0 0; }
  .koszty-daily-label { font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); }
}
