:root {
  --bg: #0d1b2a;
  --bg2: #132338;
  --bg3: #1a2f4a;
  --gold: #c9a227;
  --gold-light: #e8c84e;
  --text: #e8e4d9;
  --text-muted: #9ba8b5;
  --accent: #4a9fd5;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  /* Safe area insets — automatically non-zero on Android/iOS notch devices */
  --sat: env(safe-area-inset-top,    0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
  --sar: env(safe-area-inset-right,  0px);
  --topbar-h: calc(56px + var(--sat));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

/* ---- TOP NAV ---- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid rgba(201,162,39,0.3);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal));
  padding-top: var(--sat);
  height: var(--topbar-h);
  min-height: var(--topbar-h);
}
.topbar h1 {
  font-size: 1.1rem; color: var(--gold); letter-spacing: 0.5px;
  text-align: center; flex: 1;
}
.topbar-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; padding: 8px;
  border-radius: 8px; transition: color .2s, background .2s;
}
.topbar-btn:hover { color: var(--gold); background: rgba(201,162,39,.1); }

/* ---- MAIN LAYOUT ---- */
.screen {
  position: fixed; top: 0; left: 0; right: 0;
  /* Content lives inside the rosary frame — bottom edge follows the rosary path */
  bottom: var(--rosary-mb, 0px);
  padding-top: var(--topbar-h);
  padding-left: var(--sal);
  padding-right: var(--sar);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transition: opacity .25s, transform .25s;
}
.screen.hidden {
  opacity: 0; pointer-events: none; transform: translateX(30px);
}

/* ---- CALENDAR SCREEN ---- */
#calendar-screen {
  padding-top: var(--topbar-h);
  padding-bottom: calc(80px + var(--sab));
}

.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  background: var(--bg2);
  position: sticky; top: 0; z-index: 10;
}
.month-nav h2 { font-size: 1.2rem; color: var(--gold); }
.month-nav button {
  background: none; border: 2px solid rgba(201,162,39,.4);
  color: var(--gold); width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; transition: all .2s;
}
.month-nav button:hover { background: rgba(201,162,39,.15); }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; padding: 12px;
}
.cal-header {
  text-align: center; font-size: .7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: .85rem; cursor: pointer;
  background: var(--bg3); transition: all .15s;
  position: relative; user-select: none;
}
.cal-day:hover { background: var(--bg2); transform: scale(1.05); }
.cal-day.has-entry { background: var(--bg2); border: 1px solid rgba(201,162,39,.2); }
.cal-day.has-entry:hover { border-color: var(--gold); background: rgba(201,162,39,.1); }
.cal-day.no-content { opacity: .55; border-style: dashed; }
.cal-day.no-content:hover { opacity: .8; }
.cal-day.today {
  background: rgba(201,162,39,.2); border: 2px solid var(--gold);
  color: var(--gold-light); font-weight: bold;
}
.cal-day.empty { background: transparent; cursor: default; }
.cal-day .dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
}
/* Reading progress badge on calendar tiles */
.cal-day.day-started { border-color: rgba(201,162,39,.5); }
.cal-day.day-done { border-color: var(--gold); }
.read-progress-ring {
  position: absolute; top: 3px; right: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,162,39,.35);
  background: conic-gradient(var(--gold) var(--pct, 0%), transparent 0%);
  opacity: .85;
}
.cal-day.day-done .read-progress-ring {
  background: var(--gold);
  border-color: var(--gold);
}

/* ---- DAY VIEW SCREEN ---- */
/* Clipped to the rosary border rectangle — margins set dynamically by rosary-animation.js */
#day-screen {
  background: var(--bg);
  top: var(--rosary-mt, 62px);
  left: 12px; right: 12px;
  bottom: var(--rosary-mb, 130px);
  border-radius: 12px;
  overflow-x: hidden;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}

