:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e8ecf3;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 10px 30px rgba(15, 23, 42, .07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ===== Brama logowania ===== */
.auth-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -5%, #dbe6ff 0%, rgba(219,230,255,0) 60%),
    radial-gradient(700px 500px at 90% 110%, #e7e0ff 0%, rgba(231,224,255,0) 55%),
    var(--bg);
}
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 44px 38px; max-width: 410px; width: 100%; text-align: center;
  box-shadow: var(--shadow);
}
.logo-tile {
  width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(140deg, #e8f0ff, #dbe6ff);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
}
.auth-title { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; }
.auth-lead { margin: 8px 0 2px; font-weight: 600; color: var(--text); }
.auth-sub { margin: 0 0 26px; color: var(--muted); font-size: .92rem; }
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 18px; border: 1px solid var(--line); border-radius: 13px;
  background: #fff; color: #1f2937; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .05s;
}
.google-btn:hover { box-shadow: var(--shadow); border-color: #cdd5e3; }
.google-btn:active { transform: translateY(1px); }
.auth-msg { color: var(--red); font-size: .85rem; min-height: 1em; margin: 14px 0 0; }
.auth-footer { color: var(--faint); font-size: .82rem; }

/* ===== Topbar ===== */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-tile {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; background: linear-gradient(140deg, #e8f0ff, #dbe6ff);
}
.brand-name { font-weight: 800; letter-spacing: -.01em; }
.brand-sub { font-size: .8rem; color: var(--muted); }
.userbar { display: flex; align-items: center; gap: 10px; }
.user-email { color: var(--muted); font-size: .85rem; }
.logout {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px;
  cursor: pointer; color: var(--text); font-size: .85rem; font-weight: 500; transition: border-color .15s;
}
.logout:hover { border-color: #cdd5e3; }
.tabs { display: flex; gap: 26px; padding: 4px 20px 0; }
.tab {
  background: none; border: none; padding: 10px 2px 14px; font-size: .98rem; color: var(--muted);
  cursor: pointer; border-bottom: 2.5px solid transparent; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

main { padding: 28px 0 72px; }
.panel { display: none; }
.panel.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Karty wydań ===== */
.releases { display: flex; flex-direction: column; gap: 16px; }
.release {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .05s;
}
.release:hover { box-shadow: var(--shadow); }
.release.is-latest { border-color: #c7d6ff; box-shadow: 0 0 0 1px #c7d6ff, var(--shadow); }
.release-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release-version { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.release-date { color: var(--faint); font-size: .82rem; margin-left: auto; }
.badge-new {
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--green); padding: 3px 9px; border-radius: 999px;
}
.chip {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: var(--brand);
}
.chip-dev { background: #fff2e0; color: var(--amber); }
.chip-beta { background: #eef2ff; color: var(--brand); }
.release-build { color: var(--faint); font-size: .8rem; margin-top: 2px; }
.release-notes { margin: 14px 0 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.release-notes li { position: relative; padding-left: 20px; color: #334155; font-size: .94rem; }
.release-notes li::before {
  content: ""; position: absolute; left: 4px; top: .55em; width: 6px; height: 6px;
  border-radius: 50%; background: #cbd5e1;
}
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: 9px 16px; border-radius: 11px; box-shadow: 0 4px 14px rgba(37,99,235,.25);
  transition: background .15s, transform .05s;
}
.dl-btn:hover { background: var(--brand-dark); }
.dl-btn:active { transform: translateY(1px); }
.release.is-latest .dl-btn { }
.release:not(.is-latest) .dl-btn { background: #eef2ff; color: var(--brand); box-shadow: none; }
.release:not(.is-latest) .dl-btn:hover { background: #e2e8ff; }

/* ===== Dokumentacja ===== */
.docs-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.docs-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 110px; align-self: start; }
.docs-nav button {
  text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; color: var(--text); font-size: .95rem;
}
.docs-nav button:hover { background: #eef1f7; }
.docs-nav button.active { background: #eaf0ff; color: var(--brand); font-weight: 600; }
.markdown {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px;
  box-shadow: var(--shadow-sm); line-height: 1.65;
}
.markdown h1, .markdown h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; letter-spacing: -.01em; }
.markdown table { border-collapse: collapse; width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.markdown code { background: #eef1f7; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.markdown pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 12px; overflow: auto; }
.markdown pre code { background: none; color: inherit; }

/* ===== Wymagania / Bugi ===== */
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row .composer-btn { margin-left: auto; }
.composer-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; background: var(--card); color: var(--text);
}
.composer-input:focus, .composer-textarea:focus, .composer-select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.composer-textarea {
  width: 100%; min-height: 74px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--card); color: var(--text);
}
.composer-select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--card); }
.composer-btn {
  padding: 12px 20px; border: none; border-radius: 12px; background: var(--brand); color: #fff;
  font-weight: 600; cursor: pointer; transition: background .15s, transform .05s;
}
.composer-btn:hover { background: var(--brand-dark); }
.composer-btn:active { transform: translateY(1px); }

.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filter {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 500;
}
.filter:hover { border-color: #cdd5e3; }
.filter.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.entry-done { opacity: .6; }
.entry-done .entry-text { text-decoration: line-through; }
.entry-head { display: flex; align-items: center; gap: 10px; }
.entry-check { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.entry-title { font-size: 1rem; font-weight: 600; }
.entry-desc { margin: 8px 0 0; color: #334155; font-size: .92rem; white-space: pre-wrap; }
.loc { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: var(--muted); }
.entry-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.author { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: var(--brand); }
.author-me { background: #e6f7ee; color: var(--green); }
.entry-date { font-size: .78rem; color: var(--faint); }
.edited { font-size: .76rem; color: var(--muted); font-style: italic; }
.entry.editing { display: flex; flex-direction: column; gap: 10px; border-color: #c7d6ff; box-shadow: 0 0 0 1px #c7d6ff, var(--shadow-sm); }
.bug-status { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.st-open { background: #fde8e8; color: var(--red); }
.st-done { background: #e6f7ee; color: var(--green); }
.sev { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; }
.sev-low { background: #eef2ff; color: var(--brand); }
.sev-mid { background: #fff2e0; color: var(--amber); }
.sev-high { background: #fde8e8; color: var(--red); }
.entry-del, .entry-toggle {
  margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: .78rem; cursor: pointer; color: var(--muted);
}
.entry-toggle { margin-left: 0; }
.entry-del:hover, .entry-toggle:hover { border-color: #cdd5e3; color: var(--text); }

/* ===== Tablica (Excalidraw) ===== */
.board-status { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.board-canvas {
  height: 76vh; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative; background: #fff;
  /* poza wąską kolumnę — szersza tablica, wyśrodkowana względem okna */
  width: 94vw; max-width: 1500px; left: 50%; transform: translateX(-50%);
}
.board-canvas .excalidraw { height: 100%; }
.mindmap-colors { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mm-label { font-size: .85rem; color: var(--muted); margin-right: 4px; }
.swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.08); }

/* ===== Komentarze ===== */
.comments { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.comment-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.comment { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.comment-text { flex: 1; color: #334155; }
.comment-del {
  background: none; border: none; color: var(--faint); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px;
}
.comment-del:hover { color: var(--red); }
.comment-row { display: flex; gap: 8px; }
.comment-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit;
  background: var(--card); color: var(--text); font-size: .9rem;
}
.comment-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.comment-btn {
  border: 1px solid var(--line); background: #eef2ff; color: var(--brand); border-radius: 10px;
  padding: 8px 14px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.comment-btn:hover { background: #e2e8ff; }

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

@media (max-width: 640px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .brand-sub { display: none; }
}
