/*
 * Wygląd panelu administratora, kierunek „Sterownia”.
 * Ładowany po bootstrap.min.css (potrzebnego tylko dla modali); nie korzysta z app.min.css strony publicznej,
 * bo tamten arkusz ustawia body jako flex, nadpisuje linki i tabele (table.polsat).
 */

@font-face { font-family: "DINPro"; src: url("../fonts/DINPro-Light-O-RSJjg.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "DINPro"; src: url("../fonts/DINPro-Regular-l3O3dqf.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DINPro"; src: url("../fonts/DINPro-Bold-jzii1o3.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
    --red: #ce0e2d;
    --red-hover: #e91537;
    --graphite: #292929;
    --graphite-2: #313030;
    --muted: #5f5f5f;
    --line: #ececec;
    --line-2: #d6d6d6;
    --field-border: #8c8c8c;
    --success: #1b6b35;
    --red-dark: #a50b24;
    --red-light: #fdeef1;
    --bg-hover: #f4f4f4;
    /* Jeden cień dla wszystkich białych boksów: delikatny, bez rozmycia powyżej 20 px. */
    --shadow: 0 1px 2px rgba(41, 41, 41, .06), 0 4px 14px rgba(41, 41, 41, .06);
    --bs-body-font-family: DINPro, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.admin {
    margin: 0;
    font-family: DINPro, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--graphite);
    background: #f2f2f2 url("../img/bg-zYJmX3W.jpg") center top / cover no-repeat;
    min-height: 100vh;
}

:where(.admin) a { color: var(--red); }
:where(.admin) a:hover { color: var(--red-hover); }
.admin h1, .admin h2, .admin h3, .admin p { margin: 0; }
.admin ul, .admin ol { margin: 0; }
.admin img { max-width: 100%; }

.admin :focus-visible {
    outline: 3px solid var(--graphite);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff;
}
.menu :focus-visible, .list-table thead :focus-visible { outline-color: #fff; box-shadow: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.admin [hidden] { display: none !important; }

.admin :focus:not(:focus-visible) { outline: none; }

.skip-menu {
    position: absolute; left: 8px; top: -60px; z-index: 2000;
    background: var(--graphite); color: #fff !important; padding: 12px 16px;
}
.skip-menu:focus { top: 8px; }

/* ---------- Szkielet: menu + treść ---------- */

.panel { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }

.menu {
    flex: 1 1 220px; max-width: 248px;
    background: var(--graphite); color: #fff;
    display: flex; flex-direction: column; gap: 4px; padding: 0 0 24px;
}
.menu__brand { background: #fff; padding: 24px 24px 20px; }
.menu__brand img { width: 150px; height: auto; display: block; }
.menu__brand p { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.menu__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.menu__link {
    display: flex; align-items: center; gap: 12px; min-height: 48px;
    padding: 14px 24px 14px 28px; color: #d9d9d9; text-decoration: none;
}
.menu__link:hover { color: #fff; background: var(--graphite-2); }
.menu__link[aria-current] {
    padding-left: 24px; color: #fff; background: var(--graphite-2);
    border-left: 4px solid var(--red); font-weight: 700;
}
.menu__link .icon { width: 20px; height: 20px; opacity: .85; }
.menu__link[aria-current] .icon { opacity: 1; }
.menu__spacer { flex-grow: 1; }
.menu__user {
    padding: 16px 24px 0; border-top: 1px solid #3d3d3d; font-size: 14px; color: #bdbdbd;
    display: flex; flex-direction: column; gap: 8px;
}
.menu__user span { overflow-wrap: anywhere; }
.menu__user form { margin: 0; }
.text-button {
    background: none; border: 0; padding: 12px 0; min-height: 44px; font: inherit;
    color: inherit; text-decoration: underline; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.menu__user .text-button { color: #fff; }

@media (min-width: 769px) {
    .menu { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
}
@media (max-width: 768px) {
    .menu { flex-basis: 100%; max-width: none; padding-bottom: 12px; }
    .menu__list { flex-direction: row; flex-wrap: wrap; }
    .menu__link, .menu__link[aria-current] { padding: 10px 16px; border-left: 0; border-bottom: 4px solid transparent; }
    .menu__link[aria-current] { border-bottom-color: var(--red); }
    .menu__spacer { display: none; }
    .menu__user { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 8px; }
}

.body {
    flex: 999 1 560px; min-width: 0; padding: 36px 40px 56px;
    display: flex; flex-direction: column; gap: 24px;
}
@media (max-width: 768px) { .body { padding: 24px 16px 40px; flex-basis: 100%; } }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.top:not(:has(.breadcrumbs, .message)) { display: none; }
.breadcrumbs { font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.messages { display: flex; flex-direction: column; gap: 8px; margin-left: auto; max-width: 100%; }
.message {
    background: var(--graphite); color: #fff; padding: 12px 16px; border-left: 4px solid var(--red);
    display: flex; gap: 16px; align-items: center; justify-content: space-between; font-size: 15px;
}
.message--warning { background: var(--red); border-left-color: var(--graphite); }
.message button {
    background: none; border: 0; color: #fff; font: inherit; font-size: 22px; line-height: 1;
    min-width: 44px; min-height: 44px; margin: -12px -16px -12px 0; cursor: pointer;
}
.admin .message :focus-visible { outline-color: #fff; box-shadow: none; }

/* ---------- Nagłówki, karty ---------- */

.header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.header h1, .box-main h1 { font-weight: 300; font-size: 40px; line-height: 1.1; }
.header p { margin-top: 6px; color: var(--muted); }
@media (max-width: 480px) { .header h1, .box-main h1 { font-size: 30px; } }

.box { background: #fff; padding: 22px 24px; box-shadow: var(--shadow); }
.box h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.box--notes { border-top: 4px solid var(--red); }
.box--calm { border-top: 4px solid var(--line-2); }
.box--frame { border: 1px dashed #8c8c8c; padding: 28px 32px; }

.box-main {
    background: #fff; padding: 28px 32px; box-shadow: var(--shadow);
    display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: flex-end; justify-content: space-between;
}
.box-main__title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.box-main h1 { font-size: 36px; overflow-wrap: anywhere; }
@media (max-width: 480px) { .box-main { padding: 20px 16px; } .box-main h1 { font-size: 28px; } }
.box-main__title p { color: var(--muted); }

.stats {
    flex: 1 1 100%; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
    padding-top: 20px; border-top: 1px solid var(--line);
}
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 26px; font-weight: 300; }
.stats dd small { font-size: 15px; color: var(--muted); }
.stats dd.smaller { font-size: 18px; font-weight: 400; }
.red { color: var(--red); }

/* ---------- Ikony (inline SVG z admin/_icons.html.twig) ---------- */

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }

/* ---------- Przyciski ---------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
    padding: 0 22px; font: inherit; text-decoration: none; cursor: pointer;
    background: #fff; color: var(--graphite); border: 1px solid var(--graphite);
}
.button:hover { color: var(--graphite); background: #f6f6f6; }
/* Jednoznaczna akcja filtra (Szukaj): grafit, żeby nie myliła się z pigułkami filtrów. */
.button--action { background: var(--graphite); border-color: var(--graphite); color: #fff; font-weight: 700; }
.button--action:hover { background: #4a4a4a; border-color: #4a4a4a; color: #fff; }
.button--quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button--quiet:hover { background: var(--bg-hover); color: var(--graphite); }
.button--primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.button--primary:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }
.admin a.button--primary, .admin a.button--primary:hover { color: #fff; }
.button-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Pulpit ---------- */

.next-event { background: #fff; display: flex; flex-wrap: wrap; box-shadow: var(--shadow); }
.next-event__date {
    flex: 1 1 260px; padding: 32px 36px; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.next-event__date h2 { font-size: 15px; font-weight: 700; }
.next-event__day { font-weight: 300; font-size: 112px; line-height: .9; color: var(--red); letter-spacing: -2px; }
.next-event__when { font-size: 18px; }
.next-event__description { flex: 999 1 420px; padding: 32px 36px; display: flex; flex-direction: column; gap: 18px; }
.next-event__description h3 { font-size: 26px; font-weight: 700; line-height: 1.2; }
.next-event__place { margin-top: 6px; color: var(--muted); }
.fill { display: flex; flex-direction: column; gap: 8px; }
.fill__row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.fill__description { font-size: 15px; color: var(--muted); }
.bar { height: 12px; background: var(--line); }
.bar > span { display: block; height: 100%; background: var(--red); }
.bar--small { height: 8px; flex: 1; min-width: 40px; }
.bar--dimmed > span { background: #8c8c8c; }
.inline-warning { font-size: 15px; color: var(--red); margin-left: 6px; }
.smaller .inline-warning { margin-left: 0; }
@media (max-width: 768px) {
    .next-event__date { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px; }
    .next-event__description { padding: 24px 20px; }
    .next-event__day { font-size: 84px; }
}

.dashboard-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.events { flex: 999 1 640px; min-width: 0; background: #fff; box-shadow: var(--shadow); }
.events__top {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px;
}
.events__top h2 { font-size: 22px; font-weight: 700; }
.dashboard-aside { flex: 1 1 300px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.notes-list { padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.4; }
.recent { list-style: none; padding: 0; display: flex; flex-direction: column; }
.recent li {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.recent li:last-child { border-bottom: 0; }
.recent strong { font-weight: 700; }
.recent small { font-size: 14px; color: var(--muted); display: block; }
.recent time { font-size: 14px; color: var(--muted); white-space: nowrap; }
.vip-badge { font-size: 13px; font-weight: 700; color: var(--red); }

/* ---------- Pola formularzy ---------- */

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.field label, .field > .label { font-size: 14px; color: var(--graphite); }
.field--small-label label { font-size: 13px; color: var(--muted); }
/* Jeden styl pól: 44 px, ramka #8c8c8c (kontrast 3:1), kanty proste jak w przyciskach (0). */
.admin input[type=text], .admin input[type=search], .admin input[type=email], .admin input[type=password],
.admin input[type=number], .admin input[type=datetime-local], .admin input[type=date], .admin input[type=time], .admin select {
    font: inherit; font-size: 16px; color: var(--graphite); background-color: #fff; width: 100%;
    padding: 10px 12px; min-height: 44px; border: 1px solid var(--field-border); border-radius: 0;
    appearance: none; -webkit-appearance: none;
}
.admin input::placeholder { color: var(--field-border); opacity: 1; }
.admin input:hover:not(:disabled), .admin select:hover:not(:disabled) { border-color: var(--graphite); }
.admin input[type=text]:focus-visible, .admin input[type=search]:focus-visible, .admin input[type=email]:focus-visible,
.admin input[type=password]:focus-visible, .admin input[type=number]:focus-visible, .admin input[type=date]:focus-visible,
.admin input[type=time]:focus-visible, .admin input[type=datetime-local]:focus-visible, .admin select:focus-visible {
    border-color: var(--graphite); outline: 2px solid var(--graphite); outline-offset: 0;
    box-shadow: 0 0 0 5px rgba(206, 14, 45, .25);
}
.admin input:disabled, .admin select:disabled { background-color: #efefef; color: var(--muted); cursor: not-allowed; }
.admin input[aria-invalid=true] { border: 2px solid var(--red); padding: 9px 11px; }
/* Strzałka selecta: własny SVG w stylu ikon panelu (obrys, zaokrąglone końce). */
.admin select {
    padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23292929' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
/* Ikona kalendarza/zegara przeglądarki zostaje, wkomponowana w pole. */
.admin input[type=date], .admin input[type=time] { min-width: 0; }
.admin input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; padding: 4px; margin-right: -4px; }
.admin input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.admin input::-webkit-date-and-time-value { text-align: left; }
fieldset.field--date { border: 0; margin: 0; padding: 0; min-width: 0; gap: 6px; }
fieldset.field--date legend { float: none; width: auto; padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--graphite); }
.field-pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }
.field__error { color: var(--red); font-size: 14px; margin: 0; }
.field__help { font-size: 14px; color: var(--muted); }
.field--check { flex-direction: row; align-items: center; gap: 12px; }
.field--check label { order: 2; font-size: 16px; }
.field--check input[type=checkbox] { order: 1; width: 22px; height: 22px; accent-color: var(--red); flex: none; }
.admin input[type=checkbox], .admin input[type=radio] { accent-color: var(--red); }
.field--check .field__error { order: 3; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.form { display: flex; flex-direction: column; gap: 16px; }
.form__buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.form__hint { font-size: 14px; color: var(--muted); line-height: 1.45; }
.box-form { background: #fff; padding: 28px 32px; max-width: 760px; box-shadow: var(--shadow); }
.box-table { background: #fff; box-shadow: var(--shadow); }
@media (max-width: 480px) { .box-form { padding: 20px 16px; } }
.form-error { color: var(--red); font-size: 15px; border-left: 4px solid var(--red); padding: 8px 12px; background: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { gap: 4px; }
.filters .field input[type=search], .filters .field select { min-width: 220px; min-height: 44px; }
.filters--guests { flex: 1 1 680px; justify-content: flex-end; }
.filters--guests > .field { flex: 1 1 240px; max-width: 360px; }
.filters--guests input[type=search] { min-width: 280px; border-color: var(--graphite); }
.filters--guests .button--action, .filters--guests .button--quiet { min-width: 0; }
@media (max-width: 480px) { .filters .field, .filters .field input[type=search] { width: 100%; min-width: 0 !important; } }

fieldset.group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
fieldset.group legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px; float: none; width: auto; }
.segments { display: flex; flex-wrap: wrap; gap: 6px; }
/* Pigułki filtrów (Obecność, Tylko VIP): jasne, zaokrąglone; zaznaczona ma czerwoną ramkę, jasnoczerwone tło i pogrubienie.
   Dzięki temu nie przypominają grafitowego przycisku „Szukaj”. */
.segments label {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer;
    border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--graphite); font-size: 15px;
}
.segments label:hover { background: var(--bg-hover); border-color: var(--field-border); }
.segments input:checked + label {
    background: var(--red-light); border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red);
    color: var(--red-dark); font-weight: 700;
}
.segments input:checked + label .icon { fill: currentColor; }
.segments input:focus-visible + label { outline: 3px solid var(--graphite); outline-offset: 2px; }
.filters__buttons { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- Tabele ---------- */

.list-table-wrap { overflow-x: auto; position: relative; }
.list-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 720px; }
.list-table--guests { min-width: 880px; }
.list-table thead tr { background: var(--graphite); color: #fff; text-align: left; }
.list-table th { padding: 12px; font-weight: 400; }
.list-table th:first-child, .list-table td:first-child { padding-left: 24px; }
.list-table th:last-child, .list-table td:last-child { padding-right: 24px; }
.list-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list-table tbody tr:last-child td { border-bottom: 0; }
.list-table--guests td { padding: 12px; }
.list-table--guests td:first-child { color: var(--muted); width: 40px; }
.list-table--guests td:last-child, .list-table--guests th:last-child { text-align: right; white-space: nowrap; }
.list-table--guests td:last-child { padding: 8px 24px 8px 12px; }
.list-table td.nowrap { white-space: nowrap; }
.list-table .muted { color: var(--muted); }
.list-table a.name { color: var(--graphite); font-weight: 700; }
.list-table tr.past { color: var(--muted); }
.list-table tr.past a.name { color: var(--muted); font-weight: 400; }
.list-table th.sortable { padding: 0 12px; }
.list-table th.sortable a {
    display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-decoration: none;
}
.list-table th.sortable a:hover { text-decoration: underline; color: #fff; }
.list-table th[aria-sort] a { font-weight: 700; }
.list-table th:first-child.sortable { padding-left: 24px; }
.registered { display: flex; align-items: center; gap: 10px; }
.registered span.number { white-space: nowrap; }
/* Akcje w wierszu: małe przyciski (36 px, cel dotyku 44 px dzięki ::after), grupa wyrównana do prawej. */
.actions__group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.actions form { margin: 0; display: flex; }
.row-action {
    position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
    font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
    background: #fff; color: var(--graphite); border: 1px solid var(--line-2);
}
.row-action::after { content: ""; position: absolute; inset: -4px -3px; }
.row-action .icon { width: 16px; height: 16px; vertical-align: 0; }
.row-action:hover { background: var(--bg-hover); border-color: var(--field-border); }
.row-action--delete { color: var(--red); }
.row-action--delete:hover { background: var(--red-light); border-color: var(--red); color: var(--red-dark); }
.guest-last-name { font-weight: 700; }
.result-info { padding: 0 24px 12px; font-size: 14px; color: var(--muted); }
.guests__top {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding: 20px 24px;
}
.guests__top h2 { font-size: 22px; font-weight: 700; }
.guests__top h2 span { font-weight: 400; color: var(--muted); font-size: 17px; }
.pager {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
    padding: 16px 24px; border-top: 1px solid var(--line); font-size: 15px;
}
.pager > span { color: var(--muted); }
.pager ul { list-style: none; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager li > span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
    border: 1px solid var(--line-2); color: var(--graphite); text-decoration: none; padding: 0 8px;
}
.pager a:hover { background: #f6f6f6; color: var(--graphite); }
.pager a[aria-current] { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.pager li > span[aria-disabled] { color: #767676; }
.pager li > span.ellipsis { border: 0; min-width: 24px; padding: 0; }
.empty h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty p { color: var(--muted); line-height: 1.45; }
.empty { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; background: #fff; box-shadow: var(--shadow); }
.box-table .empty--in-box { box-shadow: none; }
.empty > div { flex: 1 1 360px; }
.empty--in-box { padding: 28px 24px; border-top: 1px solid var(--line); }

/* ---------- Modale (Bootstrap + wygląd Sterowni) ---------- */

.admin .modal-backdrop { --bs-backdrop-bg: #292929; --bs-backdrop-opacity: .72; }
.admin .modal-content { border: 0; border-radius: 0; font-family: inherit; color: var(--graphite); }
.admin .modal-content.with-red { border-top: 4px solid var(--red); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 8px; }
.modal-head h2 { font-size: 24px; font-weight: 700; margin: 0; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.close {
    background: none; border: 0; font: inherit; font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px;
    cursor: pointer; color: var(--graphite); margin: -8px -10px 0 0;
}
.modal-text { padding: 16px 28px 24px; }
.modal-text--confirmation { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-text--confirmation h2 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.modal-text--confirmation p { color: var(--muted); line-height: 1.5; font-size: 15px; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.button--danger { background: var(--red); border: 1px solid var(--red); color: #fff; font-weight: 700; }
.button--danger:hover { background: var(--red-hover); color: #fff; }
.admin .modal-dialog { --bs-modal-width: 560px; }
.mail-preview { width: 100%; height: 380px; border: 1px solid var(--line-2); background: #fff; }
.vip-result p { margin-bottom: 12px; }
.loading { padding: 24px 28px; color: var(--muted); }

/* ---------- Strefa niebezpieczna na stronie edycji ---------- */

.danger-zone { background: #fff; box-shadow: var(--shadow); padding: 22px 28px; max-width: 760px; border-top: 4px solid var(--red); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.danger-zone h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.danger-zone p { color: var(--muted); font-size: 15px; max-width: 460px; }

/* ---------- Logowanie ---------- */

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login__box { width: 100%; max-width: 420px; background: #fff; box-shadow: var(--shadow); border-top: 4px solid var(--red); }
.login__brand { padding: 28px 32px 0; }
.login__brand img { width: 150px; height: auto; display: block; }
.login__body { padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 20px; }
.login h1 { font-weight: 300; font-size: 32px; line-height: 1.1; }
.login .button { width: 100%; }
@media (max-width: 480px) { .login__brand { padding: 24px 20px 0; } .login__body { padding: 20px 20px 28px; } }

/* ---------- Check-in (telefon obsługi) ---------- */

.checkin { min-height: 100vh; display: flex; flex-direction: column; }
.checkin__top { background: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.checkin__top img { width: 130px; height: auto; display: block; }
.checkin__top form { margin: 0; }
.checkin__top .text-button { font-size: 14px; color: var(--graphite); padding: 0; }
.checkin__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 16px 32px; }
.checkin__box {
    width: 100%; max-width: 560px; background: #fff; border-top: 10px solid var(--graphite); box-shadow: var(--shadow);
    padding: 32px 24px 36px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px;
}
.checkin__box--ok { border-top-color: var(--success); }
.checkin__box--warning { border-top-color: var(--red); }
.checkin__icon { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--graphite); color: #fff; }
.checkin__box--ok .checkin__icon { background: var(--success); }
.checkin__box--warning .checkin__icon { background: var(--red); }
.checkin__icon svg { width: 56px; height: 56px; }
.checkin__state { font-size: 16px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.checkin__box--ok .checkin__state { color: var(--success); }
.checkin__box--warning .checkin__state { color: var(--red); }
.checkin__message { font-size: 30px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
@media (min-width: 600px) { .checkin__message { font-size: 36px; } }

/* ---------- Szablon maila ---------- */

.template { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.template__form { flex: 1 1 300px; max-width: 420px; background: #fff; padding: 24px; box-shadow: var(--shadow); }
.template__preview { flex: 999 1 460px; min-width: 0; background: #fff; padding: 20px 24px 24px; box-shadow: var(--shadow); }
.template__preview h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.template__preview iframe { width: 100%; height: 600px; border: 1px solid var(--line-2); background: #fff; }

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

/* Przyciski jeden pod drugim, równej szerokości (wąska kolumna, np. wybór szablonu maila). */
.form__buttons--column {
    flex-direction: column;
    align-items: stretch;
}
.form__buttons--column > .button {
    width: 100%;
    justify-content: center;
}


/* ---------- Szablony maili z edytorem (F-02): biblioteka, kroki, edytor, podgląd ---------- */

.template-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.template-card { display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); min-width: 0; }
.template-card__thumb { height: 180px; background: #e9e9e9; overflow: hidden; border-bottom: 1px solid var(--line); }
.template-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.template-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.template-card__body h2 { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.template-card__usage { font-size: 14px; color: var(--muted); flex: 1; }
.template-card__body form { margin: 0; display: flex; }
.template-library__new { display: flex; flex-direction: column; min-width: 0; }
.template-card--new {
    position: relative; flex: 1; min-height: 240px; align-items: center; justify-content: center; text-align: center; gap: 10px;
    padding: 24px; border: 2px dashed var(--field-border); background: rgba(255, 255, 255, .7); cursor: pointer; box-shadow: none;
}
.template-card--new:hover, .template-card--drop { border-color: var(--red); background: var(--red-light); }
.template-card--new .icon { width: 40px; height: 40px; color: var(--red); }
.template-card__new-title { font-size: 18px; font-weight: 700; }
.template-card__new-hint { font-size: 14px; color: var(--muted); max-width: 240px; }
.template-card__file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.template-card--new:focus-within { outline: 3px solid var(--graphite); outline-offset: 2px; }
.template-manual { list-style: none; padding: 0; margin-top: 8px; display: flex; flex-direction: column; }
.template-manual li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.template-manual li:last-child { border-bottom: 0; }
.template-picker { gap: 6px; }
.template-picker__option {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; cursor: pointer;
    border: 1px solid var(--line-2); background: #fff;
}
.template-picker__option:hover { background: var(--bg-hover); }
.template-picker__option:has(input:checked) { border-color: var(--red); background: var(--red-light); font-weight: 700; }
.template-picker__thumb { width: 60px; height: 40px; object-fit: cover; object-position: top; background: #e9e9e9; flex: none; }

.form-error ul { margin: 6px 0 0; padding-left: 18px; }


.template-num { gap: 3px; }
.template-num label { font-size: 12px; color: var(--muted); }
.input-unit { position: relative; display: block; }
.admin .input-unit input[type=number] { min-height: 36px; padding: 5px 30px 5px 10px; font-size: 15px; -moz-appearance: textfield; appearance: textfield; }
.admin .input-unit input[type=number][aria-invalid=true] { padding: 4px 29px 4px 9px; }
.input-unit input::-webkit-inner-spin-button, .input-unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit__sfx { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }

/* Opisy bez JS (details) */
.template-texts { background: #fff; box-shadow: var(--shadow); padding: 10px 16px; }
.template-texts summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.template-texts summary::before { content: "▸"; color: var(--red); }
.template-texts[open] summary::before { content: "▾"; }
.template-texts__body { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 6px; }

/* Pasek postępu wgrywania grafiki (F-02) */
.upload-progress { margin-top: 16px; }
.template-card--new + .upload-progress, .template-library__new .upload-progress { margin: 12px 16px 0; }
.upload-progress__track { height: 8px; border-radius: 4px; background: #e6e6e6; overflow: hidden; }
.upload-progress__bar { height: 100%; width: 0; background: var(--red); border-radius: 4px; transition: width .2s ease; }
.upload-progress--processing .upload-progress__bar {
    background-image: linear-gradient(90deg, var(--red) 0, var(--red-hover) 50%, var(--red) 100%);
    background-size: 200% 100%; animation: upload-progress-pulse 1.2s linear infinite;
}
.upload-progress__label { margin: 6px 0 0; font-size: .875rem; color: #555; }
form.is-uploading .template-card--new { pointer-events: none; opacity: .7; }
@keyframes upload-progress-pulse { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .upload-progress__bar { transition: none; } .upload-progress--processing .upload-progress__bar { animation: none; } }

/* ---------- Edytor „Studio” (F-02, krok 2): ciemny obszar roboczy, pływający inspektor, menu zwinięte do ikon ---------- */

body.studio { background: #2f2f31; }
body.studio .body { padding: 0; gap: 0; background: #2f2f31; }
body.studio .body { position: relative; }
body.studio .top { position: absolute; z-index: 30; top: 62px; left: 20px; right: 20px; padding: 0; pointer-events: none; }
body.studio .top .messages { margin: 0; pointer-events: auto; width: max-content; max-width: 100%; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

@media (min-width: 769px) {
    body.studio .panel { flex-wrap: nowrap; }
    body.studio .body { flex: 999 1 0; }
    body.studio .menu {
        flex: 0 0 64px; max-width: 64px; padding: 14px 0; gap: 6px; align-items: center; background: #232325; overflow: visible;
    }
    body.studio .menu__brand { flex: none; width: 40px; height: 40px; padding: 0; margin-bottom: 14px; display: grid; place-items: center; }
    body.studio .menu__brand > * { display: none; }
    body.studio .menu__brand::before { content: "pm"; color: var(--red); font-weight: 700; font-size: 13px; }
    body.studio .menu__list { width: 100%; align-items: center; gap: 6px; }
    body.studio .menu__link, body.studio .menu__link[aria-current] {
        width: 40px; min-height: 40px; height: 40px; padding: 0; justify-content: center; color: #9a9a9c; border-left: 0;
    }
    body.studio .menu__link:hover { background: #2c2c2f; color: #fff; }
    body.studio .menu__link[aria-current] { color: #fff; background: #3a3a3d; border-left: 3px solid var(--red); }
    body.studio .menu__link span, body.studio .menu__user > span, body.studio .menu__label { display: none; }
    body.studio .menu__user { padding: 0; border: 0; align-items: center; }
    body.studio .menu__user .text-button { width: 40px; min-height: 40px; height: 40px; padding: 0; justify-content: center; color: #9a9a9c; }
    body.studio .menu__user .text-button:hover { color: #fff; }
    body.studio .menu__user .icon { width: 20px; height: 20px; }
}
@media (min-width: 960px) {
    body.studio .panel { height: 100vh; }
    body.studio .body { height: 100vh; overflow: hidden; }
}

.studio { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; font-variant-numeric: tabular-nums; }
.studio__bar {
    flex: 0 0 auto; min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 6px 20px;
    background: #262628; color: #e8e8e8; border-bottom: 1px solid #3a3a3d; font-size: 13px;
}
.studio__crumb { color: #9a9a9c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.admin .studio__crumb a { color: #9a9a9c; }
.admin .studio__crumb a:hover { color: #fff; }
.studio__crumb strong { color: #fff; }
.studio__steps-wrap { margin: 0 auto; }
.studio__steps { list-style: none; margin: 0; padding: 3px; display: flex; background: #1f1f21; border-radius: 6px; }
.admin .studio__steps a { display: block; padding: 6px 14px; color: #9a9a9c; text-decoration: none; border-radius: 4px; font-size: 13px; white-space: nowrap; }
.admin .studio__steps a:hover { color: #fff; }
.admin .studio__steps a[aria-current] { color: #fff; background: #3a3a3d; font-weight: 700; }
.studio__status { font-size: 12px; color: #9a9a9c; }
.studio__btn {
    font: inherit; font-size: 13px; line-height: 1.2; padding: 7px 14px; min-height: 34px; background: transparent; color: #fff;
    border: 1px solid #5a5a5d; border-radius: 4px; cursor: pointer;
}
.studio__btn:hover { background: #333336; }
.studio__btn--main { background: var(--red); border-color: var(--red); font-weight: 700; }
.studio__btn--main:hover { background: var(--red-hover); border-color: var(--red-hover); }
.studio__btn--light { background: #fff; color: var(--graphite); border-color: #c4c4c4; }
.studio__btn--light:hover { background: var(--bg-hover); }
.studio__bar :focus-visible, .studio__zoom :focus-visible, .studio__scroller :focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #292929; }
/* Błędy zapisu: mały toast w miejscu potwierdzenia zapisu (nie przesuwa obszaru roboczego). */
.admin .studio__errors {
    position: absolute; z-index: 31; top: 62px; left: 20px; max-width: min(520px, calc(100% - 40px)); margin: 0;
    padding: 8px 14px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.admin .studio__errors ul { margin: 4px 0 0; padding-left: 18px; }
.admin .studio__errors button { min-height: 36px; margin: -8px -14px -8px 0; }
/* Pola liczbowe w inspektorze: błąd pokazuje czerwona ramka i toast; tekst pod polem tylko dla czytników ekranu,
   bo w wąskiej siatce rozpychał sąsiednie pola. */
.studio__inspector .template-num .field__error {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Wartość poprawiona do dozwolonego zakresu: krótkie podświetlenie pola. */
@keyframes studio-corrected { 0%, 40% { box-shadow: 0 0 0 3px #f2c14e; } 100% { box-shadow: 0 0 0 3px rgba(242, 193, 78, 0); } }
.input-unit.is-corrected input { animation: studio-corrected 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .input-unit.is-corrected input { animation: none; } }

.studio__work {
    position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background-color: #2f2f31;
    background-image: radial-gradient(#47474a 1px, transparent 1px); background-size: 20px 20px;
}
.studio__scroller { position: absolute; inset: 0; overflow: auto; }
.studio__pad { display: flex; justify-content: center; align-items: flex-start; width: max-content; min-width: 100%; padding: 48px 330px 72px 130px; }
.studio__sheet { position: relative; flex: none; width: 600px; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
.studio__canvas, .studio__fallback { display: block; width: 100%; height: 100%; background: #fff; }
.studio__fallback { height: auto; }
.studio__marks {
    position: absolute; inset: -22px; pointer-events: none; background-repeat: no-repeat;
    --m: linear-gradient(#9a9a9c, #9a9a9c);
    background-image: var(--m), var(--m), var(--m), var(--m), var(--m), var(--m), var(--m), var(--m);
    background-size: 14px 1px, 14px 1px, 14px 1px, 14px 1px, 1px 14px, 1px 14px, 1px 14px, 1px 14px;
    background-position:
        0 21px, 100% 21px, 0 calc(100% - 22px), 100% calc(100% - 22px),
        21px 0, calc(100% - 22px) 0, 21px 100%, calc(100% - 22px) 100%;
}

/* Części grafiki (klikane), linie i etykiety na płótnie */
.studio-zone {
    position: absolute; left: 0; right: 0; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; z-index: 1;
}
.studio-zone:hover { background: rgba(206, 14, 45, .07); box-shadow: inset 0 0 0 2px rgba(206, 14, 45, .6); }
.admin .studio-zone:focus-visible { outline: 3px solid #fff; outline-offset: -3px; box-shadow: inset 0 0 0 6px #292929; }
.studio-zone__tip {
    position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: none; padding: 4px 10px; font-size: 13px; white-space: nowrap;
    background: var(--graphite); color: #fff; pointer-events: none; max-width: 90%; overflow: hidden; text-overflow: ellipsis; border-radius: 3px;
}
.studio-zone:hover .studio-zone__tip, .studio-zone:focus-visible .studio-zone__tip { display: block; }
.studio-edge { position: absolute; left: -64px; right: -64px; height: 0; border-top: 2px dashed #e8e8e8; pointer-events: none; z-index: 2; margin-top: -1px; }
.studio-edge__label {
    position: absolute; right: calc(100% + 2px); top: -11px; padding: 3px 8px; font-size: 12px; line-height: 1.3; white-space: nowrap;
    background: #e8e8e8; color: var(--graphite); border-radius: 3px;
}
.studio-dim { position: absolute; right: -40px; width: 0; border-left: 1px solid #9a9a9c; pointer-events: none; z-index: 2; }
.studio-dim__text { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; color: #e8e8e8; }
.studio-cut { position: absolute; left: -120px; right: -64px; height: 28px; margin-top: -14px; z-index: 3; cursor: ns-resize; touch-action: none; }
.studio-cut::before { content: ""; position: absolute; left: 56px; right: 0; top: 13px; height: 2px; background: var(--red); }
.studio-cut::after {
    content: ""; position: absolute; left: 111px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
    border: 3px solid var(--red); box-sizing: border-box;
}
.studio-cut__label {
    position: absolute; left: 8px; top: 2px; padding: 3px 8px; font-size: 12px; line-height: 1.3; font-weight: 700; white-space: nowrap;
    background: var(--red); color: #fff; border-radius: 3px; pointer-events: none;
}
.admin .studio-cut:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 5px #292929; }
.studio-qr { position: absolute; z-index: 3; border: 2px dashed transparent; border-radius: 0; touch-action: pan-y; cursor: ew-resize; }
.studio-qr:hover, .studio-qr.is-dragging { border-color: var(--red); }
.studio-qr[data-mode="on_image"] { border-color: var(--red); cursor: move; touch-action: none; }
.admin .studio-qr:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 5px #292929; border-color: var(--red); }
.studio__work.is-editing .studio-cut, .studio__work.is-editing .studio-edge, .studio__work.is-editing .studio-dim, .studio__work.is-editing .studio-qr { visibility: hidden; }
.studio__work.is-editing .studio-zone:not(.is-active) { background: rgba(47, 47, 49, .55); box-shadow: none; }
.studio__work.is-editing .studio-zone__tip { display: none; }
.studio__work.is-editing .studio-zone.is-active, .studio__work.is-editing .studio-zone.is-active:hover { background: transparent; box-shadow: inset 0 0 0 3px var(--red); }

/* Zoom i podpowiedź */
.studio__zoom {
    position: absolute; left: 24px; bottom: 24px; z-index: 5; display: flex; align-items: center; background: #1f1f21; border-radius: 6px; color: #e8e8e8; font-size: 13px;
}
.studio__zoom button { min-width: 34px; height: 34px; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; cursor: pointer; border-radius: 6px; }
.studio__zoom button:hover { background: #333336; }
.studio__zoom span { padding: 0 6px; min-width: 46px; text-align: center; }
.studio__zoom .studio__zoom-fit { font-size: 13px; padding: 0 12px; border-left: 1px solid #3a3a3d; border-radius: 0 6px 6px 0; }
.admin .studio__hint { position: absolute; left: 210px; right: 340px; bottom: 30px; margin: 0; text-align: center; font-size: 13px; color: #9a9a9c; pointer-events: none; z-index: 1; }

/* Pływający inspektor */
.studio__inspector {
    position: absolute; right: 28px; top: 28px; z-index: 5; width: 288px; max-height: calc(100% - 56px); overflow: auto; background: #fff;
    border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); font-size: 14px; transition: opacity .15s;
}
.studio__inspector.is-dim { opacity: .55; }
.studio-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.studio-sec:last-child { border-bottom: 0; }
.studio-sec h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.studio-tiles { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.studio-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.studio-tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.studio-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; font-size: 12px; line-height: 1.2; text-align: center;
    border: 1px solid #dcdcdc; border-radius: 6px; background: #fff; color: var(--graphite); cursor: pointer; min-width: 0;
}
.studio-tile:hover { border-color: var(--field-border); }
.studio-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.studio-tile:has(input:checked) { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: var(--red-light); color: var(--red-dark); font-weight: 700; }
.studio-tile:has(input:focus-visible) { outline: 3px solid var(--graphite); outline-offset: 2px; }
.studio-tile--row { flex-direction: row; gap: 8px; padding: 6px; text-align: left; }
.studio-tile--row:has(input:checked) { background: #fff; color: var(--graphite); font-weight: 400; }
.studio-swatch { flex: none; width: 26px; height: 26px; border-radius: 4px; }
.studio-swatch--picker { background: conic-gradient(#ce0e2d, #f2c14e, #3a8f6b, #2a5bd7, #ce0e2d); }
.studio-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.studio-row + .studio-row { margin-top: 8px; }
.studio .template-num { gap: 4px; }
.studio .template-num label { font-size: 12px; color: var(--muted); }
.admin .studio .input-unit input[type=number] { min-height: 32px; height: 32px; padding: 0 22px 0 8px; font-size: 14px; border: 1px solid #c4c4c4; border-radius: 4px; }
.admin .studio .input-unit input[type=number][aria-invalid=true] { border: 2px solid var(--red); padding: 0 21px 0 7px; }
.admin .studio-chips__lead { margin: 14px 0 6px; font-size: 12px; color: var(--muted); }
.studio-chips__list { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-chip { font: inherit; font-size: 12px; min-height: 26px; padding: 3px 9px; border: 1px solid #dcdcdc; border-radius: 4px; background: #fff; color: var(--graphite); cursor: pointer; }
.studio-chip:hover { border-color: var(--graphite); }
.studio-chip[aria-pressed=true] { border-color: var(--red); background: var(--red-light); color: var(--red-dark); }
.admin .studio-note { margin: 0; font-size: 13px; color: var(--muted); }
.admin .studio-note--warn { margin-top: 8px; font-size: 12px; color: var(--red-dark); }
.studio-row--card { grid-auto-flow: row; grid-template-columns: 96px minmax(0, 1fr); }
.studio-name-opt { margin-top: 10px; display: grid; gap: 2px; }
.studio-name-opt .studio-note { padding-left: 42px; }
.studio-switch { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; color: var(--graphite); cursor: pointer; position: relative; }
.admin .studio .studio-switch { color: var(--graphite); font-size: 13px; }
.studio-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.studio-switch__track { flex: none; position: relative; width: 34px; height: 20px; border-radius: 10px; background: #b9b9b9; transition: background .15s; }
.studio-switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.studio-switch input:checked + .studio-switch__track { background: var(--red); }
.studio-switch input:checked + .studio-switch__track::after { transform: translateX(14px); }
.studio-switch input:focus-visible + .studio-switch__track { outline: 3px solid var(--graphite); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .studio-switch__track, .studio-switch__track::after { transition: none; } }
.admin .studio-bg { margin: 8px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.studio-bg code { color: var(--graphite); background: none; padding: 0; font-size: 13px; }
.studio-bg span { font-size: 12px; color: var(--muted); }
.studio-bg input[type=color] { width: 44px; height: 28px; padding: 0; border: 1px solid var(--field-border); background: #fff; cursor: pointer; }
.studio-descs { list-style: none; margin: 0 -8px; padding: 0; font-size: 13px; }
.studio-desc {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 5px 8px; font: inherit; font-size: 13px; text-align: left;
    border: 0; border-radius: 4px; background: none; color: var(--graphite); cursor: pointer; min-height: 30px;
}
.studio-desc:hover { background: var(--bg-hover); }
.studio-desc__name { color: var(--muted); flex: none; }
.studio-desc__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.studio-desc__value.is-empty { color: var(--red); text-decoration: underline; }
.studio-desc__state { color: var(--red-dark); }
.studio-desc.is-active { background: var(--red-light); }
.studio-desc.is-active .studio-desc__name { color: var(--red-dark); font-weight: 700; }
.studio__inspector .template-texts { box-shadow: none; padding: 0; }
.studio__inspector .field__help { font-size: 12px; }

/* Okienko opisu części, przyczepione ze strzałką */
.studio-pop { position: absolute; z-index: 10; width: 300px; padding: 16px; background: #fff; color: var(--graphite); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .4); }
.studio-pop h2 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.admin .studio-pop__help { margin: 0 0 10px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.studio-pop label { font-size: 12px; color: var(--muted); }
.studio-pop textarea {
    display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 14px; padding: 8px; border: 2px solid var(--graphite); border-radius: 4px; resize: vertical; background: #fff; color: var(--graphite);
}
.admin .studio-pop__count { margin: 10px 0 12px; font-size: 12px; color: var(--muted); text-align: right; }
.studio-pop__actions { display: flex; gap: 8px; justify-content: flex-end; }
.studio-pop__arrow { position: absolute; top: 34px; left: -8px; width: 16px; height: 16px; background: #fff; transform: rotate(45deg); }
.studio-pop.is-left .studio-pop__arrow { left: auto; right: -8px; }
.studio-pop .studio__btn { font-size: 13px; }

@media (max-width: 959px) {
    body.studio .panel { height: auto; }
    .studio__work { overflow: visible; display: flex; flex-direction: column; flex: none; }
    .studio__scroller { position: static; overflow-x: auto; overflow-y: hidden; }
    .studio__pad { padding: 44px 110px 28px 130px; }
    .studio__inspector { position: static; width: auto; max-height: none; margin: 4px 16px 16px; overflow: visible; }
    .studio__zoom { position: static; order: -1; margin: 0 16px 8px; width: max-content; }
    .admin .studio__hint { position: static; order: -1; margin: 0 16px 8px; text-align: left; }
}
@media (max-width: 768px) {
    body.studio .menu__brand { display: none; }
    body.studio .menu { padding-bottom: 4px; }
}
@media (max-width: 759px) {
    .studio__bar { padding: 10px 14px; gap: 8px 12px; }
    .studio__crumb { flex: 1 1 100%; }
    .studio__steps-wrap { flex: 1 1 100%; margin: 0; }
    .studio__steps { width: 100%; }
    .studio__steps li { flex: 1 1 0; }
    .admin .studio__steps a { padding: 8px 4px; text-align: center; font-size: 12px; }
    .studio__status { flex: 1 1 auto; }
    .studio__pad { padding: 34px 26px 26px; }
    .studio-cut { left: -8px; right: -8px; }
    .studio-cut::before { left: 0; }
    .studio-cut::after { left: -1px; }
    .studio-cut__label { left: 14px; top: -20px; }
    .studio-edge { left: -8px; right: -8px; }
    .studio-edge__label { right: auto; left: 14px; top: 4px; }
    .studio-dim { display: none; }
    .studio-pop { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; max-height: 80vh; overflow: auto; border-radius: 10px 10px 0 0; }
    .studio-pop__arrow { display: none; }
    .admin .studio__hint { margin: 0 14px 8px; }
    .studio__zoom { margin: 0 14px 8px; }
    .studio__inspector { margin: 4px 12px 16px; }
}

/* Wspólne dla kroków 1 i 3: przyciski-linki, formularze w inspektorze, przełączniki segmentowe */
.admin a.studio__btn, .admin a.studio__btn:hover { display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.studio-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.studio-form .field { gap: 4px; }
.studio-form--after { margin-top: 14px; }
.admin .studio-form label { font-size: 12px; color: var(--muted); }
.admin .studio__inspector input[type=text], .admin .studio__inspector input[type=email], .admin .studio__inspector select {
    width: 100%; min-height: 34px; height: 34px; padding: 0 10px; font-size: 14px; border: 1px solid #c4c4c4; border-radius: 4px; background-color: #fff; color: var(--graphite);
}
.admin .studio__inspector input[aria-invalid=true] { border: 2px solid var(--red); padding: 0 9px; }
.admin .studio__inspector input[type=file] { width: 100%; min-height: 0; height: auto; padding: 0; border: 0; font-size: 12px; }
.studio-form .studio__btn { width: 100%; justify-content: center; }
.studio__inspector .field__error { margin: 2px 0 0; font-size: 12px; }
.admin .studio-spec { margin: 0 0 2px; font-size: 15px; }
.admin .studio-usage { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.studio__inspector .upload-progress { margin-top: 0; }

.studio-seg { display: flex; gap: 2px; }
.studio-seg[hidden] { display: none; }
.studio-seg + .studio-seg { margin-left: 4px; padding-left: 6px; border-left: 1px solid #3a3a3d; }
.admin .studio__zoom .studio-seg > * {
    display: inline-flex; align-items: center; min-width: 0; height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: none; cursor: pointer;
    font: inherit; font-size: 13px; color: #9a9a9c; text-decoration: none; white-space: nowrap;
}
.admin .studio__zoom .studio-seg > *:hover { color: #fff; }
.admin .studio__zoom .studio-seg > [aria-pressed=true], .admin .studio__zoom .studio-seg > [aria-current] { background: #3a3a3d; color: #fff; }
.studio__zoom--views { padding: 3px; flex-wrap: wrap; }

/* Wyrównanie kodu w poziomie (krok 2) */
.studio-aligns { display: flex; height: 32px; border: 1px solid #c4c4c4; border-radius: 4px; overflow: hidden; background: #fff; }
.studio-aligns[hidden] { display: none; }
.studio .studio-aligns__label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.studio-aligns button { flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: none; color: var(--graphite); display: grid; place-items: center; cursor: pointer; }
.studio-aligns button + button { border-left: 1px solid #dcdcdc; }
.studio-aligns button:hover { background: var(--bg-hover); }
.studio-aligns button[aria-pressed=true] { background: var(--red-light); color: var(--red-dark); box-shadow: inset 0 0 0 1px var(--red); }
.admin .studio-aligns button:focus-visible { outline: 3px solid var(--graphite); outline-offset: -3px; }

/* Krok 1: cała grafika jako próbny wydruk */
.studio__img { display: block; width: 100%; height: 100%; background: #fff; }
.studio--sheet .studio__sheet { height: auto; }

/* Krok 3: podgląd maila z nagłówkiem skrzynki */
.studio-mail { width: 640px; transition: width .2s ease; }
.studio-mail[data-device=phone] { width: 375px; }
.studio-inbox { padding: 14px 18px 12px; border-bottom: 1px solid #e3e3e3; background: #fff; color: var(--graphite); }
.admin .studio-inbox p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .studio-inbox__from { font-size: 13px; }
.studio-inbox__from span { color: var(--muted); }
.admin .studio-inbox__subject { margin-top: 6px; font-size: 16px; font-weight: 700; }
.admin .studio-inbox__pre { font-size: 13px; color: #8a8a8a; }
.studio-inbox__pre:empty { display: none; }
.studio-mail__frame { display: block; width: 100%; height: 760px; border: 0; background: #fff; }
@media (max-width: 959px) {
    .studio--sheet .studio__pad { padding: 40px 28px 24px; }
    .studio--mail .studio__pad { width: auto; padding: 24px 16px; }
    .studio-mail { max-width: 100%; }
}
@media (max-width: 759px) {
    .studio--sheet .studio__pad { padding: 34px 26px 26px; }
    .studio--mail .studio__pad { padding: 16px 14px 20px; }
    .studio__zoom--views { max-width: calc(100% - 28px); }
    .studio-seg + .studio-seg { margin-left: 0; padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .studio__inspector { transition: none; }
    .studio-mail { transition: none; }
}