.day-header {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(201,162,39,.3);
}
.day-badge {
  display: inline-block;
  background: rgba(201,162,39,.15); border: 1px solid rgba(201,162,39,.4);
  color: var(--gold); border-radius: 20px;
  padding: 3px 12px; font-size: .75rem; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.day-header h2 {
  font-size: 1.3rem; line-height: 1.4; color: var(--text);
}
.day-date { color: var(--text-muted); font-size: .85rem; margin-top: 6px; }
.mystery-badge {
  margin-top: 8px; font-size: .75rem; color: rgba(201,162,39,.8);
  letter-spacing: .5px; display: flex; align-items: center; gap: 4px;
}
.mystery-badge.break-badge { color: rgba(74,200,120,.8); }

.day-nav-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.nav-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid rgba(201,162,39,.3);
  color: var(--text-muted); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: .8rem;
  transition: all .2s;
}
.nav-btn:hover { color: var(--gold); border-color: var(--gold); background: rgba(201,162,39,.1); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.day-counter { color: var(--text-muted); font-size: .8rem; }

/* Sticky footer day nav — sits at the bottom of the rosary frame, above the lektor bar */
.day-footer-nav {
  position: sticky; bottom: 0; z-index: 12;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 10px 16px calc(10px + var(--sab));
  background: linear-gradient(180deg, rgba(19,35,56,0) 0%, var(--bg2) 38%);
  border-top: 1px solid rgba(201,162,39,.25);
  backdrop-filter: blur(2px);
}
[data-theme="light"] .day-footer-nav {
  background: linear-gradient(180deg, rgba(236,228,211,0) 0%, var(--bg2) 38%);
  border-top-color: rgba(139,101,8,.25);
}

.day-content { padding: 0; }

.section {
  margin: 0; border-bottom: 1px solid rgba(255,255,255,.07);
}
.section-header {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 8px 14px 12px; cursor: pointer;
  user-select: none;
  overflow: visible;
  position: relative;
}
.section-title {
  font-size: .85rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); display: flex; align-items: center; gap: 8px;
  flex: 1;
}
.section-icon { font-size: 1rem; }
.section-arrow {
  color: var(--text-muted); font-size: .7rem; transition: transform .25s;
}
.section.open .section-arrow { transform: rotate(180deg); }
.section-body {
  padding: 0 20px;
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}
.section.open .section-body {
  max-height: 9999px; padding: 0 20px 20px;
}
.section-body p {
  line-height: 1.7; font-size: .95rem; color: var(--text);
  margin-bottom: 10px;
}
.section-body p:last-child { margin-bottom: 0; }

/* Blog section special */
.blog-text {
  line-height: 1.75; font-size: .98rem; color: var(--text);
  white-space: pre-line;
}

/* Mystery / Tajemnica */
.mystery-title {
  font-size: .9rem; color: var(--accent); font-style: italic;
  margin-bottom: 12px; padding: 10px 14px;
  background: rgba(74,159,213,.08); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.mystery-text { white-space: pre-line; line-height: 1.7; font-size: .93rem; }

/* Prayer section */
.prayer-text {
  white-space: pre-line; line-height: 1.85; font-size: .93rem;
  color: var(--text); font-style: italic;
}

/* Calls to action */
.calls-block {
  background: rgba(201,162,39,.05); border: 1px solid rgba(201,162,39,.2);
  border-radius: 8px; padding: 14px; margin-top: 12px;
}
.calls-block h4 {
  color: var(--gold); font-size: .8rem; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.call-item {
  display: flex; gap: 10px; margin-bottom: 10px;
}
.call-item:last-child { margin-bottom: 0; }
.call-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(201,162,39,.2); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0; margin-top: 1px;
}
.call-text { font-size: .9rem; line-height: 1.6; }

/* ---- TODAY BUTTON (FAB) ---- */
.fab {
  position: fixed;
  bottom: calc(24px + var(--sab)); right: calc(20px + var(--sar)); z-index: 50;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: var(--bg);
  border: none; font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,162,39,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(201,162,39,.7); }

/* ---- LOADING ---- */
.loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text-muted); font-size: .95rem;
}
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(201,162,39,.2);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: calc(90px + var(--sab)); left: 50%; transform: translateX(-50%);
  background: var(--bg3); color: var(--text);
  padding: 10px 20px; border-radius: 24px;
  font-size: .85rem; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 200;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ---- SEARCH ---- */
.search-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.85); backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  margin: 56px 16px 0; position: relative;
}
.search-input {
  width: 100%; padding: 14px 16px 14px 44px;
  background: var(--bg3); border: 1px solid rgba(201,162,39,.4);
  border-radius: var(--radius); color: var(--text); font-size: 1rem;
  outline: none;
}
.search-input:focus { border-color: var(--gold); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer;
}
.search-results {
  flex: 1; overflow-y: auto; padding: 12px 16px;
}
.search-result-item {
  padding: 14px 16px; background: var(--bg3); border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; border: 1px solid transparent;
  transition: border-color .15s;
}
.search-result-item:hover { border-color: rgba(201,162,39,.4); }
.sri-day { font-size: .75rem; color: var(--gold); margin-bottom: 4px; }
.sri-title { font-size: .95rem; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,162,39,.3); border-radius: 2px; }

/* ---- RESPONSIVE ---- */
@media (min-width: 600px) {
  .calendar-grid { max-width: 500px; margin: 0 auto; }
  .day-header, .day-content { max-width: 700px; margin: 0 auto; }
  .day-nav-row { max-width: 700px; margin: 0 auto; }
}

