.stamp-page {
    --stamp-ink: #313030;
    --stamp-muted: #626262;
    --stamp-line: #d4d4d4;
    --stamp-paper: #f2f2f2;
    --stamp-focus: #315c79;
    color: var(--stamp-ink);
}

.stamp-page [hidden] { display: none !important; }
.stamp-page .breadcrumb { margin-bottom: 24px; }
.stamp-flow { margin: 20px 0 48px; scroll-margin-top: 16px; }
.stamp-flow button, .stamp-flow input, .stamp-flow select, .stamp-flow textarea, .stamp-flow__dialog button { font-family: inherit; }
.stamp-flow :focus-visible, .stamp-flow__dialog :focus-visible { outline: 2px solid var(--stamp-focus); outline-offset: 3px; }
.stamp-flow button:disabled { cursor: default; }

.stamp-flow__steps {
    display: flex;
    gap: 16px;
    align-items: center;
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}
.stamp-flow__steps li { display: flex; align-items: center; gap: 16px; margin: 0; min-width: 0; }
.stamp-flow__steps li:not(:last-child) { flex: 1; }
.stamp-flow__steps li:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: var(--stamp-line); }
.stamp-flow__steps button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 0;
    background: transparent;
    padding: 0 4px;
    color: var(--stamp-ink);
    font-weight: 600;
    white-space: nowrap;
}
.stamp-flow__steps button:disabled { color: var(--stamp-muted); }
.stamp-flow__number {
    display: inline-grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid transparent;
    background: var(--stamp-paper);
    font-size: 14px;
    line-height: 1;
}
.stamp-flow__number i, .stamp-flow__steps .is-complete .stamp-flow__number span { display: none; }
.stamp-flow__steps .is-complete .stamp-flow__number { border-color: var(--stamp-ink); background: #fff; }
.stamp-flow__steps .is-complete .stamp-flow__number i { display: block; }
.stamp-flow__steps [aria-current] .stamp-flow__number { background: var(--stamp-ink); color: #fff; }

.stamp-flow__layout {
    display: grid;
    grid-template: 'body aside' 1fr 'body actions' auto / minmax(0, 2fr) minmax(0, 1fr);
    gap: 0 12px;
}
.stamp-flow__body { grid-area: body; border: 1px solid var(--stamp-line); padding: clamp(16px, 3vw, 32px); min-width: 0; }
.stamp-flow__aside { grid-area: aside; min-width: 0; }
.stamp-flow__actions { grid-area: actions; }
.stamp-flow__aside, .stamp-flow__actions { padding: clamp(16px, 2.5vw, 28px); background: var(--stamp-paper); }
.stamp-flow__actions { padding-top: 0; }
.stamp-flow__aside h1 { margin: 0; color: var(--stamp-ink); font: inherit; font-size: clamp(20px, 2.3vw, 30px); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.stamp-flow__aside h1::first-letter { text-transform: uppercase; }
.stamp-flow__base-price { margin: 10px 0 0; font-size: 21px; font-weight: 600; }
.stamp-flow__imprint { display: grid; place-items: center; min-height: clamp(140px, 24vw, 285px); margin: 0 0 12px; }
.stamp-flow__imprint img { display: block; width: auto; height: auto; max-width: 100%; max-height: 270px; object-fit: contain; }
.stamp-flow__imprint--selected { min-height: 100px; padding: 8px; border: 1px solid var(--stamp-line); }
.stamp-flow__imprint--selected img { max-height: 105px; }
.stamp-flow__description { margin: 0 0 20px; font-size: 13px; color: var(--stamp-muted); line-height: 1.55; }

.stamp-flow__button, .stamp-flow a.stamp-flow__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid var(--stamp-ink);
    border-radius: 0;
    background: var(--stamp-ink);
    color: #fff;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}
.stamp-flow__button:hover, .stamp-flow a.stamp-flow__button:hover { background: #4b4a4a; color: #fff; }
.stamp-flow__button--secondary { justify-content: flex-start; border-color: var(--stamp-line); background: #fff; color: var(--stamp-ink); }
.stamp-flow__button--secondary:hover { border-color: var(--stamp-ink); background: var(--stamp-paper); color: var(--stamp-ink); }
.stamp-flow__button:disabled { opacity: .65; }
.stamp-flow [data-next] { margin-top: 16px; }
.stamp-flow__template-choice { display: flex; align-items: center; gap: 12px; min-height: 46px; margin-bottom: 8px; padding: 9px 12px; border: 1px solid var(--stamp-ink); background: var(--stamp-paper); font-weight: 600; }
.stamp-flow__edit, .stamp-flow__recap button, .stamp-flow__earlier button {
    min-height: 44px;
    padding: 2px 4px;
    border: 0;
    background: none;
    color: var(--stamp-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-align: left;
}

.stamp-flow__recap, .stamp-flow__earlier { margin: 0; }
.stamp-flow__recap:has([data-recap-step]:not([hidden])) { margin-top: 16px; }
.stamp-flow__recap > div, .stamp-flow__earlier > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    column-gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--stamp-line);
    line-height: 1.35;
}
.stamp-flow__recap dt, .stamp-flow__earlier dt { grid-column: 1; font-weight: 600; }
.stamp-flow__recap dd, .stamp-flow__earlier dd { margin: 0; grid-column: 1; overflow-wrap: anywhere; }
.stamp-flow__recap button, .stamp-flow__earlier button { grid-column: 2; grid-row: 1 / span 2; }
.stamp-flow__earlier > div { grid-template-columns: max-content minmax(0, 1fr) max-content; padding: 0 12px; border: 0; background: var(--stamp-paper); margin-bottom: 10px; }
.stamp-flow__earlier dd { grid-column: 2; }
.stamp-flow__earlier button { grid-column: 3; grid-row: 1; }

.stamp-flow__models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stamp-flow .stamp-flow__model {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 110px;
    padding: 14px 8px;
    border: 1px solid var(--stamp-line);
    border-radius: 0;
    background: #fff;
    color: var(--stamp-ink);
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.stamp-flow__model img, .stamp-flow__review-housing img { width: min(100%, 150px); height: auto; aspect-ratio: 1; object-fit: contain; }
.stamp-flow__model i { position: absolute; top: 9px; right: 9px; display: none; padding: 4px; color: #fff; background: var(--stamp-ink); font-size: 12px; }
.stamp-flow .stamp-flow__model[aria-pressed='true'] { border-color: var(--stamp-ink); }
.stamp-flow__model[aria-pressed='true'] i { display: block; }
.stamp-flow__colors { margin: 14px 0 0; }
.stamp-flow__colors legend, .stamp-flow__fields legend { width: auto; margin: 0 0 6px; border: 0; color: var(--stamp-ink); font: inherit; font-weight: 600; }
.stamp-flow__colors legend span { font-weight: 400; }
.stamp-flow__swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp-flow__swatch, .stamp-flow__variant { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; margin: 0; cursor: pointer; }
.stamp-flow__swatch span { width: 28px; height: 28px; background: var(--stamp-swatch); border: 1px solid var(--stamp-line); }
.stamp-flow__variant span { border: 1px solid var(--stamp-line); padding: 5px 10px; }
.stamp-flow__swatch input:checked + span, .stamp-flow__variant input:checked + span { outline: 2px solid var(--stamp-ink); outline-offset: 2px; }
.stamp-flow__swatch input:focus-visible + span, .stamp-flow__variant input:focus-visible + span { outline: 2px dashed var(--stamp-focus); outline-offset: 4px; }

.stamp-flow__fields { margin: 0 0 14px; min-width: 0; }
.stamp-flow__fields legend label, .stamp-flow__fields > label { margin: 0; }
.stamp-flow__fields:not(.stamp-flow__quantity) > label.stamp-flow__choice { display: block; margin-bottom: 8px; cursor: pointer; }
.stamp-flow__choice > span { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--stamp-line); font-weight: 500; }
.stamp-flow__choice i { display: grid; flex: 0 0 16px; place-items: center; width: 16px; height: 16px; border: 1px solid var(--stamp-muted); }
.stamp-flow__choice input:checked + span { border-color: var(--stamp-ink); background: var(--stamp-paper); }
.stamp-flow__choice input:checked + span i::before { content: ''; width: 8px; height: 8px; background: var(--stamp-ink); }
.stamp-flow__choice input:disabled + span { opacity: .62; cursor: default; }
.stamp-flow__choice input:focus-visible + span { outline: 2px solid var(--stamp-focus); outline-offset: 2px; }
.stamp-flow__input { display: block; width: 100%; max-width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--stamp-line); border-radius: 0; background: #fff; color: var(--stamp-ink); }
.stamp-flow__quantity { display: flex; align-items: center; gap: 12px; }
.stamp-flow__quantity .stamp-flow__input { width: 90px; }
.stamp-flow__hint { display: block; margin: 6px 0 0; color: var(--stamp-muted); font-size: 13px; }
.stamp-flow__review-housing { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 13px; }
.stamp-flow__review-housing strong, .stamp-flow__review-housing span { display: block; overflow-wrap: anywhere; }
.stamp-flow__price { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--stamp-line); margin-bottom: 14px; padding-top: 14px; }
.stamp-flow__price strong { font-size: 23px; }
.stamp-flow__notice { border: 1px solid var(--stamp-ink); background: var(--stamp-paper); padding: 10px 12px; margin: 0 0 12px; }
.stamp-flow__success p { font-weight: 600; }

.stamp-flow__dialog { inset: 0; width: min(1280px, calc(100% - 32px)); max-width: none; height: min(780px, calc(100% - 32px)); max-height: none; margin: auto; padding: 0; border: 1px solid var(--stamp-line); border-radius: 0; color: var(--stamp-ink); }
.stamp-flow__dialog[open] { display: flex; flex-direction: column; }
.stamp-flow__dialog::backdrop { background: rgb(0 0 0 / .55); }
.stamp-flow__dialog-header { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--stamp-line); background: #fff; }
.stamp-flow__editor { flex: 1; min-height: 0; }
.stamp-flow__editor iframe { width: 100%; height: 100%; border: 0; display: block; }
html:has(.stamp-flow__dialog[open]) { overflow: hidden; }

@media (max-width: 767px) {
    body:has(.stamp-page) #back-top { display: none !important; }
    .stamp-flow { margin-top: 12px; }
    .stamp-flow__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(96px, 1.2fr); gap: 3px; margin-bottom: 12px; }
    .stamp-flow__steps li { display: block; }
    .stamp-flow__steps li:not(:last-child)::after { display: none; }
    .stamp-flow__steps button { width: 100%; min-height: 55px; flex-direction: column; justify-content: flex-start; gap: 5px; padding: 4px 1px; font-size: clamp(11px, 3.3vw, 14px); line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
    .stamp-flow__number { width: 25px; height: 25px; font-size: 12px; }
    .stamp-flow__layout { grid-template: 'aside' auto 'body' auto 'actions' auto / minmax(0, 1fr); gap: 8px; }
    .stamp-flow__aside, .stamp-flow__actions, .stamp-flow__body { padding: 12px; }
    .stamp-flow__recap:has([data-recap-step]:not([hidden])) { margin-top: 8px; }
    .stamp-flow__recap > div { padding: 2px 0; }
    .stamp-flow__earlier { display: none; }
    .stamp-flow__description { margin-bottom: 12px; }
    .stamp-flow__imprint { min-height: 120px; }
    .stamp-flow__imprint--selected { min-height: 84px; }
    .stamp-flow__imprint--selected img { max-height: 84px; }
    .stamp-flow__price { border-top: 0; padding-top: 0; }
    .stamp-flow__review-housing { grid-template-columns: minmax(0, 105px) minmax(0, 1fr); }
    .stamp-flow__dialog { width: 100%; height: 100%; height: 100dvh; border: 0; }
}
