/* HAL premium identity M19 — additive presentation only; no runtime authority. */
:root {
  --hal-brand-platinum: #f7fbff;
  --hal-brand-steel: #8ba2b7;
  --hal-brand-cyan: #00d9e8;
  --uacfl-gold-bright: #fff3b0;
  --uacfl-gold: #d9a62e;
  --uacfl-gold-deep: #87530d;
}

.premium-brand-suite {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  gap: 5px;
  isolation: isolate;
}

.premium-hal-brand {
  position: relative;
  gap: 9px !important;
}

.premium-hal-mark {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  object-fit: contain;
  background: radial-gradient(circle at 48% 44%, #123341 0%, #07151b 54%, #020609 100%);
  box-shadow: inset 0 0 0 1px rgb(201 247 255 / .28), 0 0 0 1px rgb(0 63 74 / .32);
  filter:
    drop-shadow(0 0 1px rgb(255 255 255 / .82))
    drop-shadow(0 0 7px rgb(0 217 232 / .4))
    drop-shadow(0 3px 5px rgb(0 0 0 / .35));
  transition: filter 180ms ease, transform 180ms ease;
}

.premium-hal-name {
  color: var(--hal-brand-platinum);
  background: linear-gradient(105deg, #71869a 0%, #f9fdff 23%, #9fb5c7 46%, #ffffff 59%, #5f778b 82%, #d9faff 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 880 !important;
  letter-spacing: .115em !important;
  text-shadow: 0 1px 0 rgb(255 255 255 / .18), 0 2px 5px rgb(0 0 0 / .28);
}

.premium-hal-brand:hover .premium-hal-mark,
.premium-hal-brand:focus-visible .premium-hal-mark {
  filter:
    drop-shadow(0 0 2px rgb(255 255 255 / .95))
    drop-shadow(0 0 10px rgb(0 217 232 / .68))
    drop-shadow(0 4px 7px rgb(0 0 0 / .38));
  transform: translateY(-1px) scale(1.025);
}

[data-theme="light"] .premium-hal-name {
  color: #13283a;
  background: linear-gradient(105deg, #0b1823 0%, #587184 22%, #102d40 43%, #7893a6 57%, #071722 77%, #315b70 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgb(255 255 255 / .52), 0 1px 3px rgb(20 48 68 / .16);
}

.uacfl-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 44px;
  overflow: hidden;
  padding: 3px 8px 3px 5px;
  border: 1px solid rgb(194 139 27 / .25);
  border-radius: 12px;
  background: linear-gradient(145deg, rgb(255 246 193 / .08), rgb(151 94 10 / .05));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 3px 10px rgb(81 47 0 / .08);
  color: var(--uacfl-gold);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.uacfl-brand::before {
  content: "";
  position: absolute;
  inset: -30% auto -30% -75%;
  width: 48%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .52), transparent);
  transform: skewX(-20deg);
  animation: premium-brand-sheen 8s cubic-bezier(.22, 1, .36, 1) infinite;
}

.uacfl-mark {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgb(255 252 222 / .92))
    drop-shadow(0 0 6px rgb(225 164 38 / .45))
    drop-shadow(0 3px 5px rgb(64 37 0 / .3));
}

.uacfl-wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  font-family: var(--font-ui, "Aptos Display", "Segoe UI", system-ui, sans-serif);
  font-size: 9.2px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .065em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #b4770e;
  background: linear-gradient(100deg, #704107 0%, #d69d25 20%, #fff1a5 44%, #b4770e 62%, #ffe69a 79%, #84520a 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgb(255 255 255 / .16);
}

.uacfl-wordmark > span:last-child {
  margin-top: 2px;
  font-size: .88em;
  letter-spacing: .2em;
}

.uacfl-brand:hover,
.uacfl-brand:focus-visible {
  border-color: rgb(217 166 46 / .68);
  background: linear-gradient(145deg, rgb(255 246 193 / .18), rgb(151 94 10 / .09));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 0 14px rgb(217 166 46 / .24);
  transform: translateY(-1px);
}

.uacfl-brand:focus-visible,
.premium-hal-brand:focus-visible {
  outline: 2px solid #d9a62e !important;
  outline-offset: 2px !important;
}

.hs-brand-suite {
  margin-right: auto;
}

.hs-brand-suite .hs-brand {
  margin-right: 0;
}