/* ---- PDF MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 150;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg2); border-radius: var(--radius);
  width: 100%; max-width: 480px; max-height: 90vh;
  display: flex; flex-direction: column;
  border: 1px solid rgba(201,162,39,.3); box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-header {
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.modal-header h3 { color: var(--gold); font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-muted);
               font-size: 1.3rem; cursor: pointer; padding: 2px 6px; }
.modal-body { overflow-y: auto; }

.pdf-tom-btn {
  width: 100%; text-align: left; background: var(--bg3);
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
  padding: 14px 16px; cursor: pointer; transition: all .15s;
  color: var(--text);
}
.pdf-tom-btn:hover { border-color: rgba(201,162,39,.4); background: rgba(201,162,39,.05); }
.ptb-num { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px;
           color: var(--text-muted); margin-bottom: 4px; }
.ptb-title { font-size: .95rem; font-weight: bold; margin-bottom: 4px; }
.ptb-desc { font-size: .8rem; color: var(--text-muted); }

/* ---- Q&A SECTION ---- */
.qa-list { margin-top: 4px; }
.qa-item {
  margin-bottom: 18px; padding: 14px;
  background: rgba(74,159,213,.04); border-radius: 8px;
  border: 1px solid rgba(74,159,213,.12);
}
.qa-q {
  font-size: .88rem; color: var(--accent); font-weight: bold;
  margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start;
}
.qa-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(74,159,213,.2); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; flex-shrink: 0; margin-top: 1px;
}
.qa-a { font-size: .9rem; line-height: 1.65; color: var(--text); padding-left: 30px; }

/* ======== COMMENTS ======== */
.cmt-block { margin-top: 16px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 12px; }
.cmt-item {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.cmt-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.cmt-nick { font-size: .8rem; color: var(--gold); font-weight: bold; }
.cmt-date { font-size: .72rem; color: var(--text-muted); flex: 1; }
.cmt-del-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .8rem; padding: 2px 5px; border-radius: 4px;
}
.cmt-del-btn:hover { color: #e55; }
.cmt-body { font-size: .88rem; line-height: 1.6; color: var(--text); }
.cmt-body img { max-width: 100%; border-radius: 6px; margin: 4px 0; }
.cmt-body a { color: var(--accent); }

.cmt-add-btn-row { margin: 8px 0 4px; }
.cmt-toggle-form-btn {
  background: none; border: 1px solid rgba(201,162,39,.25);
  color: var(--text-muted); border-radius: 6px; padding: 6px 14px;
  font-size: .78rem; cursor: pointer; transition: all .2s;
}
.cmt-toggle-form-btn:hover { border-color: var(--gold); color: var(--gold); }

.cmt-form { margin-top: 10px; }
.cmt-form-inner {
  background: var(--bg3); border: 1px solid rgba(201,162,39,.2);
  border-radius: 8px; padding: 12px;
}
.cmt-nick-input {
  width: 100%; background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  color: var(--text); border-radius: 6px; padding: 7px 10px;
  font-size: .85rem; margin-bottom: 8px; outline: none;
}
.cmt-nick-input:focus { border-color: rgba(201,162,39,.4); }
.cmt-editor-toolbar {
  display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 6px;
}
.cmt-editor-toolbar button {
  background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted); border-radius: 4px; padding: 4px 9px;
  cursor: pointer; font-size: .82rem; transition: all .15s; min-width: 28px;
}
.cmt-editor-toolbar button:hover { border-color: var(--gold); color: var(--gold); }
.cmt-editor {
  min-height: 80px; max-height: 300px; overflow-y: auto;
  background: var(--bg2); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; padding: 10px; font-size: .88rem; line-height: 1.6;
  color: var(--text); outline: none; cursor: text;
}
.cmt-editor:focus { border-color: rgba(201,162,39,.35); }
.cmt-editor:empty::before {
  content: attr(data-placeholder); color: var(--text-muted); font-style: italic;
}
.cmt-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.cmt-cancel-btn {
  background: none; border: 1px solid rgba(255,255,255,.15);
  color: var(--text-muted); border-radius: 6px; padding: 6px 14px;
  font-size: .82rem; cursor: pointer;
}
.cmt-submit-btn {
  background: var(--gold); border: none; color: var(--bg);
  border-radius: 6px; padding: 6px 16px; font-size: .82rem;
  font-weight: bold; cursor: pointer;
}

/* ======== TTS PLAYER BAR ======== */
.tts-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: linear-gradient(135deg, #0a1520 0%, #132338 100%);
  border-top: 1px solid rgba(201,162,39,.4);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px calc(16px + var(--sar)) calc(10px + var(--sab)) calc(16px + var(--sal));
  gap: 12px;
  transform: translateY(100%); transition: transform .3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}
