/* ==========================================================================
   RENTINGLOCK — motyw aplikacji
   Warstwa nadpisań na Bootstrap 5.2. Bez kroku budowania, bez JS.
   Kolejność: 1) zmienne  2) nadpisania Bootstrapa  3) klasy własne rl-
   Wszystkie wartości wyciągnięte z makiet: logowanie, rejestracja,
   generowanie kodu, lista zamków.
   ========================================================================== */

/* ==========================================================================
   1. ZMIENNE
   ========================================================================== */

:root {
  /* --- Kolory marki ------------------------------------------------------
     rl-brand      logo, akcenty dekoracyjne, ikony (nie dla małego tekstu)
     rl-primary    wypełnienie przycisku głównego (biały tekst = AA 4.6:1)
     rl-primary-ink linki i mały tekst na białym tle (AA 5.8:1)            */
  --rl-brand: #1487CE;
  --rl-primary: #1177B8;
  --rl-primary-hover: #0F6BA6;
  --rl-primary-active: #0B5580;
  --rl-primary-soft: #E8F1F9;
  --rl-primary-soft-2: #EEF4F9;
  --rl-primary-ink: #0F6BA6;

  /* --- Tekst ------------------------------------------------------------
     rl-subtle i rl-faint tylko dla tekstu >= 16px, ikon i separatorów.    */
  --rl-ink: #0E1621;
  --rl-body: #3C4A5A;
  --rl-muted: #5C6B7C;
  --rl-subtle: #7A8899;
  --rl-faint: #98A5B4;
  --rl-placeholder: #A6B2BF;
  --rl-label: #6B7889;

  /* --- Powierzchnie i linie --------------------------------------------- */
  --rl-bg: #E9EDF2;
  --rl-surface: #FFFFFF;
  --rl-surface-alt: #FAFBFD;
  --rl-surface-sunken: #F2F5F8;
  --rl-surface-shell: #F5F7FA;
  --rl-line: #DDE3EA;
  --rl-line-card: #E1E7ED;
  --rl-line-soft: #EDF1F5;
  --rl-line-row: #F0F3F7;

  /* --- Stany ------------------------------------------------------------
     *-ink dla tekstu, gołe dla kropek/pasków, *-soft dla tła plakietek.   */
  --rl-success: #1E9E6A;
  --rl-success-ink: #137B51;
  --rl-success-soft: #E8F6EE;
  --rl-warning: #D2860B;
  --rl-warning-ink: #8A5A06;
  --rl-warning-soft: #FBF1DF;
  --rl-danger: #C33A3A;
  --rl-danger-ink: #A82F2F;
  --rl-danger-soft: #FDECEC;
  --rl-neutral-soft: #F2F5F8;
  --rl-neutral-ink: #5C6B7C;

  /* --- Panel ciemny (ekrany wejścia, mail) ------------------------------ */
  --rl-night: #0E1621;
  --rl-night-line: #1E2B3A;
  --rl-night-text: #A9B7C6;
  --rl-night-accent: #4FB3EA;
  --rl-night-faint: #66748A;

  /* --- Typografia ------------------------------------------------------- */
  --rl-font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rl-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --rl-text-2xs: 11px;   /* etykieta wersalikowa */
  --rl-text-xs: 12px;    /* plakietka, etykieta pola */
  --rl-text-sm: 13px;    /* meta, komórka tabeli */
  --rl-text-base: 14px;  /* tekst pomocniczy, nawigacja */
  --rl-text-md: 15px;    /* tekst pola, akapit */
  --rl-text-lg: 16px;    /* nazwa w wierszu, przycisk XL */
  --rl-text-xl: 19px;    /* logo, tytuł karty w panelu */
  --rl-text-2xl: 22px;
  --rl-text-3xl: 27px;   /* tytuł formularza */
  --rl-text-4xl: 30px;   /* tytuł ekranu */
  --rl-text-5xl: 34px;   /* nagłówek panelu marki */
  --rl-weight-regular: 400;
  --rl-weight-medium: 500;
  --rl-weight-semibold: 600;
  --rl-weight-bold: 700;
  --rl-track-tight: -.02em;
  --rl-track-label: .06em;
  --rl-track-caps: .1em;
  --rl-leading-tight: 1.2;
  --rl-leading-body: 1.55;

  /* --- Odstępy (siatka 4/8 px) ------------------------------------------ */
  --rl-space-1: 4px;
  --rl-space-2: 8px;
  --rl-space-3: 12px;
  --rl-space-4: 16px;
  --rl-space-5: 20px;
  --rl-space-6: 24px;
  --rl-space-7: 28px;
  --rl-space-8: 32px;
  --rl-space-10: 40px;
  --rl-space-11: 44px;
  --rl-space-14: 56px;

  /* --- Promienie -------------------------------------------------------- */
  --rl-radius-xs: 5px;   /* plakietka */
  --rl-radius-sm: 6px;
  --rl-radius-md: 8px;   /* przycisk S */
  --rl-radius-lg: 10px;  /* pole, przycisk L */
  --rl-radius-xl: 14px;  /* karta */
  --rl-radius-2xl: 16px; /* powłoka ekranu */
  --rl-radius-pill: 999px;

  /* --- Wysokości kontrolek --------------------------------------------- */
  --rl-control-sm: 34px;
  --rl-control-md: 38px;
  --rl-control-lg: 44px;
  --rl-control-xl: 50px;

  /* --- Cienie ----------------------------------------------------------- */
  --rl-shadow-card: 0 1px 2px rgba(14, 22, 33, .04);
  --rl-shadow-raised: 0 12px 32px -18px rgba(14, 22, 33, .3);
  --rl-shadow-modal: 0 32px 80px -28px rgba(14, 22, 33, .45);
  --rl-focus-ring: 0 0 0 3px rgba(20, 135, 206, .28);
}

/* ==========================================================================
   2. NADPISANIA BOOTSTRAPA
   Motyw wchodzi przez zmienne --bs-*; komponenty tylko tam, gdzie zmienna
   nie wystarcza (przyciski, pola, tabela).
   ========================================================================== */

:root {
  --bs-body-font-family: var(--rl-font-sans);
  --bs-body-font-size: var(--rl-text-md);
  --bs-body-color: var(--rl-body);
  --bs-body-bg: var(--rl-bg);
  --bs-emphasis-color: var(--rl-ink);
  --bs-secondary-color: var(--rl-muted);
  --bs-border-color: var(--rl-line);
  --bs-border-radius: var(--rl-radius-lg);
  --bs-border-radius-sm: var(--rl-radius-md);
  --bs-border-radius-lg: var(--rl-radius-xl);
  --bs-primary: var(--rl-primary);
  --bs-primary-rgb: 17, 119, 184;
  --bs-danger: var(--rl-danger);
  --bs-success: var(--rl-success);
  --bs-warning: var(--rl-warning);
  --bs-link-color: var(--rl-primary-ink);
  --bs-link-hover-color: var(--rl-primary-active);
  --bs-font-monospace: var(--rl-font-mono);
  --bs-heading-color: var(--rl-ink);
}

body {
  background: var(--rl-bg);
  color: var(--rl-body);
  font-family: var(--rl-font-sans);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1, h2, h3, h4, h5 { color: var(--rl-ink); letter-spacing: var(--rl-track-tight); font-weight: var(--rl-weight-bold); }
a { color: var(--rl-primary-ink); text-decoration: none; }
a:hover { color: var(--rl-primary-active); text-decoration: underline; }
code, kbd, samp, .font-monospace { font-family: var(--rl-font-mono); }

*:focus-visible { outline: none; box-shadow: var(--rl-focus-ring); border-radius: var(--rl-radius-md); }

/* Bootstrapowe .btn / .form-control dostają wygląd motywu, żeby stare
   fragmenty ERB nie odstawały od klas rl-. */
.btn { font-weight: var(--rl-weight-semibold); border-radius: var(--rl-radius-lg); }
.btn-primary {
  --bs-btn-bg: var(--rl-primary);
  --bs-btn-border-color: var(--rl-primary);
  --bs-btn-hover-bg: var(--rl-primary-hover);
  --bs-btn-hover-border-color: var(--rl-primary-hover);
  --bs-btn-active-bg: var(--rl-primary-active);
  --bs-btn-active-border-color: var(--rl-primary-active);
}
.btn-outline-secondary {
  --bs-btn-color: var(--rl-body);
  --bs-btn-border-color: var(--rl-line);
  --bs-btn-hover-bg: var(--rl-surface-sunken);
  --bs-btn-hover-color: var(--rl-ink);
  --bs-btn-hover-border-color: #B9C4D0;
}
.form-control, .form-select {
  border-color: var(--rl-line);
  border-radius: var(--rl-radius-lg);
  color: var(--rl-ink);
  font-size: var(--rl-text-md);
  min-height: var(--rl-control-lg);
}
.form-control:focus, .form-select:focus { border-color: var(--rl-brand); box-shadow: var(--rl-focus-ring); }
.form-control::placeholder { color: var(--rl-placeholder); }
.table { --bs-table-color: var(--rl-body); --bs-table-border-color: var(--rl-line-row); }
.card { border-color: var(--rl-line-card); border-radius: var(--rl-radius-xl); }
.badge { font-weight: var(--rl-weight-bold); border-radius: var(--rl-radius-sm); }

/* ==========================================================================
   3. KLASY WŁASNE — rl-
   ========================================================================== */

/* --- 3.1 Układ i powłoka ekranu ---------------------------------------- */
.rl-page { min-height: 100vh; background: var(--rl-bg); }
.rl-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--rl-space-4); }
@media (min-width: 768px) { .rl-container { padding: 0 var(--rl-space-7); } }

.rl-main { padding: var(--rl-space-6) 0 var(--rl-space-10); }
@media (min-width: 768px) { .rl-main { padding: var(--rl-space-8) 0 var(--rl-space-14); } }

.rl-stack { display: flex; flex-direction: column; gap: var(--rl-space-5); }
.rl-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rl-space-2); }
.rl-row-between { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--rl-space-4); }
.rl-grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-4); }
@media (min-width: 768px) { .rl-grid-2 { grid-template-columns: 1fr 1fr; gap: var(--rl-space-5); } }
.rl-sidecols { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-5); align-items: start; }
@media (min-width: 992px) { .rl-sidecols { grid-template-columns: minmax(0, 1fr) 320px; } }

