/* Betlewski Usługi - grawer na karcie produktu. Wszystko z prefiksem bsv-, odporne na style motywu. */

.bsv-services,
.bsv-dialog {
    --bsv-accent: #a3004f;
    --bsv-accent-dark: #7f003d;
    --bsv-accent-soft: #fbf2f6;
    --bsv-text: #1f1d1e;
    --bsv-muted: #6d6a6c;
    --bsv-border: #dedadd;
    --bsv-surface: #faf8f9;
    --bsv-error: #c62828;
    --bsv-engraving: #a58f77;
    --bsv-radius: 10px;
    color: var(--bsv-text);
    font-size: 15px;
    line-height: 1.45;
}

.bsv-services [hidden],
.bsv-dialog[hidden],
.bsv-dialog [hidden] {
    display: none !important;
}

.bsv-services *,
.bsv-dialog * {
    box-sizing: border-box;
}

/* Przyciski (niezależne od stylów przycisków motywu) */

.bsv-services .bsv-btn,
.bsv-dialog .bsv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    margin: 0;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.bsv-services .bsv-btn-primary,
.bsv-dialog .bsv-btn-primary {
    border-color: var(--bsv-accent);
    background: var(--bsv-accent);
    color: #fff;
}

.bsv-services .bsv-btn-primary:hover,
.bsv-dialog .bsv-btn-primary:hover {
    border-color: var(--bsv-accent-dark);
    background: var(--bsv-accent-dark);
    color: #fff;
}

.bsv-services .bsv-btn-secondary,
.bsv-dialog .bsv-btn-secondary {
    border-color: var(--bsv-border);
    background: #fff;
    color: var(--bsv-text);
}

.bsv-services .bsv-btn-secondary:hover,
.bsv-dialog .bsv-btn-secondary:hover {
    border-color: var(--bsv-text);
    background: #fff;
    color: var(--bsv-text);
}

.bsv-services .bsv-btn-link {
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--bsv-muted);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bsv-services .bsv-btn-link:hover {
    background: none;
    color: var(--bsv-error);
}

.bsv-services .bsv-btn:focus-visible,
.bsv-dialog .bsv-btn:focus-visible,
.bsv-dialog button:focus-visible,
.bsv-dialog input:focus-visible {
    outline: 2px solid var(--bsv-accent);
    outline-offset: 2px;
}

/* Wiersz „Personalizacja / Grawer” na karcie produktu */

.bsv-services {
    width: 100%;
    margin: 4px 0 16px;
}

.bsv-services[hidden] {
    display: none !important;
}

.bsv-services .bsv-services-title {
    margin: 0 0 8px;
    color: var(--bsv-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bsv-service {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px;
    border: 1px solid var(--bsv-border);
    border-radius: var(--bsv-radius);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bsv-service.is-added {
    border-color: var(--bsv-accent);
}

.bsv-service.is-error {
    border-color: var(--bsv-error);
}

.bsv-service-body {
    display: flex;
    flex: 1 1 140px;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bsv-service-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bsv-service-name {
    font-size: 15px;
    font-weight: 700;
}

.bsv-service-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 13.5px;
}

.bsv-service-detail:empty {
    display: none;
}

.bsv-service-price {
    color: var(--bsv-accent);
    font-weight: 700;
    white-space: nowrap;
}

.bsv-service-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--bsv-text);
}

/* Miejsce w osobnej linii: opis po lewej, cena po prawej */
.bsv-service-place {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 10px;
}

.bsv-service-place-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bsv-service-place-price {
    flex: 0 0 auto;
    color: var(--bsv-accent);
    font-weight: 700;
    white-space: nowrap;
}

.bsv-service-place.is-dim .bsv-service-place-text {
    color: var(--bsv-muted);
}

/* Powód, dla którego to miejsce nie trafi do koszyka - w linii miejsca, pod opisem */
.bsv-service-place-note {
    display: flex;
    flex: 0 0 100%;
    align-items: flex-start;
    gap: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.bsv-service-place-note svg {
    flex: 0 0 auto;
    margin-top: 2px;
}

.bsv-service-place.is-warning .bsv-service-place-note {
    color: #7a4b00;
}

.bsv-service-place.is-error .bsv-service-place-note {
    color: var(--bsv-error);
}

.bsv-service-place.is-warning + .bsv-service-place,
.bsv-service-place.is-error + .bsv-service-place {
    margin-top: 4px;
}

.bsv-service-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--bsv-border);
}

