/* Editorial profile. All rules are scoped; the existing bottom navigation is shared. */
#s-profile { padding: 0 0 24px; }
:root { --profile-hero-bg: #0A0A0A; }
html.dark { --profile-hero-bg: #1A1A1A; }
body:has(#s-profile.on)::after { background: var(--profile-hero-bg); }
#s-profile .profile-hero { padding: 24px 20px 0; background: var(--profile-hero-bg); color: var(--bg); }
html.dark #s-profile .profile-hero { color: var(--fg); }
#s-profile .profile-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
#s-profile .profile-eyebrow { font-size: 11px; line-height: 1.5; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#s-profile .profile-hero .profile-eyebrow { opacity: .65; }
#s-profile .profile-settings-button { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid currentColor; border-radius: 50%; }
#s-profile svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#s-profile .profile-greeting { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(22px, 6.6vw, 30px); line-height: 1.35; letter-spacing: -.05em; text-transform: uppercase; overflow-wrap: anywhere; }
#s-profile .profile-handle { margin: 12px 0 24px; font-size: 12px; opacity: .65; overflow-wrap: anywhere; }
#s-profile .profile-tabs { display: flex; gap: 24px; }
#s-profile .profile-tab { min-height: 48px; padding: 0 0 12px; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600; opacity: .6; }
#s-profile .profile-tab[aria-selected="true"] { border-bottom-color: currentColor; opacity: 1; }
#s-profile .profile-body { padding: 24px 20px 0; }
#s-profile .profile-order-card { border: 1.5px solid var(--hard); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
#s-profile .profile-order-main { padding: 18px; }
#s-profile .profile-order-card .profile-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10px; margin-bottom: 16px; }
#s-profile .profile-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#s-profile .profile-order-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
#s-profile .profile-order-heading time { font-size: 11px; color: var(--muted-fg); }
#s-profile .profile-order-title { font-family: var(--display); font-size: 23px; font-weight: 800; letter-spacing: -.05em; line-height: 1.4; margin: 16px 0 7px; overflow-wrap: anywhere; }
#s-profile .profile-order-description { color: var(--muted-fg); font-size: 12px; line-height: 1.6; margin: 0; }
#s-profile .profile-order-products { display: flex; gap: 7px; align-items: center; margin: 18px 0; }
#s-profile .profile-order-photo { width: 45px; height: 58px; object-fit: cover; border-radius: 7px; flex-shrink: 0; background: var(--muted); }
#s-profile .profile-order-product-text { min-width: 0; padding-left: 6px; }
#s-profile .profile-order-product-text strong { display: block; font-size: 12px; line-height: 1.5; }
#s-profile .profile-order-product-text p { color: var(--muted-fg); font-size: 11px; line-height: 1.5; margin: 4px 0 0; overflow-wrap: anywhere; }
#s-profile .profile-order-progress { display: flex; gap: 5px; margin: 16px 0 8px; }
#s-profile .profile-order-progress span { flex: 1; height: 4px; border-radius: 8px; background: var(--line); }
#s-profile .profile-order-progress span.done { background: var(--fg); }
#s-profile .profile-order-stages { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-fg); gap: 6px; }
#s-profile .profile-order-stages .current { color: var(--fg); font-weight: 700; }
#s-profile .profile-order-open { width: 100%; min-height: 50px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; text-align: left; }
#s-profile .profile-order-open svg { width: 18px; height: 18px; }
#s-profile .profile-no-orders { padding: 4px 0 24px; border-bottom: 1.5px solid var(--hard); }
#s-profile .profile-no-orders h2 { font-family: var(--display); font-size: 23px; font-weight: 800; line-height: 1.4; letter-spacing: -.05em; margin: 0; }
#s-profile .profile-no-orders p { margin: 12px 0 20px; font-size: 12px; color: var(--muted-fg); line-height: 1.6; }
#s-profile .profile-catalog-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 13px 18px; border-radius: var(--r-pill); background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 600; }
#s-profile .profile-disclosure { border: 0; padding: 0; margin: 0; }
#s-profile .profile-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; min-height: 54px; border-bottom: 1px solid var(--line); font-size: 13px; }
#s-profile .profile-disclosure > summary::-webkit-details-marker { display: none; }
#s-profile .profile-disclosure > summary svg { width: 15px; height: 15px; }
#s-profile .profile-disclosure[open] > summary svg { transform: rotate(90deg); }
#s-profile .profile-disclosure-content { padding: 16px 0; }
#s-profile .profile-history-row { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#s-profile .profile-history-row span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted-fg); }
#s-profile .profile-loyalty { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0 20px; border-bottom: 1.5px solid var(--hard); }
#s-profile .profile-loyalty .profile-eyebrow { color: var(--muted-fg); font-size: 10px; margin-bottom: 8px; }
#s-profile .profile-loyalty p { font-size: 14px; font-weight: 600; margin: 0; }
#s-profile .profile-loyalty strong { font-family: var(--display); font-size: 30px; letter-spacing: -.05em; font-weight: 800; flex-shrink: 0; }
#s-profile .profile-purchases { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 8px; }
#s-profile .profile-purchases > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
#s-profile .profile-purchases strong { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
#s-profile .profile-purchases span { display: block; margin-top: 6px; color: var(--muted-fg); font-size: 11px; }
#s-profile .profile-menu-button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 14px 0; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
#s-profile .profile-menu-button > span:first-of-type { min-width: 0; }
#s-profile .profile-menu-button .profile-menu-trail { margin-left: auto; color: var(--muted-fg); font-size: 11px; text-align: right; }
#s-profile .profile-menu-button > svg:last-child { margin-left: auto; width: 15px; height: 15px; }
#s-profile .profile-menu-button .profile-menu-trail + svg { margin-left: 0; }
#s-profile .profile-help { margin: 24px 0 0; }
#s-profile .profile-help h3 { font-size: 15px; margin: 0 0 6px; }
#s-profile .profile-help p { font-size: 12px; color: var(--muted-fg); line-height: 1.6; margin: 0; }
#s-profile .profile-help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
#s-profile .profile-help-actions button { min-height: 46px; padding: 10px 16px; border: 1.5px solid var(--hard); border-radius: var(--r-pill); font-size: 12px; }
#s-profile .profile-help-actions .primary { background: var(--fg); color: var(--bg); }
#s-profile .profile-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; color: var(--muted-fg); font-size: 10px; }
#s-profile .profile-footer button { min-height: 44px; font-size: inherit; text-align: right; }
#s-profile .profile-data-intro { margin: 0 0 20px; font-size: 13px; color: var(--muted-fg); line-height: 1.6; }
#s-profile .profile-delivery-summary { padding: 14px 0 20px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#s-profile .profile-delivery-summary p { margin: 5px 0 0; color: var(--muted-fg); }
#s-profile .profile-save { width: 100%; margin: 12px 0 24px; }
#s-profile .profile-level-progress { margin: 14px 0; height: 4px; border-radius: 8px; background: var(--line); overflow: hidden; }
#s-profile .profile-level-progress span { display: block; height: 100%; background: var(--fg); }
#s-profile .profile-offline { padding: 24px 20px 0; }
#s-profile .desc { white-space: normal; line-height: 1.6; }
.profile-sheet-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.profile-sheet-row img { width: 48px; height: 64px; object-fit: cover; border-radius: 7px; }
.profile-sheet-row > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.profile-sheet-row strong { font-size: 14px; }
.profile-sheet-row p { font-size: 12px; color: var(--muted-fg); line-height: 1.5; margin: 6px 0; }
.profile-sheet-note { margin: 16px 0; font-size: 13px; line-height: 1.6; }
@media (max-width: 360px) {
  #s-profile .profile-hero { padding-left: 16px; padding-right: 16px; }
  #s-profile .profile-body { padding-left: 16px; padding-right: 16px; }
  #s-profile .profile-order-main { padding: 16px; }
  #s-profile .profile-order-title, #s-profile .profile-no-orders h2 { font-size: 21px; }
  #s-profile .profile-order-photo { width: 38px; height: 50px; }
  #s-profile .profile-loyalty strong { font-size: 26px; }
  #s-profile .profile-purchases { gap: 10px; }
  #s-profile .profile-purchases > div + div { padding-left: 10px; }
}

/* Account controls follow the quieter editorial card style. */
#s-profile .profile-theme-picker { display:flex; gap:4px; padding:4px; border:0; border-radius:12px; background:var(--muted); }
#s-profile .profile-theme-picker button { flex:1; min-width:0; min-height:44px; padding:8px 4px; border:0; border-radius:8px; font-size:11px; line-height:1.4; font-weight:600; color:var(--muted-fg); background:transparent; }
#s-profile .profile-theme-picker button[aria-pressed="true"] { background:var(--fg); color:var(--bg); }
#s-profile .profile-settings-group + .profile-settings-group { margin-top:28px; }
#s-profile .profile-group-title { margin:0 0 12px; color:var(--muted-fg); font-size:10px; line-height:1.5; letter-spacing:.08em; text-transform:uppercase; font-weight:600; }
#s-profile .profile-document-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:72px; padding:14px 0; border-bottom:1px solid var(--line); color:var(--fg); text-decoration:none; }
#s-profile .profile-document-row strong { display:block; font-size:13px; font-weight:600; line-height:1.5; }
#s-profile .profile-document-row span span { display:block; margin-top:4px; color:var(--muted-fg); font-size:11px; line-height:1.5; }
#s-profile .profile-document-row svg { width:16px; height:16px; color:var(--muted-fg); }
#s-profile .profile-list-control { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:64px; border-bottom:1px solid var(--line); }
#s-profile .profile-list-label { display:flex; align-items:center; gap:8px; font-size:13px; line-height:1.5; }
#s-profile .profile-count { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px; border-radius:6px; background:var(--muted); color:var(--muted-fg); font-size:10px; }
#s-profile .profile-clear { min-height:44px; padding:9px 12px; border:0; border-radius:8px; background:var(--muted); color:var(--fg); font-size:11px; font-weight:500; }
#s-profile .profile-clear:disabled { opacity:.4; cursor:default; }
#s-profile .profile-recent-control { padding:16px 0; border-bottom:1px solid var(--line); }
#s-profile .profile-recent-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#s-profile .profile-recent-heading p { margin:5px 0 0; font-size:11px; color:var(--muted-fg); }
#s-profile .profile-recent-control > .profile-clear { margin-top:12px; }
#s-profile .profile-switch { flex-shrink:0; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; background:transparent; }
#s-profile .profile-switch span { position:relative; width:38px; height:22px; border-radius:999px; background:var(--line); }
#s-profile .profile-switch span::after { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:var(--bg); transition:transform .18s; }
#s-profile .profile-switch[aria-checked="true"] span { background:var(--fg); }
#s-profile .profile-switch[aria-checked="true"] span::after { transform:translateX(16px); }
#s-profile .profile-inline-value { margin-left:auto; color:var(--muted-fg); font-size:11px; }
#s-profile .profile-form { display:grid; grid-template-columns:1fr; gap:16px; }
#s-profile .profile-form .frow { margin:0; min-width:0; }
#s-profile .profile-form label { display:block; margin-bottom:7px; color:var(--muted-fg); font-size:11px; line-height:1.5; font-weight:500; }
#s-profile .profile-form .frow > span { font-size:10px; font-weight:500; letter-spacing:.04em; }
#s-profile .profile-form input { width:100%; min-width:0; height:48px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--fg); font-size:16px; box-shadow:none; }
#s-profile .profile-form input:focus { border-color:var(--hard); outline:2px solid var(--line); outline-offset:2px; }
#s-profile .profile-form input[aria-invalid="true"] { border-color:#bd3838; }
#s-profile .profile-save { min-height:48px; border:0; border-radius:12px; box-shadow:none; font-size:13px; }
#s-profile .profile-save:active { transform:translateY(1px); box-shadow:none; }
#s-profile .profile-edit { display:inline-flex; align-items:center; gap:6px; width:auto; height:auto; min-height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:9px; font-size:11px; }
#s-profile .profile-edit::before { display:none; }
#s-profile .profile-edit svg { width:15px; height:15px; }
#s-profile .profile-saved { padding:5px 7px; border:0; border-radius:6px; background:var(--muted); color:var(--muted-fg); font-size:10px; }
#s-profile #profile-delivery > .box { padding:18px; border:0; border-radius:12px; background:var(--muted); box-shadow:none; font-size:12px; line-height:1.65; }
#s-profile .profile-error:empty { display:none; }
#s-profile .profile-catalog-button, #s-profile .profile-help-actions button { border-radius:12px; box-shadow:none; }
#s-profile .profile-help-actions button { border-width:1px; border-color:var(--line); }
#s-profile .profile-help-actions .primary { border-color:var(--fg); }
#s-profile :is(button,a,summary):focus-visible { outline:2px solid var(--fg); outline-offset:3px; }

#s-profile .profile-greeting + .profile-tabs { margin-top:24px; }

#s-profile .profile-recipient-card { padding:0 0 22px; margin-bottom:8px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
#s-profile .profile-recipient-card .delivery-title { margin:0; padding:0; border:0; gap:8px; align-items:center; }
#s-profile .profile-recipient-card .delivery-label { font-family:inherit; font-size:10px; font-weight:600; letter-spacing:.05em; color:var(--muted-fg); }
#s-profile .profile-recipient-card .profile-edit { background:transparent; border:0; padding:0 0 0 8px; min-height:44px; flex-shrink:0; color:var(--muted-fg); font-size:11px; }
#s-profile .profile-recipient-card .profile-delivery-summary { padding:8px 0 0; }
#s-profile .profile-recipient-card .profile-delivery-summary strong { display:block; font-size:15px; line-height:1.5; font-weight:600; margin-bottom:10px; }
#s-profile .profile-support-row { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; min-height:88px; padding:18px 0; text-align:left; border:0; border-top:1px solid var(--hard); border-bottom:1px solid var(--line); border-radius:0; background:transparent; color:var(--fg); }
#s-profile .profile-support-copy { display:flex; flex-direction:column; gap:6px; min-width:0; }
#s-profile .profile-support-copy strong { font-size:17px; font-weight:600; line-height:1.4; letter-spacing:-.02em; }
#s-profile .profile-support-copy > span { color:var(--muted-fg); font-size:11px; line-height:1.5; }
#s-profile .profile-support-link { display:flex; align-items:center; gap:12px; flex-shrink:0; font-size:11px; font-weight:600; }
#s-profile .profile-support-link svg { width:18px; height:18px; }
#s-profile .profile-support-row:hover .profile-support-link { text-decoration:underline; text-underline-offset:4px; }

/* Approved profile: three focused tabs, soft surfaces, no section rules. */
#s-profile .profile-tabs { gap:0; justify-content:space-between; }
#s-profile .profile-tab { min-width:0; padding:0 8px 12px; font-size:14px; }
#s-profile .profile-body { padding-top:22px; }
#s-profile [role="tabpanel"][hidden] { display:none; }
#s-profile .profile-order-card { background:var(--muted); border:0; border-radius:16px; margin-bottom:18px; padding:0 16px 16px; }
#s-profile .profile-order-main { padding:18px 4px 16px; }
#s-profile .profile-order-card .profile-eyebrow { color:var(--muted-fg); letter-spacing:0; }
#s-profile .profile-status-dot { display:none; }
#s-profile .profile-order-photo { width:64px; height:80px; border-radius:10px; }
#s-profile .profile-order-product-text strong { font-size:13px; }
#s-profile .profile-order-open { min-height:44px; padding:12px 14px; border:0; border-radius:11px; background:var(--fg); color:var(--bg); justify-content:center; }
#s-profile .profile-order-open svg { display:none; }
#s-profile .profile-no-orders { border:0; padding:20px; border-radius:16px; background:var(--muted); margin-bottom:18px; }
#s-profile #profile-history > summary { border:0; border-radius:14px; background:var(--muted); padding:16px; min-height:76px; }
#s-profile #profile-history > summary > svg:first-child { width:27px; height:27px; transform:none; }
#s-profile #profile-history > summary > span { flex:1; }
#s-profile #profile-history > summary strong { display:block; font-size:15px; }
#s-profile #profile-history > summary span span { display:block; margin-top:5px; color:var(--muted-fg); font-size:12px; }
#s-profile .profile-disclosure > summary, #s-profile .profile-history-row, #s-profile .profile-list-control, #s-profile .profile-recent-control { border-bottom:0; }
#s-profile .profile-history-row { padding:14px; background:var(--muted); border-radius:10px; margin-bottom:8px; }
#s-profile .profile-recipient-card { padding:0; margin:0 0 22px; border:0; }
#s-profile .profile-delivery-heading { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
#s-profile .profile-delivery-heading h2 { flex:1; margin:0; font-size:18px; line-height:1.35; font-weight:700; letter-spacing:-.025em; }
#s-profile .profile-recipient-card .profile-edit { color:var(--fg); padding:0; gap:6px; font-size:12px; }
#s-profile .profile-recipient-fields { margin:0; padding:20px; background:var(--muted); border-radius:16px; }
#s-profile .profile-recipient-fields > div + div { margin-top:20px; }
#s-profile .profile-recipient-fields dt { font-size:12px; line-height:1.4; color:var(--muted-fg); margin:0 0 4px; }
#s-profile .profile-recipient-fields dd { margin:0; font-size:15px; line-height:1.45; overflow-wrap:anywhere; }
#s-profile .profile-missing { margin:0 0 20px; color:var(--muted-fg); font-size:13px; line-height:1.6; }
#s-profile .profile-setting-row { display:flex; align-items:center; text-align:left; width:100%; min-height:68px; padding:16px; gap:16px; background:var(--muted); color:var(--fg); border:0; border-radius:15px; }
#s-profile .profile-setting-row > svg:first-child { width:28px; height:28px; }
#s-profile .profile-setting-row > svg:last-child { width:16px; height:16px; margin-left:auto; }
#s-profile .profile-setting-row > span { flex:1; min-width:0; }
#s-profile .profile-setting-row strong { display:block; font-size:15px; font-weight:650; line-height:1.4; }
#s-profile .profile-setting-row span span { display:block; margin-top:4px; color:var(--muted-fg); font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
#s-profile .profile-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:20px; }
#s-profile .profile-settings-grid > div { display:flex; min-width:0; }
#s-profile .profile-tile { display:flex; flex-direction:column; justify-content:space-between; width:100%; min-width:0; min-height:132px; aspect-ratio:1.3; padding:16px; text-align:left; border:0; border-radius:15px; background:var(--muted); color:var(--fg); }
#s-profile .profile-tile-top { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; }
#s-profile .profile-tile-top > svg:first-child { width:28px; height:28px; }
#s-profile .profile-tile-top > svg:last-child:not(:first-child) { width:15px; height:15px; }
#s-profile .profile-tile-copy { display:block; margin-top:18px; }
#s-profile .profile-tile-copy strong { display:block; font-size:16px; font-weight:650; line-height:1.15; letter-spacing:-.025em; }
#s-profile .profile-tile-copy > span { display:block; margin-top:7px; color:var(--muted-fg); font-size:12px; line-height:1.35; }
#s-profile .profile-recent-tile[aria-checked="false"] .profile-tile-top { color:var(--muted-fg); }
#s-profile .profile-list-management { margin-top:24px; }
#s-profile .profile-list-management > summary { color:var(--muted-fg); font-size:12px; }
#s-profile .profile-list-management .profile-disclosure-content { padding-top:4px; }
.profile-sheet-document { display:flex; align-items:center; gap:16px; min-height:76px; padding:16px; margin-top:12px; background:var(--muted); border-radius:12px; color:var(--fg); text-decoration:none; }
.profile-sheet-document > span { flex:1; }
.profile-sheet-document strong { display:block; font-size:14px; line-height:1.4; }
.profile-sheet-document span span { display:block; margin-top:5px; font-size:12px; color:var(--muted-fg); line-height:1.5; }
.profile-sheet-document svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; }
.profile-sheet-theme { display:grid; gap:8px; margin-top:20px; }
.profile-theme-option { display:flex; align-items:center; justify-content:space-between; text-align:left; min-height:52px; padding:14px 16px; border:0; border-radius:12px; background:var(--muted); color:var(--fg); font-size:14px; }
.profile-theme-option[aria-pressed="true"] { background:var(--fg); color:var(--bg); }
@media (hover:hover) { #s-profile .profile-tile:hover, #s-profile .profile-setting-row:hover { background:color-mix(in srgb,var(--muted) 92%,var(--fg)); } }
@media (max-width:360px) {
  #s-profile .profile-tab { padding-left:4px; padding-right:4px; font-size:13px; }
  #s-profile .profile-delivery-heading { flex-wrap:wrap; gap:4px 8px; }
  #s-profile .profile-delivery-heading h2 { font-size:16px; }
  #s-profile .profile-tile { padding:13px; }
  #s-profile .profile-tile-copy strong { font-size:15px; }
  #s-profile .profile-tile-copy > span { font-size:11px; }
}

#s-profile .profile-hero { position:relative; }
#s-profile .profile-theme-trigger { position:absolute; top:12px; right:16px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; color:inherit; background:transparent; cursor:pointer; }
#s-profile .profile-theme-trigger svg { width:19px; height:19px; stroke-width:1.6; }
#s-profile .profile-hero-top { padding-right:44px; }
@media(hover:hover) { #s-profile .profile-theme-trigger:hover { background:color-mix(in srgb,currentColor 8%,transparent); } }
html.theme-wave::view-transition-old(root),
html.theme-wave::view-transition-new(root) { animation:none; mix-blend-mode:normal; }
html.theme-wave::view-transition-old(root) { z-index:1; }
html.theme-wave::view-transition-new(root) { z-index:2; }
html.theme-wave::view-transition { pointer-events:none; }

.media-frame { position: relative; display: block; overflow: hidden; background: var(--muted); border-radius: inherit; object-fit: cover; }
body .media-frame > img { display: block; width: 100% !important; height: 100% !important; min-width: 0; aspect-ratio: auto !important; border: 0 !important; border-radius: inherit !important; object-fit: inherit; flex: none !important; }
.media-frame > img:not(.media-preview) { opacity: 0; transition: opacity 180ms ease; }
.media-frame[data-state="ready"] > img:not(.media-preview) { opacity: 1; }
.media-frame[data-reused="true"] > img:not(.media-preview) { transition: none; }
.media-frame[data-reused="true"] > .media-placeholder, .media-frame[data-preview-ready="true"] > .media-placeholder { display: none; }
.card.media-reused-card { animation: none; }
.media-frame > .media-preview { position: absolute; inset: 0; }
.media-placeholder { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--bg) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; opacity: .45; pointer-events: none; }
.media-frame[data-state="ready"] > .media-placeholder, .media-frame[data-state="error"] > .media-placeholder { display: none; }
.media-retry { display: none; position: absolute; inset: 0; padding: 8px; align-items: center; justify-content: center; text-align: center; font-size: 12px; line-height: 1.4; color: var(--fg); background: var(--muted); cursor: pointer; min-width: 32px; min-height: 38px; }
.media-frame[data-state="error"] > .media-retry { display: flex; }
.media-frame[data-preview-ready="true"][data-state="error"] > .media-retry { top: auto; background: var(--bg); }
.media-retry:focus-visible { outline: 3px solid var(--fg); outline-offset: -4px; }
.thumb > .media-frame { width: 100%; height: 100%; position: absolute; inset: 0; border-radius: 0; }
.thumb.off .media-frame[data-state="ready"] > img { opacity: .35; }
#s-product .gallery > .media-frame { scroll-snap-align: center; flex: 0 0 94%; aspect-ratio: 3/4; border-radius: var(--r); }
.viewer-frame { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; overflow: hidden; }
.viewer-frame > .media-frame { width: 100%; height: 100%; object-fit: contain; }
.viewer-frame > img { width: 100%; height: 100%; object-fit: contain; }
#s-cart .row > .media-frame { flex: 0 0 84px; width: 84px; height: 112px; border: 2px solid var(--hard); border-radius: var(--r); }
/* The bordered frame clips the photo; a second inner radius leaves white corners. */
body #s-cart .row > .media-frame > img { border-radius: 0 !important; }
#s-profile .profile-order-products > .media-frame { flex: 0 0 45px; width: 45px; height: 58px; border-radius: 7px; }
.profile-sheet-row > .media-frame { flex: 0 0 48px; width: 48px; height: 64px; border-radius: 7px; }
#s-product .media-frame.product-color-image { flex: 0 0 32px; width: 32px; height: 38px; border-radius: 5px; }
.product-loading-photo { max-width: 768px; }
@media (max-width: 380px) { #s-profile .profile-order-products > .media-frame { flex-basis: 38px; width: 38px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { .media-placeholder { animation: none; } .media-frame > img { transition: none; } }

/* Account loading: shared theme tokens, no personal data before the response. */
#s-profile .profile-wait-hero { padding-top:28px; min-height:208px; display:flex; flex-direction:column; }
#s-profile .profile-wait-hero .profile-greeting { font-size:clamp(24px,7vw,30px); line-height:1.24; }
.profile-wait-tabs { display:flex; gap:24px; padding:28px 0 18px; margin-top:auto; }
.profile-wait-tabs .wait-shape { width:100px; height:12px; background:currentColor; opacity:.13; }
#s-profile .profile-wait-body { padding-top:24px; }
.profile-wait-status { display:flex; align-items:center; gap:10px; margin:0 0 22px; color:var(--muted-fg); font-size:12px; line-height:1.5; }
.profile-wait-spinner { width:17px; height:17px; flex:none; border:2px solid var(--line); border-top-color:var(--muted-fg); border-radius:50%; animation:profile-wait-spin 1s linear infinite; }
.wait-shape { display:block; position:relative; overflow:hidden; background:var(--line); border-radius:5px; }
.wait-shape::after { content:''; position:absolute; inset:0; background:linear-gradient(100deg,transparent 15%,var(--bg) 50%,transparent 85%); opacity:.5; transform:translateX(-100%); animation:profile-wait-shimmer 1.9s ease-in-out infinite; }
.profile-wait-card { padding:22px; border-radius:16px; background:var(--muted); }
.wait-title { height:15px; width:76%; }
.wait-subtitle { height:11px; width:46%; margin-top:13px; }
.profile-wait-photos { display:flex; gap:9px; margin-top:23px; }
.profile-wait-photos .wait-shape { width:49px; height:62px; border-radius:7px; }
.profile-wait-history { display:flex; justify-content:space-between; align-items:center; padding:24px 0; border-bottom:1px solid var(--line); }
.profile-wait-history > .wait-shape:first-child { width:61%; height:12px; }
.profile-wait-history .wait-circle { width:18px; height:18px; border-radius:50%; }
.profile-wait-stats { display:grid; grid-template-columns:1fr 1fr; gap:28px; margin-top:24px; }
.profile-wait-stats .wait-shape:first-child { width:76%; height:14px; }
.profile-wait-stats .wait-shape + .wait-shape { width:58%; height:10px; margin-top:10px; }

.profile-loaded { animation:profile-loaded 240ms ease-out; }
@keyframes profile-wait-spin { to { transform:rotate(360deg); } }
@keyframes profile-wait-shimmer { to { transform:translateX(100%); } }
@keyframes profile-loaded { from { opacity:.3; } to { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .wait-shape::after,.profile-wait-spinner,.profile-loaded { animation:none; } }

/* Error messages keep their explanation and recovery action visually separate. */
.empty.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px;
}
.empty.error-state > p {
  max-width: 30ch;
  margin: 0;
  line-height: 1.4;
  text-wrap: balance;
}
.empty.error-state > .desc {
  max-width: 34ch;
  margin-top: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.empty.error-state > .btn {
  margin-top: 24px;
}
.error-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  line-height: 1.65;
}
.error-note > p {
  margin: 0;
}
.error-note > .chip,
.error-note > .btn {
  flex: none;
  width: auto;
  max-width: 100%;
  margin: 0;
}
#s-profile .profile-no-orders.error-state > p {
  margin: 14px 0 24px;
  max-width: 38ch;
}
@media (max-width: 360px) {
  .empty.error-state { padding: 40px 16px; }
}

:root {
  /* System and Telegram control areas are distinct; native CSS and SDK system
     insets describe the same system area, so use their maximum, not their sum. */
  --store-safe-top: calc(max(env(safe-area-inset-top, 0px), var(--store-tg-safe-top, var(--tg-safe-area-inset-top, 0px))) + var(--store-tg-content-top, var(--tg-content-safe-area-inset-top, 0px)));
  --store-safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--store-tg-safe-bottom, var(--tg-safe-area-inset-bottom, 0px))) + var(--store-tg-content-bottom, var(--tg-content-safe-area-inset-bottom, 0px)));
  --store-safe-left: calc(max(env(safe-area-inset-left, 0px), var(--store-tg-safe-left, var(--tg-safe-area-inset-left, 0px))) + var(--store-tg-content-left, var(--tg-content-safe-area-inset-left, 0px)));
  --store-safe-right: calc(max(env(safe-area-inset-right, 0px), var(--store-tg-safe-right, var(--tg-safe-area-inset-right, 0px))) + var(--store-tg-content-right, var(--tg-content-safe-area-inset-right, 0px)));
}
body {
  min-height: var(--store-viewport-height, 100dvh);
  padding-top: var(--store-safe-top);
  padding-right: var(--store-safe-right);
  padding-bottom: calc(var(--nav-h) + var(--store-safe-bottom));
  padding-left: var(--store-safe-left);
}
/* Keep scrolled content out of the native top controls too. */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--store-safe-top);
  background: var(--bg);
  z-index: 85;
  pointer-events: none;
}
.head { top: var(--store-safe-top); padding-top: 12px; }
.backbar { top: var(--store-safe-top); padding-top: 10px; }
#s-product .backbar { padding-top: 20px; }
.nav {
  padding-left: var(--store-safe-left);
  padding-right: var(--store-safe-right);
  padding-bottom: var(--store-safe-bottom);
}
.actionbar {
  bottom: calc(var(--nav-h) + var(--store-safe-bottom));
  padding-left: calc(20px + var(--store-safe-left));
  padding-right: calc(20px + var(--store-safe-right));
}
.chatbar { bottom: calc(var(--nav-h) + var(--store-safe-bottom) + 8px); }
.store-notice { top: calc(var(--store-safe-top) + 14px); }
.sheet { top: var(--store-safe-top); }
.sheet .panel {
  max-height: min(86dvh, calc(var(--store-viewport-height, 100dvh) - var(--store-safe-top) - 12px));
  padding-left: calc(16px + var(--store-safe-left));
  padding-right: calc(16px + var(--store-safe-right));
  padding-bottom: calc(20px + var(--store-safe-bottom));
}
.viewer {
  top: var(--store-safe-top);
  right: var(--store-safe-right);
  bottom: var(--store-safe-bottom);
  left: var(--store-safe-left);
}
.viewer .close { top: 12px; }
.viewer .pos { bottom: 16px; }