/* --- 3.2 Pasek nawigacji ---------------------------------------------- */
.rl-topbar { background: var(--rl-surface); border-bottom: 1px solid var(--rl-line-soft); }
.rl-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-4); min-height: 64px; }
.rl-brand { display: inline-flex; align-items: center; gap: var(--rl-space-2); font-size: var(--rl-text-xl); font-weight: var(--rl-weight-bold); letter-spacing: -.01em; color: var(--rl-brand); text-decoration: none; }
.rl-brand:hover { color: var(--rl-brand); text-decoration: none; }
.rl-brand-mark { border: 2px solid currentColor; border-radius: var(--rl-radius-xs); padding: 0 6px; }
.rl-brand--light { color: #FFFFFF; }
.rl-brand--light .rl-brand-mark { color: var(--rl-night-accent); }

.rl-nav { display: none; align-items: center; gap: var(--rl-space-1); }
@media (min-width: 768px) { .rl-nav { display: flex; } }
.rl-nav-link { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--rl-radius-md); font-size: var(--rl-text-base); font-weight: var(--rl-weight-medium); color: var(--rl-muted); text-decoration: none; }
.rl-nav-link:hover { background: var(--rl-surface-sunken); color: var(--rl-ink); text-decoration: none; }
.rl-nav-link.is-active { background: var(--rl-primary-soft-2); color: var(--rl-ink); font-weight: var(--rl-weight-semibold); }
.rl-nav-sep { width: 1px; height: 24px; background: var(--rl-line-soft); margin: 0 var(--rl-space-2); }
.rl-user { display: flex; align-items: center; gap: var(--rl-space-3); }
.rl-user-mail { display: none; font-size: var(--rl-text-base); font-weight: var(--rl-weight-medium); color: var(--rl-body); }
@media (min-width: 992px) { .rl-user-mail { display: inline; } }
.rl-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--rl-ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); flex: none; }

/* Hamburger + szuflada bez JS: checkbox + label */
.rl-hamburger { display: inline-flex; align-items: center; justify-content: center; width: var(--rl-control-lg); height: var(--rl-control-lg); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); color: var(--rl-body); cursor: pointer; }
@media (min-width: 768px) { .rl-hamburger { display: none; } }
.rl-drawer-toggle { position: absolute; opacity: 0; pointer-events: none; }
.rl-drawer { display: none; flex-direction: column; gap: var(--rl-space-1); padding: var(--rl-space-3) 0 var(--rl-space-4); border-top: 1px solid var(--rl-line-soft); }
.rl-drawer .rl-nav-link { height: var(--rl-control-lg); font-size: var(--rl-text-md); }
.rl-drawer-toggle:checked ~ .rl-drawer { display: flex; }

/* Nawigacja dolna (mobile) */
.rl-bottomnav { display: flex; align-items: stretch; justify-content: space-around; background: var(--rl-surface); border-top: 1px solid var(--rl-line-soft); padding: var(--rl-space-2) 0 var(--rl-space-1); }
.rl-bottomnav-item { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-semibold); color: var(--rl-subtle); text-decoration: none; }
.rl-bottomnav-item:hover { color: var(--rl-ink); text-decoration: none; }
.rl-bottomnav-item.is-active { color: var(--rl-primary-ink); }

/* --- 3.3 Karta --------------------------------------------------------- */
.rl-card { background: var(--rl-surface); border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-xl); box-shadow: var(--rl-shadow-card); }
.rl-card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-3); padding: var(--rl-space-4) var(--rl-space-5); border-bottom: 1px solid var(--rl-line-soft); }
.rl-card-body { padding: var(--rl-space-5); }
@media (min-width: 768px) { .rl-card-body { padding: var(--rl-space-6); } }
.rl-card-footer { display: flex; align-items: center; gap: var(--rl-space-3); padding: var(--rl-space-4) var(--rl-space-5); border-top: 1px solid var(--rl-line-soft); }
.rl-card-title { font-size: var(--rl-text-lg); font-weight: var(--rl-weight-semibold); letter-spacing: -.01em; color: var(--rl-ink); margin: 0; }
.rl-shell { background: var(--rl-surface-shell); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-2xl); overflow: hidden; box-shadow: var(--rl-shadow-raised); }

/* --- 3.4 Typografia użytkowa ------------------------------------------ */
.rl-h1 { font-size: var(--rl-text-4xl); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-tight); color: var(--rl-ink); margin: 0; }
.rl-h2 { font-size: var(--rl-text-3xl); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-tight); color: var(--rl-ink); margin: 0; }
.rl-h3 { font-size: var(--rl-text-xl); font-weight: var(--rl-weight-semibold); letter-spacing: -.01em; color: var(--rl-ink); margin: 0; }
.rl-lead { font-size: var(--rl-text-md); line-height: var(--rl-leading-body); color: var(--rl-muted); margin: 0; }
.rl-meta { font-size: var(--rl-text-sm); color: var(--rl-muted); margin: 0; }
.rl-mono { font-family: var(--rl-font-mono); }
.rl-caps { font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-caps); text-transform: uppercase; color: var(--rl-label); }
.rl-section-label { font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--rl-label); }

/* --- 3.5 Przyciski ---------------------------------------------------- */
.rl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--rl-space-2);
  height: var(--rl-control-lg); padding: 0 var(--rl-space-5);
  border: 1px solid transparent; border-radius: var(--rl-radius-lg);
  font-family: inherit; font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold);
  line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.rl-btn:hover { text-decoration: none; }
.rl-btn svg { flex: none; }
.rl-btn-sm { height: var(--rl-control-sm); padding: 0 var(--rl-space-4); font-size: var(--rl-text-sm); border-radius: var(--rl-radius-md); }
.rl-btn-lg { height: var(--rl-control-xl); padding: 0 var(--rl-space-6); font-size: var(--rl-text-lg); }
.rl-btn-block { width: 100%; }

.rl-btn-primary { background: var(--rl-primary); color: #fff; }
.rl-btn-primary:hover { background: var(--rl-primary-hover); color: #fff; }
.rl-btn-primary:active { background: var(--rl-primary-active); }
.rl-btn-secondary { background: var(--rl-surface); border-color: var(--rl-line); color: var(--rl-body); }
.rl-btn-secondary:hover { border-color: #B9C4D0; background: var(--rl-surface-alt); color: var(--rl-ink); }
.rl-btn-danger { background: var(--rl-danger); color: #fff; }
.rl-btn-danger:hover { background: #A82F2F; color: #fff; }
.rl-btn-ghost { background: transparent; color: var(--rl-primary-ink); }
.rl-btn-ghost:hover { background: var(--rl-primary-soft); color: var(--rl-primary-active); }
.rl-btn:disabled, .rl-btn.is-disabled { background: var(--rl-surface-sunken); border-color: transparent; color: var(--rl-faint); cursor: not-allowed; }
.rl-btn-secondary:disabled, .rl-btn-secondary.is-disabled { background: var(--rl-surface); border-color: var(--rl-line-soft); color: var(--rl-faint); }

/* Segmentowany przełącznik (zakładki listy/kalendarza) */
.rl-seg { display: inline-flex; align-items: center; gap: var(--rl-space-1); padding: 3px; background: var(--rl-surface-sunken); border-radius: var(--rl-radius-lg); }
.rl-seg-item { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; border-radius: var(--rl-radius-sm); background: transparent; color: var(--rl-muted); font-family: inherit; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); text-decoration: none; cursor: pointer; }
.rl-seg-item:hover { color: var(--rl-ink); text-decoration: none; }
.rl-seg-item.is-active { background: var(--rl-surface); color: var(--rl-ink); box-shadow: var(--rl-shadow-card); }
.rl-seg-count { font-family: var(--rl-font-mono); font-size: var(--rl-text-xs); color: var(--rl-placeholder); }
.rl-seg-item.is-active .rl-seg-count { color: var(--rl-primary-ink); }

/* --- 3.6 Pola formularza ---------------------------------------------- */
.rl-field { display: flex; flex-direction: column; gap: 7px; }
.rl-label { font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-label); text-transform: uppercase; color: var(--rl-label); }
.rl-label-note { font-weight: var(--rl-weight-medium); letter-spacing: 0; text-transform: none; color: var(--rl-placeholder); }
.rl-input, .rl-select, .rl-textarea {
  width: 100%; min-height: var(--rl-control-lg); padding: 0 14px;
  border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface);
  font-family: inherit; font-size: var(--rl-text-md); color: var(--rl-ink);
}
.rl-input::placeholder, .rl-textarea::placeholder { color: var(--rl-placeholder); }
.rl-input:hover, .rl-select:hover, .rl-textarea:hover { border-color: #C8D2DC; }
.rl-input:focus, .rl-select:focus, .rl-textarea:focus { outline: none; border-color: var(--rl-brand); box-shadow: var(--rl-focus-ring); }
.rl-input:disabled, .rl-textarea:disabled, .rl-select:disabled { background: var(--rl-surface-sunken); color: var(--rl-faint); cursor: not-allowed; }
.rl-textarea { min-height: 104px; padding: var(--rl-space-3) 14px; line-height: var(--rl-leading-body); resize: vertical; }
.rl-input--mono { font-family: var(--rl-font-mono); letter-spacing: .04em; }
.rl-select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%237A8899' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.rl-field.is-invalid .rl-input, .rl-field.is-invalid .rl-select, .rl-field.is-invalid .rl-textarea { border-color: var(--rl-danger); background: #FFFCFC; }
.rl-error { display: flex; align-items: center; gap: 6px; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-medium); color: var(--rl-danger-ink); }
.rl-hint { font-size: 12.5px; color: var(--rl-muted); }
.rl-input-group { display: flex; align-items: center; gap: var(--rl-space-3); min-height: var(--rl-control-lg); padding: 0 14px; border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); }
.rl-input-group:focus-within { border-color: var(--rl-brand); box-shadow: var(--rl-focus-ring); }
.rl-input-group .rl-input { border: 0; padding: 0; min-height: auto; box-shadow: none; }
.rl-input-group .rl-input:focus { box-shadow: none; }
.rl-affix { font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-body); font-family: var(--rl-font-mono); }
.rl-affix-sep { width: 1px; height: 20px; background: var(--rl-line-soft); flex: none; }
.rl-affix-btn { border: 0; background: none; padding: 0; font-family: inherit; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); color: var(--rl-subtle); cursor: pointer; }
.rl-affix-btn:hover { color: var(--rl-ink); }
.rl-check { display: flex; align-items: flex-start; gap: var(--rl-space-3); font-size: 13.5px; line-height: var(--rl-leading-body); color: var(--rl-body); }
.rl-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--rl-primary); flex: none; }
.rl-strength { display: flex; align-items: center; gap: 14px; }
.rl-strength-track { display: flex; gap: var(--rl-space-1); flex: 1; }
.rl-strength-track span { height: 4px; flex: 1; border-radius: 2px; background: var(--rl-line-soft); }
.rl-strength-track span.is-on { background: var(--rl-success); }
.rl-chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-chip { display: inline-flex; align-items: center; justify-content: center; min-width: var(--rl-control-lg); height: var(--rl-control-lg); padding: 0 var(--rl-space-3); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); color: var(--rl-muted); font-size: var(--rl-text-sm); font-weight: var(--rl-weight-bold); letter-spacing: .04em; cursor: pointer; }
.rl-chip:hover { border-color: #B9C4D0; color: var(--rl-ink); text-decoration: none; }
.rl-chip.is-active { border-color: var(--rl-brand); background: var(--rl-primary-soft-2); color: var(--rl-primary-ink); }
.rl-preset { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--rl-space-3); border: 0; border-radius: var(--rl-radius-sm); background: var(--rl-surface-sunken); color: var(--rl-body); font-family: inherit; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); cursor: pointer; text-decoration: none; }
.rl-preset:hover { background: #E6EDF4; color: var(--rl-ink); text-decoration: none; }

/* --- 3.7 Plakietki i kropki stanu ------------------------------------- */
.rl-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--rl-radius-sm); font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); white-space: nowrap; }
.rl-badge--lg { height: 26px; padding: 0 10px; }
.rl-badge--info { background: var(--rl-primary-soft); color: var(--rl-primary-ink); }
.rl-badge--success { background: var(--rl-success-soft); color: var(--rl-success-ink); }
.rl-badge--warning { background: var(--rl-warning-soft); color: var(--rl-warning-ink); }
.rl-badge--danger { background: var(--rl-danger-soft); color: var(--rl-danger-ink); }
.rl-badge--neutral { background: var(--rl-neutral-soft); color: var(--rl-neutral-ink); }
.rl-badge--caps { text-transform: uppercase; letter-spacing: .04em; font-size: var(--rl-text-2xs); height: 20px; }
.rl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }

