/* Emplo Reputation panel. The look of Atomic CRM (marmelab, MIT; shadcn/ui's neutral theme): Inter, white and
   neutral greys, a tab bar on top, outlined buttons, lists of rows with initials, cards with a 10 px radius.
   Colour only means a state, as a small dot. Light by default, dark when the system asks for it. DESIGN.md. */

:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(1 0 0);
  --raised: oklch(0.97 0 0);
  --line: oklch(0.922 0 0);
  --line-strong: oklch(0.85 0 0);
  --ink: oklch(0.145 0 0);
  --muted: oklch(0.44 0 0);
  --faint: oklch(0.556 0 0);
  --bar: oklch(0.97 0 0);
  --ok: oklch(0.50 0.13 150);   --ok-fill: oklch(0.72 0.17 150);  --ok-tint: oklch(0.97 0.02 150);
  --warn: oklch(0.54 0.12 65);  --warn-fill: oklch(0.80 0.16 80); --warn-tint: oklch(0.98 0.025 85);
  --bad: oklch(0.54 0.20 27);   --bad-fill: oklch(0.64 0.21 25);  --bad-tint: oklch(0.97 0.015 25);
  --accent: oklch(0.50 0.17 255); --accent-fill: oklch(0.62 0.17 250); --accent-tint: oklch(0.97 0.015 250);
  --on-fill: oklch(0.985 0 0);
  --idle: oklch(0.922 0 0);
  --radius: 10px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: oklch(0.145 0 0);
    --surface: oklch(0.205 0 0);
    --raised: oklch(0.269 0 0);
    --line: oklch(0.29 0 0);
    --line-strong: oklch(0.38 0 0);
    --ink: oklch(0.985 0 0);
    --muted: oklch(0.82 0 0);
    --faint: oklch(0.708 0 0);
    --bar: oklch(0.205 0 0);
    --ok: oklch(0.80 0.13 150);   --ok-tint: oklch(0.26 0.04 150);
    --warn: oklch(0.84 0.12 80);  --warn-tint: oklch(0.27 0.04 80);
    --bad: oklch(0.75 0.15 25);   --bad-tint: oklch(0.26 0.05 25);
    --accent: oklch(0.76 0.12 250); --accent-tint: oklch(0.26 0.05 255);
    --idle: oklch(0.29 0 0);
  }
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 0.875rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }  /* pages not yet on .page (letters) */
/* Icons: Heroicons (MIT), inline sprite in _icons.html */
.icon { width: 16px; height: 16px; flex: none; fill: currentColor; vertical-align: -3px; }
.hint { color: var(--faint); font-size: 0.8125rem; }
.count { color: var(--faint); font-weight: 400; margin-left: 6px; }
.empty { color: var(--faint); padding: 16px; }

/* App bar: brand on the left, the pages as tabs in the middle, the system's state and logging out on the right */
.appbar { position: sticky; top: 0; z-index: 20; isolation: isolate; background: var(--bar); border-bottom: 1px solid var(--line); }
html { scroll-padding-top: 64px; }  /* an anchor (#o-...) lands below the sticky bar */
.appbar-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 48px;
  max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em;
  text-decoration: none; }
