/* Product navigation keeps the existing font sizes and a consistent hit area. */
header.clone-global {
  height: 56px;
  min-height: 56px;
  padding: 0 20px;
  gap: 16px;
  flex-wrap: nowrap;
}
.clone-global .clone-logo {
  flex: 0 0 auto;
  min-width: 0;
  gap: 4px !important; /* Override the legacy logo gap declared with !important. */
}
.clone-global .clone-logo img { width: 36px; height: 36px; }
.clone-global .clone-nav {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  gap: 8px;
  order: 0;
  flex-wrap: nowrap;
  overflow: visible;
}
.clone-global .clone-nav a {
  position: relative;
  flex: 0 0 80px;
  width: 80px;
  height: 36px;
  justify-content: center;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}
.clone-global .clone-nav a::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 1px;
  height: 20px;
  background: var(--target-line, #dce5e1);
  pointer-events: none;
}
.clone-global .clone-nav a:first-child::before { left: -4px; }
.clone-global .clone-nav a:hover { background: rgba(50, 110, 89, .06); }
.clone-global .clone-nav a.active {
  background: #eaf4f0;
  color: #176b55;
}
.clone-global .clone-nav a:focus-visible {
  outline: 2px solid var(--target-accent, #176b55);
  outline-offset: 2px;
}
.clone-global .clone-tools { min-width: 0; }
.clone-global .clone-user { border-left: 0; padding-left: 0; margin-left: 0; }
.clone-global .account-menu { position: relative; flex: 0 0 auto; }
.account-menu > summary { display: flex; cursor: pointer; list-style: none; border-radius: 50%; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:focus-visible { outline: 2px solid #176b55; outline-offset: 3px; }
.account-menu[open] .clone-avatar { background: #dceee5; border-color: #8dbaa5; }
.account-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 1000;
  width: min(220px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #dce5e1;
  border-radius: 12px;
  background: #fff;
  color: #243b34;
  box-shadow: 0 12px 36px rgba(22, 53, 42, .16);
  white-space: normal;
}
.account-identity { display: grid; gap: 4px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #e4ebe7; overflow-wrap: anywhere; }
.account-identity strong { font-size: 14px; font-weight: 600; }
.account-identity span { font-size: 13px; color: #65756f; }
.clone-tools .account-logout { display: flex; align-items: center; justify-content: flex-start; width: 100%; height: auto; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--target-ink, #243b34); font: inherit; font-size: 13px; line-height: 22px; text-align: left; cursor: pointer; }
.clone-tools .account-logout:hover { background: rgba(50, 110, 89, .07); }
.clone-tools .account-logout:focus-visible { outline: 2px solid var(--target-accent, #176b55); outline-offset: -2px; }
.clone-global #targetUser {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  header.clone-global,
  body.ai-create-active header.clone-global {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
    gap: 8px 16px;
    flex-wrap: wrap;
    align-items: center;
  }
  .clone-global .clone-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .clone-global #targetUser { max-width: 100px; }
  .clone-global .clone-nav a:first-child::before { display: none; }
}
@media (max-width: 600px) {
  header.clone-global,
  body.ai-create-active header.clone-global { padding: 8px 12px; gap: 6px 12px; }
  .clone-global .clone-logo { flex-basis: auto; min-width: 0; }
  .clone-global .clone-logo img { width: 32px; height: 32px; }
  .clone-global .clone-tools { gap: 6px; }
  .clone-global .qj-phone-slot,
  .clone-global #targetUser { display: none; }
  .clone-global .clone-user { padding-left: 0; margin-left: 0; }
  .clone-global .clone-nav { gap: 8px; }
  .clone-global .clone-nav a::before { left: -4px; }
  .clone-global .clone-nav a { flex: 1 0 68px; width: auto; min-width: 68px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .clone-global .clone-nav a { transition: none; }
}

/* Gateway sidebar: one icon family, comfortable spacing, existing page targets. */
.app > .console-sidebar {
  padding: 0 12px;
  background: #f7f7f8;
}
.console-sidebar .brand {
  padding: 24px 16px 16px;
  border: 0;
  color: var(--target-muted, #65727c);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.console-sidebar #nav { margin-top: 4px; gap: 0; }
#nav .gateway-navigation { display: grid; gap: 6px; }
#nav .gateway-navigation button {
  position: relative;
  min-height: 40px;
  width: 100%;
  padding: 10px 1px 12px 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--target-ink, #243b34);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
#nav .gateway-navigation button:hover { background: rgba(50, 110, 89, .07); }
#nav .gateway-navigation button.active {
  background: rgba(50, 110, 89, .12);
  color: var(--target-accent, #176b55);
  font-weight: 650;
}
#nav .gateway-navigation button:focus-visible {
  outline: 2px solid var(--target-accent, #176b55);
  outline-offset: -2px;
}
#nav .gateway-navigation button::before {
  content: "";
  display: block;
  position: absolute;
  left: 16px;
  top: 50%;
  width: 17px;
  height: 20px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--target-muted, #65727c);
  background: currentColor;
  -webkit-mask: var(--console-nav-icon) center / contain no-repeat;
  mask: var(--console-nav-icon) center / contain no-repeat;
}
#nav .gateway-navigation button.active::before,
#nav .gateway-navigation button:hover::before { color: var(--target-accent, #176b55); }
#nav button[data-page="overview"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
}
#nav button[data-page="keys"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='16.5' r='4.5'/%3E%3Cpath d='m11 13 10-10 2 2-3 3-2-2m-3 3 2 2-3 3-2-2'/%3E%3C/svg%3E");
}
#nav button[data-page="billing"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='2.5'/%3E%3Cpath d='M3 10h18M6 15h4'/%3E%3C/svg%3E");
}
#nav button[data-page="usage"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v16a2 2 0 0 0 2 2h16M8 16v-5m5 5V6m5 10v-8'/%3E%3C/svg%3E");
}
#nav button[data-page="pricing"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5A1.5 1.5 0 0 1 4.5 3H11l10 10a1.5 1.5 0 0 1 0 2l-6 6a1.5 1.5 0 0 1-2 0L3 11Z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1'/%3E%3C/svg%3E");
}
#nav button[data-page="docs"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21V5M12 5C9 2.5 5 3 2 3.5v15c3-.5 7-1 10 2.5 3-3.5 7-3 10-2.5v-15C19 3 15 2.5 12 5Z'/%3E%3C/svg%3E");
}
@media (max-width: 768px) {
  .app > .console-sidebar { padding: 0 8px; }
  .console-sidebar .brand { padding: 14px 10px 10px; }
  .console-sidebar #nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0 0 10px; }
  #nav .gateway-navigation { display: contents; }
  #nav .gateway-navigation button { min-height: 44px; padding: 10px 8px 10px 34px; font-size: 12px; line-height: 24px; border-radius: 10px; }
  #nav .gateway-navigation button::before { left: 10px; width: 18px; height: 18px; }
}
@media (max-width: 359px) {
  .console-sidebar #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #nav .gateway-navigation button { transition: none; }
}

/* Voice navigation shares the gateway's line icons and active treatment. */
.console-sidebar:has(.voice-navigation button.active) > .brand { display: none; }
.console-sidebar:has(.voice-navigation button.active) #nav > .nav-group {
  margin: 0;
  padding: 24px 16px 16px;
  border: 0;
}
#nav button[data-page="voice-debug"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10v2a7 7 0 0 0 14 0v-2M12 19v3m-4 0h8'/%3E%3C/svg%3E");
}
#nav button[data-page="realtime"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3v8m0 4v6M12 3v3m0 4v11M19 3v12m0 4v2M2 13h6M9 8h6m1 9h6'/%3E%3C/svg%3E");
}
#nav button[data-page="voices"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10v4m4-8v12m5-16v20m5-16v12m4-8v4'/%3E%3C/svg%3E");
}
#nav button[data-page="knowledge"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M3 5v7c0 4 18 4 18 0V5M3 12v7c0 4 18 4 18 0v-7'/%3E%3C/svg%3E");
}
#nav button[data-page="voice-docs"] {
  --console-nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21V5M12 5C9 2.5 5 3 2 3.5v15c3-.5 7-1 10 2.5 3-3.5 7-3 10-2.5v-15C19 3 15 2.5 12 5Z'/%3E%3C/svg%3E");
}