/* --- 3.8 Komunikaty ---------------------------------------------------- */
.rl-alert { display: flex; align-items: flex-start; gap: var(--rl-space-3); padding: var(--rl-space-4); border: 1px solid; border-radius: var(--rl-radius-lg); font-size: var(--rl-text-base); line-height: var(--rl-leading-body); }
.rl-alert-title { display: block; font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); margin-bottom: 2px; }
.rl-alert svg { margin-top: 2px; flex: none; }
.rl-alert--info { background: var(--rl-primary-soft); border-color: #CFE3F3; color: var(--rl-primary-ink); }
.rl-alert--success { background: var(--rl-success-soft); border-color: #C9E9D8; color: var(--rl-success-ink); }
.rl-alert--warning { background: var(--rl-warning-soft); border-color: #EEDCB4; color: var(--rl-warning-ink); }
.rl-alert--danger { background: var(--rl-danger-soft); border-color: #F5D2D2; color: var(--rl-danger-ink); }

/* --- 3.9 Tabela i paginacja ------------------------------------------- */
.rl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rl-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.rl-table th { height: 40px; padding: 0 var(--rl-space-4); background: var(--rl-surface-alt); border-bottom: 1px solid var(--rl-line-soft); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-caps); text-transform: uppercase; color: var(--rl-label); text-align: left; white-space: nowrap; }
.rl-table td { height: 52px; padding: 0 var(--rl-space-4); border-bottom: 1px solid #F3F6F9; font-size: 13.5px; color: var(--rl-body); }
.rl-table tbody tr:hover { background: var(--rl-surface-alt); }
.rl-table .rl-td-mono { font-family: var(--rl-font-mono); }
.rl-table .rl-td-code { font-family: var(--rl-font-mono); font-weight: var(--rl-weight-bold); letter-spacing: .04em; color: var(--rl-ink); }
.rl-table .rl-td-dim { color: var(--rl-muted); }
.rl-table .rl-td-right { text-align: right; }
.rl-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-4); padding: var(--rl-space-3) var(--rl-space-4); border-top: 1px solid var(--rl-line-soft); }
.rl-pages { display: flex; align-items: center; gap: var(--rl-space-1); }
.rl-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 var(--rl-space-2); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-md); background: var(--rl-surface); color: var(--rl-body); font-family: var(--rl-font-mono); font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); text-decoration: none; }
.rl-page-btn:hover { border-color: #B9C4D0; color: var(--rl-ink); text-decoration: none; }
.rl-page-btn.is-active { background: var(--rl-primary); border-color: var(--rl-primary); color: #fff; }
.rl-page-btn.is-disabled { color: var(--rl-faint); border-color: var(--rl-line-soft); pointer-events: none; }

/* --- 3.10 Wiersz zamka (lista) ---------------------------------------- */
.rl-lockrow { display: grid; grid-template-columns: 4px 1fr; align-items: stretch; border-bottom: 1px solid var(--rl-line-row); background: var(--rl-surface); }
.rl-lockrow:last-child { border-bottom: 0; }
.rl-lockrow:hover { background: var(--rl-surface-alt); }
.rl-rail { background: var(--rl-faint); }
.rl-rail--info { background: var(--rl-brand); }
.rl-rail--success { background: var(--rl-success); }
.rl-rail--danger { background: var(--rl-danger); }
.rl-lockrow-body { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); padding: var(--rl-space-4); }
@media (min-width: 768px) {
  .rl-lockrow-body { grid-template-columns: 1.1fr 1.5fr 160px; align-items: center; gap: var(--rl-space-5); padding: var(--rl-space-5) var(--rl-space-5) var(--rl-space-5) var(--rl-space-5); }
}
.rl-lockrow-head { display: flex; flex-direction: column; gap: 3px; }
.rl-lockrow-name { display: flex; align-items: center; gap: var(--rl-space-2); font-size: var(--rl-text-lg); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-lockrow-meta { font-family: var(--rl-font-mono); font-size: var(--rl-text-sm); color: var(--rl-subtle); }
.rl-addr { display: flex; flex-direction: column; gap: 3px; }
.rl-addr-street { font-size: var(--rl-text-md); font-weight: var(--rl-weight-medium); color: var(--rl-ink); }
.rl-addr-city { font-size: var(--rl-text-sm); color: var(--rl-subtle); }
.rl-lockrow-actions { display: flex; align-items: center; justify-content: flex-start; gap: var(--rl-space-2); }
@media (min-width: 768px) { .rl-lockrow-actions { justify-content: flex-end; } }
.rl-listhead { display: none; }
@media (min-width: 768px) {
  .rl-listhead { display: grid; grid-template-columns: 4px 1.1fr 1.5fr 160px; column-gap: var(--rl-space-5); align-items: center; height: 42px; padding-right: var(--rl-space-5); background: var(--rl-surface-alt); border-bottom: 1px solid var(--rl-line-soft); }
  .rl-listhead > span { font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-caps); text-transform: uppercase; color: var(--rl-label); }
  .rl-listhead > span:first-of-type { padding-left: var(--rl-space-5); }
}

/* --- 3.11 Kod dostępu -------------------------------------------------- */
.rl-code { display: flex; flex-direction: column; gap: var(--rl-space-4); padding: var(--rl-space-5); border: 1px solid #CFE3F3; border-radius: var(--rl-radius-xl); background: var(--rl-primary-soft); }
.rl-code-value { font-family: var(--rl-font-mono); font-size: 34px; font-weight: var(--rl-weight-bold); letter-spacing: .14em; color: var(--rl-ink); line-height: 1; word-break: break-word; }
@media (min-width: 768px) { .rl-code-value { font-size: 44px; } }
.rl-code-meta { font-size: var(--rl-text-sm); color: var(--rl-primary-ink); }
.rl-code-actions { display: flex; flex-wrap: wrap; gap: var(--rl-space-2); }

/* --- 3.12 Kalendarz ---------------------------------------------------- */
.rl-cal { display: flex; flex-direction: column; gap: var(--rl-space-3); }
.rl-cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-3); }
.rl-cal-month { font-size: var(--rl-text-lg); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-cal-dows, .rl-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rl-cal-dow { font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--rl-label); text-align: center; padding-bottom: var(--rl-space-1); }
.rl-cal-day { min-height: 56px; display: flex; flex-direction: column; gap: var(--rl-space-1); padding: 6px; border: 1px solid var(--rl-line-soft); border-radius: var(--rl-radius-md); background: var(--rl-surface); font-family: var(--rl-font-mono); font-size: var(--rl-text-sm); font-weight: var(--rl-weight-bold); color: var(--rl-ink); }
@media (min-width: 768px) { .rl-cal-day { min-height: 84px; padding: var(--rl-space-2); } }
.rl-cal-tag { margin-top: auto; font-family: var(--rl-font-sans); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-semibold); line-height: 1.3; color: var(--rl-primary-ink); }
.rl-cal-day.is-busy { background: var(--rl-primary-soft); border-color: #CFE3F3; }
.rl-cal-day.is-start { background: var(--rl-primary-soft); border-color: #CFE3F3; border-left: 3px solid var(--rl-brand); }
.rl-cal-day.is-end { background: var(--rl-primary-soft); border-color: #CFE3F3; border-right: 3px solid var(--rl-brand); }
.rl-cal-day.is-today { border-color: var(--rl-brand); box-shadow: inset 0 0 0 1px var(--rl-brand); }
.rl-cal-day.is-outside { background: var(--rl-surface-alt); color: var(--rl-faint); border-color: var(--rl-line-soft); }
.rl-cal-legend { display: flex; flex-wrap: wrap; gap: var(--rl-space-4); font-size: var(--rl-text-sm); color: var(--rl-muted); }
.rl-legend-item { display: inline-flex; align-items: center; gap: var(--rl-space-2); }
.rl-legend-swatch { width: 14px; height: 14px; border-radius: var(--rl-radius-xs); border: 1px solid var(--rl-line); background: var(--rl-surface); flex: none; }

/* Oś czasu obłożenia (gantt) */
.rl-gantt { display: flex; flex-direction: column; gap: var(--rl-space-2); }
.rl-gantt-scale, .rl-gantt-track { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; }
.rl-gantt-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: var(--rl-space-3) 0; border-bottom: 1px solid var(--rl-line-row); }
@media (min-width: 768px) { .rl-gantt-row { grid-template-columns: 180px 1fr; align-items: center; gap: var(--rl-space-4); } }
.rl-gantt-label { font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-gantt-sub { font-size: var(--rl-text-xs); color: var(--rl-subtle); }
.rl-gantt-day { font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); color: var(--rl-label); text-align: center; }
.rl-gantt-cell { height: 26px; border-radius: var(--rl-radius-xs); background: var(--rl-line-soft); }
.rl-gantt-bar { height: 26px; border-radius: var(--rl-radius-xs); background: var(--rl-brand); color: #fff; font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); display: flex; align-items: center; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.rl-gantt-bar--soft { background: #BFDDF2; color: var(--rl-primary-ink); }
.rl-gantt-bar--block { background: var(--rl-neutral-soft); color: var(--rl-neutral-ink); }

/* --- 3.13 Stany pusty / ładowanie / błąd ------------------------------ */
.rl-empty { display: flex; flex-direction: column; align-items: center; gap: var(--rl-space-3); padding: var(--rl-space-10) var(--rl-space-5); text-align: center; }
.rl-empty-icon { width: 48px; height: 48px; border-radius: var(--rl-radius-xl); background: var(--rl-surface-sunken); color: var(--rl-faint); display: flex; align-items: center; justify-content: center; }
.rl-empty-title { font-size: var(--rl-text-lg); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-empty-text { max-width: 380px; font-size: var(--rl-text-base); line-height: var(--rl-leading-body); color: var(--rl-muted); }
.rl-skeleton { display: flex; flex-direction: column; gap: var(--rl-space-3); padding: var(--rl-space-5); }
.rl-skel { height: 12px; border-radius: var(--rl-radius-sm); background: linear-gradient(90deg, #EDF1F5 25%, #F6F8FA 37%, #EDF1F5 63%); background-size: 400% 100%; animation: rl-shimmer 1.4s ease infinite; }
.rl-skel--title { height: 18px; width: 40%; }
.rl-skel--line { width: 100%; }
.rl-skel--short { width: 60%; }
.rl-skel--pill { height: 22px; width: 88px; border-radius: var(--rl-radius-sm); }
@keyframes rl-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .rl-skel { animation: none; } }
.rl-spinner { width: 20px; height: 20px; border: 2px solid var(--rl-line); border-top-color: var(--rl-primary); border-radius: 50%; animation: rl-spin .8s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }

/* --- 3.14 Okna modalne i warstwy ------------------------------------- */
.rl-modal-layer { position: relative; padding: var(--rl-space-6); background: rgba(14, 22, 33, .55); border-radius: var(--rl-radius-xl); display: flex; justify-content: center; }
.rl-modal { width: 100%; max-width: 480px; background: var(--rl-surface); border-radius: var(--rl-radius-xl); box-shadow: var(--rl-shadow-modal); overflow: hidden; }
.rl-modal--wide { max-width: 560px; }
.rl-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--rl-space-4); padding: var(--rl-space-5) var(--rl-space-5) var(--rl-space-3); }
.rl-modal-title { font-size: var(--rl-text-2xl); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-tight); color: var(--rl-ink); margin: 0; }
.rl-modal-body { padding: 0 var(--rl-space-5) var(--rl-space-5); display: flex; flex-direction: column; gap: var(--rl-space-4); }
.rl-modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--rl-space-2); padding: var(--rl-space-4) var(--rl-space-5); border-top: 1px solid var(--rl-line-soft); background: var(--rl-surface-alt); }
.rl-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--rl-radius-md); background: transparent; color: var(--rl-subtle); cursor: pointer; flex: none; }
.rl-close:hover { background: var(--rl-surface-sunken); color: var(--rl-ink); }
.rl-modal-icon { width: 40px; height: 40px; border-radius: var(--rl-radius-lg); display: flex; align-items: center; justify-content: center; flex: none; }
.rl-modal-icon--danger { background: var(--rl-danger-soft); color: var(--rl-danger-ink); }
.rl-modal-icon--info { background: var(--rl-primary-soft); color: var(--rl-primary-ink); }

