:root {
  --blue: #3643BA;
  --blue-dark: #28318C;
  --blue-50: #ECEEFB;
  --mint: #B8F1D8;

  --ink: #1A1A1A;
  --ink-2: #2E353C;
  --muted: #5B6370;
  --muted-2: #8A929C;

  --line: #E1E8ED;
  --line-strong: #CFD7DE;
  --surface: #F7F9FA;
  --surface-2: #EEF2F4;
  --white: #FFFFFF;

  --green: #1FAE6B;
  --green-50: #E6F8EE;
  --orange: #D97706;
  --orange-50: #FDF1E0;
  --red: #DC2626;
  --red-50: #FBE7E5;

  --r-xs: 6px;
  --r: 10px;
  --r-md: 14px;

  /* Decathlon-clean: system miękkich cieni */
  --shadow-sm: 0 1px 2px rgba(15, 26, 42, 0.04), 0 1px 3px rgba(15, 26, 42, 0.05);
  --shadow-md: 0 2px 6px rgba(15, 26, 42, 0.05), 0 8px 20px rgba(15, 26, 42, 0.07);
  --shadow-hover: 0 4px 10px rgba(15, 26, 42, 0.07), 0 16px 32px rgba(15, 26, 42, 0.10);
  --shadow-blue: 0 2px 8px rgba(54, 67, 186, 0.24);
  --shadow-blue-hover: 0 6px 18px rgba(54, 67, 186, 0.36);
}

/* ── Tweak: density scale ── */
:root { --pad-scale: 1; --radius-scale: 1; --border-color: var(--line); }
:root[data-density="compact"]  { --pad-scale: 0.72; }
:root[data-density="cozy"]     { --pad-scale: 1; }
:root[data-density="spacious"] { --pad-scale: 1.35; }