.tabs { display: flex; align-self: stretch; }
.tabs a { display: flex; align-items: center; padding: 0 20px; color: var(--muted); font-weight: 500; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color 150ms var(--ease); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-color: var(--ink); }
.account { justify-self: end; display: flex; align-items: center; gap: 8px; }
.account form { margin: 0; }
.state-pill { text-decoration: none; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--muted);
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  transition: color 150ms var(--ease), background-color 150ms var(--ease), scale 120ms var(--ease); }
.icon-button:hover { color: var(--ink); background: var(--raised); }
@media (max-width: 900px) {  /* tabs get their own row and scroll sideways; the state keeps its dot, the word goes to readers */
  .appbar-in { grid-template-columns: 1fr auto; row-gap: 0; padding: 0; }
  html { scroll-padding-top: 108px; }
  .logo { padding: 10px 16px; }
  .account { padding-right: 12px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; min-height: 44px; }
  .tabs a { padding: 0 14px; }
  .state-pill #headline-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Page: a title row with the actions on the right; list pages put their filters in a column on the left */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 24px 64px; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  margin-bottom: 20px; min-height: 36px; }
.page-top h1 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; }
.page-top h1 .count { font-size: 1.125rem; }
.page-top .lede { color: var(--faint); margin-top: 2px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.with-side { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) {
  .page { padding: 16px 16px 48px; }
  .with-side { grid-template-columns: 1fr; gap: 16px; }
  .page-top h1 { font-size: 1.25rem; }
}

/* Filters column: a search box and groups of options, each group under a heading with an icon */
.facets { display: grid; gap: 22px; position: sticky; top: 64px; }
.facets .search input { width: 100%; }
.facet h3 { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.facet h3 .icon { width: 18px; height: 18px; }
.facet ul { list-style: none; margin: 0; padding: 0 0 0 26px; display: grid; gap: 2px; }
.facet a, .facet label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px;
  margin-left: -8px; border-radius: 6px; color: var(--ink); text-decoration: none; cursor: pointer; }
.facet a:hover, .facet label:hover { background: var(--raised); }
.facet a[aria-current], .facet label:has(input:checked) { background: var(--raised); font-weight: 600; }
.facet .n { color: var(--faint); font-weight: 400; }
.facet input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.facet input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.facet label:has(input[type="checkbox"]) { justify-content: flex-start; }
@media (max-width: 900px) {
  .facets { position: static; grid-template-columns: 1fr; gap: 12px; }
  .facet ul { display: flex; flex-wrap: wrap; padding: 0; gap: 4px; }
  .facet a, .facet label { margin: 0; border: 1px solid var(--line); }
}

/* Buttons and fields: 36 px; .button is the page's one filled main action, .button.quiet the outlined rest */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px;
  font: 500 0.875rem var(--font); color: var(--bg); background: var(--ink); border: 1px solid var(--ink);
  border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), scale 120ms var(--ease); }
.button:hover { background: color-mix(in oklch, var(--ink) 85%, var(--bg)); }
.button:active, .icon-button:active { scale: 0.96; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button.quiet { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button.quiet:hover { background: var(--raised); }
.button.danger { color: var(--on-fill); background: var(--bad-fill); border-color: var(--bad-fill); }
.button.small { height: 30px; padding: 0 10px; font-size: 0.8125rem; }
.button.small .icon { width: 14px; height: 14px; }
input, select, textarea { font: 400 0.875rem var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; min-width: 0; transition: border-color 150ms var(--ease); }
input, select { height: 36px; padding: 0 12px; }
textarea { padding: 10px 12px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--faint); outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--faint) 25%, transparent); }
.search { position: relative; display: inline-flex; align-items: center; }
.search .icon { position: absolute; right: 11px; color: var(--faint); pointer-events: none; }
.search input { padding-right: 34px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.check input[type="checkbox"], .check input[type="radio"] { height: auto; padding: 0; margin: 0; flex: none; }
.note-form .check { align-items: flex-start; gap: 8px; }
.note-form .check input { margin-top: 2px; }
input[type="file"] { height: auto; padding: 6px; }
input[type="file"]::file-selector-button { margin-right: 10px; }

/* Menu: a <details> whose list opens under its button */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.button .chevron { color: var(--faint); }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 240px; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px -8px color-mix(in oklch, var(--ink) 18%, transparent); }
.menu-list a { display: flex; justify-content: space-between; gap: 16px; padding: 6px 10px; border-radius: 6px;
  text-decoration: none; white-space: nowrap; }
.menu-list a:hover { background: var(--raised); }
.menu-list .meta { color: var(--faint); font-size: 0.8125rem; }