.tts-bar.tts-active { transform: translateY(0); }
.tts-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.tts-icon { font-size: 1.2rem; flex-shrink: 0; }
.tts-text { min-width: 0; }
.tts-label {
  font-size: .78rem; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: opacity .15s;
}
.tts-pos { font-size: .7rem; color: var(--text-muted); }
.tts-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tts-btn {
  background: none; border: 1px solid rgba(201,162,39,.3);
  color: var(--text-muted); width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: .85rem; display: flex; align-items: center;
  justify-content: center; transition: all .15s;
}
.tts-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: rgba(201,162,39,.1); }
.tts-btn:disabled { opacity: .3; cursor: default; }
.tts-btn.tts-play {
  width: 40px; height: 40px; background: var(--gold); color: var(--bg);
  border-color: var(--gold); font-size: 1rem;
}
.tts-btn.tts-play:hover { background: var(--gold-light); }
.tts-btn.tts-close { border-color: transparent; font-size: .75rem; }
.tts-read-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: .85rem; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; margin-left: auto; transition: color .15s;
  flex-shrink: 0;
}
.tts-read-btn:hover { color: var(--gold); }

/* Push content above TTS bar when active */
body.tts-playing .day-content { padding-bottom: 140px; }

/* ---- Voice settings panel ---- */
.tts-voice-panel {
  position: fixed; bottom: calc(80px + var(--sab)); right: calc(12px + var(--sar)); z-index: 9100;
  background: var(--bg2); border: 1px solid rgba(201,162,39,.35);
  border-radius: 14px; padding: 18px 20px 16px; width: 290px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 10px;
}
.tvp-title { font-weight: 700; color: var(--gold-light); font-size: .95rem; margin-bottom: 2px; }
.tvp-label { font-size: .8rem; color: var(--text-muted); }
.tvp-select {
  width: 100%; background: var(--bg3); color: var(--text);
  border: 1px solid rgba(201,162,39,.25); border-radius: 8px;
  padding: 7px 10px; font-size: .82rem;
}
.tvp-quick-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tvp-quick-btn {
  flex: 1; min-width: 70px; padding: 5px 6px; font-size: .75rem;
  background: rgba(201,162,39,.1); border: 1px solid var(--gold-dark);
  color: var(--text); border-radius: 6px; cursor: pointer;
}
.tvp-quick-btn:hover { background: rgba(201,162,39,.25); }
.tvp-row { display: flex; flex-direction: column; gap: 3px; }
.tvp-range { width: 100%; accent-color: var(--gold); }
.tvp-test-btn {
  background: rgba(201,162,39,.15); border: 1px solid var(--gold);
  color: var(--gold-light); border-radius: 8px; padding: 8px;
  font-size: .85rem; cursor: pointer;
}
.tvp-test-btn:hover { background: rgba(201,162,39,.3); }
.tvp-close-btn {
  background: none; border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted); border-radius: 8px; padding: 6px;
  font-size: .8rem; cursor: pointer;
}
.tvp-close-btn:hover { border-color: rgba(255,255,255,.3); color: var(--text); }

/* ======== LANGUAGE TOGGLE ======== */
.lang-btn {
  background: none; border: 1px solid rgba(201,162,39,.3);
  color: var(--text-muted); border-radius: 16px; padding: 3px 10px;
  font-size: .72rem; cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--gold); color: var(--gold); }
.lang-btn.en-active { background: rgba(74,159,213,.15); border-color: var(--accent); color: var(--accent); }

#lang-loading {
  display: none; position: fixed; top: 56px; left: 0; right: 0;
  background: rgba(13,27,42,.95); z-index: 90;
  align-items: center; justify-content: center; gap: 10px;
  padding: 10px; font-size: .85rem; color: var(--text-muted);
  border-bottom: 1px solid rgba(201,162,39,.2);
}


/* ---- Bible sections ---- */
.bible-ref-badge {
  display: inline-block;
  background: rgba(201,162,39,.15);
  color: var(--gold-light);
  border: 1px solid rgba(201,162,39,.3);
  border-radius: 10px;
  font-size: .72rem;
  padding: 1px 8px;
  margin-left: 8px;
  font-weight: 600;
  letter-spacing: .02em;
  vertical-align: middle;
}
.bible-book-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.bible-text-container {
  min-height: 40px;
}
.bible-load-btn {
  background: rgba(201,162,39,.1);
  border: 1px solid rgba(201,162,39,.25);
  color: var(--gold-light);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .2s;
}
.bible-load-btn:hover { background: rgba(201,162,39,.2); }
.bible-loading {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 8px 0;
}
p.bible-text {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 8px;
}
sup.bv-num {
  color: var(--gold);
  font-size: .68rem;
  font-weight: 700;
  margin-right: 2px;
  vertical-align: super;
  opacity: .85;
}
.bv-text { }

