:root {
  --navy: #233163;
  --navy-2: #18203a;
  --navy-3: #36447c;
  --coral: #f05a41;
  --coral-dark: #d84a34;
  --coral-pale: #fff2ef;
  --ink: #18203a;
  --muted: #687087;
  --soft: #f5f7fc;
  --line: #e4e8f1;
  --white: #fff;
  --good: #247a61;
  --good-soft: #ecf9f4;
  --good-line: #d1f0e3;
  --bad: #a6382a;
  --bad-soft: #fdecea;
  --bad-line: #f7d6d0;
  --info: #2b5fa8;
  --info-soft: #eef3fc;
  --info-line: #d8e3f6;
  --shadow: 0 24px 70px rgba(29, 42, 90, .11);
  --shadow-soft: 0 10px 32px rgba(29, 42, 90, .08);
  --radius: 22px;
  color-scheme: light;
  font-family: Aptos, "Segoe UI", Inter, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7f8fc; color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --------------------------------------------------------------- topbar -- */
.topbar {
  height: 76px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(225,229,239,.9);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); text-decoration: none; }
.brand-logo { width: 40px; height: 40px; display: block; flex: 0 0 auto; object-fit: contain; }
.brand-copy { display: flex; align-items: baseline; gap: 5px; letter-spacing: -.02em; }
.brand-copy strong { font-size: 18px; }
.brand-copy small { color: var(--coral); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.brand.light { color: #fff; }

.topnav { display: flex; align-items: center; gap: 4px; margin-right: auto; margin-left: 14px; }
.topnav a { padding: 9px 14px; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; transition: background .18s, color .18s; }
.topnav a:hover { color: var(--navy); background: var(--soft); }
.topnav a.current { color: var(--coral); background: var(--coral-pale); }

.topbar-actions, .user-menu { display: flex; align-items: center; }
.topbar-actions { gap: 22px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--good); background: var(--good-soft); border: 1px solid var(--good-line); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.privacy-pill svg { width: 16px; height: 16px; }
.user-menu { gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--navy), var(--navy-3)); font-size: 12px; font-weight: 800; box-shadow: 0 5px 16px rgba(35,49,99,.2); }
.user-copy { display: grid; line-height: 1.2; min-width: 120px; }
.user-copy strong { font-size: 12px; }
.user-copy small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.logout-link { color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; padding: 8px; }
.logout-link:hover { color: var(--coral); }