/* The bell (letters/notifications.py): a count on the icon, the last week's items in a panel under it */
.bell > summary { position: relative; }
.badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  font-size: 0.6875rem; font-weight: 600; line-height: 16px; text-align: center; color: var(--on-fill); background: var(--accent-fill); }
.bell-list { width: min(400px, calc(100vw - 24px)); padding: 0; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.bell-list ul { list-style: none; margin: 0; padding: 4px; max-height: min(70vh, 520px); overflow-y: auto; }
.bell-list li a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start;
  white-space: normal; transition: background-color 150ms var(--ease); }
.bell-list li a > .icon { margin-top: 2px; color: var(--faint); }
.bell-list b { display: block; font-weight: 500; }
.bell-list b + span { display: block; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.bell-list time { color: var(--faint); font-size: 0.75rem; white-space: nowrap; }
.bell-list li.new a { box-shadow: inset 2px 0 0 var(--accent-fill); }
.bell-empty { padding: 14px; color: var(--faint); }
@media (max-width: 640px) { .bell-list { position: fixed; top: 52px; left: 12px; right: 12px; width: auto; } }
.link-button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.link-button:hover { color: var(--ink); text-decoration: underline; }

/* Cards and section titles: a title with an icon sits above its card, not inside a grey header */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 0.9375rem; font-weight: 600; }
.panel-body { padding: 16px; }
.block-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; font-weight: 600; }
.block-title .icon { width: 18px; height: 18px; color: var(--muted); }
.block-title h2 { font: inherit; display: flex; align-items: center; gap: 8px; }
div.block-title { flex-wrap: wrap; }
.block-title .level-info[open] { flex-basis: 100%; order: 9; }
.block-title .hint, .block-title .more { margin-left: auto; font-weight: 400; }
.block-title .more { font-size: 0.8125rem; color: var(--muted); }
.block { margin-bottom: 28px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Badges: a Heroicons icon in the state's colour and a word, on an outline; a plain label has no icon. No dots: they
   read as generated (Staś, 28.10.2026). Never a coloured slab. */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 0.75rem; font-weight: 500; color: var(--ink); background: var(--surface);
  white-space: nowrap; --tone: var(--ok-fill); }
.pill .icon { width: 14px; height: 14px; color: var(--tone); }
[data-state="warn"] > .pill, .pill[data-state="warn"], .appbar[data-state="warn"] .state-pill { --tone: var(--warn-fill); }
[data-state="bad"] > .pill, .pill[data-state="bad"], .appbar[data-state="bad"] .state-pill { --tone: var(--bad-fill); }
.pill[data-state="ours"] { --tone: var(--accent-fill); }  /* waits on us: work, not an alarm */
.pill.neutral { --tone: var(--faint); color: var(--muted); }
.icon[data-state="ours"] { color: var(--accent-fill); }
.icon[data-state="bad"] { color: var(--bad-fill); }
.icon[data-state="warn"] { color: var(--warn-fill); }
.icon[data-state="warn"] { color: var(--warn-fill); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 0.75rem;
  font-weight: 500; color: var(--muted); background: var(--raised); white-space: nowrap; }
.tag[data-state="warn"] { color: var(--warn); background: var(--warn-tint); }
.tag[data-state="bad"] { color: var(--bad); background: var(--bad-tint); }
.tag[data-state="ok"] { color: var(--ok); background: var(--ok-tint); }
.tag.strong { color: var(--ink); }

/* Initials in a pastel circle (Atomic CRM's avatars); the tone only tells rows apart */
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%;
  font-size: 0.875rem; font-weight: 500; --h: 250; color: oklch(0.42 0.09 var(--h)); background: oklch(0.92 0.045 var(--h)); }