.bsv-service-total strong {
    color: var(--bsv-accent);
    white-space: nowrap;
}

.bsv-services .bsv-service-more {
    align-self: flex-start;
    margin: 0;
    padding: 2px 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--bsv-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: none;
    cursor: pointer;
}

.bsv-services .bsv-service-more:focus-visible {
    outline: 2px solid var(--bsv-accent);
    outline-offset: 2px;
}

.bsv-service-summary.is-dim {
    color: var(--bsv-muted);
}

.bsv-service-note {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.bsv-service-note svg {
    flex: 0 0 auto;
    margin-top: 2px;
}

.bsv-service-note.is-warning {
    color: #7a4b00;
}

.bsv-service-note.is-error {
    color: var(--bsv-error);
}

.bsv-service-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* Zapisany grawer: opisy i ceny na całą szerokość, „Zmień” i „Usuń” pod nimi */
.bsv-service.has-saved .bsv-service-body {
    flex-basis: 100%;
}

.bsv-service.has-saved .bsv-service-actions {
    width: 100%;
    justify-content: flex-end;
}

.bsv-services .bsv-service-actions .bsv-btn {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

.bsv-services .bsv-service-actions .bsv-btn-link {
    padding: 0 8px;
}

.bsv-services .bsv-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Informacja o usłudze (ⓘ): opis i czas realizacji */

/* Okienko informacji pod całym wierszem (zawsze mieści się na ekranie telefonu) */
.bsv-info {
    position: relative;
    display: inline-flex;
}

.bsv-services .bsv-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--bsv-muted);
    cursor: pointer;
}

.bsv-services .bsv-info-toggle:hover,
.bsv-info.is-open .bsv-info-toggle {
    color: var(--bsv-text);
}

.bsv-services .bsv-info-toggle:focus-visible {
    outline: 2px solid var(--bsv-accent);
    outline-offset: 1px;
}

/* Dymek nad ikoną „i”, strzałka wskazuje ikonę. Przesunięcie w bok (gdy dymek wychodziłby poza ekran) i dymek
   pod ikoną (gdy nad nią brak miejsca) ustawia skrypt: --bsv-shift i .is-below */
.bsv-info-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    z-index: 30;
    display: none;
    width: max-content;
    max-width: min(300px, calc(100vw - 32px));
    padding: 10px 12px;
    border: 1px solid var(--bsv-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    color: var(--bsv-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    transform: translateX(calc(-50% + var(--bsv-shift, 0px)));
}

.bsv-info-panel::before {
    content: "";
    position: absolute;
    top: 100%;
    left: calc(50% - var(--bsv-shift, 0px));
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-right: 1px solid var(--bsv-border);
    border-bottom: 1px solid var(--bsv-border);
    background: #fff;
    transform: rotate(45deg);
}

/* Most między ikoną a dymkiem - kursor nie gubi dymka po drodze */
.bsv-info-panel::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: 12px;
}

.bsv-info.is-below .bsv-info-panel {
    top: calc(100% + 10px);
    bottom: auto;
}

.bsv-info.is-below .bsv-info-panel::before {
    top: auto;
    bottom: 100%;
    margin: 0 0 -5px -5px;
    transform: rotate(225deg);
}

.bsv-info.is-below .bsv-info-panel::after {
    top: auto;
    bottom: 100%;
}

.bsv-info.is-open .bsv-info-panel {
    display: block;
}

@media (hover: hover) {
    .bsv-info:hover .bsv-info-panel {
        display: block;
    }
}

.bsv-info-lead {
    display: block;
    margin-top: 4px;
    color: var(--bsv-accent-dark);
    font-weight: 600;
}

.bsv-services-link {
    margin: 0 0 14px;
    font-size: 14px;
}

/* Okno grawera */

html.bsv-dialog-open,
html.bsv-dialog-open body {
    overflow: hidden !important;
}

.bsv-dialog {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bsv-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 20, 22, 0.55);
    opacity: 0;
    transition: opacity 0.2s;
}

.bsv-dialog.is-open .bsv-dialog-backdrop {
    opacity: 1;
}

.bsv-dialog-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.2s, transform 0.2s;
}

