/* Adapt to the browser viewport, independently of the phone model and pixel density. */
@media screen and (min-width: 2000px) {
  /* Match the existing 1900px workspace instead of sending controls to the edge of an ultrawide display. */
  body[data-sc-surface="platform"].reference-layout .app-shell .topbar { padding-left: max(25px, calc(50% - 925px)); padding-right: max(25px, calc(50% - 925px)); }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Keep keyboard/remote focus visible without adding device or manufacturer detection. */
body[data-sc-surface] :is(a[href], button, input, select, textarea, summary):focus-visible { outline: 3px solid #d51649; outline-offset: 3px; }
body[data-sc-surface] { --sc-safe-top: env(safe-area-inset-top, 0px); --sc-safe-right: env(safe-area-inset-right, 0px); --sc-safe-bottom: env(safe-area-inset-bottom, 0px); --sc-safe-left: env(safe-area-inset-left, 0px); }
body[data-sc-surface] fieldset { min-inline-size: 0; }
body[data-sc-surface] dialog[open] { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px - var(--sc-safe-top) - var(--sc-safe-bottom)); overflow-y: auto; overscroll-behavior-y: contain; }
body[data-sc-surface] :is(input, textarea, select) { scroll-margin-block: 80px; }
body[data-sc-surface] :is(.cl-dialog, .eq-dialog, .rv-dialog, .pv-dialog, .bk-dialog, .sp-dialog, .of-dialog) { max-width: calc(100vw - 24px - var(--sc-safe-left) - var(--sc-safe-right)); }
body[data-sc-surface="platform"] :is(.app-shell, .main-content) { min-height: 100vh; min-height: 100dvh; }
body[data-sc-surface="platform"] .runtime-gate.auth-gate[hidden] { display: none !important; }
body[data-sc-surface="platform"] .sidebar { padding-bottom: max(12px, var(--sc-safe-bottom)); }
body[data-sc-surface="platform"] :is(.page-wrap, .main-content) { min-width: 0; }
body[data-sc-surface="site"] .header { padding-top: var(--sc-safe-top); padding-left: var(--sc-safe-left); padding-right: var(--sc-safe-right); }
body[data-sc-surface="site"] :is(.hero-copy, .section-heading, .footer) { overflow-wrap: anywhere; }
body[data-sc-surface="site"] .victor-panel { min-height: 0; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px - var(--sc-safe-top) - var(--sc-safe-bottom)); }
body[data-sc-surface="signup"] .setup-main { padding-bottom: var(--sc-safe-bottom); }
body[data-sc-surface="store"] .sf-mobile-cart { bottom: max(13px, var(--sc-safe-bottom)); left: max(15px, var(--sc-safe-left)); right: max(15px, var(--sc-safe-right)); }
body[data-sc-surface="store"] .sf-cart-drawer { max-height: 100vh; max-height: 100dvh; padding-bottom: var(--sc-safe-bottom); }
body[data-sc-surface="store"] .sf-cart-drawer > footer { flex-shrink: 0; }