/* ---- Read ribbon / bookmark ---- */
.read-ribbon-btn {
  /* Bookmark/ribbon shape: rectangle with V-notch at bottom */
  align-self: stretch;
  width: 22px;
  min-width: 22px;
  margin-left: 6px;
  margin-top: -10px;
  margin-bottom: -10px;
  border: none;
  background: rgba(201,162,39,.18);
  cursor: pointer;
  flex-shrink: 0;
  clip-path: polygon(0% 0%, 100% 0%, 100% 82%, 50% 100%, 0% 82%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  transition: background .18s, transform .1s;
  color: transparent;
}
.read-ribbon-btn::before { content: none; }
/* Unread: faint tint of the section's own colour; active: full colour */
.read-ribbon-btn.read-active {
  background: var(--ribbon-color, var(--gold));
}
.read-ribbon-btn.read-active::after {
  content: '✓';
  font-size: 10px;
  font-weight: 700;
  color: #0d1b2a;
  line-height: 1;
}
.read-ribbon-btn:hover { background: rgba(201,162,39,.38); }
.read-ribbon-btn.read-active:hover { filter: brightness(1.12); }

/* ---- Rosary introduction (first tajemnica of each part) ---- */
.rosary-intro {
  border: 1px solid rgba(201,162,39,.3);
  border-radius: var(--radius);
  background: rgba(201,162,39,.06);
  padding: 14px 16px; margin: 0 0 16px;
}
.ri-head {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); margin-bottom: 10px;
}
.ri-cross { font-size: .95rem; color: var(--gold-light); text-align: center; margin: 0 0 12px; font-style: italic; }
.ri-prayer { margin: 0 0 12px; }
.ri-name {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 3px;
}
.ri-prayer p { font-size: .9rem; line-height: 1.65; color: var(--text); margin: 0; }
.ri-foot { font-size: .8rem; font-style: italic; color: var(--text-muted); border-top: 1px solid rgba(201,162,39,.2); padding-top: 8px; margin-top: 4px; }
[data-theme="light"] .ri-cross { color: #8a6a08; }

/* ---- Drogi (nabożeństwa stacyjne) ---- */
.drogi-badge {
  font-size: .62rem; letter-spacing: .5px; text-transform: none;
  color: var(--text-muted); background: rgba(201,162,39,.12);
  border: 1px solid rgba(201,162,39,.25); border-radius: 10px;
  padding: 1px 8px; margin-left: 6px; white-space: nowrap;
}
.drogi-subtitle { font-size: .78rem; font-style: italic; color: var(--text-muted); margin: 0 0 10px; }
.drogi-intro { font-size: .86rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.6; }
.drogi-version { margin-bottom: 18px; }
.drogi-version-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); margin-bottom: 8px; border-bottom: 1px solid rgba(201,162,39,.2); padding-bottom: 4px;
}
.drogi-station { margin: 0 0 10px; }
.drogi-st-title { font-size: 1rem; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.drogi-st-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; margin-right: 6px;
  border-radius: 11px; background: var(--gold); color: #0d1b2a;
  font-size: .75rem; font-weight: 700;
}
.drogi-st-ref { font-size: .76rem; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.drogi-inv { font-size: .9rem; color: var(--gold-light); font-style: italic; margin: 0 0 8px; }
.drogi-med { font-size: .92rem; line-height: 1.7; color: var(--text); margin: 0 0 8px; }
.drogi-resp { font-size: .9rem; color: var(--gold-light); font-style: italic; margin: 0 0 4px; }
[data-theme="light"] .drogi-inv,
[data-theme="light"] .drogi-resp { color: #8a6a08; }
[data-theme="light"] .drogi-st-num { color: #f7f2e9; }

/* Per-section TTS speaker button */
.sec-tts-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: .9rem; cursor: pointer; padding: 2px 6px; line-height: 1;
  flex-shrink: 0; border-radius: 4px; transition: color .15s, background .15s;
  margin-left: auto;
}
.sec-tts-btn:hover { color: var(--gold); background: rgba(201,162,39,.12); }

/* PWA install CTA */
#pwa-install-btn {
  display: none; /* shown via JS when beforeinstallprompt fires */
  position: fixed; bottom: calc(6px + var(--sab)); left: 50%; transform: translateX(-50%);
  z-index: 30; align-items: center; gap: 8px;
  background: var(--gold); color: #0d1b2a; border: none;
  padding: 10px 24px; border-radius: 24px; font-size: .88rem; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 16px rgba(201,162,39,.45);
  white-space: nowrap; animation: pwa-pulse 2.5s ease-in-out infinite;
}
#pwa-install-btn:hover { background: var(--gold-light); }
@keyframes pwa-pulse {
  0%,100% { box-shadow: 0 4px 16px rgba(201,162,39,.4); }
  50%      { box-shadow: 0 4px 28px rgba(201,162,39,.8); }
}

/* Entire section gets gold left stripe when read */
.section.section-read {
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.section.section-read > .section-header {
  padding-left: 13px;
}

/* ---- Stats modal ---- */
.stats-grid-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg3);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.06);
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.1;
}
.stat-label { font-size: .78rem; color: var(--text); margin-top: 2px; }
.stat-sub { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }

