:root {
  --navy: #13294b;
  --navy-soft: #c9d3e3;
  --yellow: #f2b134;
  --text: #1c2430;
  --muted: #5d6470;
  --faint: #8a909a;
  --page: #fbfaf7;
  --card: #ffffff;
  --line: #e2dfd6;
  --chip: #eceae3;
  --chip-text: #4a5160;
  --red: #d93a3a;
  --red-text: #a3221d;
  --red-bg: #fde8e6;
  --orange: #f09a24;
  --orange-text: #8a4d04;
  --orange-bg: #fdf0dc;
  --grey: #b9b5aa;
  --grey-text: #4a5160;
  --grey-bg: #efeee9;
  --green: #68a84a;
  --green-text: #2d4a1c;
  --green-bg: #eef6e8;
  --green-line: #cfe3bb;
  --invite-bg: #fff7e5;
  --invite-line: #f0d79a;
  --invite-text: #5b4204;
  --radius: 10px;
}

* { box-sizing: border-box; }
/* `display` on a class would beat the hidden attribute (the account panel once showed before it was opened). */
[hidden] { display: none !important; }
/* No blue flash on tap (Android): buttons and tabs show their own state. */
body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--page); -webkit-tap-highlight-color: transparent; }
a { color: var(--navy); }
h1 { font-weight: 600; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: -3px; }