.bsv-dialog.is-open .bsv-dialog-panel {
    opacity: 1;
    transform: none;
}

.bsv-dialog-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 14px 24px;
    border-bottom: 1px solid var(--bsv-border);
}

.bsv-dialog .bsv-dialog-header h2 {
    margin: 0;
    padding: 0;
    color: var(--bsv-text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.3;
    text-transform: none;
}

.bsv-dialog .bsv-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--bsv-muted);
    cursor: pointer;
}

.bsv-dialog .bsv-dialog-close:hover {
    background: var(--bsv-surface);
    color: var(--bsv-text);
}

.bsv-dialog-body {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.bsv-dialog-preview {
    padding: 20px 24px;
    overflow-y: auto;
    background: var(--bsv-surface);
}

.bsv-photo {
    text-align: center;
    line-height: 0;
}

/* Ramka ma dokładnie wymiary zdjęcia - położenie graweru (w %) liczy się względem zdjęcia */
.bsv-photo-frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--bsv-radius);
    background: #fff;
    vertical-align: top;
}

.bsv-dialog .bsv-photo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 260px);
    max-height: calc(100dvh - 260px);
    margin: 0;
    pointer-events: none;
}

.bsv-photo-art {
    position: absolute;
    left: 50%;
    top: 50%;
    line-height: 0;
    pointer-events: none;
}

.bsv-photo-art .bsv-engraving-svg {
    display: block;
    width: 100%;
    height: auto;
    fill: var(--bsv-engraving);
    filter: drop-shadow(1px 1px 1.5px rgba(0, 0, 0, 0.45));
    opacity: 0.92;
}

.bsv-views {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.bsv-dialog .bsv-view {
    width: 64px;
    height: 64px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--bsv-border);
    cursor: pointer;
}

.bsv-dialog .bsv-view img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bsv-dialog .bsv-view.is-selected {
    border-color: var(--bsv-accent);
    box-shadow: none;
}

.bsv-preview-note {
    margin: 10px 0 0;
    color: var(--bsv-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.bsv-dialog-controls {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.bsv-step + .bsv-step {
    margin-top: 22px;
}

.bsv-dialog .bsv-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--bsv-text);
    font-size: 15px;
    font-weight: 700;
}

.bsv-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bsv-text);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.bsv-dialog-heading {
    min-width: 0;
}

.bsv-dialog .bsv-dialog-subtitle {
    margin: 2px 0 0;
    color: var(--bsv-muted);
    font-size: 13.5px;
    line-height: 1.4;
}

.bsv-dialog .bsv-dialog-subtitle:empty {
    display: none;
}

/* Wybór wariantu w oknie (te same wartości co w formularzu karty) */

.bsv-variant {
    margin: 0 0 18px;
}

.bsv-variant-attr + .bsv-variant-attr {
    margin-top: 10px;
}

.bsv-dialog .bsv-variant-label {
    margin: 0 0 6px;
    color: var(--bsv-muted);
    font-size: 13px;
    font-weight: 600;
}

.bsv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bsv-dialog .bsv-chip {
    min-height: 40px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--bsv-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    color: var(--bsv-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.bsv-dialog .bsv-chip:hover {
    border-color: var(--bsv-muted);
}

.bsv-dialog .bsv-chip.is-selected {
    border-color: var(--bsv-accent);
    box-shadow: 0 0 0 1px var(--bsv-accent) inset;
}

.bsv-dialog .bsv-chip:disabled {
    opacity: 0.45;
    text-decoration: line-through;
    cursor: not-allowed;
}

.bsv-dialog .bsv-dialog-message {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bsv-surface);
    font-size: 14px;
}

.bsv-dialog .bsv-dialog-message.is-error {
    background: #fdecec;
    color: var(--bsv-error);
}

.bsv-dialog .bsv-places-hint {
    margin: 0 0 8px;
    color: var(--bsv-muted);
    font-size: 13.5px;
}

.bsv-dialog .bsv-btn-primary:disabled,
.bsv-dialog .bsv-btn-primary:disabled:hover {
    border-color: var(--bsv-accent);
    background: var(--bsv-accent);
    color: #fff;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Miejsca grawera (zakładki) */

/* Linia pod zakładkami jako cień (bez ujemnego marginesu - przewijanie w poziomie bez paska w pionie) */
.bsv-place-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 18px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 -1px 0 var(--bsv-border);
    scrollbar-width: thin;
}

.bsv-dialog .bsv-place-tab {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0;
    padding: 8px 14px 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--bsv-muted);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
    cursor: pointer;
}