/* ── Tweak: tone ── */
:root[data-tone="utility"]    { --radius-scale: 1; --border-color: var(--line); }
:root[data-tone="friendly"]   { --radius-scale: 2.2; --border-color: #ECF1F5; }
:root[data-tone="industrial"] { --radius-scale: 0; --border-color: #B7C2CC; }

:root[data-tone="industrial"] body { background: #ECEFF2; }
:root[data-tone="friendly"] body { background: #F4F7FA; }

/* apply scale to common surfaces */
.welcome-head, .panel-head, .stat-card, .card,
.module-list, .module-row, .lesson, .sidebar, .chat-side, .chat-shell,
.login-card, .admin-head, .admin-stat, .admin-table-wrap, .admin-codes-list,
.btn, .chip, .tag, .module-row .icon, .stat-icon, .composer .field, .login-form input {
  border-radius: calc(var(--r) * var(--radius-scale));
  border-color: var(--border-color);
}

/* ── Decathlon-clean: miękka elewacja głównych powierzchni ── */
.welcome-head, .panel-head, .stat-card, .card, .lesson,
.sidebar, .chat-side, .chat-shell, .login-card,
.admin-head, .admin-stat, .admin-table-wrap, .admin-codes-list, .module-list,
.ann-card, .ann-widget, .admin-ann {
  border-color: rgba(15, 26, 42, 0.06);
  box-shadow: var(--shadow-sm);
}
.welcome-head { padding: calc(24px * var(--pad-scale)) calc(28px * var(--pad-scale)); }
.stat-card { padding: calc(14px * var(--pad-scale)) calc(16px * var(--pad-scale)); }
.panel-head { padding: calc(18px * var(--pad-scale)) calc(20px * var(--pad-scale)); }
.lesson { padding: calc(22px * var(--pad-scale)) calc(24px * var(--pad-scale)); }
.sidebar, .chat-side { padding: calc(16px * var(--pad-scale)); }
.module-row { padding-top: calc(12px * var(--pad-scale)); padding-bottom: calc(12px * var(--pad-scale)); }
.admin-stat { padding: calc(14px * var(--pad-scale)) calc(16px * var(--pad-scale)); }
.container { padding-top: calc(24px * var(--pad-scale)); padding-bottom: calc(40px * var(--pad-scale)); }

/* industrial: sharp, mono meta, heavier rules */
:root[data-tone="industrial"] .module-row { border-top-color: #C8D1DA; }
:root[data-tone="industrial"] .admin-table th { background: #DCE2E8; color: #1A1A1A; border-bottom-color: #B7C2CC; letter-spacing: 0.08em; }
:root[data-tone="industrial"] .admin-table td { border-bottom-color: #C8D1DA; }
:root[data-tone="industrial"] .eyebrow, :root[data-tone="industrial"] .module-row .num,
:root[data-tone="industrial"] .breadcrumb, :root[data-tone="industrial"] .section-title h3,
:root[data-tone="industrial"] .admin-stat .lbl {
  font-family: "Geist Mono", ui-monospace, monospace; letter-spacing: 0.06em;
}
:root[data-tone="industrial"] .stat-icon, :root[data-tone="industrial"] .module-row .icon {
  background: #DCE2E8; color: #1A1A1A;
}
:root[data-tone="industrial"] .tag { letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; }

/* friendly: soft tinted surfaces, no harsh lines */
:root[data-tone="friendly"] .welcome-head,
:root[data-tone="friendly"] .panel-head,
:root[data-tone="friendly"] .lesson,
:root[data-tone="friendly"] .sidebar,
:root[data-tone="friendly"] .chat-side,
:root[data-tone="friendly"] .chat-shell,
:root[data-tone="friendly"] .module-list,
:root[data-tone="friendly"] .admin-head,
:root[data-tone="friendly"] .admin-stat,
:root[data-tone="friendly"] .admin-table-wrap,
:root[data-tone="friendly"] .admin-codes-list,
:root[data-tone="friendly"] .stat-card,
:root[data-tone="friendly"] .login-card { box-shadow: 0 1px 0 rgba(15,26,42,0.02), 0 6px 18px -10px rgba(15,26,42,0.10); }
:root[data-tone="friendly"] .stat-icon, :root[data-tone="friendly"] .module-row .icon { background: var(--blue-50); color: var(--blue-dark); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  color: var(--ink);
  background: #EEF3F8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--blue-dark); }

/* ────────────  APP SHELL  ──────────── */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  background: linear-gradient(180deg, #3D4AC4 0%, var(--blue) 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 14px rgba(40, 49, 140, 0.22);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.brand-logo {
  height: 24px;
  width: auto;
  display: block;
  /* logo jest jednokolorowe → przemalowujemy na białe pod indygo nagłówek */
  filter: brightness(0) invert(1);
}
.brand-word {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.brand-divider {
  height: 18px;
  width: 1px;
  background: rgba(255, 255, 255, 0.30);
}
.brand-section {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}
.brand-section .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  margin: 0 8px 2px;
  vertical-align: middle;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav button:hover { background: rgba(255, 255, 255, 0.10); color: white; }
.nav button.active {
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-weight: 600;
}

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

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: var(--r);
  padding: 2px;
  flex-shrink: 0;
}
.lang-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  min-width: 30px;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.lang-btn:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.lang-btn.active {
  background: white;
  color: var(--blue);
}
.lang-btn.active:hover { background: white; color: var(--blue); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.user-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.user-chip .name { font-size: 13px; font-weight: 500; }
.logout-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 6px;
  cursor: pointer;
  font-family: inherit;
}
.logout-btn:hover { color: white; background: rgba(255, 255, 255, 0.08); }

.main { flex: 1; width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ────────────  COMMON UI  ──────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: background 0.14s, color 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue-hover);
}
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-blue); }
.btn-secondary {
  background: white;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:active { transform: translateY(0); box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  letter-spacing: 0;
}
.tag.green { background: var(--green-50); color: #126B43; }
.tag.orange { background: var(--orange-50); color: #8C4B04; }
.tag.gray { background: var(--surface-2); color: var(--muted); }
.tag.blue { background: var(--blue-50); color: var(--blue-dark); }

/* shared card primitive */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ────────────  SCREEN 1: WELCOME  ──────────── */

.welcome {
  display: grid;
  gap: 20px;
}
.welcome-head {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.welcome-head h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 8px 0 8px;
  color: var(--ink);
}
.welcome-head .lead {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}
.welcome-head .ctas {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.welcome-head .meta-side {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  min-width: 180px;
}
.welcome-head .meta-side strong { color: var(--ink); font-weight: 600; }

.welcome-head .next-step-card {
  appearance: none;
  background: var(--blue-50);
  border: 1px solid var(--blue-50);
  border-radius: calc(var(--r) * var(--radius-scale));
  padding: 14px 18px;
  min-width: 220px;
  max-width: 300px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.welcome-head .next-step-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.welcome-head .ns-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-dark);
  margin-bottom: 6px;
}
.welcome-head .ns-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.welcome-head .ns-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.stat-card:hover { border-color: rgba(54,67,186,0.30); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
.stat-value {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}

/* ────────────  SCREEN 2: PANEL  ──────────── */

.panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}
.panel-head h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 4px 0 4px;
}
.panel-head .sub {
  color: var(--muted);
  font-size: 13.5px;
}
.panel-head .sub strong { color: var(--ink); font-weight: 600; }

.progress-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  min-width: 280px;
}
.ring {
  width: 44px;
  height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ring svg { transform: rotate(-90deg); }
.ring .pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
}
.progress-card .ttl { font-weight: 600; font-size: 13px; color: var(--ink); }
.progress-card .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.progress-card .bar {
  margin-top: 6px;
  height: 4px;
  width: 180px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-card .bar > i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-title .filters { display: flex; gap: 4px; }

.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: var(--r);
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

/* dense list-style module cards */
.module-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.module-row {
  display: grid;
  grid-template-columns: 4px 32px 1.4fr 1.4fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px 12px 0;
  border-top: 1px solid var(--line);
  background: white;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s;
}
.module-row:first-child { border-top: 0; }
.module-row:hover { background: var(--blue-50); }
.module-row.locked { opacity: 0.55; cursor: not-allowed; }
.module-row.locked:hover { background: white; }
.module-row .accent {
  width: 4px;
  height: 36px;
  border-radius: 0 2px 2px 0;
  background: var(--accent, var(--blue));
}
.module-row .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.module-row .num {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  margin-bottom: 2px;
}
.module-row .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.module-row .desc {
  font-size: 13px;
  color: var(--muted);
}
.module-row .stats {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  white-space: nowrap;
}
.module-row .duration {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}
.module-row .arrow {
  color: var(--muted-2);
  font-size: 14px;
  padding-right: 4px;
}
.module-row:hover .arrow { color: var(--blue); }

/* ────────────  SCREEN 3: MODULE VIEW  ──────────── */

.module-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 64px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 14px;
  width: fit-content;
}
.back-link:hover { color: var(--blue-dark); }

.sidebar h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.sidebar .meta {
  font-size: 12.5px;
  color: var(--muted);
}
.sidebar .bar {
  margin: 12px 0 4px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.sidebar .bar > i {
  display: block;
  height: 100%;
  background: var(--blue);
}
.sidebar .pct {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.step {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 8px;
  border-radius: var(--r-xs);
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.step:hover { background: var(--surface); }
.step.active {
  background: var(--blue-50);
}
.step.locked { opacity: 0.55; cursor: not-allowed; }
.step .stepnum {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.step.done .stepnum { background: var(--green); color: white; }
.step.active .stepnum { background: var(--blue); color: white; }
.step .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.step.active .label { color: var(--blue-dark); font-weight: 600; }
.step .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.step .icon { font-size: 12px; color: var(--muted-2); }

.lesson {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
}
.lesson .breadcrumb {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.lesson h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.lesson .lead {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 18px;
  max-width: 64ch;
}

.logipad-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}
.logipad {
  background: #11161D;
  border-radius: var(--r);
  padding: 16px;
  color: #DDE3EE;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  position: relative;
  border: 1px solid #1F2630;
}
.logipad .screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #6F7E94;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.logipad .screen-top .battery { color: #6FD9A8; }
.logipad .lp-orow {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1.7fr 0.7fr;
  gap: 14px;
  align-items: start;
  padding: 50px 8px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 12px;
}
.logipad .lp-col {
  min-width: 0;
}
.logipad .lp-col-id .lp-zone {
  font-size: 17px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.logipad .lp-col-id .lp-meta {
  font-size: 11px;
  color: #6F7E94;
  line-height: 1.5;
}
.logipad .lp-col-counts .lp-dead {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
  line-height: 1;
}
.logipad .lp-col-counts .lp-count-main {
  font-size: 14px;
  color: #9CD9B4;
  font-weight: 600;
  margin-bottom: 2px;
}
.logipad .lp-col-counts .lp-count-sec {
  font-size: 12.5px;
  color: #6F7E94;
  line-height: 1.5;
}
.logipad .lp-col-codes {
  font-size: 13.5px;
  color: #DDE3EE;
  line-height: 1.7;
  font-family: "Geist Mono", ui-monospace, monospace;
  word-spacing: 2px;
}
.logipad .lp-col-cities {
  font-size: 14px;
  color: white;
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
}

.hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  z-index: 4;
  padding: 0;
}
.hotspot:hover { transform: scale(1.10); }
.hotspot.active {
  background: white;
  color: var(--blue-dark);
  box-shadow: 0 0 0 2px var(--blue);
}

.legend {
  background: white;
  border-radius: var(--r);
  padding: 14px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.legend .ttl {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.legend-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  cursor: pointer;
  align-items: start;
  transition: opacity 0.12s;
}
.legend-item:first-child { border-top: 0; padding-top: 4px; }
.legend-item .pin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  margin-top: 1px;
}
.legend-item.active .pin { background: var(--blue); color: white; }
.legend-item.dim { opacity: 0.55; }
.legend-item .ttl-row { font-size: 13px; font-weight: 600; color: var(--ink); }
.legend-item .desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; line-height: 1.45; }

.lesson-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.lesson-foot .step-meta {
  font-size: 12.5px;
  color: var(--muted);
}

/* ────────────  SCREEN 4: CHAT  ──────────── */

.chat-page {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
.chat-page.solo {
  display: block;
  max-width: 860px;
  margin: 0 auto;
}
.chat-side {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  position: sticky;
  top: 64px;
}
.chat-side h4 {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 8px;
}
.thread-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-xs);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  display: block;
  margin-bottom: 1px;
  transition: background 0.12s;
}
.thread-item:hover { background: var(--surface); }
.thread-item.active { background: var(--blue-50); color: var(--blue-dark); font-weight: 600; }
.thread-item .when { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }

.chat-shell {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 110px);
  min-height: 540px;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.chat-head .who { display: flex; align-items: center; gap: 10px; }
.chat-head .who .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.chat-head h3 { font-size: 14.5px; font-weight: 600; margin: 0; }
.chat-head .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--green-50);
  color: #126B43;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--r-xs);
}
.online::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
}
.msg-row { display: flex; gap: 10px; max-width: 78%; }
.msg-row.bot { align-self: flex-start; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-row .av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 10.5px;
}
.msg-row.bot .av { background: var(--blue); color: white; }
.msg-row.user .av { background: var(--surface-2); color: var(--ink-2); }
.bubble {
  background: white;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.msg-row.user .bubble {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.bubble strong { color: var(--blue-dark); font-weight: 600; }
.msg-row.user .bubble strong { color: white; }
.cite {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  background: white;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  font-weight: 500;
}
.cite .dotc {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.typing { display: inline-flex; gap: 3px; align-items: center; padding: 3px 0; }
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
  animation: blink 1.4s infinite ease-in-out both;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.suggestions {
  padding: 10px 18px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: white;
  border-top: 1px solid var(--line);
}
.suggestion {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--r);
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.suggestion:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }

.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--line);
}
.composer .field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 7px 12px;
  transition: border-color 0.12s;
}
.composer .field:focus-within { border-color: var(--blue); }
.composer input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
}
.composer input::placeholder { color: var(--muted-2); }
.composer .send {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: var(--blue);
  color: white;
  border: 0;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}
.composer .send:hover { background: var(--blue-dark); }
.composer .send:disabled { background: var(--line-strong); cursor: not-allowed; }

/* ────────────  LOGIN  ──────────── */

.login-wrap {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  padding: 24px;
  /* miękki indygo-gradient zamiast płaskiej szarości */
  background:
    radial-gradient(1100px 560px at 50% -12%, var(--blue-50) 0%, rgba(236,238,251,0) 62%),
    linear-gradient(180deg, #F5F6FE 0%, #EEF1FB 55%, #EAEDF8 100%);
}
/* delikatny wzór z symbolu „orbity" — bezszwowa mozaika w szachownicę */
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/orbit-pattern.svg");
  background-repeat: repeat;
  background-position: calc(50% - 52px) center;
  background-size: 300px 300px;
  opacity: 0.06;
  /* odbarwiamy indygo do szarości jak we wzorze referencyjnym */
  filter: grayscale(1);
  /* wycinamy DOKŁADNIE jedną orbitę — okrągła dziura w miejscu podświetlonego logo */
  -webkit-mask-image: radial-gradient(circle at 50% calc(50% - 195px), transparent 0, transparent 120px, #000 175px);
          mask-image: radial-gradient(circle at 50% calc(50% - 195px), transparent 0, transparent 120px, #000 175px);
}
/* Na telefonie kafelek 300px jest ogromny → 1-2 orbity. Zmniejszamy kafelek,
   żeby gęstość wyglądała jak na desktopie. Wersja PC (powyżej) bez zmian. */
@media (max-width: 600px) {
  .login-wrap::before {
    background-position: center;
    background-size: 165px 165px;
    -webkit-mask-image: radial-gradient(circle at 50% calc(50% - 188px), transparent 0, transparent 66px, #000 104px);
            mask-image: radial-gradient(circle at 50% calc(50% - 188px), transparent 0, transparent 66px, #000 104px);
  }
}
.login-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.login-logo {
  position: relative;
  z-index: 1;
  height: 72px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  /* „rozgrzana" orbita — pulsujące indygo światło */
  animation: orbitGlow 2.8s ease-in-out infinite;
}
@keyframes orbitGlow {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(54, 67, 186, 0.18));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(54, 67, 186, 0.60));
    transform: scale(1.05);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-logo { animation: none; }
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 28px 24px;
}
.login-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-50);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  margin-bottom: 14px;
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}
.login-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.55;
}
.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.login-form .input-wrap {
  display: flex;
  gap: 8px;
}
.login-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 15px;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  color: var(--ink);
  outline: none;
  text-transform: uppercase;
  transition: border-color 0.12s;
  background: white;
}
.login-form input::placeholder { color: var(--muted-2); text-transform: none; letter-spacing: 0; font-family: inherit; }
.login-form input:focus { border-color: var(--blue); }
.login-form input.error { border-color: var(--red); }
.login-form .err {
  font-size: 12.5px;
  color: var(--red);
  margin-top: 8px;
}
.login-help {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.login-help strong { color: var(--ink); font-weight: 600; }
.login-help code {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--ink);
}

/* ────────────  ADMIN  ──────────── */

.admin-head {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-head h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 2px;
  letter-spacing: -0.01em;
}
.admin-head .sub { font-size: 13px; color: var(--muted); }
.admin-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.admin-stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.admin-stat .lbl {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.admin-stat .val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.admin-stat .delta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.admin-table-wrap {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.admin-toolbar h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.admin-toolbar .search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 5px 10px;
  font-size: 13px;
  color: var(--muted);
}
.admin-toolbar .search input {
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  width: 180px;
  background: transparent;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink);
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--surface); }
.admin-table .name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-table .avx {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.admin-table .name-cell .meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
.admin-table .progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.admin-table .pbar {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  min-width: 80px;
}
.admin-table .pbar > i {
  display: block;
  height: 100%;
  background: var(--blue);
}
.admin-table .pbar.done > i { background: var(--green); }
.admin-table .pbar.warn > i { background: var(--orange); }
.admin-table .pnum {
  font-size: 12px;
  color: var(--muted);
  min-width: 48px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.admin-table .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs);
}
.admin-table .status-pill.green { background: var(--green-50); color: #126B43; }
.admin-table .status-pill.orange { background: var(--orange-50); color: #8C4B04; }
.admin-table .status-pill.gray { background: var(--surface-2); color: var(--muted); }
.admin-table .status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.admin-table .row-action {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-xs);
}
.admin-table .row-action:hover { background: var(--surface-2); color: var(--blue-dark); }

/* code distribution panel */
.admin-codes {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.admin-codes-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.admin-codes-list h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.code-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.code-row:first-of-type { border-top: 0; }
.code-row .c {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.code-row .for { color: var(--muted); font-size: 12.5px; }
.code-row .copy-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 11.5px;
}
.code-row .copy-btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.code-row .copy-btn.copied { background: var(--green-50); color: #126B43; border-color: #B6E3C7; }

/* ────────────  ANIMATIONS  ──────────── */

.fade-in {
  animation: fadeIn 0.18s ease-out both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ────────────  ANNOUNCEMENTS  ──────────── */

.ann-card {
  background: white;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ann-card.ann-prio-important {
  border-left-color: var(--orange);
  background: var(--orange-50);
}
.ann-card.ann-prio-event {
  border-left-color: var(--blue);
  background: var(--blue-50);
}
.ann-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ann-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.ann-badge.ann-prio-important { background: var(--orange); color: white; }
.ann-badge.ann-prio-event { background: var(--blue); color: white; }
.ann-date {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ann-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0 0;
}
.ann-body {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.55;
}
.ann-body ul, .ann-body ol { margin: 6px 0; padding-left: 22px; }
.ann-body li { margin-bottom: 2px; }
.ann-body b, .ann-body strong { font-weight: 700; color: var(--ink); }
.ann-body a { color: var(--blue); }
.ann-foot {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.ann-widget {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-top: 14px;
}
.ann-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
}
.ann-widget-head h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.ann-widget-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-btn {
  background: transparent;
  border: 0;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

.ann-page h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  color: var(--ink);
}
.ann-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ann-empty {
  font-size: 13.5px;
  color: var(--muted);
  margin: 8px 0;
}

/* admin section */
.admin-ann {
  margin-top: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}
.admin-ann > h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
}
.admin-ann > h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 8px;
  letter-spacing: 0.06em;
}
.admin-ann-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-ann-form h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
  letter-spacing: 0.06em;
}
.admin-ann-form input,
.admin-ann-form textarea,
.admin-ann-form select {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s;
}
.admin-ann-form input:focus,
.admin-ann-form textarea:focus,
.admin-ann-form select:focus { border-color: var(--blue); }
.admin-ann-form textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ── RichTextEditor ── */
.rte {
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: white;
  overflow: hidden;
}
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}
.rte-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.rte-btn:hover { background: var(--surface-2); }
.rte-btn.active {
  background: var(--blue);
  color: white;
}
.rte-btn.active:hover { background: var(--blue-dark); }
.rte-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}
.rte-emoji {
  position: absolute;
  top: 38px;
  right: 8px;
  z-index: 20;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 280px;
}
.rte-emoji-item {
  border: 0;
  background: transparent;
  font-size: 18px;
  padding: 4px;
  border-radius: var(--r-xs);
  cursor: pointer;
  line-height: 1;
}
.rte-emoji-item:hover { background: var(--surface-2); }
.rte-editor {
  min-height: 96px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
}
.rte-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted-2);
  pointer-events: none;
}
.rte-editor ul, .rte-editor ol { margin: 4px 0; padding-left: 22px; }
.rte-editor:focus { background: white; }
.rte:focus-within { border-color: var(--blue); }
.admin-ann-form-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.admin-ann-form-foot select { flex: 0 0 auto; min-width: 160px; }
.admin-ann-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-ann-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}
.btn-delete {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--red);
  border-radius: var(--r-xs);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-delete:hover { background: var(--red-50); border-color: var(--red); }