/* --- 3.15 Toast, tooltip, popover ------------------------------------ */
.rl-toast-stack { display: flex; flex-direction: column; gap: var(--rl-space-3); width: 100%; max-width: 380px; }
.rl-toast { display: flex; align-items: flex-start; gap: var(--rl-space-3); padding: var(--rl-space-3) var(--rl-space-4); border: 1px solid var(--rl-line-card); border-left: 3px solid var(--rl-faint); border-radius: var(--rl-radius-lg); background: var(--rl-surface); box-shadow: var(--rl-shadow-raised); }
.rl-toast-title { font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-toast-text { font-size: var(--rl-text-sm); color: var(--rl-muted); }
.rl-toast--info { border-left-color: var(--rl-brand); }
.rl-toast--success { border-left-color: var(--rl-success); }
.rl-toast--warning { border-left-color: var(--rl-warning); }
.rl-toast--danger { border-left-color: var(--rl-danger); }
.rl-toast-life { height: 3px; border-radius: 2px; background: var(--rl-line-soft); overflow: hidden; margin-top: 6px; }
.rl-toast-life > span { display: block; height: 3px; background: var(--rl-faint); width: 45%; }

.rl-tip { position: relative; display: inline-flex; align-items: center; }
.rl-tip-trigger { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--rl-surface-sunken); color: var(--rl-muted); font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); cursor: help; }
.rl-tip-bubble { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); min-width: 180px; max-width: 240px; padding: var(--rl-space-2) var(--rl-space-3); border-radius: var(--rl-radius-md); background: var(--rl-ink); color: #fff; font-size: var(--rl-text-sm); line-height: 1.45; opacity: 0; visibility: hidden; transition: opacity .12s ease; z-index: 10; }
.rl-tip-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--rl-ink); }
.rl-tip:hover .rl-tip-bubble, .rl-tip:focus-within .rl-tip-bubble { opacity: 1; visibility: visible; }
.rl-popover { width: 100%; max-width: 320px; padding: var(--rl-space-4); border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-lg); background: var(--rl-surface); box-shadow: var(--rl-shadow-raised); display: flex; flex-direction: column; gap: var(--rl-space-2); }
.rl-popover-title { font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-popover-text { font-size: var(--rl-text-sm); line-height: var(--rl-leading-body); color: var(--rl-muted); }

/* --- 3.16 Zakładki, akordeon, okruszki, kreator ---------------------- */
.rl-tabs { display: flex; gap: var(--rl-space-5); border-bottom: 1px solid var(--rl-line-soft); overflow-x: auto; }
.rl-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px var(--rl-space-3); border: 0; border-bottom: 2px solid transparent; background: none; font-family: inherit; font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-muted); white-space: nowrap; cursor: pointer; text-decoration: none; }
.rl-tab:hover { color: var(--rl-ink); text-decoration: none; }
.rl-tab.is-active { color: var(--rl-primary-ink); border-bottom-color: var(--rl-primary); }

.rl-accordion { display: flex; flex-direction: column; border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-xl); overflow: hidden; background: var(--rl-surface); }
.rl-acc-item { border-bottom: 1px solid var(--rl-line-soft); }
.rl-acc-item:last-child { border-bottom: 0; }
.rl-acc-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-3); padding: var(--rl-space-4) var(--rl-space-5); font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); cursor: pointer; list-style: none; }
.rl-acc-summary::-webkit-details-marker { display: none; }
.rl-acc-summary:hover { background: var(--rl-surface-alt); }
.rl-acc-item[open] .rl-acc-chevron { transform: rotate(180deg); }
.rl-acc-chevron { color: var(--rl-subtle); transition: transform .15s ease; }
.rl-acc-body { padding: 0 var(--rl-space-5) var(--rl-space-5); font-size: var(--rl-text-base); line-height: var(--rl-leading-body); color: var(--rl-muted); }

.rl-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rl-space-2); font-size: var(--rl-text-sm); color: var(--rl-subtle); }
.rl-crumbs a { color: var(--rl-subtle); }
.rl-crumbs a:hover { color: var(--rl-primary-ink); }
.rl-crumbs-sep { color: #C1CAD4; }
.rl-crumbs-current { color: var(--rl-body); font-weight: var(--rl-weight-semibold); }

.rl-steps { display: flex; flex-direction: column; gap: var(--rl-space-3); }
@media (min-width: 768px) { .rl-steps { flex-direction: row; align-items: flex-start; gap: 0; } }
.rl-step { display: flex; align-items: flex-start; gap: var(--rl-space-3); flex: 1; }
.rl-step-num { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rl-line); background: var(--rl-surface); color: var(--rl-subtle); display: flex; align-items: center; justify-content: center; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-bold); flex: none; }
.rl-step-title { font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); color: var(--rl-muted); }
.rl-step-sub { font-size: var(--rl-text-sm); color: var(--rl-subtle); }
.rl-step.is-done .rl-step-num { background: var(--rl-success-soft); border-color: #C9E9D8; color: var(--rl-success-ink); }
.rl-step.is-done .rl-step-title { color: var(--rl-body); }
.rl-step.is-current .rl-step-num { background: var(--rl-primary); border-color: var(--rl-primary); color: #fff; }
.rl-step.is-current .rl-step-title { color: var(--rl-ink); }
.rl-step-line { display: none; }
@media (min-width: 768px) { .rl-step-line { display: block; flex: 1; height: 1px; background: var(--rl-line); margin: 14px var(--rl-space-3) 0; } }

/* --- 3.17 Oś zdarzeń, rozmowa, opinia -------------------------------- */
.rl-timeline { display: flex; flex-direction: column; }
.rl-tl-item { display: grid; grid-template-columns: 20px 1fr; gap: var(--rl-space-3); padding-bottom: var(--rl-space-4); }
.rl-tl-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rl-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rl-faint); margin-top: 5px; flex: none; }
.rl-tl-dot--success { background: var(--rl-success); }
.rl-tl-dot--info { background: var(--rl-brand); }
.rl-tl-dot--warning { background: var(--rl-warning); }
.rl-tl-dot--danger { background: var(--rl-danger); }
.rl-tl-line { width: 1px; flex: 1; background: var(--rl-line-soft); }
.rl-tl-what { font-size: var(--rl-text-base); font-weight: var(--rl-weight-medium); color: var(--rl-ink); }
.rl-tl-when { font-family: var(--rl-font-mono); font-size: 12.5px; color: var(--rl-subtle); }