.avatar.large { width: 48px; height: 48px; font-size: 1rem; }
.avatar[data-tone="2"] { --h: 165; } .avatar[data-tone="3"] { --h: 300; } .avatar[data-tone="4"] { --h: 25; }
.avatar[data-tone="5"] { --h: 75; } .avatar[data-tone="6"] { --h: 205; }
.avatar .icon { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .avatar { color: oklch(0.88 0.06 var(--h)); background: oklch(0.36 0.06 var(--h)); } }
.level { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--raised); }
.level[data-level="1"], .level[data-level="1.5"] { color: var(--bg); background: var(--ink); }
h2 .level { margin-right: 2px; }

/* Rows: Atomic CRM's list. Initials, a bold name with one or two quiet lines under it, what to do on the right */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: color-mix(in oklch, var(--raised) 60%, var(--surface)); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-size: 0.9375rem; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-title a { text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.row-sub { color: var(--faint); }
.row-sub > span + span::before, .row-why > span + span::before { content: " · "; }
.row-why { color: var(--faint); font-size: 0.8125rem; max-width: 110ch; }
.row-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none;
  color: var(--faint); font-size: 0.8125rem; }
.row-side form { margin: 0; }
.people { display: grid; gap: 2px; margin-top: 4px; }
.people > div > span + span::before { content: " · "; color: var(--faint); }
@media (max-width: 700px) {
  .row { flex-wrap: wrap; align-items: flex-start; }
  .row-main { flex-basis: calc(100% - 56px); }
  .row-side { flex-basis: 100%; justify-content: flex-start; padding-left: 54px; }
}

/* Tables, where columns really help (the case page) */
.table-scroll { overflow-x: auto; }
.leads { width: 100%; border-collapse: collapse; }
.leads th { text-align: left; font-weight: 500; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; }
.leads td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.leads tbody tr:last-child td { border-bottom: 0; }
.leads tbody tr:hover { background: color-mix(in oklch, var(--raised) 60%, var(--surface)); }
.leads td small { display: block; color: var(--faint); font-size: 0.8125rem; }
.leads td small.note { color: var(--warn); }
.leads form { margin: 0; }
.level-info summary { width: fit-content; color: var(--faint); font-size: 0.8125rem; font-weight: 400; cursor: pointer; }
.level-info p { padding: 6px 0 4px; color: var(--muted); font-weight: 400; font-size: 0.875rem; max-width: 100ch; }
.level-more { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.level-desc { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); max-width: 100ch; }

/* Notices */
.offline, .message { margin-bottom: 16px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; gap: 8px; }
.offline .icon { color: var(--warn-fill); }
.message[data-kind="success"] { color: var(--ok); background: var(--ok-tint); border-color: transparent; }
.message[data-kind="error"] { color: var(--bad); background: var(--bad-tint); border-color: transparent; }
.wrap > .message:first-child { margin-top: 16px; }
.blocked { display: flex; gap: 16px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 24px; border-radius: var(--radius); background: var(--bad-tint);
  border: 1px solid color-mix(in oklch, var(--bad-fill) 30%, transparent); }
.blocked h2 { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--bad); margin-bottom: 4px; }
.blocked p { max-width: 75ch; color: var(--muted); }
.blocked strong { color: var(--ink); font-weight: 500; }

/* Dashboard: three columns like Atomic CRM's (today's numbers and the order form, the chart and the feed, services) */
.dash { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr) 300px; } .dash > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .dash { grid-template-columns: 1fr; } }
.kv { margin: 0; display: grid; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); }
.kv dt small { display: block; font-size: 0.75rem; color: var(--faint); }
.kv dd { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; text-align: right; }
.kv dd small { margin-left: 4px; font-size: 0.8125rem; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.order { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.order p { color: var(--muted); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 16px 16px 30px; position: relative; }
.col { flex: 1; height: 100%; position: relative; }
.bar { position: absolute; inset: 0; background: var(--ink); opacity: 0.85; border-radius: 3px 3px 0 0; transform-origin: bottom;
  transform: scaleY(0.015); transition: transform 250ms var(--ease); }
.col:hover .bar { opacity: 1; }
.col em { position: absolute; bottom: -22px; left: 0; font-style: normal; font-size: 0.75rem; color: var(--faint); }
/* Feed: Atomic CRM's "Latest activity" */
.events { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow: auto; }
.events li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline;
  padding: 12px 16px; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.events li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); align-self: center; }
