:root {
  /* Paleta z obrazu Matki Bożej (nieba, aureoli, płaszcza i sukni) */
  --blue-dark: #0D286A;
  --blue: #2A5DAE;
  --blue-light: #E9EFFA;
  --gold: #935E15;
  --gold-light: #F7ECD8;
  --green: #2F7A34;
  --green-light: #EAF3E7;
  --ink: #1C1C1E;
  --paper: #FAF6EE;
  --card: #FFFFFF;
  --muted: #6B6B6F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background:
    linear-gradient(rgba(250,246,238,0.95), rgba(250,246,238,0.95)),
    url('img/plomien-milosci.webp');
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  background-color: var(--paper);
  color: var(--ink);
  font-size: 19px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

.header {
  background:
    linear-gradient(180deg, rgba(13,40,106,0.12) 0%, rgba(13,40,106,0.22) 55%, rgba(13,40,106,0.88) 100%),
    url('img/plomien-milosci.webp');
  background-size: cover;
  background-position: center 8%;
  color: #fff;
  min-height: 340px;
  padding: 24px 20px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.meet-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  min-height: 44px;
  text-decoration: none;
}

.meet-banner svg {
  flex: none;
  width: 26px;
  height: 26px;
}

.meet-banner .meet-text {
  display: flex;
  flex-direction: column;
}

.meet-banner .meet-title {
  font-weight: 700;
  font-size: 17px;
}

.meet-banner .meet-sub {
  font-weight: 400;
  font-size: 14px;
  color: var(--blue);
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 6px solid var(--blue);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.slots {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-filled {
  background: var(--green-light);
  color: var(--green);
  border-radius: 12px;
  padding: 8px 8px 8px 16px;
  min-height: 44px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slot-filled .name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.slot-filled .name-wrap span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-filled .check {
  flex: none;
  width: 22px;
  height: 22px;
}

.slot-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:active {
  background: rgba(0,0,0,0.08);
}

.icon-btn.delete {
  color: #B3261E;
}

.slot-empty button {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  border: 2px dashed var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.slot-empty button:active {
  background: var(--gold-light);
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.overlay.hidden { display: none; }

.sheet {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 28px;
}

.sheet h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  color: var(--blue-dark);
}

.sheet .sheet-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 18px;
}

.sheet input {
  width: 100%;
  font-size: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #D8D8DC;
  font-family: inherit;
  margin-bottom: 16px;
}

.sheet input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-primary {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 12px;
  background: var(--gold);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:disabled {
  opacity: 0.5;
}

.btn-cancel {
  width: 100%;
  min-height: 48px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 18px;
  font-family: inherit;
  margin-top: 8px;
  cursor: pointer;
}

.sheet-error {
  color: #B3261E;
  font-size: 17px;
  margin: -8px 0 16px;
  min-height: 22px;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 24px;
  background: var(--green);
  color: #fff;
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  z-index: 60;
  transition: opacity 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

.reset-link {
  display: block;
  margin: 30px auto 0;
  padding: 10px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.loading, .error-banner {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 19px;
}
