/* Konfigurator naklejek dla klienta (?rrp_naklejki=1, od 0.48). Telefon jak aplikacja (strona sie nie przewija): bryt
   u gory (przewija sie tylko on), pod nim kafelki pozycji albo okienko zaznaczonej pozycji albo biblioteka, na dole cena
   i koszyk. Od 900 px trzy kolumny: biblioteka, bryt, Twoje naklejki z cena. Kolory i przyciski jak konfigurator tapet. */

body.rrn-standalone { margin: 0; overflow: hidden; background: #f6f4f1; }
html.rrn-locked, html.rrn-locked body { overflow: hidden; }
/* Plywajace widzety sklepu zaslanialy pasek koszyka (jak w plannerze: planner.css, tryb aplikacji). */
body.rrn-standalone #CookiebotWidget, body.rrn-standalone .trp-floating-switcher, body.rrn-standalone #trp-floater-ls { display: none !important; }

#rrp-naklejki {
    --rrn-ink: #03295d;
    --rrn-ink-2: #0b3f86;
    --rrn-rose: #c9959a;
    --rrn-rose-2: #f3e4e5;
    --rrn-rose-ink: #8a4f55;
    --rrn-bg: #fbf9f8;
    --rrn-stage: #efebe5;
    --rrn-line: #e3dde0;
    --rrn-field: #c9d2e3;
    --rrn-text: #1d2330;
    --rrn-muted: #5f6573;
    --rrn-ok: #1f7a4d;
    --rrn-warn: #b0413e;
    --rrn-admin: 0px;
    color: var(--rrn-text);
    font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}