/* Explicit theme wins over the device media query on standalone pages too. */
html[data-theme-page="standalone"][data-color-theme="light"] {
  --bg: #FFFFFF; --fg: #0A0A0A; --muted: #F2F2F2; --muted-fg: #5C5C5C;
  --line: #E2E2E2; --warn-bg: #FFF7E6; --warn-line: #E8C98A;
  --ok: var(--payment-light, #0A7B34); --warn: #B45309;
}
html[data-theme-page="standalone"][data-color-theme="dark"] {
  --bg: #0A0A0A; --fg: #FFFFFF; --muted: #1A1A1A; --muted-fg: #A8A8A8;
  --line: #454545; --warn-bg: #241C08; --warn-line: #806A35;
  --ok: var(--payment-dark, #4ADE80); --warn: #FBBF24;
}
html { color-scheme: light; }
html.dark { color-scheme: dark; }
input::placeholder, textarea::placeholder { color: var(--muted-fg); opacity: 1; }
.cart-legal a, .cart-legal a:visited { color: var(--fg); text-underline-offset: 3px; }
.dark .pay button[aria-pressed]::after { border-color: var(--muted-fg); }
.dark #s-profile .profile-form input { border-color: #686868; }
#s-profile .profile-form input.invalid { border-color: #C74242; background: #FFF0F0; }
.dark #s-profile .profile-form input.invalid { border-color: #FF9191; background: #351919; }
.dark .need { background: #3A2B0A; color: #FBBF24; }
.dark .ok-tag { background: #102A1A; color: #86EFAC; }
.cell-input:focus { background: var(--muted); color: var(--fg); border-color: var(--muted-fg); }
html[data-theme-page="standalone"] input {
  background: var(--bg); color: var(--fg); border-color: var(--line);
}
html[data-theme-page="standalone"] .secondary {
  background: var(--bg); color: var(--fg); border-color: var(--fg);
}
html[data-theme-page="standalone"] #authSubmit {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
html[data-theme-page="standalone"] #authMessage,
html[data-theme-page="standalone"] #authIntro { color: var(--muted-fg); }
html[data-theme-page="standalone"] input:focus-visible,
html[data-theme-page="standalone"] button:focus-visible { outline-color: var(--fg); }

.customer-links { display:flex; flex-wrap:wrap; gap:4px 20px; padding:0 16px; }
.customer-links a, .customer-footer a, .document-nav a, .document-back { display:inline-flex; align-items:center; min-height:44px; color:inherit; text-decoration:underline; text-underline-offset:4px; }
.customer-links a { font-size:13px; font-weight:500; }
.customer-footer { margin:24px 16px 0; padding:16px 0 24px; border-top:1px solid var(--line); }
.customer-footer p { margin:0 0 6px; font-size:14px; font-weight:700; }
.customer-footer-links { display:flex; flex-wrap:wrap; gap:0 20px; }
.customer-footer a { font-size:13px; }
.document-back { margin-bottom:12px; font-size:14px; }
.document-nav { display:flex; flex-wrap:wrap; gap:0 18px; margin:16px 0 24px; padding:12px 0; border-block:1px solid var(--line); font-size:14px; }
.customer-links a:focus-visible, .customer-footer a:focus-visible, .document-nav a:focus-visible, .document-back:focus-visible, .profile-telegram-entry:focus-visible { outline:2px solid currentColor; outline-offset:4px; border-radius:3px; }
.profile-telegram-entry { width:100%; margin-top:16px; text-decoration:none; }
[id="delivery"], [id="payment"], [id="returns"], [id="contacts"] { scroll-margin-top:20px; }

/* Guest entry links form separate full-width touch targets. */
#s-profile .profile-guest-hero { padding-bottom:24px; }
#s-profile .profile-guest-entry .profile-telegram-entry { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; margin:0 0 12px; min-height:50px; box-sizing:border-box; }
#s-profile .profile-guest-entry .profile-catalog-button { text-decoration:none; background:transparent; color:var(--fg); border:1.5px solid var(--hard); }

#s-profile .profile-guest-entry h2 { font-family:var(--display); font-size:clamp(17px,4.6vw,20px); font-weight:600; line-height:1.5; letter-spacing:-.035em; text-wrap:balance; }
#s-profile .profile-guest-entry p { font-size:14px; line-height:1.65; margin:12px 0 24px; }
#s-profile .profile-guest-entry .profile-telegram-entry,
#s-profile .profile-guest-entry .profile-catalog-button { font-family:var(--display); font-size:12px; font-weight:600; line-height:1.5; text-align:left; padding:15px 18px; border-radius:12px; }
#s-profile .profile-guest-entry svg { width:20px; height:20px; flex-shrink:0; }

.toolbar #categoryBtn { position:relative; }
/* Inline counts share the icon baseline instead of overlapping it. */
.toolbar button:has(.dot:not([hidden])) { display:flex; justify-content:center; align-items:center; gap:3px; width:auto; min-width:40px; padding:0 7px; }
.toolbar button:has(.dot:not([hidden])) svg { flex:none; }
.toolbar .dot { position:static; display:inline-grid; place-items:center; flex:none; min-width:14px; height:16px; padding:0 3px; border:0; border-radius:4px; background:color-mix(in srgb,currentColor 14%,transparent); color:inherit; font-family:inherit; font-size:10px; font-weight:600; font-variant-numeric:tabular-nums; line-height:1; }
.toolbar .dot[hidden] { display:none; }
body:has(.category-menu[open]) { overflow:hidden; }
.category-menu { position:fixed; inset:auto; top:calc(var(--store-safe-top,0px) + 58px); right:max(12px,calc((100vw - 480px)/2 + 12px)); margin:0; width:min(420px,calc(100vw - 24px)); max-height:calc(var(--store-viewport-height,100dvh) - var(--store-safe-top,0px) - var(--store-safe-bottom,0px) - 76px); padding:20px; border:1px solid var(--line); border-radius:22px; background:var(--bg); color:var(--fg); box-shadow:0 12px 44px #0002; overflow:hidden; }
.category-menu[open] { display:flex; flex-direction:column; }
.category-menu::backdrop { background:#0005; }
.category-menu-head { display:flex; justify-content:space-between; gap:12px; margin-bottom:20px; flex:none; }
.category-menu h2 { margin:0; font-family:var(--display); font-size:23px; font-weight:800; letter-spacing:-.04em; line-height:1.35; }
.category-menu-head p { margin:7px 0 0; font-size:12px; color:var(--muted-fg); line-height:1.5; }
.category-menu-close { display:grid; place-items:center; flex:none; width:40px; height:40px; margin:-6px -6px 0 0; padding:0; color:inherit; border:0; background:transparent; border-radius:10px; cursor:pointer; }
.category-menu-close svg { width:23px; height:23px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; }
.category-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; min-height:0; overflow:auto; padding:3px; margin:-3px; overscroll-behavior:contain; }
.category-menu-tile { position:relative; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:5px; min-height:66px; padding:12px 29px 12px 13px; border:0; border-radius:12px; background:var(--muted); color:var(--fg); text-align:left; cursor:pointer; }
.category-menu-tile:last-child:nth-child(odd) { grid-column:1/-1; }
.category-menu-tile strong { font-family:inherit; font-size:13px; font-weight:600; line-height:1.35; overflow-wrap:anywhere; }
.category-menu-quantity { font-size:11px; line-height:1.4; color:var(--muted-fg); }
.category-menu-check { position:absolute; top:13px; right:11px; display:grid; place-items:center; width:16px; height:16px; border:1.4px solid var(--muted-fg); border-radius:50%; font-size:11px; line-height:1; color:transparent; }
.category-menu-tile[aria-pressed="true"] { background:var(--fg); color:var(--bg); }
.category-menu-tile[aria-pressed="true"] .category-menu-quantity { color:inherit; opacity:.7; }
.category-menu-tile[aria-pressed="true"] .category-menu-check { border-color:var(--bg); background:var(--bg); color:var(--fg); }
.category-menu-footer { padding-top:20px; flex:none; }
.category-menu-footer > div { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:32px; margin-bottom:10px; }
.category-menu-selected,.category-menu-reset { font-size:12px; color:var(--muted-fg); }
.category-menu-reset { padding:6px 0; border:0; background:transparent; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.category-menu-reset:disabled { opacity:.4; cursor:default; }
.category-menu-apply { display:block; width:100%; min-height:48px; padding:12px; border:0; border-radius:12px; background:var(--fg); color:var(--bg); font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.category-menu-apply:disabled { opacity:.5; }
.category-menu-retry { grid-column:1/-1; min-height:66px; border:0; border-radius:12px; background:var(--muted); color:var(--fg); font-size:13px; cursor:pointer; }
.category-menu button:focus-visible { outline:2px solid var(--fg); outline-offset:2px; }
@media(max-width:360px) { .category-menu { padding:16px; }.category-menu-tile strong { font-size:12px; }.brandrow { gap:8px; }.toolbar button { width:34px; }.brand { font-size:clamp(18px,6vw,22px); } }
@media(max-width:360px) { .toolbar button:has(.dot:not([hidden])) { min-width:34px; padding:0 3px; gap:2px; }.toolbar button:has(.dot:not([hidden])) svg { width:14px; height:14px; }.toolbar .dot { min-width:12px; height:15px; padding:0 2px; font-size:9px; } }