/* Header */
/* Sticky: the menu stays in view on long results and pages. */
.top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; }
main { padding-bottom: 40px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; }
.wordmark { font-size: 17px; letter-spacing: -0.1px; }
.wordmark b { font-weight: 700; color: var(--yellow); }
.wordmark span { font-weight: 400; color: var(--navy-soft); }
.menu { display: flex; align-items: center; gap: 22px; }
.menu a { color: var(--navy-soft); font-size: 14px; text-decoration: none; }
.menu a:hover, .menu a[aria-current="page"] { color: #fff; }
.menu a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--yellow); padding-bottom: 3px; }
.menu .lang { border: 1px solid rgba(201, 211, 227, 0.45); border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.lang-short { display: none; }

/* Start */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { margin: 0 auto; font-size: 34px; line-height: 1.2; color: var(--navy); max-width: 600px; text-wrap: balance; }
.tagline { margin: 10px auto 26px; color: var(--muted); max-width: 560px; font-size: 16px; text-wrap: balance; }
.check-form { max-width: 560px; margin: 0 auto; text-align: left; }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 13px 15px; border: 1.5px solid var(--navy); border-radius: var(--radius); background: var(--card); color: var(--text); }
.url-row input:focus { outline: 3px solid color-mix(in srgb, var(--yellow) 60%, transparent); outline-offset: 1px; }
.url-row .check-button { font-size: 16px; padding: 13px 24px; white-space: nowrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--chip); border-radius: 12px; }
.tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; padding: 7px 16px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--chip-text); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--card); color: var(--navy); font-weight: 600; border-color: var(--line); }
.tab:disabled { cursor: progress; }
.trust { margin-top: 20px; }
.how-line { margin: 0 auto; max-width: 560px; font-size: 14px; color: var(--muted); text-wrap: balance; }
.how-line a { white-space: nowrap; }
.promises { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 0; padding: 0; }
.promise { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--green-bg); border: 1px solid var(--green-line); color: var(--green-text); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* The invoice's and the account's panels: in their tab, or lent to a shop's result ("in-context") with a header */
.panel { padding: 16px 18px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: left; color: var(--text); }
.panel-head { display: none; align-items: center; gap: 8px; color: var(--navy); margin-bottom: 12px; }
.in-context { margin-top: 12px; border-color: var(--invite-line); }
.in-context .panel-head { display: flex; }
.panel-head h2 { margin: 0; flex: 1; font-size: 16px; font-weight: 600; }
.panel-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.panel-close:hover { background: var(--grey-bg); }
.panel .hint { font-size: 12px; color: var(--faint); margin: 8px 0 0; }
.drop { display: grid; justify-items: center; gap: 2px; padding: 18px 16px; border: 1.5px dashed #b9b4a6; border-radius: 12px; background: var(--page); color: var(--navy); text-align: center; cursor: pointer; }
.drop:hover, .drop-over, #invoice-file:focus-visible + .drop { border-color: var(--navy); background: #f3f1ea; }
.drop .icon { color: var(--navy); margin-bottom: 4px; }
.drop-main { font-weight: 600; }
.drop-sub { font-size: 13px; color: var(--muted); }
.drop[data-state="read"] { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 10px; padding: 12px 14px; border-style: solid; border-color: var(--line); background: var(--card); }
.drop[data-state="read"] .icon { grid-row: span 2; margin: 0; }
.drop[data-state="read"] .drop-sub { color: var(--navy); text-decoration: underline; }
.drop[data-state="reading"] { cursor: progress; }
.inv-fields { margin-top: 14px; }
.inv-read { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
/* A NIP has 10 digits, an account 26: a narrow field and a wide one. */
.inv-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px 12px; }
.field { display: grid; gap: 3px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); }
.panel input[type="text"] { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); min-width: 0; }
.panel input:focus { outline: 3px solid color-mix(in srgb, var(--yellow) 60%, transparent); outline-offset: 1px; }
.account-row { display: grid; grid-template-columns: 1fr 190px; gap: 10px 12px; }
.check-button { font: inherit; font-weight: 600; border: 0; border-radius: var(--radius); background: var(--navy); color: #fff; cursor: pointer; }
.panel .check-button { margin-top: 14px; padding: 10px 20px; }
.check-button:disabled { opacity: 0.7; cursor: progress; }
.form-error { color: var(--red-text); margin: 8px auto 0; max-width: 560px; text-align: left; }
.form-error:empty { margin: 0; }

/* After a check the hero is a slim navy band holding the field */
.hero-compact { padding: 14px 0; background: var(--navy); }
.hero-compact .hero-intro, .hero-compact .trust { display: none; }
.hero-compact .tabs { background: rgba(255, 255, 255, 0.12); margin-bottom: 12px; }
.hero-compact .tab { color: var(--navy-soft); }
.hero-compact .tab[aria-selected="true"] { color: var(--navy); }
.hero-compact .url-row input { border-color: transparent; padding: 10px 13px; font-size: 15px; }
.hero-compact .url-row .check-button { background: var(--yellow); color: var(--navy); padding: 10px 20px; font-size: 15px; }
.hero-compact .form-error { color: #ffd2cc; }
.hero-compact .progress-text { color: var(--navy-soft); }

/* Progress while checking */
.progress { max-width: 560px; margin: 14px auto 0; }
.progress-track { display: flex; gap: 2px; height: 12px; border-radius: 6px; background: var(--grey-bg); overflow: hidden; }
.progress-text { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.progress-queue { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--orange-text); }
.hero-compact .progress-queue { color: var(--yellow); }
.sg-read { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.seg { height: 100%; transition: width 0.3s; }
.seg-warn.seg-strong { background: var(--red); }
.seg-warn.seg-medium { background: var(--orange); }
.seg-warn.seg-weak { background: var(--grey); }
.seg-ok { background: var(--green); }
.seg-unknown { background: repeating-linear-gradient(45deg, var(--grey) 0 4px, var(--grey-bg) 4px 8px); }

/* Result */
.result { padding-top: 20px; padding-bottom: 8px; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.summary-head { display: flex; align-items: center; gap: 14px; }
.summary-icon { flex: none; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; }
.summary p { margin: 0; }
.summary .summary-level { font-size: 22px; font-weight: 600; line-height: 1.2; }
.summary .summary-advice { color: var(--muted); margin-top: 2px; }
.summary-high .summary-icon { background: var(--red-bg); color: var(--red); }
.summary-high .summary-level { color: var(--red-text); }
.summary-elevated .summary-icon { background: var(--orange-bg); color: var(--orange); }
.summary-elevated .summary-level { color: var(--orange-text); }
.summary-few .summary-icon, .summary-none .summary-icon { background: var(--grey-bg); color: var(--grey-text); }
.summary-few .summary-level { color: var(--grey-text); }
.summary-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin: 16px 0 8px; }
/* Equal segments by CSS: the CSP allows no style attributes. */
.summary-bar .seg { flex: 1; }
.counts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.ct::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.ct-strong::before { background: var(--red); }
.ct-medium::before { background: var(--orange); }
.ct-weak::before { background: var(--grey); }
.ct-unknown::before { background: repeating-linear-gradient(45deg, var(--grey) 0 2px, var(--grey-bg) 2px 4px); }
.ct-ok::before { background: var(--green); }
.summary .summary-incomplete { margin-top: 10px; font-size: 13px; color: var(--muted); }

.summary-pending { margin: 18px 0 0; padding: 14px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.context { margin-top: 12px; padding: 12px 16px; background: var(--invite-bg); border: 1px solid var(--invite-line); border-radius: var(--radius); color: var(--invite-text); }
.context p { margin: 0 0 10px; font-size: 14px; }
.context-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.context-button { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border: 1px solid var(--navy); border-radius: 8px; background: var(--card); color: var(--navy); cursor: pointer; }
.context-button:hover { background: var(--navy); color: #fff; }

.signals { margin-top: 16px; }
.alerts .sg { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; margin: 7px 0; }
.stripe { flex: none; width: 4px; border-radius: 2px; background: var(--grey); }
.sg-warn.sg-strong .stripe { background: var(--red); }
.sg-warn.sg-medium .stripe { background: var(--orange); }
.sg-unknown .stripe { background: repeating-linear-gradient(0deg, var(--grey) 0 4px, transparent 4px 8px); }
.sg p { margin: 0; }
.sg .sg-title { font-weight: 600; }
.sg .sg-about { margin-top: 2px; font-size: 13px; color: var(--muted); }
.cap { display: inline-block; font-size: 11px; font-weight: 400; line-height: 1.6; padding: 0 8px; margin-right: 6px; border-radius: 999px; background: var(--chip); color: var(--chip-text); vertical-align: 1px; white-space: nowrap; }
.sg-unknown .sg-title { font-weight: 400; color: var(--muted); }
.more-alerts { font: inherit; font-size: 14px; padding: 4px 0; border: 0; background: none; color: var(--navy); cursor: pointer; text-decoration: underline; }

/* Checks without remarks: compact green tiles */
.fine { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px; margin-top: 12px; }
.fine .sg { display: flex; align-items: flex-start; gap: 8px; background: var(--green-bg); border: 1px solid var(--green-line); border-radius: 9px; padding: 8px 11px; font-size: 13px; color: var(--green-text); }
.fine .sg .icon { color: var(--green); margin-top: 2px; }
.fine .stripe, .fine .cap { display: none; }
.fine .sg .sg-title { font-weight: 400; }

.closing h2 { font-size: 16px; margin: 24px 0 6px; }
.yourself { margin: 0; padding-left: 20px; }
.elsewhere { font-size: 14px; }
.disclaimer { font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }
.disclaimer .version { display: block; margin-top: 4px; }
.site-footer { text-align: center; font-size: 12px; color: var(--faint); padding: 0 16px 24px; }
.footer-guides { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; font-size: 13px; }
.footer-guides a { display: inline-block; padding: 8px 0; color: var(--muted); }
.footer-version { margin: 4px 0 0; }
.guide ol, .guide ul { padding-left: 1.4em; }
.guide li { margin: 10px 0; }
.guide-cta { background: var(--invite-bg); border: 1px solid var(--invite-line); border-radius: var(--radius); padding: 12px 14px; margin-top: 22px; }

.prose { padding-top: 28px; }
.prose h1 { font-size: 28px; color: var(--navy); }

/* How it works */
.how h2 { font-size: 20px; color: var(--navy); margin: 34px 0 10px; }
.how h3 { font-size: 15px; margin: 0 0 4px; color: var(--navy); }
.how .lead { font-size: 16px; color: var(--muted); }
.ways { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ways li { display: flex; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.ways p { margin: 0; color: var(--muted); }
.way-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; }
.how-sources dt { font-weight: 600; margin-top: 10px; }
.how-sources dd { margin: 2px 0 0; color: var(--muted); }
.how-group { margin-top: 18px; }
.how-signals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.how-signals li { padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.how-signals p, .how-levels p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.decisive { display: inline-block; margin-left: 8px; font-size: 11px; padding: 0 8px; line-height: 1.7; border-radius: 999px; background: var(--red-bg); color: var(--red-text); vertical-align: 1px; }
.how-levels { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.how-levels li { padding: 10px 14px 10px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--grey); border-radius: var(--radius); }
.how-level-high { border-left-color: var(--red) !important; }
.how-level-elevated { border-left-color: var(--orange) !important; }
.how-level-none { border-left-color: var(--green) !important; }
.how-pay-good { border-left-color: var(--green) !important; }
.how-pay-bad { border-left-color: var(--red) !important; }
/* The sticky header must not cover the section a result links to. */
#pay { scroll-margin-top: 110px; }
.how-why { margin-top: 20px; padding: 4px 20px 8px; background: var(--invite-bg); border: 1px solid var(--invite-line); border-radius: 14px; }
.how-why h2 { margin-top: 16px; }

@media (max-width: 560px) {
  /* Menu links big enough for a finger. */
  .menu { gap: 4px; }
  .menu a, .menu a[aria-current="page"] { font-size: 13px; padding: 8px 6px; }
  .menu .lang { margin-left: 4px; padding: 6px 10px; }
  .lang-long { display: none; }
  .lang-short { display: inline; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 26px; }
  .url-row { flex-direction: column; }
  .summary .summary-level { font-size: 19px; }
  .fine, .inv-grid, .account-row { grid-template-columns: 1fr; }
  .tabs { display: flex; }
  /* The icon above the label: "Numer konta" stays on one line. */
  .tab { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 4px; font-size: 13px; line-height: 1.3; white-space: nowrap; }
  /* Under 16 px iPhones zoom the page in when a field is tapped. */
  .panel input[type="text"], .hero-compact .url-row input { font-size: 16px; }
  /* While checking and on the result the band stays short: the field and its button side by side. */
  .hero-compact .url-row { flex-direction: row; }
  /* Big enough for a finger. */
  .more-alerts { padding: 8px 0; }
}

/* Narrow phones: the menu goes to a second row under the name. */
@media (max-width: 400px) {
  .top-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 2px; }
  .menu { width: 100%; margin-top: 4px; }
  .menu a:first-child { margin-left: -6px; }
  .menu .lang { margin-left: auto; }
}

/* The author's statistics page */
.stats { padding-top: 24px; max-width: 1200px; }
.stats h1 { font-size: 26px; color: var(--navy); margin: 0 0 6px; }
.stats-intro, .stats-empty { color: var(--muted); }
.stats-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.stats table { border-collapse: collapse; font-size: 13px; width: 100%; }
.stats th, .stats td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.stats thead th { background: var(--chip); color: var(--chip-text); text-align: center; }
.stats tbody th { text-align: left; font-weight: 600; }
.stats-total { background: var(--invite-bg); font-weight: 600; }
.stats-retry { display: inline-block; padding: 11px 18px; border-radius: var(--radius); background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; }
