/* Shared light/dark palette and typefaces as Tibor's picker. Transactional layout stays in the plugin. */
html .sc-root{--sc-font:var(--stg-font);--sc-font-mono:var(--stg-mono);--ink:var(--stg-ink);--ink2:var(--stg-ink2);--muted:var(--stg-muted);--muted2:var(--stg-muted2);--muted3:var(--stg-muted3);--surface:var(--stg-surface);--surface2:var(--stg-soft);--surface3:var(--stg-surface3);--frame:var(--stg-surface);--desk:var(--stg-surface);--tint:var(--stg-tint);--line:var(--stg-line);--line2:var(--stg-line2);--lineStrong:var(--stg-line-strong);--accent:var(--stg-accent);--accentText:var(--stg-orange);--accentTint:var(--stg-accent-wash);--accentSolid:var(--stg-solid);--accentSolidHover:var(--stg-solid-hover);--sc-on-accent:var(--stg-on-accent);color-scheme:var(--stg-color-scheme);font-family:var(--stg-font)}
.sc-root .sc-header{background:var(--stg-surface);color:var(--stg-ink);border-color:var(--stg-line)}.sc-root .sc-header__back,.sc-root .sc-header__helplabel,.sc-root .sc-header__contact{color:var(--stg-ink)}.sc-root .sc-header__contact{background:transparent;border-color:var(--stg-line-strong)}.sc-root .sc-brand img{display:block;width:150px;max-height:23px;height:auto}.sc-root .sc-header__left{align-items:center}
@media(max-width:700px){.sc-root .sc-brand img{width:112px;max-height:17px}}