.stat-section-title {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 4px 0 10px;
}
.stat-overview-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-overview-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  overflow: hidden;
}
.stat-overview-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width .4s ease;
  min-width: 2px;
}
.stat-overview-pct {
  font-size: .82rem;
  color: var(--gold-light);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}
.stat-rows { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.stat-row-icon { width: 20px; text-align: center; font-size: 1rem; }
.stat-row-label { flex: 1; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-row-bar {
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.stat-row-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .4s ease;
  min-width: 2px;
}
.stat-row-count {
  font-size: .75rem;
  color: var(--text-muted);
  min-width: 52px;
  text-align: right;
}

/* ======== MOBILE / CAPACITOR ANDROID ======== */
@media (max-width: 480px), (pointer: coarse) {
  /* Larger touch targets */
  .cal-day          { min-height: 40px; font-size: .9rem; }
  .cal-header       { font-size: .65rem; }
  .section-header   { padding: 14px 16px; min-height: 52px; }
  .tts-btn          { width: 40px; height: 40px; font-size: 1rem; }
  .tts-btn.tts-play { width: 46px; height: 46px; font-size: 1.1rem; }
  .topbar-btn       { width: 44px; height: 44px; font-size: 1.5rem; }
  .nav-btn          { padding: 10px 16px; font-size: .9rem; min-height: 44px; }
  .month-nav button { width: 44px; height: 44px; font-size: 1.1rem; }

  /* Day view comfortable reading */
  .section-body     { padding: 14px 16px; font-size: 1rem; line-height: 1.75; }
  .day-header       { padding: 20px 16px 18px; }
  .day-header h2    { font-size: 1.2rem; }
  .day-nav-row      { padding: 10px 12px; gap: 8px; }

  /* Bottom nav buttons row on calendar */
  #calendar-screen > div:last-child {
    padding: 12px 12px calc(16px + var(--sab)) !important;
    gap: 8px;
  }
  #calendar-screen > div:last-child .nav-btn {
    flex: 1; text-align: center; justify-content: center;
    padding: 10px 8px; font-size: .82rem;
  }

  /* Modals full-width on mobile */
  .modal-box        { margin: 0 8px; }

  /* TTS bar bigger on touch */
  .tts-label        { font-size: .82rem; }
  .tts-pos          { font-size: .72rem; }
}

/* ======================================================
   THEME SWITCH BUTTON
   ====================================================== */
#theme-toggle-btn {
  background: none; border: 1px solid rgba(201,162,39,.3);
  color: var(--text-muted); border-radius: 16px; padding: 3px 8px;
  font-size: .85rem; cursor: pointer; transition: all .2s;
  white-space: nowrap; line-height: 1.4;
}
#theme-toggle-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ======================================================
   LIGHT MODE  –  [data-theme="light"] on <html>
   ====================================================== */
[data-theme="light"] {
  --bg:         #f7f2e9;
  --bg2:        #ece4d3;
  --bg3:        #e1d7c3;
  --gold:       #8b6508;
  --gold-light: #a07818;
  --text:       #1c1505;
  --text-muted: #6b6047;
  --accent:     #2068a0;
  --shadow:     0 4px 20px rgba(0,0,0,0.15);
}

/* Body & html background */
[data-theme="light"] html,
[data-theme="light"] body { background: var(--bg); color: var(--text); }

/* Topbar */
[data-theme="light"] .topbar {
  background: var(--bg2);
  border-bottom-color: rgba(139,101,8,.3);
}

/* Sections – replace rgba(255,255,255,.xx) borders with dark equivalents */
[data-theme="light"] .section { border-bottom-color: rgba(0,0,0,.1); }
[data-theme="light"] .section-body { border-color: rgba(0,0,0,.06); }
[data-theme="light"] .day-nav-row { border-bottom-color: rgba(0,0,0,.08); }

/* Day header */
[data-theme="light"] .day-header {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border-bottom-color: rgba(139,101,8,.3);
}

/* Calendar cells */
[data-theme="light"] .cal-day         { background: var(--bg3); }
[data-theme="light"] .cal-day.has-entry { background: var(--bg2); border-color: rgba(139,101,8,.25); }
[data-theme="light"] .cal-day.has-entry:hover { background: rgba(139,101,8,.1); }
[data-theme="light"] .cal-day.today   { background: rgba(139,101,8,.18); border-color: var(--gold); }

/* Month nav */
[data-theme="light"] .month-nav       { background: var(--bg2); }

/* Search overlay */
[data-theme="light"] .search-overlay  { background: rgba(247,242,233,.92); backdrop-filter: blur(6px); }
[data-theme="light"] .search-input    { background: var(--bg3); border-color: rgba(139,101,8,.4); color: var(--text); }
[data-theme="light"] .search-result-item { background: var(--bg3); }

