/* Fundacja Octopus – layout inspired by "Verti" (HTML5 UP).
   Neutral palette with one accent colour (buttons, links, active nav):
   the logo purple by default, the project's colour on project pages and
   their posts (set on <body> as --accent / --accent-hover / --project). */

@font-face { font-family: "Dosis"; font-weight: 400; font-display: swap; src: url("/fonts/Dosis-Regular.ttf") format("truetype"); }
@font-face { font-family: "Dosis"; font-weight: 600; font-display: swap; src: url("/fonts/Dosis-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Dosis"; font-weight: 700; font-display: swap; src: url("/fonts/Dosis-Bold.ttf") format("truetype"); }

:root {
  --purple: #990099;
  --purple-dark: #6e006e;
  --accent: var(--purple);
  --accent-hover: var(--purple-dark);
  /* Line colour of project icons. */
  --project: var(--purple);
  --ink: #222222;
  --text: #4a4a4a;
  --muted: #737373;
  --bg: #f5f5f4;
  --surface: #ffffff;
  --panel: #f0efee;
  --footer: #222222;

  --radius: 8px;
  --shadow: 0 3px 0 rgba(0, 0, 0, 0.05);
  --display: "Dosis", "Trebuchet MS", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.7;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: 1.7rem; font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
main { flex: 1; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

/* Buttons */
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.65em 1.4em;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.button:hover { background: var(--accent-hover); color: #fff; }
.button.large { font-size: 1.2rem; padding: 0.75em 1.6em; }
.button.alt { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button.alt:hover { background: var(--ink); color: #fff; }

/* Header */
.site-header { padding: 2.5rem 0 2rem; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo-icon { width: 64px; }
.logo-wordmark { width: 248px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.nav a {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.4em 0.9em;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); }
.nav a.current { border-bottom-color: var(--accent); }

/* Banner */
.banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 3.5rem 4rem;
}
.banner p { font-size: 1.2rem; max-width: 40em; }
.banner-art { width: 260px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Features */
/* One column per visible project (ADR-0060): the server sets --cols (and
   --cols-mid for medium screens) from the number of cards, like the menu. */
.features {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  scroll-margin-top: 1rem;
}
.feature { padding: 0; overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 1rem; }
.feature-art {
  height: 140px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--project);
}
.feature-art svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature .inner { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; flex: 1; }
.feature header h2 { margin-bottom: 0.1em; }
.subtitle { font-family: var(--display); font-size: 1.15rem; color: var(--muted); margin-bottom: 1em; }
.meta { font-size: 0.95rem; color: var(--muted); }
.more { margin-top: auto; font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-decoration: none; }

.feature-link { color: inherit; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
.feature-link:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); }
.feature-link:hover .more { color: var(--accent-hover); }

/* Sections, posts */
.section { margin-top: 2.5rem; }
main > .section:last-child { margin-bottom: 4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h1, .section-head h2 { margin: 0; }
.post-order { display: flex; gap: 0.5rem; color: var(--muted); margin-right: auto; } /* next to the heading, not centred */
.post-order a { padding: 0.35rem 0.25rem; } /* bigger tap target */
.post-order [aria-current] { color: var(--ink); font-weight: 600; text-decoration: none; cursor: default; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.post-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.post-card-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--panel); }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.75rem 1.75rem; }
.post-card-placeholder { display: grid; place-items: center; aspect-ratio: 3 / 2; background: var(--panel); color: var(--project); }
.post-card-placeholder svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.post-card-body > p:not(.post-meta) { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .more { margin-top: auto; }
.post-card h3 { margin-bottom: 0.4em; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p:not(.post-meta) { font-size: 0.97rem; }
.post-meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5em; }
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--accent); }

/* Aktualności (homepage): one post per view, scroll-snap; carousel.js adds the controls */
.news { scroll-margin-top: 1rem; }
.carousel-track { position: relative; display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) { .carousel-track { scroll-behavior: smooth; } }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; }
.news-card { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); height: 100%; padding: 0; overflow: hidden; border-top: 5px solid var(--project); }
.news-card-image img, .news-card-image.post-card-placeholder { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); }
.news-card-body { display: flex; flex-direction: column; padding: 2rem 2.25rem; }
.news-card-body h3 { font-size: 1.6rem; margin-bottom: 0.4em; }
.news-card-body h3 a { color: var(--ink); text-decoration: none; }
.news-card-body h3 a:hover { color: var(--accent); }
.news-card-body > p:not(.post-meta) { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.carousel-controls { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.carousel-controls[hidden] { display: none; }
.carousel-prev, .carousel-next { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.carousel-prev:hover, .carousel-next:hover { color: var(--accent); }
.carousel-dot { width: 2rem; height: 2rem; border: 0; padding: 0; background: none; cursor: pointer; }
.carousel-dot::before { content: ""; display: block; width: 0.75rem; height: 0.75rem; margin: auto; border-radius: 50%; background: #c8c6c4; }
.carousel-dot[aria-current="true"]::before { background: var(--accent); }
.carousel-controls button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.empty { color: var(--muted); }
.categories { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--muted); }
.tag { display: inline-block; padding: 0.2em 0.8em; border: 1px solid #d4d4d4; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.tag:hover { color: var(--ink); }
.post { max-width: 820px; margin-inline: auto; padding: 2.5rem 3rem; }
.post .lead { max-width: 70ch; font-size: 1.2rem; color: var(--ink); margin: 0 0 1.5rem; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.5rem; margin-top: 1.5em; }
.prose h3 { margin-top: 1.25em; }
.prose img { border-radius: 6px; }
.prose::after { content: ""; display: block; clear: both; }
.post-image { margin: 1.5em 0; }
.post-image img { width: 100%; height: auto; }
.missing-photo { display: grid; place-items: center; min-height: 8rem; margin: 1.5em 0; background: var(--panel); color: var(--muted); border-radius: 6px; }
.post-gallery .missing-photo { margin: 0; }
.preview-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 1.25rem; padding: 0.6rem 1rem; text-align: center; font-weight: 600; background: var(--ink); color: #fff; }
.preview-bar p { margin: 0; }
.preview-bar a { color: #fff; }
.preview-bar .button { padding: 0.35em 1em; }
.preview-bar :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.preview-notes { margin-bottom: 1rem; }
.preview-notes ul { margin: 0.4rem 0 0 1.2rem; }
.post-image figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4em; }
.post-image.size-wide { margin-inline: calc(-1 * min(3rem, 4vw)); max-width: none; }
.post-image.size-wide figcaption { padding-inline: min(3rem, 4vw); }
.post-image.size-left { float: left; width: 46%; margin: 0.3em 1.5em 1em 0; }
.post-image.size-right { float: right; width: 46%; margin: 0.3em 0 1em 1.5em; }
.post-gallery { display: grid; gap: 0.6rem; margin: 1.5em 0; clear: both; }
.post-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.post-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.post-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.post-gallery img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity 0.15s; }
.post-gallery a:hover img { opacity: 0.85; }
.prose blockquote { margin: 1.5em 0; padding-left: 1em; border-left: 3px solid #d4d4d4; color: var(--muted); }
.prose .post-quote { border-left: 4px solid var(--accent); padding: 0.5em 0 0.5em 1.25em; color: var(--ink); clear: both; }
.post-quote p { font-family: var(--display); font-size: 1.35rem; line-height: 1.4; margin: 0 0 0.4em; }
.post-quote cite { font-style: normal; color: var(--muted); }
.post-quote cite::before { content: "— "; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid #e0e0e0; padding: 0.4em 0.7em; }
.post-back { margin-top: 2rem; }
.post-cover { width: 100%; height: auto; border-radius: 6px; margin: 0.5rem 0 1.75rem; }
.post-cover-top { margin: -2.5rem -3rem 2rem; width: calc(100% + 6rem); max-width: none; border-radius: var(--radius) var(--radius) 0 0; }

/* Photo viewer */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.lightbox img { max-width: 92vw; max-height: 88vh; display: block; border-radius: 4px; }
.lightbox button { position: fixed; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 2rem; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; line-height: 1; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-close { top: 1rem; right: 1rem; font-size: 1.4rem !important; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Activity page */
.activity-hero { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; padding: 3rem; align-items: start; }
.activity-hero > div:last-child { max-width: 70ch; }
.activity-brand { display: grid; gap: 1.25rem; justify-items: center; width: 200px; }
.activity-icon { width: 120px; height: 120px; display: grid; place-items: center; background: color-mix(in srgb, var(--project) 12%, #fff); border-radius: var(--radius); color: var(--project); }
/* multiply blends the logos' off-white backgrounds into the white card */
.activity-logo { width: 200px; height: auto; mix-blend-mode: multiply; border-radius: var(--radius); }
.themed .activity-hero { border-top: 6px solid var(--project); }
.themed .eyebrow { color: var(--accent); }
.tag { --project: #d4d4d4; }
.tag:hover { border-color: var(--project); }
.activity-icon svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-family: var(--display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3em; }
.activity-hero h1 { margin-bottom: 0.15em; }
.activity-hero .button { margin-top: 0.5rem; }
.project-social { display: flex; gap: 0.5rem; margin-top: 1rem; }
/* 44px tap target around a 26px line icon, like the project icons */
.project-social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); }
.project-social svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Main */
.main-grid {
  display: grid;
  margin: 2.5rem auto 4rem;
  align-items: start;
  scroll-margin-top: 1rem;
}
.content h3 { margin-top: 1.5em; }
.list { padding-left: 1.2em; margin: 0 0 1.75em; }

/* Footer */
.site-footer { background: var(--footer); color: #cfcfcf; padding: 4rem 0 2rem; }
.site-footer h3 { color: #fff; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #cfcfcf; }
.site-footer .button { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 0.3em 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.links li:first-child { border-top: 0; }
address { font-style: normal; }
.registry { margin-top: 1em; font-size: 0.9rem; color: #9a9a9a; }
.copyright { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.9rem; color: #9a9a9a; }

/* Panel (logged-in area) */
.panel { margin: 0 auto 4rem; }
.panel h1 { font-size: 2rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.notice { font-size: 0.95rem; background: var(--panel); padding: 0.9rem 1.1rem; border-radius: 6px; }
.button { border: 0; cursor: pointer; }
.button:disabled { opacity: 0.5; cursor: wait; }

/* Blog editor */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6em 0.5em; border-bottom: 1px solid #e7e7e7; }
.table th { font-family: var(--display); color: var(--ink); }
.hint { font-size: 0.9rem; color: var(--muted); margin: 0; }
.hint code { background: var(--panel); padding: 0.1em 0.35em; border-radius: 4px; }
.form-errors { background: #fdecec; color: #8a1c1c; border-radius: 6px; padding: 0.8rem 1rem 0.8rem 2rem; }

/* Post list in the panel */
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--project); margin-right: 0.45em; }
.badge { display: inline-block; padding: 0.1em 0.6em; border-radius: 999px; background: #fff3cd; color: #7a5b00; font-size: 0.85rem; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 0.75rem; }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.sort-button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.status-filter [aria-current] { color: inherit; font-weight: 700; text-decoration: none; }
/* Fixed width, so the columns do not shift when the arrow changes. */
.sort-arrow { display: inline-block; min-width: 1.2em; margin-left: 0.25em; text-align: center; }
th:not([aria-sort]) .sort-arrow { color: var(--muted); }
.danger, .link-button.danger { color: #b3261e; }

/* Post editor */
.editor-page { margin: 0 auto 4rem; }
.editor-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.editor-top a { color: var(--muted); }
.save-status { color: var(--muted); font-size: 0.9rem; }
.editor-heading { font-size: 1.6rem; margin: 0.75rem 0 1.25rem; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.editor-main { padding: 2rem; }
.editor-side { display: grid; gap: 1rem; position: sticky; top: 1rem; }
.side-card { padding: 1.25rem 1.4rem; }
.side-card h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.editor-page input:not([type=radio]):not([type=checkbox]), .editor-page textarea,
.panel-form input, .panel-form textarea {
  width: 100%; font: inherit; color: var(--text); padding: 0.6rem 0.75rem; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff;
}
.editor-page textarea, .panel-form textarea { resize: vertical; line-height: 1.6; }
.editor-page input:focus, .editor-page textarea:focus, .panel-form input:focus, .panel-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.editor-page .editor-main input.editor-title { font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--ink); border: 0; border-bottom: 2px solid #eee; border-radius: 0; padding: 0.2rem 0 0.5rem; margin-bottom: 1.5rem; }
.editor-page .editor-main input.editor-title:focus { outline: none; border-bottom-color: var(--accent); }
.field { display: grid; gap: 0.35rem; margin-top: 1rem; font-family: var(--display); font-weight: 600; color: var(--ink); }
.field-label { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; color: var(--ink); }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.save-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.save-actions .button { flex: 1; padding-inline: 0.8em; }
.view-link { margin: 0.75rem 0 0; }
.form-errors[hidden] { display: none; }
.form-errors { margin: 0.75rem 0 0; font-size: 0.95rem; }
#summary-count.over { color: #b3261e; font-weight: 600; }
.editor-page [aria-invalid="true"] { border-color: #b3261e; }
.panel-form fieldset { border: 0; padding: 0; margin: 1.5rem 0 0; }
.panel-form legend { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.panel-form .save-actions { align-items: center; margin-top: 1.5rem; }
.panel-form .save-actions .button { flex: 0 0 auto; }
.editor-summary { display: grid; gap: 0.35rem; margin-bottom: 1.5rem; }
.editor-summary .field { margin-top: 0; }

.project-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.project-chip input { position: absolute; opacity: 0; pointer-events: none; }
.project-chip span { display: inline-flex; align-items: center; gap: 0.45em; padding: 0.35em 0.85em; border: 1px solid #d9d9d9; border-radius: 999px; cursor: pointer; font-size: 0.95rem; }
.project-chip span::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--chip); }
.project-chip input:checked + span { background: var(--chip); border-color: var(--chip); color: #fff; }
.project-chip input:checked + span::before { background: #fff; }
.project-chip input:focus-visible + span { outline: 2px solid var(--chip); outline-offset: 2px; }

.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid #d9d9d9; border-radius: 8px; overflow: hidden; }
.segmented.vertical { display: grid; width: 100%; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 0.4em 0.85em; font-size: 0.9rem; cursor: pointer; border-right: 1px solid #e5e5e5; }
.segmented.vertical span { border-right: 0; border-bottom: 1px solid #e5e5e5; }
.segmented label:last-child span { border: 0; }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.upload-zone { display: grid; place-items: center; width: 100%; min-height: 140px; border: 2px dashed #cfcfcf; border-radius: 8px; background: #fafafa; color: var(--muted); font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.upload-zone:hover, .drag-over .upload-zone, .upload-zone.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); color: var(--ink); }
.upload-zone.small { min-height: 0; aspect-ratio: 1; }
.cover-preview img, .image-preview-block img { width: 100%; height: auto; border-radius: 6px; display: block; }
.inline-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.inline-actions button, .thumb-actions button, .block-toolbar button, .format-bar button, .add-block button, .block-insert button {
  font: inherit; font-size: 0.9rem; padding: 0.3em 0.7em; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; cursor: pointer; color: var(--ink);
}
.inline-actions button:hover, .thumb-actions button:hover, .block-toolbar button:hover, .format-bar button:hover, .add-block button:hover, .block-insert button:hover { border-color: var(--ink); }
button:disabled { opacity: 0.35; cursor: default; }

.blocks { display: grid; gap: 0.4rem; }
.block { border: 1px solid #ececec; border-radius: 8px; padding: 0.75rem 1rem 1rem; background: #fff; transition: border-color 0.15s; }
.block:focus-within { border-color: #cfcfcf; }
.block-unknown { background: var(--panel); }
.block-unknown .hint { color: var(--text); } /* AA contrast on the grey card */
.block-toolbar { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.6rem; }
.block-label { margin-right: auto; font-family: var(--display); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.block-toolbar button { padding: 0.15em 0.55em; }
.format-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.format-bar button { font-size: 0.85rem; padding: 0.2em 0.6em; }
.panel-form .format-bar { margin: 0.4rem 0 0.35rem; }
.link-dialog { width: min(32rem, 100% - 32px); border: 0; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 10px 40px rgb(0 0 0 / 0.25); }
.link-dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.link-dialog h2 { font-size: 1.25rem; margin: 0; }
.link-dialog .save-actions { justify-content: flex-start; }
.link-dialog .form-errors { padding-left: 1rem; }
.image-block { display: grid; gap: 0.6rem; }
.image-block .field-label { margin: 0.2rem 0 0; }
.image-preview-block { position: relative; max-width: 520px; }
.overlay-button { position: absolute; right: 0.6rem; bottom: 0.6rem; font: inherit; font-size: 0.9rem; padding: 0.35em 0.8em; border: 0; border-radius: 6px; background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; }
.gallery-editor { display: grid; gap: 0.6rem; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.gallery-editor.cols-2 { --cols: 2; }
.gallery-editor.cols-4 { --cols: 4; }
.gallery-editor figure { margin: 0; position: relative; }
.gallery-editor img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.thumb-actions { position: absolute; inset: auto 0.3rem 0.3rem; display: flex; gap: 0.25rem; justify-content: flex-end; opacity: 0; transition: opacity 0.15s; }
.gallery-editor figure:hover .thumb-actions, .gallery-editor figure:focus-within .thumb-actions { opacity: 1; }
.thumb-actions button { padding: 0.1em 0.45em; background: rgba(255, 255, 255, 0.92); }
.gallery-editor .thumb-wrap { position: relative; } /* the actions sit on the photo, not on the alt field */
.alt-field { display: grid; gap: 0.2rem; margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.editor-page .alt-field input { font-size: 0.85rem; padding: 0.3em 0.5em; }
.quote-block { display: grid; gap: 0.5rem; }
.add-block { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px dashed #e0e0e0; color: var(--muted); }
.add-block button { padding: 0.45em 1em; }
/* "+ Dodaj blok" between blocks (ADR-0015): low-key until used. */
.block-insert { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.block-insert .insert-toggle { border-style: dashed; color: var(--muted); font-size: 0.85rem; padding: 0.15em 0.8em; }
.insert-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; width: 100%; }
.insert-menu[hidden] { display: none; }
.missing { display: grid; place-items: center; aspect-ratio: 1; background: var(--panel); color: var(--muted); font-size: 0.8rem; border-radius: 6px; }

/* Panel layout: side menu, on phones one row of links without JS (ADR-0048) */
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.5rem 1rem; background: var(--surface); color: var(--ink); border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.skip-link:focus { top: 1rem; }
.panel-layout { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.panel-nav ul { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.25rem; }
.panel-nav a { display: block; padding: 0.4rem 0.75rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.panel-nav a:hover { background: var(--panel); color: var(--ink); }
.panel-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.panel-nav-title { margin: 0 0 0.5rem; padding: 0 0.75rem; font-family: var(--display); font-weight: 700; }
.panel-nav-user { margin: 0; padding: 0 0.75rem; font-size: 0.85rem; overflow-wrap: anywhere; }
.panel-section { margin-top: 2rem; }
/* A wide table scrolls inside its box, not the whole page. */
.panel-main > .box { overflow-x: auto; }
/* Skip-link target: takes focus, but the whole block needs no ring. */
.panel-main:focus { outline: none; }

/* Accessibility bar (a11y.js, public pages only). The settings are classes on
   <html>, set before the first paint by the inline script in base.html. */
.a11y-bar { background: var(--surface); border-bottom: 1px solid #e4e2e0; font-size: 0.9rem; }
/* Pages other than the homepage (`html.a11y-reveal`, set in <head>): the bar
   is a lower single row, off-screen until the visitor scrolls up (a11y.js)
   or tabs into it, and still in the accessibility tree. The header gets
   room above the logo, so the bar never covers it at the top of the page. */
html.a11y-reveal .a11y-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; font-size: 0.8rem; transform: translateY(-100%); transition: transform 0.2s ease; }
html.a11y-reveal .a11y-bar.a11y-bar-shown, html.a11y-reveal .a11y-bar:focus-within { transform: none; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); }
html.a11y-reveal .a11y-inner { flex-wrap: nowrap; overflow-x: auto; gap: 0.3rem; padding: 0.2rem 0; scrollbar-width: none; }
html.a11y-reveal .a11y-inner > :first-child { margin-left: auto; } /* right-aligned, yet scrolls from the start when too wide */
html.a11y-reveal .a11y-label { display: none; }
.a11y-short { display: none; }
html.a11y-reveal .a11y-group { margin-right: 0.3rem; }
html.a11y-reveal .a11y-bar button { min-height: 1.75rem; min-width: 1.75rem; padding: 0.1rem 0.5rem; flex: none; white-space: nowrap; }
html.a11y-reveal .site-header, html.a11y-reveal .survey-header { padding-top: 3rem; }
@media (prefers-reduced-motion: reduce) { html.a11y-reveal .a11y-bar { transition: none; } }
@media (max-width: 560px) {
  html.a11y-reveal .a11y-bar { font-size: 0.72rem; }
  html.a11y-reveal .a11y-inner, html.a11y-reveal .a11y-group { gap: 0.15rem; }
  html.a11y-reveal .a11y-group { margin-right: 0; }
  html.a11y-reveal .a11y-bar button { padding: 0.1rem 0.28rem; }
  /* Shorter labels in the sliding bar on phones, so it stays one row;
     the hidden span is out of the accessibility tree too. */
  html.a11y-reveal .a11y-full { display: none; }
  html.a11y-reveal .a11y-short { display: inline; }
}
.a11y-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem; padding: 0.35rem 0; }
.a11y-label { color: var(--muted); margin-right: 0.25rem; }
.a11y-group { display: inline-flex; gap: 0.25rem; margin-right: 0.5rem; }
.a11y-bar button { min-height: 2.25rem; min-width: 2.25rem; padding: 0.2rem 0.65rem; border: 1px solid #c8c6c4; border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.a11y-bar button:hover { border-color: var(--accent); color: var(--accent); }
.a11y-bar button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.a11y-bar button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Larger text: everything sized in rem grows with the root size. */
html.a11y-text-1 { font-size: 125%; }
html.a11y-text-2 { font-size: 150%; }

/* High contrast: yellow on black. !important beats the project colours set
   inline on <body> and on cards. */
html.a11y-contrast, html.a11y-contrast * {
  --ink: #ffff00 !important; --text: #ffff00 !important; --muted: #ffff00 !important;
  --accent: #ffff00 !important; --accent-hover: #ffffff !important; --project: #ffff00 !important;
  --bg: #000000 !important; --surface: #000000 !important; --panel: #000000 !important; --footer: #000000 !important;
}
html.a11y-contrast body, html.a11y-contrast .box, html.a11y-contrast .site-footer, html.a11y-contrast .a11y-bar { background: #000 !important; color: #ff0 !important; }
html.a11y-contrast .box { border: 2px solid #ff0; box-shadow: none; }
html.a11y-contrast a { color: #ff0 !important; }
html.a11y-contrast a:hover, html.a11y-contrast a:focus { color: #fff !important; }
html.a11y-contrast .button, html.a11y-contrast .button.alt { background: #000 !important; color: #ff0 !important; box-shadow: inset 0 0 0 2px #ff0 !important; }
html.a11y-contrast .button:hover { background: #ff0 !important; color: #000 !important; }
html.a11y-contrast :focus-visible { outline: 3px solid #fff !important; outline-offset: 2px; }
html.a11y-contrast .a11y-bar button[aria-pressed="true"] { background: #ff0 !important; color: #000 !important; }
html.a11y-contrast .activity-icon { background: #000; border: 2px solid #ff0; }
html.a11y-contrast .logo-wordmark { filter: invert(1); } /* black lettering → white; the octopus stays, it is decorative */

/* Underlined links (buttons and the menu too, so every link looks like one). */
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 0.2em; font-weight: 700; }

/* No animations: no transitions, smooth scrolling or hover movement. */
html.a11y-still, html.a11y-still * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
html.a11y-still .feature-link:hover { transform: none; }

/* Medium screens */
@media (max-width: 980px) {
  .site-header { padding: 1.5rem 0; }
  .header-inner { justify-content: center; text-align: center; }
  .nav ul { justify-content: center; }
  .banner { grid-template-columns: 1fr; text-align: center; padding: 2.5rem 2rem; }
  .banner p { margin-inline: auto; }
  .banner-art { width: 180px; margin: 0 auto; grid-row: 1; }
  .actions { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .panel-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .panel-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
  .panel-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; }
  .panel-nav a { padding: 0.3rem 0.6rem; }
  .panel-nav-title { margin: 0; padding: 0 0.25rem 0 0; }
  .panel-nav-title::after { content: ":"; }
  .panel-nav-user { flex-basis: 100%; padding: 0; }
  .editor-side { position: static; }
  .news-card { display: flex; flex-direction: column; }
  .news-card-body { flex: 1; }
  .news-card-image img, .news-card-image.post-card-placeholder { height: auto; aspect-ratio: 3 / 2; }
  .activity-hero { grid-template-columns: 1fr; padding: 2rem; gap: 1.5rem; }
  .activity-icon { width: 96px; height: 96px; }
  .post { padding: 2rem; }
  .post-cover-top { margin: -2rem -2rem 1.75rem; width: calc(100% + 4rem); }
  .activity-brand { width: auto; grid-template-columns: auto auto; align-items: center; justify-content: start; }
  .activity-logo { width: 140px; }
  .content { order: -1; }
  .features { grid-template-columns: repeat(var(--cols-mid, 2), minmax(0, 1fr)); }
}

/* Small screens */
@media (max-width: 560px) {
  .box { padding: 1.5rem; }
  .feature, .post-card, .news-card { padding: 0; }
  .banner { padding: 2rem 1.25rem; }
  .feature .inner { padding: 1.5rem; }
  .logo-icon { width: 48px; }
  .logo-wordmark { width: 200px; }
  .nav a { font-size: 1rem; padding: 0.35em 0.7em; }
  .a11y-inner { justify-content: center; }
  .a11y-label { flex-basis: 100%; text-align: center; margin: 0; }
  .features { grid-template-columns: 1fr; }
  .post-image.size-left, .post-image.size-right { float: none; width: auto; margin: 1.5em 0; }
  .post-gallery.cols-3, .post-gallery.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .post-cover-top { margin: -1.5rem -1.5rem 1.5rem; width: calc(100% + 3rem); }
  .activity-hero, .post { padding: 1.5rem; }
  .post-card-body, .news-card-body { padding: 1.25rem 1.5rem 1.5rem; }
  .news-card-body h3 { font-size: 1.35rem; }
}

/* Survey list and form in the panel (ADR-0065) */
.survey-code { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.survey-meta { display: grid; gap: 0.5rem; padding: 1rem 1.2rem; margin-bottom: 1rem; background: var(--panel); border-radius: 8px; }
.survey-meta p { margin: 0; }
.survey-meta .survey-code { font-size: 1.4rem; }
.survey-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.panel-form fieldset.option-group { margin-top: 1rem; display: grid; gap: 0.4rem; }
.panel-form fieldset.option-group legend { font-size: 1rem; margin-bottom: 0.3rem; }
.panel-form .check input { width: 1.1rem; height: 1.1rem; padding: 0; flex: none; accent-color: var(--accent); }
.panel-form .check { min-height: 44px; }
.questions { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.75rem; }
.question .block-label { font-size: 0.85rem; margin: 0; }
.question .block-label:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.question .field:first-of-type { margin-top: 0; }
.question select, .add-question select { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: var(--text); }
.question select:disabled, .question textarea:disabled, .question input:disabled { background: var(--panel); color: var(--muted); }
.question .hint { margin-top: 0.4rem; }
.scale-labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }
.add-question { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.add-question label { font-family: var(--display); font-weight: 600; color: var(--ink); }

/* Participant survey pages, /ankieta (ADR-0065, ticket 02): mobile first, touch targets of at least 44 px */
.survey-page { background: var(--panel); }
.survey-header { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 1rem; }
.survey-header .logo-icon { width: 44px; height: auto; }
.survey-header .logo-wordmark { width: 170px; height: auto; }
.survey-main { max-width: 34rem; margin: 0 auto; padding: 0 1rem 3rem; }
.survey-main:focus { outline: none; }
.survey-main h1 { font-size: 1.6rem; text-align: center; }
.survey-card { background: #fff; border-radius: 12px; padding: 1.25rem; display: grid; gap: 0.9rem; }
.survey-card h1 { text-align: left; margin: 0; }
.survey-card p { margin: 0; }
.survey-label { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.survey-code-input { font: inherit; font-size: 2rem; letter-spacing: 0.3em; text-align: center; padding: 0.4rem; min-height: 56px; border: 2px solid #cfcfcf; border-radius: 8px; width: 100%; }
.survey-code-input:focus, .survey-form textarea:focus, .survey-word input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.survey-error { color: #8a1c1c; background: #fdecec; border-radius: 6px; padding: 0.6rem 0.8rem; }
.survey-error[hidden] { display: none; }
.survey-wait { font-size: 1.2rem; text-align: center; padding: 1.5rem 0; }
.survey-refresh { text-align: center; margin-top: 1rem; }
.survey-card .button, .survey-refresh .button, .survey-nav .button { min-height: 48px; }
.survey-progress { font-family: var(--display); font-weight: 600; color: var(--muted); }
.survey-form { display: grid; gap: 0.9rem; }
.survey-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; min-width: 0; }
.survey-question { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--ink); line-height: 1.25; padding: 0; margin-bottom: 0.5rem; }
.survey-choice { display: flex; align-items: center; gap: 0.75rem; min-height: 52px; padding: 0.5rem 0.9rem; border: 2px solid #ddd; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.survey-choice input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--accent); margin: 0; }
.survey-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.survey-choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.survey-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.survey-scale-option { position: relative; }
.survey-scale-option input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.survey-scale-option > span { display: grid; place-items: center; min-height: 56px; border: 2px solid #ddd; border-radius: 10px; font-family: var(--display); font-weight: 700; font-size: 1.4rem; cursor: pointer; }
.survey-scale-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.survey-scale-option input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.survey-scale-ends { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.95rem; }
.survey-form textarea, .survey-word input { width: 100%; font: inherit; font-size: 1.1rem; padding: 0.6rem 0.75rem; border: 2px solid #ddd; border-radius: 8px; min-height: 48px; }
.survey-word { display: grid; gap: 0.3rem; }
.survey-word label { font-weight: 600; color: var(--ink); }
.survey-count { text-align: right; }
.survey-status { font-weight: 600; color: #1d6b32; min-height: 1.5em; }
.survey-form input:disabled + span, .survey-form textarea:disabled, .survey-form input:disabled { opacity: 0.6; cursor: not-allowed; }
.survey-results { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e5e5e5; }
.survey-results h3 { font-size: 1.1rem; }
.survey-results ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.survey-result { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.75rem; }
.survey-result-numbers { font-variant-numeric: tabular-nums; font-weight: 600; }
.survey-bar { grid-column: 1 / -1; height: 0.6rem; background: #eee; border-radius: 999px; overflow: hidden; }
.survey-bar > span { display: block; height: 100%; background: var(--accent); }
.survey-mean { font-weight: 700; margin-bottom: 0.5rem; }
.survey-texts li { background: var(--panel); border-radius: 8px; padding: 0.5rem 0.75rem; }
.survey-results ul.survey-cloud { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: baseline; }
.survey-cloud li { font-family: var(--display); font-weight: 700; color: var(--ink); line-height: 1.2; }
.survey-cloud-count { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.survey-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 0.5rem; }
.survey-nav .button { flex: 1; }
.survey-page .a11y-bar button { min-height: 44px; min-width: 44px; }
.option-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.option-row { display: grid; grid-template-columns: 4.5rem 1fr auto; align-items: center; gap: 0.5rem; }
.option-row label { font-size: 0.9rem; color: var(--muted); }
.option-row input { width: 100%; font: inherit; padding: 0.5rem 0.7rem; border: 1px solid #d9d9d9; border-radius: 6px; }
.option-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.option-row button, .add-option { font: inherit; font-size: 0.9rem; min-height: 36px; padding: 0.3em 0.7em; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; cursor: pointer; color: var(--ink); }
.add-option { justify-self: start; margin-top: 0.5rem; }
.option-row input:disabled { background: var(--panel); color: var(--muted); }
.bank { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); border: 0; border-radius: 12px; padding: 1.5rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.bank::backdrop { background: rgba(0, 0, 0, 0.45); }
.bank h2 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.bank-form { display: grid; gap: 0.6rem; }
.bank-form input[type=search] { width: 100%; font: inherit; padding: 0.55rem 0.75rem; border: 1px solid #d9d9d9; border-radius: 6px; }
.bank-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.4rem; max-height: 50vh; overflow: auto; }
.bank-item { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.8rem; border: 1px solid #e5e5e5; border-radius: 8px; cursor: pointer; }
.bank-item input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; flex: none; accent-color: var(--accent); }
.bank-item span { display: grid; gap: 0.2rem; }
.bank-item:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.bank-item:has(input:disabled) { opacity: 0.6; cursor: default; }
.bank-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }

/* Running a survey, /panel/ankiety/{id}/prowadzenie (ticket 03); works on a phone */
.lead-meta p { margin: 0; }
.lead-now { margin: 1rem 0 1.5rem; padding: 1rem 1.2rem; border: 2px solid var(--accent); border-radius: 10px; display: grid; gap: 0.5rem; }
.lead-now p { margin: 0; }
.lead-now-label { color: var(--muted); font-family: var(--display); font-weight: 600; }
.lead-now-text { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.lead-now-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.lead-now-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.3rem; }
.lead-now-actions .button, .lead-question-actions .button { min-height: 44px; }
.lead-heading { font-size: 1.2rem; }
.lead-questions { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.lead-question { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; padding: 0.7rem 0.9rem; border: 1px solid #e5e5e5; border-radius: 8px; }
.lead-question.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.lead-question-text { display: grid; gap: 0.15rem; min-width: 0; flex: 1 1 16rem; }
.lead-question-actions { display: flex; gap: 0.75rem; align-items: center; }
.lead-options summary { cursor: pointer; font-family: var(--display); font-weight: 700; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
/* Participant page: the "presenter moved on" notice */
.survey-notice { margin: 0 0 0.75rem; text-align: center; font-weight: 600; color: var(--ink); }
.survey-notice:empty { margin: 0; }
.survey-refresh[hidden] { display: none; }
.survey-state .button { min-height: 44px; }

/* A survey's results in the panel, /panel/ankiety/{id}/wyniki (ticket 09) */
.results-summary { margin: 0 0 1.25rem; }
.results-questions { display: grid; gap: 1.25rem; }
.result-card { border: 1px solid #e5e5e5; border-radius: 10px; padding: 1rem 1.2rem; display: grid; gap: 0.6rem; }
.result-card h2 { font-size: 1.15rem; margin: 0; }
.result-card .hint { margin: 0; }
.result-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.result-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; }
.result-label { display: flex; gap: 0.6rem; align-items: baseline; }
.result-letter { font-family: var(--display); min-width: 1.1em; }
.result-numbers { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.result-bar { grid-column: 1 / -1; height: 0.75rem; background: #eee; border-radius: 999px; overflow: hidden; }
.result-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.result-mean { font-weight: 700; margin: 0 0 0.5rem; }
.result-texts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.result-texts li { background: var(--panel); border-radius: 8px; padding: 0.5rem 0.75rem; }
.result-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: baseline; }
.result-cloud li { font-family: var(--display); font-weight: 700; color: var(--ink); line-height: 1.2; }
.result-cloud-count { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* Prowadzenie: moderation and the Screen links (ticket 04) */
.lead-screen-links { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0 0 0.75rem; }
.lead-moderation { margin: 0 0 1.5rem; }
.lead-moderation-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.35rem; max-height: 22rem; overflow: auto; }
.lead-moderation-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.7rem; background: var(--panel); border-radius: 6px; }
.lead-moderation-list li.is-hidden span { text-decoration: line-through; color: var(--muted); }

/* The Screen for the projector, /panel/ankiety/{id}/ekran (ticket 04): dark, large type, numbers carry the meaning */
.screen-page { --screen-bg: #111316; --screen-text: #f4f4f4; --screen-muted: #b9bec6; --screen-bar: #f2b632; --screen-track: #2b2f35;
  margin: 0; min-height: 100vh; background: var(--screen-bg); color: var(--screen-text); font-family: var(--body, system-ui, sans-serif); }
.screen-page h1, .screen-page h2 { color: var(--screen-text); }
.screen-page.idle, .screen-page.idle * { cursor: none; }
.screen { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 2.5vh 4vw; box-sizing: border-box; }
.screen-warning { background: #5c1d1d; color: #fff; padding: 0.6rem 1rem; border-radius: 8px; margin: 0 0 1rem; font-size: 1.1rem; }
.screen-body { display: grid; align-items: center; }
.screen-waiting { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4vw; }
.screen-qr { width: min(48vh, 80vw); height: auto; background: #fff; padding: 1.2vh; border-radius: 16px; }
.screen-join h1 { font-size: clamp(2rem, 4vw, 3.6rem); margin: 0 0 1.5rem; }
.screen-join-step { font-size: clamp(1.2rem, 2vw, 1.8rem); color: var(--screen-muted); margin: 0; }
.screen-address { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4.5vw, 4.4rem); margin: 0.2rem 0 1rem; word-break: break-all; }
.screen-code { font-size: clamp(1.5rem, 3vw, 2.6rem); margin: 0; }
.screen-code strong { font-family: var(--display); letter-spacing: 0.08em; font-size: 1.4em; }
.screen-note { color: var(--screen-muted); font-size: 1.4rem; }
.screen-thanks { text-align: center; }
.screen-thanks h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.screen-thanks p { font-size: 1.6rem; color: var(--screen-muted); }
.screen-question { display: grid; gap: 1.5vh; align-content: start; }
.screen-number { margin: 0; color: var(--screen-muted); font-size: clamp(1rem, 1.6vw, 1.5rem); font-family: var(--display); font-weight: 600; }
.screen-text { margin: 0 0 1.5vh; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1.15; }
.screen-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 2.2vh; }
.screen-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6vh 2rem; font-size: clamp(1.2rem, 2.2vw, 2.1rem); }
.screen-bar-label b { font-family: var(--display); margin-right: 0.7rem; }
.screen-bar-numbers { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.screen-bar { grid-column: 1 / -1; height: clamp(14px, 2.4vh, 28px); background: var(--screen-track); border-radius: 999px; overflow: hidden; }
.screen-bar-fill { display: block; height: 100%; width: 0; background: var(--screen-bar); border-radius: 999px; }
.screen-mean { font-size: clamp(1.6rem, 3vw, 2.8rem); font-weight: 700; margin: 0 0 1vh; }
.screen-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1vh 2.4vw; }
.screen-word { font-family: var(--display); font-weight: 700; line-height: 1.1; }
.screen-word-count { font-size: 0.4em; color: var(--screen-muted); font-weight: 400; vertical-align: super; }
.screen-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1.2vh 1.2vw; max-height: 62vh; overflow: auto; }
.screen-tile { background: #1f2329; border-left: 6px solid var(--screen-bar); border-radius: 8px; padding: 1rem 1.2rem; font-size: clamp(1.1rem, 1.8vw, 1.6rem); }
.screen-hidden { text-align: center; }
.screen-big-count { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 8vw, 7rem); margin: 0; }
.screen-hidden p:last-child, .screen-empty { color: var(--screen-muted); font-size: 1.6rem; }
.screen-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; color: var(--screen-muted); font-size: clamp(1rem, 1.6vw, 1.5rem); }
.screen-corner { display: flex; align-items: center; gap: 0.8rem; }
.screen-corner[hidden] { display: none; }
.screen-corner img { background: #fff; padding: 4px; border-radius: 6px; width: clamp(64px, 9vh, 120px); height: auto; }
.screen-blackout { position: fixed; inset: 0; background: #000; z-index: 30; }
.screen-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 1rem; background: rgba(0, 0, 0, 0.82); text-align: center; }
.screen-overlay[hidden], .screen-blackout[hidden] { display: none; }
.screen-start { font: inherit; font-family: var(--display); font-weight: 700; font-size: 2rem; padding: 1rem 2.4rem; border: 0; border-radius: 999px; background: var(--screen-bar); color: #111; cursor: pointer; }
.screen-start:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.screen-hint { color: var(--screen-muted); font-size: 1.2rem; max-width: 36rem; }
.screen-controls { position: fixed; top: 1rem; right: 1rem; z-index: 25; display: flex; gap: 0.5rem; transition: opacity 0.3s; }
.screen-controls button { font: inherit; padding: 0.4rem 0.9rem; border: 1px solid #555; border-radius: 6px; background: #1f2329; color: var(--screen-text); cursor: pointer; }
.screen-controls button[hidden] { display: none; }
.screen-page.idle .screen-controls { opacity: 0; pointer-events: none; }
.screen-flash { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); background: #1f2329; color: var(--screen-text); padding: 0.6rem 1.2rem; border-radius: 8px; opacity: 0; transition: opacity 0.3s; z-index: 26; margin: 0; }
.screen-flash.shown { opacity: 1; }
.screen-help { background: #1f2329; color: var(--screen-text); border: 0; border-radius: 12px; padding: 1.5rem 2rem; }
.screen-help::backdrop { background: rgba(0, 0, 0, 0.6); }
.screen-help dl { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.5rem; font-size: 1.1rem; }
.screen-help dt { font-weight: 700; }
.screen-help dd { margin: 0; color: var(--screen-muted); }
.screen-help button { font: inherit; padding: 0.4rem 1rem; border-radius: 6px; border: 0; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .screen-bar-fill { transition: width 0.6s ease; }
  .screen-word { transition: font-size 0.6s ease, opacity 0.4s; }
  .screen-word.new, .screen-tile.new { opacity: 0; }
  .screen-tile { transition: opacity 0.6s; }
}
.lead-compare { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* Comparison with earlier workshops (ticket 07): names on every bar, common words bold and underlined */
.screen-history { margin: 0 0 1.5vh; color: var(--screen-muted); font-size: clamp(1.1rem, 1.8vw, 1.6rem); }
.screen-pair-row { display: grid; gap: 0.6vh; font-size: clamp(1.1rem, 2vw, 1.9rem); }
.screen-pair { display: grid; grid-template-columns: 9em 1fr 4.5em; align-items: center; gap: 1rem; font-size: 0.8em; }
.screen-pair .screen-bar { grid-column: auto; }
.screen-pair-name { color: var(--screen-muted); }
.screen-pair.before .screen-bar-fill { background: repeating-linear-gradient(135deg, #8fb3ff 0 10px, #6f93e0 10px 20px); }
.screen-compare-clouds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 2vw; }
.screen-compare-cloud h2 { font-size: clamp(1.2rem, 2vw, 1.8rem); margin: 0 0 1vh; color: var(--screen-muted); }
.screen-compare-clouds .screen-word { font-weight: 400; }
.screen-compare-clouds .screen-word.common { font-weight: 800; text-decoration: underline; text-underline-offset: 0.15em; }
.screen-footer { flex-wrap: wrap; }
.screen-corner span { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .screen-pair { grid-template-columns: 5.5em minmax(0, 1fr) 3.2em; gap: 0.5rem; }
}

/* Comparison in the results view (ticket 10): every bar named, "Pozostałe sesje" striped, common words bold and underlined */
.results-compare { border: 1px solid #e5e5e5; border-radius: 10px; padding: 0.8rem 1.2rem 1rem; margin-bottom: 1.25rem; display: grid; gap: 0.25rem; }
.results-compare[hidden] { display: none; }
.results-compare-all { font-weight: 700; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.result-history { color: var(--muted); margin: 0 0 0.5rem; }
.result-pair-row { display: grid; gap: 0.3rem; }
.result-pair { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 6.5em; align-items: center; gap: 0.6rem; font-size: 0.92rem; }
.result-pair .result-bar { grid-column: auto; }
.result-pair-name { color: var(--muted); }
.result-pair.before .result-bar > span { background: repeating-linear-gradient(135deg, #5b7bd5 0 8px, #8aa3e6 8px 16px); }
.result-clouds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.result-clouds h3 { font-size: 1rem; margin: 0 0 0.4rem; color: var(--muted); }
.result-clouds .result-cloud li { font-weight: 400; }
.result-clouds .result-cloud li.common { font-weight: 800; text-decoration: underline; text-underline-offset: 0.15em; }
@media (max-width: 600px) { .result-pair { grid-template-columns: 6em minmax(0, 1fr) 5.5em; } }