.rl-chat { display: flex; flex-direction: column; gap: var(--rl-space-3); }
.rl-msg { max-width: 78%; padding: var(--rl-space-3) var(--rl-space-4); border-radius: var(--rl-radius-xl); font-size: var(--rl-text-base); line-height: var(--rl-leading-body); }
.rl-msg-when { display: block; margin-top: 6px; font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); }
.rl-msg--guest { align-self: flex-start; background: var(--rl-surface-sunken); color: var(--rl-body); border-bottom-left-radius: var(--rl-radius-xs); }
.rl-msg--guest .rl-msg-when { color: var(--rl-subtle); }
.rl-msg--host { align-self: flex-end; background: var(--rl-primary); color: #fff; border-bottom-right-radius: var(--rl-radius-xs); }
.rl-msg--host .rl-msg-when { color: #CFE3F3; }
.rl-chat-day { align-self: center; font-size: var(--rl-text-xs); font-weight: var(--rl-weight-semibold); color: var(--rl-subtle); }

.rl-review { display: flex; flex-direction: column; gap: var(--rl-space-3); }
.rl-stars { display: inline-flex; gap: 2px; color: var(--rl-warning); }
.rl-stars .is-off { color: var(--rl-line); }
.rl-review-text { font-size: var(--rl-text-md); line-height: var(--rl-leading-body); color: var(--rl-body); }
.rl-reply { margin-left: var(--rl-space-5); padding: var(--rl-space-4); border-left: 2px solid var(--rl-line); background: var(--rl-surface-alt); border-radius: 0 var(--rl-radius-lg) var(--rl-radius-lg) 0; }

/* --- 3.18 Wskaźniki i wykres ---------------------------------------- */
.rl-stats { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); }
@media (min-width: 576px) { .rl-stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .rl-stats { grid-template-columns: repeat(4, 1fr); } }
.rl-stat { display: flex; flex-direction: column; gap: 6px; padding: var(--rl-space-4) var(--rl-space-5); background: var(--rl-surface); border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-xl); }
.rl-stat-label { font-size: var(--rl-text-xs); font-weight: var(--rl-weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--rl-label); }
.rl-stat-value { font-size: 30px; font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-tight); color: var(--rl-ink); line-height: 1.1; }
.rl-stat-delta { font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); }
.rl-stat-delta--up { color: var(--rl-success-ink); }
.rl-stat-delta--down { color: var(--rl-danger-ink); }
.rl-stat-delta--flat { color: var(--rl-muted); }
.rl-meter { height: 5px; border-radius: 3px; background: var(--rl-line-soft); overflow: hidden; }
.rl-meter > span { display: block; height: 5px; border-radius: 3px; background: var(--rl-success); }
.rl-meter--warning > span { background: var(--rl-warning); }
.rl-meter--danger > span { background: var(--rl-danger); }
.rl-chart { width: 100%; height: auto; display: block; }

/* --- 3.19 Filtry i pasek narzędzi ----------------------------------- */
.rl-filters { display: flex; flex-direction: column; gap: var(--rl-space-2); }
@media (min-width: 768px) { .rl-filters { flex-direction: row; flex-wrap: wrap; align-items: center; } }
.rl-search { display: flex; align-items: center; gap: var(--rl-space-2); height: var(--rl-control-md); padding: 0 var(--rl-space-3); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); }
@media (min-width: 768px) { .rl-search { width: 260px; } }
.rl-search:focus-within { border-color: var(--rl-brand); box-shadow: var(--rl-focus-ring); }
.rl-search svg { color: var(--rl-faint); flex: none; }
.rl-search input { flex: 1; min-width: 0; border: 0; background: none; font-family: inherit; font-size: var(--rl-text-base); color: var(--rl-ink); }
.rl-search input:focus { outline: none; }
.rl-filter-btn { display: inline-flex; align-items: center; gap: var(--rl-space-2); height: var(--rl-control-md); padding: 0 var(--rl-space-4); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); color: var(--rl-body); font-family: inherit; font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); cursor: pointer; text-decoration: none; }
.rl-filter-btn:hover { border-color: #B9C4D0; color: var(--rl-ink); text-decoration: none; }
.rl-filter-btn.is-active { border-color: var(--rl-brand); background: var(--rl-primary-soft-2); color: var(--rl-primary-ink); }
.rl-filter-select { height: var(--rl-control-md); min-height: var(--rl-control-md); font-size: var(--rl-text-base); width: auto; }
.rl-filters-spacer { flex: 1; }

/* --- 3.20 Panel marki (logowanie / rejestracja) --------------------- */
.rl-auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 992px) { .rl-auth { grid-template-columns: 1fr 1fr; } }
.rl-auth-brand { display: none; background: var(--rl-night); padding: var(--rl-space-11) var(--rl-space-10); flex-direction: column; justify-content: space-between; gap: var(--rl-space-10); }
@media (min-width: 992px) { .rl-auth-brand { display: flex; } }
.rl-auth-claim { font-size: var(--rl-text-5xl); font-weight: var(--rl-weight-semibold); line-height: var(--rl-leading-tight); letter-spacing: -.025em; color: #fff; }
.rl-auth-list { display: flex; flex-direction: column; gap: var(--rl-space-4); }
.rl-auth-item { display: flex; align-items: flex-start; gap: var(--rl-space-3); font-size: var(--rl-text-md); line-height: var(--rl-leading-body); color: var(--rl-night-text); }
.rl-auth-item .rl-dot { color: var(--rl-night-accent); margin-top: 8px; }
.rl-auth-step { width: 26px; height: 26px; border-radius: var(--rl-radius-md); background: var(--rl-night-line); color: var(--rl-night-accent); display: flex; align-items: center; justify-content: center; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-bold); flex: none; }
.rl-auth-foot { font-size: var(--rl-text-sm); color: var(--rl-night-faint); }
.rl-auth-panel { background: var(--rl-surface); display: flex; align-items: center; justify-content: center; padding: var(--rl-space-8) var(--rl-space-4) var(--rl-space-10); }
@media (min-width: 768px) { .rl-auth-panel { padding: var(--rl-space-11) var(--rl-space-10); } }
.rl-auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--rl-space-6); }
.rl-auth-mobile-brand { display: flex; margin-bottom: var(--rl-space-2); }
@media (min-width: 992px) { .rl-auth-mobile-brand { display: none; } }

/* --- 3.21 Pomocniki --------------------------------------------------- */
.rl-divider { height: 1px; background: var(--rl-line-soft); border: 0; margin: 0; }
.rl-vis-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rl-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- 3.22 Przewodnik po stylach (tylko style-guide.html) ------------- */
.rl-guide-nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--rl-line-soft); backdrop-filter: blur(6px); }
.rl-guide-nav-inner { display: flex; gap: var(--rl-space-4); overflow-x: auto; padding: var(--rl-space-3) 0; font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); }
.rl-guide-section { padding-top: var(--rl-space-10); display: flex; flex-direction: column; gap: var(--rl-space-5); }
.rl-guide-title { display: flex; align-items: baseline; gap: var(--rl-space-3); flex-wrap: wrap; }
.rl-guide-grid { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-4); }
@media (min-width: 576px) { .rl-guide-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .rl-guide-grid--3 { grid-template-columns: repeat(3, 1fr); } .rl-guide-grid--4 { grid-template-columns: repeat(4, 1fr); } }
.rl-spec { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--rl-radius-xs); background: var(--rl-ink); color: #fff; font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-medium); }
.rl-spec--ghost { background: var(--rl-surface-sunken); color: var(--rl-muted); }
.rl-specrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rl-space-2); }
.rl-swatch { display: flex; flex-direction: column; gap: var(--rl-space-2); }
.rl-swatch-chip { height: 64px; border-radius: var(--rl-radius-lg); border: 1px solid rgba(14, 22, 33, .08); }
.rl-swatch-name { font-size: var(--rl-text-sm); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-swatch-hex { font-family: var(--rl-font-mono); font-size: var(--rl-text-xs); color: var(--rl-muted); }
.rl-swatch-use { font-size: var(--rl-text-xs); line-height: 1.45; color: var(--rl-subtle); }
.rl-demo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rl-space-3); }
.rl-demo--col { flex-direction: column; align-items: stretch; }
.rl-demo-box { padding: var(--rl-space-5); border: 1px dashed var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface-alt); }
.rl-space-bar { height: 16px; border-radius: 3px; background: var(--rl-brand); }
.rl-radius-box { height: 56px; border: 2px solid var(--rl-brand); background: var(--rl-primary-soft); }

/* ==========================================================================
   3.23 KALENDARZ HOTELOWY — pobyt liczony od połowy dnia
   Zameldowanie około 16:00, wymeldowanie około 11:00, więc dzień przyjazdu
   i wyjazdu są wypełnione po skosie, nie na całą szerokość.
   ========================================================================== */

