:root {
  --brand: #2f6f73;
  --brand-strong: #235558;
  --brand-soft: #d9eeee;
  --bg: #fbfcfc;
  --bg-alt: #eef4f4;
  --surface: #ffffff;
  --text: #172526;
  --muted: #536466;
  --line: #d5e0e0;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7cc3c6;
    --brand-strong: #a3d8da;
    --brand-soft: #173a3c;
    --bg: #0f1717;
    --bg-alt: #142020;
    --surface: #1a2727;
    --text: #e3eded;
    --muted: #9fb1b2;
    --line: #2b3b3c;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }

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

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand img { border-radius: 7px; }

nav { display: flex; gap: 4px; }

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}

nav a:hover { color: var(--text); background: var(--bg-alt); }

.header-right { display: flex; align-items: center; gap: 12px; }

/* Below 900px (phones, tablets) the brand, four section links, the language
   switch and the register/login buttons don't fit in one row (measured: the
   Polish header needs about 870px). The links go; the sections are short
   enough to reach by scrolling. */
@media (max-width: 899px) {
  nav { display: none; }
}

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 40px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.lang-switch button:hover { color: var(--text); }

.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--surface);
}

.lang-switch button:focus-visible,
nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Hero */

.hero { padding: 56px 0 64px; }

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding: 88px 0 96px; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 56px; }
}

h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 18px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
}

.body-text {
  margin-top: 14px;
  color: var(--muted);
  max-width: 34em;
}

.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

/* App screenshot */

.app-shot { margin: 0; min-width: 0; }

.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgb(0 0 0 / 0.45);
}

.app-shot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Sections */

.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }

@media (min-width: 900px) {
  .section { padding: 96px 0; }
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.01em; }

.section-lede {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40em;
}