@media (min-width: 1760px) {
  .uacfl-wordmark { font-size: 10px; letter-spacing: .08em; }
  .uacfl-brand { padding-right: 10px; }
}

@media (max-width: 1280px) {
  .uacfl-wordmark { display: none; }
}

@media (max-width: 1100px) {
  .premium-brand-suite { gap: 2px; }
  .premium-hal-mark { width: 32px !important; height: 32px !important; }
  .uacfl-mark { width: 29px; height: 29px; flex-basis: 29px; }
  .uacfl-brand { min-width: 36px; padding-inline: 3px; }
}

@media (max-width: 520px) {
  .premium-brand-suite { min-height: 44px; gap: 0; }
  .premium-hal-brand { width: 36px; min-width: 36px !important; padding-inline: 1px !important; }
  .premium-hal-mark { width: 30px !important; height: 30px !important; }
  .uacfl-brand { width: 34px; min-width: 34px; min-height: 40px; padding: 2px; border-color: transparent; background: transparent; box-shadow: none; }
  .uacfl-mark { width: 25px; height: 25px; flex-basis: 25px; }
}

@media (max-width: 360px) {
  .premium-brand-suite { display: none; }
}

/* Decorative Bugs intentionally roam above the shell, but never above an active decision surface. */
:where(.pg-app) .modal-root:not([hidden]) {
  z-index: 2147481000 !important;
}

:where(.pg-app) details.chat-voice-settings[open] > .vc-panel {
  z-index: 2147481000 !important;
}

:where(.pg-app) details.chat-voice-settings[open] ~ .vc-backdrop,
:where(.pg-app) .vc-backdrop.on {
  z-index: 2147480999 !important;
}

/* Carry the material language into the primary controls without changing behavior. */
:where(.pg-app) .hx-headernav > a,
:where(.pg-app) .mode-trigger,
:where(.pg-app) .hx-search-trigger,
:where(.pg-app) .header-actions .icon-btn,
:where(.pg-app) .status-pill {
  border-color: rgb(var(--g6) / .58);
  background:
    linear-gradient(180deg, rgb(var(--g11) / .34), rgb(var(--g11) / .04) 42%, transparent 43%),
    linear-gradient(145deg, rgb(var(--g11) / .08), rgb(var(--g4) / .08));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 2px 7px rgb(22 43 64 / .1);
  font-weight: 760;
  letter-spacing: .012em;
}

:where(.pg-app) .hx-headernav > a:hover,
:where(.pg-app) .mode-trigger:hover,
:where(.pg-app) .hx-search-trigger:hover,
:where(.pg-app) .header-actions .icon-btn:hover {
  border-color: rgb(var(--c-accent) / .48);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .72), 0 5px 14px rgb(var(--c-accent) / .12);
}

:where(.pg-app) .hx-headernav > a[aria-current="page"] {
  color: #0b3153;
  background: linear-gradient(145deg, rgb(226 244 255 / .98), rgb(226 237 255 / .92));
  border-color: rgb(59 130 246 / .22);
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgb(43 91 143 / .12);
}

:where(.pg-app) .mode-trigger-label,
:where(.pg-app) .hx-command-label,
:where(.pg-app) .product-ribbon-copy strong {
  font-weight: 820;
  letter-spacing: -.012em;
}

:where(.pg-app) .empty-kicker,
:where(.pg-app) .history-label,
:where(.pg-app) .mode-trigger-kicker {
  font-weight: 850;
  letter-spacing: .14em;
}

:where(.pg-app) .hx-command-surface {
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

:where(.pg-app) .hx-command-surface:hover {
  border-color: rgb(var(--c-accent) / .22);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 5px 14px rgb(55 79 116 / .08);
}

:where(.pg-app) .hx-command-surface[aria-pressed="true"] {
  border-color: rgb(var(--c-accent) / .52);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .72), 0 5px 16px rgb(var(--c-accent) / .13);
}

:where(.pg-app) .portal-cta.primary,
:where(.pg-app) .btn-send:not(:disabled) {
  border: 1px solid rgb(100 95 212 / .34);
  background: linear-gradient(110deg, #73e3eb 0%, #89c9f5 48%, #a78bfa 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .76), 0 8px 20px rgb(87 105 198 / .18);
  color: #102138;
  font-weight: 830;
  text-shadow: 0 1px 0 rgb(255 255 255 / .55);
}

/* The creator is immediately reachable from the first screen without adding a messaging authority. */
:where(.pg-app) .founder-connect {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgb(183 128 24 / .3);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 12%, rgb(255 236 154 / .17), transparent 36%),
    linear-gradient(135deg, rgb(255 255 255 / .66), rgb(247 235 198 / .18));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .74), 0 8px 22px rgb(111 71 7 / .08);
}