@media screen and (max-width: 900px) {
  body[data-sc-surface] :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]) { font-size: 16px; }
  body[data-sc-surface="platform"] .sidebar { height: 100vh; height: 100dvh; max-width: calc(100vw - 56px); padding-top: max(20px, var(--sc-safe-top)); padding-left: max(10px, var(--sc-safe-left)); }
  body[data-sc-surface="platform"] .sidebar .side-nav { flex: 1; min-height: 0; }
  body[data-sc-surface="platform"] .sidebar .sidebar-bottom { flex-shrink: 0; }
  body[data-sc-surface="platform"] .topbar { padding-left: max(12px, var(--sc-safe-left)); padding-right: max(12px, var(--sc-safe-right)); }
  body[data-sc-surface="platform"] .page-wrap { padding-left: max(12px, var(--sc-safe-left)); padding-right: max(12px, var(--sc-safe-right)); }
  body[data-sc-surface="platform"] .sc-period-actions { flex-wrap: wrap; }
  body[data-sc-surface="platform"] .sc-period-custom { min-width: 0; }
  body[data-sc-surface="platform"] .sc-period-custom summary { min-height: 44px; }
  body[data-sc-surface="platform"] .sc-period-actions > select.sc-period-preset { min-height: 44px; height: auto; }
  body[data-sc-surface="platform"] :is(.cl-editor-footer, .eq-editor-footer) { flex-wrap: wrap; gap: 10px; padding-bottom: max(16px, var(--sc-safe-bottom)); }
  body[data-sc-surface="site"] .victor-chat.sc-chat-open { top: calc(var(--sc-visual-top, 0px) + max(10px, var(--sc-safe-top))); bottom: auto; right: max(10px, var(--sc-safe-right)); }
  body[data-sc-surface="site"] .victor-panel { width: min(378px, calc(100vw - 20px - var(--sc-safe-left) - var(--sc-safe-right))); height: calc(100vh - 20px); height: calc(var(--sc-visual-height, 100dvh) - max(10px, var(--sc-safe-top)) - max(10px, var(--sc-safe-bottom))); min-height: 0; }
  body[data-sc-surface="site"] .victor-header { flex-shrink: 0; }
  body[data-sc-surface="site"] .victor-chat { bottom: max(12px, var(--sc-safe-bottom)); right: max(10px, var(--sc-safe-right)); }
  body[data-sc-surface="store"] .sf-header-inner { padding-left: max(17px, var(--sc-safe-left)); padding-right: max(17px, var(--sc-safe-right)); }
  body[data-sc-surface="store"] :is(.sf-main, .sf-nav-inner) { padding-left: max(17px, var(--sc-safe-left)); padding-right: max(17px, var(--sc-safe-right)); }
  body[data-sc-surface="signup"] .setup-main { padding-left: max(18px, var(--sc-safe-left)); padding-right: max(18px, var(--sc-safe-right)); }
}
@media screen and (min-width: 681px) and (max-width: 1000px) {
  body[data-sc-surface="site"] .wrap { max-width: calc(100% - 2 * max(24px, var(--sc-safe-left), var(--sc-safe-right))); }
}
@media screen and (max-width: 680px) {
  body[data-sc-surface="site"] .wrap { width: calc(100% - 2 * max(17px, var(--sc-safe-left), var(--sc-safe-right))) !important; max-width: calc(100% - 2 * max(17px, var(--sc-safe-left), var(--sc-safe-right))) !important; }
}
@media screen and (max-width: 600px) {
  body[data-sc-surface="platform"] .app-shell .topbar { min-height: 64px; height: auto; gap: 6px; flex-wrap: wrap; padding-top: max(8px, var(--sc-safe-top)); padding-bottom: 8px; }
  body[data-sc-surface="platform"] .app-shell .breadcrumbs { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
  body[data-sc-surface="platform"] .app-shell .topbar-actions { gap: 4px; flex-shrink: 0; }
  body[data-sc-surface="platform"] .app-shell .topbar .local-clock { display: none; }
  body[data-sc-surface="platform"] .app-shell :is(.topbar .icon-button, .top-avatar, .mobile-menu) { width: 44px; height: 44px; min-width: 44px; }
  body[data-sc-surface="platform"] .app-shell .heading-actions { flex-wrap: wrap; gap: 8px; }
  body[data-sc-surface="platform"] .app-shell .heading-actions .button { min-height: 44px; white-space: normal; font-size: 12px; }
  body[data-sc-surface="site"] .header .button { min-height: 44px; }
  body[data-sc-surface="site"] .hero { padding-bottom: 76px; }
  body[data-sc-surface="site"] .victor-launcher { width: 52px; height: 52px; justify-content: center; padding: 6px; }
  body[data-sc-surface="site"] .victor-launcher > span:nth-child(2) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body[data-sc-surface="site"] .victor-launcher-dot { position: absolute; right: 4px; top: 3px; }
  body[data-sc-surface="store"] .sf-product-action { min-height: 44px; font-size: 11px; white-space: normal; }
  body[data-sc-surface="store"] .sf-product-content > strong { font-size: 13px; line-height: 1.45; }
}
@media screen and (pointer: coarse) {
  body[data-sc-surface] :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]) { font-size: 16px; }
  body[data-sc-surface] :is(button, .button, .sf-primary, .sf-secondary, .setup-primary) { min-height: 44px; }
  body[data-sc-surface="platform"] .nav-item { min-height: 44px; }
  body[data-sc-surface="platform"] .app-shell .topbar :is(.icon-button, .top-avatar, .mobile-menu) { width: 44px; height: 44px; min-width: 44px; }
  body[data-sc-surface="platform"] .app-shell .topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
  body[data-sc-surface="site"] :is(.victor-sound, .victor-close) { min-width: 44px; height: 44px; }
  body[data-sc-surface="site"] .victor-heading small { white-space: normal; }
  body[data-sc-surface="site"] .victor-quick-actions { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  body[data-sc-surface="site"] .victor-quick-actions button { flex: none; }
}
@media screen and (max-height: 500px) and (max-width: 1000px) {
  body[data-sc-surface="platform"] .runtime-gate.auth-gate { display: block; padding: 0; }
  body[data-sc-surface="platform"] .auth-layout { display: block; min-height: 100vh; min-height: 100dvh; border-radius: 0; }
  body[data-sc-surface="platform"] .auth-showcase { display: none; }
  body[data-sc-surface="platform"] .auth-main { padding: 20px max(24px, var(--sc-safe-right)) 20px max(24px, var(--sc-safe-left)); }
  body[data-sc-surface="platform"] .auth-mobile-brand { display: inline-flex; margin: 0 0 14px; }
  body[data-sc-surface="platform"] .auth-form-wrap { margin: 0 auto; padding: 12px 0; }
  body[data-sc-surface="platform"] .sidebar .brand { min-height: 44px; padding-bottom: 8px; }
  body[data-sc-surface="platform"] .sidebar .profile-button { display: none; }
  body[data-sc-surface="platform"] .sidebar .sidebar-bottom { padding-top: 4px; }
  body[data-sc-surface="site"] :is(.victor-audio-activation, .victor-chat-note, .victor-quick-actions) { display: none; }
  body[data-sc-surface="site"] .victor-header { min-height: 56px; padding-block: 6px; }
}