/* ────────────  STEP CONTENT (text / test)  ──────────── */

.step-text { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.st-p { margin: 0 0 14px; }
.st-list { margin: 0 0 16px; padding-left: 22px; }
.st-list li { margin-bottom: 6px; }
.st-figure { margin: 4px 0 16px; }
.st-figure img {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.st-figure figcaption {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 7px;
}
.st-iconlist {
  list-style: none;
  margin: 4px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-iconlist li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 14px;
}
.st-iconlist .ili-ic { font-size: 20px; flex: none; line-height: 1; }
.st-iconlist .ili-tx { font-size: 14px; font-weight: 500; color: var(--ink); }

/* interaktywne zdjęcie z hotspotami */
.imghot-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
  margin: 4px 0 16px;
}
.imghot-stage { position: relative; line-height: 0; }
.imghot-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.imghot-stage .hotspot {
  width: 28px;
  height: 28px;
  font-size: 13px;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.imghot-stage .hotspot:hover { transform: translate(-50%, -50%) scale(1.12); }
.imghot-stage .hotspot.active { transform: translate(-50%, -50%); }
/* wariant „wide": szerokie zdjęcie na całą szerokość, legenda pod spodem (siatka) */
.imghot-wrap.wide { grid-template-columns: 1fr; }
.imghot-wrap.wide .legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px 18px;
}
@media (max-width: 640px) {
  .imghot-wrap { grid-template-columns: 1fr; }
  .imghot-wrap.wide .legend { grid-template-columns: 1fr; }
}
.st-callout {
  background: var(--blue-50);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-xs);
  padding: 12px 16px;
  margin: 4px 0 16px;
  font-size: 13.5px;
  color: var(--blue-dark);
}
.st-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 4px 0 16px;
}
.st-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
}
.st-card-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.st-card-value { font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.st-card-value a { color: var(--blue); text-decoration: none; overflow-wrap: anywhere; }
.st-card-value a:hover { text-decoration: underline; }

/* normy dźwigania — dwie kolumny (Kobiety / Mężczyźni) z podsekcjami */
.st-norms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 4px 0 16px;
}
.st-norm-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}
.st-norm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.st-norm-head .ico { font-size: 20px; }
.st-norm-section { margin-bottom: 12px; }
.st-norm-section:last-child { margin-bottom: 0; }
.st-norm-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.st-norm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.st-norm-row .nm-label { font-size: 13.5px; color: var(--ink-2); }
.st-norm-row .nm-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-dark);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .st-norms { grid-template-columns: 1fr; }
}