.events li[data-level="warning"]::before { background: var(--warn-fill); }
.events li[data-level="error"]::before { background: var(--bad-fill); }
.events .msg { grid-column: 2; grid-row: 1; }
.events .proc { grid-column: 2; grid-row: 2; color: var(--faint); font-size: 0.8125rem; }
.events time { grid-column: 3; grid-row: 1; color: var(--faint); font-size: 0.8125rem; }
.events li[data-level="warning"] .msg { color: var(--warn); }
.events li[data-level="error"] .msg { color: var(--bad); }
.events li.empty { display: block; }
.events li.empty::before { display: none; }

/* Services: name, state, last activity and a 24 h bar (System and the public page) */
.services { list-style: none; margin: 0; padding: 0; }
.service { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.2fr) minmax(120px, .8fr) minmax(200px, 1.3fr);
  align-items: center; gap: 8px 20px; padding: 14px 16px; border-top: 1px solid var(--line); }
.service:first-child { border-top: 0; }
.service h2 { font-size: 0.875rem; font-weight: 500; }
.service > .pill { justify-self: start; }
.svc-seen { color: var(--faint); font-size: 0.8125rem; white-space: nowrap; }
.hours { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; height: 22px; }
.hours li { flex: 1; border-radius: 2px; background: var(--idle); transition: background-color 250ms var(--ease); }
.hours li[data-state="ok"] { background: var(--ok-fill); }
.hours li[data-state="bad"] { background: var(--bad-fill); }
.hours:hover li { opacity: 0.55; }
.hours li:hover { opacity: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; list-style: none; padding: 10px 16px; margin: 0; color: var(--faint);
  font-size: 0.8125rem; border-top: 1px solid var(--line); }
.legend li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--idle); }
.legend li[data-state="ok"]::before { background: var(--ok-fill); }
.legend li[data-state="bad"]::before { background: var(--bad-fill); }
@media (max-width: 860px) {
  .service { grid-template-columns: 1fr auto; }
  .svc-seen { grid-column: 1; }
  .hours { grid-column: 1 / -1; }
}
/* On the dashboard the services are a short list: name and state */
.dash .service { grid-template-columns: 1fr auto; padding: 12px 16px; }
.dash .svc-seen { grid-column: 1; }
.dash .hours, .dash .service > span:last-child { display: none; }

/* System: the queues and the raw log */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.meter { height: 4px; border-radius: 2px; background: var(--idle); margin-top: 8px; overflow: hidden; width: 100%; }
.meter span { display: block; height: 100%; background: var(--ink); transform-origin: left; transition: transform 250ms var(--ease); }
.kv > div:has(.meter) { flex-wrap: wrap; }
/* System's two views as tabs under the title (Usługi i logi, Koszty AI): the app bar's underline, one size down */
.subtabs { display: flex; gap: 4px; margin: -4px 0 24px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 8px 12px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 150ms var(--ease); }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current] { color: var(--ink); border-color: var(--ink); }
/* Koszty AI: the month against the limit on top, then from where, for what, on which models and day by day */
.spend { padding: 20px; display: grid; gap: 14px; margin-bottom: 28px; }
.spend-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spend-label { color: var(--muted); }
.spend-sum { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.spend-sum small { display: inline-block; margin-left: 8px; font-size: 0.875rem; font-weight: 400; letter-spacing: 0; color: var(--faint); }
.spend > .meter { height: 8px; border-radius: 4px; margin: 0; }
.spend-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; margin: 0;
  padding-top: 14px; border-top: 1px solid var(--line); }