:where(.pg-app) .founder-connect-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

:where(.pg-app) .founder-connect-copy > span {
  color: #7a520f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

:where(.pg-app) .founder-connect-copy > strong {
  color: #3e2b0b;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .035em;
}

:where(.pg-app) .founder-connect-copy > small {
  color: #684b1b;
  font-size: 11px;
  font-weight: 700;
}

:where(.pg-app) .founder-connect-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

:where(.pg-app) .founder-connect-links > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid rgb(125 82 11 / .22);
  border-radius: 11px;
  background: linear-gradient(145deg, rgb(255 255 255 / .72), rgb(235 208 136 / .22));
  color: #4d350c;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .82);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

:where(.pg-app) .founder-connect-links > a > span {
  color: #9a690e;
  font-weight: 950;
}

:where(.pg-app) .founder-connect-links > a > b {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
}

:where(.pg-app) .founder-connect-links > a:hover,
:where(.pg-app) .founder-connect-links > a:focus-visible {
  border-color: rgb(176 118 16 / .58);
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgb(158 104 12 / .18);
  transform: translateY(-1px);
}

:where(.pg-app)[data-theme="dark"] .founder-connect {
  background:
    radial-gradient(circle at 8% 12%, rgb(255 219 111 / .13), transparent 38%),
    linear-gradient(135deg, rgb(78 57 19 / .5), rgb(27 31 42 / .88));
}

:where(.pg-app)[data-theme="dark"] .founder-connect-copy > span,
:where(.pg-app)[data-theme="dark"] .founder-connect-copy > small { color: #e9c66f; }
:where(.pg-app)[data-theme="dark"] .founder-connect-copy > strong { color: #fff0b0; }
:where(.pg-app)[data-theme="dark"] .founder-connect-links > a {
  color: #fff0b0;
  background: linear-gradient(145deg, rgb(108 77 20 / .48), rgb(27 31 42 / .72));
  border-color: rgb(229 178 60 / .32);
}

/* A first-time visitor should never have to decode the account icon. */
:where(.pg-app) .mobile-signin-cta {
  color: #13294a;
  border-color: rgb(45 121 214 / .42);
  background: linear-gradient(145deg, #ffffff, #dcecff);
  box-shadow: inset 0 1px 0 #fff, 0 7px 18px rgb(29 91 166 / .16);
  font-weight: 850;
}

:where(.pg-app)[data-theme="dark"] .mobile-signin-cta {
  color: #e9f7ff;
  border-color: rgb(105 208 255 / .42);
  background: linear-gradient(145deg, rgb(18 64 92 / .92), rgb(31 42 72 / .94));
}

/* Cast is a modal decision surface. Give it explicit contrast instead of theme-inverted g-tokens. */
:where(.pg-app) .cast-sheet {
  background: rgb(3 8 18 / .78);
}

:where(.pg-app) .cast-card {
  color: #f5f9ff;
  background: linear-gradient(165deg, #13213a, #091321 74%);
  border: 1px solid rgb(125 190 255 / .24);
  box-shadow: 0 30px 90px rgb(0 0 0 / .72), inset 0 1px 0 rgb(255 255 255 / .08);
}

:where(.pg-app) .cast-head h2 { color: #ffffff; }
:where(.pg-app) .cast-x { color: #ffffff; background: #172b4a; border: 1px solid rgb(141 199 255 / .32); }
:where(.pg-app) .cast-disclaimer { color: #dceaff; background: rgb(57 255 136 / .08); }
:where(.pg-app) .cast-group h3 { color: #69c8ff; }
:where(.pg-app) .cast-pick {
  color: #f8fbff;
  background: linear-gradient(155deg, #172842, #0f1b2f);
  border-color: rgb(143 190 240 / .24);
}
:where(.pg-app) .cast-pick small { color: #b8cbe3; }
:where(.pg-app) .cast-pick[aria-pressed="true"] { background: rgb(57 255 136 / .13); }

:where(.pg-app)[data-theme="light"] .cast-sheet { background: rgb(20 33 51 / .5); }
:where(.pg-app)[data-theme="light"] .cast-card {
  color: #14243b;
  background: linear-gradient(165deg, #ffffff, #edf4fc 76%);
  border-color: #b8cbe4;
  box-shadow: 0 24px 70px rgb(31 58 91 / .28), inset 0 1px 0 #fff;
}
:where(.pg-app)[data-theme="light"] .cast-head h2 { color: #10213a; }
:where(.pg-app)[data-theme="light"] .cast-x { color: #10213a; background: #e6eef9; border-color: #b5c8e1; }
:where(.pg-app)[data-theme="light"] .cast-disclaimer { color: #244260; background: #e8f8ee; }
:where(.pg-app)[data-theme="light"] .cast-group h3 { color: #145fa9; }
:where(.pg-app)[data-theme="light"] .cast-pick { color: #14243b; background: #ffffff; border-color: #bdcde1; }
:where(.pg-app)[data-theme="light"] .cast-pick small { color: #536b89; }
:where(.pg-app)[data-theme="light"] .cast-pick[aria-pressed="true"] { background: #e7faee; border-color: #28945c; }

/* Command Center is the chat-shell entry point for the one canonical Bugs controller. */
:where(.pg-app) body:has(#hal-command-center) .hb-key {
  display: flex !important; /* Restore accessible Bugs menu; Work Focus can hide temporarily. */
}

:where(.pg-app) body:has(#hal-command-center) .hb-menu {
  top: 190px;
  right: 12px;
}

@media (max-width: 760px) {
  :where(.pg-app) .founder-connect { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  :where(.pg-app) .founder-connect { padding: 11px; }
  :where(.pg-app) .founder-connect-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Conversation Center may insert a policy panel before summary; closed details must still be truly closed. */
:where(.pg-app) details.chat-voice-settings:not([open]) > :not(summary) {
  display: none !important;
}

/* Mobile command surface: one compact hierarchy, no clipped duplicate controls. */
@media (max-width: 640px) {
  :where(.pg-app) .product-ribbon {
    min-height: 54px;
    padding: 5px 8px;
    overflow: visible;
  }

  :where(.pg-app) .product-ribbon-actions {
    width: 100% !important;
    max-width: 100%;
    gap: 6px !important;
    justify-content: center;
    overflow: visible;
  }

  :where(.pg-app) .product-ribbon-actions > .hal-dock-toggle,
  :where(.pg-app) .product-ribbon-actions > .radio-live-link,
  :where(.pg-app) .product-ribbon-actions > .workspace-launch {
    display: none !important;
  }

  :where(.pg-app) .product-ribbon-actions > .cast-launch,
  :where(.pg-app) .product-ribbon-actions > .hal-acct-chip,
  :where(.pg-app) .product-ribbon-actions .hal-connect-trigger {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    border: 1px solid rgb(var(--g6) / .52) !important;
    background: linear-gradient(155deg, rgb(var(--g11) / .72), rgb(var(--g4) / .1)) !important;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .72), 0 4px 12px rgb(38 66 103 / .1) !important;
  }

  :where(.pg-app) .product-ribbon-actions > .cast-launch b,
  :where(.pg-app) .product-ribbon-actions .hal-connect-trigger > :not(.hal-connect-icon),
  :where(.pg-app) .product-ribbon-actions .hal-acct-name {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
  }

  :where(.pg-app) .product-ribbon-actions > .cast-launch {
    color: #16314d !important;
    font-size: 20px;
  }

  :where(.pg-app)[data-theme="dark"] .product-ribbon-actions > .cast-launch {
    color: #e9f8ff !important;
  }

  :where(.pg-app) .product-ribbon-actions > .avatar-main-launch {
    flex: 1 1 112px;
    width: auto;
    min-width: 98px;
    max-width: 110px;
    min-height: 44px;
    padding-inline: 11px;
    border-radius: 13px;
    justify-content: center;
  }

  :where(.pg-app) .product-ribbon-actions > .hal-acct-chip {
    width: auto !important;
    min-width: 86px !important;
    max-width: 108px !important;
    flex: 0 0 auto !important;
    gap: 5px !important;
    justify-content: flex-start !important;
    padding: 0 10px 0 5px !important;
  }

  :where(.pg-app) .product-ribbon-actions > .hal-acct-chip .hal-acct-name {
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-width: 66px;
    overflow: hidden !important;
    clip: auto !important;
    clip-path: none !important;
    color: #17314f;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :where(.pg-app)[data-theme="dark"] .product-ribbon-actions > .hal-acct-chip .hal-acct-name {
    color: #eef9ff;
  }

  :where(.pg-app) .product-ribbon-actions > .hal-acct-chip .hal-acct-name-sub {
    display: none !important;
  }

  :where(.pg-app) .hx-command-surfaces {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
    gap: 2px;
    overflow: visible;
  }

  :where(.pg-app) .hx-command-surface {
    width: 100%;
    min-width: 0 !important;
    min-height: 44px;
    grid-template-columns: 17px minmax(0, auto);
    column-gap: 3px;
    justify-content: center;
    padding: 4px 3px;
  }

  :where(.pg-app) .hx-command-icon {
    width: 17px;
    height: 17px;
    font-size: 10px;
  }

  :where(.pg-app) .hx-command-label { font-size: 10px; }
  :where(.pg-app) .hx-command-surface[data-hx-command-surface="bugs"] { color: #9b6611; }
  :where(.pg-app)[data-theme="dark"] .hx-command-surface[data-hx-command-surface="bugs"] { color: #ffd37a; }

  :where(.pg-app) .cast-sheet { padding: 8px; }
  :where(.pg-app) .cast-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 14px;
    border-radius: 18px;
  }

  :where(.pg-app) .composer {
    padding: 5px 8px max(4px, env(safe-area-inset-bottom));
  }

  :where(.pg-app) .composer-inner {
    gap: 4px;
    padding: 5px;
    border-radius: 15px;
  }

  :where(.pg-app) .composer-row {
    min-height: 50px;
    padding: 3px;
    border-radius: 13px;
  }

  :where(.pg-app) #composer-input {
    min-height: 44px !important;
    height: 44px;
    max-height: 88px;
    padding-block: 10px;
    overflow-y: auto;
    resize: none;
    line-height: 1.35;
    scrollbar-width: none;
  }

  :where(.pg-app) #composer-input::-webkit-scrollbar {
    display: none;
  }

  :where(.pg-app) .composer-row :is(.btn-attach, .btn-send, .btn-stop) {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    border-radius: 11px;
  }

  :where(.pg-app) .chat-voice-controls {
    display: grid !important;
    grid-template-columns: max-content max-content 44px;
    grid-template-rows: 44px 15px;
    align-items: center;
    justify-content: start;
    gap: 3px 6px;
    min-height: 62px;
    padding: 0 2px;
    overflow: visible;
  }

  :where(.pg-app) #btn-chat-mic {
    grid-column: 1;
    grid-row: 1;
  }

  :where(.pg-app) #btn-chat-team {
    grid-column: 2;
    grid-row: 1;
  }

  :where(.pg-app) #btn-chat-mic,
  :where(.pg-app) #btn-chat-team {
    min-height: 44px;
    height: 44px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
  }

  :where(.pg-app) #chat-voice-status {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    margin: 0 6px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :where(.pg-app) details.chat-voice-settings {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin: 0;
  }

  :where(.pg-app) details.chat-voice-settings > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
  }

  :where(.pg-app) details.chat-voice-settings > summary > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  :where(.pg-app) .footer {
    gap: 4px;
    min-height: 25px;
    padding: 2px 8px;
    overflow: hidden;
  }

  :where(.pg-app) .footer-brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :where(.pg-app) .footer-more {
    flex: 0 0 auto;
  }

  :where(.pg-app) .footer-more > summary {
    min-height: 25px;
    padding: 0 4px;
    font-size: 10px;
  }

  /* Keep the character system and Bugs key, but pause roaming sprites on resource-tight small screens. */
  /* Keep a small native bug presence on phones; user can switch it off.
     The global work-focus stylesheet still pauses sprites for heavy jobs. */
  body .hb-layer {
    display: block !important;
  }

  body .hb-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 52px;
    padding: 4px;
    border-radius: 12px 0 0 12px;
  }

  body .hb-key > svg {
    display: none;
  }

  body .hb-key .hb-key-t {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    writing-mode: vertical-rl;
  }

  /* Modal surfaces own the full interaction plane; the preserved Bugs key yields until they close. */
  body:has(details.chat-voice-settings[open]) .hb-key {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 360px) {
  :where(.pg-app) .hx-command-surface {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  :where(.pg-app) .hx-command-icon { display: none; }
  :where(.pg-app) .hx-command-label { font-size: 10px; }
}

@media (max-width: 520px) {
  :where(.pg-app) .header {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-height: 56px;
    padding: 6px 8px !important;
  }

  :where(.pg-app) .premium-brand-suite {
    display: inline-flex !important;
    width: 68px;
    min-width: 68px;
    min-height: 44px;
    gap: 2px;
  }

  :where(.pg-app) .premium-hal-brand {
    display: inline-flex;
    width: 32px;
    min-width: 32px !important;
    min-height: 44px;
    padding: 0 !important;
  }

  :where(.pg-app) .premium-hal-mark {
    width: 28px !important;
    height: 28px !important;
  }

  :where(.pg-app) .premium-hal-name,
  :where(.pg-app) .header-actions > .hx-search-trigger,
  :where(.pg-app) .header .status-pill,
  :where(.pg-app) #hal-work-tray-toggle {
    display: none !important;
  }

  :where(.pg-app) .uacfl-brand {
    display: inline-flex !important;
    width: 32px;
    min-width: 32px;
    min-height: 40px;
    padding: 2px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  :where(.pg-app) .uacfl-mark {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  :where(.pg-app) .uacfl-wordmark {
    display: none !important;
  }

  :where(.pg-app) .mode-control {
    flex: 0 0 auto;
    margin: 0 !important;
  }

  :where(.pg-app) .mode-trigger {
    width: auto;
    min-width: 62px;
    min-height: 44px;
    gap: 0;
    padding: 0 12px;
    justify-content: center;
    border-radius: 13px;
  }

  :where(.pg-app) .mode-trigger-kicker,
  :where(.pg-app) .mode-trigger-desc,
  :where(.pg-app) .mode-chevron {
    display: none !important;
  }

  :where(.pg-app) .header-spacer {
    flex: 1 1 auto;
    min-width: 0;
  }

  :where(.pg-app) .header-actions {
    gap: 4px;
    margin-left: 0;
  }

  :where(.pg-app) .header-actions .icon-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
  }

  /* Shared content pages retain both identities and one compact, accessible menu. */
  .hs-head .hs-inner {
    width: calc(100% - 16px);
    min-height: 56px;
    gap: 6px;
  }

  .hs-head .hs-brand-suite {
    display: inline-flex !important;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    gap: 2px;
    overflow: hidden;
  }

  .hs-head .premium-hal-name,
  .hs-head .uacfl-wordmark {
    display: none !important;
  }

  .hs-head .premium-hal-brand {
    width: 34px;
    min-width: 34px;
    padding: 0 !important;
  }

  .hs-head .premium-hal-mark {
    width: 30px !important;
    height: 30px !important;
  }

  .hs-head .uacfl-brand {
    display: inline-flex !important;
    width: 34px;
    min-width: 34px;
    min-height: 40px;
    padding: 2px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .hs-head .uacfl-mark {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .hs-head .hs-mobile {
    flex: 0 0 44px;
    margin-left: auto;
  }

  .hs-head .hs-mobile > summary {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
    background: linear-gradient(155deg, rgb(var(--g11) / .08), rgb(var(--g4) / .08));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .12);
  }

  .hs-head .hs-sheet {
    top: 56px;
    max-height: calc(100dvh - 56px);
  }
}

:where(.pg-app)[data-theme="dark"] .hx-headernav > a[aria-current="page"] {
  color: #e9f8ff;
  background: linear-gradient(145deg, rgb(20 65 89 / .92), rgb(36 48 88 / .9));
}

@media (prefers-reduced-motion: reduce) {
  .uacfl-brand::before { animation: none; display: none; }
  .premium-hal-mark, .uacfl-brand, :where(.pg-app) .founder-connect-links > a { transition: none; }
}

@media (forced-colors: active) {
  .premium-hal-name, .uacfl-wordmark {
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    background: none;
  }
  .uacfl-brand { border: 1px solid ButtonText; }
}

@keyframes premium-brand-sheen {
  0%, 62% { left: -75%; opacity: 0; }
  68% { opacity: .72; }
  82% { left: 145%; opacity: 0; }
  100% { left: 145%; opacity: 0; }
}
