/* ------------------------------------------------------------------------------------------------
   Brand colours come from the Radzymin logo: blue #007bc2 (white text on it: 4.55:1) and
   yellow #fcdf00 (dark text on it: 14:1). Yellow is used for calls to action and highlights only.
   ------------------------------------------------------------------------------------------------ */
:root {
  --blue: #007bc2;
  --blue-dark: #005a91;
  --blue-deep: #0b2a40;
  --yellow: #fcdf00;

  --color-bg: #f4f8fb;
  --color-surface: #ffffff;
  --color-tint: #e8f3fa;
  --color-text: #14202b;
  --color-muted: #4a5b69;
  --color-border: #d6e2eb;
  --color-link: #005a91;
  --color-focus: #005a91;

  --color-error: #b3261e;
  --color-error-bg: #fbe9e7;
  --color-success: #146c43;
  --color-success-bg: #e6f4ea;
  --color-warning: #6e5200;
  --color-warning-bg: #fff6cc;

  --chart-0: #007bc2;
  --chart-1: #d55e00;
  --chart-2: #009e73;
  --chart-3: #8a4fbf;
  --chart-4: #6b7785;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 30, 60, 0.06), 0 6px 20px rgba(0, 30, 60, 0.07);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d1620;
    --color-surface: #15212d;
    --color-tint: #111d29;
    --color-text: #e8f0f6;
    --color-muted: #9db0bf;
    --color-border: #263646;
    --color-link: #5bb8ee;
    --color-focus: #fcdf00;

    --color-error: #f2a099;
    --color-error-bg: #3a1f1d;
    --color-success: #6fd08c;
    --color-success-bg: #17321f;
    --color-warning: #f0d060;
    --color-warning-bg: #3a3210;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap.page { max-width: 760px; padding-top: 32px; padding-bottom: 56px; }

a { color: var(--color-link); }

/* Everything clickable gets the hand cursor. Browsers only do that for links by default; buttons,
   checkboxes and their labels keep the arrow unless told otherwise. */
a[href],
button,
summary,
select,
[role="button"],
input[type="submit"],
input[type="checkbox"],
input[type="radio"],
.field-checkbox label { cursor: pointer; }
button:disabled,
input:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 40px 0 12px; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 8px; }
h1, h2, h3 { overflow-wrap: anywhere; }

.lead { color: var(--color-muted); font-size: 1.1rem; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--yellow);
  color: #14202b;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Header ------------------------------------------------------------------------------- */