/* kody sektorów (Universy) — panel na każdy universe, kod jako kolorowa plakietka */
.st-sectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 4px 0 16px;
  align-items: start;
}
.st-sector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sector-accent, var(--blue));
  border-radius: var(--r);
  padding: 14px 16px;
}
.st-sector-name {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--sector-accent, var(--ink));
  margin-bottom: 10px;
}
.st-sector-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
}
.st-sector-code {
  flex: none;
  min-width: 30px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--sector-accent, var(--blue));
  border-radius: 6px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}
.st-sector-label { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* test */
.step-test { display: flex; flex-direction: column; gap: 18px; }
.test-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--blue-50);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px;
}
.test-intro .ti-emoji { font-size: 26px; line-height: 1; flex: none; }
.test-intro .ti-title { font-size: 15px; font-weight: 700; color: var(--blue-dark); }
.test-intro .ti-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tr-emoji { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.qst-q { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.qst-opts { display: flex; flex-direction: column; gap: 8px; }
.qst-opt {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.qst-opt:hover:not(:disabled) { border-color: var(--blue); }
.qst-opt.picked { border-color: var(--blue); background: var(--blue-50); color: var(--blue-dark); font-weight: 600; }
.qst-opt.correct { border-color: var(--green); background: var(--green-50); color: var(--green); font-weight: 600; }
.qst-opt.wrong { border-color: var(--red); background: var(--red-50); color: var(--red); }
.qst-opt:disabled { cursor: default; }
.test-result {
  border-radius: var(--r);
  padding: 16px 18px;
  text-align: center;
}
.test-result.pass { background: var(--green-50); }
.test-result.fail { background: var(--red-50); }
.tr-score { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.test-result.pass .tr-msg { color: var(--green); font-weight: 600; }
.test-result.fail .tr-msg { color: var(--red); font-weight: 600; margin-bottom: 12px; }

/* ────────────  MODAL  ──────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}
.modal {
  background: white;
  border-radius: 8px;
  padding: 24px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--ink);
}
.modal-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: -12px 0 18px;
}
.login-pin-row { margin-top: 14px; }
.modal-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 12px;
}
.modal-label:first-of-type { margin-top: 0; }
.modal-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.modal-input:focus { border-color: var(--blue); background: white; }
.modal-err {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--red-50);
  color: var(--red);
  font-size: 13px;
  border-radius: var(--r-xs);
}
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.modal-wide { max-width: 520px; }

/* code-row: dwie akcje obok siebie */
.code-row-actions {
  display: flex;
  gap: 6px;
}

/* worker detail modal */
.wd-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.wd-code {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.wd-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  line-height: 1;
}
.wd-close:hover { background: var(--surface-2); color: var(--ink); }
.wd-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.wd-modules {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.wd-module {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.wd-module:first-child { border-top: 0; }
.wd-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
}
.wd-dot.wd-done { background: var(--green); color: white; }
.wd-dot.wd-progress { background: var(--orange); color: white; }
.wd-mod-title { color: var(--ink); font-weight: 500; }
.wd-mod-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.wd-foot { justify-content: space-between; }

.modal-result { text-align: center; }
.modal-result .modal-title { text-align: center; margin-top: 6px; }
.modal-ok-icon {
  width: 48px;
  height: 48px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
}
.result-name {
  font-size: 16px;
  color: var(--ink-2);
  margin: 16px 0 8px;
}
.result-code {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--blue-50);
  border: 1px dashed var(--blue);
  border-radius: var(--r);
  padding: 14px 20px;
  margin: 0 auto 4px;
  display: inline-block;
}

/* ────────────  PRINT CARD (A4)  ──────────── */

.print-area { display: none; }

@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }

  .print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 40px 60px;
    box-sizing: border-box;
    background: white;
    color: #000;
    font-family: "Archivo", system-ui, sans-serif;
  }

  @page { size: A4; margin: 0; }
}

.pc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid #3643BA;
  margin-bottom: 28px;
}
.pc-decathlon {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #3643BA;
}
.pc-divider {
  height: 22px;
  width: 1px;
  background: #555;
}
.pc-loc {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
.pc-h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 28px;
  color: #000;
}
.pc-block { margin-bottom: 22px; }
.pc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #666;
  margin-bottom: 6px;
}
.pc-name { font-size: 20px; font-weight: 600; color: #000; }
.pc-code-block { margin: 30px 0; }
.pc-code {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #3643BA;
  padding: 18px 24px;
  border: 3px solid #3643BA;
  border-radius: 8px;
  display: inline-block;
  background: #F3F4FD;
}
.pc-url {
  font-size: 16px;
  font-weight: 600;
  color: #3643BA;
  font-family: "Geist Mono", ui-monospace, monospace;
}
.pc-how {
  background: #F5F6FB;
  padding: 18px 22px;
  border-radius: 6px;
  margin-top: 30px;
}
.pc-intro {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: #333;
}
.pc-tabs {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1A1A1A;
}
.pc-tabs li {
  padding: 6px 0;
  border-top: 1px solid #e3eaf0;
}
.pc-tabs li:first-child { border-top: 0; padding-top: 2px; }
.pc-tabs strong {
  color: #3643BA;
  font-weight: 700;
  margin-right: 4px;
}
.pc-footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 11.5px;
  color: #777;
  font-style: italic;
}

