/* MoreLove – widok sali. Kolory z logo: niebieski #194F8B i pomarańczowy #ED9955. */
:root {
  --blue: #194F8B;
  --blue-deep: #133E6E;
  --blue-line: #2E6299;
  --orange: #ED9955;
  --orange-ink: #B7611F;
  --page: #F4F6FA;
  --ink: #1B2B40;
  --muted: #5A6A80;
  --on-blue: #DCE7F4;
  --screen: #FFF8EE;
  --wood: #C08A5A;
  --wood-dark: #8A5A33;
  --seat: #FFFFFF;
  --chip: #EAF0F7;
  --led-off: #E5484D;
  --led-on: #2FCF78;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font: 16px/1.5 var(--body); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nagłówek ---------- */
.top {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 24px 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
}
.logo { display: block; width: clamp(220px, 30vw, 360px); height: auto; }
.brand-course { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }

.meta { text-align: right; }
.meta p { margin: 0; }
.meta .edition { color: var(--muted); }
.meta .meeting { font: 600 1.7rem/1.2 var(--display); color: var(--blue); }
.meta .date { color: var(--ink); }
.progress { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.progress .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #B8C6D8; }
.progress .dot.past { background: #B8C6D8; }
.progress .dot.now { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 8px var(--orange); }

/* ---------- wyszukiwarka par ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 8px 24px 64px; }
.finder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 18px 0 10px; }
.finder > label { font-weight: 700; }
.finder-box { position: relative; width: min(420px, 100%); }
.finder input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 2px solid #C9D4E2;
  background: #fff;
  color: var(--ink);
}
.finder input:focus { border-color: var(--blue); }
.find-hint { margin: 0; color: var(--muted); font-size: .92rem; }
.status { flex-basis: 100%; margin: 0; color: #B42328; font-size: .95rem; }
.status:empty { display: none; }

.results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(19, 62, 110, .25);
  max-height: 60vh;
  overflow-y: auto;
}
.results button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.results button:hover, .results button:focus-visible { background: var(--chip); outline: none; }
.results .pair { display: block; font-weight: 700; }
.results .where { display: block; font-size: .88rem; color: var(--muted); }
.results .none { padding: 10px 12px; color: var(--muted); }

/* ---------- sala ---------- */
.room {
  position: relative;
  margin-top: 8px;
  padding: 0 0 28px;
  background: var(--blue-deep);
  border-radius: 28px 28px 14px 14px;
  overflow: hidden;
}
.screen {
  position: relative;
  width: min(62%, 640px);
  margin: 0 auto 40px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--screen);
  color: #9A8A70;
  border-radius: 0 0 8px 8px;
  font: 500 1rem var(--display);
  letter-spacing: .04em;
  box-shadow: 0 0 60px 14px rgba(255, 248, 238, .2);
}
.screen::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -20%;
  width: 140%;
  height: 360px;
  background: linear-gradient(to bottom, rgba(255, 248, 238, .12), rgba(255, 248, 238, 0));
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  padding: 0 24px;
}
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 0 6px 26px; border-bottom: 2px solid var(--orange); }
.col-label { margin: 0; font: 600 1rem/1.3 var(--display); color: #fff; }
.col-count { color: var(--on-blue); font-size: .88rem; }

.empty { grid-column: 1 / -1; margin: 24px auto; max-width: 46ch; text-align: center; color: var(--on-blue); font-size: 1.1rem; }

/* ---------- stolik ---------- */
.bench { position: relative; padding-left: 26px; border-radius: 14px; transition: opacity .2s; }
.bench-no { position: absolute; left: 0; bottom: 2px; width: 20px; text-align: center; color: var(--on-blue); font-size: .85rem; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plank { height: 9px; margin-top: 6px; border-radius: 3px; background: linear-gradient(to bottom, var(--wood), var(--wood-dark)); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }

.room.filtering .bench:not(.hit) { opacity: .25; }
.bench.hit .seat { box-shadow: 0 0 0 3px var(--orange), 0 0 24px rgba(237, 153, 85, .7); }

.seat { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-radius: 12px 12px 4px 4px; background: var(--seat); color: var(--ink); }
.seat-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.seat-name.blank { color: var(--muted); font-weight: 400; }

.sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid #D0D9E5; background: #fff; color: var(--ink);
  font-size: .9rem; line-height: 1.15; cursor: pointer; text-align: left;
}
.sbtn:hover { border-color: var(--blue); }
.sbtn .ico { width: 20px; height: 20px; flex: none; }

.attend { justify-content: flex-start; }
.led { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--led-off); box-shadow: 0 0 0 2px rgba(229, 72, 77, .2), 0 0 8px rgba(229, 72, 77, .7); }
.attend.on { border-color: #BFE9D2; background: #ECFAF2; font-weight: 700; }
.attend.on .led { background: var(--led-on); box-shadow: 0 0 0 2px rgba(47, 207, 120, .2), 0 0 10px rgba(47, 207, 120, .9); }
.attend.just .led { animation: pulse .9s ease-out 2; }
@keyframes pulse { 50% { transform: scale(1.6); } }

.order { display: flex; flex-direction: column; gap: 6px; }
.order-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px; border-radius: 8px; background: var(--chip); font-size: .9rem; font-weight: 700; }
.order-chip .ico { width: 24px; height: 24px; }
.sugar-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 3px; border-radius: 999px; background: #fff; font-weight: 400; font-size: .82rem; }
.sugar-badge .ico { width: 16px; height: 16px; }
.order-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.order-btns .sbtn { flex: 1 1 auto; min-height: 32px; font-size: .84rem; padding: 4px 8px; }
.sbtn.done { background: var(--blue); color: #fff; border-color: var(--blue); }
.sbtn.done:hover { background: var(--blue-deep); }

/* ---------- okna dialogowe ---------- */
dialog { width: min(460px, calc(100vw - 32px)); padding: 24px; border: none; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(10, 30, 60, .45); }
dialog::backdrop { background: rgba(10, 30, 60, .6); }
dialog h2 { margin: 0 0 12px; font: 600 1.4rem/1.25 var(--display); color: var(--blue); }
dialog p { margin: 0 0 18px; }
.drink-lead { margin: -6px 0 16px; font-size: 1.1rem; }
fieldset { margin: 0; padding: 0; border: none; }

.drink-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 2px solid #D0D9E5; background: #fff; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .ico { width: 28px; height: 28px; flex: none; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--chip); font-weight: 700; }
.opt:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }

