:root {
  --paper: #f2f4ef;
  --surface: #fbfcf9;
  --ink: #16262b;
  --muted: #566a6f;
  --rail: #0d6b58;
  --rail-dark: #09503f;
  --amber: #d99a00;
  --brick: #b3402e;
  --line: #c9d1ca;
  --focus: #1a56db;
  --radius: 6px;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11191c; --surface: #172226; --ink: #e8efe9; --muted: #9bb0b0;
    --rail: #35b597; --rail-dark: #5fd0b4; --amber: #f0b429; --brick: #ee7d6b; --line: #2d3d41; --focus: #7aa7ff;
  }
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; line-height: 1.5; font-size: 16px; }
a { color: var(--rail-dark); text-underline-offset: 2px; }
a:hover { color: var(--rail); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar { background: var(--ink); color: var(--paper); }
@media (prefers-color-scheme: dark) { .topbar { background: #0b1215; } }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: .65rem 1rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.15rem; color: #fff; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: #7ee0c6; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav a { color: #d7e3dd; text-decoration: none; padding: .35rem .7rem; border-radius: var(--radius); }
nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
nav a[aria-current="page"] { background: #fff; color: #16262b; font-weight: 600; }  /* stały ciemny kolor: w trybie ciemnym --ink jest jasny */

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 1.75rem; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.rail form { display: grid; gap: .85rem; }
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .5rem .6rem; font: inherit; color: inherit; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 7rem; resize: vertical; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .15rem 0; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--rail); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem .75rem; margin: 0; }
legend { font-weight: 650; font-size: .9rem; padding: 0 .35rem; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: .5rem .95rem; border-radius: var(--radius);
  border: 1px solid var(--rail); background: var(--rail); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--rail-dark); border-color: var(--rail-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--rail-dark); }
.btn.ghost:hover { background: var(--rail); color: #fff; }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.danger { background: transparent; border-color: var(--brick); color: var(--brick); }
.btn.danger:hover { background: var(--brick); color: #fff; }
@media (prefers-color-scheme: dark) { .btn { color: #06201a; } .btn:hover, .btn.ghost:hover { color: #06201a; } }

.notice { border-left: 4px solid var(--amber); background: var(--surface); padding: .7rem .9rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; }
.notice.bad { border-color: var(--brick); }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* lista ofert: układ jak rozkład jazdy, wynik po lewej */
.offers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.offer { display: grid; grid-template-columns: 74px 1fr auto; gap: .5rem 1rem; padding: .85rem .25rem; border-bottom: 1px solid var(--line); align-items: start; }
@media (max-width: 560px) { .offer { grid-template-columns: 60px 1fr; } .offer .act { grid-column: 2; } }
.score { text-align: left; }
.score b { font-size: 1.5rem; font-weight: 750; line-height: 1; display: block; }
.bar { display: flex; gap: 2px; margin-top: .3rem; }
.bar i { height: 5px; flex: 1; background: var(--line); border-radius: 1px; }
.bar i.on { background: var(--amber); }
.company { font-weight: 700; }
.title { font-size: 1.02rem; }
.title a { color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin-top: .3rem; align-items: center; }
.chip { font-size: .78rem; padding: .08rem .5rem; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.chip.kind { border-color: var(--rail); color: var(--rail-dark); font-weight: 600; }
.chip.new { background: var(--amber); border-color: var(--amber); color: #1d1500; font-weight: 600; }
details.why { margin-top: .4rem; font-size: .88rem; }
details.why summary { cursor: pointer; color: var(--muted); width: fit-content; }
details.why ul { margin: .35rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.saved { color: var(--rail-dark); font-weight: 600; font-size: .9rem; }

/* pipeline: kolumny to naprawdę kolejne etapy */
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 8rem; }
.col h2 { font-size: .98rem; display: flex; justify-content: space-between; }
.col h2 span { color: var(--muted); font-weight: 500; }
.card { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: .6rem; margin-top: .55rem; font-size: .9rem; }
.card form { display: grid; gap: .4rem; margin-top: .5rem; }
.card textarea { min-height: 3.2rem; }
.card .row { display: flex; gap: .4rem; }
.due { color: var(--brick); font-weight: 650; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.kpi b { display: block; font-size: 1.9rem; font-weight: 750; line-height: 1.1; }
.hbar { display: grid; grid-template-columns: 9rem 1fr 2.5rem; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .9rem; }
.hbar .track { background: var(--line); height: 10px; border-radius: 2px; }
.hbar .fill { background: var(--rail); height: 100%; border-radius: 2px; }
.months { display: inline-flex; gap: 2px; }
.months i { width: 12px; height: 12px; background: var(--line); border-radius: 2px; }
.months i.on { background: var(--rail); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
@media (prefers-reduced-motion: no-preference) { .btn { transition: background .12s; } }

details#filters > summary { font-weight: 650; cursor: pointer; margin-bottom: .6rem; }
details#filters:not([open]) > summary { margin-bottom: 0; }

.offer.plain { grid-template-columns: 1fr auto; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.25rem 0 .5rem; }
.notice.intro a { font-weight: 650; }

/* konta */
.topbar-in .account-link { margin-left: auto; }
.account-link a { color: #d7e3dd; text-decoration: none; padding: .35rem .7rem; border-radius: var(--radius); }
.account-link a.login { border: 1px solid #7ee0c6; color: #fff; }
.account-link a:hover { background: rgba(255,255,255,.1); color: #fff; }
.account-link a[aria-current="page"] { background: #fff; color: #16262b; font-weight: 600; }
.narrow { max-width: 620px; }
.stack { display: grid; gap: .85rem; }
.perks { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose h2 { margin-top: 1.25rem; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot > div { max-width: 1180px; margin: 0 auto; padding: 1rem; }
