/* ================= Ráérünk? – stílus ================= */

:root {
  --page: #f5f5f2;
  --card: #ffffff;
  --card-2: #f7f8f9;
  --ink: #191b1f;
  --ink-2: #565a63;
  --muted: #8b8e97;
  --line: rgba(15, 18, 24, 0.10);
  --line-soft: rgba(15, 18, 24, 0.06);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 120, 214, 0.10);

  --yes: #0ca30c;
  --maybe: #fab219;
  --no: #d03b3b;
  --yes-soft: rgba(12, 163, 12, 0.13);
  --maybe-soft: rgba(250, 178, 25, 0.18);
  --no-soft: rgba(208, 59, 59, 0.10);

  --wk: rgba(15, 18, 24, 0.030);
  --event-tint: rgba(42, 120, 214, 0.07);
  --today: rgba(42, 120, 214, 0.14);

  --shadow: 0 1px 2px rgba(10, 14, 20, 0.05), 0 8px 28px rgba(10, 14, 20, 0.07);
  --shadow-pop: 0 4px 16px rgba(10, 14, 20, 0.14), 0 16px 48px rgba(10, 14, 20, 0.18);
  --radius: 16px;

  --name-w: 200px;
  --cell-w: 40px;
  --row-h: 46px;
  --month-h: 30px;
  --dayhead-h: 50px;
  --sum-h: 40px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0f12;
    --card: #17191f;
    --card-2: #1d2028;
    --ink: #eef0f4;
    --ink-2: #b3b8c2;
    --muted: #7e828c;
    --line: rgba(255, 255, 255, 0.10);
    --line-soft: rgba(255, 255, 255, 0.06);
    --accent: #3987e5;
    --accent-soft: rgba(57, 135, 229, 0.16);

    --yes-soft: rgba(12, 163, 12, 0.20);
    --maybe-soft: rgba(250, 178, 25, 0.20);
    --no-soft: rgba(208, 59, 59, 0.18);

    --wk: rgba(255, 255, 255, 0.030);
    --event-tint: rgba(57, 135, 229, 0.10);
    --today: rgba(57, 135, 229, 0.22);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-pop: 0 4px 16px rgba(0, 0, 0, 0.5), 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

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

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

/* ---------- betöltés ---------- */