.bsv-dialog .bsv-place-tab.is-active {
    border-bottom-color: var(--bsv-accent);
    color: var(--bsv-text);
}

.bsv-place-tab-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bsv-place-tab-check {
    display: inline-flex;
    color: var(--bsv-accent);
}

.bsv-place-tab-price {
    color: var(--bsv-muted);
    font-size: 12.5px;
    font-weight: 500;
}

.bsv-place-tab.is-on .bsv-place-tab-price {
    color: var(--bsv-accent);
}

.bsv-place-add {
    padding: 20px 16px;
    border: 1px dashed var(--bsv-border);
    border-radius: var(--bsv-radius);
    text-align: center;
}

.bsv-dialog .bsv-place-add-text {
    margin: 0 0 12px;
    font-size: 15px;
}

.bsv-dialog .bsv-place-off {
    min-height: 40px;
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bsv-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bsv-dialog .bsv-place-off:hover {
    color: var(--bsv-error);
}

/* „Wyczyść formularz” pod polami tekstu */
.bsv-dialog .bsv-clear-text {
    min-height: 40px;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bsv-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bsv-dialog .bsv-clear-text:hover:not(:disabled) {
    background: none;
    color: var(--bsv-text);
}

.bsv-dialog .bsv-clear-text:disabled {
    opacity: 0.45;
    cursor: default;
}

.bsv-dialog .bsv-dialog-notice {
    margin: 22px 0 0;
    color: var(--bsv-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.bsv-dialog .bsv-dialog-notice:empty {
    display: none;
}

.bsv-dialog-total {
    display: block;
    color: var(--bsv-muted);
    font-size: 13px;
}

/* Wzory */

.bsv-patterns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.bsv-dialog .bsv-pattern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 8px 6px 10px;
    border: 1px solid var(--bsv-border);
    border-radius: var(--bsv-radius);
    background: #fff;
    box-shadow: none;
    color: var(--bsv-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.25;
    text-transform: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bsv-dialog .bsv-pattern:hover {
    border-color: var(--bsv-muted);
}

.bsv-dialog .bsv-pattern.is-selected {
    border-color: var(--bsv-accent);
    box-shadow: 0 0 0 1px var(--bsv-accent) inset;
}

.bsv-pattern-art {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.bsv-pattern-art {
    overflow: hidden;
}

/* Plik ma zapas miejsca wokół grafiki - w kafelku powiększamy środek */
.bsv-pattern-art .bsv-engraving-svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: var(--bsv-text);
    transform: scale(1.75);
}

.bsv-photo-art.is-placeholder .bsv-engraving-svg text {
    opacity: 0.45;
}

.bsv-pattern-name {
    text-align: center;
}

.bsv-pattern-price {
    color: var(--bsv-accent);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.bsv-dialog .bsv-pattern[hidden] {
    display: none !important;
}

/* Wyszukiwarka wzorów (przy wielu wzorach w miejscu) */

.bsv-pattern-search {
    display: block;
    margin: 0 0 10px;
}

.bsv-dialog .bsv-search-input {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--bsv-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    color: var(--bsv-text);
    font-family: inherit;
    font-size: 16px;
}

.bsv-dialog .bsv-search-input:focus {
    border-color: var(--bsv-accent);
    outline: none;
    box-shadow: 0 0 0 1px var(--bsv-accent);
}

.bsv-dialog .bsv-empty-search {
    margin: 8px 0 0;
    color: var(--bsv-muted);
    font-size: 13.5px;
}

.bsv-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.bsv-dialog-preview.is-empty .bsv-photo {
    display: none;
}

/* Czcionki */

.bsv-fonts {
    display: grid;
    gap: 8px;
}

.bsv-dialog .bsv-font {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid var(--bsv-border);
    border-radius: var(--bsv-radius);
    background: #fff;
    box-shadow: none;
    color: var(--bsv-text);
    font-family: inherit;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    cursor: pointer;
}

.bsv-dialog .bsv-font.is-selected {
    border-color: var(--bsv-accent);
    box-shadow: 0 0 0 1px var(--bsv-accent) inset;
}

.bsv-font-sample {
    overflow: hidden;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsv-font-label {
    flex: 0 0 auto;
    color: var(--bsv-muted);
    font-size: 12.5px;
}

/* Tekst */

.bsv-line + .bsv-line {
    margin-top: 12px;
}

.bsv-dialog .bsv-line label {
    display: block;
    margin: 0 0 4px;
    color: var(--bsv-muted);
    font-size: 13px;
    font-weight: 600;
}

.bsv-line-field {
    position: relative;
}

.bsv-dialog .bsv-line-input {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 64px 0 14px;
    border: 1px solid var(--bsv-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    color: var(--bsv-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 48px;
}

.bsv-dialog .bsv-line-input:focus {
    border-color: var(--bsv-accent);
    outline: none;
    box-shadow: 0 0 0 1px var(--bsv-accent);
}

.bsv-line.has-error .bsv-line-input {
    border-color: var(--bsv-error);
}

.bsv-line-count {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--bsv-muted);
    font-size: 12.5px;
    transform: translateY(-50%);
    pointer-events: none;
}

.bsv-line-count.is-full {
    color: var(--bsv-accent);
    font-weight: 700;
}

.bsv-dialog .bsv-error {
    margin: 4px 0 0;
    color: var(--bsv-error);
    font-size: 13px;
}

.bsv-dialog .bsv-error:empty {
    display: none;
}

/* Stopka okna */

.bsv-dialog-footer {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 24px;
    border-top: 1px solid var(--bsv-border);
    background: #fff;
}

.bsv-dialog-price {
    font-size: 15px;
}

.bsv-dialog-price strong {
    color: var(--bsv-accent);
}

.bsv-dialog-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Telefony i wąskie ekrany: panel od dołu na całą szerokość, podgląd na górze */

@media (max-width: 782px) {
    .bsv-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .bsv-dialog-panel {
        width: 100%;
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        max-height: none;
        border-radius: 16px 16px 0 0;
        transform: translateY(40px);
    }

    .bsv-dialog-header {
        padding: 8px 8px 8px 16px;
    }

    .bsv-dialog .bsv-dialog-header h2 {
        font-size: 18px;
    }

    .bsv-dialog-body {
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .bsv-dialog-preview {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 12px 16px;
        overflow: visible;
        box-shadow: 0 6px 12px -10px rgba(0, 0, 0, 0.35);
    }

    .bsv-dialog .bsv-photo-img {
        max-height: 34vh;
        max-height: 34dvh;
    }

    /* Pisanie tekstu: klawiatura zajmuje pół ekranu - mniejszy podgląd, bez miniatur zdjęć */
    .bsv-dialog.is-typing .bsv-photo-img {
        max-height: 18vh;
        max-height: 18dvh;
    }

    .bsv-dialog.is-typing .bsv-views {
        display: none;
    }

    .bsv-views {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-top: 8px;
        overflow-x: auto;
    }

    /* Wyśrodkowane, gdy się mieszczą; przewijane od pierwszej, gdy nie (justify-content: center ucina początek) */
    .bsv-dialog .bsv-views > .bsv-view:first-child {
        margin-left: auto;
    }

    .bsv-dialog .bsv-views > .bsv-view:last-child {
        margin-right: auto;
    }

    .bsv-dialog .bsv-view {
        flex: 0 0 auto;
        width: 48px;
        height: 48px;
    }

    .bsv-preview-note {
        display: none;
    }

    .bsv-dialog-controls {
        padding: 16px;
        overflow: visible;
    }

    .bsv-patterns {
        grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    }

    .bsv-dialog-footer {
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    }

    .bsv-dialog-price {
        width: 100%;
    }

    .bsv-dialog-buttons {
        width: 100%;
        margin-left: 0;
    }

    .bsv-dialog-buttons .bsv-btn {
        flex: 1;
    }
}

/* Telefon: wiersz w jednej linii; po zapisaniu grawera (dłuższe podsumowanie) przyciski pod spodem */
@media (max-width: 480px) {
    .bsv-service {
        gap: 8px 10px;
    }

    .bsv-service-body {
        flex-basis: 100px;
    }

    .bsv-services .bsv-service-actions .bsv-btn {
        padding: 0 12px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .bsv-dialog-backdrop,
    .bsv-dialog-panel {
        transition: none;
    }
}