.spend-facts dt { color: var(--faint); font-size: 0.8125rem; }
.spend-facts dd { margin: 2px 0 0; font-size: 1.125rem; font-weight: 600; }
@media (max-width: 700px) { .spend-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.leads .r { text-align: right; }
.leads td .meter { max-width: 280px; margin-top: 6px; }
.costs-chart { justify-content: flex-start; }
.costs-chart .col { max-width: 40px; }
.costs-foot { margin-top: 10px; }
.log { background: var(--raised); color: var(--ink); font: 0.8125rem/1.6 var(--mono); padding: 12px 16px;
  height: min(68vh, 720px); overflow: auto; word-break: break-word; border-radius: 0 0 var(--radius) var(--radius); }
.log .line { white-space: pre-wrap; }
.log .t, .log .lv { color: var(--faint); }
.log .p, .log .id { color: var(--accent); }
.log .line[data-level="warning"] .lv, .log .line[data-level="warning"] .m { color: var(--warn); }
.log .line[data-level="error"] .lv, .log .line[data-level="error"] .m { color: var(--bad); }
.log-foot { padding: 10px 16px; border-top: 1px solid var(--line); }

/* Login */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--raised); }
.login { width: min(380px, 100%); display: grid; gap: 6px; padding: 28px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; }
.login h1 { font-size: 1.25rem; font-weight: 600; margin: 22px 0 4px; letter-spacing: -0.02em; }
.login .lede { color: var(--faint); margin-bottom: 8px; }
.login label { font-weight: 500; margin-top: 10px; }
.login .button { margin-top: 18px; }
.login .back { font-size: 0.8125rem; margin-top: 12px; color: var(--faint); justify-self: center; }

/* The public page: one big answer to "does it work?" in a band that takes the system's colour */
.band { --tint: var(--ok-tint); --tone: var(--ok-fill); border-bottom: 1px solid var(--line); background: var(--tint);
  transition: background-color 250ms var(--ease); }
.band[data-state="warn"] { --tint: var(--warn-tint); --tone: var(--warn-fill); }
.band[data-state="bad"] { --tint: var(--bad-tint); --tone: var(--bad-fill); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.hero { padding: 48px 24px 40px; }
#headline { display: flex; align-items: center; gap: 0.3em; font-size: 2.25rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; }
.state-icon { width: 0.9em; height: 0.9em; color: var(--tone); transition: color 250ms var(--ease); }
.checked { margin-top: 10px; color: var(--muted); font-size: 0.8125rem; }
main.public { padding-top: 32px; padding-bottom: 64px; }
main.public .legend { border: 0; padding: 12px 0 0; }
@media (max-width: 600px) { #headline { font-size: 1.75rem; } .hero { padding: 32px 16px 28px; } }

/* CRM (letters, the other session): Atomic CRM's deal board, the client's record page and its notes */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 16px; overflow-x: auto;
  padding-bottom: 8px; align-items: start; }
.board-col { display: grid; gap: 10px; align-content: start; }
.board-head { text-align: center; padding-bottom: 4px; }
.board-head h2 { font-size: 1rem; font-weight: 500; }
.board-head p { color: var(--faint); }
.deal { display: grid; gap: 6px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease); }
.deal:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px -4px color-mix(in oklch, var(--ink) 20%, transparent); }
.deal-title { font-size: 0.9375rem; font-weight: 500; line-height: 1.35; }
.deal-sub { color: var(--faint); font-size: 0.8125rem; }
.deal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.board-more { margin-top: 24px; }
.board-more summary { cursor: pointer; font-weight: 600; }
.board-more[open] > summary { margin-bottom: 12px; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "main aside" "lower aside" "analysis aside";
  gap: 28px; align-items: start; }