.features {
  display: grid;
  gap: 16px;
  margin-top: 40px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.features article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.features h3 { font-size: 1.05rem; margin-bottom: 8px; }
.features p { color: var(--muted); font-size: 0.95rem; }

/* Organization section (index.html): free vs. organization, how it works. */

.plans {
  display: grid;
  gap: 16px;
  margin-top: 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.plan-featured { border: 2px solid var(--brand); padding: 25px; }
.plan h3 { font-size: 1.2rem; }
.plan-tag { color: var(--brand); font-weight: 600; font-size: 0.95rem; margin: 4px 0 16px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan li { position: relative; padding-left: 26px; font-size: 0.95rem; }
.plan li::before { content: "\2713"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.plan-note { margin-top: 16px; color: var(--muted); font-size: 0.85rem; }

.steps-title { margin-top: 48px; font-size: 1.2rem; }

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 16px;
}

/* Three steps in a row, or one under another: never two and a lone third. */
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 22px 70px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.steps h4 { font-size: 1.05rem; margin: 4px 0 8px; }
.steps p { color: var(--muted); font-size: 0.95rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 32px; }

/* Contact */

.contact-grid { display: grid; gap: 32px; }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
}

.contact-form {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.field-row { display: grid; gap: 16px; }

@media (min-width: 600px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.contact-form label:where(:not(altcha-widget *)) { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }

.contact-form input:where(:not(altcha-widget *)),
.contact-form textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.contact-form textarea { resize: vertical; min-height: 120px; }

.contact-form input:where(:not(altcha-widget *)):focus,
.contact-form textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent;
}

.contact-form button {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  padding: 11px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: var(--surface);
  cursor: pointer;
}

.contact-form button:disabled { opacity: 0.45; cursor: not-allowed; }

.form-note { color: var(--muted); font-size: 0.875rem; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer a { color: inherit; }

/* Privacy policy (privacy.html). i18n.js sets <html lang>; only the article
   in that language is shown. */

html[lang="pl"] .policy[lang="en"],
html[lang="en"] .policy[lang="pl"] { display: none; }

.policy-page { border-top: 0; padding-top: 48px; }
.policy { max-width: 46em; }
.policy h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.01em; }
.policy h2 { font-size: 1.25rem; margin-top: 32px; }
.policy p, .policy ul { margin-top: 12px; }
.policy ul { padding-left: 1.25em; }
.policy li + li { margin-top: 6px; }
.policy a { color: var(--brand); overflow-wrap: anywhere; }
.policy-date { color: var(--muted); font-size: 0.9rem; }

/* Buttons (login link, control panel) */

:root { --danger: #b3261e; --success: #1e6b3a; }
@media (prefers-color-scheme: dark) {
  :root { --danger: #f2b8b5; --success: #8fd6a6; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: var(--surface);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.button-small { padding: 6px 12px; font-size: 0.875rem; }
.button-quiet { background: transparent; color: var(--brand); border-color: var(--line); }
.button-quiet:hover { background: var(--bg-alt); border-color: var(--line); }
.button-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.button-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: currentColor; }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* On phones the header holds the brand, the language switch and this. */
.header-right .button-small { padding: 6px 10px; }

/* Contact form states */

.contact-form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note-error { color: var(--danger); }
.form-note-success { color: var(--success); font-weight: 600; }

/* Login */

.login-page { border-top: 0; }
.login-card { max-width: 400px; margin: 0 auto; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 4px; }

/* Control panel */

.panel { padding: 32px 0 72px; }
.panel h1 { font-size: clamp(1.6rem, 3.5vw, 2rem); }
.panel h2 { font-size: 1.2rem; }
.panel h3 { font-size: 1.05rem; overflow-wrap: anywhere; }

.signed-in { color: var(--muted); font-size: 0.875rem; }
@media (max-width: 719px) {
  .signed-in { display: none; }
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs [role="tab"] {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.stack { display: grid; gap: 16px; }
.stack-tight { display: grid; gap: 12px; }
.list-title { margin: 40px 0 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.card-head > div:first-child { min-width: 0; flex: 1 1 240px; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; min-width: 0; }
.field-narrow { max-width: 260px; }

.panel input,
.panel textarea,
.panel select {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.panel textarea { resize: vertical; }
.panel input:focus,
.panel textarea:focus,
.panel select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 559px) {
  .user-row { grid-template-columns: minmax(0, 1fr) auto; }
  .user-row .field:nth-child(2) { grid-column: 1; }
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (max-width: 559px) {
  .inline-form { grid-template-columns: minmax(0, 1fr); }
}

.table-scroll { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.users th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.users td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users td:first-child { overflow-wrap: anywhere; }
table.users select { min-width: 150px; }
table.users .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.chip-update { background: var(--bg-alt); color: var(--muted); }

.post-body { white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }

.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.banner-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog h2 { font-size: 1.25rem; margin-bottom: 8px; }
.dialog form { margin-top: 20px; display: flex; justify-content: flex-end; }
.password-org { font-weight: 700; margin-top: 12px; overflow-wrap: anywhere; }
.password-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.password-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.password-user { font-weight: 600; overflow-wrap: anywhere; }
.password-value { grid-column: 1; font-size: 1rem; letter-spacing: 0.03em; overflow-wrap: anywhere; user-select: all; }
.password-list .button { grid-column: 2; grid-row: 1 / span 2; }

/* Organization panel, registration and account pages */

/* Control panel alerts (panel.html). */
.alerts { margin-top: 16px; }
.alerts h2 { font-size: 1rem; margin-bottom: 6px; }
.alerts ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

.banner-success { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.panel .banner { margin-bottom: 0; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.card .inline-form + .form-note { margin-top: -4px; }
.log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.log-list li { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 12px; overflow-wrap: anywhere; }
.log-date { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
@media (max-width: 559px) {
  .log-list li { grid-template-columns: 1fr; gap: 0; }
}
.payment-block { margin-top: 8px; }
.payment-block input[type="date"] { width: auto; }
.payment-block .button-row { align-items: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.register-card { max-width: 520px; }
.contact-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.contact-form .check input { width: auto; margin-top: 3px; flex: none; }
/* The ALTCHA widget (register.html) brings its own styles; site form rules skip it. */
.contact-form altcha-widget { display: block; }
.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--brand-soft);
  font-size: 0.9rem;
}
.notice p { margin: 0; }

.staff-login { margin-top: 8px; }
.staff-login summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; text-align: center; }
.staff-login[open] summary { margin-bottom: 12px; }
.staff-login h2 { font-size: 1.25rem; margin-bottom: 4px; }
span.brand { cursor: default; }

/* Download tab of the control panel and the owner panel. */
.downloads { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.checksum { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 0.75rem; }
#panel-download > h2 { margin-bottom: 16px; }