/* ------------------------------------------------------------------ hero -- */
main { width: min(1440px, 100%); margin: 0 auto; }
.hero { padding: clamp(48px, 6vw, 86px) clamp(22px, 6vw, 88px) 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 60px; position: relative; overflow: hidden; }
.hero.compact { padding-top: clamp(36px, 4vw, 58px); padding-bottom: 30px; }
.hero::after { content: ""; position: absolute; width: 370px; height: 370px; border: 90px solid rgba(240,90,65,.045); border-radius: 50%; right: -175px; top: -210px; pointer-events: none; }
.hero-copy { max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow i { width: 19px; height: 2px; background: currentColor; border-radius: 3px; }
.eyebrow.light { color: #ff9684; }
.hero h1 { margin: 17px 0 18px; color: var(--navy); font-size: clamp(38px, 4.5vw, 66px); line-height: .99; letter-spacing: -.052em; }
.hero.compact h1 { font-size: clamp(32px, 3.4vw, 50px); }
.hero h1 span { color: var(--coral); }
.hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.hero-signature { margin-top: 18px !important; color: var(--navy) !important; font-size: 13px !important; font-weight: 800; letter-spacing: .02em; }
.hero-signature::before { content: "— "; color: var(--coral); }

.steps { list-style: none; margin: 0; padding: 0 0 5px; display: flex; align-items: center; flex: 0 0 auto; }
.steps li { display: flex; align-items: center; gap: 10px; position: relative; min-width: 128px; }
.steps li:not(:last-child)::after { content: ""; width: 32px; height: 1px; background: var(--line); margin: 0 15px; }
.steps li > span { width: 31px; height: 31px; border: 1px solid var(--line); background: #fff; color: #98a0b5; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; transition: .25s ease; }
.steps li div { display: grid; line-height: 1.2; }
.steps li strong { font-size: 11px; color: #7b8398; }
.steps li small { color: #a2a9ba; font-size: 9px; margin-top: 3px; }
.steps li.active > span, .steps li.done > span { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 5px 15px rgba(240,90,65,.25); }
.steps li.active strong, .steps li.done strong { color: var(--navy); }
.steps li.done > span { font-size: 0; }
.steps li.done > span::after { content: "✓"; font-size: 12px; }

.export-actions { display: flex; gap: 10px; flex: 0 0 auto; padding-bottom: 6px; }

/* --------------------------------------------------------------- panele -- */
.workspace { padding: 0 clamp(22px, 6vw, 88px) 90px; }
.panel { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.submit-workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .7fr); gap: 22px; align-items: start; }
.track-workspace { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(0, 1.4fr); gap: 22px; align-items: start; }
.form-panel, .side-panel, .result-panel { padding: clamp(24px, 3vw, 38px); }
.side-panel { display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 28px; }
.panel-heading.compact { margin-bottom: 20px; }
.panel-index { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--coral); background: var(--coral-pale); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 18px; letter-spacing: -.02em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ------------------------------------------------------------------ pola -- */
.field { display: grid; margin-bottom: 20px; }
.field > label { color: var(--navy); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.field > label b { color: var(--coral); font-weight: 800; }
.field > label .optional { color: var(--muted); font-weight: 650; font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; color: var(--ink); background: #fafbfe;
  border: 1px solid #dce1ec; border-radius: 12px; font-size: 13px; line-height: 1.55;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(240,90,65,.11); background: #fff; }
.field input.invalid, .field textarea.invalid, .field select.invalid { border-color: var(--coral); background: var(--coral-pale); }
.field select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #8e96aa 50%), linear-gradient(135deg, #8e96aa 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.field-hint { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.field-hint i { color: #a0a7b8; font-style: normal; font-size: 9px; flex: 0 0 auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.code-input { font-family: "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; }

.always-removed { display: grid; gap: 9px; padding: 16px; border-radius: 14px; background: #f2faf7; color: #39745f; margin-bottom: 14px; }
.always-removed span { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; font-weight: 650; line-height: 1.4; }
.always-removed svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; stroke-width: 2.5; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row.slim { padding: 6px 2px; border: 0; }
.toggle-row > span { display: grid; }
.toggle-row strong { font-size: 12px; color: var(--navy); }
.toggle-row small { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.45; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { width: 39px; height: 22px; padding: 3px; border-radius: 99px; background: #d8dce7; transition: .2s; flex: 0 0 auto; }
.toggle-row i::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(27,35,62,.25); transition: transform .2s; }
.toggle-row input:checked + i { background: var(--navy); }
.toggle-row input:checked + i::after { transform: translateX(17px); }
.toggle-row input:focus-visible + i { outline: 3px solid rgba(240,90,65,.25); }

.mode-notice { margin-top: 16px; padding: 12px; border: 1px solid #f5d9a6; background: #fff9ed; border-radius: 12px; color: #8b641e; display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.5; }
.mode-notice svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.mode-notice em { font-style: normal; font-weight: 700; }

.source-meta { margin: 20px 0 0; display: grid; gap: 10px; }
.source-meta div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.source-meta dt { color: #9299aa; font-size: 10px; }
.source-meta dd { margin: 0; color: var(--navy); font-size: 11px; font-weight: 750; text-align: right; }

.edit-hint { margin-top: 18px; padding: 14px 0 0; display: flex; gap: 11px; border-top: 1px solid var(--line); }
.edit-hint svg { flex: 0 0 auto; width: 17px; color: var(--coral); }
.edit-hint strong { color: var(--navy); font-size: 11px; }
.edit-hint p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.edit-hint a { color: var(--coral); font-weight: 700; }

/* -------------------------------------------------------------- przyciski -- */
.primary-button, .secondary-button, .ghost-button, .microsoft-button {
  border: 0; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px; font-weight: 800;
  transition: transform .18s, box-shadow .18s, background .18s, opacity .18s, border-color .18s;
}
.primary-button { min-height: 50px; padding: 0 20px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--coral), #f47760); box-shadow: 0 10px 24px rgba(240,90,65,.24); font-size: 14px; }
.form-panel > .primary-button { width: 100%; margin-top: 6px; }
.primary-button svg { width: 18px; height: 18px; }
.primary-button:hover:not(:disabled), .microsoft-button:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(240,90,65,.3); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.primary-button.export { min-height: 44px; padding: 0 17px; font-size: 12px; }
.secondary-button { min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); box-shadow: 0 6px 18px rgba(35,49,99,.06); font-size: 12px; }
.secondary-button:hover { border-color: #c9cfdd; transform: translateY(-1px); }
.secondary-button svg { width: 16px; height: 16px; }
.ghost-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 11px; }
.ghost-button:hover { color: var(--navy); border-color: #c9cfdd; }
.ghost-button.danger:hover { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.processing-caption { margin: 12px 0 0; text-align: center; color: #9aa2b4; font-size: 10px; line-height: 1.5; }

/* -------------------------------------------------------- karta sukcesu -- */
.success-card { margin: 0 clamp(22px, 6vw, 88px) 100px; padding: clamp(34px, 5vw, 62px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; display: grid; place-items: center; }
.success-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; color: #fff; background: linear-gradient(145deg, #3aaa7d, #2c8f68); box-shadow: 0 12px 28px rgba(45,143,104,.28); margin-bottom: 22px; }
.success-mark svg { width: 28px; height: 28px; stroke-width: 2.6; }
.success-card h2 { margin: 12px 0 10px; color: var(--navy); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.035em; }
.success-card > p { margin: 0; max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.code-box { margin: 30px 0 12px; padding: 20px 22px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; border: 1.5px dashed #cdd3e2; border-radius: 18px; background: linear-gradient(145deg, #fafbfe, #f5f7fc); }
.code-box code { max-width: 100%; color: var(--navy); font-family: "Cascadia Mono", Consolas, monospace; font-size: clamp(20px, 3vw, 30px); font-weight: 700; letter-spacing: .1em; overflow-wrap: anywhere; }
.code-caption { margin: 0; color: var(--muted); font-size: 11px; }
.success-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------- filtry -- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.field.inline { margin: 0; flex: 1 1 180px; }
.field.inline > label, .field.inline > span { color: #9299aa; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.field.inline input, .field.inline select { padding: 10px 12px; font-size: 12px; border-radius: 10px; }
.field.inline select { background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; }

/* ------------------------------------------------------ tablica pomysłów -- */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; align-items: start; }
/* Elementy siatki i flexa mają domyślnie `min-width: auto`, więc długa treść
   rozpycha je ponad szerokość kolumny. `min-width: 0` przywraca zawijanie. */
.idea-card { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); transition: transform .18s, box-shadow .18s; }
.idea-card > * { min-width: 0; }
.idea-card:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(29,42,90,.12); }
.idea-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.idea-card h3 { margin: 8px 0 0; color: var(--navy); font-size: 16px; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.idea-card .track-body { margin: 0; font-size: 12px; }
.category-chip { min-width: 0; display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--navy); font-size: 10px; font-weight: 750; overflow-wrap: anywhere; }
.status-chip { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.status-chip.neutral { background: var(--soft); color: var(--muted); border-color: var(--line); }
.status-chip.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.status-chip.good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.status-chip.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
/* Archiwum — sprawa zamknięta, karta ma być wyraźnie spokojniejsza wizualnie. */
.archive-chip { flex: 0 0 auto; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid #d9d2c4; background: #f6f2e9; color: #7a6a4a; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.admin-card.archived { background: #fbfbfd; border-style: dashed; }
.admin-card.archived .admin-card-head h2 { color: var(--muted); }
.pending-badge { min-width: 20px; padding: 2px 7px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 800; }
.secondary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.archive-note { margin: 16px 0 0; padding: 13px 15px; border: 1px solid #e7dfcd; border-radius: 12px; background: #fbf8f1; color: #7a6a4a; font-size: 11px; line-height: 1.55; }
.track-head-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }

.idea-card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.idea-meta { min-width: 0; color: #9299aa; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
/* `margin-left: auto` trzyma przycisk przy prawej krawędzi także wtedy, gdy
   długi podpis autora zepchnie go do własnej linii. */
.vote-button { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 800; cursor: pointer; transition: .18s; }
.vote-button svg { width: 16px; height: 16px; }
.vote-button:hover { border-color: var(--coral); color: var(--coral); transform: translateY(-1px); }
.vote-button.voted { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(240,90,65,.24); }
.vote-button:disabled { opacity: .5; cursor: progress; }
.vote-count { display: inline-flex; align-items: center; gap: 6px; color: var(--coral); font-size: 12px; font-weight: 800; }

.empty-state { padding: 70px 24px; text-align: center; display: grid; place-items: center; }
.empty-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; color: var(--coral); background: var(--coral-pale); margin-bottom: 18px; }
.empty-mark svg { width: 28px; height: 28px; }
.empty-state h2 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-state a { color: var(--coral); font-weight: 700; }

/* --------------------------------------------------------- śledzenie -- */
.result-panel { min-width: 0; display: grid; gap: 4px; }
.track-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.track-head > div { min-width: 0; }
.track-head h2 { margin: 6px 0 0; color: var(--navy); font-size: clamp(20px, 2.4vw, 27px); letter-spacing: -.035em; overflow-wrap: anywhere; }
.result-kicker { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.track-meta { margin: 8px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.track-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.track-section:last-child { border-bottom: 0; padding-bottom: 0; }
.track-section h3 { margin: 0 0 10px; color: var(--navy); font-size: 12px; letter-spacing: .02em; }
/* `pre-wrap` zachowuje akapity autora, ale samo nie łamie długich ciągów bez
   spacji (linki, ścieżki, nazwy plików) — bez `overflow-wrap` taki ciąg
   wychodziłby poza kartę. */
.track-body { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-section { min-width: 0; margin-top: 14px; }
.idea-section > strong { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 6px; }
.idea-card .idea-section { margin-top: 4px; }
.idea-card .idea-section .track-body { font-size: 12px; }
.benefit-box { margin: 14px 0 0; padding: 14px 16px; border: 1px solid #ffddd6; border-radius: 14px; background: var(--coral-pale); }
.benefit-box strong { display: block; color: var(--coral); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 7px; }
.benefit-box p { margin: 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.author-line { margin: 14px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.author-line strong { color: var(--navy); }

.thread { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.thread li { min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); }
.thread li.admin { border-color: var(--info-line); background: var(--info-soft); }
.thread-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.thread-head strong { color: var(--navy); font-size: 11px; }
.thread-head small { color: #9299aa; font-size: 10px; }
.thread p { margin: 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-empty { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.reply-form { display: grid; gap: 12px; justify-items: start; }
.reply-form textarea { width: 100%; resize: vertical; padding: 13px 14px; color: var(--ink); background: #fafbfe; border: 1px solid #dce1ec; border-radius: 12px; font-size: 12px; line-height: 1.6; outline: none; transition: border-color .2s, box-shadow .2s; }
.reply-form textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(240,90,65,.11); background: #fff; }

/* ----------------------------------------------------------- panel admina -- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-tile { padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.stat-tile dt { color: #9299aa; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.stat-tile dd { margin: 9px 0 0; color: var(--navy); font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat-tile dd span { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0; margin-left: 6px; }
.stat-tile.accent dd { color: var(--coral); }

.stat-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 26px; }
.chart-panel { padding: 24px; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.bar-list span { color: var(--navy); font-size: 11px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list b { color: var(--navy); font-size: 12px; font-weight: 800; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), #ff927f); transition: width .4s ease; }
.bar-track.navy i { background: linear-gradient(90deg, var(--navy), var(--navy-3)); }

.admin-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.admin-card { min-width: 0; padding: 26px; }
.admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.admin-card-head > div:first-child { min-width: 0; }
.admin-card-head h2 { margin: 6px 0 0; color: var(--navy); font-size: 19px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.admin-card-side { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.admin-controls { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.admin-controls .field.inline { flex: 0 0 190px; display: flex; align-items: center; gap: 10px; }
.admin-controls .field.inline > span { margin: 0; flex: 0 0 auto; }
.admin-controls .field.inline select { flex: 1; }
.admin-thread { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ toast -- */
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%); min-width: min(440px, calc(100vw - 32px)); max-width: 600px; padding: 13px 14px 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; background: var(--navy-2); border-radius: 12px; box-shadow: 0 15px 45px rgba(18,25,50,.3); font-size: 12px; animation: toast-in .25s ease-out; }
.toast.error { background: var(--bad); }
.toast.success { background: var(--good); }
.toast button { border: 0; background: transparent; color: currentColor; font-size: 20px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------------------------------------------------------------- login -- */
.login-body { min-height: 100vh; background: var(--navy); }
.login-layout { width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr); }
.login-intro { padding: clamp(35px, 6vw, 90px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: var(--navy); position: relative; overflow: hidden; }
.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-intro::before { width: 480px; height: 480px; border: 100px solid rgba(255,255,255,.035); left: -280px; bottom: -260px; }
.login-intro::after { width: 350px; height: 350px; border: 70px solid rgba(240,90,65,.11); right: -230px; top: -210px; }
.login-intro > * { position: relative; z-index: 1; }
.login-intro h1 { margin: 17px 0 20px; max-width: 690px; font-size: clamp(44px, 5.7vw, 76px); line-height: .98; letter-spacing: -.055em; }
.login-intro > div p { max-width: 600px; margin: 0; color: #cbd1e3; font-size: 16px; line-height: 1.7; }
.login-intro ul { list-style: none; margin: 50px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 25px 35px; color: #dfe3f0; font-size: 11px; }
.login-intro li { display: flex; align-items: center; gap: 9px; }
.login-intro li span { color: #ff927f; font-weight: 800; }
.login-card { background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(45px, 8vw, 120px); }
.microsoft-icon, .microsoft-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.microsoft-icon { width: 47px; height: 47px; margin-bottom: 35px; }
.microsoft-mini { width: 17px; height: 17px; gap: 1.5px; }
.microsoft-icon i:nth-child(1), .microsoft-mini i:nth-child(1) { background: #f25022; }
.microsoft-icon i:nth-child(2), .microsoft-mini i:nth-child(2) { background: #7fba00; }
.microsoft-icon i:nth-child(3), .microsoft-mini i:nth-child(3) { background: #00a4ef; }
.microsoft-icon i:nth-child(4), .microsoft-mini i:nth-child(4) { background: #ffb900; }
.login-card h2 { margin: 13px 0 10px; color: var(--navy); font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -.045em; }
.login-card > p { margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.microsoft-button { width: 100%; min-height: 56px; padding: 0 20px; border-radius: 13px; color: #fff; background: var(--navy); box-shadow: 0 10px 25px rgba(35,49,99,.22); }
.microsoft-button > svg { margin-left: auto; }
.login-footnote { margin-top: 24px; color: #9299ac; font-size: 10px; line-height: 1.55; }
.login-error { width: 100%; margin: -12px 0 20px; padding: 13px; border: 1px solid #ffd4cb; border-radius: 10px; color: var(--bad); background: var(--coral-pale); font-size: 11px; line-height: 1.5; }

.error-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--soft); }
.error-card { width: min(480px, 100%); padding: 45px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.error-code { width: 58px; height: 58px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--coral-pale); color: var(--coral); font-size: 28px; font-weight: 800; }
.error-card h1 { color: var(--navy); margin: 0; }
.error-card p { color: var(--muted); line-height: 1.6; margin-bottom: 28px; }

/* ------------------------------------------------------------ responsywność -- */
@media (max-width: 1180px) {
  .topnav { order: 3; width: 100%; }
  .submit-workspace, .track-workspace { grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); }
}

@media (max-width: 1100px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .steps { align-self: stretch; justify-content: space-between; }
  .steps li { min-width: 0; }
  .track-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar { height: auto; padding: 12px 18px; flex-wrap: wrap; row-gap: 10px; }
  .topnav { margin: 0; order: 3; overflow-x: auto; }
  .privacy-pill, .user-copy { display: none; }
  .hero { padding-top: 34px; }
  .hero h1 br { display: none; }
  .steps { overflow-x: auto; padding-bottom: 8px; }
  .steps li:not(:last-child)::after { width: 18px; margin: 0 9px; }
  .submit-workspace { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .admin-card-head, .track-head { flex-direction: column; }
  .export-actions { width: 100%; }
  .export-actions a { flex: 1; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 55vh; gap: 80px; }
  .login-card { min-height: 45vh; padding: 50px clamp(25px, 10vw, 90px); }
}

@media (max-width: 560px) {
  .brand-copy small { display: none; }
  .hero, .workspace { padding-left: 16px; padding-right: 16px; }
  .success-card { margin-left: 16px; margin-right: 16px; padding: 28px 20px; }
  .hero { padding-bottom: 26px; }
  .hero h1 { font-size: 36px; }
  .steps li div { display: none; }
  .steps li { gap: 0; flex: 1; }
  .steps li:not(:last-child)::after { flex: 1; width: auto; }
  .panel { border-radius: 18px; }
  .form-panel, .side-panel, .result-panel, .admin-card { padding: 21px; }
  .idea-grid { grid-template-columns: 1fr; }
  .code-box { flex-direction: column; gap: 14px; }
  .success-actions { flex-direction: column-reverse; width: 100%; }
  .success-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