.record-main { grid-area: main; } .record-aside { grid-area: aside; } .record-lower { grid-area: lower; min-width: 0; }
.record > .analysis { grid-area: analysis; min-width: 0; }
@media (max-width: 1000px) { .record { grid-template-columns: 1fr; grid-template-areas: "main" "lower" "aside" "analysis"; } }
.record-main { padding: 24px; }
.record-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.record-head h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.record-head p { color: var(--faint); }
.note-form { display: grid; gap: 8px; margin-bottom: 8px; }
.note-form textarea { width: 100%; min-height: 72px; resize: vertical; }
.note-form .button { justify-self: end; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.note-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.note-meta .icon { width: 14px; height: 14px; }
.note-meta time { margin-left: auto; }
.note-text { white-space: pre-line; max-width: 75ch; }
.record-aside { display: grid; gap: 24px; }
.aside-section h3 { font-size: 0.875rem; font-weight: 600; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.info-list li { display: flex; align-items: center; gap: 10px; }
.info-list .icon { color: var(--faint); }
.info-list .hint { margin-left: 4px; }
.money { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.money dt { color: var(--muted); } .money dd { margin: 0; font-weight: 500; text-align: right; }

/* Stages of a case (Staś's concept C): .track is the short bar on a card, .flow the stages on the case page
   (li.done / li.cur / plain = later), .now the one thing to do next with its button */
.track { display: flex; gap: 2px; width: 96px; }
.track i { flex: 1; height: 4px; border-radius: 2px; background: var(--idle); }
.track i.done { background: var(--faint); }
.track i.cur { background: var(--accent-fill); }
.flow { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
.flow > li { counter-increment: stage; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 22px; }
.flow > li::before { content: counter(stage); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-size: 0.8125rem; font-weight: 600; color: var(--faint); border: 1.5px solid var(--line-strong); background: var(--surface); }
.flow > li::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.flow > li:last-child::after { display: none; }
.flow > li.done::before { content: ""; border-color: var(--faint); }
.flow > li > .icon { position: absolute; left: 6px; top: 6px; color: var(--muted); }  /* a done stage: Heroicons check */
.flow > li.cur::before { color: var(--on-fill); background: var(--accent-fill); border-color: var(--accent-fill); }
.flow h2 { font-size: 0.9375rem; font-weight: 600; padding-top: 3px; }
.flow .done h2, .flow li:not(.done):not(.cur) h2 { color: var(--muted); font-weight: 500; }
.now { display: grid; gap: 12px; margin: 10px 0 16px; padding: 16px; border-radius: var(--radius); background: var(--accent-tint); }
.now-step { display: flex; align-items: flex-start; gap: 10px; }  /* a long AI suggestion wraps beside the pill, not under it */
.now strong { font-weight: 600; }
.now .why { color: var(--muted); }

/* The client card below the record (D68, concept 1): the stage that waits now, the finished ones in a line each,
   the analysis last and quiet. One accent only, the blue of "Czeka na nas": no mixes that drift to purple. */
.eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.eyebrow .icon { width: 14px; height: 14px; }
.record-lower > .block:first-child { margin-top: 4px; }
.stage-title { font-size: 1.125rem; font-weight: 600; text-wrap: balance; }
.stage-hint { margin: 2px 0 12px; color: var(--muted); max-width: 80ch; }
.stage-card { box-shadow: inset 3px 0 0 var(--accent-fill); }
.letter-box { display: grid; gap: 12px; }
.letter-box form { display: grid; gap: 6px; }
.letter-box p { margin: 0; }
.done-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); }
.done-list > li + li { border-top: 1px solid var(--line); }
.done-list summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.done-list summary::-webkit-details-marker { display: none; }
.done-list summary > .icon:first-child { color: var(--faint); }
.done-list summary b { font-weight: 600; min-width: 88px; }
.done-list summary span { color: var(--muted); }
.done-list summary .chevron { margin-left: auto; color: var(--faint); transition: transform 200ms var(--ease); }
.done-list details[open] .chevron { transform: rotate(180deg); }
.done-body { border-top: 1px solid var(--line); }
.analysis .block-title { color: var(--muted); font-size: 0.9375rem; }
.stats-line { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 12px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); }
.stats-line div { display: grid; gap: 2px; }
.stats-line dt { color: var(--faint); font-size: 0.75rem; }
.stats-line dd { margin: 0; font-weight: 600; }
.facts-line { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 16px; color: var(--muted); font-size: 0.8125rem; }
.facts-line > span:first-child { color: var(--faint); }
.facts-line b { color: var(--ink); font-weight: 600; }
.analysis .panel { margin-bottom: 16px; }
.pitch { max-width: 80ch; font-size: 1rem; }
.pitch strong { font-weight: 600; }
.opinions { list-style: none; margin: 0; padding: 0; }
.opinion { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.opinion:first-child { border-top: 0; }
.opinion-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.opinion summary { cursor: pointer; color: var(--faint); font-size: 0.8125rem; }
.opinion-text { margin: 6px 0 0; max-width: 100ch; white-space: pre-line; }
.claims td:nth-child(2) { min-width: 28ch; }
.claims td:last-child { color: var(--muted); min-width: 24ch; }
.opinion input[type="text"], .opinion input:not([type]) { max-width: 100ch; }
.arguments { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; max-width: 110ch; }
.arguments small { color: var(--faint); }
.arguments .check { margin-right: 6px; vertical-align: middle; font-size: 0.8125rem; }
.arguments .struck .argument-text { text-decoration: line-through; color: var(--faint); }
.skipped { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--muted); }
.changes { list-style: none; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.changes del { color: var(--muted); }
.changes ins { text-decoration: none; background: var(--ok-tint); }
/* The client's questionnaire on the card (_ankieta.html): one line in all, then a topic per row, opened on demand */
.q-total { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.q-total strong { color: var(--ink); font-weight: 600; }
.q-topic { border-bottom: 1px solid var(--line); }
.q-topic > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.q-topic > summary::-webkit-details-marker { display: none; }
.q-topic > summary .icon { color: var(--faint); transition: transform 200ms var(--ease); }
.q-topic[open] > summary .icon { transform: rotate(180deg); }
.q-topic > summary b { font-weight: 600; }
.q-meta { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center;
  color: var(--faint); font-size: 0.8125rem; }
.q-rows { list-style: none; margin: 0; padding: 0 16px 12px 42px; display: grid; gap: 12px; }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
.q-row p { margin: 0; }
.q-said { grid-column: 1 / -1; color: var(--muted); font-size: 0.8125rem; }
.q-said span { color: var(--faint); }
@media (max-width: 640px) {
  .q-rows { padding-left: 16px; }
}

/* Motion only on change (DESIGN.md): never layout properties */
@keyframes flash { from { background-color: var(--raised); } }
.service.changed, .stat.changed, .kv > .changed { animation: flash 900ms var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(-4px); } }
.events li.new, .log .line.new { animation: enter 220ms var(--ease), flash 1200ms var(--ease); }
/* Glass only where the page scrolls under (Staś, 30.10.2026; PRODUCT.md): the top bar and what drops from it. The
   bar's blur sits on ::before, so a menu inside it still blurs the page and not just the bar. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .appbar { background: transparent; }
  .appbar::before { content: ""; position: absolute; inset: 0; z-index: -1;
    background: color-mix(in oklch, var(--bar) 72%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5); }
  .menu-list { background: color-mix(in oklch, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); }
}
@media (prefers-reduced-transparency: reduce) {
  .appbar { background: var(--bar); }
  .appbar::before { content: none; }
  .menu-list { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Opening things: a menu drops in, a folded section slides open where the browser can animate to height: auto */
.menu[open] > .menu-list { animation: enter 160ms var(--ease); }
.message { animation: enter 220ms var(--ease); }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details:not(.menu)::details-content { block-size: 0; overflow-y: clip;
    transition: block-size 220ms var(--ease), content-visibility 220ms allow-discrete; }
  details:not(.menu)[open]::details-content { block-size: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::details-content { animation: none !important; transition: none !important; }
}