/* A full-width document with the same reading width and gutters as the site. */
.sc-root .sc-layout,.sc-root .sc-header{width:100%;max-width:var(--stg-document-width);margin-inline:auto;padding-inline:var(--stg-gutter)}
.sc-root .sc-header__back{border:1px solid var(--stg-ink);border-radius:var(--stg-r1);padding:12px 16px;min-height:var(--stg-control-height);display:inline-flex;align-items:center;text-decoration:none}
.sc-root .sc-header__contact{min-height:var(--stg-control-height);display:inline-flex;align-items:center}
.sc-root .sc-field:has(#sc-start-date){display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:10px}
.sc-root #sc-start-date{width:180px;max-width:100%;flex:none}
.sc-root .sc-field:has(#sc-start-date) .sc-label{font-weight:400;color:var(--stg-muted);margin:0}
.sc-root .sc-field:has(#sc-start-date) .sc-hint{margin:0}
@media(max-width:700px){.sc-root .sc-header__back{padding:8px 10px}.sc-root .sc-field:has(#sc-start-date) .sc-hint{flex-basis:100%}}

/* Native theme consumes the exact public reference field/radius tokens. */
.sc-root{--r1:var(--stg-r1);--r2:var(--stg-r2);--r3:var(--stg-r3);--sc-field-line:var(--stg-line-strong);--sc-field-line-strong:var(--stg-ink2)}
.sc-root #sc-company-name,.sc-root #sc-ico{border-color:var(--stg-line2)}
.sc-root #sc-company-name:focus,.sc-root #sc-ico:focus{border-color:var(--stg-ink)}
/* Contact fields follow the reference's intrinsic 220px columns, avoiding an empty third column. */
.sc-root .sc-fields:has(#sc-first-name){grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.sc-root .sc-fields:has(#sc-first-name) .sc-field:has(#sc-email){grid-column:auto}
.sc-root .sc-company-result{border:1.5px solid var(--stg-line-strong);border-radius:var(--stg-r1)}

.sc-root :is(#sc-company-name,#sc-ico)[aria-invalid="true"]{border-color:var(--stg-orange)}

.sc-root .sc-company-result[aria-selected="true"]{background:var(--stg-tint);border-color:var(--stg-orange)}

.sc-root .sc-header__contact{gap:7px}.stg-contact-icon{vertical-align:middle;flex:none}.stg-payment-brands{display:inline-flex;gap:5px;align-items:center;background:var(--stg-on-accent);padding:3px;border-radius:var(--stg-r1)}.stg-payment-brands img{object-fit:contain}

/* Company search variants share markup and behavior; B is the live default. */
.sc-root .sc-company-panel { border-radius: var(--stg-r1); border-color: var(--stg-accent); background: var(--stg-surface); color: var(--stg-ink); }
.sc-root .sc-company-cue { color: var(--stg-orange); }
.sc-root .sc-input[data-company-search] { border-color: var(--stg-accent); }
.sc-root .sc-company-result { color: var(--stg-ink); border-color: var(--stg-line); border-radius: var(--stg-r1); background: var(--stg-surface); }
.sc-root .sc-company-result:hover, .sc-root .sc-company-result[aria-selected="true"] { background: var(--stg-tint); }
.sc-root [data-company-variant="a"] .sc-company-panel { background: var(--stg-tint); }
.sc-root [data-company-variant="c"] .sc-company-panel { background: var(--stg-ink); color: var(--stg-surface); }
.sc-root [data-company-variant="c"] .sc-company-heading { color: inherit; }

.sc-root [data-company-variant="c"] .sc-company-result { padding: 16px; }
.sc-root [data-company-variant="c"] .sc-company-result > span:last-child { justify-self: start; padding: 4px 8px; border-radius: var(--stg-r1); background: var(--stg-solid); color: var(--stg-on-accent); }

.sc-root .sc-wallets { padding: 0; border: 0; border-radius: 0; background: transparent; }
.sc-root .sc-invoice { border-color: var(--stg-line); border-radius: var(--stg-r1); background: var(--stg-soft); }

/* Checkout has a separate header: keep its navigation usable without accidental wraps. */
.sc-root .sc-header{flex-wrap:nowrap;position:relative}
.sc-root .sc-header__left{min-width:0}
.sc-root .stg-checkout-desktop-help .sc-header__help{flex-wrap:nowrap;white-space:nowrap}
.stg-checkout-back-short,.stg-checkout-help-menu{display:none}
@media(max-width:1439px){
.stg-checkout-desktop-help{display:none}
.stg-checkout-help-menu{display:block;flex:none;margin-left:auto}
.stg-checkout-help-menu summary{cursor:pointer;min-height:44px;padding:12px 8px;font-size:14px;color:var(--stg-ink)}
.stg-checkout-help-panel{position:absolute;z-index:60;top:100%;inset-inline:var(--stg-gutter);padding:var(--stg-space-4);border:1px solid var(--stg-line);border-radius:var(--stg-r2);background:var(--stg-surface);box-shadow:var(--stg-shadow-menu);max-height:calc(100dvh - 120px);overflow-y:auto}
.sc-root .stg-checkout-help-panel .sc-header__help{display:flex;flex-direction:column;align-items:stretch;margin:0}
.sc-root .stg-checkout-help-panel .sc-header__contact{white-space:normal;overflow-wrap:anywhere;justify-content:flex-start}
.stg-checkout-help-panel .stg-header-controls{flex-direction:column;align-items:stretch;border-top:1px solid var(--stg-line);padding-top:var(--stg-space-3);margin-top:var(--stg-space-2)}
.stg-checkout-help-panel .stg-theme-switch{display:flex;order:1;justify-content:space-between;min-height:44px}
.stg-checkout-help-panel .stg-language-button{align-self:flex-start}
.stg-checkout-help-panel .stg-theme-label{position:static;width:auto;height:auto;clip-path:none;overflow:visible}
}
@media(max-width:700px){
.stg-checkout-back-long{display:none}.stg-checkout-back-short{display:inline}
.sc-root .sc-header{gap:8px;padding-block:12px}
.sc-root .sc-header__left{gap:10px}
.sc-root .sc-header__back{gap:4px;white-space:normal;line-height:1.3;justify-content:center}
.sc-root .sc-header .sc-brand{flex:none}
}
@media(max-width:360px){.sc-root .sc-header .sc-brand img{width:92px}.sc-root .sc-header__back{padding-inline:6px}.sc-root .sc-header__left{gap:6px}}
@media(max-width:1439px){.sc-root .stg-checkout-help-panel .stg-header-controls{margin-left:0;width:100%}}

/* Company identity stays visible; auto-filled billing details are editable on demand. */
.sc-root .sc-company-billing{margin-block:var(--stg-space-4);padding:var(--stg-space-3);border:1px solid var(--stg-line);border-radius:var(--stg-r1);background:var(--stg-surface)}
.sc-root .sc-company-billing[hidden]{display:none}
.sc-root .sc-company-billing>summary{cursor:pointer;min-height:44px;padding-block:var(--stg-space-2);font-weight:600;color:var(--stg-ink)}
.sc-root .sc-company-billing>.sc-fields{margin-top:var(--stg-space-3)}
@media(min-width:900px){.sc-root .sc-fields:has(#sc-company-name){grid-template-columns:minmax(0,2fr) minmax(0,1fr)}.sc-root .sc-fields:has(#sc-company-name)>*{grid-column:auto}}

/* Billing completeness is visible even while its editable fields are collapsed. */
.sc-root .sc-company-billing-status{display:block;font-size:var(--stg-text-sm,14px);font-weight:400;line-height:1.5;color:var(--stg-orange);margin-top:4px}
.sc-root .sc-company-billing-status[data-complete="true"]{color:var(--stg-ink2)}

/* Receipt uses the same theme scale and cards as the checkout and customer portal. */
.sc-root .sc-done{gap:var(--stg-space-5);color:var(--stg-ink)}
.sc-root .sc-done__head{gap:var(--stg-space-3);align-items:flex-start}
.sc-root .sc-done .sc-title--done{font-family:var(--stg-font);font-size:var(--stg-heading);line-height:1.15;max-width:28ch;margin:0}
.sc-root .sc-done .sc-lede{font-size:18px;line-height:1.6;max-width:70ch;margin:0;color:var(--stg-muted)}
.sc-root .sc-done .sc-facts{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--stg-space-3);align-items:stretch}
.sc-root .sc-done .sc-fact{height:100%;box-sizing:border-box;padding:var(--stg-space-4);gap:var(--stg-space-2);border:1px solid var(--stg-line);border-radius:var(--stg-r2);background:var(--stg-soft)}
.sc-root .sc-done .sc-fact__value{font-size:20px;line-height:1.45;overflow-wrap:anywhere}
.sc-root .sc-done .sc-fact__value--text{font-family:var(--stg-font);font-size:16px}
.sc-root .sc-done .sc-invoice,.sc-root .sc-done .sc-card{margin:0;padding:var(--stg-space-5);border:1px solid var(--stg-line);border-radius:var(--stg-r2);background:var(--stg-surface)}
.sc-root .sc-done .sc-card__body{padding:0;gap:var(--stg-space-2)}
.sc-root .sc-done .sc-card__title{font-family:var(--stg-font);font-size:22px;line-height:1.3;margin:0}
.sc-root .sc-done .stg-store-badges{margin-block:0}
.sc-root .sc-done .sc-card__text,.sc-root .sc-done .sc-hint{font-size:16px;line-height:1.6;color:var(--stg-muted)}
.sc-root .sc-done .sc-invoice .sc-btn{margin-top:var(--stg-space-3)}
.sc-root .sc-done .sc-invoice__document{height:min(70vh,720px);border-radius:var(--stg-r1);background:var(--stg-soft)}
.sc-root .sc-done .sc-help{margin:0;padding-top:var(--stg-space-4);gap:var(--stg-space-2);border-color:var(--stg-line);flex-wrap:wrap}
@media(max-width:700px){
.sc-root .sc-done .sc-facts{grid-template-columns:1fr}
.sc-root .sc-done .sc-invoice,.sc-root .sc-done .sc-card{padding:var(--stg-space-4)}
.sc-root .sc-done .sc-invoice .sc-btn{width:100%;box-sizing:border-box;white-space:normal}
.sc-root .sc-done .sc-lede{font-size:16px}
}
/* Override the checkout's wide-screen two-column rule for receipt-only documents. */
.sc-root .sc-layout.sc-layout--single{grid-template-columns:minmax(0,1fr)}

.sc-root .sc-company-billing>h3{margin:0 0 var(--stg-space-3);font-size:16px;color:var(--stg-ink)}
.sc-root .sc-date-edit{color:var(--stg-orange)}
.sc-root .sc-done [data-bind="orderNumber"],.sc-root .sc-done [data-bind="doneStartDate"]{font-size:24px;font-weight:700}
@media(min-width:900px){.sc-root .sc-summary{align-self:start;top:var(--stg-space-4);max-height:calc(100dvh - 32px);overflow-y:auto}}

/* Woo owns saved-card selection; present its real radio controls as theme choices. */
.sc-root #payment .woocommerce-SavedPaymentMethods{display:grid;gap:10px;margin:0 0 20px;padding:0;list-style:none}
.sc-root #payment .woocommerce-SavedPaymentMethods>li{display:flex;align-items:center;gap:12px;margin:0;padding:14px 16px;min-height:52px;border:1px solid var(--stg-line-strong);border-radius:var(--stg-r1);background:var(--stg-surface);color:var(--stg-ink)}
.sc-root #payment .woocommerce-SavedPaymentMethods>li:has(input:checked){border-color:var(--stg-accent);background:var(--stg-tint)}
.sc-root #payment .woocommerce-SavedPaymentMethods>li:focus-within{outline:2px solid var(--stg-accent);outline-offset:2px}
.sc-root #payment .woocommerce-SavedPaymentMethods input[type=radio]{flex:0 0 20px;width:20px;height:20px;margin:0;accent-color:var(--stg-accent)}
.sc-root #payment .woocommerce-SavedPaymentMethods label{flex:1;min-width:0;margin:0;line-height:1.5;font-size:16px;font-weight:600;cursor:pointer;overflow-wrap:anywhere}

/* Keep tablet summary blocks in reading order without shared grid-row stretching. */
@media (min-width:660px) and (max-width:899px){
  .sc-root .sc-summary__body{display:flex;flex-direction:column;gap:var(--stg-space-3)}
  .sc-root .sc-summary__body>[data-summary-rows]{border-top:1px solid var(--sc-divider);padding-top:12px}
}

.sc-confirmation-money{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--stg-space-3);margin-block:var(--stg-space-5)}
.sc-confirmation-money>div{display:flex;flex-direction:column;gap:var(--stg-space-2);padding:var(--stg-space-4);border:1px solid var(--stg-line);border-radius:var(--stg-r2);min-width:0}
.sc-confirmation-money strong{font-size:28px;line-height:1.3;overflow-wrap:anywhere}
@media(max-width:700px){.sc-confirmation-money{grid-template-columns:1fr}}

/* Step 4: avoid stacked wallet/form margins on narrow screens. */
@media(max-width:700px){
.sc-root [data-panel="platba"] .sc-panel,
.sc-root [data-panel="platba"] .sc-wooform{gap:var(--stg-space-3)}
.sc-root [data-panel="platba"] .sc-wallets,
.sc-root [data-panel="platba"] .sc-gateway,
.sc-root [data-panel="platba"] .sc-gateway .payment_box{margin:0}
.sc-root [data-panel="platba"] .sc-wooform:has(.stg-stripe-card)>[data-when="card"]:has(>.sc-stripe-reassurance:only-child){display:none}
}
