/* Portal layout and optical surfaces. Palette/type remain semantic theme tokens. */
html { scroll-padding: 24px; }
body {
  background: var(--paper);
  isolation: isolate;
}
/* A static colour field gives the glass something to transmit. Its own fixed
 * layer also works on mobile browsers that ignore background-attachment. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--color-action) 22%, var(--accent)), transparent 56%),
    radial-gradient(ellipse at 0% 85%, color-mix(in srgb, var(--color-action) 20%, var(--accent)), transparent 58%),
    radial-gradient(ellipse at 72% 100%, var(--accent), transparent 50%),
    linear-gradient(125deg, transparent 20%, color-mix(in srgb, var(--color-surface) 65%, transparent) 47%, transparent 72%);
}
button, a, input, select { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
button, input, select { scroll-margin-block: 24px; }
/* Blur creates a stacking context; keep the open menu above page controls. */
.topbar { position: relative; z-index: 40; height: 80px; padding: 16px clamp(20px, 4vw, 64px); background: var(--color-surface); border-bottom-color: color-mix(in srgb, var(--color-surface) 80%, var(--line)); box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent); }
.brand { gap: 0; }
.brand-mark, .brand-detail { display: none; }
.footer { padding: 24px clamp(20px, 4vw, 64px); line-height: var(--leading-body); }
.button:hover:not(:disabled) { box-shadow: 0 3px 12px color-mix(in srgb, var(--color-action) 15%, transparent); }
.button.secondary:hover:not(:disabled) { background: var(--accent); }
.text-button { min-height: 44px; }
.card, .settings-section, .plan-card { box-shadow: var(--shadow-card); }
.notice { overflow-wrap: anywhere; }
.auth-layout { margin-block: clamp(40px, 8vw, 100px); }
.auth-layout .card { padding: clamp(24px, 3vw, 36px); }
.auth-layout .intro h1 { font-size: var(--text-hero); }
.auth-layout .intro p { font-size: var(--text-body); }
.portal-nav-icon { width: 22px; height: 22px; flex: 0 0 22px; display: inline-block; vertical-align: middle; }
.portal-sidebar { display: none; }
.portal-shell .workspace { max-width: 1200px; margin: 32px auto 40px; padding-inline: clamp(20px, 3.5vw, 48px); }
.portal-shell .minimal-management { max-width: 960px; }
.minimal-auth .auth-card { box-shadow: var(--shadow-card); }
.venue-heading { gap: 24px; }
.venue-title .eyebrow { color: var(--muted); margin-bottom: 10px; }
.venue-controls .org-switch select { min-height: 48px; }
.venue-rename > summary { min-height: 44px; display: inline-flex; align-items: center; }
.venue-rename form { box-shadow: var(--shadow-card); }
.dashboard-apps-heading { margin-top: 24px; padding-top: 28px; }
.app-launch-tile.product-card-overview { min-height: 0; }
.app-launch-tile.product-card-overview .product-footnote { padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--line); }
.workspace-toolbar { gap: 24px; padding-bottom: 24px; margin-bottom: 30px; }
.org-switch { max-width: 340px; }
.org-switch label { font-size: var(--text-caption); letter-spacing: var(--tracking-label); margin-bottom: 8px; }
.org-switch select { border-color: color-mix(in srgb, var(--color-surface) 80%, var(--line)); background: var(--color-surface); box-shadow: inset 0 1px 0 var(--color-surface), inset 0 -1px 0 color-mix(in srgb, var(--color-action) 8%, transparent), 0 5px 16px color-mix(in srgb, var(--color-action) 8%, transparent); }
.org-switch-control { position: relative; }
.org-switch-control > .portal-nav-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; }
.org-switch-control select { padding-left: 46px; }
.account-email { color: var(--muted); font-size: var(--text-caption); }
.account .text-button { color: var(--muted); font-size: var(--text-caption); padding-block: 8px; }
.dashboard-intro { margin-bottom: 30px; }
.dashboard-intro h1 { margin-bottom: 8px; }
.dashboard-intro p { font-size: var(--text-description); }
.overview-apps { scroll-margin-top: 24px; }
.overview-section-heading { margin: 0 0 18px; font-size: var(--text-section); }
.product-grid { gap: 20px; }
.product-card-overview { min-width: 0; padding: 20px; box-shadow: var(--shadow-card); }
.product-summary { display: grid; grid-template-columns: minmax(0, 1fr) 36%; gap: 16px; align-items: stretch; }
.product-copy { min-width: 0; }
.product-copy h3 { font-family: var(--font-heading); font-size: var(--text-product); font-weight: var(--weight-bold); letter-spacing: var(--tracking-heading); margin: 0 0 6px; }
.product-card-overview .product-description { font-size: var(--text-small); margin-bottom: 10px; line-height: var(--leading-compact); color: var(--muted); }
.product-preview-label { display: inline-block; background: var(--color-badge); color: var(--muted); border-radius: var(--radius-small); padding: 3px 7px; font-size: var(--text-badge); }
.product-visual { min-width: 0; overflow: hidden; border-radius: var(--radius-hover); background: var(--accent); height: 144px; }
.product-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-visual .app-icon { width: 100%; height: 100%; }
.product-card-overview .product-actions { padding: 10px 0 0; }
.product-card-overview .product-actions .button { padding: 8px 0; min-height: 44px; border: 0; background: transparent; color: var(--color-action); justify-content: flex-start; text-align: left; box-shadow: none; }
.product-card-overview .product-actions .button:hover { text-decoration: underline; text-underline-offset: 4px; }
.workspace-navigation summary { display: flex; align-items: center; gap: 8px; background: var(--color-surface); border-color: color-mix(in srgb, var(--color-surface) 80%, var(--line)); box-shadow: inset 0 1px 0 var(--color-surface), inset 0 -1px 0 color-mix(in srgb, var(--color-action) 8%, transparent), 0 5px 16px color-mix(in srgb, var(--color-action) 8%, transparent); font-size: var(--text-small); }
.workspace-navigation summary::-webkit-details-marker { display: none; }
.workspace-navigation nav { padding: 8px; border-color: color-mix(in srgb, var(--color-surface) 80%, var(--line)); box-shadow: inset 0 1px 0 var(--color-surface), 0 16px 40px color-mix(in srgb, var(--color-action) 14%, transparent); }
.workspace-navigation nav a { display: flex; align-items: center; gap: 10px; }
.workspace-navigation nav a[aria-current] { color: var(--color-action); }
.management > h1, .settings-intro h1 { margin-bottom: 12px; }
.management > p, .settings-intro > p { font-size: var(--text-description); }
.record h2 { font-size: var(--text-section); }
.settings-section { gap: 28px; }
.settings-section-intro p { line-height: var(--leading-body); }
.portal-shell .settings-savebar { background: var(--color-surface); border-color: color-mix(in srgb, var(--color-surface) 80%, var(--line)); border-radius: var(--radius-menu); box-shadow: inset 0 1px 0 var(--color-surface), var(--shadow-savebar); }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .topbar, .org-switch select, .workspace-navigation summary {
    background: linear-gradient(130deg, color-mix(in srgb, var(--color-surface) 24%, transparent), transparent 50%), color-mix(in srgb, var(--color-surface) 58%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
    backdrop-filter: blur(20px) saturate(145%);
  }
  .workspace-navigation nav, .portal-shell .settings-savebar {
    /* Secondary text needs a more opaque backing than the ink nav labels. */
    background: linear-gradient(130deg, color-mix(in srgb, var(--color-surface) 45%, transparent), transparent 65%), color-mix(in srgb, var(--color-surface) 90%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
  }
}
@media (min-width: 1100px) {
  .portal-shell { padding-left: 224px; }
  .portal-shell .topbar { justify-content: flex-end; height: 72px; padding-inline: 40px; }
  .portal-shell .topbar .brand { display: none; }
  .portal-sidebar { position: fixed; inset: 16px auto 16px 16px; width: 208px; padding: 24px 12px 18px; z-index: 25; flex-direction: column; overflow-y: auto; border: 1px solid color-mix(in srgb, var(--color-surface) 85%, var(--line)); border-radius: 28px; background: var(--color-surface); box-shadow: inset 1px 1px 0 color-mix(in srgb, var(--color-surface) 95%, transparent), inset -1px -1px 0 color-mix(in srgb, var(--color-action) 8%, transparent), 0 12px 36px color-mix(in srgb, var(--color-action) 10%, transparent); }
  .portal-shell .portal-sidebar { display: flex; }
  .portal-sidebar-brand { display: block; padding: 0 16px 36px; text-decoration: none; font-size: var(--text-brand); font-weight: var(--weight-brand); letter-spacing: var(--tracking-brand); }
  .portal-sidebar nav { display: grid; gap: 6px; }
  .portal-nav-link { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-hover); text-decoration: none; font-size: var(--text-nav); }
  .portal-nav-link:hover { background: color-mix(in srgb, var(--accent) 70%, transparent); }
  .portal-nav-link[aria-current] { background: var(--accent); color: var(--color-action); font-weight: var(--weight-medium); }
  .portal-sidebar-account { margin-top: auto; padding-top: 24px; }
  @supports ((backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px))) {
    .portal-sidebar { background: linear-gradient(145deg, color-mix(in srgb, var(--color-surface) 38%, transparent), transparent 45%, color-mix(in srgb, var(--color-surface) 18%, transparent)), color-mix(in srgb, var(--color-surface) 44%, transparent); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%); }
  }
}
@media (max-width: 1099px) {
  .portal-shell .topbar { height: 76px; padding: 16px 24px; }
  .portal-shell .settings-savebar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .portal-shell .footer { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 1000px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); max-width: 540px; gap: 28px; margin-block: 36px; }
  .auth-layout .intro h1 { font-size: var(--text-auth-mobile); }
  .auth-layout .intro p { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .topbar { height: 72px; padding-inline: 22px; }
  .footer { padding-inline: 22px; flex-wrap: wrap; gap: 4px 16px; }
  .portal-shell .workspace { margin-top: 24px; padding-inline: 22px; }
  .workspace-toolbar { gap: 16px; margin-bottom: 26px; padding-bottom: 20px; flex-wrap: wrap; }
  .org-switch { max-width: none; flex-basis: 100%; }
  .portal-shell .workspace-toolbar .account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 0; max-width: none; width: 100%; text-align: left; }
  .workspace-toolbar .account .text-button { white-space: nowrap; }
  .portal-overview .workspace-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
  .portal-overview .account-email { display: none; }
  .portal-overview .workspace-toolbar .account { width: auto; }
  .dashboard-intro { margin-bottom: 24px; gap: 12px; }
  .dashboard-intro h1 { font-size: var(--text-management-mobile); }
  .venue-heading { gap: 16px; }
  .venue-title h1 { font-size: var(--text-management-mobile); }
  .venue-controls { gap: 10px; }
  .venue-controls .button { padding-inline: 14px; }
  .dashboard-apps-heading { margin-top: 18px; padding-top: 24px; }
  .product-grid { gap: 14px; }
  .product-card-overview { padding: 16px; }
  .product-summary { grid-template-columns: minmax(0, 1fr) 36%; gap: 12px; }
  .product-visual { height: 132px; }
  .overview-section-heading { margin-bottom: 14px; }
  .portal-shell .settings-section { padding: 22px; }
  .portal-shell .settings-savebar { padding: 14px; }
  .auth-layout { margin-top: 34px; }
  .auth-layout .intro h1 { font-size: var(--text-auth-mobile); }
}
@media (max-width: 380px) {
  .portal-shell .workspace { padding-inline: 16px; }
  .product-card-overview { padding: 14px; }
  .product-summary { grid-template-columns: minmax(0, 1fr) 32%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  body::before { display: none; }
  .topbar, .portal-sidebar, .org-switch select, .workspace-navigation summary, .workspace-navigation nav, .portal-shell .settings-savebar { background: var(--color-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  body::before { display: none; }
  .topbar, .portal-sidebar, .org-switch select, .workspace-navigation summary, .workspace-navigation nav, .portal-shell .settings-savebar { background: Canvas; color: CanvasText; border-color: CanvasText; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .portal-nav-link[aria-current] { outline: 2px solid; outline-offset: -4px; }
}