/* ────────────  RESPONSIVE  ──────────── */

@media (max-width: 1024px) {
  .module-view { grid-template-columns: 1fr; }
  .chat-page { grid-template-columns: 1fr; }
  .sidebar, .chat-side { position: static; }
  .logipad-wrap { grid-template-columns: 1fr; }
  .module-row { grid-template-columns: 4px 32px 1.4fr 1fr auto auto; }
  .module-row .stats { display: none; }
}

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-codes { grid-template-columns: 1fr; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
}

/* ── tablety w pionie / duże telefony w poziomie ── */
@media (max-width: 720px) {
  .container { padding: 16px 14px 32px; }

  /* nagłówek: bez sekcji opisowej, kompaktowa nawigacja, zostaje sam wylogout */
  .header-inner { padding: 0 14px; gap: 10px; }
  .brand-section, .brand-divider { display: none; }
  .nav button { padding: 5px 8px; font-size: 12.5px; }
  .header-right { gap: 6px; }
  .lang-btn { padding: 4px 8px; font-size: 11px; min-width: 26px; }
  .user-chip { gap: 0; }
  .user-chip .avatar, .user-chip .name { display: none; }
  .logout-btn { margin-left: 0; }

  /* tabela adminów: poziome przewijanie zamiast rozjeżdżania */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }

  .stat-row { grid-template-columns: 1fr; }
  .panel-head { grid-template-columns: 1fr; }
  .progress-card { border-left: 0; padding-left: 0; padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
  .lesson { padding: 18px 16px; }
  .module-row { grid-template-columns: 4px 28px 1fr auto; padding: 10px 12px 10px 0; }
  .module-row .desc, .module-row .stats { display: none; }
  .msg-row { max-width: 90%; }
  .welcome-head { padding: 18px; gap: 18px; }
  .welcome-head h1 { font-size: 22px; }
  .welcome-head .next-step-card { max-width: none; width: 100%; }
  .ann-page h2 { font-size: 20px; }
}