/* Modals */
[data-theme="light"] .modal-overlay   { background: rgba(247,242,233,.8); }
[data-theme="light"] .modal-box       { background: var(--bg2); border-color: rgba(139,101,8,.3); }
[data-theme="light"] .modal-header    { border-bottom-color: rgba(0,0,0,.1); }
[data-theme="light"] .pdf-tom-btn     { background: var(--bg3); border-color: rgba(0,0,0,.1); color: var(--text); }

/* TTS bar – hardcoded dark gradient → light */
[data-theme="light"] .tts-bar {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border-top-color: rgba(139,101,8,.4);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
}
[data-theme="light"] .tts-btn { border-color: rgba(139,101,8,.3); color: var(--text-muted); }
[data-theme="light"] .tts-btn.tts-play { background: var(--gold); color: #f7f2e9; border-color: var(--gold); }

/* TTS voice panel */
[data-theme="light"] .tts-voice-panel { background: var(--bg2); border-color: rgba(139,101,8,.35); box-shadow: 0 8px 32px rgba(0,0,0,.2); }
[data-theme="light"] .tvp-select { background: var(--bg3); color: var(--text); }

/* Comments */
[data-theme="light"] .cmt-block       { border-top-color: rgba(0,0,0,.1); }
[data-theme="light"] .cmt-item        { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.1); }
[data-theme="light"] .cmt-editor      { background: var(--bg3); border-color: rgba(0,0,0,.12); color: var(--text); }
[data-theme="light"] .cmt-form-inner  { background: var(--bg3); border-color: rgba(139,101,8,.2); }
[data-theme="light"] .cmt-nick-input  { background: var(--bg2); border-color: rgba(0,0,0,.15); color: var(--text); }
[data-theme="light"] .cmt-editor-toolbar button { background: var(--bg2); border-color: rgba(0,0,0,.12); color: var(--text-muted); }

/* Bible sections */
[data-theme="light"] .bible-ref-badge { background: rgba(139,101,8,.12); border-color: rgba(139,101,8,.3); }
[data-theme="light"] .bible-book-label { border-bottom-color: rgba(0,0,0,.08); }
[data-theme="light"] .bible-load-btn  { background: rgba(139,101,8,.1); border-color: rgba(139,101,8,.25); }

/* Mystery block */
[data-theme="light"] .mystery-title {
  background: rgba(32,104,160,.07);
  border-left-color: var(--accent);
}

/* Calls block */
[data-theme="light"] .calls-block { background: rgba(139,101,8,.04); border-color: rgba(139,101,8,.2); }

/* Stat cards */
[data-theme="light"] .stat-card { background: var(--bg3); border-color: rgba(0,0,0,.08); }
[data-theme="light"] .stat-overview-bar,
[data-theme="light"] .stat-row-bar    { background: rgba(0,0,0,.1); }

/* QA */
[data-theme="light"] .qa-item { background: rgba(32,104,160,.04); border-color: rgba(32,104,160,.15); }

/* PWA install button */
[data-theme="light"] #pwa-install-btn { background: var(--gold); color: #f7f2e9; }

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(139,101,8,.3); }

/* Toast */
[data-theme="light"] .toast { background: var(--bg3); color: var(--text); }

/* Section read indicator */
[data-theme="light"] .section.section-read > .section-header { border-left-color: var(--gold); }

/* Rosary SVG – swap hardcoded colours for day-screen background */
[data-theme="light"] #day-screen { background: var(--bg); }

/* ═══════════════════════════════════════════════════════════════════════
   Intro section + tekst
   ═══════════════════════════════════════════════════════════════════════ */
.section--intro > .section-header {
  border-left: 4px solid #4ade80;
}
.intro-text {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════
   Wyrównanie tekstu
   ═══════════════════════════════════════════════════════════════════════ */
.justified-text {
  text-align: justify;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  word-break: break-word;
}
.left-text    { text-align: left; }
.center-text  { text-align: center; }
.right-text   { text-align: right; }

/* Klasy wyrównania z edytora Quill — nadpisują .justified-text per akapit */
p.ql-align-justify,  li.ql-align-justify  { text-align: justify !important; hyphens: auto; }
p.ql-align-left,     li.ql-align-left     { text-align: left    !important; hyphens: none; }
p.ql-align-center,   li.ql-align-center   { text-align: center  !important; hyphens: none; }
p.ql-align-right,    li.ql-align-right    { text-align: right   !important; hyphens: none; }

/* ═══════════════════════════════════════════════════════════════════════
   Ramka QR / placeholder multimedialny
   ═══════════════════════════════════════════════════════════════════════ */
.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 8px;
  justify-content: flex-start;
}

