:root {
    --portal-ink: #111111;
    --portal-muted: #666666;
    --portal-line: #e5e5e5;
    --portal-paper: #ffffff;
    --portal-wash: #ffffff;
    --portal-accent: #2563eb;
    --portal-success: #15803d;
    --portal-danger: #991b1b;
    --portal-radius: 4px;
    color-scheme: light;
}

* { box-sizing: border-box; }

body.portal-body {
    min-width: 320px;
    margin: 0;
    color: var(--portal-ink);
    background: var(--portal-wash);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: inherit; }

.portal-width { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.portal-header { border-bottom: 1px solid var(--portal-line); background: #ffffff; }

.portal-header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 24px; }

.portal-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--portal-ink); font-size: 1.02rem; font-weight: 760; letter-spacing: -.025em; text-decoration: none; }

.portal-brand-mark { width: 34px; height: 34px; border: 0; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.portal-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.portal-brand-name { display: block; width: auto; max-width: 180px; max-height: 34px; object-fit: contain; }
.portal-brand-copy { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.portal-brand-tagline { color: var(--portal-muted); font-size: .62rem; line-height: 1.1; white-space: nowrap; }
.portal-language-switcher { display: inline-flex; align-items: center; gap: 3px; padding-left: 8px; border-left: 1px solid var(--portal-line); }
.portal-language-switcher button { border: 0; padding: 4px 5px; color: var(--portal-muted); background: transparent; font: inherit; font-size: .76rem; cursor: pointer; }
.portal-language-switcher button:hover, .portal-language-switcher button.is-active { color: var(--portal-accent); font-weight: 700; }

.portal-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); color: var(--portal-muted); font-size: .92rem; }
.portal-nav a { text-decoration: none; }
.portal-nav a:hover, .portal-nav a:focus-visible, .portal-text-link:hover, .portal-text-link:focus-visible, .portal-footer a:hover, .portal-footer a:focus-visible { color: var(--portal-accent); }

.portal-main { padding-top: clamp(34px, 6vw, 68px); padding-bottom: clamp(50px, 8vw, 88px); }
.narrow-main { width: min(760px, calc(100% - 40px)); }

.portal-breadcrumb { display: flex; gap: 9px; align-items: center; color: var(--portal-muted); font-size: .86rem; }
.portal-breadcrumb a { text-underline-offset: 3px; }

.portal-heading { max-width: 720px; margin: 24px 0 32px; }
.portal-heading h1 { max-width: 630px; margin: 8px 0 12px; font-size: clamp(2rem, 4.8vw, 3.65rem); line-height: 1.04; letter-spacing: -.055em; }
.portal-heading p:not(.portal-eyebrow) { max-width: 650px; margin: 0; color: var(--portal-muted); font-size: 1.03rem; }
.portal-eyebrow, .card-kicker { margin: 0; color: var(--portal-accent); font-size: .75rem; font-weight: 800; letter-spacing: .115em; text-transform: uppercase; }

.checkout-layout { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); gap: 22px; align-items: start; }
.portal-card { border: 1px solid var(--portal-line); border-radius: var(--portal-radius); background: var(--portal-paper); }
.order-summary, .checkout-form-card, .order-detail-card { padding: clamp(24px, 4vw, 38px); }
.portal-card h2 { margin: 8px 0 10px; font-size: clamp(1.4rem, 2.5vw, 1.8rem); line-height: 1.15; letter-spacing: -.035em; }
.item-details { min-height: 24px; margin: 0; color: var(--portal-muted); font-size: .93rem; }

.summary-price { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--portal-line); }
.summary-price span { color: var(--portal-muted); font-size: .88rem; }
.summary-price strong { color: var(--portal-ink); font-size: 1.24rem; letter-spacing: -.025em; text-align: right; }
.quiet-note, .form-footnote { margin: 18px 0 0; color: var(--portal-muted); font-size: .87rem; }