body.admin-bar #rrp-naklejki { --rrn-admin: 46px; }
@media (min-width: 783px) { body.admin-bar #rrp-naklejki { --rrn-admin: 32px; } }
#rrp-naklejki *, #rrp-naklejki *::before, #rrp-naklejki *::after { box-sizing: border-box; }
#rrp-naklejki [hidden] { display: none !important; }

/* Flatsome stylizuje same znaczniki (button: wersaliki, line-height 2.4em, min-height, marginesy; input[type=...]: wysokosc
   2.5em i cien; label: blok i pogrubienie; p, li: marginesy; img: height auto). Reset ma moc jednej klasy (.rrn :where())
   - wygrywa z regulami motywu dla znacznikow, przegrywa z klasami ponizej; pola z #rrp-naklejki (motyw: input[type=text]). */
.rrn :where(button, input, a, label, select, textarea, h1, h2, h3, p, ul, li, small, strong, em) {
    font: inherit; letter-spacing: normal; text-transform: none; margin: 0;
}
.rrn :where(button) {
    cursor: pointer; min-height: 0; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit;
    line-height: 1.2; box-shadow: none; text-shadow: none; white-space: normal;
}
.rrn :where(button:disabled) { cursor: default; }
/* iOS: szybkie stukanie w przyciski (+, kafelki) nie powieksza strony. */
#rrp-naklejki button { touch-action: manipulation; }
.rrn :where(h1, h2, h3) { font-family: inherit; font-weight: 700; color: var(--rrn-ink); line-height: 1.2; }
.rrn :where(ul) { list-style: none; padding: 0; }
.rrn :where(strong) { font-weight: 700; }
.rrn :where(small) { font-size: inherit; }
.rrn :where(em) { font-style: normal; }
.rrn :where(img) { max-width: none; }
/* Miniatura, ktorej nie ma (grafika bez pliku): puste jasne pole zamiast ikony zepsutego obrazka. */
.rrn img.is-missing { visibility: hidden; }
.rrn :where(button:focus-visible, a:focus-visible, input:focus-visible) { outline: 3px solid rgba(201, 149, 154, 0.75); outline-offset: 2px; }
#rrp-naklejki input[type="text"], #rrp-naklejki input[type="search"] {
    height: 44px; min-height: 0; max-width: none; margin: 0; padding: 0 12px; border: 1.5px solid var(--rrn-field); border-radius: 10px;
    background: #fff; box-shadow: none; color: var(--rrn-text); font-size: 16px; /* 16 px: iOS nie powieksza strony przy pisaniu */
    line-height: 1.2; -webkit-appearance: none; appearance: none;
}
#rrp-naklejki input[type="text"]:focus, #rrp-naklejki input[type="search"]:focus {
    border-color: var(--rrn-ink); box-shadow: 0 0 0 3px rgba(201, 149, 154, 0.35); outline: none;
}
#rrp-naklejki input[type="range"] {
    width: 100%; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--rrn-ink);
}
.rrn-loading { margin: 0; padding: 40px 16px; text-align: center; color: #5f6573; font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ------------------------------------------------------------------ uklad: telefon */

.rrn-app {
    position: fixed; top: var(--rrn-admin); left: 0; right: 0; bottom: 0; z-index: 1;
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top" "msg" "stage" "dock" "buy";
    background: var(--rrn-bg); overflow: hidden;
    /* Bez zaznaczania tekstu i przeciagania obrazkow (proba przeciagniecia naklejki zaznaczala pol strony). */
    user-select: none; -webkit-user-select: none;
}
.rrn-app input { user-select: text; -webkit-user-select: text; }
.rrn img { -webkit-user-drag: none; }
.rrn-top { grid-area: top; }
.rrn-msg { grid-area: msg; }
.rrn-stage { grid-area: stage; }
.rrn-dock, .rrn-edit, .rrn-lib { grid-area: dock; }
.rrn-buy { grid-area: buy; }
.rrn-side { display: none; }
.rrn-lib { display: none; }
.rrn-app.is-lib .rrn-lib { display: flex; }
.rrn-app.is-lib .rrn-dock, .rrn-app.is-edit .rrn-dock, .rrn-app.is-lib .rrn-edit { display: none; }

.rrn-top {
    display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 4px 8px 4px 4px;
    padding-top: max(4px, env(safe-area-inset-top, 0px)); background: #fff; border-bottom: 1px solid var(--rrn-line);
}
.rrn-back { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--rrn-ink); text-decoration: none; }
.rrn-back:active { background: #f0ece6; }
.rrn-heading { flex: 1; min-width: 0; }
.rrn-heading h1 { font-size: 17px; }
.rrn-heading p { font-size: 12px; color: var(--rrn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrn-top-wall {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1.5px solid var(--rrn-line);
    border-radius: 999px; background: #fff; color: var(--rrn-ink); font-size: 14px; font-weight: 600;
}
.rrn-top-wall:disabled { opacity: 0.45; }

/* ------------------------------------------------------------------ bryt */

.rrn-stage { position: relative; min-height: 0; background: var(--rrn-stage); }
.rrn-scroll {
    height: 100%; overflow-x: hidden; overflow-y: auto; padding: 10px 12px 18px; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; touch-action: pan-y;
}
.rrn-note { margin: 0 auto 8px; color: var(--rrn-ink); font-size: 13px; line-height: 1.35; text-align: center; }
.rrn-ruler {
    position: relative; margin: 0 auto 6px; height: 16px; color: var(--rrn-muted); font-size: 11px; text-align: center; line-height: 16px;
}
.rrn-ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; border-top: 1px solid #b9b2a8; }
.rrn-ruler::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 8px; border-left: 1px solid #b9b2a8; border-right: 1px solid #b9b2a8; }
.rrn-ruler span { position: relative; z-index: 1; padding: 0 8px; background: var(--rrn-stage); }
.rrn-sheet {
    position: relative; margin: 0 auto; background: #fff; border-radius: 3px; box-shadow: 0 6px 20px -10px rgba(40, 30, 20, 0.35), 0 0 0 1px rgba(40, 30, 20, 0.06);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.rrn-sheet-layer { position: absolute; inset: 0; overflow: hidden; }
.rrn-st {
    position: absolute; overflow: hidden; cursor: pointer;
    transition: left 0.16s ease, top 0.16s ease, width 0.16s ease, height 0.16s ease, opacity 0.16s ease;
}
.rrn-st img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.rrn-app.is-edit .rrn-st:not(.is-sel) { opacity: 0.5; }
/* Zaznaczona pozycja: jasne tlo i cienka granatowa ramka (bez zmiany kolorow akwareli), reszta przygaszona. */
.rrn-st.is-sel { border-radius: 4px; background: rgba(243, 228, 229, 0.9); box-shadow: 0 0 0 1px rgba(3, 41, 93, 0.45); }
.rrn-st.is-new { animation: rrn-pop 0.6s ease-out; z-index: 2; }
@keyframes rrn-pop { 0% { transform: scale(1.35); filter: drop-shadow(0 0 6px rgba(3, 41, 93, 0.6)); } 100% { transform: none; filter: none; } }
/* Granica metra pod naklejkami (to nie linia ciecia - arkusz jest jednym kawalkiem), podpis z cena nad nimi. */
.rrn-metre { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed rgba(201, 149, 154, 0.85); pointer-events: none; }
.rrn-metre-label {
    position: absolute; right: 6px; z-index: 3; margin-top: -11px; padding: 2px 8px; border-radius: 999px; background: var(--rrn-rose-2);
    color: var(--rrn-rose-ink); font-size: 11px; font-weight: 700; white-space: nowrap; pointer-events: none;
}
.rrn-free {
    position: absolute; display: flex; align-items: center; justify-content: center; padding: 6px; border: 1.5px dashed rgba(201, 149, 154, 0.7);
    border-radius: 8px; background: repeating-linear-gradient(-45deg, rgba(243, 228, 229, 0.75) 0 6px, rgba(255, 255, 255, 0) 6px 12px);
    color: var(--rrn-rose-ink); font-size: 12px; font-weight: 600; text-align: center; pointer-events: none;
}
.rrn-free span { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); }
.rrn-empty {
    position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 28px 24px; text-align: center;
    color: var(--rrn-muted); font-size: 15px; cursor: pointer;
}
.rrn-empty span { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 240px; }
.rrn-empty svg { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: var(--rrn-rose-2); color: var(--rrn-ink); }
.rrn-logo { position: absolute; height: auto; opacity: 0.9; pointer-events: none; }
.rrn-end { margin: 6px auto 0; color: var(--rrn-ink); font-size: 12px; font-weight: 700; text-align: right; }

/* Komunikat nad brytem (wlasny wiersz ukladu - nie zaslania naklejek, bryt sie kurczy). */
.rrn-msg {
    position: relative; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; padding: 8px 44px 8px 12px;
    border-left: 4px solid var(--rrn-ink); border-bottom: 1px solid var(--rrn-line); background: #fff; font-size: 14px; animation: rrn-in 0.18s ease-out;
}
.rrn-msg p { flex: 1 1 150px; min-width: 0; }
.rrn-msg.is-warn { border-left-color: var(--rrn-rose); background: #fdf7f7; }
.rrn-msg.is-ok { border-left-color: var(--rrn-ok); background: #f5fbf7; }
.rrn-msg-action {
    flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--rrn-ink); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.rrn-msg-action.is-link { padding: 0 4px; background: none; color: var(--rrn-ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* Telefon z otwarta biblioteka: zostaja tylko komunikaty o limicie (cena jest w dolnym pasku), biblioteka ma miejsce. */
.rrn-app.is-lib .rrn-msg:not(.is-limit) { display: none; }
.rrn-msg-x { position: absolute; top: 50%; right: 4px; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; color: var(--rrn-muted); font-size: 22px; line-height: 1; }
@keyframes rrn-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ kafelki pozycji (telefon) */

.rrn-dock {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; background: #fff; border-top: 1px solid var(--rrn-line);
    scrollbar-width: none; overscroll-behavior-x: contain;
}
.rrn-dock::-webkit-scrollbar { display: none; }
.rrn-tile-add {
    /* Przypiety z lewej; cien w lewo zaslania margines listy (przewijane kafelki nie przeswituja obok). */
    position: sticky; left: 0; z-index: 1; box-shadow: -14px 0 0 2px #fff, 8px 0 10px -6px #fff;
    flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 104px; min-height: 64px;
    padding: 6px; border: 2px dashed #b9c4d6; border-radius: 14px; background: #fff; color: var(--rrn-ink); font-size: 13px; font-weight: 700; text-align: center;
}
.rrn-app.is-empty .rrn-tile-add { flex: 1; flex-direction: row; gap: 8px; border-style: solid; border-color: var(--rrn-ink); background: var(--rrn-ink); color: #fff; font-size: 15px; }
.rrn-pos {
    flex: none; display: flex; align-items: center; gap: 8px; width: 156px; min-height: 64px; padding: 6px 10px 6px 6px; border: 1.5px solid var(--rrn-line);
    border-radius: 14px; background: var(--rrn-bg); text-align: left;
}
.rrn-pos img { flex: none; width: 48px; height: 48px; object-fit: contain; }
.rrn-pos-text { display: flex; flex-direction: column; min-width: 0; }
.rrn-pos-text strong { font-size: 13px; color: var(--rrn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrn-pos-text small { font-size: 12px; color: var(--rrn-muted); white-space: nowrap; }
.rrn-pos.is-sel { border-color: var(--rrn-ink); box-shadow: inset 0 0 0 1px var(--rrn-ink); }
.rrn-pos.is-new { animation: rrn-tile 0.9s ease-out; }
@keyframes rrn-tile { 0%, 40% { border-color: var(--rrn-ink); box-shadow: 0 0 0 3px rgba(201, 149, 154, 0.6); } 100% { box-shadow: none; } }

/* ------------------------------------------------------------------ okienko zaznaczonej pozycji */

.rrn-edit {
    padding: 10px 14px 12px; background: #fff; border-top: 1px solid var(--rrn-line); border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px -18px rgba(3, 41, 93, 0.4); animation: rrn-up 0.18s ease-out;
}
@keyframes rrn-up { from { transform: translateY(16px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.rrn-edit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rrn-edit-head img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.rrn-edit-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rrn-edit-title strong { font-size: 15px; color: var(--rrn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrn-edit-title span { font-size: 13px; color: var(--rrn-muted); }
.rrn-done {
    flex: none; min-height: 42px; padding: 0 20px; border-radius: 12px; background: var(--rrn-ink); color: #fff; font-size: 15px; font-weight: 700; white-space: nowrap;
}
.rrn-edit-row { display: grid; grid-template-columns: 68px 44px minmax(0, 1fr) 44px 76px; align-items: center; gap: 8px; min-height: 52px; }
.rrn-edit-label { font-size: 13px; font-weight: 600; color: var(--rrn-muted); }
.rrn-round {
    width: 44px; height: 44px; border: 1.5px solid var(--rrn-field); border-radius: 50%; background: #fff; color: var(--rrn-ink);
    font-size: 24px; font-weight: 600; line-height: 1; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.rrn-round:active:not(:disabled) { background: var(--rrn-rose-2); }
.rrn-round:disabled { opacity: 0.35; }
.rrn-num { display: flex; align-items: center; gap: 4px; color: var(--rrn-muted); font-size: 13px; }
#rrp-naklejki .rrn-num input { width: 52px; padding: 0 6px; text-align: right; }
#rrp-naklejki .rrn-count { width: 100%; padding: 0 4px; text-align: center; font-weight: 700; }
.rrn-edit-row .rrn-count { grid-column: 3; justify-self: center; max-width: 84px; }
.rrn-edit-gap { display: block; }
.rrn-edit-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.rrn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--rrn-line);
    border-radius: 999px; background: #fff; color: var(--rrn-ink); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.rrn-ghost svg { width: 18px; height: 18px; }
.rrn-ghost:disabled { opacity: 0.45; }
.rrn-remove { min-height: 44px; padding: 0 10px; color: var(--rrn-warn); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ biblioteka */

.rrn-lib { flex-direction: column; min-height: 0; background: #fff; }
.rrn-app:not(.is-wide) .rrn-lib {
    height: clamp(300px, 56vh, 470px); height: clamp(300px, 56dvh, 470px); padding: 10px 12px 0; border-top: 1px solid var(--rrn-line);
    border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px -18px rgba(3, 41, 93, 0.4); animation: rrn-up 0.18s ease-out;
}
.rrn-lib-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rrn-lib-head h2 { font-size: 17px; }
.rrn-lib-hint { font-size: 13px; color: var(--rrn-muted); }
.rrn-lib-hint.is-warn { color: var(--rrn-rose-ink); font-weight: 600; }
/* W bibliotece glowna akcja to koszyk na dole - "Gotowe" spokojniejsze. */
.rrn-lib-done { background: #fff; color: var(--rrn-ink); box-shadow: inset 0 0 0 2px var(--rrn-ink); }
.rrn-lib.is-pulse .rrn-grid { animation: rrn-pulse 1s ease-out; }
@keyframes rrn-pulse { 0%, 50% { box-shadow: inset 0 0 0 3px rgba(201, 149, 154, 0.7); border-radius: 14px; } 100% { box-shadow: none; } }
#rrp-naklejki .rrn-search { flex: none; width: 100%; }
.rrn-chips { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.rrn-chips::-webkit-scrollbar { display: none; }
.rrn-chips.is-wrap { flex-wrap: wrap; overflow: visible; }
.rrn-chips button {
    flex: none; min-height: 38px; padding: 0 14px; border: 1.5px solid var(--rrn-line); border-radius: 999px; background: #fff; color: var(--rrn-ink); font-size: 14px; white-space: nowrap;
}
.rrn-chips button[aria-pressed="true"] { background: var(--rrn-ink); border-color: var(--rrn-ink); color: #fff; }
/* max-content: obraz z width:100% nie wlicza sie do wysokosci wiersza - bez tego kafelki sie zgniataja. */
.rrn-grid {
    flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start;
    gap: 8px; overflow-y: auto; padding: 2px 0 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.rrn-tile { position: relative; min-width: 0; }
.rrn-tile-main {
    display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 8px 6px 6px; border: 1.5px solid var(--rrn-line);
    border-radius: 14px; background: var(--rrn-bg); color: var(--rrn-text); font-size: 12px; text-align: center;
}
.rrn-tile-main img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.rrn-tile-main span {
    display: -webkit-box; max-width: 100%; min-height: 2.6em; overflow: hidden; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rrn-tile-main:active { transform: scale(0.97); }
.rrn-tile.is-added .rrn-tile-main { border-color: var(--rrn-ink); background: #fff; box-shadow: inset 0 0 0 1px var(--rrn-ink); }
/* Kafelek: grafika i pod nia pasek tej samej wysokosci - "+ Dodaj" albo "- xN +" (siatka nie przeskakuje po dodaniu). */
.rrn-tile-main { border-radius: 14px 14px 0 0; border-bottom: 0; }
.rrn-tile-add1, .rrn-tile-step { height: 44px; border: 1.5px solid var(--rrn-line); border-top: 0; border-radius: 0 0 14px 14px; }
.rrn-tile-add1 { display: block; width: 100%; background: #fff; color: var(--rrn-ink); font-size: 13px; font-weight: 700; }
.rrn-tile-add1:active { background: var(--rrn-rose-2); }
.rrn-tile.is-added .rrn-tile-main { border-color: var(--rrn-ink); }
.rrn-tile-step {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; border-color: var(--rrn-ink);
    background: var(--rrn-ink); color: #fff; overflow: hidden;
}
.rrn-tile-step button { height: 44px; color: #fff; font-size: 22px; font-weight: 700; line-height: 1; }
.rrn-tile-step button:active { background: var(--rrn-ink-2); }
.rrn-tile-step em { min-width: 0; font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; }
.rrn-grid-empty { grid-column: 1 / -1; padding: 24px 8px; color: var(--rrn-muted); text-align: center; }
.rrn-lib-done { display: inline-flex; align-items: center; }

/* ------------------------------------------------------------------ cena i koszyk */

.rrn-buy {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid var(--rrn-line); box-shadow: 0 -8px 24px -16px rgba(3, 41, 93, 0.35); z-index: 4;
}
.rrn-sum, .rrn-buy-extra, .rrn-price-label { display: none; }
.rrn-price { display: flex; flex-direction: column; min-width: 0; }
.rrn-price strong { font-size: 21px; color: var(--rrn-ink); line-height: 1.1; white-space: nowrap; }
.rrn-price small { font-size: 12px; color: var(--rrn-muted); white-space: nowrap; }
.rrn-cart {
    flex: 1; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: var(--rrn-ink); color: #fff; font-size: 16px; font-weight: 700;
    box-shadow: 0 8px 20px -10px rgba(3, 41, 93, 0.7); text-align: center;
}
.rrn-cart:disabled { background: #b7bfcc; box-shadow: none; }
.rrn-cart.is-added { background: var(--rrn-ok); box-shadow: 0 8px 20px -10px rgba(31, 122, 77, 0.7); }
.rrn-cart.is-guide { background: #fff; color: var(--rrn-ink); box-shadow: inset 0 0 0 2px var(--rrn-ink); }
.rrn-cart.is-guide:disabled { background: transparent; color: var(--rrn-muted); box-shadow: inset 0 0 0 1.5px var(--rrn-line); font-weight: 600; }
.rrn-link { min-height: 40px; padding: 0 6px; color: var(--rrn-ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ okno "Zobacz na scianie" i AI */

.rrn-modal {
    position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-end; justify-content: center; background: rgba(3, 41, 93, 0.55);
}
.rrn-modal-box {
    display: flex; flex-direction: column; width: 100%; max-height: 92vh; max-height: 92dvh; padding: 12px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    background: #fff; border-radius: 18px 18px 0 0; overflow-y: auto; animation: rrn-up 0.2s ease-out;
}
.rrn-modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rrn-modal-head h2 { font-size: 17px; }
.rrn-wall-canvas { width: 100%; aspect-ratio: 4 / 3; max-height: 58vh; max-height: 58dvh; border-radius: 12px; overflow: hidden; background: #ece5db; }
.rrn-wall-canvas canvas { display: block; width: 100%; height: 100%; }
.rrn-wall-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 8px; }
.rrn-ai-open {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
    background: linear-gradient(135deg, var(--rrn-ink), var(--rrn-ink-2)); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.rrn-hint { margin: 6px 0; color: var(--rrn-muted); font-size: 13px; }
.rrn-segment { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #f1ede7; margin-bottom: 8px; }
.rrn-segment button { flex: 1; min-height: 40px; padding: 8px; border-radius: 9px; color: var(--rrn-muted); font-weight: 600; }
.rrn-segment button[aria-selected="true"] { background: #fff; color: var(--rrn-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.rrn-file {
    position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px; border: 2px dashed #b9c4d6;
    border-radius: 14px; color: var(--rrn-ink); font-weight: 700; text-align: center; cursor: pointer;
}
.rrn-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rrn-consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 12px; color: var(--rrn-muted); }
.rrn-consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--rrn-ink); }
.rrn-consent.is-missing { padding: 8px; margin: 8px -8px; border-radius: 10px; background: #fff6f6; color: #9b2c2c; animation: rrn-shake 0.35s; }
@keyframes rrn-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rrn-ai-start { width: 100%; flex: none; }
.rrn-ai-result { display: flex; flex-direction: column; gap: 10px; }
.rrn-ai-result img { width: 100%; height: auto; border-radius: 12px; }
.rrn-ai-wait { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 10px; color: var(--rrn-muted); text-align: center; }
.rrn-spinner { width: 40px; height: 40px; border: 4px solid #e5e9f0; border-top-color: var(--rrn-ink); border-radius: 50%; animation: rrn-spin 0.9s linear infinite; }
@keyframes rrn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .rrn-st, .rrn-edit, .rrn-lib, .rrn-msg, .rrn-modal-box, .rrn-consent.is-missing { transition: none !important; animation: none !important; }
    .rrn-st.is-new { animation: none; }
}

/* ------------------------------------------------------------------ waskie telefony */

/* Niski ekran (Safari z paskami) przy otwartym okienku pozycji: bez notki nad arkuszem - wiecej miejsca na arkusz. */
@media (max-height: 700px) {
    .rrn-app.is-edit .rrn-note, .rrn-app.is-lib .rrn-note { display: none; }
}

@media (max-width: 360px) {
    .rrn-edit-row { grid-template-columns: 56px 40px minmax(0, 1fr) 40px 64px; gap: 6px; }
    .rrn-round { width: 40px; height: 40px; }
    #rrp-naklejki .rrn-num input { width: 44px; }
    .rrn-cart { font-size: 15px; }
    .rrn-top-wall span { display: none; }
}

/* ------------------------------------------------------------------ komputer: trzy kolumny */

@media (min-width: 900px) {
    .rrn-app.is-wide {
        grid-template-columns: 320px minmax(0, 1fr) 360px; grid-template-rows: auto auto minmax(0, 1fr) auto;
        grid-template-areas: "top top top" "lib msg side" "lib stage side" "lib stage buy";
    }
    .rrn-app.is-wide .rrn-dock, .rrn-app.is-wide .rrn-top-wall, .rrn-app.is-wide .rrn-lib-done { display: none; }
    .rrn-app.is-wide .rrn-top { padding: 4px 18px 4px 8px; }
    .rrn-app.is-wide .rrn-heading { display: flex; align-items: baseline; gap: 10px; }
    .rrn-app.is-wide .rrn-heading h1 { flex: none; width: auto; font-size: 18px; }
    .rrn-app.is-wide .rrn-heading p { flex: 0 1 auto; min-width: 0; font-size: 14px; }
    .rrn-app.is-wide .rrn-lib { grid-area: lib; display: flex; padding: 16px 16px 0; border-right: 1px solid var(--rrn-line); }
    .rrn-app.is-wide .rrn-lib-head h2 { font-size: 16px; }
    .rrn-app.is-wide .rrn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* Kafelki na komputerze sa wezsze (ok. 90 px): pasek - xN + mniejszy, mysz nie potrzebuje 44 px. */
    .rrn-app.is-wide .rrn-tile-step { grid-template-columns: 30px minmax(0, 1fr) 30px; height: 34px; }
    .rrn-app.is-wide .rrn-tile-add1 { height: 34px; }
    .rrn-app.is-wide .rrn-tile-step button { height: 34px; font-size: 18px; }
    .rrn-app.is-wide .rrn-tile-step em { font-size: 12px; }
    .rrn-app.is-wide .rrn-chips { flex-wrap: wrap; overflow: visible; }
    .rrn-app.is-wide .rrn-scroll { padding: 16px 32px 24px; }
    .rrn-app.is-wide .rrn-note { font-size: 14px; }
    .rrn-app.is-wide .rrn-msg p { flex-basis: 100%; }
    .rrn-app.is-wide .rrn-msg { border-bottom: 0; border-radius: 0 12px 12px 0; margin: 12px auto 0; width: min(600px, calc(100% - 48px)); box-shadow: 0 6px 18px -12px rgba(3, 41, 93, 0.45); }
    .rrn-app.is-wide .rrn-side {
        grid-area: side; display: flex; flex-direction: column; min-height: 0; padding: 16px 16px 8px; border-left: 1px solid var(--rrn-line); background: #fff; overflow-y: auto;
    }
    .rrn-side h2 { flex: none; font-size: 16px; margin-bottom: 10px; }
    .rrn-list { display: flex; flex-direction: column; gap: 8px; }
    .rrn-row { border: 1.5px solid var(--rrn-line); border-radius: 14px; background: var(--rrn-bg); }
    .rrn-row.is-sel { border-color: var(--rrn-ink); background: #fff; box-shadow: inset 0 0 0 1px var(--rrn-ink); }
    .rrn-row-main { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 12px 6px 6px; text-align: left; }
    .rrn-row-main img { flex: none; width: 44px; height: 44px; object-fit: contain; }
    .rrn-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .rrn-row-text strong { font-size: 14px; color: var(--rrn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rrn-row-text small { font-size: 13px; color: var(--rrn-muted); }
    .rrn-row-count { flex: none; font-weight: 700; color: var(--rrn-ink); }
    .rrn-list-empty { padding: 18px; border: 1.5px dashed var(--rrn-line); border-radius: 14px; color: var(--rrn-muted); text-align: center; }
    .rrn-row .rrn-edit { padding: 4px 12px 10px; border-top: 1px solid var(--rrn-line); border-radius: 0 0 14px 14px; box-shadow: none; animation: none; }
    .rrn-row .rrn-edit-head { display: none; }
    /* Etykieta nad wierszem (w waskiej kolumnie "Wysokosc" stykala sie z "-"). */
    .rrn-row .rrn-edit-row { grid-template-columns: 40px minmax(0, 1fr) 40px 74px; gap: 4px 8px; min-height: 0; padding-bottom: 6px; }
    .rrn-row .rrn-edit-label { grid-column: 1 / -1; padding-top: 6px; }
    .rrn-row .rrn-edit-row .rrn-count { grid-column: 2; }
    .rrn-row .rrn-round { width: 40px; height: 40px; font-size: 22px; }
    .rrn-app.is-wide .rrn-buy {
        grid-area: buy; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px 16px; border-left: 1px solid var(--rrn-line); box-shadow: 0 -8px 24px -18px rgba(3, 41, 93, 0.35);
    }
    .rrn-app.is-wide .rrn-sum { display: block; }
    .rrn-sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; }
    .rrn-sum-row strong { color: var(--rrn-ink); }
    .rrn-sum-row span { color: var(--rrn-muted); font-size: 13px; }
    .rrn-meter { display: block; height: 8px; margin: 8px 0 6px; border-radius: 4px; background: #edf1ee; overflow: hidden; }
    .rrn-meter span { display: block; height: 100%; border-radius: 4px; background: #4f9a6a; transition: width 0.2s; }
    .rrn-meter.is-near span { background: var(--rrn-rose); }
    .rrn-sum-hint { font-size: 13px; color: var(--rrn-muted); }
    .rrn-app.is-wide .rrn-price { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding-top: 10px; border-top: 1px solid var(--rrn-line); }
    .rrn-app.is-wide .rrn-price-label { display: inline; font-size: 14px; color: var(--rrn-muted); }
    .rrn-app.is-wide .rrn-price strong { font-size: 24px; }
    .rrn-app.is-wide .rrn-price small { flex-basis: 100%; font-size: 13px; }
    .rrn-app.is-wide .rrn-cart { flex: none; min-height: 54px; font-size: 17px; }
    .rrn-app.is-wide .rrn-buy-extra { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .rrn-app.is-wide .rrn-wall-wide { flex: 1; }
    .rrn-modal { align-items: center; }
    .rrn-modal-box { width: min(760px, 94vw); border-radius: 18px; padding: 16px 18px; }
}
@media (min-width: 1280px) {
    .rrn-app.is-wide { grid-template-columns: 360px minmax(0, 1fr) 380px; }
}