.boot-spinner {
  margin: 40vh auto 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- általános elemek ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 550;
  font-size: 14px;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--card-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.danger { color: var(--no); border-color: var(--no-soft); }
.btn.danger:hover { background: var(--no-soft); border-color: var(--no); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- icons ---------- */

.ic {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
  stroke-width: 2;
}
.btn .ic { width: 16px; height: 16px; vertical-align: middle; }
.btn.small .ic { width: 14px; height: 14px; }
.btn.icon-only { padding: 6px; width: 30px; height: 30px; justify-content: center; }
.btn.icon-only .ic { width: 16px; height: 16px; }
.chip .ic { width: 13px; height: 13px; vertical-align: -0.12em; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 64px; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- landing ---------- */

.landing {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  width: 100%;
}

.hero { text-align: center; margin-bottom: 40px; }
.hero .logo-dots { display: inline-flex; gap: 8px; margin-bottom: 18px; }
.hero .logo-dots span { width: 18px; height: 18px; border-radius: 50%; }
.hero h1 {
  font-size: clamp(38px, 7vw, 58px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero p.tagline {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 560px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 36px 0;
}
.feature {
  padding: 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-soft);
}
.feature .f-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 12px;
}
.feature .f-icon .ic { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.create-card { padding: 28px; max-width: 560px; margin: 0 auto; }
.create-card h2 { margin: 0 0 18px; font-size: 20px; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dt-range { display: flex; align-items: center; gap: 8px; }
.dt-range input { flex: 1; min-width: 0; }
.dt-arrow { flex: none; display: inline-flex; color: var(--muted); }
.dt-arrow .ic { width: 16px; height: 16px; }

.demo-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 26px auto 0;
  flex-wrap: wrap;
}
.demo-strip .dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(10, 14, 20, 0.14);
}
.demo-strip .dot .ic { width: 16px; height: 16px; stroke-width: 2.6; }

.recents { max-width: 560px; margin: 28px auto 0; }
.recents h3 { font-size: 14px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
}
.recent-item:hover { border-color: var(--accent); }
.recent-item .r-icon { width: 26px; height: 26px; min-width: 26px; border-radius: 7px; object-fit: cover; }
.recent-item .r-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .r-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.badge-admin {
  font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 2px 8px;
}

.landing-footer { text-align: center; margin-top: 48px; color: var(--muted); font-size: 13px; }

/* ---------- naptár oldal ---------- */

.poll-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 18px 70px;
  width: 100%;
}

.poll-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.poll-head .ph-text { flex: 1; min-width: 240px; }
.poll-head h1 { margin: 0 0 2px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.01em; line-height: 1.15; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.poll-head h1 .ph-icon { width: 40px; height: 40px; min-width: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line-soft); }
.poll-head .ph-dates { color: var(--ink-2); font-size: 14px; }
.poll-head .ph-desc { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; max-width: 720px; }
.poll-head .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.home-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
  margin-bottom: 10px;
}
.home-link:hover { color: var(--accent); }
.home-link .logo-dots { display: inline-flex; gap: 3px; }
.home-link .logo-dots span { width: 8px; height: 8px; border-radius: 50%; }

/* csatlakozás sáv */
.join-bar {
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent-soft), transparent 65%), var(--card);
}
.join-bar .jb-lead { flex-basis: 100%; margin: 0 0 2px; font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.join-bar .jb-lead .ic { width: 19px; height: 19px; color: var(--accent); }
.join-bar .field { margin: 0; flex: 1; min-width: 170px; }
.join-bar .btn { height: 40px; }

/* saját sáv */
.me-bar {
  padding: 12px 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.me-bar .mb-hello { font-weight: 650; margin-right: auto; display: inline-flex; align-items: center; gap: 8px; }
.me-bar .mb-hello .ic { width: 19px; height: 19px; color: var(--accent); }
.me-bar .mb-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.me-bar .mb-quick .q-label { font-size: 13px; color: var(--muted); margin-right: 2px; }

/* ---------- rács ---------- */

.grid-card { padding: 0; overflow: hidden; position: relative; }

.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.grid-toolbar h2 { font-size: 16px; margin: 0; margin-right: auto; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.legend .lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.legend .lg-dot {
  width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.legend .lg-dot .ic { width: 12px; height: 12px; stroke-width: 2.8; }

.saved-flash {
  position: absolute;
  bottom: 14px; right: 16px;
  background: var(--yes);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 13px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 30;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.saved-flash .ic { width: 14px; height: 14px; stroke-width: 2.8; }
.saved-flash.show { opacity: 1; transform: translateY(0); }

.grid-scroll {
  overflow: auto;
  max-height: min(64vh, 640px);
  overscroll-behavior-x: contain;
}

.grid {
  display: grid;
  grid-template-columns: var(--name-w) repeat(var(--cols), var(--cell-w));
  width: max-content;
  min-width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.g-cell { display: flex; align-items: center; justify-content: center; }

/* fejléc sorok – ragadósak */
.g-month {
  position: sticky; top: 0; z-index: 12;
  height: var(--month-h);
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  display: flex; align-items: flex-end;
  justify-content: flex-start;
  padding: 0 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  white-space: nowrap;
}
.g-month .m-label {
  position: sticky;
  left: calc(var(--name-w) + 10px);
}
.g-day {
  position: sticky; top: var(--month-h); z-index: 12;
  height: var(--dayhead-h);
  background: var(--card);
  flex-direction: column;
  gap: 0;
  font-size: 11px;
  color: var(--muted);
  border: none;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  user-select: none;
  padding: 4px 0 0;
}
.g-day:hover { background: var(--accent-soft); }
.g-day .d-num {
  font-size: 14px; font-weight: 700; color: var(--ink);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.g-day.today .d-num { background: var(--accent); color: var(--accent-ink); }
.g-day .d-ev { line-height: 1; height: 10px; color: var(--accent); }
.g-day .d-ev .ic { width: 10px; height: 10px; vertical-align: top; }

.g-sum {
  position: sticky; top: calc(var(--month-h) + var(--dayhead-h)); z-index: 12;
  height: var(--sum-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.sum-chip {
  min-width: 26px; height: 22px;
  padding: 0 4px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--ink);
  background: color-mix(in oklab, var(--yes) calc(var(--f) * 52%), var(--card-2));
}
.sum-chip.zero { color: var(--muted); background: var(--card-2); }
.sum-chip.best { box-shadow: 0 0 0 2px var(--yes); }

/* név oszlop */
.g-name {
  position: sticky; left: 0; z-index: 11;
  background: var(--card);
  justify-content: flex-start;
  gap: 9px;
  padding: 0 10px 0 14px;
  border-right: 1px solid var(--line);
  height: var(--row-h);
  font-size: 14px;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  border-top: none;
  text-align: left;
  width: 100%;
  border-left: none;
}
button.g-name { appearance: none; }
.g-name:hover { background: var(--card-2); }
.g-name .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name .nm .you { color: var(--accent); font-weight: 700; font-size: 12px; }
.g-name.is-me { box-shadow: inset 3px 0 0 var(--accent); }

.g-corner {
  position: sticky; left: 0; z-index: 13;
  background: var(--card);
  border-right: 1px solid var(--line);
  justify-content: flex-start;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.g-corner.c-month { top: 0; height: var(--month-h); border-bottom: 1px solid var(--line-soft); }
.g-corner.c-day { top: var(--month-h); height: var(--dayhead-h); border-bottom: 1px solid var(--line-soft); align-items: flex-end; padding-bottom: 8px; }
.g-corner.c-sum { top: calc(var(--month-h) + var(--dayhead-h)); height: var(--sum-h); border-bottom: 1px solid var(--line); }

.avatar {
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}

/* nap cellák */
.cell {
  height: var(--row-h);
  border: none;
  background: transparent;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  border-bottom: 1px solid var(--line-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}
.cell .c-dot {
  width: 27px; height: 27px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line);
  color: transparent;
  transition: transform 0.08s;
}
.cell .c-dot .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.cell.editable { cursor: pointer; }
.cell.editable:hover .c-dot { transform: scale(1.12); border-color: var(--muted); }
.cell.editable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.cell.s-yes .c-dot { background: var(--yes); border: none; color: #fff; }
.cell.s-maybe .c-dot { background: var(--maybe); border: none; color: #4a3200; }
.cell.s-no .c-dot { background: var(--no-soft); border: 2px solid transparent; color: var(--no); }

/* oszlop árnyalatok */
.wk { background-color: var(--wk); }
.has-event { background-color: var(--event-tint); }
.g-day.has-event { background-color: var(--event-tint); }
.g-day.has-event:hover { background: var(--accent-soft); }
.g-day.selecting { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.grid-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- alkalmak ---------- */

.events-section { margin-top: 22px; }
.events-section .es-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.events-section h2 { font-size: 18px; margin: 0; margin-right: auto; display: flex; align-items: center; gap: 9px; }
.events-section h2 .ic { width: 20px; height: 20px; color: var(--accent); }

.event-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.event-card { padding: 15px 17px; display: flex; gap: 14px; align-items: flex-start; }
.event-card .ev-date {
  min-width: 52px;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  padding: 7px 4px 8px;
  line-height: 1.15;
}
.event-card .ev-date .ed-m { font-size: 11px; font-weight: 700; text-transform: uppercase; display: block; }
.event-card .ev-date .ed-d { font-size: 21px; font-weight: 800; display: block; }
.event-card .ev-date .ed-w { font-size: 10.5px; display: block; color: var(--ink-2); }
.event-card .ev-date .ed-range { display: block; font-size: 10px; font-weight: 700; color: var(--accent); margin-top: 3px; white-space: nowrap; }
.event-card .ev-when { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; margin: 1px 0 6px; }
.event-card .ev-when .ic { width: 14px; height: 14px; color: var(--muted); flex: none; }
.event-card .ev-body { flex: 1; min-width: 0; }
.event-card h3 { margin: 0 0 2px; font-size: 15.5px; display: flex; align-items: center; gap: 7px; }
.event-card .ev-icon { width: 22px; height: 22px; min-width: 22px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-soft); }
.event-card .ev-note { font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.event-card .ev-avail { font-size: 12px; color: var(--muted); margin-top: 6px; }
.event-card .ev-actions { display: flex; flex-direction: column; gap: 4px; }

.leader-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.leader-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 9px 2px 3px;
  font-size: 12.5px;
  font-weight: 600;
}
.leader-chip .avatar { width: 18px; height: 18px; min-width: 18px; font-size: 9px; }
.leader-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.events-empty {
  padding: 22px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- modal ---------- */

.overlay {
  position: fixed; inset: 0;
  background: rgba(8, 10, 14, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--line-soft);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: scale(0.96) translateY(6px); opacity: 0; } }
.modal h2 { margin: 0 0 6px; font-size: 19px; }
.modal h2.m-title { display: flex; align-items: center; gap: 9px; }
.modal h2.m-title .ic { width: 21px; height: 21px; color: var(--accent); flex: none; }
.modal .m-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 16px; }
.modal .m-sub.m-sub-icon { display: flex; align-items: center; gap: 7px; }
.modal .m-sub.m-sub-icon .ic { width: 16px; height: 16px; color: var(--accent); }
.link-label { margin: 14px 0 5px; font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.link-label .ic { width: 16px; height: 16px; color: var(--accent); }
.modal .m-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal .m-actions .left { margin-right: auto; }

.linkbox {
  display: flex; gap: 8px; align-items: center;
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 10px 0;
}
.linkbox code {
  flex: 1;
  font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.note-warn {
  background: var(--maybe-soft);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.note-warn .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; color: #a56a00; }
@media (prefers-color-scheme: dark) {
  .note-warn .ic { color: var(--maybe); }
}

/* nap részletei modal */
.day-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.day-group .dg-title { font-size: 12.5px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.day-group .names { display: flex; flex-wrap: wrap; gap: 5px; }
.name-tag { background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.dg-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }

/* event icon field */
.icon-field { display: flex; align-items: center; gap: 10px; }
.icon-preview {
  width: 46px; height: 46px; min-width: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-preview.empty .ic { width: 20px; height: 20px; color: var(--muted); }
.icon-upload-btn { cursor: pointer; }

/* role editor */
.roles-editor { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.role-group {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 9px 10px 5px;
  background: var(--card-2);
}
.rg-head { display: flex; align-items: center; gap: 8px; }
.rg-label {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--card);
  outline: none;
}
.rg-label:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.role-pick { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow: auto; margin: 4px 0 2px; }
.role-pick label {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
}
.role-pick label:hover { background: var(--card); }
/* Reset the .field input bleed (border / padding / animated focus ring) that
   made the whole row twitch when a checkbox was clicked. */
.role-pick input[type=checkbox] {
  width: 16px; height: 16px; min-width: 16px;
  flex: none;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  accent-color: var(--accent);
  transition: none;
}
.role-pick input[type=checkbox]:focus { box-shadow: none; border-color: transparent; }
.role-pick .lp-status { margin-left: auto; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.role-block { margin-top: 8px; }

/* rendered markdown (descriptions, notes) */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md ul { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin: 1px 0; }
.md a { color: var(--accent); text-decoration: underline; }
.md code {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.5px 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.danger-zone { border-top: 1px solid var(--line-soft); margin-top: 18px; padding-top: 14px; }

/* ---------- toast ---------- */

#toast-root {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--page);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.2s ease-out;
  max-width: min(90vw, 480px);
}
.toast.error { background: var(--no); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- hibaoldal ---------- */

.error-page { text-align: center; padding: 18vh 20px; }
.error-page .error-ic { color: var(--muted); margin-bottom: 8px; }
.error-page .error-ic .ic { width: 52px; height: 52px; stroke-width: 1.6; }
.error-page h2 { margin: 0 0 6px; }
.error-page p { color: var(--ink-2); }

/* ---------- mobil ---------- */

@media (max-width: 640px) {
  :root { --name-w: 124px; --cell-w: 36px; }
  .poll-page { padding: 14px 10px 60px; }
  .g-name { padding: 0 6px 0 8px; font-size: 13px; gap: 6px; }
  .avatar { width: 22px; height: 22px; min-width: 22px; font-size: 10px; }
  .grid-toolbar { padding: 12px 12px; gap: 8px; }
  .create-card { padding: 20px; }
  .modal { padding: 18px; }
  .grid-scroll { max-height: 70vh; }
}

@media print {
  .join-bar, .me-bar, .ph-actions, .grid-toolbar .btn, .ev-actions { display: none !important; }
  .grid-scroll { max-height: none; overflow: visible; }
  .card { box-shadow: none; }
}