.sugar-opt { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.sugar-opt input { position: absolute; opacity: 0; }
.sugar-opt .box { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; display: grid; place-items: center; }
.sugar-opt input:checked + .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.sugar-opt input:checked + .box::after { content: "✓"; font-weight: 700; line-height: 1; }
.sugar-opt input:focus-visible + .box { outline: 3px solid var(--orange); outline-offset: 2px; }
.sugar-opt:has(input:disabled) { opacity: .4; cursor: not-allowed; }

.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn { padding: 10px 18px; border-radius: 10px; border: 2px solid var(--blue); cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.danger { background: #B42328; border-color: #B42328; color: #fff; }
.btn.danger:hover { background: #8F1B1F; }
.btn:disabled { opacity: .5; cursor: wait; }

/* ---------- instalacja aplikacji ---------- */
.install {
  max-width: 1272px; margin: 14px auto 0; padding: 14px 18px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  background: #fff; border: 2px solid var(--orange); border-radius: 16px;
}
.install p { margin: 0; max-width: 60ch; font-weight: 700; }
.install-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ios-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.ios-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: .95rem; }
.ios-warn { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #FDF1E6; border-left: 5px solid var(--orange); font-weight: 700; }
.foot { max-width: 1320px; margin: 0 auto; padding: 0 24px 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--muted); font-size: .88rem; }
.link-btn { padding: 0; border: none; background: none; color: var(--blue); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- komunikat o następnym spotkaniu ---------- */
.notice {
  max-width: 640px; margin: 7vh auto 48px; padding: 36px 28px; text-align: center;
  background: #fff; border-radius: 24px; border-top: 6px solid var(--orange);
  box-shadow: 0 20px 50px rgba(19, 62, 110, .12);
}
.notice-logo { display: block; width: min(300px, 80%); height: auto; margin: 0 auto 10px; }
.notice-course { margin: 0 0 24px; padding-bottom: 22px; border-bottom: 1px solid #E3E9F1; color: var(--muted); }
.notice h2 { margin: 0 0 16px; font: 600 1.6rem/1.2 var(--display); color: var(--blue); }
.notice .when { margin: 0 0 12px; font-size: 1.3rem; line-height: 1.45; }
.notice .invite { margin: 0; font: 600 1.3rem var(--display); color: var(--orange-ink); }
.notice .which { margin: 20px 0 0; color: var(--muted); }

/* materiały do pobrania */
.materials { margin-top: 26px; padding-top: 22px; border-top: 1px solid #E3E9F1; text-align: left; }
.materials h3 { margin: 0 0 6px; font: 600 1.15rem/1.3 var(--display); color: var(--blue); text-align: center; }
.materials > p { margin: 0 0 14px; color: var(--muted); text-align: center; }
.materials ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.materials a {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "t n g" "t s g"; align-items: center; gap: 0 12px;
  padding: 10px 12px; border: 2px solid #D0D9E5; border-radius: 12px; color: var(--ink); text-decoration: none; background: #fff;
}
.materials a:hover { border-color: var(--blue); background: var(--chip); }
.ftype { grid-area: t; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; color: #fff; font: 700 .78rem var(--body); }
.ftype.pdf { background: #C7392F; }
.ftype.doc { background: #2B579A; }
.fname { grid-area: n; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.fsize { grid-area: s; color: var(--muted); font-size: .88rem; }
.fget { grid-area: g; padding: 7px 12px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: .9rem; }

.farewell .materials { margin: 6px 0 26px; padding-top: 20px; }
.farewell .materials > p { font-size: 1rem; margin: 0 0 14px; }

/* ---------- podgląd administratora ---------- */
.preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 12px 24px; background: #FDF1E6; border-bottom: 3px solid var(--orange);
}
.preview-bar p { margin: 0; max-width: 80ch; }
.preview-bar a { color: var(--blue); font-weight: 700; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-actions .btn { text-decoration: none; font-size: .92rem; padding: 7px 14px; }
.preview-actions .btn.primary { color: #fff; }

.sbtn.locked { color: #8A97A8; border-style: dashed; background: #F7F9FC; }
.sbtn.locked .ico { opacity: .5; }

/* ---------- koniec edycji ---------- */
.farewell { max-width: 560px; margin: 0 auto; padding: 12vh 24px 48px; text-align: center; }
.farewell .logo { margin: 0 auto 36px; width: min(320px, 80%); }
.farewell h1 { margin: 0 0 18px; font: 600 clamp(1.3rem, 4.5vw, 1.8rem)/1.3 var(--display); color: var(--blue); }
.farewell p { margin: 0 0 14px; font-size: 1.15rem; }
.farewell .recommend { margin-top: 28px; padding-top: 22px; border-top: 3px solid var(--orange); color: var(--orange-ink); font-weight: 700; }

/* ---------- komunikaty ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700;
  box-shadow: 0 12px 40px rgba(10, 30, 60, .35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-left: 6px solid var(--led-on); }
.toast.err { border-left: 6px solid var(--led-off); }

/* ---------- tablet i telefon: trzy wyraźnie oddzielone grupy stolików ---------- */
@media (max-width: 1099px) {
  .room { background: transparent; overflow: visible; border-radius: 0; padding: 0; }
  .screen { width: 80%; margin-bottom: 24px; background: var(--blue-deep); color: var(--on-blue); box-shadow: none; border-radius: 10px; }
  .screen::after { display: none; }
  .columns { grid-template-columns: 1fr; gap: 28px; padding: 0; }
  .col { padding: 0 14px 18px; background: var(--blue-deep); border-radius: 20px; overflow: hidden; }
  .col-head { margin: 0 -14px 4px; padding: 14px 18px 12px; border-bottom: 4px solid var(--orange); background: var(--blue); }
  .col-label { font-size: 1.15rem; }
  .empty { color: var(--muted); }
}
@media (max-width: 1320px) { .install { margin: 14px 24px 0; } }
@media (max-width: 640px) {
  .install { margin: 12px 12px 0; }
  .top { padding: 18px 16px 4px; }
  .meta { text-align: left; }
  .progress { justify-content: flex-start; }
  main { padding: 4px 12px 48px; }
  .bench { padding-left: 22px; }
  .seat { padding: 8px; }
  .drink-opts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== widok obsługi ===================== */
.staff .presence {
  display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 8px;
  border-radius: 8px; background: #F7F9FC; color: var(--muted); font-size: .88rem;
}
.staff .presence.on { background: #ECFAF2; color: var(--ink); font-weight: 700; }
.staff .presence.on .led { background: var(--led-on); box-shadow: 0 0 0 2px rgba(47, 207, 120, .2), 0 0 10px rgba(47, 207, 120, .9); }
.staff .seat.has-order { box-shadow: 0 0 0 3px var(--orange); }
.staff .order .sbtn.done { width: 100%; min-height: 40px; font-weight: 700; }

.staff-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 16px 0 12px; }
.staff-todo { margin: 0; font: 600 1.25rem var(--display); color: var(--blue); }
.staff-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.staff-note { margin-top: 6px !important; color: var(--orange-ink); font-weight: 700; }

.staff-login { margin-top: 5vh; }
.staff-login form { display: grid; gap: 12px; max-width: 320px; margin: 0 auto; text-align: left; }
.staff-login label { font-weight: 700; }
.staff-login input { padding: 11px 14px; border: 2px solid #C9D4E2; border-radius: 10px; font: inherit; }
.staff-err { margin: 0; min-height: 1.4em; color: #B42328; }

.summary { margin-top: 32px; }
.summary h2 { margin: 0 0 14px; font: 600 1.5rem var(--display); color: var(--blue); }
.sum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sum-card { padding: 16px 18px; background: #fff; border-radius: 16px; border-top: 5px solid var(--blue); box-shadow: 0 8px 24px rgba(19, 62, 110, .08); }
.sum-card.sum-total { border-top-color: var(--orange); background: #FFFBF6; }
.sum-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; font: 600 1.05rem var(--display); color: var(--blue); }
.sum-card h3 span { font-size: 1.6rem; color: var(--ink); }
.sum-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sum-card li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; }
.sum-card li .ico { width: 24px; height: 24px; }
.sum-card li strong { font-size: 1.2rem; min-width: 2ch; text-align: right; }
.sum-card .sum-sugar { margin-top: 4px; padding-top: 8px; border-top: 1px dashed #D0D9E5; }
.sum-empty { margin: 0; color: var(--muted); }

@media (max-width: 1099px) { .sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sum-grid { grid-template-columns: 1fr; } }

/* ===================== zegar warsztatu nad stolikami ===================== */
.ws-bar {
  position: sticky; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 0 0 12px; padding: 12px 18px; border-radius: 16px;
  background: var(--blue); color: #fff; box-shadow: 0 10px 30px rgba(19, 62, 110, .3);
}
.ws-bar .ico { width: 26px; height: 26px; flex: none; }
.ws-label { font-weight: 700; }
.ws-time { margin-left: auto; font: 600 1.9rem/1 var(--display); font-variant-numeric: tabular-nums; }
.ws-track { flex-basis: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.ws-fill { display: block; height: 100%; width: 0; background: var(--orange); transition: width .5s linear; }
.ws-bar.last { background: var(--orange-ink); }
.ws-bar.last .ws-fill { background: #fff; }
.ws-bar.ended { background: #fff; color: var(--blue); border: 3px solid var(--orange); font-size: 1.15rem; }

/* przed godziną otwarcia: sala widoczna, przyciski wyciszone */
.actions-info {
  margin: 0 0 12px; padding: 12px 16px; border-radius: 14px;
  background: #FDF1E6; border: 2px solid var(--orange); color: var(--ink);
}
.actions-info[hidden] { display: none; }
.actions-wait .seat .sbtn { opacity: .55; }

/* ---------- 1.20: zakładki obsługi, cofanie, przygotowanie sali ---------- */
.stabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 640px; margin: 16px 0 4px; padding: 6px; background: #fff; border-radius: 16px; box-shadow: 0 6px 18px rgba(19, 62, 110, .08); }
.stabs button { border: 0; border-radius: 12px; padding: 12px 10px; background: transparent; color: var(--muted); font: 600 1rem var(--display); cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.stabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.stab-badge { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--orange); color: #fff; font: 700 .85rem var(--body); }
.stab-badge.muted { background: #A9BCD3; }
.stabs button[aria-selected="true"] .stab-badge.muted { background: var(--orange); }

.staff .seat.served { box-shadow: none; }
.served-box { margin-top: 8px; padding: 8px 10px; border: 2px dashed #A9BCD3; border-radius: 10px; background: #F5F8FC; display: grid; gap: 6px; font-size: .9rem; }
.served-box b { color: var(--ink); }
.served-box small { color: var(--muted); }
.served-box .sbtn.undo { width: 100%; min-height: 38px; padding: 4px 12px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700; border-radius: 10px; cursor: pointer; }

.undo-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; width: min(560px, calc(100% - 24px)); padding: 12px 14px 10px; border-radius: 16px; background: #1B2B40; color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.undo-bar p { margin: 0; font-weight: 700; }
.undo-btn { background: var(--orange); color: #fff; border: 0; font-weight: 700; padding: 10px 16px; border-radius: 12px; cursor: pointer; }
.undo-track { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: #3A4B62; overflow: hidden; }
.undo-track i { display: block; height: 100%; background: var(--orange); transition: width .25s linear; }
body.has-undo .toast { bottom: 110px; }
body.prep-tab .undo-bar { display: none; }

.prep { max-width: 640px; margin: 14px 0 90px; }
.prep-head { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 6px 18px rgba(19, 62, 110, .08); }
.prep-meeting { margin: 0 0 8px; color: var(--muted); }
.prep-track { height: 10px; border-radius: 5px; background: var(--chip); overflow: hidden; }
.prep-track i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .3s; }
.prep-count { font: 600 1.7rem var(--display); color: var(--blue); white-space: nowrap; }
.prep-sect { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 4px 8px; font: 600 1.1rem var(--display); color: var(--orange-ink); }
.prep-sect span { font: 400 .9rem var(--body); color: var(--muted); }
.prep-task { width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; text-align: left; margin: 0 0 10px; padding: 14px 16px; border: 2px solid transparent; border-radius: 14px; background: #fff; color: var(--ink); font: 700 1.05rem var(--body); cursor: pointer; box-shadow: 0 3px 10px rgba(19, 62, 110, .06); }
.prep-task .box { width: 32px; height: 32px; border-radius: 9px; border: 2px solid #A9BCD3; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.prep-task small { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
.prep-task.done { background: #EEF9F3; border-color: #BDE8CF; color: var(--muted); }
.prep-task.done .t { text-decoration: line-through; }
.prep-task.done .box { background: var(--led-on); border-color: var(--led-on); }
.prep-task:disabled { opacity: .6; }
.prep-empty { margin: 0 4px; color: var(--muted); }
.prep-hint { color: var(--muted); font-size: .92rem; margin: 14px 4px 0; }

/* ---------- 1.20: ankieta ---------- */
.sv-invite { margin-top: 26px; padding: 22px 20px 18px; border-radius: 18px; background: #fff; border: 2px solid #F3D3B5; border-top: 6px solid var(--orange); text-align: left; box-shadow: 0 10px 26px rgba(19, 62, 110, .08); }
.sv-invite h3 { margin: 10px 0 6px; font: 600 1.35rem/1.25 var(--display); color: var(--blue); }
.sv-invite p { margin: 0 0 14px; font-size: 1rem; }
.sv-invite .sv-until { margin: 10px 0 0; color: var(--muted); font-size: .9rem; text-align: center; }
.sv-invite.done { border-color: #BDE8CF; border-top-color: var(--led-on); text-align: center; }
.sv-chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #FDF1E6; color: var(--orange-ink); font-weight: 700; font-size: .88rem; }
.btn.sv-open { width: 100%; background: var(--orange); border-color: var(--orange); color: #fff; font-size: 1.1rem; padding: 13px; border-radius: 12px; }
.btn.sv-open:hover { background: #E0853D; }
.farewell .sv-invite { margin: 10px 0 26px; }
.farewell .sv-invite p { font-size: 1rem; }

body.sv-on { overflow: hidden; }
.sv { position: fixed; inset: 0; z-index: 70; overflow-y: auto; background: var(--page); -webkit-overflow-scrolling: touch; }
.sv-in { max-width: 620px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
.sv-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin: 0 -16px 12px; padding: 12px 16px; background: var(--page); border-bottom: 1px solid #E3E9F1; }
.sv-head .sv-chip { grid-row: 2; justify-self: start; }
.sv-head .sv-close { grid-column: 2; grid-row: 1 / 3; }
.sv-head h2 { margin: 0; font: 600 1.15rem/1.25 var(--display); color: var(--blue); }
.sv-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); font-size: 1.1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(19, 62, 110, .12); }
.sv-q { margin: 0 0 12px; padding: 16px 18px; background: #fff; border-radius: 16px; border: 2px solid transparent; box-shadow: 0 3px 12px rgba(19, 62, 110, .06); transition: border-color .2s; }
.sv-q.missing { border-color: var(--led-off); }
.sv-q h3 { margin: 0 0 8px; font: 600 1.05rem/1.3 var(--display); color: var(--blue); }
.sv-sub { margin: -4px 0 8px; color: var(--muted); font-size: .9rem; }
.sv-opt { font: 400 .85rem var(--body); color: var(--muted); }
.sv-stars { display: flex; gap: 2px; }
.sv-stars button { border: 0; background: none; padding: 2px 4px; font-size: 2.1rem; line-height: 1; color: #D3DCE7; cursor: pointer; min-width: 44px; min-height: 44px; }
.sv-stars button.on { color: var(--orange); }
.sv-who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sv-who button { padding: 14px 8px; border: 2px solid #D6DEE8; border-radius: 14px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.sv-who button small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.sv-who button[aria-pressed="true"] { border-color: var(--blue); background: var(--chip); color: var(--blue); }
.sv-m { padding: 8px 0 4px; border-top: 1px solid #EEF2F7; }
.sv-m:first-of-type { border-top: 0; }
.sv-mt { margin: 0 0 2px; font-weight: 700; }
.sv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-left: 12px; border-left: 3px solid var(--chip); margin: 4px 0; }
.sv-row span { font-size: .95rem; }
.sv-row small { display: block; color: var(--muted); font-size: .85rem; }
.sv-row .sv-stars button { font-size: 1.6rem; min-width: 34px; min-height: 40px; padding: 2px; }
.sv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-pills button { padding: 9px 14px; border-radius: 999px; border: 2px solid #D6DEE8; background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.sv-pills button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.sv-q textarea { width: 100%; padding: 10px 12px; border: 2px solid #D6DEE8; border-radius: 12px; font: inherit; resize: vertical; }
.sv-send { width: 100%; padding: 14px; font-size: 1.1rem; border-radius: 14px; margin-top: 4px; }
.sv-foot { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }
.sv-thanks { margin-top: 18vh; text-align: center; background: #fff; border-radius: 20px; padding: 32px 22px; box-shadow: 0 12px 30px rgba(19, 62, 110, .1); }
.sv-thanks h2 { margin: 0 0 8px; font: 600 1.6rem var(--display); color: var(--blue); }
.sv-heart { font-size: 2.6rem; color: var(--orange); line-height: 1; margin-bottom: 8px; }
@media (max-width: 380px) { .sv-row { grid-template-columns: 1fr; } }

/* 1.21: ważne informacje i godziny na liście przygotowania sali */
.prep-info { margin: 14px 0 0; padding: 14px 18px; border-radius: 16px; background: #fff; border-left: 5px solid var(--blue); box-shadow: 0 3px 10px rgba(19, 62, 110, .06); }
.prep-info h3 { margin: 0 0 6px; font: 600 1rem var(--display); color: var(--blue); }
.prep-info ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.prep-at { display: inline-block; margin: 0 8px 2px 0; padding: 1px 8px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 .82rem var(--body); font-style: normal; vertical-align: 1px; }
.prep-task.done .prep-at { background: #A9BCD3; }
.prep-meeting strong { color: var(--ink); }

/* 1.22: materiały z wcześniejszych spotkań */
.older-btn { width: 100%; margin-top: 14px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t i" "s i"; align-items: center; gap: 0 10px; text-align: left; padding: 12px 16px; border: 2px dashed #A9BCD3; border-radius: 14px; background: #F5F8FC; color: var(--blue); cursor: pointer; font: inherit; }
.older-btn span { grid-area: t; font-weight: 700; font-size: 1rem; }
.older-btn small { grid-area: s; color: var(--muted); }
.older-btn b { grid-area: i; font-size: 1.3rem; }
.older-btn.open { border-style: solid; border-color: var(--blue); background: var(--chip); }
.older h4 { margin: 16px 0 8px; font: 600 1rem var(--display); color: var(--blue); }
.older ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }

/* ---------- 1.23: numer kolejnego zamówienia (tylko obsługa) ---------- */
.order-chip { border: 2px solid transparent; }
.ord-no { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 999px; color: #fff; font: 700 .8rem var(--body); }
.order-chip.n1 { background: #EAF0F7; border-color: #C9D8EA; } .order-chip.n1 .ord-no { background: #194F8B; }
.order-chip.n2 { background: #FDE9D7; border-color: #F4C9A2; } .order-chip.n2 .ord-no { background: #B7611F; }
.order-chip.n3 { background: #DDF4E7; border-color: #A9E0C2; } .order-chip.n3 .ord-no { background: #1C7D49; }
.order-chip.n4 { background: #ECE4F7; border-color: #CDB9EA; } .order-chip.n4 .ord-no { background: #6B4AA3; }
.order-chip.n5 { background: #FBE0E3; border-color: #F2B3BA; } .order-chip.n5 .ord-no { background: #B42328; }
.ord-legend { display: flex; flex-wrap: nowrap; gap: 5px; align-items: center; white-space: nowrap; font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.ord-legend .order-chip { padding: 2px 3px; }

/* ---------- 1.23: statystyki ---------- */
.stats-dlg { width: min(560px, calc(100vw - 20px)); padding: 0 0 18px; }
.stats-dlg.wide { width: min(860px, calc(100vw - 20px)); }
.st-head { display:flex; justify-content:space-between; align-items:center; padding: 18px 22px 12px; background: var(--blue); }
.st-head h2 { margin:0; color:#fff; }
.st-x { width:38px; height:38px; border-radius:50%; border:0; background:rgba(255,255,255,.15); color:#fff; font-size:1.1rem; }
.stats-dlg > *:not(.st-head) { margin-left: 22px; margin-right: 22px; }
.st-sub { color: var(--muted); font-size:.92rem; margin-top: 12px !important; margin-bottom: 12px !important; }
.st-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:5px; background: var(--chip); border-radius: 14px; }
.st-tabs button { border:0; border-radius:10px; padding:10px; background:transparent; font: 600 1rem var(--display); color: var(--muted); }

.st-meet { margin-top: 12px; } .st-pick { display:flex; gap:10px; align-items:center; font-weight:700; } .st-pick select { flex:1; padding:8px 10px; border:2px solid #C9D4E2; border-radius:10px; font: inherit; }
.st-kpis { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-top:14px; }
.st-kpis div { background:#fff; border:1px solid #D6DEE8; border-top:4px solid var(--orange); border-radius:12px; padding:10px 12px; }
.st-kpis b { display:block; font: 600 1.7rem/1.1 var(--display); color: var(--blue); } .st-kpis span { color: var(--muted); font-size:.85rem; }
.st-tbl { width: calc(100% - 44px); border-collapse: collapse; margin-top: 14px; font-size:.95rem; }
.st-scroll .st-tbl { width:100%; margin-top:0 } .st-scroll { margin-top:14px; overflow-x:auto }
.st-tbl th { text-align:left; font-size:.8rem; color: var(--muted); padding: 6px 8px; border-bottom:2px solid #D6DEE8; }
.st-tbl td { padding: 7px 8px; border-bottom:1px solid #EEF2F7; }
.st-tbl .r { text-align:right; font-variant-numeric: tabular-nums; } .st-tbl td.r { font-weight:700; }
.st-tbl .ico { width:22px; height:22px; vertical-align:-6px; margin-right:6px; }
.st-tbl .bar { width: 40%; } .st-tbl .bar i { display:block; height:10px; border-radius:5px; background: var(--blue); }
.st-tbl tr.sum td { font-weight:700; border-top:2px solid var(--blue); background:#F5F8FC; }
.st-tbl.ed th.f, .st-tbl.ed td.f { color:#B8C3D1; background:#FAFBFD; }
.st-tbl.ed .tot { background:#FDF1E6; color: var(--orange-ink); }
.st-tbl.ed tr.candle td { background:#FFFBF6; }
.st-mat { margin-top: 16px; padding: 12px 14px; background:#F5F8FC; border-radius: 12px; }
.st-mat h3 { margin:0 0 6px; font: 600 1rem var(--display); color: var(--blue); }
.st-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px dashed #D0D9E5; }
.st-row:last-child { border-bottom:0 } .st-row small { display:block; color: var(--muted); font-size:.8rem; }
.st-row.candle { background:#FFF6EC; margin: 6px -14px -12px; padding: 10px 14px; border-radius: 0 0 12px 12px; }
.st-step { display:flex; gap:4px; } .st-step button { width:36px; height:36px; border-radius:10px; border:2px solid var(--blue); background:#fff; color: var(--blue); font-weight:700; font-size:1.1rem; }
.st-step input { width:52px; text-align:center; border:2px solid #C9D4E2; border-radius:10px; font: 700 1.1rem var(--body); }
.st-note { color: var(--muted); font-size:.85rem; }
.st-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:16px; }

.stats-dlg { max-height: calc(100vh - 24px); overflow-y: auto; }
.stats-dlg[data-view="edition"] { width: min(900px, calc(100vw - 20px)); }
.st-tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.st-tabs button { cursor: pointer; }
.st-empty { color: var(--muted); margin-top: 14px; }
.st-step input::-webkit-outer-spin-button, .st-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-step button { cursor: pointer; }
.st-saved { color: var(--led-on); font-size: .82rem; font-weight: 700; }
.st-tbl.ed td.cur, .st-tbl.ed th.cur { box-shadow: inset 0 3px 0 var(--orange); }
@media (max-width: 480px) { .st-kpis b { font-size: 1.35rem; } .stats-dlg > *:not(.st-head) { margin-left: 14px; margin-right: 14px; } .st-tbl:not(.ed) { width: calc(100% - 28px); } }
.st-pick select { min-width: 0; width: 100%; text-overflow: ellipsis; }
.st-tbl.ed td.cur { box-shadow: none; }
.st-tbl.ed td:first-child { white-space: nowrap; }
@media (max-width: 480px) {
  .st-kpis span { font-size: .78rem; line-height: 1.3; display: block; }
  .st-tbl.ed { font-size: .85rem; }
  .st-tbl.ed td, .st-tbl.ed th { padding: 6px 5px; }
  .st-tbl:not(.ed) td:first-child { white-space: nowrap; }
  .st-tbl:not(.ed) .bar { width: 30%; }
}
@media (max-width: 480px) { .st-tbl.ed .f { display: none; } }
