.portal-page { width: min(900px, calc(100% - 32px)); padding-bottom: 50px; }
.session-restoring { display: none; min-height: 240px; padding: 64px 0; text-align: center; color: var(--muted); }
:root[data-session-state="restoring"] #auth-view { display: none !important; }
:root[data-session-state="restoring"] #portal-view { display: none !important; }
:root[data-session-state="restoring"] .session-restoring { display: block; }
.portal-section.home-main { width: 100%; max-width: none; padding: 0; margin: 0; }
.phone-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; min-width: 0; }
.app-form-grid > .phone-field { grid-column: 1 / -1; }
.product-photo-frame { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: 12px auto; }
.product-photo-preview { position: absolute; inset: 0; display: block; box-sizing: border-box; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.product-photo-preview img:not(.app-icon) { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.product-photo-preview:disabled { opacity: 1; cursor: default; }
.product-photo-remove { position: absolute; top: 6px; right: 6px; }
.order-app .photo-select-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; align-self: flex-start; margin: 0; min-height: 48px; padding: 10px 20px; border: 1px solid #2e7068; border-radius: 6px; background: #2e7068; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.order-app .photo-select-button:hover { background: #245c55; border-color: #245c55; }
.photo-select-button .app-icon { width: 22px; height: 22px; filter: invert(1) !important; }
.store-pickup { padding: 14px 0; border-block: 1px solid var(--line); }
.order-app .store-pickup h3 { margin: 0 0 12px; }
.store-pickup .is-selected { border-color: #2e7068; background: #2e7068; color: #fff; }
.link-field { position: relative; }
.link-field > label { font-size: 14px; font-weight: 600; }
.app-field.link-field input { padding-right: 95px; }
.link-field .paste-link { position: absolute; right: 10px; bottom: 6px; min-height: 36px; }
.map-search-form { display: flex; align-items: end; gap: 12px; }
.map-search-form .app-field { flex: 1; }
.map-search-result { width: 100%; min-height: 44px; text-align: left; padding: 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.bank-details { display: grid; gap: 14px; margin: 16px 0 24px; padding: 16px 0; border-block: 1px solid var(--line); }
.bank-details > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; }
.bank-details dt { font-size: 13px; color: var(--muted); }
.bank-details dd { grid-row: 2; margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.bank-details .text-button { grid-column: 2; grid-row: 1 / 3; }
.checkout-agreements { padding: 16px 0; border-block: 1px solid var(--line); margin: 24px 0; }
.checkout-agreements h3 { margin: 0 0 12px; }
.legal-approval { display: flex; align-items: center; gap: 12px; min-height: 62px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.approval-indicator { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; flex-shrink: 0; }
.legal-approval[aria-pressed="true"] .approval-indicator { background: #2e7068; border-color: #2e7068; }
.approval-indicator .app-icon { width: 15px; height: 15px; filter: invert(1) !important; }
.approval-state { margin-left: auto; font-size: 12px; color: var(--teal); }
.tracking-placeholder .order-timeline { margin-top: 24px; }
.legal-page { padding-bottom: 40px; }
.fees-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.fees-table th, .fees-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.fees-table th:last-child, .fees-table td:last-child { text-align: right; white-space: nowrap; }
.portal-title { font-size: 24px; }
.portal-content { min-width: 0; }
body:has(.portal-page) .theme-toggle, body:has(.legal-page) .theme-toggle { position: absolute; right: 18px; top: 18px; }
.portal-toolbar .eyebrow { display: none; }
.portal-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 8px 0; margin: 18px 0; position: static; z-index: 400; background: var(--paper); }
.portal-toolbar { flex-direction: row; align-items: center; }
.portal-actions { width: auto; flex-shrink: 0; }
.portal-toolbar h1 { margin-top: 0; }
.portal-tab { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 6px; font-size: 13px; padding: 9px 3px; text-decoration: none; line-height: 1.3; }
.app-icon { width: 23px; height: 23px; object-fit: contain; }
:root[data-theme="dark"] .app-icon { filter: invert(1); }
.portal-tab[data-view="orders"]::before { content: ""; width: 23px; height: 23px; background: var(--ink); mask: url('/assets/icons/navigation_fill.png') center / contain no-repeat; }
.portal-tab[data-view="profile"]::before { content: ""; width: 23px; height: 23px; background: var(--ink); mask: url('/assets/icons/user_fill.png') center / contain no-repeat; }
.order-app { max-width: 720px; margin: 0 auto; }
.order-app h2 { font-size: 23px; line-height: 1.3; margin: 16px 0 24px; }
.order-app h3 { font-size: 18px; margin-top: 26px; }
.order-app .button { width: auto; max-width: 100%; margin: 12px 0; min-height: 44px; border-radius: 6px; white-space: normal; }
.order-app .primary-button, .app-dialog .primary-button { background: #2e7068; color: #fff; border: 1px solid #2e7068; }
.order-app .primary-button { display: block; width: 100%; }
.order-app a, .app-dialog a { color: var(--teal); }
.store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 24px; }
.store-button { min-width: 0; min-height: 44px; padding: 9px 5px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; font: inherit; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; cursor: pointer; }
.store-button:hover { border-color: var(--teal); background: var(--soft-teal); }
.store-button[aria-pressed="true"] { background: var(--soft-teal); border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.custom-store-form { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; }
.order-app .custom-store-toggle { width: 100%; display: block; }
.custom-store-form .app-field { flex: 1; margin: 0; }
.custom-store-form .button { margin: 0; display: grid; place-items: center; width: 48px; min-height: 48px; }
.store-selection-actions { display: grid; gap: 8px; margin: 16px 0; }
.store-selection-actions .button { margin: 0; width: 100%; }
.store-selection-actions button[aria-pressed="true"] { background: var(--soft-teal); color: var(--teal); border-color: var(--teal); }
.product-back { display: grid; place-items: center; position: sticky; top: 8px; z-index: 450; width: 64px; height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; margin-bottom: 16px; }
.app-form { display: grid; gap: 14px; }
.app-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 8px 0; font-size: 14px; font-weight: 600; }
.app-field input, .app-field select, .app-field textarea { width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 12px; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); background: var(--panel); }
.app-field textarea { min-height: 90px; resize: vertical; }
.app-field input:focus, .app-field textarea:focus, .app-field select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.app-field input:user-invalid { border-color: #bd303b; }
.app-disclosure { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin: 12px 0; background: var(--panel); }
.app-disclosure summary { cursor: pointer; font-weight: 650; }
.app-disclosure[open] > summary { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.photo-preview { width: 72px; height: 72px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--soft-teal); cursor: pointer; flex-shrink: 0; }
.photo-preview img:not(.app-icon) { width: 100%; height: 100%; object-fit: cover; }
.photo-preview:disabled { cursor: default; }
.profile-photo-avatar { width: 112px; height: 112px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; padding: 0; margin: 0 auto 16px; background: var(--soft-teal); overflow: hidden; }
button.profile-photo-avatar { cursor: pointer; }
.profile-photo-avatar img:not(.app-icon) { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-editor { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.profile-photo-editor .profile-photo-avatar { margin: 0; }
.profile-photo-frame { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.profile-photo-frame .app-close { position: absolute; top: 0; right: 0; width: 30px; height: 30px; padding: 5px; }
.cart-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.cart-item-detail { display: grid; gap: 3px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.cart-item-detail small { color: var(--muted); }
.item-commands { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-commands .text-button { padding: 3px; margin: 0; color: var(--teal); font-size: 14px; }
.app-close { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; padding: 7px; border: 0; border-radius: 6px; background: #b92f3b; cursor: pointer; }
.app-close .app-icon { width: 22px; height: 22px; filter: invert(1); }
.app-options { padding: 0; border: 0; margin: 24px 0; min-width: 0; }
.app-options legend { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.choice-row { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 9px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.choice-row:has(input:checked) { border: 2px solid #2e7068; padding: 15px; background: var(--soft-teal); }
.choice-row > div { display: flex; flex: 1; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.choice-row small { flex-basis: 100%; color: var(--muted); }
.is-disabled { cursor: not-allowed; }
.choice-row input, .consent-row input { accent-color: #218264; width: 23px; height: 23px; flex-shrink: 0; margin: 0; }
.consent-row { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; }
.price-summary { margin: 24px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.price-summary > div { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 20px; margin: 8px 0; font-size: 15px; }
.price-summary dd { margin: 0; text-align: right; font-weight: 650; white-space: nowrap; }
.guest-cart-offer { padding: 10px 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.guest-cart-offer p { margin-top: 0; }
.price-summary > div:last-child { font-size: 18px; font-weight: 700; color: var(--teal); }
.promo-form { display: flex; align-items: end; gap: 12px; }
.promo-form .app-field { flex: 1; }
.saved-address { border-bottom: 1px solid var(--line); padding: 16px 0; overflow-wrap: anywhere; }
.saved-address p { margin: 6px 0; }
.text-danger { color: #bd303b !important; }
.danger-button { background: #b92f3b; color: #fff; border: 0; }
.profile-menu { display: grid; gap: 0; margin: 26px 0; }
.profile-menu button, .profile-menu a { border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; padding: 18px 2px; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.profile-menu button span { float: right; }
.app-dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); overflow: auto; }
.app-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.app-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.app-dialog-header h2 { font-size: 20px; margin: 0; }
.app-dialog-body { padding: 16px 20px; }
.app-dialog-footer { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; background: var(--panel); position: sticky; bottom: 0; border-top: 1px solid var(--line); z-index: 1000; }
.app-dialog-footer .button { width: auto; flex: 1; min-height: 44px; margin: 0; }
.legal-text { font: inherit; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-expanded { display: block; max-width: 100%; max-height: 68dvh; margin: auto; object-fit: contain; }
.app-map { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 6px; margin: 16px 0; background: #e5e9e4; color: #161c1a; }
.order-card > summary { list-style: none; cursor: pointer; }
.order-card > summary::after { content: "⌄"; display: block; text-align: right; }
.order-card[open] > summary::after { content: "⌃"; }
.order-item-compact { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.order-item-compact > div { min-width: 0; }
.order-item-compact p { margin: 0; font-size: 14px; }
.order-timeline .is-complete::before, .order-timeline .is-current::before { background: #2e7068; color: white; border-color: #2e7068; }
.delivery-code { display: block; font-size: 30px; font-weight: 750; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
@media (min-width: 900px) {
  .portal-page { width: min(1120px, calc(100% - 48px)); }
  .portal-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
  .portal-tabs { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0 16px 0 0; border-bottom: 0; border-right: 1px solid var(--line); position: fixed; top: clamp(16px, calc(100dvh - 320px), 160px); left: max(24px, calc((100vw - 1120px) / 2)); width: 180px; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .portal-content { grid-column: 2; }
  .has-product-back .portal-content { padding-left: 84px; }
  .has-product-back .product-back { position: fixed; top: clamp(16px, calc(100dvh - 320px), 160px); left: calc(max(24px, (100vw - 1120px) / 2) + 212px); }
  .has-site-navigation > .home-main { max-width: 1120px; width: calc(100% - 48px); padding-left: 212px; }
  .has-site-navigation #home-sidebar { top: 144px; max-height: calc(100dvh - 160px); }
  .portal-tab { flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 12px 10px; border-bottom: 0; border-left: 3px solid transparent; font-size: 14px; text-align: left; }
  .portal-tab.is-active { border-bottom: 0; border-left-color: var(--teal); color: var(--teal); background: var(--soft-teal); }
  .portal-tabs .app-icon, .portal-tab::before { flex-shrink: 0; }
  .portal-toolbar { margin-bottom: 20px; }
}
@media (max-width: 540px) {
  .portal-page { padding-bottom: 110px; }
  .portal-toolbar { align-items: flex-start; gap: 8px; margin-bottom: 22px; }
  .portal-title { font-size: 21px; }
  .portal-actions .icon-command { display: none; }
  .portal-updated { font-size: 11px; }
  .app-form-grid { grid-template-columns: 1fr; gap: 4px; }
  .cart-item { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .cart-item .photo-preview { width: 58px; height: 58px; }
  .cart-item .item-commands { grid-column: 2; justify-content: end; }
  .app-dialog-body { padding: 14px; }
  .price-summary > div { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Keep controls touch-sized while reducing vertical space between them. */
.portal-header { padding: 6px 0; }
.portal-header .brand { width: 108px; height: 72px; }
.portal-page { padding-top: 16px; padding-bottom: 24px; }
.portal-section { padding-bottom: 16px; }
.section-heading { margin: 4px 0 12px; }
.order-app h2 { margin: 8px 0 16px; }
.order-app h3 { margin-top: 16px; }
.order-app .button { margin-block: 8px; }
.app-form { gap: 8px; }
.app-form-grid { gap: 6px 12px; }
.app-field { margin-block: 4px; gap: 3px; }
.app-field input, .app-field select, .app-field textarea { padding: 8px 10px; min-height: 44px; }
.app-field.link-field input { padding-right: 95px; }
.app-field textarea { min-height: 70px; }
.product-photo-frame { width: min(240px, 100%); margin-block: 8px; }
.store-pickup { padding-block: 10px; }
.recipient-only .app-form-grid > .phone-field { grid-column: auto; }
.recipient-only .phone-field { grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
.app-options { margin-block: 14px; }
.choice-row { padding: 10px; margin-block: 6px; min-height: 44px; }
.choice-row:has(input:checked) { padding: 9px; }
.bank-details { gap: 8px; padding-block: 10px; margin-block: 12px; }
.price-summary { margin-block: 14px; padding-block: 10px; }
.checkout-agreements { padding-block: 10px; margin-block: 14px; }
.legal-approval { min-height: 48px; padding-block: 8px; }
.profile-menu { margin-block: 14px; }
.profile-menu button, .profile-menu a { padding-block: 10px; min-height: 44px; }
.auth-challenge-dialog { border: 1px solid var(--line, #dce4e1); border-radius: 8px; padding: 44px 8px 8px; width: min(400px, calc(100vw - 32px)); background: var(--surface, #fff); }
.auth-challenge-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.auth-challenge-dialog > .app-close { position: absolute; top: 8px; right: 8px; }
.auth-challenge-dialog iframe { display: block; border: 0; width: 100%; height: 300px; }
.profile-details div { padding-block: 8px; }
.saved-address { padding-block: 10px; }
.app-dialog-header, .app-dialog-body { padding: 12px 16px; }
.app-dialog-footer { padding: 10px 16px; }
.app-dialog-body > .muted { font-size: 12px; line-height: 1.4; margin-block: 8px; }
.app-map { height: min(280px, 42dvh); margin-block: 10px; }
@media (min-width: 900px) {
  #account-sidebar, .has-product-back .product-back { top: 112px; max-height: calc(100dvh - 128px); }
}
@media (max-width: 899px) {
  .portal-tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; margin: 0; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); min-height: 76px; }
  body:has(.portal-page) footer, body.has-site-navigation footer { padding-bottom: 110px; }
  .has-product-back > header { position: sticky; top: 0; z-index: 460; }
  .has-product-back .product-back { position: fixed; top: 21px; left: max(16px, env(safe-area-inset-left)); margin: 0; z-index: 470; }
  .has-product-back .theme-toggle { z-index: 480; }
}
@media (max-width: 540px) {
  .portal-page { padding-bottom: 96px; }
  .app-form-grid { gap: 4px; }
  .recipient-only .app-form-grid > .phone-field { grid-column: 1 / -1; }
}