/* ── telefony: nagłówek w dwóch rzędach, nawigacja przewijana poziomo ── */
@media (max-width: 600px) {
  .header-inner {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 6px 12px;
    gap: 6px 10px;
  }
  .brand { order: 1; }
  .header-right { order: 2; margin-left: auto; }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 0 0 auto; white-space: nowrap; }

  /* modale na pełną szerokość, z własnym przewijaniem */
  .modal-backdrop { padding: 12px; }
  .modal { padding: 20px 18px; max-width: none; max-height: calc(100vh - 24px); overflow-y: auto; }
  .modal-wide { max-width: none; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; justify-content: center; }

  /* logipad: ciaśniejszy układ i mniejsze fonty, żeby zmieścić 4 kolumny */
  .logipad-wrap { padding: 14px; }
  .logipad { padding: 12px; }
  .logipad .lp-orow { gap: 7px; padding: 44px 2px 12px; }
  .logipad .lp-col-id .lp-zone { font-size: 14px; }
  .logipad .lp-col-counts .lp-dead { font-size: 15px; }
  .logipad .lp-col-counts .lp-count-main { font-size: 11.5px; }
  .logipad .lp-col-codes { font-size: 11px; line-height: 1.55; }
  .logipad .lp-col-cities { font-size: 11.5px; }
  .logipad .lp-meta, .logipad .lp-count-sec { font-size: 10px; }

  .st-cards { grid-template-columns: 1fr 1fr; }
  .lesson-foot { flex-wrap: wrap; gap: 10px; }

  /* formularz ogłoszeń admina */
  .admin-ann-form-foot { flex-direction: column; align-items: stretch; }
  .admin-ann-form-foot select { min-width: 0; width: 100%; }
}

/* ── małe telefony ── */
@media (max-width: 380px) {
  .brand-word { font-size: 13px; }
  .lang-btn { padding: 3px 7px; min-width: 24px; }
  .welcome-head h1 { font-size: 20px; }
  .st-cards { grid-template-columns: 1fr; }
}