.qr-frame {
  --qr-size: 88px;
  --qr-corner: 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: var(--qr-size);
  height: var(--qr-size);
  padding: 4px;
  border: 1.5px solid var(--gold, #c8a45a);
  border-radius: 6px;
  background:
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) top    left  / var(--qr-corner) 2px no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) top    left  / 2px var(--qr-corner) no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) top    right / var(--qr-corner) 2px no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) top    right / 2px var(--qr-corner) no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) bottom left  / var(--qr-corner) 2px no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) bottom left  / 2px var(--qr-corner) no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) bottom right / var(--qr-corner) 2px no-repeat,
    linear-gradient(var(--gold, #c8a45a), var(--gold, #c8a45a)) bottom right / 2px var(--qr-corner) no-repeat,
    transparent;
  color: var(--gold, #c8a45a);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.qr-frame:hover {
  opacity: .85;
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(201,162,39,.35);
}

/* Ramka z wygenerowanym kodem QR — trochę większa */
.qr-frame.has-qr {
  --qr-size: 110px;
  padding: 6px;
}

.qr-frame__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.qr-frame__icon svg { width: 100%; height: 100%; }

.qr-frame__code {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-frame__code svg {
  width: 100%;
  height: auto;
  color: var(--text, #e8e4d9);
}

.qr-frame__label {
  font-size: .6rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text-muted, #999);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-frame__placeholder {
  display: none; /* ukryty w wersji cyfrowej */
  font-size: .55rem;
  color: var(--text-muted, #999);
  letter-spacing: .05em;
  font-style: italic;
}

.qr-frame--small { --qr-size: 64px; }

/* Druk: pokaż placeholder QR zamiast ikony */
@media print {
  .qr-frame {
    border: 2px solid #333 !important;
    background: transparent !important;
    color: #333 !important;
  }
  .qr-frame__icon { display: none !important; }
  .qr-frame__placeholder {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60px;
    font-size: .8rem;
    letter-spacing: .1em;
    color: #333;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Modal generatora QR
   ═══════════════════════════════════════════════════════════════════════ */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.qr-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.qr-modal-box {
  background: var(--bg2, #132338);
  border: 1px solid rgba(201,162,39,.4);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  transform: translateY(20px) scale(.97);
  transition: transform .25s;
}
.qr-modal-overlay.open .qr-modal-box {
  transform: translateY(0) scale(1);
}

.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.qr-modal-header h3 {
  color: var(--gold, #c9a227);
  font-size: 1rem;
  letter-spacing: .3px;
}
.qr-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, #9ba8b5);
  font-size: 1.2rem;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.qr-modal-close:hover { color: var(--gold, #c9a227); background: rgba(201,162,39,.12); }

.qr-modal-body {
  padding: 20px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Podgląd kodu QR */
.qr-modal-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3, #1a2f4a);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  min-height: 200px;
  padding: 16px;
  position: relative;
}

.qr-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted, #9ba8b5);
  text-align: center;
}
.qr-preview-placeholder svg { opacity: .5; }
.qr-preview-placeholder p {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-muted, #9ba8b5);
}

.qr-preview-code {
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-preview-code svg {
  color: var(--text, #e8e4d9);
  border-radius: 4px;
}

.qr-preview-code.hidden,
.qr-preview-placeholder.hidden {
  display: none;
}

/* Pola URL i etykiety */
.qr-url-label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted, #9ba8b5);
  margin-bottom: 6px;
}
.qr-url-input {
  width: 100%;
  background: var(--bg3, #1a2f4a);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text, #e8e4d9);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.qr-url-input:focus {
  border-color: rgba(201,162,39,.5);
  box-shadow: 0 0 0 3px rgba(201,162,39,.1);
}
.qr-url-hint {
  font-size: .75rem;
  color: var(--text-muted, #9ba8b5);
  line-height: 1.5;
  margin-top: 6px;
}

/* Akcje */
.qr-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.qr-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}
.qr-btn-primary {
  background: var(--gold, #c9a227);
  color: var(--bg, #0d1b2a);
}
.qr-btn-primary:hover { background: var(--gold-light, #e8c84e); transform: translateY(-1px); }
.qr-btn-secondary {
  background: var(--bg3, #1a2f4a);
  color: var(--text-muted, #9ba8b5);
  border: 1px solid rgba(255,255,255,.1);
}
.qr-btn-secondary:hover { border-color: rgba(201,162,39,.4); color: var(--gold, #c9a227); }

/* Real QR code container and styling */
.qr-code-container {
  display: block;
  text-align: center;
  margin: 16px auto;
  max-width: 180px;
}
.qr-code-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.qr-code-link:hover {
  transform: scale(1.05);
}
.qr-code-img {
  max-width: 150px;
  width: 100%;
  height: auto;
  border: 2px solid var(--gold, #c9a227);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  display: block;
  margin: 0 auto;
}
.qr-code-label {
  font-size: 0.8rem;
  color: var(--text-muted, #9ba8b5);
  margin-top: 6px;
  font-weight: 500;
  text-align: center;
}