/* Widok miesiąca dla jednego mieszkania */
.rl-hcal { display: flex; flex-direction: column; gap: var(--rl-space-3); }
.rl-hcal-grid, .rl-hcal-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.rl-hday { position: relative; min-height: 60px; padding: 6px 7px; border: 1px solid var(--rl-line-soft); border-radius: var(--rl-radius-sm); background: var(--rl-surface); font-family: var(--rl-font-mono); font-size: var(--rl-text-sm); font-weight: var(--rl-weight-medium); color: var(--rl-body); overflow: hidden; }
@media (min-width: 768px) { .rl-hday { min-height: 76px; padding: var(--rl-space-2); } }
.rl-hday-num { position: relative; z-index: 1; }
.rl-hday-tag { position: relative; z-index: 1; display: block; margin-top: var(--rl-space-3); font-family: var(--rl-font-sans); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-semibold); color: var(--rl-primary-ink); line-height: 1.3; }
/* pobyt w całości: cały dzień zajęty */
.rl-hday.is-stay { background: var(--rl-primary-soft); border-color: #D9E8F5; }
/* przyjazd: wypełnienie od skosu w prawo (od ~16:00) */
.rl-hday.is-in { background: linear-gradient(112deg, var(--rl-surface) 46%, var(--rl-primary-soft) 46.5%); border-color: #D9E8F5; }
/* wyjazd: wypełnienie do skosu (do ~11:00) */
.rl-hday.is-out { background: linear-gradient(112deg, var(--rl-primary-soft) 30%, var(--rl-surface) 30.5%); border-color: #D9E8F5; }
/* dzień zmiany gościa: wyjazd rano, przyjazd po południu */
.rl-hday.is-turn { background: linear-gradient(112deg, var(--rl-primary-soft) 30%, var(--rl-surface) 30.5%, var(--rl-surface) 46%, #D5E7F6 46.5%); border-color: #D9E8F5; }
.rl-hday.is-today { border-color: var(--rl-brand); box-shadow: inset 0 0 0 1px var(--rl-brand); }
.rl-hday.is-outside { background: var(--rl-surface-alt); color: var(--rl-faint); }
.rl-hday.is-blocked { background: repeating-linear-gradient(112deg, var(--rl-surface-sunken) 0 6px, var(--rl-surface) 6px 12px); color: var(--rl-muted); }

/* Oś czasu wielu mieszkań — jedna kolumna na pół dnia */
.rl-hstrip { display: flex; flex-direction: column; }
.rl-hstrip-row { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-2); padding: var(--rl-space-3) 0; border-bottom: 1px solid var(--rl-line-row); }
@media (min-width: 768px) { .rl-hstrip-row { grid-template-columns: 190px 1fr; align-items: center; gap: var(--rl-space-4); } }
.rl-hstrip-row:last-child { border-bottom: 0; }
.rl-hstrip-name { font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-hstrip-sub { font-family: var(--rl-font-mono); font-size: var(--rl-text-xs); color: var(--rl-subtle); }
/* 14 dni = 28 półdniowych kolumn; zmień liczbę tylko tutaj */
.rl-hstrip-scale, .rl-hstrip-track { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); align-items: center; }
.rl-hstrip-scale { border-bottom: 1px solid var(--rl-line-soft); padding-bottom: 6px; }
.rl-hstrip-daylabel { grid-column: span 2; text-align: center; font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); color: var(--rl-label); }
.rl-hstrip-daylabel.is-today { color: var(--rl-primary-ink); font-weight: var(--rl-weight-bold); }
.rl-hstrip-track { min-height: 34px; background-image: repeating-linear-gradient(to right, var(--rl-line-soft) 0 1px, transparent 1px calc(100% / 14)); background-size: calc(100% / 14) 100%; }
/* Pasek pobytu: skos na obu końcach oddaje godzinę wejścia i wyjścia */
.rl-stay { position: relative; height: 26px; display: flex; align-items: center; padding: 0 var(--rl-space-3); background: var(--rl-brand); color: #fff; font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 3px; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.rl-stay--soft { background: #BFDDF2; color: var(--rl-primary-ink); }
.rl-stay--block { background: repeating-linear-gradient(112deg, #E3E9F0 0 7px, #EEF2F6 7px 14px); color: var(--rl-neutral-ink); }
.rl-stay--now { background: var(--rl-primary); box-shadow: 0 0 0 1px rgba(14, 22, 33, .12); }
.rl-hstrip-now { grid-row: 1; align-self: stretch; width: 2px; background: var(--rl-danger); justify-self: center; }

/* ==========================================================================
   3.24 LISTA MIESZKAŃ
   ========================================================================== */
.rl-prop { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-4); padding: var(--rl-space-4); border-bottom: 1px solid var(--rl-line-row); }
@media (min-width: 992px) { .rl-prop { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.5fr) 170px; align-items: center; gap: var(--rl-space-5); padding: var(--rl-space-5); } }
.rl-prop:last-child { border-bottom: 0; }
.rl-prop:hover { background: var(--rl-surface-alt); }
.rl-prop-name { display: flex; align-items: center; gap: var(--rl-space-2); font-size: var(--rl-text-lg); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-prop-addr { font-size: var(--rl-text-sm); color: var(--rl-muted); }
.rl-facts { display: flex; flex-wrap: wrap; gap: var(--rl-space-2); }
.rl-fact { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid var(--rl-line-soft); border-radius: var(--rl-radius-sm); background: var(--rl-surface-alt); font-size: var(--rl-text-xs); font-weight: var(--rl-weight-semibold); color: var(--rl-body); white-space: nowrap; }
.rl-fact svg { color: var(--rl-subtle); flex: none; }
.rl-fact.is-warn { border-color: #EEDCB4; background: var(--rl-warning-soft); color: var(--rl-warning-ink); }
.rl-fact.is-warn svg { color: var(--rl-warning-ink); }
.rl-fact.is-off { border-color: #F5D2D2; background: var(--rl-danger-soft); color: var(--rl-danger-ink); }
.rl-fact.is-off svg { color: var(--rl-danger-ink); }
.rl-fact.is-missing { border-style: dashed; background: var(--rl-surface); color: var(--rl-subtle); }

/* ==========================================================================
   3.25 NAWIGACJA WYBIERALNA — warianty górnego paska
   ========================================================================== */
.rl-pillnav { display: flex; flex-wrap: wrap; gap: var(--rl-space-2); }
.rl-pillnav-item { display: inline-flex; align-items: center; gap: var(--rl-space-2); height: var(--rl-control-md); padding: 0 var(--rl-space-4); border: 1px solid var(--rl-line); border-radius: var(--rl-radius-pill); background: var(--rl-surface); color: var(--rl-body); font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); text-decoration: none; white-space: nowrap; }
.rl-pillnav-item:hover { border-color: #B9C4D0; color: var(--rl-ink); text-decoration: none; }
.rl-pillnav-item.is-active { background: var(--rl-ink); border-color: var(--rl-ink); color: #fff; }
.rl-pillnav-count { font-family: var(--rl-font-mono); font-size: var(--rl-text-xs); opacity: .7; }
.rl-picker { display: inline-flex; align-items: center; gap: var(--rl-space-3); height: var(--rl-control-lg); padding: 0 14px; border: 1px solid var(--rl-line); border-radius: var(--rl-radius-lg); background: var(--rl-surface); max-width: 100%; }
.rl-picker:hover { border-color: #B9C4D0; }
.rl-picker-label { font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); letter-spacing: var(--rl-track-caps); text-transform: uppercase; color: var(--rl-label); }
.rl-picker select { border: 0; background: none; padding: 0 var(--rl-space-4) 0 0; font-family: inherit; font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); appearance: none; min-width: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%230E1621' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; }
.rl-picker select:focus { outline: none; }

/* ==========================================================================
   3.26 USTAWIENIA — nawigacja pionowa i przełącznik
   ========================================================================== */
.rl-settings { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-5); align-items: start; }
@media (min-width: 992px) { .rl-settings { grid-template-columns: 240px minmax(0, 1fr); } }
.rl-vnav { display: flex; gap: var(--rl-space-1); overflow-x: auto; padding-bottom: var(--rl-space-1); }
@media (min-width: 992px) { .rl-vnav { flex-direction: column; overflow: visible; position: sticky; top: var(--rl-space-5); } }
.rl-vnav-link { display: flex; align-items: center; gap: var(--rl-space-3); min-height: var(--rl-control-lg); padding: 0 14px; border-radius: var(--rl-radius-lg); font-size: var(--rl-text-base); font-weight: var(--rl-weight-medium); color: var(--rl-muted); text-decoration: none; white-space: nowrap; }
.rl-vnav-link:hover { background: var(--rl-surface-sunken); color: var(--rl-ink); text-decoration: none; }
.rl-vnav-link.is-active { background: var(--rl-surface); border: 1px solid var(--rl-line-card); color: var(--rl-ink); font-weight: var(--rl-weight-semibold); box-shadow: var(--rl-shadow-card); }
.rl-vnav-link svg { color: var(--rl-subtle); flex: none; }
.rl-vnav-link.is-active svg { color: var(--rl-primary-ink); }
.rl-setrow { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); padding: var(--rl-space-4) 0; border-bottom: 1px solid var(--rl-line-soft); }
@media (min-width: 768px) { .rl-setrow { grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: var(--rl-space-5); } }
.rl-setrow:last-child { border-bottom: 0; padding-bottom: 0; }
.rl-setrow-title { font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-setrow-desc { font-size: var(--rl-text-sm); line-height: var(--rl-leading-body); color: var(--rl-muted); }
.rl-switch { display: inline-flex; align-items: center; gap: var(--rl-space-3); cursor: pointer; }
.rl-switch input { appearance: none; width: 44px; height: 26px; border-radius: var(--rl-radius-pill); background: #C8D2DC; position: relative; cursor: pointer; flex: none; transition: background-color .15s ease; }
.rl-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(14, 22, 33, .25); transition: transform .15s ease; }
.rl-switch input:checked { background: var(--rl-primary); }
.rl-switch input:checked::after { transform: translateX(18px); }
.rl-switch-text { font-size: var(--rl-text-base); color: var(--rl-body); }

/* ==========================================================================
   3.27 NAKŁADAJĄCE SIĘ KODY NA KALENDARZU
   Trzy typy kodu mają własny język graficzny, nie tylko inny odcień:
   pobytowy — pełne wypełnienie, skos na końcach (godzina zameldowania)
   godzinowy — jasne tło i wyraźna ramka, końce proste (dokładna godzina)
   stały     — kreskowanie, ramka przerywana (powtarza się codziennie)
   ========================================================================== */

.rl-lanes { display: flex; flex-direction: column; gap: 3px; }
.rl-lane { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); align-items: center; min-height: 24px; }
.rl-lane--hours { grid-template-columns: repeat(24, minmax(0, 1fr)); }
/* Wariant „delikatne nakładanie”: kolejne tory wchodzą na siebie o 9 px,
   biała obwódka trzyma je rozdzielne wizualnie. */
.rl-lanes--overlap .rl-lane + .rl-lane { margin-top: -9px; }
.rl-lanes--overlap .rl-lane { position: relative; }
.rl-lanes--overlap .rl-lane:nth-child(1) { z-index: 3; }
.rl-lanes--overlap .rl-lane:nth-child(2) { z-index: 2; }
.rl-lanes--overlap .rl-lane:nth-child(3) { z-index: 1; }
.rl-lanes--overlap .rl-stay, .rl-lanes--overlap .rl-code-bar { box-shadow: 0 0 0 1.5px #fff; }

/* Pasek kodu godzinowego i stałego — proste końce, więc czytelna godzina */
.rl-code-bar { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-code-bar--hour { background: var(--rl-warning-soft); border: 1.5px solid var(--rl-warning); color: var(--rl-warning-ink); }
.rl-code-bar--fixed { background: repeating-linear-gradient(112deg, #E7ECF2 0 6px, #F3F6F9 6px 12px); border: 1.5px dashed #B9C4D0; color: var(--rl-neutral-ink); }
.rl-code-bar--service { background: #E4F1EC; border: 1.5px solid var(--rl-success); color: var(--rl-success-ink); }
.rl-code-bar--wide { height: 26px; font-size: var(--rl-text-xs); }
.rl-more { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--rl-surface-sunken); color: var(--rl-muted); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); }

/* Filtry typów kodu — działają bez JS, na stanie :checked */
.rl-toggles { display: flex; flex-wrap: wrap; gap: var(--rl-space-2); }
.rl-toggle { display: inline-flex; align-items: center; gap: var(--rl-space-2); height: var(--rl-control-md); padding: 0 14px; border: 1px solid var(--rl-brand); border-radius: var(--rl-radius-lg); background: var(--rl-primary-soft-2); font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); cursor: pointer; }
.rl-toggle:hover { border-color: var(--rl-primary-hover); }
.rl-toggle-box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--rl-primary); background: var(--rl-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.rl-toggle-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.rl-cf-input { position: absolute; opacity: 0; pointer-events: none; }
/* stan wyłączony filtru — wygląd etykiety idzie za ukrytym wejściem */
.rl-cf-stay:not(:checked) ~ .rl-cf-scope .rl-toggle--stay,
.rl-cf-hour:not(:checked) ~ .rl-cf-scope .rl-toggle--hour,
.rl-cf-fixed:not(:checked) ~ .rl-cf-scope .rl-toggle--fixed { border-color: var(--rl-line); background: var(--rl-surface); color: var(--rl-muted); }
.rl-cf-stay:not(:checked) ~ .rl-cf-scope .rl-toggle--stay .rl-toggle-box,
.rl-cf-hour:not(:checked) ~ .rl-cf-scope .rl-toggle--hour .rl-toggle-box,
.rl-cf-fixed:not(:checked) ~ .rl-cf-scope .rl-toggle--fixed .rl-toggle-box { background: var(--rl-surface); border-color: #B9C4D0; }
.rl-cf-stay:not(:checked) ~ .rl-cf-scope .rl-toggle--stay .rl-toggle-box svg,
.rl-cf-hour:not(:checked) ~ .rl-cf-scope .rl-toggle--hour .rl-toggle-box svg,
.rl-cf-fixed:not(:checked) ~ .rl-cf-scope .rl-toggle--fixed .rl-toggle-box svg { display: none; }
.rl-cf-stay:not(:checked) ~ .rl-cf-scope .rl-stay--guest,
.rl-cf-stay:not(:checked) ~ .rl-cf-scope .rl-hday-bar--guest { display: none; }
.rl-cf-hour:not(:checked) ~ .rl-cf-scope .rl-code-bar--hour,
.rl-cf-hour:not(:checked) ~ .rl-cf-scope .rl-hday-bar--hour { display: none; }
.rl-cf-fixed:not(:checked) ~ .rl-cf-scope .rl-code-bar--fixed,
.rl-cf-fixed:not(:checked) ~ .rl-cf-scope .rl-hday-bar--fixed { display: none; }

/* Kreski kodów w komórce miesiąca — kilka kodów w jednym dniu */
.rl-hday-bars { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: var(--rl-space-2); }
.rl-hday-bar { height: 5px; border-radius: 2px; }
.rl-hday-bar--guest { background: var(--rl-brand); }
.rl-hday-bar--hour { background: var(--rl-warning); }
.rl-hday-bar--fixed { background: #B9C4D0; }
.rl-hday-bar--half { width: 55%; }
.rl-hday-bar--half-end { width: 40%; margin-left: auto; }
.rl-hday-count { position: relative; z-index: 1; font-family: var(--rl-font-sans); font-size: var(--rl-text-2xs); font-weight: var(--rl-weight-bold); color: var(--rl-muted); }

/* Skala godzinowa dla zbliżenia na jeden dzień */
.rl-hourscale { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); border-bottom: 1px solid var(--rl-line-soft); padding-bottom: 6px; }
.rl-hourscale > span { grid-column: span 3; font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); color: var(--rl-label); }
.rl-hourgrid { background-image: repeating-linear-gradient(to right, var(--rl-line-soft) 0 1px, transparent 1px calc(100% / 8)); background-size: calc(100% / 8) 100%; }

/* ==========================================================================
   3.28 MENU UŻYTKOWNIKA (ikona w prawym górnym rogu)
   <details> + <summary> — otwiera się bez JS.
   ========================================================================== */
.rl-usermenu { position: relative; }
.rl-usermenu-btn { display: flex; align-items: center; gap: var(--rl-space-2); height: var(--rl-control-md); padding: 0 6px 0 8px; border-radius: var(--rl-radius-pill); cursor: pointer; list-style: none; }
.rl-usermenu-btn::-webkit-details-marker { display: none; }
.rl-usermenu-btn:hover { background: var(--rl-surface-sunken); }
.rl-usermenu[open] > .rl-usermenu-btn { background: var(--rl-surface-sunken); }
.rl-usermenu-chevron { color: var(--rl-subtle); transition: transform .15s ease; }
.rl-usermenu[open] .rl-usermenu-chevron { transform: rotate(180deg); }
.rl-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 264px; padding: var(--rl-space-2); border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-xl); background: var(--rl-surface); box-shadow: var(--rl-shadow-modal); }
.rl-menu-head { display: flex; align-items: center; gap: var(--rl-space-3); padding: var(--rl-space-3); }
.rl-menu-name { font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-menu-mail { font-family: var(--rl-font-mono); font-size: var(--rl-text-xs); color: var(--rl-subtle); word-break: break-all; }
.rl-menu-item { display: flex; align-items: center; gap: var(--rl-space-3); min-height: var(--rl-control-lg); padding: 0 var(--rl-space-3); border-radius: var(--rl-radius-md); font-size: var(--rl-text-base); font-weight: var(--rl-weight-medium); color: var(--rl-body); text-decoration: none; }
.rl-menu-item:hover { background: var(--rl-surface-sunken); color: var(--rl-ink); text-decoration: none; }
.rl-menu-item svg { color: var(--rl-subtle); flex: none; }
.rl-menu-item--danger { color: var(--rl-danger-ink); }
.rl-menu-item--danger svg { color: var(--rl-danger-ink); }
.rl-menu-item--danger:hover { background: var(--rl-danger-soft); color: var(--rl-danger-ink); }
.rl-menu-sep { height: 1px; margin: var(--rl-space-2) 0; background: var(--rl-line-soft); }
.rl-menu-badge { margin-left: auto; font-family: var(--rl-font-mono); font-size: var(--rl-text-2xs); color: var(--rl-subtle); }

/* Klucze API */
.rl-key { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); padding: var(--rl-space-4) 0; border-bottom: 1px solid var(--rl-line-soft); }
@media (min-width: 768px) { .rl-key { grid-template-columns: minmax(0, 1fr) 220px auto; align-items: center; gap: var(--rl-space-4); } }
.rl-key:last-child { border-bottom: 0; padding-bottom: 0; }
.rl-keyvalue { display: flex; align-items: center; gap: var(--rl-space-2); height: 34px; padding: 0 var(--rl-space-3); border: 1px solid var(--rl-line-soft); border-radius: var(--rl-radius-md); background: var(--rl-surface-alt); font-family: var(--rl-font-mono); font-size: var(--rl-text-sm); color: var(--rl-ink); overflow: hidden; }
.rl-keyvalue span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-keyvalue--new { border-color: #CFE3F3; background: var(--rl-primary-soft); }

/* ==========================================================================
   3.29 URZĄDZENIA — trzy układy i element „dodaj”
   ========================================================================== */
.rl-devrow { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); padding: var(--rl-space-4) 0; border-bottom: 1px solid var(--rl-line-soft); }
@media (min-width: 768px) { .rl-devrow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 130px auto; align-items: center; gap: var(--rl-space-4); } }
.rl-devrow:last-of-type { border-bottom: 0; }
.rl-devname { display: flex; align-items: center; gap: var(--rl-space-2); font-size: var(--rl-text-md); font-weight: var(--rl-weight-semibold); color: var(--rl-ink); }
.rl-devicon { width: 32px; height: 32px; border-radius: var(--rl-radius-md); background: var(--rl-surface-sunken); color: var(--rl-body); display: flex; align-items: center; justify-content: center; flex: none; }
.rl-devicon--info { background: var(--rl-primary-soft); color: var(--rl-primary-ink); }
.rl-devicon--off { background: var(--rl-danger-soft); color: var(--rl-danger-ink); }
.rl-devgrid { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); }
@media (min-width: 576px) { .rl-devgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .rl-devgrid { grid-template-columns: repeat(3, 1fr); } }
.rl-devcard { display: flex; flex-direction: column; gap: var(--rl-space-4); padding: var(--rl-space-4); border: 1px solid var(--rl-line-card); border-radius: var(--rl-radius-xl); background: var(--rl-surface); }
.rl-devcard:hover { border-color: #C8D2DC; }
.rl-devgroup { display: flex; align-items: center; justify-content: space-between; gap: var(--rl-space-3); padding: var(--rl-space-3) var(--rl-space-4); background: var(--rl-surface-alt); border-top: 1px solid var(--rl-line-soft); border-bottom: 1px solid var(--rl-line-soft); }
.rl-devgroup-name { font-size: var(--rl-text-base); font-weight: var(--rl-weight-bold); color: var(--rl-ink); }
/* Element „dodaj” — kreskowana ramka, ten sam rytm co karta lub wiersz */
.rl-addtile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--rl-space-2); min-height: 148px; padding: var(--rl-space-4); border: 1.5px dashed #C1CAD4; border-radius: var(--rl-radius-xl); background: var(--rl-surface-alt); color: var(--rl-muted); font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); text-align: center; text-decoration: none; cursor: pointer; }
.rl-addtile:hover { border-color: var(--rl-brand); background: var(--rl-primary-soft-2); color: var(--rl-primary-ink); text-decoration: none; }
.rl-addtile-plus { width: 32px; height: 32px; border-radius: 50%; border: 1.5px dashed currentColor; display: flex; align-items: center; justify-content: center; flex: none; }
.rl-addrow { display: flex; align-items: center; justify-content: center; gap: var(--rl-space-2); min-height: var(--rl-control-lg); margin-top: var(--rl-space-3); border: 1.5px dashed #C1CAD4; border-radius: var(--rl-radius-lg); background: var(--rl-surface-alt); color: var(--rl-muted); font-size: var(--rl-text-base); font-weight: var(--rl-weight-semibold); text-decoration: none; cursor: pointer; }
.rl-addrow:hover { border-color: var(--rl-brand); background: var(--rl-primary-soft-2); color: var(--rl-primary-ink); text-decoration: none; }
.rl-addrow--tight { margin: var(--rl-space-3) var(--rl-space-4) var(--rl-space-4); }

/* ==========================================================================
   3.30 BUDYNEK / LOKALIZACJA — nagłówek grupy nad mieszkaniami
   ========================================================================== */
.rl-bldg { border-bottom: 1px solid var(--rl-line); }
.rl-bldg:last-child { border-bottom: 0; }
.rl-bldg-head { display: grid; grid-template-columns: 1fr; gap: var(--rl-space-3); padding: var(--rl-space-4); background: var(--rl-surface-alt); border-bottom: 1px solid var(--rl-line-soft); }
@media (min-width: 992px) { .rl-bldg-head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.5fr) 170px; align-items: center; gap: var(--rl-space-5); padding: var(--rl-space-4) var(--rl-space-5); } }
.rl-bldg-name { display: flex; align-items: center; gap: var(--rl-space-3); font-size: var(--rl-text-lg); font-weight: var(--rl-weight-bold); letter-spacing: -.01em; color: var(--rl-ink); }
.rl-bldg-icon { width: 30px; height: 30px; border-radius: var(--rl-radius-md); background: var(--rl-ink); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.rl-bldg-addr { font-size: var(--rl-text-sm); color: var(--rl-muted); }
/* Mieszkania wewnątrz budynku: wcięcie i pionowa linia pokazują zawieranie */
.rl-bldg-units { position: relative; }
.rl-bldg-units > .rl-prop { padding-left: var(--rl-space-8); }
@media (min-width: 992px) { .rl-bldg-units > .rl-prop { padding-left: var(--rl-space-10); } }
.rl-bldg-units::before { content: ""; position: absolute; top: 0; bottom: var(--rl-space-4); left: var(--rl-space-5); width: 1px; background: var(--rl-line); }
@media (min-width: 992px) { .rl-bldg-units::before { left: var(--rl-space-7); } }
.rl-prop-unit { position: relative; }
.rl-prop-unit::before { content: ""; position: absolute; top: 50%; left: var(--rl-space-5); width: 11px; height: 1px; background: var(--rl-line); }
@media (min-width: 992px) { .rl-prop-unit::before { left: var(--rl-space-7); } }

/* ============================================================================
   3.31  Wylogowanie jako formularz i zamykanie szuflady kliknięciem obok
   ----------------------------------------------------------------------------
   Dwie rzeczy, których pakiet projektowy nie przewidział, bo zakłada zwykłe
   odnośniki i nie zna wymagań tej aplikacji.

   Wylogowanie MUSI być formularzem wysyłanym metodą DELETE — jako odnośnik
   dawało się wywołać cudzym obrazkiem wskazującym /logout. Formularz nie może
   jednak wyglądać jak przycisk przeglądarki, więc zdejmujemy mu domyślny
   wygląd i zostawiamy wygląd pozycji menu.

   Szuflada mobilna otwiera się polem wyboru, bez JavaScriptu. Żeby zamykała
   się także kliknięciem obok, pod nią leży przezroczysta etykieta na całą
   wysokość ekranu, wskazująca to samo pole wyboru.
   ========================================================================== */

.rl-menu-form { display: contents; }

button.rl-menu-item,
button.rl-nav-link {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.rl-drawer { position: relative; z-index: 2; }

/* Menu użytkownika to element details, a ten z definicji nie zamyka się po
   kliknięciu obok — trzeba trafić z powrotem w nagłówek. Rozwiązuje to
   pseudoelement nagłówka rozciągnięty na całe okno, gdy menu jest otwarte:
   kliknięcie gdziekolwiek trafia w nagłówek i zwija menu. Panel menu ma
   z-index 30, więc pozycje w środku pozostają klikalne. */
.rl-usermenu[open] > summary::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  cursor: default;
}

.rl-drawer-backdrop { display: none; }

.rl-drawer-toggle:checked ~ .rl-drawer-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: default;
}

@media (min-width: 768px) {
  .rl-drawer-toggle:checked ~ .rl-drawer-backdrop { display: none; }
}

/* ============================================================================
   3.32  Wybór języka jako pola radio
   ----------------------------------------------------------------------------
   Projekt pokazuje języki jako chipsy ze stanem is-active. Stan dokłada się
   zwykle JavaScriptem, którego tu nie ma, więc chipsy są etykietami ukrytych
   pól radio, a zaznaczenie robi selektor :checked.
   ========================================================================== */

.rl-chip-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.rl-chip-radio:checked + .rl-chip {
  border-color: var(--rl-primary);
  background: var(--rl-primary-soft, var(--rl-surface-sunken));
  color: var(--rl-primary-ink);
  font-weight: var(--rl-weight-bold);
}
.rl-chip-radio:focus-visible + .rl-chip { outline: 2px solid var(--rl-primary); outline-offset: 2px; }

/* 3.33 Prawdziwe logo i diagram na ekranach wejściowych
   ------------------------------------------------------------------
   Logo przyszło jako PNG 1500x400 z dużym marginesem; przycięte do samej
   treści (1236x199) i zapisane w dwóch wariantach: niebieskim na jasne tło
   i białym na ciemny panel. Oryginały leżą nietknięte w design/logo_rl.
   Wysokość ustawiamy, szerokość liczy się sama z proporcji 6.21:1. */

/* Dwie pulapki w tej jednej regule.

   Nie ma tu wlasciwosci display, bo regula lezy na koncu pliku, a @media nie
   podnosi specyficznosci: display ustawiony tutaj wygralby z regula ukrywajaca
   mobilna marke na desktopie i logo wyskoczyloby nad formularzem.

   Jest za to align-self. Oba kontenery wokol logo (.rl-auth-brand i
   .rl-auth-form) to kolumny flex, a te domyslnie rozciagaja dzieci na cala
   szerokosc. Obrazek dostawal wtedy szerokosc panelu przy ustalonej wysokosci,
   czyli wychodzil splaszczony i rozciagniety. flex: none nie pozwala go scisnac. */

.rl-logo { height: 26px; width: auto; align-self: flex-start; flex: none; }
.rl-auth-brand .rl-logo { display: block; height: 30px; }
.rl-brand .rl-logo { height: 24px; }

/* Diagram zastępuje hasło z podpunktami na ciemnym panelu. Górna granica
   470px jest wyliczona tak, żeby podpisy renderowały się co najmniej 11 px
   i całość mieściła się bez przewijania na laptopie 1366x768. Zwiększenie
   powiększa tekst, ale panel zaczyna się przewijać. */
.rl-diagram { display: block; width: 100%; max-width: 470px; height: auto; margin: 0 auto; }

/* 3.34 Nagłówek karty na wąskim ekranie
   ------------------------------------------------------------------
   Nagłówek karty trzyma tytuł, wyszukiwarkę i zakładki w jednym rzędzie
   i nie zawijał go wcale. Na telefonie zawartość nie mieściła się w karcie
   i wychodziła poza prawą krawędź ekranu — tabela pod spodem przewijała się
   poprawnie, bo ma własny kontener, ale sam nagłówek wypychał całą stronę. */

.rl-card-header { flex-wrap: wrap; }
.rl-card-header > * { min-width: 0; max-width: 100%; }

/* Zakładki przewijają się w poziomie wewnątrz karty. Zawijanie ich do drugiej
   linii rozbiłoby pigułkę na dwa kawałki, a przy czterech pozycjach z licznikami
   i tak nie zmieszczą się w rzędzie na telefonie. */
.rl-seg { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rl-seg-item { flex: none; }

/* Na telefonie wyszukiwarka bierze całą szerokość karty zamiast kurczyć się
   do zawartości. Od tabletu w górę wraca do szerokości własnej, żeby nie
   spychać zakładek do osobnego rzędu. */
.rl-filters { width: 100%; }
@media (min-width: 768px) { .rl-filters { width: auto; } }

/* 3.35 Ramki Turbo
   ------------------------------------------------------------------
   Przeglądarka nie zna elementu <turbo-frame>, więc traktuje go jak element
   liniowy. Bez tego karta w środku ramki rozjeżdża układ. */

turbo-frame { display: block; }