/* A light header keeps the coat of arms consistent across colour schemes. */
.site-header { background: #fff; border-bottom: 4px solid var(--blue); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #14202b; }
.brand-logo { display: block; width: 46px; height: 58px; flex: 0 0 46px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.15rem; }
.brand-text small { color: #4a5b69; font-size: 0.8rem; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav-link { color: #14202b; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.site-nav-link:hover { background: #e8f3fa; }
.site-nav-cta {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
}
.site-nav-cta:hover { background: var(--blue-dark); }
.site-header :focus-visible { outline-color: var(--blue-dark); }

.site-nav-cta { white-space: nowrap; }
.mobile-nav { display: none; }

@media (max-width: 640px) {
  .site-nav { display: none; }
  .header-inner { gap: 10px; }
  .brand { gap: 10px; }
  .brand-text strong { font-size: 1rem; }
  .brand-text small { font-size: 0.72rem; }
  .brand-logo { width: 40px; height: 50px; flex-basis: 40px; }
  .mobile-nav { display: block; position: relative; color: #14202b; }
  .mobile-nav summary { list-style: none; padding: 9px 13px; border: 1px solid var(--color-border); border-radius: 999px; font-weight: 700; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav summary::after { content: '⌄'; padding-left: 7px; }
  .mobile-nav[open] summary::after { content: '⌃'; }
  .mobile-nav-panel { position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); display: grid; gap: 2px; width: min(82vw, 280px); padding: 8px; background: #fff; border: 1px solid var(--color-border); border-radius: 14px; box-shadow: var(--shadow); }
  .mobile-nav-panel a { padding: 11px 12px; border-radius: 9px; color: #14202b; font-weight: 650; text-decoration: none; }
  .mobile-nav-panel a:hover { background: var(--color-tint); }
}

/* ---- Buttons ------------------------------------------------------------------------------ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--blue-dark); }
.button:active { transform: translateY(1px); }
.button-lg { padding: 14px 28px; font-size: 1.05rem; }
.button-accent { background: var(--yellow); color: #14202b; }
.button-accent:hover { background: #ffe94d; }
.button-outline { background: transparent; color: var(--color-link); border-color: currentColor; }
.button-outline:hover { background: var(--color-tint); }
.button-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.75); }
.button-outline-light:hover { background: rgba(255, 255, 255, 0.14); }

/* ---- Hero --------------------------------------------------------------------------------- */
.hero {
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(252, 223, 0, 0.28), transparent 42%),
    linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
}
.hero-inner { padding-top: 44px; padding-bottom: 48px; max-width: 1040px; }
.hero :focus-visible { outline-color: #fff; }
.hero-eyebrow { margin: 0 0 12px; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; }
.hero h1 { max-width: 20ch; font-size: clamp(2rem, 5.4vw, 3.2rem); line-height: 1.08; margin-bottom: 16px; }
.hero-highlight { color: var(--yellow); }
.hero-lead { max-width: 40rem; font-size: 1.2rem; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.28); }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font-size: 0.9rem; opacity: 0.92; }
.hero-stats dd { margin: 0; font-size: 2.2rem; font-weight: 800; line-height: 1.1; color: var(--yellow); }

/* ---- Sections ----------------------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-tint { background: var(--color-tint); }
.section h2 { margin-top: 0; }
.section-lead { color: var(--color-muted); font-size: 1.1rem; max-width: 42rem; margin: 0 0 28px; }
.empty { color: var(--color-muted); }

.petition-list, .topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.petition-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.petition-card,
.topic-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.petition-card { display: flex; flex-direction: column; border-top: 5px solid var(--blue); }
.petition-card .button { align-self: flex-start; margin-top: auto; }
.petition-card h3 { font-size: 1.25rem; }
.petition-card h3 a { color: var(--color-text); text-decoration: none; }
.petition-card h3 a:hover { color: var(--color-link); text-decoration: underline; }

.card-progress { margin: 4px 0 18px; }
.card-progress .progress-bar { margin-top: 0; }
.card-progress-label { margin: 6px 0 0; font-size: 0.9rem; color: var(--color-muted); }
.card-progress-label strong { color: var(--color-text); }

.signature-count { color: var(--color-link); font-size: 1.05rem; }

/* Steps ("Jak możesz pomóc") */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.step { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; }
.step p { margin: 0; color: var(--color-muted); }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--yellow);
  color: #14202b;
  font-weight: 800;
}

/* Contact section */
.contact { padding-top: 24px; }
.contact-card {
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(252, 223, 0, 0.22), transparent 40%),
    var(--blue-deep);
  border-radius: 20px;
  padding: 36px;
}
.contact-card h2 { color: #fff; font-size: 1.9rem; }
.contact-card a:not(.button) { color: var(--yellow); }
.contact-card :focus-visible { outline-color: #fff; }
.contact-card code { background: rgba(255, 255, 255, 0.16); color: #fff; }
.contact-about { max-width: 42rem; font-size: 1.05rem; }
.contact-about p { margin: 0 0 12px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.contact-address { margin: 16px 0 0; opacity: 0.85; font-size: 0.95rem; }

.about-card {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.about-photo { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 28%; border-radius: 14px; }
.about-card-compact { align-items: start; }
.about-page { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: clamp(24px, 5vw, 48px); align-items: start; }
.about-page .about-photo { position: sticky; top: 24px; }
.about-copy h2 { margin-top: 0; }
.about-copy .button { margin-top: 10px; }
.contact-invite { padding: 24px; text-align: center; background: var(--color-tint); border-radius: 16px; }
.contact-invite h2 { margin: 0 0 8px; }
.contact-invite p { margin: 0 auto 16px; }
.contact-invite .contact-address { margin-top: 14px; }

.contact-dialog {
  width: min(94vw, 620px);
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 0;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 24px 90px rgb(0 0 0 / .35);
}
.contact-dialog::backdrop { background: rgb(5 22 34 / .72); }
.contact-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.contact-dialog-head h2 { margin: 0; }
.contact-dialog .contact-form { padding: 18px 24px 24px; }
.dialog-close { flex: 0 0 42px; height: 42px; border: 0; border-radius: 50%; background: var(--color-tint); color: var(--color-text); font-size: 1.8rem; line-height: 1; }
.site-credit { font-size: .88rem; }
.site-credit a { font-weight: 700; }

.contact-grid { display: grid; gap: 32px; }
.contact-form {
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 24px;
}
.contact-form h3 { margin: 0 0 16px; font-size: 1.25rem; }
.contact-card .contact-form a:not(.button) { color: var(--color-link); }
.contact-card .contact-form :focus-visible { outline-color: var(--color-focus); }
.optional { font-weight: 400; color: var(--color-muted); }
[aria-invalid="true"] { border-color: var(--color-error); }

.form-status { margin: 12px 0 0; min-height: 1.5em; font-weight: 600; }
.form-status-pending { color: var(--color-muted); }
.form-status-success { color: var(--color-success); }
.form-status-error { color: var(--color-error); }

@media (min-width: 860px) {
  .contact-grid-with-form { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .contact-card { padding: 26px 22px; }
  .hero-inner { padding-top: 32px; padding-bottom: 34px; }
  .hero-eyebrow { font-size: 0.78rem; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .hero-lead { font-size: 1.05rem; }
  .hero-actions .button { width: 100%; }
  .about-card { grid-template-columns: 1fr; gap: 22px; }
  .about-photo { max-width: 260px; }
  .about-page { grid-template-columns: 1fr; }
  .about-page .about-photo { position: static; max-width: 240px; }
}

/* ---- Petition page ------------------------------------------------------------------------ */
.petition-body, .topic-body { margin: 20px 0; }

.help-box {
  background: linear-gradient(135deg, var(--color-surface), var(--color-tint));
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--blue);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 28px);
  margin: 32px 0;
  box-shadow: var(--shadow);
}
.help-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.help-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; background: var(--yellow); color: #14202b; border-radius: 15px; transform: rotate(-5deg); }
.help-icon .ui-icon { width: 26px; height: 26px; }
.help-eyebrow { margin: 0 0 4px; color: var(--color-muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.help-box h2 { font-size: clamp(1.15rem, 3vw, 1.45rem); margin: 0; letter-spacing: -.025em; }
.ui-icon { flex-shrink: 0; vertical-align: middle; }
.share { container-type: inline-size; text-align: left; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 24px; }
.share-label { margin: 0 0 6px; font-weight: 750; font-size: .95rem; }
.share-description { margin: 0 0 16px; color: var(--color-muted); font-size: .85rem; line-height: 1.5; }
.share-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.share-list li[hidden] { display: none; }
.share-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-link);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.share-link:hover { background: var(--color-tint); border-color: var(--color-link); }
.share-copy { border-style: dashed; }
.share-copy.is-copied { color: var(--color-success); background: var(--color-success-bg); border-style: solid; border-color: var(--color-success); }
.share-feedback { min-height: 1.5em; margin: 8px 0 0; font-size: .8rem; color: var(--color-success); }
.share-feedback.is-error { color: var(--color-error); }
.share-manual { font-size: .85rem; color: var(--color-muted); }
.share-manual input { width: 100%; margin-top: 6px; padding: 9px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text); font: inherit; }
.share-offline { padding-left: 24px; border-left: 1px solid var(--color-border); }
.share-qr { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 10px 0 12px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.share-qr-image { display: block; flex: 0 0 80px; padding: 4px; background: #fff; border-radius: 8px; }
.share-qr img { display: block; width: 72px; height: 72px; }
.share-qr-copy { flex: 1; min-width: 0; line-height: 1.4; }
.share-qr-copy strong { display: block; font-size: .88rem; }
.share-qr-copy small { display: block; margin-top: 4px; font-size: .75rem; color: var(--color-muted); }
.share-qr > .ui-icon { width: 16px; color: var(--color-link); }
.share-qr:hover { border-color: var(--color-link); }
.share-print { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: .85rem; font-weight: 700; text-underline-offset: 4px; }
.share-paper-note { font-size: .78rem; margin: 4px 0 0; }
@container (max-width: 560px) {
  .share-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .share-offline { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--color-border); }
}
@container (max-width: 260px) {
  .share-list { grid-template-columns: minmax(0, 1fr); }
}

.contact-hint {
  margin: 36px 0 0;
  padding: 14px 18px;
  background: var(--color-tint);
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
}
.contact-hint p { margin: 0; }

.disclaimer { color: var(--color-muted); font-size: 0.85rem; }
.disclaimer-inline { margin: 0 0 16px; }

.signature-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius);
  padding: 26px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.field-hint { color: var(--color-muted); font-size: 0.85rem; margin: 4px 0 0; }
.field-error { color: var(--color-error); font-size: 0.85rem; margin: 4px 0 0; }
.field-checkbox label { font-weight: normal; display: flex; gap: 8px; align-items: flex-start; }
.field-checkbox input { margin-top: 5px; }

/* Honeypot: hidden from sighted users but present in the DOM for bots to fill in. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 12px 16px; border-radius: 8px; margin: 16px 0; }
.alert-error { background: var(--color-error-bg); color: var(--color-error); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { border: 1px solid var(--color-border); padding: 8px 10px; text-align: left; }
.admin-table th { background: var(--color-tint); }

code { background: var(--color-border); padding: 2px 5px; border-radius: 4px; }

/* ---- Topics ("Czym się zajmuję") ---------------------------------------------------------- */
.topic-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.topic-card-head h1,
.topic-card-head h3 { margin: 0; flex: 1 1 14rem; }
.topic-card-head h3 a { color: var(--color-text); text-decoration: none; }
.topic-card-head h3 a:hover { color: var(--color-link); text-decoration: underline; }

.topic-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.topic-card { display: flex; flex-direction: column; }
.topic-card .topic-card-head { display: block; }
.topic-card .topic-card-head h3 { margin-bottom: 10px; }
.topic-card .topic-card-head .badge { margin: 0 4px 8px 0; }
.topic-card .topic-meta { margin-top: auto; padding-top: 12px; }
.topic-card .topic-institution { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.topic-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.topic-filters button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-text); font: inherit; font-weight: 600; }
.topic-filters button[aria-pressed="true"] { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.page-jumps { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0; }
.page-jumps a { min-height: 44px; display: inline-flex; align-items: center; }
#form-errors h2 { margin-top: 0; font-size: 1.2rem; }
.field input[aria-invalid="true"] { border: 2px solid var(--color-error); }

.topic-summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-bottom: 10px; }
.topic-outcome, .topic-next { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 8px 0; font-size: 0.94rem; }
.topic-outcome strong { color: var(--color-muted); }
.topic-next strong { color: var(--color-link); }
.topic-current { margin: 18px 0; padding: 12px 16px; background: var(--color-tint); border-left: 4px solid var(--blue); border-radius: 0 10px 10px 0; }
.topic-current p { margin: 0 0 6px; }
.topic-current p:last-child { margin-bottom: 0; }

.topic-institution { color: var(--color-muted); font-size: 0.9rem; margin: 4px 0 10px; }
.topic-meta { color: var(--color-muted); font-size: 0.85rem; margin: 8px 0 0; }
.topic-progress { margin-top: 12px; }
.topic-progress .progress-bar { margin-top: 0; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-planned { background: var(--color-bg); color: var(--color-muted); border-color: var(--color-border); }
.badge-in_progress { background: var(--color-tint); color: var(--color-link); border-color: var(--color-border); }
.badge-waiting { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-completed { background: var(--blue); color: #fff; }
.badge-rejected { background: var(--color-error-bg); color: var(--color-error); }

.timeline { list-style: none; margin: 16px 0; padding: 0; }
.timeline-step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.timeline-step::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--color-border); }
.timeline-step:last-child::before { display: none; }
.timeline-marker {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  position: relative;
  z-index: 1;
}
.timeline-step-done .timeline-marker { background: var(--blue); border-color: var(--blue); }
.timeline-title { margin: 0; font-weight: 600; }
.timeline-date { margin: 0; color: var(--color-muted); font-size: 0.85rem; }

/* Answer deadline: colour is backed by the label text and a leading symbol, never colour alone. */
.badge-late { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error); }
.timing {
  margin: 6px 0 0;
  padding: 6px 10px;
  border-left: 4px solid var(--timing, var(--color-border));
  border-radius: 0 6px 6px 0;
  background: var(--timing-bg, var(--color-bg));
  color: var(--timing-fg, var(--color-text));
  font-size: 0.9rem;
}
.timing-label::before { content: var(--timing-icon, ""); margin-right: 6px; }
.timing-label::after { content: ": "; font-weight: 400; }
.timing-on_time { --timing: var(--color-success); --timing-bg: var(--color-success-bg); --timing-fg: var(--color-success); --timing-icon: "\2713"; }
.timing-awaiting { --timing: var(--color-warning); --timing-bg: var(--color-warning-bg); --timing-fg: var(--color-warning); --timing-icon: "\23F3"; }
.timing-late,
.timing-overdue { --timing: var(--color-error); --timing-bg: var(--color-error-bg); --timing-fg: var(--color-error); --timing-icon: "\26A0"; }
.timing-late .timing-label,
.timing-overdue .timing-label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.timeline-step-on_time .timeline-marker { background: var(--color-success); border-color: var(--color-success); }
.timeline-step-awaiting .timeline-marker { border-color: var(--color-warning); }
.timeline-step-late .timeline-marker,
.timeline-step-overdue .timeline-marker { background: var(--color-error); border-color: var(--color-error); border-radius: 3px; transform: rotate(45deg); }

/* ---- Confirmation page (after clicking the e-mail link) ----------------------------------- */
.confirmed-page {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px 28px;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow);
}
.confirmed-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.confirmed-page h1 { font-size: 1.6rem; }
.confirmed-lead { color: var(--color-text); }
.confirmed-note { color: var(--color-muted); font-size: 0.9rem; }
.confirmed-share { margin-top: 28px; }
.confirmed-share h2 { font-size: 1.15rem; margin: 0 0 10px; }
.confirmed-page .share-list { justify-content: center; }
.confirmed-page .contact-hint { text-align: left; }

/* ---- Signature-goal progress (petition page, confirmation page, cards) -------------------- */
.progress-block { margin-top: 24px; text-align: left; }
.progress-stats { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-stat-right { text-align: right; }
.progress-stat-value { display: block; font-size: 1.85rem; font-weight: 800; color: var(--color-link); }
.progress-stat-label { display: block; font-size: 0.85rem; color: var(--color-muted); }

.progress-bar { height: 10px; background: var(--color-border); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #2aa3e6); border-radius: 999px; }
.progress-remaining { margin-top: 12px; font-size: 0.9rem; color: var(--color-muted); }
.confirmed-page .progress-remaining { text-align: center; }

.recent-signatures { margin-top: 28px; text-align: left; }
.recent-signatures h3 { font-size: 1rem; margin-bottom: 8px; }
.recent-signatures-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.recent-signatures-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
}
.recent-signatures-city { color: var(--color-muted); }

/* ---- Charts (fenced `chart` blocks in content files, rendered to SVG on the server) ------ */
.chart-s0 { --series: var(--chart-0); }
.chart-s1 { --series: var(--chart-1); }
.chart-s2 { --series: var(--chart-2); }
.chart-s3 { --series: var(--chart-3); }
.chart-s4 { --series: var(--chart-4); }

.chart { margin: 28px 0; }
.chart-title { margin: 0 0 8px; font-weight: 700; }
.chart-svg { display: block; width: 100%; height: auto; }

.chart-grid { stroke: var(--color-border); stroke-width: 1; }
.chart-axis { stroke: var(--color-muted); }
.chart-tick, .chart-label, .chart-unit { fill: var(--color-muted); font-size: 12px; }
.chart-value { fill: var(--color-text); font-size: 12px; font-weight: 600; }

.chart-bar { fill: var(--series); stroke: var(--color-bg); stroke-width: 1; }
.chart-bar:hover { opacity: 0.85; }
.chart-line { stroke: var(--series); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
/* Series differ by dash pattern as well as colour, so the chart doesn't rely on colour alone. */
.chart-line.chart-s1 { stroke-dasharray: 8 5; }
.chart-line.chart-s2 { stroke-dasharray: 1 6; }
.chart-line.chart-s3 { stroke-dasharray: 12 4 2 4; }
.chart-line.chart-s4 { stroke-dasharray: 3 3; }
.chart-dot { fill: var(--series); stroke: var(--color-bg); stroke-width: 1.5; }

.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; font-size: 0.9rem; }
.chart-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; background: var(--series); vertical-align: -1px; }
.chart-caption { margin-top: 8px; color: var(--color-muted); font-size: 0.85rem; }

.chart-data { margin-top: 10px; overflow-x: auto; font-size: 0.9rem; }
.chart-data summary { color: var(--color-link); }
.chart-data table { border-collapse: collapse; margin-top: 8px; min-width: 100%; }
.chart-data th, .chart-data td { border: 1px solid var(--color-border); padding: 5px 10px; }
.chart-data td { text-align: right; font-variant-numeric: tabular-nums; }
.chart-data thead th { background: var(--color-tint); }
.chart-data tbody th { text-align: left; font-weight: 600; }

/* ---- Footer ------------------------------------------------------------------------------- */
.site-footer { background: var(--blue-deep); color: #cfe3f1; padding: 32px 0; font-size: 0.95rem; }
.site-footer p { margin: 0 0 10px; }
.site-footer a { color: #fff; }
.site-footer .disclaimer { color: #a9c3d6; }
.site-footer :focus-visible { outline-color: #fff; }

/* Admin: anonimizacja dokumentów */
.anon-note { background: var(--color-warning-bg); color: var(--color-warning); padding: 12px 14px; border-radius: 6px; }
.anon-section { margin: 28px 0; }
.anon-wide { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; }
.button-secondary { background: var(--color-tint); color: var(--color-link); border: 1px solid var(--color-border); }
.button-secondary:hover { background: var(--color-border); }
.anon-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.anon-stage { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--color-border); cursor: crosshair; touch-action: none; user-select: none; }
.anon-stage canvas { display: block; max-width: 100%; height: auto; }
.anon-box { position: absolute; background: rgba(0, 0, 0, 0.55); outline: 2px solid #c00; cursor: pointer; }
.anon-box-manual { outline-color: #06c; }
.anon-box-draft { background: rgba(0, 102, 204, 0.3); outline: 2px dashed #06c; pointer-events: none; }

/* Motion follows the action; all content is visible before JavaScript runs. */
.button, .share-link, .share-qr, .site-nav-link, .site-nav-cta, .dialog-close {
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .25s, transform .25s var(--ease-out);
}
.petition-card, .topic-card, .step { transition: border-color .25s, box-shadow .25s, transform .3s var(--ease-out); }
.field input, .field textarea { transition: border-color .2s, box-shadow .2s, background-color .2s; }
.field:focus-within input:not([type="checkbox"]), .field:focus-within textarea { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent); }
.field-checkbox input { accent-color: var(--blue); width: 18px; height: 18px; flex-shrink: 0; }
.button:active, .share-link:active, .share-qr:active, .site-nav-cta:active { transform: translateY(1px) scale(.98); }
.button:disabled { opacity: .7; }
.button.is-pending { pointer-events: none; }
.button.is-pending::before { content: ''; width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .7s linear infinite; }
.progress-bar-fill { transform-origin: left; }
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::after { content: ''; position: absolute; z-index: -1; right: -80px; top: -140px; width: clamp(320px, 45vw, 560px); aspect-ratio: 1; border: 1px solid rgb(255 255 255 / .16); border-radius: 50%; box-shadow: 0 0 0 54px rgb(255 255 255 / .04), 0 0 0 108px rgb(255 255 255 / .03); pointer-events: none; }
.step-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 18px; background: var(--color-tint); color: var(--color-link); border-radius: 12px; }
.contact-dialog[open] { animation: dialog-enter .25s var(--ease-out); }
.contact-dialog[open]::backdrop { animation: backdrop-enter .2s ease-out; }
.mobile-nav[open] .mobile-nav-panel { animation: dialog-enter .2s var(--ease-out); }
.form-status-success, .form-status-error, .alert { animation: feedback-enter .3s var(--ease-out); }
.confirmed-icon polyline { stroke-dasharray: 30; stroke-dashoffset: 0; animation: check-draw .6s var(--ease-out); }
.signature-form:target, #podpisz:target { animation: target-highlight 1.2s ease-out; }
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):hover, .site-nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgb(0 40 70 / .15); }
  .share-link:hover, .share-qr:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .share-qr:hover > .ui-icon { transform: translateX(3px); }
  .share-qr > .ui-icon { transition: transform .25s var(--ease-out); }
  .petition-card:hover, .topic-card:hover, .step:hover { transform: translateY(-4px); border-color: var(--color-link); box-shadow: 0 12px 30px rgb(0 40 70 / .1); }
  .dialog-close:hover { transform: rotate(90deg); }
}
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes feedback-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes check-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes target-highlight { from { background-color: var(--color-tint); } to { background-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .button:hover, .button:active, .site-nav-cta:hover, .site-nav-cta:active, .share-link:hover, .share-link:active, .share-qr:hover, .share-qr:active, .share-qr:hover > .ui-icon, .petition-card:hover, .topic-card:hover, .step:hover, .dialog-close:hover { transform: none; }
}