.account-summary { display: grid; gap: 13px; margin: 22px 0 26px; padding: 18px 0; border-block: 1px solid var(--portal-line); }
.account-summary div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
.account-summary dt, .detail-list dt { color: var(--portal-muted); font-size: .85rem; }
.account-summary dd, .detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.portal-form { display: grid; gap: 18px; }
.form-field { display: grid; gap: 8px; }
.form-field label { color: var(--portal-ink); font-size: .92rem; font-weight: 650; }
.form-field label span { color: var(--portal-muted); font-weight: 400; }
.form-field textarea { width: 100%; min-height: 130px; resize: vertical; padding: 13px 14px; border: 1px solid #d4d4d4; border-radius: 3px; color: var(--portal-ink); background: #fff; font: inherit; line-height: 1.45; }
.form-field textarea::placeholder { color: var(--portal-muted); }
.form-field textarea:focus { outline: 3px solid rgba(37, 99, 235, .15); border-color: #2563eb; }

.portal-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 13px; padding: 12px 20px; border: 0; border-radius: 3px; color: #ffffff; background: var(--portal-accent); box-shadow: none; font: inherit; font-weight: 770; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.portal-button:hover { background: #1d4ed8; transform: translateY(-1px); }
.portal-button:focus-visible { outline: 3px solid rgba(37, 99, 235, .15); outline-offset: 3px; }

.portal-alert { margin: 0 0 24px; padding: 14px 17px; border: 1px solid; border-radius: 4px; font-size: .94rem; }
.portal-alert-error { border-color: #fecdca; color: var(--portal-danger); background: #fef3f2; }
.portal-alert-success { border-color: #abefc6; color: var(--portal-success); background: #ecfdf3; }

.order-heading { margin-bottom: 28px; }
.order-reference { display: flex; justify-content: space-between; gap: 22px; align-items: baseline; padding-bottom: 20px; border-bottom: 1px solid var(--portal-line); }
.order-reference span { color: var(--portal-muted); font-size: .88rem; }
.order-reference strong { font-size: clamp(1.05rem, 3vw, 1.35rem); letter-spacing: .04em; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 26px; color: var(--portal-muted); font-size: .88rem; }
.status-pill { display: inline-flex; padding: 5px 9px; border: 1px solid var(--portal-line); border-radius: 4px; color: var(--portal-ink); background: #ffffff; font-weight: 700; }
.detail-list { display: grid; margin: 0; border-top: 1px solid var(--portal-line); }
.detail-list > div { display: grid; grid-template-columns: minmax(105px, .42fr) 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--portal-line); }
.detail-list .detail-note dd { white-space: pre-wrap; }
.portal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 24px; }
.portal-text-link { color: var(--portal-muted); font-weight: 650; text-underline-offset: 4px; }

.portal-footer { padding: 23px 0; border-top: 1px solid var(--portal-line); color: var(--portal-muted); background: #fff; font-size: .9rem; }
.portal-footer a { color: var(--portal-muted); font-weight: 650; text-underline-offset: 3px; }

@media (max-width: 760px) {
    .portal-width, .narrow-main { width: min(100% - 28px, 760px); }
    .portal-header-inner { min-height: 68px; }
    .portal-nav { gap: 14px; font-size: .86rem; }
    .checkout-layout { grid-template-columns: 1fr; }
    .order-summary, .checkout-form-card, .order-detail-card { padding: 24px 20px; }
}

@media (max-width: 430px) {
    .portal-brand { font-size: .93rem; }
    .portal-brand-mark { width: 28px; height: 28px; }
    .portal-brand-name { max-width: 150px; max-height: 28px; }
    .portal-brand-tagline { font-size: .56rem; }
    .portal-nav a:first-child { display: none; }
    .summary-price, .order-reference { align-items: flex-start; flex-direction: column; gap: 6px; }
    .summary-price strong { text-align: left; }
    .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
}
