/* ==========================================================================
   THE 707 COMPANY — 707 STUDIO DESIGN SYSTEM
   Standardized from 707 Form App & 707 Studio
   Apple UI Standard + Windows HD Clarity + Helvetica Neue 707 Display
   ========================================================================== */

:root {
  /* Typography Stacks (Strictly SF Pro across all elements) */
  --font-apple-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", system-ui, sans-serif;
  --font-707: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", system-ui, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

  /* Typography Scale */
  --display-h1: 28px;
  --heading-h2: 22px;
  --heading-h3: 18px;
  --subtext-lead: 16px;
  --bodytext: 14px;
  --btn: 14px;
  --caption: 12px;
  --legal-micro: 11px;

  /* Typography Weights (Default UI copy = 350 mid Light/Regular, Max weight = Medium 500 — no bold) */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-ui-default: 350;
  --font-weight-max: 500;

  /* Brand Luxury Palette */
  --color-brand-primary: #000000;
  --color-brand-secondary: #111111;
  --color-brand-muted: #737373;
  --color-brand-border: #E5E5E5;
  --color-brand-surface: #FAFAFA;
  --color-brand-accent: #FFFFFF;

  /* Light Theme Surfaces */
  --color-bg: #FFFFFF;
  --color-bg-subtle: #FAFAFA;
  --color-surface: #FFFFFF;
  --color-surface-2: #F5F5F5;
  --color-surface-hover: rgba(0, 0, 0, 0.04);
  --color-surface-active: rgba(0, 0, 0, 0.08);
  --color-border: #E5E5E5;
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-hairline: rgba(0, 0, 0, 0.10);

  /* Primary Action */
  --color-primary: #000000;
  --color-primary-hover: #222222;
  --color-primary-text: #FFFFFF;
  --color-highlight: #2563EB;

  /* Premium Status Colors (Pale moss, deep oxblood, muted bronze) */
  --color-moss-50: #e8f3fc;
  --color-moss-100: #d0e7fa;
  --color-moss-500: #0D72CB;
  --color-moss-600: #0a5ca5;

  --color-oxblood-50: #F6EEED;
  --color-oxblood-500: #7E2C32;
  --color-oxblood-600: #64212A;

  --color-bronze-50: #F5F1E7;
  --color-bronze-500: #8F7C50;
  --color-bronze-600: #766443;

  /* Text Hierarchy */
  --color-text-primary: #000000;
  --color-text-secondary: #404040;
  --color-text-muted: #737373;
  --color-text-disabled: #A3A3A3;
  --color-text-inverse: #FFFFFF;

  /* Sidebar Tokens */
  --sidebar-bg: #FAFAFA;
  --sidebar-border: #E5E5E5;
  --sidebar-text: #404040;
  --sidebar-text-muted: #737373;
  --sidebar-text-active: #000000;

  /* Dimensions & Spacing */
  --sidebar-width: 260px;
  --header-height: 48px;
  --chat-max-width: 800px;
  --canvas-width: 580px;
  --tap-min: 44px;
}

/* ==========================================================================
   DARK THEME OVERRIDES (EDITOR STUDIO PALETTE)
   ========================================================================== */

[data-theme="dark"] {
  --color-brand-primary: #FFFFFF;
  --color-brand-secondary: #E5E5E5;
  --color-brand-muted: #9CA3AF;
  --color-brand-border: #2e2e2e;
  --color-brand-surface: #171717;
  --color-brand-accent: #000000;

  --color-bg: #0d0d0d;
  --color-bg-subtle: #171717;
  --color-surface: #171717;
  --color-surface-2: #202020;
  --color-surface-hover: rgba(255, 255, 255, 0.05);
  --color-surface-active: rgba(255, 255, 255, 0.10);
  --color-border: #2e2e2e;
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-hairline: rgba(255, 255, 255, 0.12);

  --color-primary: #FFFFFF;
  --color-primary-hover: #E5E5E5;
  --color-primary-text: #000000;
  --color-highlight: #3B82F6;

  --color-moss-50: #0b253d;
  --color-moss-500: #0D72CB;
  --color-moss-600: #4fa3eb;

  --color-oxblood-50: #3A1115;
  --color-oxblood-500: #7E2C32;
  --color-oxblood-600: #C69A96;

  --color-bronze-50: #4A3E29;
  --color-bronze-500: #8F7C50;
  --color-bronze-600: #C4B690;

  --color-text-primary: #F3F4F6;
  --color-text-secondary: #D1D5DB;
  --color-text-muted: #9CA3AF;
  --color-text-disabled: #6B7280;
  --color-text-inverse: #0d0d0d;

  --sidebar-bg: #0d0d0d;
  --sidebar-border: #2e2e2e;
  --sidebar-text: #9CA3AF;
  --sidebar-text-muted: #6B7280;
  --sidebar-text-active: #F3F4F6;
}

/* ==========================================================================
   BASE RESET & SUBPIXEL ANTIALIASING
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: var(--font-apple-ui);
  font-size: var(--bodytext);
  font-weight: var(--font-weight-ui-default);
  line-height: 1.45;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.011em;
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
}

/* Cap headings and emphasis tags at Medium (500) — never bold (600/700) */
h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
th {
  font-weight: var(--font-weight-max, 500);
}

.font-707 {
  font-family: var(--font-707) !important;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

/* Sleek Auto-Hiding Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*:hover {
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

*:hover::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.22);
}

/* Apple Frosted Glass Utilities */
.apple-frost {
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

[data-theme="dark"] .apple-frost {
  background: rgba(24, 24, 24, 0.90);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

.apple-frost-backdrop {
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

/* Tactile Press Effect */
.apple-press {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.12s ease;
}

.apple-press:active {
  transform: scale(0.97);
}

/* Apple Glass Button */
.apple-glass-btn {
  background-color: rgba(255, 255, 255, 0.85);
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  color: var(--color-text-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.15s ease;
}

.apple-glass-btn:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.25);
}

.apple-glass-btn-dark {
  background-color: #000000;
  border: 0.5px solid rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
  transition: all 0.15s ease;
}

.apple-glass-btn-dark:hover {
  background-color: #222222;
}

/* Unified Apple Glass Status Indicator Pill */
.apple-status-pill {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 9999px;
  border: 0.5px solid var(--color-border-hairline);
  background: rgba(236, 236, 236, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: var(--legal-micro);
  font-weight: 500;
}

/* ==========================================================================
   APP SHELL & LAYOUT
   ========================================================================== */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--color-bg);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--sidebar-bg);
  border-right: 0.5px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--sidebar-border);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-707);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.brand-logo-img {
  height: 20px;
  width: auto;
}

.sidebar-action-row {
  padding: 12px 14px 8px;
}

.btn-sidebar-new {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.btn-sidebar-new:hover {
  background-color: var(--color-primary-hover);
}

.sidebar-search-container {
  padding: 0 14px 10px;
}

.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-surface-2);
  border: 0.5px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.sidebar-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--color-text-primary);
  width: 100%;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px;
}

.sidebar-section-title {
  padding: 10px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.sidebar-item:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.sidebar-item.is-active {
  background-color: var(--color-surface-2);
  color: var(--color-text-primary);
  font-weight: 500;
}

.sidebar-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-pin {
  color: var(--color-bronze-500);
}

/* Sidebar Footer (Clean, No Quotas!) */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 0.5px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
}

.sidebar-footer-btn:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 0.5px solid var(--color-border-subtle);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background-color: #000000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   HEADER & MULTIPLAYER PRESENCE BAR
   ========================================================================== */

.app-header {
  height: var(--header-height);
  border-bottom: 0.5px solid var(--color-border);
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-title-text {
  font-family: var(--font-707);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Real-Time Collaborator Avatars (707 Studio Style) */
.collaborator-stack {
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.collaborator-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: #FFFFFF;
  margin-left: -6px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.collaborator-avatar:hover {
  transform: scale(1.12);
  z-index: 10;
}

.collaborator-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  border: 1px solid #FFFFFF;
}

.collaborator-status-dot.is-live {
  background-color: var(--color-moss-500);
}

.collaborator-status-dot.is-admin {
  background-color: var(--color-oxblood-500);
}

.btn-invite-team {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 0.5px solid var(--color-border);
  background-color: var(--color-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
}

.btn-invite-team:hover {
  background-color: var(--color-surface-hover);
  border-color: rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   WORKSPACE MAIN SPLIT LAYOUT (CHAT + LIVE CANVAS)
   ========================================================================== */

.workspace-container {
  flex: 1;
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  position: relative;
}

/* Chat Pane */
.chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.chat-viewport {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 32px;
}

.chat-thread-container {
  width: 100%;
  max-width: var(--chat-max-width);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Live Editing Canvas Pane (Split View) */
.canvas-pane {
  width: var(--canvas-width);
  height: 100%;
  border-left: 0.5px solid var(--color-border);
  background-color: var(--color-surface);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-header {
  height: var(--header-height);
  padding: 0 16px;
  border-bottom: 0.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-surface);
}

.canvas-toolbar {
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-bg-subtle);
  flex-wrap: wrap;
}

.canvas-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  font-family: var(--font-apple-ui);
  line-height: 1.6;
}

.canvas-editor-body h1 {
  font-family: var(--font-707);
  font-size: var(--display-h1);
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.canvas-editor-body h2 {
  font-family: var(--font-707);
  font-size: var(--heading-h2);
  font-weight: 500;
  margin: 20px 0 10px;
}

/* ==========================================================================
   GLEAN OMNIBAR & COMPOSER
   ========================================================================== */

.composer-area {
  width: 100%;
  max-width: var(--chat-max-width);
  margin: 0 auto;
  padding: 0 16px 16px;
}

.omnibar-card {
  background-color: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.omnibar-card:focus-within {
  border-color: #000000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.omnibar-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 0;
  overflow-x: auto;
}

.omnibar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  border: 0.5px solid var(--color-border);
  background-color: var(--color-surface-2);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.omnibar-chip.is-active {
  background-color: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

.omnibar-input-row {
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
  gap: 8px;
}

.omnibar-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-size: var(--bodytext);
  line-height: 1.5;
  color: var(--color-text-primary);
  max-height: 160px;
  min-height: 24px;
}

.omnibar-textarea::placeholder {
  color: var(--color-text-muted);
}

.btn-omnibar-send {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: #000000;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-omnibar-send:hover {
  background-color: #222222;
}

/* ==========================================================================
   PROACTIVE AI & INTELLIGENCE FEED
   ========================================================================== */

.proactive-feed-card {
  background-color: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proactive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.proactive-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: var(--color-moss-50);
  color: var(--color-moss-600);
  font-size: 11px;
  font-weight: 500;
}

.proactive-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background-color: var(--color-bg-subtle);
  border: 0.5px solid var(--color-border-subtle);
}

.proactive-item-content {
  flex: 1;
}

.proactive-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.proactive-item-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.btn-proactive-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  margin-top: 6px;
  border-radius: 6px;
  background-color: #000000;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   DEPARTMENT ACTION HUB
   ========================================================================== */

.action-hub-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-dept-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dept-pill-btn {
  padding: 4px 12px;
  border-radius: 9999px;
  border: 0.5px solid var(--color-border);
  background-color: var(--color-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.dept-pill-btn.is-active {
  background-color: #000000;
  color: #FFFFFF;
  border-color: #000000;
  font-weight: 500;
}

.action-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.action-card {
  background-color: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.action-card:hover {
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.action-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.action-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
}

/* ==========================================================================
   MOBILE VIEWPORT ADAPTATIONS (390px)
   ========================================================================== */

@media (max-width: 768px) {
  .canvas-pane {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--header-height));
    z-index: 200;
    transform: translateX(100%);
  }

  .canvas-pane.is-open {
    transform: translateX(0);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }
}

/* ==========================================================================
   INTEGRATED COMPANY DATA & PERMISSIONS MODAL + TRUE BLACK DARK THEME
   ========================================================================== */

.company-data-modal-window {
  width: 100%;
  max-width: 496px;
}

.company-data-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.company-scope-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(244, 244, 245, 0.85);
  border: 0.5px solid rgba(27, 27, 27, 0.08);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.company-scope-card.is-enabled {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(27, 27, 27, 0.14);
}

.company-scope-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.company-scope-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.company-scope-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #171717;
}

.company-scope-handle {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.06);
  color: #404040;
}

.company-scope-access-pill {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(123, 139, 103, 0.14);
  color: #0a5ca5;
}

.company-scope-access-pill.is-restricted {
  background: rgba(143, 124, 80, 0.15);
  color: #6b5832;
}

.company-scope-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #525252;
}

.company-scope-toggle-btn {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 6px 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-scope-toggle-btn.is-toggled .mini-switch {
  background: #0D72CB;
}

.company-scope-toggle-btn.is-toggled .mini-switch::after {
  transform: translateX(14px);
}

/* Pure Black Whole-Page Dark Theme Overrides */
html[data-theme="dark"] {
  --liquid-glass-bg: linear-gradient(180deg,
      rgba(23, 23, 23, 0.96) 0%,
      rgba(17, 17, 17, 0.94) 55%,
      rgba(13, 13, 13, 0.97) 100%);
  --liquid-glass-tail-fill: #1c1c1c;
  --liquid-glass-shadow-lg:
    0 0 0 0.5px rgba(255, 255, 255, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 32px 72px -12px rgba(0, 0, 0, 0.85),
    0 12px 28px -6px rgba(0, 0, 0, 0.65);
  --liquid-glass-shadow-popover:
    0 0 0 0.5px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 52px -10px rgba(0, 0, 0, 0.82);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app-viewport,
html[data-theme="dark"] .main-hub,
html[data-theme="dark"] .chat-primary-pane {
  background-color: #000000;
  color: #f5f5f5;
}

html[data-theme="dark"] .studio-header {
  background: transparent;
}

html[data-theme="dark"] .logo-img {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] .version-badge {
  background: #262626;
  border-color: transparent;
  color: #b3b3b3;
}

html[data-theme="dark"] .version-badge:hover {
  background: #262626;
  color: #b3b3b3;
}

html[data-theme="dark"] .icon-action-btn {
  color: #e5e5e5;
}

html[data-theme="dark"] .icon-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html[data-theme="dark"] .user-monogram-badge {
  background: #171717;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f5f5f5;
}

html[data-theme="dark"] .user-live-dot,
html[data-theme="dark"] .notif-dot-moss {
  border-color: #000000;
}

html[data-theme="dark"] .adaptive-greeting-h1 {
  color: #ffffff;
}

html[data-theme="dark"] .greeting-subline {
  color: #a3a3a3;
}

html[data-theme="dark"] .hub-overlay-scrim {
  background: rgba(0, 0, 0, 0.56);
}

html[data-theme="dark"] .glass-popover-menu,
html[data-theme="dark"] .glass-level2-flyout,
html[data-theme="dark"] .mention-popover,
html[data-theme="dark"] .gemini-context-menu,
html[data-theme="dark"] .feedback-reason-popover,
html[data-theme="dark"] .foot-more-dropdown,
html[data-theme="dark"] .hub-sort-menu,
html[data-theme="dark"] .bulk-project-picker,
html[data-theme="dark"] .folder-add-conv-picker,
html[data-theme="dark"] .project-invite-popover {
  background: #1c1c1c;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.72),
    inset 0 0 10px 1px rgba(255, 255, 255, 0.04),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.14),
    0 22px 50px -8px rgba(0, 0, 0, 0.65),
    0 6px 16px -2px rgba(0, 0, 0, 0.40);
  color: #f5f5f5;
}

html[data-theme="dark"] .popover-option-btn,
html[data-theme="dark"] .submenu-trigger-btn,
html[data-theme="dark"] .prompt-template-btn,
html[data-theme="dark"] .mention-opt-btn,
html[data-theme="dark"] .gemini-menu-item,
html[data-theme="dark"] .sort-menu-item,
html[data-theme="dark"] .bulk-picker-item,
html[data-theme="dark"] .assign-proj-option,
html[data-theme="dark"] .company-data-head-title {
  color: #e5e5e5;
}

html[data-theme="dark"] .popover-option-btn:hover,
html[data-theme="dark"] .submenu-anchor-wrap:hover>.submenu-trigger-btn,
html[data-theme="dark"] .submenu-anchor-wrap.is-submenu-open>.submenu-trigger-btn,
html[data-theme="dark"] .prompt-template-btn:hover,
html[data-theme="dark"] .mention-opt-btn:hover,
html[data-theme="dark"] .mention-opt-btn.is-kbd-active,
html[data-theme="dark"] .gemini-menu-item:hover,
html[data-theme="dark"] .sort-menu-item:hover,
html[data-theme="dark"] .bulk-picker-item:hover,
html[data-theme="dark"] .assign-proj-option:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

html[data-theme="dark"] .popover-option-btn.is-selected,
html[data-theme="dark"] .popover-option-btn.is-selected:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

html[data-theme="dark"] .popover-divider,
html[data-theme="dark"] .mention-divider,
html[data-theme="dark"] .assign-pop-sep {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .popover-opt-title,
html[data-theme="dark"] .menu-item-label {
  color: #f5f5f5;
}

html[data-theme="dark"] .popover-opt-desc,
html[data-theme="dark"] .company-data-hint,
html[data-theme="dark"] .company-data-handle-label {
  color: #a3a3a3;
}

html[data-theme="dark"] .balloon-tail-svg path:nth-child(2) {
  stroke: #171717;
}

html[data-theme="dark"] .balloon-tail-svg path:nth-child(3) {
  stroke: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .dock-tooltip,
html[data-theme="dark"] .header-dock-tooltip {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f5;
}

html[data-theme="dark"] .dock-tooltip::after,
html[data-theme="dark"] .header-dock-tooltip::after {
  background: #1e1e1e;
}

html[data-theme="dark"] .centered-hub-modal,
html[data-theme="dark"] .hub-modal-glass,
html[data-theme="dark"] .quicklook-window,
html[data-theme="dark"] .create-project-card {
  background: rgba(25, 25, 25, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  color: #f5f5f5;
}

html[data-theme="dark"] .hub-modal-title,
html[data-theme="dark"] .hub-title,
html[data-theme="dark"] .project-card-title,
html[data-theme="dark"] .history-row-title,
html[data-theme="dark"] .folder-title-h2,
html[data-theme="dark"] .quicklook-title {
  color: #f5f5f5;
}

html[data-theme="dark"] .hub-subtitle {
  color: #a3a3a3;
}

html[data-theme="dark"] .hub-toolbar {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .hub-search-input,
html[data-theme="dark"] .create-proj-input,
html[data-theme="dark"] .invite-email-input {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f5;
}

html[data-theme="dark"] .hub-pill,
html[data-theme="dark"] .hub-sort-btn,
html[data-theme="dark"] .hub-mode-segmented {
  background: #262626;
  border: 1px solid #383838;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #e5e5e5;
}

html[data-theme="dark"] .hub-close-btn,
html[data-theme="dark"] .bulk-action-btn,
html[data-theme="dark"] .bulk-clear-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e5e5e5;
}

html[data-theme="dark"] .hub-pill.is-active,
html[data-theme="dark"] .mode-seg-btn.is-active {
  background: #ffffff;
  color: #0a0a0a;
}

html[data-theme="dark"] .artifact-hub-card,
html[data-theme="dark"] .thinking-step-card,
html[data-theme="dark"] .inline-artifact-card {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.11);
  color: #f5f5f5;
}

html[data-theme="dark"] .project-hub-card,
html[data-theme="dark"] .history-hub-row {
  background: transparent;
  border-color: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  color: #f5f5f5;
}

html[data-theme="dark"] .project-hub-card:hover,
html[data-theme="dark"] .history-hub-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

html[data-theme="dark"] .artifact-hub-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .project-card-threads,
html[data-theme="dark"] .history-row-meta,
html[data-theme="dark"] .step-p,
html[data-theme="dark"] .assistant-lead-p,
html[data-theme="dark"] .assistant-bullet-list,
html[data-theme="dark"] .assistant-sub-h {
  color: #d4d4d4;
}

html[data-theme="dark"] .assistant-prose-h,
html[data-theme="dark"] .assistant-callout-title,
html[data-theme="dark"] .chat-user-msg-text,
html[data-theme="dark"] .table-card-title {
  color: #f5f5f5;
}

html[data-theme="dark"] .header-share-capsule,
html[data-theme="dark"] .header-project-glass-btn,
html[data-theme="dark"] .thread-collab-pill,
html[data-theme="dark"] .jump-latest-btn {
  background: rgba(25, 25, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f5;
}

html[data-theme="dark"] .thinking-header-btn {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #d4d4d4;
}

html[data-theme="dark"] .thinking-content-body {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.11);
  color: #d4d4d4;
}

html[data-theme="dark"] .table-action-pill,
html[data-theme="dark"] .composer-cap-pill,
html[data-theme="dark"] .inline-artifact-dl-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e5e5e5;
}

html[data-theme="dark"] .foot-icon-btn {
  color: #a3a3a3;
}

html[data-theme="dark"] .foot-icon-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

html[data-theme="dark"] .composer-queue-tray {
  background: #171717;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f5;
}

html[data-theme="dark"] .queue-item-row {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .thread-time-divider span {
  background: #000000;
  color: #a3a3a3;
}

html[data-theme="dark"] .company-scope-card {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .company-scope-card.is-enabled {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .company-scope-name {
  color: #f5f5f5;
}

html[data-theme="dark"] .company-scope-handle {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
}

html[data-theme="dark"] .company-scope-access-pill {
  background: rgba(123, 139, 103, 0.24);
  color: #bfd0ab;
}

html[data-theme="dark"] .company-scope-access-pill.is-restricted {
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

html[data-theme="dark"] .company-scope-desc {
  color: #a3a3a3;
}

html[data-theme="dark"] .company-scope-toggle-btn.is-toggled .mini-switch {
  background: #0D72CB;
}

html[data-theme="dark"] .company-scope-toggle-btn.is-toggled .mini-switch::after {
  background: #ffffff;
}

/* ===== Borderless Profile Quick Info Header ===== */
.user-profile-popover a {
  text-decoration: none;
}

.user-profile-popover .profile-account-card {
  background: transparent;
  border: none;
  border-radius: 11px;
  padding: 8px 10px;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

.user-profile-popover .profile-card-meta {
  gap: 3px;
}

.user-profile-popover .profile-card-top {
  gap: 7px;
}

.user-profile-popover .profile-menu-divider {
  margin: 6px 4px;
}

.user-profile-popover .profile-account-card:hover,
.user-profile-popover .profile-account-card:focus-visible {
  background: rgba(27, 27, 27, 0.055);
  border: none;
}

html[data-theme="dark"] .user-profile-popover .profile-account-card {
  background: transparent;
  border: none;
}

html[data-theme="dark"] .user-profile-popover .profile-account-card:hover,
html[data-theme="dark"] .user-profile-popover .profile-account-card:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border: none;
}

/* ===== Usage Limits WhatsApp IT CTA (Single Apple Liquid Glass Button) ===== */
.usage-limits-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 0.5px solid rgba(27, 27, 27, 0.08);
}

.usage-request-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.usage-request-title {
  font-size: 12px;
  font-weight: 500;
  color: #171717;
}

.usage-request-sub {
  font-size: 11px;
  color: #737373;
}

.usage-wa-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 15px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 245, 248, 0.72) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 2px 8px rgba(27, 27, 27, 0.06);
  color: #111111;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.usage-wa-cta:hover,
.usage-wa-cta:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 249, 251, 0.9) 100%);
  border-color: rgba(27, 27, 27, 0.24);
  outline: none;
}

.usage-wa-cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

html[data-theme="dark"] .usage-limits-foot {
  border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .usage-request-title {
  color: #f5f5f5;
}

html[data-theme="dark"] .usage-request-sub {
  color: #a3a3a3;
}

html[data-theme="dark"] .usage-wa-cta {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.07) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px rgba(0, 0, 0, 0.45);
  color: #f5f5f5;
}

html[data-theme="dark"] .usage-wa-cta:hover,
html[data-theme="dark"] .usage-wa-cta:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  border-color: rgba(255, 255, 255, 0.34);
}

/* ===== Shared Main Studio Header (for Settings & Support Sub-Pages) ===== */
.studio-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 48px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 85;
  background: transparent;
  flex-shrink: 0;
}

.settings-shell-page .studio-header {
  position: fixed;
  height: 54px;
  padding: 10px 24px;
  background: rgba(242, 242, 242, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

html[data-theme="dark"] .settings-shell-page .studio-header {
  background: rgba(0, 0, 0, 0.84);
}

.header-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 20px;
}

.logo-link {
  height: 18px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
  text-decoration: none;
}

.logo-link:hover {
  opacity: 0.85;
}

.logo-img {
  height: 18px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ebebeb;
  border: none;
  box-shadow: none;
  font-family: var(--font-707, var(--font-apple-ui));
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #525252;
  line-height: 1.1;
  white-space: nowrap;
  user-select: none;
}

.version-badge:hover {
  background: #ebebeb;
  border: none;
}

.header-icons-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.icon-action-btn {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0;
  color: #000000;
  transition: opacity 0.15s ease, transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .icon-action-btn {
  color: #f5f5f5;
}

.icon-action-btn:hover {
  opacity: 0.75;
}

.icon-action-btn svg {
  width: 19px;
  height: 19px;
}

.notif-dot-moss {
  position: absolute;
  top: 2px;
  right: 2.5px;
  width: 6.5px;
  height: 6.5px;
  border-radius: 9999px;
  background-color: var(--moss-500, #0D72CB);
  box-shadow: 0 0 0 1.5px #f2f2f2;
}

html[data-theme="dark"] .notif-dot-moss {
  box-shadow: 0 0 0 1.5px #000000;
}

.user-monogram-badge {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background-color: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-apple-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .user-monogram-badge {
  background-color: #ffffff;
  color: #0a0a0a;
}

.user-live-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--moss-500, #0D72CB);
  border: 1px solid #ffffff;
}

.profile-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.settings-shell-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 9px 16px;
  border-radius: 9999px;
  background: rgba(25, 25, 25, 0.92);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 120;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.settings-shell-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html[data-theme="dark"] .settings-shell-toast {
  background: rgba(244, 244, 245, 0.94);
  color: #0a0a0a;
}

/* ===== Shared Profile Popover & Usage Limits Modal ===== */
@keyframes appleMenuDrop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mini-switch {
  width: 28px;
  height: 16px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.14);
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.18s ease;
}

.mini-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(244px, calc(100vw - 24px));
  padding: 6px;
  border-radius: 16px;
  background: var(--liquid-glass-bg, rgba(255, 255, 255, 0.92));
  -webkit-backdrop-filter: blur(28px) saturate(1.85);
  backdrop-filter: blur(28px) saturate(1.85);
  border: 0.5px solid rgba(27, 27, 27, 0.10);
  box-shadow: var(--liquid-glass-shadow-popover, 0 18px 42px rgba(27, 27, 27, 0.14));
  display: none;
  flex-direction: column;
  z-index: 95;
  font-family: var(--font-707, var(--font-apple-ui));
  transform-origin: top right;
  animation: appleMenuDrop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-profile-popover * {
  font-family: var(--font-707, var(--font-apple-ui));
  box-sizing: border-box;
}

.user-profile-popover.is-open {
  display: flex;
}

.user-profile-popover.is-expanded-view {
  width: min(272px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 76px));
  overflow-y: auto;
}

.profile-account-card {
  width: 100%;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(27, 27, 27, 0.038);
  border: 0.5px solid rgba(27, 27, 27, 0.075);
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-account-card:hover,
.profile-account-card:focus-visible {
  background: rgba(27, 27, 27, 0.065);
  border-color: rgba(27, 27, 27, 0.14);
  outline: none;
}

.profile-card-avatar {
  position: relative;
  overflow: hidden;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #111111;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.015em;
  flex-shrink: 0;
}

.profile-card-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.profile-card-name {
  font-size: 12.5px;
  font-weight: var(--font-weight-max, 500);
  line-height: 16px;
  color: #111111;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.075);
  color: #404040;
  font-size: 10px;
  font-weight: var(--font-weight-max, 500);
  line-height: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.profile-card-division {
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  color: #525252;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-chevron {
  width: 13px;
  height: 13px;
  color: #737373;
  flex-shrink: 0;
}

.profile-menu-divider {
  height: 1px;
  background: rgba(27, 27, 27, 0.065);
  margin: 5px 4px;
}

.profile-menu-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-menu-item {
  width: 100%;
  min-height: 33px;
  padding: 6px 9px;
  border-radius: 9px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  cursor: pointer;
  color: #171717;
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: rgba(27, 27, 27, 0.055);
  color: #000000;
  outline: none;
}

.profile-menu-item-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.profile-menu-item-left svg {
  width: 15px;
  height: 15px;
  color: #525252;
  flex-shrink: 0;
}

.profile-menu-item:hover .profile-menu-item-left svg {
  color: #111111;
}

.profile-menu-kbd {
  font-size: 11px;
  font-weight: 400;
  color: #737373;
  flex-shrink: 0;
}

.profile-menu-item.is-signout {
  color: #525252;
}

.profile-menu-item.is-signout:hover,
.profile-menu-item.is-signout:focus-visible {
  background: rgba(159, 18, 57, 0.075);
  color: #9f1239;
}

.profile-menu-item.is-signout:hover svg,
.profile-menu-item.is-signout:focus-visible svg {
  color: #9f1239;
}

.profile-sub-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.profile-sub-panel.is-active {
  display: flex;
}

.profile-sub-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 7px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(27, 27, 27, 0.065);
}

.profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #111111;
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.profile-back-btn:hover,
.profile-back-btn:focus-visible {
  background: rgba(27, 27, 27, 0.055);
  outline: none;
}

.profile-back-btn svg {
  width: 15px;
  height: 15px;
  color: #525252;
}

.profile-sec-label {
  padding: 7px 9px 2px;
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  color: #737373;
  letter-spacing: -0.005em;
}

.profile-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 400;
  color: #737373;
  flex-shrink: 0;
}

.profile-row-chev {
  width: 13px;
  height: 13px;
  color: #a3a3a3;
  flex-shrink: 0;
}

.profile-static-row {
  width: 100%;
  min-height: 35px;
  padding: 6px 9px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #171717;
  font-size: 12.5px;
}

.profile-seg-group {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 8px;
  background: rgba(27, 27, 27, 0.065);
  gap: 2px;
  flex-shrink: 0;
}

.profile-seg-btn {
  min-height: 22px;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #525252;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.profile-seg-btn.is-active {
  background: #ffffff;
  color: #111111;
  font-weight: var(--font-weight-max, 500);
  box-shadow: 0 1px 2px rgba(27, 27, 27, 0.10);
}

.profile-menu-item .mini-switch {
  width: 30px;
  height: 17px;
}

.profile-menu-item .mini-switch::after {
  width: 13px;
  height: 13px;
}

.profile-menu-item.is-toggled .mini-switch {
  background: #0D72CB;
}

.profile-menu-item.is-toggled .mini-switch::after {
  transform: translateX(13px);
}

.profile-sub-box {
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(27, 27, 27, 0.035);
  border: 0.5px solid rgba(27, 27, 27, 0.075);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0;
}

.profile-sub-note {
  font-size: 11.5px;
  line-height: 1.4;
  color: #525252;
}

.profile-sub-textarea {
  width: 100%;
  min-height: 76px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0.5px solid rgba(27, 27, 27, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #111111;
  font-family: var(--font-707, var(--font-apple-ui));
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.profile-sub-primary-btn {
  align-self: flex-end;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(242, 242, 246, 0.82) 100%);
  color: #111111;
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(27, 27, 27, 0.08);
}

[data-theme="dark"] .user-profile-popover {
  background: rgba(25, 25, 25, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .profile-card-avatar {
  background: #f5f5f5;
  color: #111111;
}

[data-theme="dark"] .profile-card-name,
[data-theme="dark"] .profile-back-btn {
  color: #f5f5f5;
}

[data-theme="dark"] .profile-role-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
}

[data-theme="dark"] .profile-card-division,
[data-theme="dark"] .profile-card-chevron,
[data-theme="dark"] .profile-menu-kbd,
[data-theme="dark"] .profile-back-btn svg,
[data-theme="dark"] .profile-sec-label,
[data-theme="dark"] .profile-row-meta,
[data-theme="dark"] .profile-sub-note {
  color: #a3a3a3;
}

[data-theme="dark"] .profile-menu-divider {
  background: rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .profile-menu-item,
[data-theme="dark"] .profile-static-row {
  color: #e5e5e5;
}

[data-theme="dark"] .profile-menu-item:hover,
[data-theme="dark"] .profile-menu-item:focus-visible,
[data-theme="dark"] .profile-back-btn:hover,
[data-theme="dark"] .profile-back-btn:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

[data-theme="dark"] .profile-menu-item-left svg {
  color: #a3a3a3;
}

[data-theme="dark"] .profile-menu-item:hover .profile-menu-item-left svg {
  color: #ffffff;
}

[data-theme="dark"] .profile-sub-header {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .profile-seg-group {
  background: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .profile-seg-btn {
  color: #a3a3a3;
}

[data-theme="dark"] .profile-seg-btn.is-active {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
  box-shadow: none;
}

[data-theme="dark"] .profile-menu-item.is-toggled .mini-switch {
  background: #0D72CB;
}

[data-theme="dark"] .profile-menu-item.is-toggled .mini-switch::after {
  background: #ffffff;
}

[data-theme="dark"] .profile-sub-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .profile-sub-textarea {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f5;
}

[data-theme="dark"] .profile-sub-primary-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.10) 100%);
  border-color: rgba(255, 255, 255, 0.24);
  color: #f5f5f5;
}

.usage-limits-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 27, 27, 0.34);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.usage-limits-overlay.is-open {
  display: flex;
}

.usage-limits-window {
  width: min(492px, calc(100vw - 24px));
  padding: 24px;
  border-radius: 24px;
  background: var(--liquid-glass-bg, rgba(255, 255, 255, 0.94));
  -webkit-backdrop-filter: blur(30px) saturate(1.85);
  backdrop-filter: blur(30px) saturate(1.85);
  border: 0.5px solid rgba(27, 27, 27, 0.12);
  box-shadow: var(--liquid-glass-shadow-lg, 0 24px 60px rgba(27, 27, 27, 0.22));
  font-family: var(--font-707, var(--font-apple-ui));
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.usage-limits-window * {
  font-family: var(--font-707, var(--font-apple-ui));
  box-sizing: border-box;
}

.usage-limits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-limits-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.usage-limits-title {
  margin: 0;
  font-size: 20px;
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.02em;
  line-height: 26px;
  color: #111111;
}

.usage-limits-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.065);
  color: #525252;
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  line-height: 14px;
  white-space: nowrap;
}

.usage-limits-close {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #404040;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.usage-limits-lead {
  margin: 0;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #404040;
}

.usage-learn-link {
  display: inline;
  text-decoration: none;
  border-bottom: 1.5px dotted rgba(27, 27, 27, 0.45);
  color: #111111;
  font-size: inherit;
  font-weight: var(--font-weight-max, 500);
}

.usage-updated-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 400;
  color: #737373;
}

.usage-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #16a34a;
}

.usage-meter-card {
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(27, 27, 27, 0.042);
  border: 0.5px solid rgba(27, 27, 27, 0.075);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-meter-name {
  font-size: 14px;
  font-weight: var(--font-weight-max, 500);
  color: #111111;
}

.usage-meter-pct {
  font-size: 14px;
  font-weight: var(--font-weight-max, 500);
  color: #111111;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.usage-meter-track {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.86);
  border: 0.5px solid rgba(27, 27, 27, 0.06);
  overflow: hidden;
}

.usage-meter-fill {
  height: 100%;
  border-radius: 9999px;
  background: #171717;
}

.usage-meter-reset {
  font-size: 12.5px;
  font-weight: 400;
  color: #525252;
}

.usage-limits-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  font-size: 12px;
  color: #737373;
}

.usage-sim-btn {
  min-height: 30px;
  padding: 4px 14px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #404040;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

[data-theme="dark"] .usage-limits-overlay {
  background: rgba(0, 0, 0, 0.56);
}

[data-theme="dark"] .usage-limits-window {
  background: rgba(25, 25, 25, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .usage-limits-title,
[data-theme="dark"] .usage-learn-link,
[data-theme="dark"] .usage-meter-name,
[data-theme="dark"] .usage-meter-pct {
  color: #f5f5f5;
}

[data-theme="dark"] .usage-limits-role-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
}

[data-theme="dark"] .usage-limits-close {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #d4d4d4;
}

[data-theme="dark"] .usage-limits-lead,
[data-theme="dark"] .usage-meter-reset {
  color: #d4d4d4;
}

[data-theme="dark"] .usage-learn-link {
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .usage-updated-row,
[data-theme="dark"] .usage-limits-foot {
  color: #a3a3a3;
}

[data-theme="dark"] .usage-meter-card {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .usage-meter-track {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .usage-meter-fill {
  background: #f5f5f5;
}

[data-theme="dark"] .usage-sim-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e5e5e5;
}

/* ===== Full-Page Settings Breadcrumb & Personal Intelligence Menu ===== */
.settings-page-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #525252;
  padding: 4px 2px;
  transition: color 0.14s ease;
}

.settings-crumb-link:hover {
  color: #111111;
}

.settings-crumb-link svg {
  width: 14px;
  height: 14px;
}

html[data-theme="dark"] .settings-crumb-link {
  color: #a3a3a3;
}

html[data-theme="dark"] .settings-crumb-link:hover {
  color: #ffffff;
}

.pi-page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pi-page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #111111;
}

.pi-page-head p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: #525252;
}

html[data-theme="dark"] .pi-page-head h1 {
  color: #ffffff;
}

html[data-theme="dark"] .pi-page-head p {
  color: #a3a3a3;
}

.pi-list-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 0.5px solid rgba(27, 27, 27, 0.09);
  box-shadow: 0 2px 10px rgba(27, 27, 27, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .pi-list-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.pi-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 62px;
  padding: 16px 22px;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid rgba(27, 27, 27, 0.08);
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.pi-list-row:last-child {
  border-bottom: none;
}

.pi-list-row:hover {
  background: rgba(27, 27, 27, 0.03);
}

html[data-theme="dark"] .pi-list-row {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .pi-list-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pi-row-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pi-row-title {
  font-size: 15px;
  font-weight: 400;
  color: #111111;
}

html[data-theme="dark"] .pi-row-title {
  color: #f5f5f5;
}

.pi-row-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 400;
  color: #737373;
}

.pi-row-right svg {
  width: 15px;
  height: 15px;
}

html[data-theme="dark"] .pi-row-right {
  color: #a3a3a3;
}

.pi-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.18);
  transition: background-color 0.16s ease;
  flex-shrink: 0;
}

.pi-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.pi-list-row-switch.is-toggled .pi-switch-track {
  background: #0D72CB;
}

.pi-list-row-switch.is-toggled .pi-switch-track::after {
  transform: translateX(18px);
}

/* Full-Page Data & Permissions Rows */
.dp-meta-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #737373;
}

html[data-theme="dark"] .dp-meta-row {
  color: #a3a3a3;
}

.dp-row-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dp-handle-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.055);
  color: #404040;
  font-size: 11.5px;
  font-weight: 500;
}

html[data-theme="dark"] .dp-handle-pill {
  background: rgba(255, 255, 255, 0.09);
  color: #e5e5e5;
}

.dp-row-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #525252;
}

html[data-theme="dark"] .dp-row-desc {
  color: #a3a3a3;
}

.dp-access-tag {
  font-size: 11.5px;
  font-weight: 400;
  color: #737373;
  white-space: nowrap;
}

.dp-access-tag.is-restricted {
  color: #92400e;
}

html[data-theme="dark"] .dp-access-tag {
  color: #a3a3a3;
}

html[data-theme="dark"] .dp-access-tag.is-restricted {
  color: #fbbf24;
}

.dp-foot-note {
  font-size: 12.5px;
  color: #737373;
  margin: 0;
}

html[data-theme="dark"] .dp-foot-note {
  color: #a3a3a3;
}

.dp-account-card {
  border-radius: 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 0.5px solid rgba(27, 27, 27, 0.09);
  box-shadow: 0 2px 10px rgba(27, 27, 27, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

html[data-theme="dark"] .dp-account-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.dp-account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.dp-account-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dp-account-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #111111;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
}

.dp-account-avatar img,
.user-monogram-badge img,
.profile-card-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  display: block;
  z-index: 0;
}

.user-live-dot {
  z-index: 1;
}

.user-monogram-badge.has-photo,
.profile-card-avatar.has-photo,
.dp-account-avatar.has-photo {
  background: transparent;
}

.dp-avatar-hover {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dp-account-avatar:hover .dp-avatar-hover,
.dp-account-avatar:focus-visible .dp-avatar-hover {
  opacity: 1;
}

.dp-avatar-hover svg {
  width: 16px;
  height: 16px;
}

.dp-photo-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dp-photo-remove {
  border: none;
  background: transparent;
  color: #737373;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
  padding: 6px 8px;
  cursor: pointer;
}

.dp-photo-remove:hover {
  color: #111111;
}

html[data-theme="dark"] .dp-photo-remove {
  color: #a3a3a3;
}

html[data-theme="dark"] .dp-photo-remove:hover {
  color: #ffffff;
}

html[data-theme="dark"] .dp-account-avatar {
  background: #f5f5f5;
  color: #111111;
}

.dp-account-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dp-account-name {
  font-size: 15px;
  font-weight: 500;
  color: #111111;
}

html[data-theme="dark"] .dp-account-name {
  color: #f5f5f5;
}

.dp-account-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.065);
  color: #404040;
  font-size: 11px;
  font-weight: 500;
}

html[data-theme="dark"] .dp-account-role {
  background: rgba(255, 255, 255, 0.11);
  color: #e5e5e5;
}

.dp-account-div {
  font-size: 12.5px;
  color: #737373;
}

html[data-theme="dark"] .dp-account-div {
  color: #a3a3a3;
}

.dp-account-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #525252;
  padding-top: 10px;
  border-top: 0.5px solid rgba(27, 27, 27, 0.08);
}

html[data-theme="dark"] .dp-account-note {
  color: #a3a3a3;
  border-top-color: rgba(255, 255, 255, 0.09);
}

.dp-request-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 9999px;
  text-decoration: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: #111111;
  border: 0.5px solid rgba(27, 27, 27, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 245, 248, 0.74) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 1px 4px rgba(27, 27, 27, 0.06);
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.dp-request-btn:hover,
.dp-request-btn:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 249, 251, 0.88) 100%);
  border-color: rgba(27, 27, 27, 0.25);
  outline: none;
}

.dp-request-btn svg {
  width: 13px;
  height: 13px;
}

html[data-theme="dark"] .dp-request-btn {
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.07) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .dp-request-btn:hover,
html[data-theme="dark"] .dp-request-btn:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
  border-color: rgba(255, 255, 255, 0.34);
}

html[data-theme="dark"] .pi-switch-track,
html[data-theme="dark"] .mini-switch,
[data-theme="dark"] .mini-switch {
  background: #3a3a3c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .pi-switch-track::after,
html[data-theme="dark"] .mini-switch::after,
[data-theme="dark"] .mini-switch::after {
  background: #f5f5f5;
}

html[data-theme="dark"] .pi-list-row-switch.is-toggled .pi-switch-track {
  background: #0D72CB;
}

html[data-theme="dark"] .pi-list-row-switch.is-toggled .pi-switch-track::after {
  background: #ffffff;
}

/* Installed Connected Apps Monochrome Pills inside Personal Intelligence */
.pi-connectors-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pi-conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(27, 27, 27, 0.045);
  border: 0.5px solid rgba(27, 27, 27, 0.08);
  font-size: 12px;
  font-weight: 400;
  color: #404040;
}

.pi-conn-chip svg {
  width: 13px;
  height: 13px;
  color: #525252;
  flex-shrink: 0;
}

html[data-theme="dark"] .pi-conn-chip {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d4d4d4;
}

html[data-theme="dark"] .pi-conn-chip svg {
  color: #a3a3a3;
}

.activity-memory-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #737373;
  padding: 6px 4px 2px;
}

html[data-theme="dark"] .activity-memory-label {
  color: #a3a3a3;
}

.activity-memory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.activity-memory-remove {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #737373;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}

.activity-memory-remove:hover {
  background: rgba(27, 27, 27, 0.08);
  color: #111111;
}

html[data-theme="dark"] .activity-memory-remove {
  color: #a3a3a3;
}

html[data-theme="dark"] .activity-memory-remove:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

@media (max-width: 640px) {
  .settings-shell-page .studio-header {
    padding: 10px 16px;
  }

  .settings-page-shell {
    padding: 82px 16px 56px;
  }

  .pi-list-row {
    padding: 16px 18px;
  }

  .usage-limits-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .company-data-modal-window {
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .company-scope-card {
    padding: 12px;
  }

  .company-scope-toggle-btn,
  .usage-wa-cta,
  .settings-crumb-link,
  .activity-memory-remove {
    min-width: 44px;
    min-height: 44px;
  }
}

html[data-theme="dark"] .profile-menu-item.is-signout {
  color: #a3a3a3;
}

html[data-theme="dark"] .profile-menu-item.is-signout:hover,
html[data-theme="dark"] .profile-menu-item.is-signout:focus-visible {
  color: #ffffff;
}

/* ==========================================================================
   Response Style Setup (Personal Intelligence -> Response Style)
   ========================================================================== */

.style-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.style-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.style-section-label {
  font-size: 13px;
  font-weight: 500;
  color: #525252;
  letter-spacing: -0.01em;
}

html[data-theme="dark"] .style-section-label {
  color: #a3a3a3;
}

.style-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #0D72CB;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.style-saved-badge.is-visible {
  opacity: 1;
}

html[data-theme="dark"] .style-saved-badge {
  color: #60a5fa;
}

.style-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.style-preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(27, 27, 27, 0.09);
  box-shadow: 0 2px 10px rgba(27, 27, 27, 0.03);
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.style-preset-card:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(27, 27, 27, 0.18);
}

.style-preset-card:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

.style-preset-card.is-selected {
  border-color: #0D72CB;
  background: rgba(13, 114, 203, 0.06);
  box-shadow: 0 0 0 1px #0D72CB;
}

html[data-theme="dark"] .style-preset-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

html[data-theme="dark"] .style-preset-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .style-preset-card.is-selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 0 0 1px #3b82f6;
}

.style-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.style-preset-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.style-preset-icon {
  width: 18px;
  height: 18px;
  color: #525252;
  flex-shrink: 0;
}

.style-preset-card.is-selected .style-preset-icon {
  color: #0D72CB;
}

html[data-theme="dark"] .style-preset-icon {
  color: #a3a3a3;
}

html[data-theme="dark"] .style-preset-card.is-selected .style-preset-icon {
  color: #60a5fa;
}

.style-preset-title {
  font-size: 14.5px;
  font-weight: 500;
  color: #111111;
}

html[data-theme="dark"] .style-preset-title {
  color: #ffffff;
}

.style-preset-check {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 1.5px solid rgba(27, 27, 27, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.style-preset-check svg {
  width: 11px;
  height: 11px;
  opacity: 0;
}

.style-preset-card.is-selected .style-preset-check {
  background: #0D72CB;
  border-color: #0D72CB;
}

.style-preset-card.is-selected .style-preset-check svg {
  opacity: 1;
}

html[data-theme="dark"] .style-preset-check {
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .style-preset-card.is-selected .style-preset-check {
  background: #3b82f6;
  border-color: #3b82f6;
}

.style-preset-desc {
  font-size: 13px;
  line-height: 1.42;
  color: #525252;
}

html[data-theme="dark"] .style-preset-desc {
  color: #a3a3a3;
}

.style-preset-tag {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: #737373;
}

html[data-theme="dark"] .style-preset-tag {
  color: #8e8e93;
}

/* Segmented quick toggles inside .pi-list-row */
.style-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 14px 22px;
  border-bottom: 0.5px solid rgba(27, 27, 27, 0.08);
}

.style-toggle-row:last-child {
  border-bottom: none;
}

html[data-theme="dark"] .style-toggle-row {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.style-toggle-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.style-toggle-sub {
  font-size: 12.5px;
  line-height: 1.35;
  color: #737373;
}

html[data-theme="dark"] .style-toggle-sub {
  color: #9ca3af;
}

.style-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(27, 27, 27, 0.06);
  flex-shrink: 0;
}

html[data-theme="dark"] .style-segmented {
  background: rgba(255, 255, 255, 0.08);
}

.style-seg-btn {
  border: none;
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.style-seg-btn:hover {
  color: #111111;
}

.style-seg-btn:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 1px;
}

.style-seg-btn.is-active {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .style-seg-btn {
  color: #a3a3a3;
}

html[data-theme="dark"] .style-seg-btn:hover {
  color: #ffffff;
}

html[data-theme="dark"] .style-seg-btn.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: none;
}

.style-toggle-row.is-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.style-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  min-height: 36px;
  border-radius: 9999px;
  border: 1px solid rgba(27, 27, 27, 0.12);
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.style-chip:hover {
  background: rgba(27, 27, 27, 0.04);
  color: #111111;
}

.style-chip:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

.style-chip.is-active {
  border-color: #0D72CB;
  background: rgba(13, 114, 203, 0.1);
  color: #0D72CB;
}

html[data-theme="dark"] .style-chip {
  border-color: rgba(255, 255, 255, 0.14);
  color: #a3a3a3;
}

html[data-theme="dark"] .style-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

html[data-theme="dark"] .style-chip.is-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

/* Live Preview Card */
.style-preview-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 0.5px solid rgba(27, 27, 27, 0.09);
  box-shadow: 0 2px 10px rgba(27, 27, 27, 0.03);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

html[data-theme="dark"] .style-preview-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.style-preview-prompt {
  align-self: flex-end;
  max-width: 85%;
  padding: 9px 14px;
  border-radius: 14px 14px 4px 14px;
  background: rgba(27, 27, 27, 0.06);
  color: #111111;
  font-size: 13.5px;
  line-height: 1.45;
}

html[data-theme="dark"] .style-preview-prompt {
  background: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.style-preview-reply {
  font-size: 14px;
  line-height: 1.55;
  color: #18181b;
}

.style-preview-reply p {
  margin: 0 0 8px;
}

.style-preview-reply p:last-child {
  margin-bottom: 0;
}

.style-preview-reply ul,
.style-preview-reply ol {
  margin: 4px 0 0;
  padding-left: 20px;
}

.style-preview-reply li {
  margin-bottom: 4px;
}

.style-preview-reply code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(27, 27, 27, 0.06);
}

html[data-theme="dark"] .style-preview-reply {
  color: #e4e4e7;
}

html[data-theme="dark"] .style-preview-reply code {
  background: rgba(255, 255, 255, 0.1);
}

.style-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.style-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.14);
  background: transparent;
  color: #525252;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.style-reset-btn:hover {
  background: rgba(27, 27, 27, 0.05);
  color: #111111;
}

.style-reset-btn:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

html[data-theme="dark"] .style-reset-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: #a3a3a3;
}

html[data-theme="dark"] .style-reset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.style-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  min-height: 38px;
  border-radius: 9999px;
  border: none;
  background: #0D72CB;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.12s ease;
}

.style-save-btn:hover {
  background: #0b61ad;
}

.style-save-btn:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

html[data-theme="dark"] .style-save-btn {
  background: #3b82f6;
}

html[data-theme="dark"] .style-save-btn:hover {
  background: #2563eb;
}

.pi-row-summary {
  font-size: 13px;
  color: #737373;
}

html[data-theme="dark"] .pi-row-summary {
  color: #9ca3af;
}

@media (max-width: 640px) {
  .style-preset-grid {
    grid-template-columns: 1fr;
  }

  .style-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
  }

  .style-segmented {
    width: 100%;
  }

  .style-seg-btn {
    flex: 1;
    min-height: 44px;
    padding: 8px 6px;
    text-align: center;
  }

  .style-reset-btn,
  .style-save-btn,
  .style-chip {
    min-height: 44px;
  }
}

.composer-cap-pill.is-research.is-active {
  background: rgba(29, 78, 216, 0.09);
  border-color: rgba(29, 78, 216, 0.25);
  color: #1d4ed8;
}

[data-theme="dark"] .composer-cap-pill.is-research.is-active {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
}

/* Seamless full-width Dynamic Island when a teammate joins */
@keyframes joinIslandReveal {
  0% {
    opacity: 0;
    transform: translateX(-6px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.header-share-capsule {
  transition:
    background-color 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-share-capsule.is-joining-island {
  background: #0D72CB !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 6px 20px rgba(13, 114, 203, 0.28) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .header-share-capsule.is-joining-island {
  background: #2563eb !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.36) !important;
}

.header-share-capsule.is-joining-island .thread-share-btn {
  color: #ffffff !important;
}

.header-share-capsule.is-joining-island .thread-share-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

.header-share-capsule.is-joining-island .share-join-island-shell {
  padding: 0 2px 0 0;
}

.header-share-capsule.is-joining-island .share-join-island-btn {
  background: transparent !important;
  color: #ffffff !important;
  padding: 2px 6px 2px 2px;
  animation: joinIslandReveal 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.header-share-capsule.is-joining-island .share-join-island-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

/* Export Chat section inside Share Modal */
.share-export-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(27, 27, 27, 0.08);
}

[data-theme="dark"] .share-export-section {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.share-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-export-label {
  font-size: 12px;
  font-weight: 500;
  color: #525252;
}

[data-theme="dark"] .share-export-label {
  color: #a3a3a3;
}

.share-export-status {
  font-size: 11.5px;
  font-weight: 500;
  color: #0D72CB;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.share-export-status.is-visible {
  opacity: 1;
}

[data-theme="dark"] .share-export-status {
  color: #60a5fa;
}

.share-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.share-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 9999px;
  border: 0.5px solid rgba(27, 27, 27, 0.12);
  background: rgba(27, 27, 27, 0.035);
  color: #171717;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.share-export-btn:hover {
  background: rgba(27, 27, 27, 0.08);
}

.share-export-btn:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

.share-export-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

[data-theme="dark"] .share-export-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f4f4f5;
}

[data-theme="dark"] .share-export-btn:hover {
  background: rgba(255, 255, 255, 0.13);
}

@media (max-width: 640px) {
  .share-export-btn {
    min-height: 44px;
  }
}

/* Import from another AI page */
.import-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 20px;
  border-radius: 16px;
  border: 1.5px dashed rgba(27, 27, 27, 0.18);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.import-dropzone:hover,
.import-dropzone.is-dragover {
  border-color: #0D72CB;
  background: rgba(13, 114, 203, 0.04);
}

[data-theme="dark"] .import-dropzone {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .import-dropzone:hover,
[data-theme="dark"] .import-dropzone.is-dragover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.import-drop-title {
  font-size: 14px;
  font-weight: 500;
  color: #111111;
}

[data-theme="dark"] .import-drop-title {
  color: #ffffff;
}

.import-drop-sub {
  font-size: 12.5px;
  color: #737373;
}

[data-theme="dark"] .import-drop-sub {
  color: #a3a3a3;
}

.import-drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.import-check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-bottom: 0.5px solid rgba(27, 27, 27, 0.08);
  background: transparent;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.import-check-row:last-child {
  border-bottom: none;
}

.import-check-row:hover {
  background: rgba(27, 27, 27, 0.025);
}

[data-theme="dark"] .import-check-row {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .import-check-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.import-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 1.5px solid rgba(27, 27, 27, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.import-check-row.is-checked .import-checkbox {
  background: #0D72CB;
  border-color: #0D72CB;
}

[data-theme="dark"] .import-checkbox {
  border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .import-check-row.is-checked .import-checkbox {
  background: #3b82f6;
  border-color: #3b82f6;
}

.import-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.import-item-kind {
  font-size: 11.5px;
  font-weight: 500;
  color: #0D72CB;
}

[data-theme="dark"] .import-item-kind {
  color: #60a5fa;
}

@media (max-width: 640px) {
  .import-source-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   LOGIN & ONBOARDING GATE (707 Ecosystem Pattern — Light Default + Dark)
   ========================================================================= */
.login-shell {
  --login-bg: #f2f2f2;
  --login-fg: #111111;
  --login-muted: #575757;
  --login-subtle: #6b6b6b;
  --login-border: rgba(17, 17, 17, 0.28);
  --login-border-focus: #111111;
  --login-btn-bg: #111111;
  --login-btn-fg: #ffffff;
  --login-btn-hover: #262626;
  --login-pill-bg: rgba(17, 17, 17, 0.05);
  --login-pill-hover: rgba(17, 17, 17, 0.1);
  --login-pill-border: rgba(17, 17, 17, 0.16);
  --login-progress-track: rgba(17, 17, 17, 0.16);
  --login-progress-fill: #111111;
  --login-error: #be123c;
  --login-badge-bg: rgba(17, 17, 17, 0.06);
  --login-badge-border: rgba(17, 17, 17, 0.14);

  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--login-bg);
  color: var(--login-fg);
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Bottom-edge blue ambience (matching Chat page .chat-thinking-ambient) */
.login-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.985);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-ambient.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Crisp unblurred LED strip core for login loading state */
.login-ambient::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(to top,
      rgba(37, 99, 235, 0.58) 0%,
      rgba(37, 99, 235, 0.26) 18%,
      rgba(59, 130, 246, 0.08) 54%,
      transparent 100%);
}

[data-theme="dark"] .login-ambient::after {
  height: 140px;
  background: linear-gradient(to top,
      rgba(59, 130, 246, 0.78) 0%,
      rgba(37, 99, 235, 0.36) 20%,
      rgba(29, 78, 216, 0.14) 56%,
      transparent 100%);
}

.login-ambient-mist {
  position: absolute;
  inset: 0 -24px -16px -24px;
  filter: blur(36px);
  -webkit-filter: blur(36px);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.login-ambient-blob-a,
.login-ambient-blob-b,
.login-ambient-blob-veil {
  position: absolute;
  pointer-events: none;
}

.login-ambient-blob-veil {
  inset: 0;
  background:
    linear-gradient(to top,
      rgba(37, 99, 235, 0.36) 0%,
      rgba(29, 78, 216, 0.16) 8%,
      rgba(6, 33, 68, 0.06) 18%,
      transparent 30%),
    radial-gradient(ellipse 130% 26% at 50% 100%,
      rgba(6, 33, 68, 0.34) 0%,
      rgba(6, 33, 68, 0.16) 48%,
      transparent 84%);
}

.login-ambient-blob-a {
  left: 0;
  bottom: 0;
  width: 78%;
  height: 24%;
  background: radial-gradient(ellipse at 50% 100%,
      rgba(37, 99, 235, 0.54) 0%,
      rgba(21, 62, 117, 0.28) 46%,
      transparent 82%);
  animation: loginBlobDriftA 2.4s linear infinite;
}

.login-ambient-blob-b {
  left: 0;
  bottom: 0;
  width: 64%;
  height: 20%;
  background: radial-gradient(ellipse at 50% 100%,
      rgba(59, 130, 246, 0.46) 0%,
      rgba(6, 33, 68, 0.22) 50%,
      transparent 84%);
  animation: loginBlobDriftB 2.4s linear infinite;
  animation-delay: -1.2s;
}

@keyframes loginBlobDriftA {
  0% {
    transform: translate3d(-75%, 0, 0);
    opacity: 0.35;
  }

  50% {
    transform: translate3d(55%, 0, 0);
    opacity: 0.9;
  }

  100% {
    transform: translate3d(185%, 0, 0);
    opacity: 0.35;
  }
}

@keyframes loginBlobDriftB {
  0% {
    transform: translate3d(-65%, 0, 0);
    opacity: 0.4;
  }

  50% {
    transform: translate3d(70%, 0, 0);
    opacity: 0.85;
  }

  100% {
    transform: translate3d(195%, 0, 0);
    opacity: 0.4;
  }
}

[data-theme="dark"] .login-ambient-blob-veil {
  background: radial-gradient(ellipse 115% 26% at 50% 100%,
      rgba(6, 33, 68, 0.78) 0%,
      rgba(6, 33, 68, 0.38) 44%,
      transparent 88%);
}

[data-theme="dark"] .login-ambient-blob-a {
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, 0.80) 0%,
      rgba(29, 78, 216, 0.48) 36%,
      rgba(6, 33, 68, 0.22) 64%,
      transparent 90%);
}

[data-theme="dark"] .login-ambient-blob-b {
  background: radial-gradient(ellipse at center,
      rgba(96, 165, 250, 0.64) 0%,
      rgba(37, 99, 235, 0.36) 38%,
      rgba(6, 33, 68, 0.16) 66%,
      transparent 92%);
}

@media (prefers-reduced-motion: reduce) {

  .login-ambient-blob-a,
  .login-ambient-blob-b,
  .login-intro-overlay * {
    animation: none !important;
  }
}

/* =========================================================================
   PRE-LOGIN CINEMATIC OPENING ANIMATION (Light Default + Dark Preset)
   ========================================================================= */
.login-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #F2F2F2;
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.65s ease;
}

.login-intro-overlay[data-intro-theme="dark"] {
  background: #000000;
  color: #ffffff;
}

.login-intro-overlay.is-exiting {
  opacity: 0;
  pointer-events: none;
}

.login-intro-overlay[hidden] {
  display: none !important;
}

/* Center-stage blue aura during first copy ("Your workspace, reimagined.") */
.login-intro-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: blur(96px);
  -webkit-filter: blur(96px);
  opacity: 0;
  animation: introAuraCycle 2.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-intro-aura-a {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 58%;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, 0.22) 0%,
      rgba(96, 165, 250, 0.15) 36%,
      rgba(191, 219, 254, 0.10) 60%,
      transparent 80%);
  animation: introAuraMorph 1.8s ease-in-out infinite;
}

.login-intro-aura-b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68%;
  height: 48%;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(ellipse at center,
      rgba(59, 130, 246, 0.18) 0%,
      rgba(147, 197, 253, 0.12) 40%,
      transparent 78%);
  animation: introAuraBreathB 2.2s ease-in-out infinite;
}

[data-intro-theme="dark"] .login-intro-aura-a {
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, 0.42) 0%,
      rgba(29, 78, 216, 0.24) 32%,
      rgba(6, 33, 68, 0.09) 56%,
      transparent 78%);
  background: radial-gradient(ellipse at center in oklab,
      oklch(55.0% 0.195 258 / 0.42) 0%,
      oklch(46.0% 0.175 258 / 0.24) 32%,
      oklch(25.2% 0.088 256 / 0.09) 56%,
      transparent 78%);
}

[data-intro-theme="dark"] .login-intro-aura-b {
  background: radial-gradient(ellipse at center,
      rgba(96, 165, 250, 0.30) 0%,
      rgba(37, 99, 235, 0.16) 36%,
      transparent 76%);
  background: radial-gradient(ellipse at center in oklab,
      oklch(70.5% 0.155 254 / 0.30) 0%,
      oklch(55.0% 0.195 258 / 0.16) 36%,
      transparent 76%);
}

@keyframes introAuraCycle {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }

  18% {
    opacity: 1;
    transform: scale(1);
  }

  78% {
    opacity: 0.95;
    transform: scale(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes introAuraMorph {

  0%,
  100% {
    border-radius: 38% 62% 71% 29% / 52% 34% 66% 48%;
    transform: translate3d(-54%, -52%, 0) rotate(-14deg) scale(0.88, 0.84);
    opacity: 0.65;
  }

  50% {
    border-radius: 64% 36% 44% 56% / 38% 68% 32% 62%;
    transform: translate3d(-46%, -48%, 0) rotate(10deg) scale(1.16, 1.06);
    opacity: 1;
  }
}

@keyframes introAuraBreathB {

  0%,
  100% {
    transform: translate3d(-46%, -46%, 0) scale(1.12);
    opacity: 0.95;
  }

  50% {
    transform: translate3d(-54%, -54%, 0) scale(0.84);
    opacity: 0.55;
  }
}

/* Bottom-edge blue loading state during "Let's get you inside." */
.login-intro-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
  opacity: 0;
  animation: introGlowCycle 2.75s cubic-bezier(0.22, 1, 0.36, 1) 5.70s forwards;
}

/* Rich Architectural Blue Ambience Backlight (radiates behind 707 LABS, recedes to pure black) */
.login-intro-blue-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  animation: introBlueStageCycle 2.90s cubic-bezier(0.22, 1, 0.36, 1) 2.75s forwards;
}

.login-intro-blue-orb-a,
.login-intro-blue-orb-b {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  filter: blur(78px);
  -webkit-filter: blur(78px);
}

.login-intro-blue-orb-a {
  width: min(62vw, 680px);
  height: min(46vh, 420px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, 0.26) 0%,
      rgba(21, 56, 128, 0.18) 38%,
      rgba(8, 22, 52, 0.08) 66%,
      transparent 88%);
  animation: introBlueDriftA 2.90s ease-in-out 2.75s forwards;
}

.login-intro-blue-orb-b {
  width: min(44vw, 460px);
  height: min(34vh, 300px);
  left: 52%;
  top: 48%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
      rgba(59, 130, 246, 0.16) 0%,
      rgba(15, 38, 86, 0.10) 48%,
      transparent 82%);
  animation: introBlueDriftB 2.90s ease-in-out 2.75s forwards;
}

@keyframes introBlueStageCycle {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  74% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
  }
}

@keyframes introBlueDriftA {
  0% {
    transform: translate(-50%, -50%) scale(0.55);
  }

  35% {
    transform: translate(-48%, -52%) scale(1.12);
  }

  100% {
    transform: translate(-52%, -48%) scale(0.92);
  }
}

@keyframes introBlueDriftB {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
  }

  45% {
    transform: translate(-56%, -44%) scale(1.18);
  }

  100% {
    transform: translate(-46%, -54%) scale(0.88);
  }
}

.login-intro-glow .login-ambient-blob-veil,
.login-intro-glow .login-ambient-blob-a,
.login-intro-glow .login-ambient-blob-b {
  filter: blur(36px);
  -webkit-filter: blur(36px);
}

.login-intro-glow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(to top,
      rgba(37, 99, 235, 0.58) 0%,
      rgba(37, 99, 235, 0.26) 18%,
      rgba(59, 130, 246, 0.08) 54%,
      transparent 100%);
}

[data-intro-theme="dark"] .login-intro-glow::after {
  height: 140px;
  background: linear-gradient(to top,
      rgba(59, 130, 246, 0.78) 0%,
      rgba(37, 99, 235, 0.36) 20%,
      rgba(29, 78, 216, 0.14) 56%,
      transparent 100%);
}

.login-intro-glow .login-ambient-blob-veil {
  background: radial-gradient(ellipse 115% 22% at 50% 100%,
      rgba(6, 33, 68, 0.24) 0%,
      rgba(6, 33, 68, 0.12) 48%,
      transparent 82%);
  background: radial-gradient(ellipse 115% 22% at 50% 100% in oklab,
      oklch(25.2% 0.088 256 / 0.24) 0%,
      oklch(25.2% 0.088 256 / 0.12) 48%,
      transparent 82%);
}

.login-intro-glow .login-ambient-blob-a {
  background: radial-gradient(ellipse at center,
      rgba(6, 33, 68, 0.36) 0%,
      rgba(21, 62, 117, 0.20) 46%,
      transparent 80%);
  background: radial-gradient(ellipse at center in oklab,
      oklch(25.2% 0.088 256 / 0.36) 0%,
      oklch(37.5% 0.105 256 / 0.20) 46%,
      transparent 80%);
}

.login-intro-glow .login-ambient-blob-b {
  background: radial-gradient(ellipse at center,
      rgba(29, 78, 137, 0.30) 0%,
      rgba(6, 33, 68, 0.16) 50%,
      transparent 82%);
  background: radial-gradient(ellipse at center in oklab,
      oklch(42.5% 0.112 256 / 0.30) 0%,
      oklch(25.2% 0.088 256 / 0.16) 50%,
      transparent 82%);
}

[data-intro-theme="dark"] .login-intro-glow .login-ambient-blob-veil {
  background: radial-gradient(ellipse 115% 26% at 50% 100%,
      rgba(6, 33, 68, 0.80) 0%,
      rgba(6, 33, 68, 0.40) 44%,
      transparent 88%);
}

[data-intro-theme="dark"] .login-intro-glow .login-ambient-blob-a {
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, 0.82) 0%,
      rgba(29, 78, 216, 0.50) 36%,
      rgba(6, 33, 68, 0.22) 64%,
      transparent 90%);
}

[data-intro-theme="dark"] .login-intro-glow .login-ambient-blob-b {
  background: radial-gradient(ellipse at center,
      rgba(96, 165, 250, 0.66) 0%,
      rgba(37, 99, 235, 0.38) 38%,
      rgba(6, 33, 68, 0.18) 66%,
      transparent 92%);
}

@keyframes introGlowCycle {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  72% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
  }
}

.login-intro-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 24px;
  min-height: 200px;
}

/* Code-Typewriter Opening Stage (Black + Architectural Blue Frosted Glass, 80% Screen Ratio) */
.login-intro-code-stage {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(80vw, 1180px);
  padding: 28px 0;
  transition:
    width 0.48s cubic-bezier(0.76, 0, 0.24, 1),
    gap 0.48s cubic-bezier(0.76, 0, 0.24, 1),
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.28s ease;
}

/* Closing beat: brackets [ ] glide inward to center, wiping the text cleanly */
.login-intro-code-stage.is-closing {
  width: 60px;
  gap: 0;
}

.login-intro-code-stage.is-closing .login-intro-phrase {
  overflow: hidden;
  min-width: 0;
  opacity: 0;
  transition: opacity 0.36s cubic-bezier(0.76, 0, 0.24, 1);
}

.login-intro-code-stage.is-closing .login-intro-bracket {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 32px rgba(59, 130, 246, 0.55);
}

.login-intro-code-stage.is-exiting {
  opacity: 0;
  transform: scale(0.84);
  filter: blur(8px);
}

.login-intro-phrase {
  position: relative;
  flex: 1;
  margin: 0;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro", system-ui, sans-serif;
  font-size: clamp(36px, 6.2vw, 88px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.032em;
  color: #f4f4f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transform-origin: center center;
  will-change: transform;
  transform: scale(2.65);
  animation: introCodeCameraPull 1.80s cubic-bezier(0.22, 1, 0.36, 1) 0.14s forwards;
}

@keyframes introCodeCameraPull {
  0% {
    transform: scale(2.65);
  }

  22% {
    transform: scale(2.25);
  }

  78% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(0.95);
  }
}

.login-intro-typed {
  display: inline-flex;
  align-items: baseline;
  background: linear-gradient(180deg, #ffffff 0%, #e4e4e7 72%, #bfdbfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.login-intro-typed em {
  font-family: inherit;
  font-style: italic;
  font-weight: 500;
}

.login-intro-char {
  display: inline-block;
  white-space: pre;
  animation: introCharIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes introCharIn {
  0% {
    opacity: 0;
    transform: translate3d(4px, 0, 0) scale(0.96);
    filter: blur(3px);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

/* Frosted Glass Caret with Surrounding Architectural Blue Bloom */
.login-intro-caret {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 1.16em;
  margin-left: 6px;
  border-radius: 3px;
  flex-shrink: 0;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(191, 219, 254, 0.36) 48%,
      rgba(37, 99, 235, 0.52) 100%);
  border: 0.75px solid rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 22px 6px rgba(59, 130, 246, 0.62),
    0 0 56px 16px rgba(37, 99, 235, 0.38);
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.login-intro-caret::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  pointer-events: none;
  background: radial-gradient(circle,
      rgba(191, 219, 254, 0.48) 0%,
      rgba(37, 99, 235, 0.28) 38%,
      transparent 72%);
  filter: blur(12px);
}

.login-intro-code-stage.is-framed .login-intro-caret {
  opacity: 0;
  transform: scaleY(0.5);
}

/* Frosted Glass Brackets [ ] refracting Black + Architectural Blue Ambience */
.login-intro-bracket {
  position: relative;
  width: 30px;
  height: clamp(130px, 26vh, 240px);
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(191, 219, 254, 0.18) 0%,
      rgba(37, 99, 235, 0.08) 50%,
      rgba(147, 197, 253, 0.20) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 0 28px rgba(37, 99, 235, 0.34);
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-intro-bracket.is-left {
  border-top: 5px solid rgba(191, 219, 254, 0.56);
  border-bottom: 5px solid rgba(191, 219, 254, 0.56);
  border-left: 5px solid rgba(255, 255, 255, 0.62);
  border-radius: 6px 0 0 6px;
  transform: translateX(36px) scaleY(0.72);
}

.login-intro-bracket.is-right {
  border-top: 5px solid rgba(191, 219, 254, 0.56);
  border-bottom: 5px solid rgba(191, 219, 254, 0.56);
  border-right: 5px solid rgba(255, 255, 255, 0.62);
  border-radius: 0 6px 6px 0;
  transform: translateX(-36px) scaleY(0.72);
}

.login-intro-code-stage.is-framed .login-intro-bracket {
  opacity: 1;
  transform: translateX(0) scaleY(1);
}

@media (max-width: 560px) {
  .login-intro-code-stage {
    width: 90vw;
    gap: 10px;
    padding: 14px 0;
  }

  .login-intro-code-stage.is-closing {
    width: 28px;
    gap: 0;
  }

  .login-intro-phrase {
    font-size: clamp(22px, 6.2vw, 28px);
  }

  .login-intro-bracket {
    width: 14px;
    height: 76px;
  }
}

/* 707 LABS Choreographed Reveal (707 center pop -> glide left -> L A B S unfold, backlit by blue ambience) */
.login-intro-logo-wrap {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: introLogoWrapperLife 2.80s cubic-bezier(0.22, 1, 0.36, 1) 2.80s forwards;
}

@keyframes introLogoWrapperLife {
  0% {
    opacity: 0;
    transform: scale(0.84);
    filter: blur(8px);
  }

  16% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }

  84% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(8px);
  }
}

.login-intro-logo-stage {
  position: relative;
  height: 36px;
  aspect-ratio: 252.6 / 52;
  display: block;
}

.intro-mark-707 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  clip-path: inset(0 36.4% 0 0);
  transform: translateX(17.8%) scale(0.76);
  transform-origin: 32% 50%;
  animation: introMark707Choreo 1.35s cubic-bezier(0.22, 1, 0.36, 1) 2.80s forwards;
}

[data-intro-theme="dark"] .intro-mark-707 {
  filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(255, 255, 255, 0.24));
  opacity: 0.92;
}

@keyframes introMark707Choreo {
  0% {
    transform: translateX(17.8%) scale(0.72);
    opacity: 0;
  }

  28% {
    transform: translateX(17.8%) scale(1.04);
    opacity: 1;
  }

  46% {
    transform: translateX(17.8%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateX(0%) scale(1);
    opacity: 1;
  }
}

.intro-labs-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.intro-labs-glyph {
  fill: #ffffff;
  stroke: #ffffff;
  stroke-width: 0.9;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0;
  transform: translateX(-22px) scale(0.86);
  transform-box: fill-box;
  transform-origin: center center;
  animation: introLabsGlyphOut 0.56s cubic-bezier(0.22, 1, 0.36, 1) calc(3.48s + var(--g-i, 0) * 80ms) forwards;
}

@keyframes introLabsGlyphOut {
  0% {
    opacity: 0;
    transform: translateX(-22px) scale(0.86);
    filter: blur(5px);
  }

  100% {
    opacity: 0.92;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

/* Static top-rim monochrome crystal glass highlight on the 707 LABS logo strokes */
.login-intro-logo-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: url('./707-labs-logo.svg');
  mask-image: url('./707-labs-logo.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 255, 255, 0.40) 40%,
      rgba(255, 255, 255, 0.08) 74%,
      rgba(255, 255, 255, 0.30) 100%);
  animation: introLogoRimIn 0.45s ease 3.90s forwards;
}

@keyframes introLogoRimIn {
  to {
    opacity: 1;
  }
}

/* Pure white/silver Apple Glass Light Sweep masked strictly to the 707 LABS logo vector */
.login-intro-logo-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: url('./707-labs-logo.svg');
  mask-image: url('./707-labs-logo.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background: linear-gradient(112deg,
      transparent 26%,
      rgba(255, 255, 255, 0.20) 39%,
      rgba(255, 255, 255, 1) 50%,
      rgba(255, 255, 255, 0.24) 61%,
      transparent 74%);
  background-size: 280% 100%;
  background-position: 145% 0;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.42));
  animation: introLogoSpecularSweep 1.35s cubic-bezier(0.4, 0, 0.2, 1) 3.95s forwards;
}

@keyframes introLogoSpecularSweep {
  0% {
    background-position: 145% 0;
    opacity: 0;
  }

  14% {
    opacity: 1;
  }

  84% {
    opacity: 1;
  }

  100% {
    background-position: -45% 0;
    opacity: 0;
  }
}

.login-intro-handoff {
  position: absolute;
  margin: 0;
  text-align: center;
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: inherit;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.24em;
  animation: introHandoffShift 2.65s cubic-bezier(0.22, 1, 0.36, 1) 5.75s forwards;
}

.login-intro-handoff-word {
  display: inline-block;
  opacity: 0;
  animation: introHandoffWordIn 0.82s cubic-bezier(0.22, 1, 0.36, 1) calc(5.75s + var(--hw-i, 0) * 280ms) forwards;
}

@keyframes introHandoffWordIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.96);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes introHandoffShift {

  0%,
  72% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(0, -26px, 0) scale(0.88);
  }
}

.login-card.is-intro-reveal {
  animation: loginCardSettle 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loginCardSettle {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.99);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.login-step-leaving {
  opacity: 0 !important;
  transform: translate3d(0, -10px, 0) scale(0.985) !important;
  filter: blur(4px);
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.4, 0, 1, 1), transform 0.24s cubic-bezier(0.4, 0, 1, 1), filter 0.24s ease;
}

.login-step-entering {
  animation: loginStepEnter 0.44s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginStepEnter {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.985);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

.login-choice-pill.is-cascading {
  opacity: 0;
  animation: loginPillCascade 0.36s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--p-i, 0) * 35ms) forwards;
}

@keyframes loginPillCascade {
  0% {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 640px) {
  .login-intro-phrase {
    max-width: 88vw;
    font-size: clamp(34px, 11vw, 52px);
  }
}

.login-intro-preset-bar {
  position: fixed;
  top: 56px;
  right: 20px;
  z-index: 220;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 9999px;
  background: rgba(17, 17, 17, 0.08);
  border: 0.5px solid rgba(17, 17, 17, 0.14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.login-intro-preset-bar[hidden] {
  display: none !important;
}

.login-intro-overlay[data-intro-theme="dark"]~.login-intro-preset-bar,
html[data-theme="dark"] .login-intro-preset-bar {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.login-intro-preset-btn {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.72;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.login-intro-preset-btn.is-active {
  background: #111111;
  color: #ffffff;
  opacity: 1;
}

.login-intro-overlay[data-intro-theme="dark"]~.login-intro-preset-bar .login-intro-preset-btn,
html[data-theme="dark"] .login-intro-preset-bar .login-intro-preset-btn {
  color: #ffffff;
}

.login-intro-overlay[data-intro-theme="dark"]~.login-intro-preset-bar .login-intro-preset-btn.is-active,
html[data-theme="dark"] .login-intro-preset-bar .login-intro-preset-btn.is-active {
  background: #ffffff;
  color: #000000;
}

@keyframes introLogoCycle {
  0% {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(8px);
  }

  22% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }

  78% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: scale(1.03);
    filter: blur(6px);
  }
}

.login-shell [hidden] {
  display: none !important;
}

[data-theme="dark"] .login-shell {
  --login-bg: #000000;
  --login-fg: #ffffff;
  --login-muted: rgba(255, 255, 255, 0.68);
  --login-subtle: rgba(255, 255, 255, 0.56);
  --login-border: rgba(255, 255, 255, 0.36);
  --login-border-focus: #ffffff;
  --login-btn-bg: #ffffff;
  --login-btn-fg: #000000;
  --login-btn-hover: #e5e5e5;
  --login-pill-bg: rgba(255, 255, 255, 0.1);
  --login-pill-hover: rgba(255, 255, 255, 0.18);
  --login-pill-border: rgba(255, 255, 255, 0.22);
  --login-progress-track: rgba(255, 255, 255, 0.30);
  --login-progress-fill: #ffffff;
  --login-error: #fda4af;
  --login-badge-bg: rgba(255, 255, 255, 0.1);
  --login-badge-border: rgba(255, 255, 255, 0.2);

  background-image: none;
}

.login-header {
  width: 100%;
  height: 48px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.login-header-center {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-header-onboarding {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.login-logo-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.login-logo-btn:hover {
  opacity: 0.78;
}

.login-logo-btn img {
  height: 18px;
  width: auto;
  display: block;
}

[data-theme="dark"] .login-logo-btn img {
  filter: brightness(0) invert(1);
}

.login-beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--login-badge-bg);
  border: 0.5px solid var(--login-badge-border);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--login-fg);
  line-height: 1.2;
}

.login-progress-track {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  width: 180px;
  pointer-events: none;
}

.login-progress-seg {
  position: relative;
  overflow: hidden;
  height: 2px;
  flex: 1;
  border-radius: 9999px;
  background: var(--login-progress-track);
}

.login-progress-seg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--login-progress-fill);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-progress-seg.is-filled::after {
  transform: scaleX(1);
}

.login-step-counter {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--login-muted);
}

.login-main {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: auto 0;
}

.login-heading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 6px;
}

.login-title {
  margin: 0;
  font-size: 34px;
  line-height: 40px;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--login-fg);
}

.login-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--login-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-field-wrap {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

.login-input-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.login-floating-input {
  box-sizing: border-box;
  appearance: none;
  margin: 0;
  outline: none;
  width: 100%;
  height: 44px;
  border-radius: 0;
  background: transparent;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 400;
  color: var(--login-fg);
  border: 0.5px solid var(--login-border);
  transition: border-color 0.15s ease;
}

.login-floating-input.has-toggle {
  padding-right: 44px;
}

.login-floating-input:focus {
  border: 1px solid var(--login-border-focus);
  box-shadow: none;
}

.login-floating-label {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 400;
  color: var(--login-muted);
  pointer-events: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
}

.login-floating-input:focus~.login-floating-label,
.login-floating-input:not(:placeholder-shown)~.login-floating-label {
  top: -21px;
  left: 0;
  transform: translateY(0);
  font-size: 13px;
  color: var(--login-fg);
}

.login-floating-input.is-error {
  color: var(--login-error);
  border-color: var(--login-error);
}

.login-floating-input.is-error:focus {
  box-shadow: 0 0 0 1px var(--login-error);
}

.login-floating-input.is-error~.login-floating-label {
  color: var(--login-error);
}

.login-eye-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--login-muted);
  cursor: pointer;
  border-radius: 6px;
}

.login-eye-btn:hover {
  color: var(--login-fg);
}

.login-eye-btn:focus-visible,
.login-primary-btn:focus-visible,
.login-pill-btn:focus-visible,
.login-choice-pill:focus-visible,
.login-text-btn:focus-visible,
.login-meta-btn:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

.login-error-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--login-error);
  text-align: left;
}

.login-primary-btn {
  width: 100%;
  height: 46px;
  border-radius: 9999px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
  font-family: var(--font-apple-ui);
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 18px rgba(17, 17, 17, 0.14);
  transition: background-color 0.16s ease, box-shadow 0.16s ease, opacity 0.15s ease, transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .login-primary-btn {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(0, 0, 0, 0.45);
}

.login-primary-btn:hover:not(:disabled) {
  background: var(--login-btn-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 22px rgba(17, 17, 17, 0.18);
}

.login-primary-btn:active:not(:disabled) {
  transform: scale(0.975);
}

.login-primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-spinner {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: loginSpin 0.7s linear infinite;
}

[data-theme="dark"] .login-spinner {
  border-color: rgba(0, 0, 0, 0.25);
  border-top-color: #000000;
}

@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

.login-helper-hint {
  margin: 0;
  font-size: 12px;
  color: var(--login-subtle);
  text-align: center;
  line-height: 1.5;
}

.login-text-btn {
  background: transparent;
  border: none;
  padding: 6px 8px;
  min-height: 32px;
  font-size: 12px;
  color: var(--login-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.login-text-btn:hover {
  color: var(--login-fg);
}

.login-terms {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--login-subtle);
  text-align: center;
  line-height: 1.5;
}

/* Onboarding Full-Height Step Layout */
.login-onboard-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  min-height: 380px;
  margin: auto 0;
}

.login-onboard-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: center;
  margin: auto 0;
}

.login-onboard-label {
  font-size: 13.5px;
  color: var(--login-muted);
}

.login-big-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--login-border);
  transition: border-color 0.15s ease;
}

.login-big-input-wrap:focus-within {
  border-bottom: 1px solid var(--login-border-focus);
}

.login-big-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--login-fg);
  padding: 8px 48px;
}

.login-big-input::placeholder {
  color: var(--login-progress-track);
}

.login-enter-hint {
  margin: 0;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  color: var(--login-subtle);
}

.login-pill-btn {
  padding: 0 48px;
  height: 46px;
  border-radius: 9999px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
  font-family: var(--font-apple-ui);
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 18px rgba(17, 17, 17, 0.14);
  transition: background-color 0.16s ease, box-shadow 0.16s ease, opacity 0.15s ease, transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .login-pill-btn {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(0, 0, 0, 0.45);
}

.login-pill-btn:hover:not(:disabled) {
  background: var(--login-btn-hover);
}

.login-pill-btn:active:not(:disabled) {
  transform: scale(0.975);
}

.login-pill-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-onboard-title {
  margin: 0;
  font-size: 34px;
  line-height: 40px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.login-onboard-title strong {
  font-weight: 500;
  color: var(--login-fg);
}

.login-onboard-title span {
  color: var(--login-muted);
}

.login-choice-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 440px;
}

.login-choice-pill {
  padding: 10px 20px;
  min-height: 40px;
  border-radius: 9999px;
  background: var(--login-pill-bg);
  border: 0.5px solid var(--login-pill-border);
  color: var(--login-fg);
  font-family: var(--font-apple-ui);
  font-size: 13px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-choice-pill:hover {
  background: var(--login-pill-hover);
  border-color: var(--login-border-focus);
}

.login-choice-pill:active {
  transform: scale(0.975);
}

.login-choice-pill.is-selected {
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
  border-color: var(--login-btn-bg);
  font-weight: var(--font-weight-max, 500);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 4px 12px rgba(17, 17, 17, 0.16);
}

/* Success Gate */
.login-success-badge {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 0.5px solid var(--login-border);
  background: var(--login-pill-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-check-path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: loginDrawCheck 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.15s;
}

@keyframes loginDrawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.login-footer {
  width: 100%;
  height: 48px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.login-footer-brand {
  font-size: 11px;
  color: var(--login-subtle);
}

.login-footer-controls {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-meta-btn {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--login-pill-bg);
  border: 0.5px solid var(--login-pill-border);
  color: var(--login-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.login-meta-btn:hover,
.login-meta-btn.is-active {
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
  border-color: var(--login-btn-bg);
}

.login-toast {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 9px 16px;
  border-radius: 9999px;
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.login-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .login-title {
    font-size: 30px;
    line-height: 36px;
  }

  .login-onboard-title {
    font-size: 28px;
    line-height: 34px;
  }

  .login-big-input {
    font-size: 34px;
    padding: 8px 40px;
  }

  .login-progress-track {
    width: 130px;
  }

  .login-primary-btn,
  .login-floating-input,
  .login-pill-btn,
  .login-choice-pill,
  .login-eye-btn,
  .login-meta-btn {
    min-height: 44px;
  }

  .login-footer {
    justify-content: center;
  }

  .login-footer-controls {
    right: 16px;
  }
}

/* =========================================================================
   GEMINI-STYLE FIRST-RUN MODALS (Opsi A: Internal Notice / Opsi B: Permissions)
   ========================================================================= */
.gate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.38);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gate-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gate-modal-card {
  width: 100%;
  max-width: 520px;
  border-radius: 24px;
  background: #ffffff;
  color: #111111;
  border: 0.5px solid rgba(17, 17, 17, 0.12);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.18), 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.gate-modal-overlay.is-open .gate-modal-card {
  transform: translateY(0) scale(1);
}

[data-theme="dark"] .gate-modal-card {
  background: #1a1a1c;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 64px -12px rgba(0, 0, 0, 0.65);
}

.gate-modal-mark {
  height: 22px;
  width: auto;
  display: block;
  margin-bottom: 2px;
}

[data-theme="dark"] .gate-modal-mark {
  filter: brightness(0) invert(1);
}

.gate-modal-title {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: inherit;
}

.gate-modal-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #555555;
  max-width: 390px;
}

[data-theme="dark"] .gate-modal-sub {
  color: #b3b3b8;
}

.gate-accordion-list {
  width: 100%;
  border-radius: 14px;
  background: #f5f5f7;
  border: 0.5px solid rgba(17, 17, 17, 0.08);
  overflow: hidden;
  text-align: left;
  margin-top: 4px;
}

[data-theme="dark"] .gate-accordion-list {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.gate-accordion-item+.gate-accordion-item {
  border-top: 0.5px solid rgba(17, 17, 17, 0.09);
}

[data-theme="dark"] .gate-accordion-item+.gate-accordion-item {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.gate-accordion-btn {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.gate-accordion-btn:hover {
  background: rgba(17, 17, 17, 0.035);
}

[data-theme="dark"] .gate-accordion-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gate-accordion-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #666666;
  transition: transform 0.18s ease;
}

[data-theme="dark"] .gate-accordion-chevron {
  color: #a1a1aa;
}

.gate-accordion-item.is-expanded .gate-accordion-chevron {
  transform: rotate(90deg);
}

.gate-accordion-body {
  padding: 0 14px 12px 38px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #555555;
  display: none;
}

[data-theme="dark"] .gate-accordion-body {
  color: #b3b3b8;
}

.gate-accordion-item.is-expanded .gate-accordion-body {
  display: block;
}

.gate-perm-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-top: 4px;
}

.gate-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f5f7;
  border: 0.5px solid rgba(17, 17, 17, 0.08);
}

[data-theme="dark"] .gate-perm-row {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.gate-perm-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.gate-perm-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #0D72CB;
}

[data-theme="dark"] .gate-perm-icon {
  color: #60a5fa;
}

.gate-perm-title {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  line-height: 1.3;
}

.gate-perm-desc {
  font-size: 12px;
  color: #555555;
  line-height: 1.4;
  margin-top: 2px;
}

[data-theme="dark"] .gate-perm-desc {
  color: #a1a1aa;
}

.gate-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(17, 17, 17, 0.22);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.18s ease;
}

[data-theme="dark"] .gate-switch {
  background: rgba(255, 255, 255, 0.24);
}

.gate-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.gate-switch.is-on {
  background: #2563eb;
}

.gate-switch:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.gate-btn-primary:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  pointer-events: none;
}

.gate-perm-req-hint {
  margin: 0;
  font-size: 11.5px;
  color: #71717a;
  text-align: center;
}

html[data-theme="dark"] .gate-perm-req-hint {
  color: #a1a1aa;
}

.gate-theme-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 9999px;
  background: rgba(17, 17, 17, 0.08);
  flex-shrink: 0;
}

html[data-theme="dark"] .gate-theme-seg {
  background: rgba(255, 255, 255, 0.10);
}

.gate-theme-opt {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #52525b;
  font-family: var(--font-apple-ui);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.gate-theme-opt.is-active {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .gate-theme-opt {
  color: #a1a1aa;
}

html[data-theme="dark"] .gate-theme-opt.is-active {
  background: #2c2c2e;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.36);
}

.gate-switch.is-on::after {
  transform: translateX(18px);
}

.gate-diag-check {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 12.5px;
  color: #444444;
  cursor: pointer;
  padding: 6px 2px 0;
}

[data-theme="dark"] .gate-diag-check {
  color: #c4c4c9;
}

.gate-diag-check input {
  width: 16px;
  height: 16px;
  accent-color: #0D72CB;
  flex-shrink: 0;
}

.gate-modal-note {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #666666;
}

[data-theme="dark"] .gate-modal-note {
  color: #9ca3af;
}

.gate-modal-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.gate-btn-secondary {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9999px;
  background: transparent;
  border: 0.5px solid rgba(17, 17, 17, 0.16);
  color: #333333;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

[data-theme="dark"] .gate-btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e5e5;
}

.gate-btn-primary {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 9999px;
  background: #111111;
  border: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

[data-theme="dark"] .gate-btn-primary {
  background: #ffffff;
  color: #000000;
}

.gate-btn-primary:focus-visible,
.gate-btn-secondary:focus-visible,
.gate-accordion-btn:focus-visible,
.gate-switch:focus-visible {
  outline: 2px solid #0D72CB;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .gate-modal-card {
    padding: 22px 18px 18px;
    border-radius: 20px;
  }

  .gate-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .gate-btn-primary,
  .gate-btn-secondary {
    min-height: 44px;
    width: 100%;
  }
}

/* =========================================================================
   HEADER NOTIFICATION POPOVER (Apple Liquid Glass — Minimal)
   ========================================================================= */
.notif-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.notif-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: -6px;
  width: min(360px, calc(100vw - 24px));
  border-radius: 18px;
  border: 0.5px solid rgba(27, 27, 27, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 250, 250, 0.94) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 24px 52px -12px rgba(0, 0, 0, 0.16),
    0 6px 16px -4px rgba(0, 0, 0, 0.06);
  padding: 10px;
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

html[data-theme="dark"] .notif-popover {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.96) 0%, rgba(20, 20, 22, 0.96) 100%);
  box-shadow: 0 28px 60px -12px rgba(0, 0, 0, 0.72);
}

.notif-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 8px;
}

.notif-popover-title {
  font-size: 13px;
  font-weight: 500;
  color: #111111;
  white-space: nowrap;
  flex-shrink: 0;
}

html[data-theme="dark"] .notif-popover-title {
  color: #f5f5f5;
}

.notif-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.notif-filter-group {
  display: inline-flex;
  padding: 2px;
  border-radius: 9999px;
  background: rgba(17, 17, 17, 0.06);
  flex-shrink: 0;
}

html[data-theme="dark"] .notif-filter-group {
  background: rgba(255, 255, 255, 0.08);
}

.notif-filter-btn {
  min-height: 22px;
  padding: 0 9px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #666666;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.notif-filter-btn.is-active {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] .notif-filter-btn {
  color: #a1a1aa;
}

html[data-theme="dark"] .notif-filter-btn.is-active {
  background: #2c2c2e;
  color: #ffffff;
}

.notif-mark-btn {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.notif-mark-btn:hover {
  background: rgba(13, 114, 203, 0.08);
}

html[data-theme="dark"] .notif-mark-btn {
  color: #60a5fa;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 9px;
  border-radius: 12px;
  border: none;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.notif-item:hover {
  background: rgba(17, 17, 17, 0.045);
}

html[data-theme="dark"] .notif-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.notif-item[hidden] {
  display: none;
}

.notif-item-ico {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: transparent;
  color: #52525b;
  font-size: 10.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html[data-theme="dark"] .notif-item-ico {
  background: transparent;
  color: #a1a1aa;
}

.notif-item-ico.is-accent {
  background: transparent;
  color: #2563eb;
}

html[data-theme="dark"] .notif-item-ico.is-accent {
  background: transparent;
  color: #60a5fa;
}

.notif-item-ico svg {
  width: 16px;
  height: 16px;
}

/* Notification Bell Ring & Blue Pulse State (Zero layout shift, returns to default + blue dot) */
@keyframes notifBellRing {
  0% {
    transform: rotate(0deg);
  }

  12% {
    transform: rotate(-15deg);
  }

  26% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-11deg);
  }

  54% {
    transform: rotate(9deg);
  }

  68% {
    transform: rotate(-5deg);
  }

  82% {
    transform: rotate(3deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

#btn-header-notif {
  border-radius: 9999px;
  transition: background-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease, opacity 0.15s ease, transform 0.12s ease;
}

#btn-header-notif.is-notif-ringing {
  width: 30px;
  height: 30px;
  margin: -3px;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 4px 12px rgba(37, 99, 235, 0.28);
}

html[data-theme="dark"] #btn-header-notif.is-notif-ringing {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22), 0 4px 14px rgba(59, 130, 246, 0.34);
}

#btn-header-notif.is-notif-ringing svg {
  color: #ffffff;
  transform-origin: top center;
  animation: notifBellRing 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97) 2;
}

#btn-header-notif.is-notif-ringing .notif-dot-moss {
  opacity: 0;
}

.notif-dot-moss {
  background-color: #2563eb !important;
}

html[data-theme="dark"] .notif-dot-moss {
  background-color: #60a5fa !important;
}

.notif-dot-moss.is-hidden {
  opacity: 0 !important;
  transform: scale(0);
  pointer-events: none;
  animation: none !important;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notif-item-title {
  font-size: 12.5px;
  font-weight: 500;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .notif-item-title {
  color: #f5f5f5;
}

.notif-item-meta {
  font-size: 11.5px;
  color: #737373;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .notif-item-meta {
  color: #9ca3af;
}

.notif-unread-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 9999px;
  background: #0D72CB;
  flex-shrink: 0;
  opacity: 0;
}

.notif-item.is-unread .notif-unread-dot {
  opacity: 1;
}

html[data-theme="dark"] .notif-unread-dot {
  background: #60a5fa;
}

.notif-empty {
  padding: 26px 12px;
  text-align: center;
  font-size: 12.5px;
  color: #737373;
}

html[data-theme="dark"] .notif-empty {
  color: #9ca3af;
}

.notif-dot-moss.is-hidden {
  display: none;
}

/* =========================================================================
   CHAT RESULT STATES & RICH QUICK LOOK PREVIEWS (Design Token Aligned)
   ========================================================================= */
.result-card {
  margin-top: 12px;
  border-radius: 16px;
  padding: 16px 18px;
  background: #fafafa;
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

html[data-theme="dark"] .result-card {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.12);
}

.result-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-card-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #404040;
}

html[data-theme="dark"] .result-card-label {
  color: #d1d5db;
}

.result-card-label svg {
  width: 14px;
  height: 14px;
  color: #2563EB;
}

html[data-theme="dark"] .result-card-label svg {
  color: #3B82F6;
}

.result-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.10);
  color: #2563EB;
}

html[data-theme="dark"] .result-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.result-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-cite-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 9999px;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  color: #111111;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.14s ease;
}

.result-cite-pill:hover {
  border-color: #2563EB;
}

html[data-theme="dark"] .result-cite-pill {
  background: #1c1c21;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

.result-cite-num {
  color: #2563EB;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 10.5px;
}

html[data-theme="dark"] .result-cite-num {
  color: #60a5fa;
}

/* Inline Chart Result */
.result-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.result-kpi-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .result-kpi-box {
  background: #1c1c21;
  border-color: rgba(255, 255, 255, 0.10);
}

.result-kpi-val {
  font-size: 17px;
  font-weight: 500;
  color: #000000;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .result-kpi-val {
  color: #f3f4f6;
}

.result-kpi-sub {
  font-size: 11.5px;
  color: #737373;
  margin-top: 2px;
}

html[data-theme="dark"] .result-kpi-sub {
  color: #9ca3af;
}

.result-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.result-bar-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.result-bar-track {
  height: 10px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

html[data-theme="dark"] .result-bar-track {
  background: rgba(255, 255, 255, 0.09);
}

.result-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: #2563EB;
}

html[data-theme="dark"] .result-bar-fill {
  background: #3B82F6;
}

.result-bar-val {
  text-align: right;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 11.5px;
  color: #404040;
}

html[data-theme="dark"] .result-bar-val {
  color: #d1d5db;
}

/* Restricted Permission & Error Cards */
.result-alert-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-alert-card.is-error {
  border-color: rgba(190, 18, 60, 0.28);
}

html[data-theme="dark"] .result-alert-card.is-error {
  border-color: rgba(251, 113, 133, 0.34);
}

.result-alert-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.result-alert-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.06);
  color: #111111;
}

html[data-theme="dark"] .result-alert-ico {
  background: rgba(255, 255, 255, 0.09);
  color: #f3f4f6;
}

.result-alert-card.is-error .result-alert-ico {
  background: rgba(190, 18, 60, 0.10);
  color: #be123c;
}

html[data-theme="dark"] .result-alert-card.is-error .result-alert-ico {
  background: rgba(251, 113, 133, 0.16);
  color: #fda4af;
}

.result-alert-title {
  font-size: 13px;
  font-weight: 500;
  color: #111111;
}

html[data-theme="dark"] .result-alert-title {
  color: #f3f4f6;
}

.result-alert-sub {
  font-size: 12px;
  color: #52525b;
  margin-top: 2px;
}

html[data-theme="dark"] .result-alert-sub {
  color: #a1a1aa;
}

.result-alert-cta {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9999px;
  border: none;
  background: #000000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}

html[data-theme="dark"] .result-alert-cta {
  background: #ffffff;
  color: #000000;
}

/* Rich Quick Look Previews (XLSX / PPTX / PDF) */
.ql-sheet-wrap,
.ql-doc-wrap {
  border-radius: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  background: #ffffff;
  overflow: hidden;
}

html[data-theme="dark"] .ql-sheet-wrap,
html[data-theme="dark"] .ql-doc-wrap {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.12);
}

.ql-sheet-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 11.5px;
  color: #52525b;
}

html[data-theme="dark"] .ql-sheet-bar {
  background: #1c1c21;
  border-bottom-color: rgba(255, 255, 255, 0.10);
  color: #9ca3af;
}

.ql-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ql-sheet-table th,
.ql-sheet-table td {
  padding: 8px 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  text-align: left;
}

html[data-theme="dark"] .ql-sheet-table th,
html[data-theme="dark"] .ql-sheet-table td {
  border-color: rgba(255, 255, 255, 0.09);
  color: #e5e7eb;
}

.ql-sheet-table th {
  background: #fafafa;
  color: #737373;
  font-weight: 500;
  font-size: 11px;
}

html[data-theme="dark"] .ql-sheet-table th {
  background: #1a1a1f;
  color: #9ca3af;
}

.ql-slide-stage {
  border-radius: 14px;
  padding: 26px 24px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #111111 0%, #1d2433 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ql-slide-kicker {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
}

.ql-slide-h {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}

.ql-slide-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ql-slide-thumb {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  background: #f5f5f5;
  color: #404040;
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ql-slide-thumb.is-active {
  border-color: #2563EB;
  color: #2563EB;
  background: rgba(37, 99, 235, 0.08);
}

html[data-theme="dark"] .ql-slide-thumb {
  background: #1c1c21;
  border-color: rgba(255, 255, 255, 0.12);
  color: #d1d5db;
}

html[data-theme="dark"] .ql-slide-thumb.is-active {
  border-color: #3B82F6;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.16);
}

.ql-doc-wrap {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ql-doc-wrap h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.ql-doc-wrap p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #52525b;
}

html[data-theme="dark"] .ql-doc-wrap p {
  color: #d1d5db;
}

@media (max-width: 640px) {
  .result-kpi-row {
    grid-template-columns: 1fr;
  }

  .result-alert-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Document Cover Thumbnail Card (PPTX / XLSX / PDF) */
.doc-result-card {
  margin-top: 12px;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .doc-result-card {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.55);
}

.doc-cover-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .doc-cover-preview {
  background: #1a1a1f;
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

.doc-cover-slide {
  padding: 20px 20px 18px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #111111 0%, #1d2433 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doc-cover-sheet {
  padding: 14px 16px 0;
  background: #f5f5f5;
}

html[data-theme="dark"] .doc-cover-sheet {
  background: #1a1a1f;
}

.doc-cover-sheet-inner {
  border-radius: 10px 10px 0 0;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.09);
  border-bottom: none;
  overflow: hidden;
}

html[data-theme="dark"] .doc-cover-sheet-inner {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.10);
}

.doc-cover-doc {
  padding: 16px 18px 0;
  background: #f5f5f5;
}

html[data-theme="dark"] .doc-cover-doc {
  background: #1a1a1f;
}

.doc-cover-doc-page {
  border-radius: 10px 10px 0 0;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.09);
  border-bottom: none;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[data-theme="dark"] .doc-cover-doc-page {
  background: #141418;
  border-color: rgba(255, 255, 255, 0.10);
}

.doc-cover-doc-line {
  height: 7px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .doc-cover-doc-line {
  background: rgba(255, 255, 255, 0.12);
}

.doc-result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
}

/* Upgraded Compact Feedback Panel inside Profile Popover */
.feedback-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.feedback-chip {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 0.5px solid rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.04);
  color: #404040;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.feedback-chip.is-active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

html[data-theme="dark"] .feedback-chip {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #d4d4d8;
}

html[data-theme="dark"] .feedback-chip.is-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.feedback-diag-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #52525b;
  margin: 6px 0 8px;
  cursor: pointer;
}

html[data-theme="dark"] .feedback-diag-row {
  color: #a1a1aa;
}

.feedback-diag-row input {
  width: 14px;
  height: 14px;
  accent-color: #111111;
}

html[data-theme="dark"] .feedback-diag-row input {
  accent-color: #ffffff;
}

/* Login: Organization Email Gate & 6-Digit Email OTP Verification */
.login-org-gate {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 0.5px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

html[data-theme="dark"] .login-org-gate {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.08);
}

.login-org-gate-title {
  font-size: 13px;
  font-weight: 500;
  color: #b91c1c;
}

html[data-theme="dark"] .login-org-gate-title {
  color: #fca5a5;
}

.login-org-gate-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #52525b;
}

html[data-theme="dark"] .login-org-gate-desc {
  color: #a1a1aa;
}

.login-org-gate-link {
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
  align-self: flex-start;
}

.login-org-gate-link:hover {
  text-decoration: underline;
}

html[data-theme="dark"] .login-org-gate-link {
  color: #60a5fa;
}

.login-otp-head-ico {
  width: 26px;
  height: 26px;
  color: #111111;
  margin-bottom: 4px;
}

html[data-theme="dark"] .login-otp-head-ico {
  color: #f4f4f5;
}

.login-otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 336px;
  margin: 4px auto 0;
}

.login-otp-digit {
  height: 50px;
  width: 100%;
  border-radius: 12px;
  border: 0.5px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: #111111;
  font-family: var(--font-apple-ui);
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.login-otp-digit:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.login-otp-digit.is-filled {
  border-color: rgba(15, 23, 42, 0.36);
}

html[data-theme="dark"] .login-otp-digit {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

html[data-theme="dark"] .login-otp-digit:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

html[data-theme="dark"] .login-otp-digit.is-filled {
  border-color: rgba(255, 255, 255, 0.38);
}

.login-otp-hint {
  font-size: 11.5px;
  color: #71717a;
}

html[data-theme="dark"] .login-otp-hint {
  color: #a1a1aa;
}

.login-otp-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Login Top-Right Language Switch Pill (EN / ID) */
.login-lang-switch {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 9999px;
  background: var(--login-pill-bg);
  border: 0.5px solid var(--login-pill-border);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-lang-btn {
  min-width: 34px;
  height: 26px;
  padding: 0 9px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--login-muted);
  font-family: var(--font-apple-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.login-lang-btn.is-active {
  background: var(--login-btn-bg);
  color: var(--login-btn-fg);
}

.login-lang-btn:hover:not(.is-active) {
  color: var(--login-fg);
}

@media (max-width: 600px) {
  .login-lang-switch {
    right: 16px;
  }
}

@media (max-width: 440px) {
  .login-otp-row {
    gap: 6px;
  }

  .login-otp-digit {
    height: 46px;
    font-size: 18px;
  }
}

/* ==========================================================================
   Composer & Sent-Bubble Attachment Reference Numbers + Drag-to-Reorder
   ========================================================================== */
.composer-att-index-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  border: 0.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 17, 22, 0.8);
  color: #ffffff;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-apple-ui);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.composer-att-index-badge:hover {
  background: #2563eb;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.36);
  transform: scale(1.08);
}

.composer-att-index-badge:active {
  transform: scale(0.95);
}

.composer-att-index-badge:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.composer-att-index-badge.is-static {
  cursor: default;
  pointer-events: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4.5px;
  font-size: 9.5px;
}

html[data-theme="dark"] .composer-att-index-badge {
  background: rgba(12, 14, 18, 0.86);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

html[data-theme="dark"] .composer-att-index-badge:hover {
  background: #3b82f6;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

html[data-theme="dark"] .composer-att-index-badge:focus-visible {
  outline-color: #60a5fa;
}

/* Keep doc preview filename clear of top-left index badge */
.composer-att-thumb .composer-att-doc-preview,
.chat-bubble-att-thumb .composer-att-doc-preview {
  padding-top: 23px;
}

/* Drag-to-reorder affordance when >= 2 attachments */
.composer-att-thumb.is-reorderable {
  cursor: grab;
}

.composer-att-thumb.is-reorderable:active {
  cursor: grabbing;
}

.composer-att-thumb.is-att-dragging {
  opacity: 0.42;
  transform: scale(0.94);
}

.composer-att-thumb.is-reorder-before::before,
.composer-att-thumb.is-reorder-after::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2.5px;
  border-radius: 9999px;
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.45);
  pointer-events: none;
  z-index: 6;
}

.composer-att-thumb.is-reorder-before::before {
  left: -6px;
}

.composer-att-thumb.is-reorder-after::after {
  right: -6px;
}

html[data-theme="dark"] .composer-att-thumb.is-reorder-before::before,
html[data-theme="dark"] .composer-att-thumb.is-reorder-after::after {
  background: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.55);
}

@media (max-width: 600px),
(hover: none) {
  .composer-att-index-badge:not(.is-static)::after {
    content: '';
    position: absolute;
    inset: -6px;
  }
}

/* Quick Look: Uploaded Attachment Preview (Image / SVG / File) */
.ql-att-stage {
  width: 100%;
  min-height: 200px;
  max-height: min(62vh, 460px);
  border-radius: 12px;
  background: #f5f5f7;
  border: 0.5px solid rgba(27, 27, 27, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

html[data-theme="dark"] .ql-att-stage {
  background: #141416;
  border-color: rgba(255, 255, 255, 0.1);
}

.ql-att-img {
  max-width: 100%;
  max-height: min(58vh, 430px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.ql-att-svg {
  width: 100%;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ql-att-svg svg {
  max-width: 100%;
  max-height: 340px;
  width: auto;
  height: auto;
}

.ql-att-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  color: #6b7280;
}

html[data-theme="dark"] .ql-att-meta {
  color: #a1a1aa;
}

.ql-att-doc-card {
  padding: 28px 22px;
  text-align: center;
  border-radius: 12px;
  background: #f5f5f7;
  border: 0.5px solid rgba(27, 27, 27, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

html[data-theme="dark"] .ql-att-doc-card {
  background: #141416;
  border-color: rgba(255, 255, 255, 0.1);
}

.ql-att-doc-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #111111;
  color: #ffffff;
  font-family: var(--font-apple-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .ql-att-doc-ext {
  background: #f5f5f7;
  color: #111111;
}

.ql-att-doc-name {
  margin: 2px 0 0;
  font-family: var(--font-apple-ui);
  font-size: 14px;
  font-weight: 500;
  color: #111111;
  word-break: break-word;
}

html[data-theme="dark"] .ql-att-doc-name {
  color: #f5f5f7;
}

.ql-att-doc-sub {
  margin: 0;
  font-family: var(--font-apple-ui);
  font-size: 12.5px;
  color: #6b7280;
}

html[data-theme="dark"] .ql-att-doc-sub {
  color: #a1a1aa;
}



/* ==========================================================================
   707 LABS ENGINEERING-SYNC REDESIGN COMPONENTS (v2.6.0)
   Covers IT's live .tfc-* / .art-* hooks with Apple Liquid Glass fidelity:
   - Light (#F2F2F2) + Pure Black Dark (#000000)
   - SF Pro weights 350–500 (never 600/700)
   - Desktop 1440px + Mobile 390px (>= 44px touch targets)
   ========================================================================== */

/* --- 1. Composer Voice Mode Trigger & Style Shortcut --- */
.composer-voice-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #3f3f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.composer-voice-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #09090b;
}

.composer-voice-btn svg {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .composer-voice-btn {
  color: #d4d4d8;
}

html[data-theme="dark"] .composer-voice-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.popover-style-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: var(--font-weight-ui-default, 350);
  color: #71717a;
  max-width: 112px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-style-meta svg {
  width: 13px;
  height: 13px;
  flex: none;
  opacity: 0.7;
}

html[data-theme="dark"] .popover-style-meta {
  color: #a1a1aa;
}

/* --- 2. Notifications Bell Popover (.tfc-notif) --- */
.tfc-pop-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tfc-menu.tfc-notif {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 320;
  width: 332px;
  max-width: calc(100vw - 24px);
  max-height: min(72vh, 480px);
  overflow-y: auto;
  padding: 8px;
  border-radius: 22px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: var(--liquid-glass-bg, rgba(255, 255, 255, 0.94));
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--liquid-glass-shadow-lg, 0 18px 44px -10px rgba(15, 23, 42, 0.18));
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-apple-ui);
  transform-origin: top right;
  animation: tfcPopReveal 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tfc-menu.tfc-notif[hidden] {
  display: none !important;
}

@keyframes tfcPopReveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tfc-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 6px;
  font-size: 13.5px;
  color: #09090b;
}

.tfc-menu-head b {
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.012em;
}

.tfc-link {
  border: 0;
  background: transparent;
  color: #0D72CB;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tfc-link:hover {
  background: rgba(13, 114, 203, 0.10);
}

.tfc-link.is-bad {
  color: #9f2d34;
}

.tfc-link.is-bad:hover {
  background: rgba(159, 45, 52, 0.10);
}

.tfc-notice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0.5px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-apple-ui);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tfc-notice:hover {
  background: rgba(15, 23, 42, 0.045);
}

.tfc-notice.is-new {
  background: rgba(234, 243, 252, 0.85);
  border-color: rgba(13, 114, 203, 0.18);
}

.tfc-notice.is-new::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #0D72CB;
}

.tfc-notice-t {
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  padding-right: 14px;
  line-height: 1.35;
}

.tfc-notice-b {
  font-size: 12.5px;
  font-weight: var(--font-weight-ui-default, 350);
  color: #52525b;
  line-height: 1.4;
}

.tfc-notice-w {
  font-size: 11px;
  color: #71717a;
  margin-top: 2px;
}

.tfc-menu-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: #71717a;
}

html[data-theme="dark"] .tfc-menu.tfc-notif {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 23, 0.94);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75);
}

html[data-theme="dark"] .tfc-menu-head,
html[data-theme="dark"] .tfc-notice-t {
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-notice-b {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-notice-w,
html[data-theme="dark"] .tfc-menu-empty {
  color: #8e8e93;
}

html[data-theme="dark"] .tfc-notice:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .tfc-notice.is-new {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] .tfc-notice.is-new::before {
  background: #60A5FA;
}

html[data-theme="dark"] .tfc-link {
  color: #60A5FA;
}

html[data-theme="dark"] .tfc-link:hover {
  background: rgba(96, 165, 250, 0.16);
}

html[data-theme="dark"] .tfc-link.is-bad {
  color: #f87171;
}

/* --- 3. Full-Screen Voice Mode (.tfc-voice) --- */
.tfc-voice {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 20px max(28px, env(safe-area-inset-bottom));
  background: rgba(242, 242, 242, 0.90);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  font-family: var(--font-apple-ui);
  animation: tfcVoiceFade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tfc-voice[hidden] {
  display: none !important;
}

@keyframes tfcVoiceFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.tfc-voice-top {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 20px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  color: #52525b;
}

.tfc-voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  color: #09090b;
  font-size: 12.5px;
}

.tfc-voice-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #0D72CB;
}

.tfc-voice-x {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.78);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: #09090b;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.tfc-voice-x:hover {
  background: #ffffff;
}

.tfc-voice-x svg {
  width: 17px;
  height: 17px;
}

.tfc-voice-orb {
  --lv: 0.45;
  position: relative;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.tfc-voice-orb i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #52525b 0%, #18181b 48%, #000000 100%);
  box-shadow: 0 30px 64px -22px rgba(0, 0, 0, 0.48), inset 0 2px 1px rgba(255, 255, 255, 0.22);
  transform: scale(calc(0.88 + var(--lv) * 0.18));
  transition: transform 0.18s ease, background 0.3s ease;
}

.tfc-voice-orb::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(9, 9, 11, 0.14);
  animation: tfcVoicePulse 2.4s ease-in-out infinite;
}

.tfc-voice[data-state="listen"] .tfc-voice-orb i {
  animation: tfcVoiceListen 1.8s ease-in-out infinite;
}

.tfc-voice[data-state="think"] .tfc-voice-orb i {
  background: radial-gradient(circle at 34% 28%, #a1a1aa 0%, #52525b 54%, #27272a 100%);
  animation: tfcVoiceBreathe 1.5s ease-in-out infinite;
}

.tfc-voice[data-state="speak"] .tfc-voice-orb i {
  background: radial-gradient(circle at 34% 28%, #3B82F6 0%, #1D4ED8 50%, #09090b 100%);
  animation: tfcVoiceSpeak 1.1s ease-in-out infinite;
}

@keyframes tfcVoiceListen {

  0%,
  100% {
    transform: scale(0.92);
  }

  50% {
    transform: scale(1.03);
  }
}

@keyframes tfcVoiceBreathe {

  0%,
  100% {
    transform: scale(0.84);
  }

  50% {
    transform: scale(0.95);
  }
}

@keyframes tfcVoiceSpeak {

  0%,
  100% {
    transform: scale(0.94);
  }

  40% {
    transform: scale(1.07);
  }

  70% {
    transform: scale(0.98);
  }
}

@keyframes tfcVoicePulse {

  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.4;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.9;
  }
}

.tfc-voice-state {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.015em;
  color: #09090b;
  min-height: 24px;
  text-align: center;
}

.tfc-voice-tr {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  min-height: 68px;
}

.tfc-voice-tr p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #52525b;
}

.tfc-voice-tr [data-vyou] {
  color: #09090b;
  font-weight: var(--font-weight-max, 500);
}

.tfc-voice-states-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
}

.tfc-voice-states-bar button {
  border: 0;
  background: transparent;
  color: #52525b;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  min-height: 32px;
}

.tfc-voice-states-bar button.is-on {
  background: #09090b;
  color: #ffffff;
}

.tfc-voice-end {
  min-height: 44px;
  padding: 0 28px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  background: #09090b;
  color: #ffffff;
  font-family: var(--font-apple-ui);
  font-size: 14px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tfc-voice-end:hover {
  opacity: 0.88;
}

html[data-theme="dark"] .tfc-voice {
  background: rgba(0, 0, 0, 0.92);
}

html[data-theme="dark"] .tfc-voice-badge,
html[data-theme="dark"] .tfc-voice-x,
html[data-theme="dark"] .tfc-voice-states-bar {
  background: rgba(24, 24, 27, 0.86);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-voice-dot {
  background: #60A5FA;
}

html[data-theme="dark"] .tfc-voice-orb i {
  background: radial-gradient(circle at 34% 28%, #f4f4f5 0%, #a1a1aa 48%, #27272a 100%);
  box-shadow: 0 24px 60px -18px rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .tfc-voice[data-state="speak"] .tfc-voice-orb i {
  background: radial-gradient(circle at 34% 28%, #93C5FD 0%, #2563EB 52%, #1E3A8A 100%);
}

html[data-theme="dark"] .tfc-voice-orb::after {
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .tfc-voice-state,
html[data-theme="dark"] .tfc-voice-tr [data-vyou] {
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-voice-tr p,
html[data-theme="dark"] .tfc-voice-states-bar button {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-voice-states-bar button.is-on,
html[data-theme="dark"] .tfc-voice-end {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

/* --- 4. Interactive Artifact Inline Card & Side Panel (Desktop Split + Mobile Bottom Sheet) --- */
:root {
  --art-w: min(50vw, 720px);
}

body.view-chat .app-viewport.has-art .chat-primary-pane {
  width: calc(100% - var(--art-w) - 16px);
  transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.art-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}

.art-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 18px;
  border: 0.5px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--font-apple-ui);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.art-card:hover {
  border-color: rgba(15, 23, 42, 0.24);
  box-shadow: 0 10px 26px -16px rgba(15, 23, 42, 0.28);
}

.art-card.is-open {
  border-color: #09090b;
}

.art-card-ico {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: #f2f2f2;
  border: 0.5px solid rgba(15, 23, 42, 0.06);
  display: inline-grid;
  place-items: center;
  color: #09090b;
}

.art-card-ico svg {
  width: 17px;
  height: 17px;
}

.art-card-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.art-card-txt b {
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-card-txt small {
  font-size: 12px;
  color: #71717a;
}

.art-card-go {
  flex: none;
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  padding: 6px 13px;
  border-radius: 9999px;
  background: #f2f2f2;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.art-card.is-open .art-card-go {
  background: #09090b;
  color: #ffffff;
}

.art-panel-backdrop {
  display: none;
}

.art-panel {
  position: fixed;
  top: 64px;
  right: 12px;
  bottom: 12px;
  width: var(--art-w);
  z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-radius: 24px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 18px 46px -22px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-apple-ui);
  animation: artSlideDesktop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.art-panel[hidden] {
  display: none !important;
}

@keyframes artSlideDesktop {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.art-sheet-grabber {
  display: none;
}

.art-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
}

.art-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.art-title-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.art-title-txt b {
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-title-txt small {
  font-size: 11.5px;
  color: #71717a;
}

.art-ver {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: #52525b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.art-seg {
  display: inline-flex;
  background: #f2f2f2;
  border-radius: 9999px;
  padding: 2px;
  border: 0.5px solid rgba(15, 23, 42, 0.06);
}

.art-seg button {
  border: 0;
  background: transparent;
  border-radius: 9999px;
  padding: 5px 12px;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  color: #52525b;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.art-seg button.is-on {
  background: #09090b;
  color: #ffffff;
}

.art-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}

.art-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: #3f3f46;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-apple-ui);
  font-size: 16px;
  font-weight: var(--font-weight-max, 500);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.art-icon:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #09090b;
}

.art-icon:disabled {
  opacity: 0.3;
  cursor: default;
  background: transparent;
}

.art-icon svg {
  width: 15px;
  height: 15px;
}

.art-share {
  height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #09090b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
}

.art-share svg {
  width: 13px;
  height: 13px;
}

.art-share.is-on {
  background: #09090b;
  border-color: #09090b;
  color: #ffffff;
}

.art-sharepop {
  position: absolute;
  top: 56px;
  right: 12px;
  z-index: 10;
  width: 300px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-radius: 18px;
  border: 0.5px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.25);
}

.art-sharepop[hidden] {
  display: none !important;
}

.art-sharepop input {
  width: 100%;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font: 12px var(--font-mono, ui-monospace, Menlo, monospace);
  color: #27272a;
  background: #f8f8f8;
}

.art-sharepop button {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font-apple-ui);
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  text-align: left;
  background: transparent;
  cursor: pointer;
  color: #09090b;
}

.art-sharepop button:hover {
  background: rgba(15, 23, 42, 0.05);
}

.art-body {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

.art-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.art-code {
  margin: 0;
  height: 100%;
  overflow: auto;
  padding: 16px 18px;
  font: 12.5px/1.6 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: #18181b;
  background: #fafafa;
  white-space: pre;
  tab-size: 2;
}

.art-err {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: 16px;
  border: 0.5px solid rgba(159, 45, 52, 0.30);
  box-shadow: 0 12px 30px -14px rgba(15, 23, 42, 0.30);
}

.art-err[hidden] {
  display: none !important;
}

.art-err>svg {
  width: 17px;
  height: 17px;
  color: #9f2d34;
  flex: none;
}

.art-err span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.art-err b {
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.art-err small {
  font-size: 12px;
  color: #52525b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-fix {
  flex: none;
  border: 0;
  background: #09090b;
  color: #ffffff;
  border-radius: 9999px;
  padding: 8px 14px;
  font-family: var(--font-apple-ui);
  font-size: 12.5px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
}

/* Mobile Artifact Bottom Sheet (~90dvh, rounded top, grabber pill) */
@media (max-width: 960px) {
  body.view-chat .app-viewport.has-art .chat-primary-pane {
    width: 100%;
  }

  .art-panel-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 185;
    background: rgba(0, 0, 0, 0.38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  .art-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 90dvh;
    max-height: 90dvh;
    margin: 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    z-index: 190;
    padding-bottom: env(safe-area-inset-bottom);
    animation: artSheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes artSheetUp {
    from {
      opacity: 0.4;
      transform: translateY(100%);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .art-sheet-grabber {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
  }

  .art-sheet-grabber::before {
    content: "";
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.18);
  }

  .art-head {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 6px 12px 10px;
  }

  .art-title {
    flex: 1 1 100%;
  }

  .art-icon,
  .art-share {
    min-width: 40px;
    min-height: 40px;
  }

  .art-share span {
    display: none;
  }
}

html[data-theme="dark"] .art-card {
  background: rgba(20, 20, 23, 0.90);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .art-card:hover,
html[data-theme="dark"] .art-card.is-open {
  border-color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .art-card-ico {
  background: #1c1c1f;
  border-color: rgba(255, 255, 255, 0.10);
  color: #f4f4f5;
}

html[data-theme="dark"] .art-card-txt b,
html[data-theme="dark"] .art-title-txt b,
html[data-theme="dark"] .art-err b {
  color: #f4f4f5;
}

html[data-theme="dark"] .art-card-txt small,
html[data-theme="dark"] .art-title-txt small,
html[data-theme="dark"] .art-ver,
html[data-theme="dark"] .art-err small {
  color: #a1a1aa;
}

html[data-theme="dark"] .art-card-go {
  background: #1c1c1f;
  color: #f4f4f5;
}

html[data-theme="dark"] .art-card.is-open .art-card-go,
html[data-theme="dark"] .art-seg button.is-on,
html[data-theme="dark"] .art-share.is-on,
html[data-theme="dark"] .art-fix {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

html[data-theme="dark"] .art-panel {
  background: #111114;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.85);
}

html[data-theme="dark"] .art-head {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .art-seg {
  background: #1c1c1f;
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .art-seg button,
html[data-theme="dark"] .art-icon {
  color: #d4d4d8;
}

html[data-theme="dark"] .art-icon:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

html[data-theme="dark"] .art-share {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-theme="dark"] .art-sharepop,
html[data-theme="dark"] .art-err {
  background: rgba(24, 24, 27, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .art-sharepop input {
  background: #09090b;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-theme="dark"] .art-sharepop button {
  color: #f4f4f5;
}

html[data-theme="dark"] .art-sharepop button:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .art-body,
html[data-theme="dark"] .art-code {
  background: #0a0a0c;
  color: #e4e4e7;
}

html[data-theme="dark"] .art-sheet-grabber::before {
  background: rgba(255, 255, 255, 0.24);
}

/* --- 5. Chat Outputs: Answer Versions, Code Results, Web Sources & Privacy Tag --- */
.tfc-ver {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  margin-right: 4px;
  font-family: var(--font-apple-ui);
  font-size: 12px;
  color: #71717a;
  font-variant-numeric: tabular-nums;
}

.tfc-ver>span {
  min-width: 28px;
  text-align: center;
}

.tfc-ver-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f3f46;
  font: 500 15px/1 var(--font-apple-ui);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tfc-ver-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
  color: #09090b;
}

.tfc-ver-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.tfc-gen {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.tfc-gen figure {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tfc-gen img,
.tfc-gen svg.tfc-chart-svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.tfc-gen figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #71717a;
}

.tfc-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.tfc-file {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  text-decoration: none;
  color: #09090b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfc-file:hover {
  border-color: rgba(15, 23, 42, 0.24);
  box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.22);
}

.tfc-file-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #EAF3FC;
  color: #0D72CB;
  display: inline-grid;
  place-items: center;
  flex: none;
}

.tfc-file-ico svg {
  width: 17px;
  height: 17px;
}

.tfc-file span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tfc-file b {
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfc-file small {
  font-size: 12px;
  color: #71717a;
}

.tfc-sources {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tfc-sources-head {
  font-size: 11.5px;
  font-weight: var(--font-weight-max, 500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
}

.tfc-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tfc-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  color: #09090b;
  text-decoration: none;
  font-size: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tfc-source-pill:hover {
  border-color: rgba(15, 23, 42, 0.25);
  background: #fafafa;
}

.tfc-source-num {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #f2f2f2;
  color: #52525b;
  font-size: 10.5px;
  font-weight: var(--font-weight-max, 500);
  display: inline-grid;
  place-items: center;
}

.tfc-source-domain {
  color: #71717a;
  font-size: 11.5px;
}

.model-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: #EAF3FC;
  color: #0D72CB;
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
}

.model-meta-tag svg {
  width: 12px;
  height: 12px;
  flex: none;
}

html[data-theme="dark"] .tfc-ver,
html[data-theme="dark"] .tfc-gen figcaption,
html[data-theme="dark"] .tfc-file small,
html[data-theme="dark"] .tfc-sources-head,
html[data-theme="dark"] .tfc-source-domain {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-ver-btn {
  color: #d4d4d8;
}

html[data-theme="dark"] .tfc-ver-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

html[data-theme="dark"] .tfc-gen figure,
html[data-theme="dark"] .tfc-file,
html[data-theme="dark"] .tfc-sources {
  background: #121215;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-file-ico,
html[data-theme="dark"] .model-meta-tag {
  background: rgba(37, 99, 235, 0.24);
  color: #60A5FA;
}

html[data-theme="dark"] .tfc-source-pill {
  background: #1c1c1f;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-source-num {
  background: #27272a;
  color: #d4d4d8;
}

/* Text selection comfort + non-repeating entrance animations (IT feedback 18 Nov) */
.conversation-stream {
  -webkit-user-select: text;
  user-select: text;
}

.conversation-stream button,
.conversation-stream [role="button"] {
  -webkit-user-select: none;
  user-select: none;
}

/* --- 6. Share Snapshot Row inside #thread-share-modal (.tfc-snap) --- */
.tfc-snap {
  margin: 6px 20px 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  background: rgba(242, 242, 242, 0.68);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tfc-snap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tfc-snap-head b {
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.tfc-snap-badge {
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  padding: 2px 9px;
  border-radius: 9999px;
  background: #EAF3FC;
  color: #0D72CB;
}

.tfc-snap p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: #52525b;
}

.tfc-snap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tfc-input {
  width: 100%;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: var(--font-apple-ui);
  font-size: 13.5px;
  background: #ffffff;
  color: #09090b;
  outline: none;
}

.tfc-input:focus {
  border-color: #09090b;
}

.tfc-snap-row .tfc-input {
  flex: 1;
  min-width: 180px;
  font: 12px var(--font-mono, ui-monospace, Menlo, monospace);
}

.tfc-snap-row.is-meta {
  justify-content: space-between;
  font-size: 11.5px;
  color: #71717a;
}

.tfc-snap-row.is-meta span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tfc-btn {
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #09090b;
  border-radius: 9999px;
  padding: 8px 15px;
  min-height: 36px;
  font-family: var(--font-apple-ui);
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tfc-btn:hover {
  background: #fafafa;
  border-color: rgba(15, 23, 42, 0.28);
}

.tfc-btn.is-primary {
  background: #09090b;
  color: #ffffff;
  border-color: #09090b;
}

.tfc-btn.is-primary:hover {
  opacity: 0.88;
}

.tfc-btn.is-danger {
  color: #9f2d34;
}

html[data-theme="dark"] .tfc-snap {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .tfc-snap-head b {
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-snap-badge {
  background: rgba(37, 99, 235, 0.24);
  color: #60A5FA;
}

html[data-theme="dark"] .tfc-snap p,
html[data-theme="dark"] .tfc-snap-row.is-meta {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-input {
  background: #09090b;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-input:focus {
  border-color: #ffffff;
}

html[data-theme="dark"] .tfc-btn {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-btn.is-primary {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

/* --- 7. Unified Glass Sheet, Skills & Custom Styles (.tfc-sheet, .tfc-sk-*, .tfc-mem-*) --- */
.tfc-sheet-back {
  position: fixed;
  inset: 0;
  z-index: 480;
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--font-apple-ui);
}

.tfc-sheet-back[hidden] {
  display: none !important;
}

.tfc-sheet {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-radius: 24px;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
}

.tfc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}

.tfc-sheet-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.015em;
  color: #09090b;
}

.tfc-sheet-body {
  padding: 8px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tfc-sheet-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 20px 18px;
  border-top: 0.5px solid rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

.tfc-sk-list {
  display: flex;
  flex-direction: column;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
}

.tfc-sk-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}

.tfc-sk-row+.tfc-sk-row {
  border-top: 0.5px solid rgba(15, 23, 42, 0.08);
}

.tfc-sk-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tfc-sk-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tfc-sk-top b,
.tfc-sk-top code {
  font-size: 14px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.tfc-sk-top code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
}

.tfc-sk-chip {
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  padding: 2px 9px;
  border-radius: 9999px;
  background: #f2f2f2;
  color: #52525b;
}

.tfc-sk-chip.is-company {
  background: #EAF3FC;
  color: #0D72CB;
}

.tfc-sk-chip.is-on {
  background: #09090b;
  color: #ffffff;
}

.tfc-sk-main p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #52525b;
}

.tfc-sk-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.tfc-st-sample {
  border: 0.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(242, 242, 242, 0.55);
}

.tfc-st-sample summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.tfc-st-sample[open] summary {
  margin-bottom: 10px;
}

.tfc-mem-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tfc-mem-add .tfc-input {
  flex: 1;
  min-width: 0;
}

.tfc-mem-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfc-mem-item:focus-within {
  border-color: #09090b;
  box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.06);
}

.tfc-mem-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #09090b;
  outline: none;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background-color 0.3s ease;
}

.tfc-mem-text.is-saved {
  background: #EAF3FC;
}

.tfc-mem-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #71717a;
}

.tfc-mem-src {
  padding: 2px 8px;
  border-radius: 9999px;
  background: #f2f2f2;
  color: #52525b;
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
}

.tfc-mem-src.is-ai {
  background: #EAF3FC;
  color: #0D72CB;
}

.tfc-mem-src.is-import {
  background: #f4ecd8;
  color: #6b4e1f;
}

html[data-theme="dark"] .tfc-sheet,
html[data-theme="dark"] .tfc-sk-list,
html[data-theme="dark"] .tfc-mem-item {
  background: #121215;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .tfc-sheet-head h3,
html[data-theme="dark"] .tfc-sk-top b,
html[data-theme="dark"] .tfc-sk-top code,
html[data-theme="dark"] .tfc-st-sample summary,
html[data-theme="dark"] .tfc-mem-text {
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-sk-row+.tfc-sk-row,
html[data-theme="dark"] .tfc-sheet-foot {
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .tfc-sk-main p,
html[data-theme="dark"] .tfc-mem-meta {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-sk-chip,
html[data-theme="dark"] .tfc-mem-src {
  background: #27272a;
  color: #d4d4d8;
}

html[data-theme="dark"] .tfc-sk-chip.is-company,
html[data-theme="dark"] .tfc-mem-src.is-ai {
  background: rgba(37, 99, 235, 0.24);
  color: #60A5FA;
}

html[data-theme="dark"] .tfc-sk-chip.is-on {
  background: #ffffff;
  color: #09090b;
}

html[data-theme="dark"] .tfc-st-sample {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .tfc-mem-text.is-saved {
  background: rgba(37, 99, 235, 0.28);
}

/* Personal Intelligence dual-action Memory row (Manage + Switch) */
.pi-list-row-dual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 60px;
}

.pi-list-row-dual+.pi-list-row,
.pi-list-row+.pi-list-row-dual {
  border-top: 0.5px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .pi-list-row-dual+.pi-list-row,
html[data-theme="dark"] .pi-list-row+.pi-list-row-dual {
  border-top-color: rgba(255, 255, 255, 0.10);
}

.pi-dual-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 8px 14px 0;
  text-decoration: none;
  color: inherit;
}

.pi-dual-toggle {
  border: 0;
  background: transparent;
  padding: 8px 0 8px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 640px) {
  .tfc-menu.tfc-notif {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .tfc-mem-add {
    flex-direction: column;
    align-items: stretch;
  }

  .tfc-sheet-back {
    align-items: flex-end;
    padding: 0;
  }

  .tfc-sheet {
    width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 92dvh;
  }

  .tfc-btn,
  .composer-voice-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .tfc-voice,
  .tfc-voice-orb i,
  .tfc-voice-orb::after,
  .art-panel,
  .tfc-menu.tfc-notif {
    animation: none !important;
    transition: none !important;
  }
}

/* --- 8. Wider 2-Column Landscape Share Modal + Snapshot [hidden] fix --- */
.tfc-snap-row[hidden],
.tfc-snap-badge[hidden] {
  display: none !important;
}

.share-modal-overlay .share-modal-window {
  width: 100%;
  max-width: min(740px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 22px 24px;
  gap: 16px;
}

.share-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 20px;
  align-items: start;
}

.share-modal-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.share-modal-col.is-right {
  padding-left: 20px;
  border-left: 0.5px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .share-modal-col.is-right {
  border-left-color: rgba(255, 255, 255, 0.10);
}

.share-modal-col .tfc-snap {
  margin: 0;
}

.share-modal-col .share-export-section {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .share-modal-col .share-export-section {
  border-top-color: rgba(255, 255, 255, 0.10);
}

.share-modal-col .share-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 680px) {
  .share-modal-overlay .share-modal-window {
    padding: 18px 16px;
  }

  .share-modal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .share-modal-col.is-right {
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 0.5px solid rgba(15, 23, 42, 0.08);
  }

  html[data-theme="dark"] .share-modal-col.is-right {
    border-top-color: rgba(255, 255, 255, 0.10);
  }
}

/* --- 9. Project Knowledge Dropzone & File List (.tfc-know-*) --- */
.tfc-know {
  display: grid;
  gap: 14px;
  padding: 6px 0 10px;
  font-family: var(--font-apple-ui);
}

.tfc-know-intro {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #52525b;
  max-width: 68ch;
}

.tfc-know-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.tfc-know-drop:hover,
.tfc-know-drop.is-over {
  border-color: #09090b;
  background: #ffffff;
}

.tfc-know-drop-ic {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #09090b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tfc-know-drop-t {
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.tfc-know-drop-h {
  font-size: 12px;
  color: #71717a;
}

.tfc-know-list {
  display: grid;
  gap: 8px;
}

.tfc-know-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 0.5px solid rgba(15, 23, 42, 0.09);
  background: #ffffff;
}

.tfc-know-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfc-know-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #71717a;
}

html[data-theme="dark"] .tfc-know-intro,
html[data-theme="dark"] .tfc-know-drop-h,
html[data-theme="dark"] .tfc-know-sub {
  color: #a1a1aa;
}

html[data-theme="dark"] .tfc-know-drop {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .tfc-know-drop:hover,
html[data-theme="dark"] .tfc-know-drop.is-over {
  border-color: rgba(255, 255, 255, 0.50);
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .tfc-know-drop-ic {
  background: #ffffff;
  color: #09090b;
}

html[data-theme="dark"] .tfc-know-drop-t,
html[data-theme="dark"] .tfc-know-name {
  color: #f4f4f5;
}

html[data-theme="dark"] .tfc-know-row {
  background: #121215;
  border-color: rgba(255, 255, 255, 0.12);
}

/* --- 10. AI Thinking, Tool Activity, Streaming Status, Stop Button & Toasts --- */
.tfc-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
  min-width: 0;
}

.tfc-thinking,
.tfc-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--font-apple-ui);
  font-size: 12.5px;
  font-weight: var(--font-weight-max, 500);
  color: #3f3f46;
  min-width: 0;
  align-self: flex-start;
}

.tfc-thinking svg,
.tfc-tool svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: #0D72CB;
}

.tfc-tool span,
.tfc-thinking span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tfc-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  font-family: var(--font-apple-ui);
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  color: #52525b;
}

.tfc-typing i {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #0D72CB;
  animation: tfcStatusDot 1.2s ease-in-out infinite;
}

.tfc-typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.tfc-typing i:nth-child(3) {
  animation-delay: 0.32s;
}

.tfc-typing span {
  margin-left: 5px;
  background: linear-gradient(90deg, #52525b 0%, #09090b 45%, #52525b 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tfcShimmerText 2.2s linear infinite;
}

@keyframes tfcStatusDot {

  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2.5px);
  }
}

@keyframes tfcShimmerText {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.tfc-caret {
  display: inline-block;
  width: 2px;
  height: 15px;
  border-radius: 2px;
  background: #09090b;
  margin-left: 2px;
  vertical-align: -2px;
  animation: tfcCaretBlink 0.95s steps(1) infinite;
}

@keyframes tfcCaretBlink {
  50% {
    opacity: 0;
  }
}

.tfc-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-apple-ui);
  font-size: 13px;
  font-weight: var(--font-weight-ui-default, 350);
  line-height: 1.5;
  color: #3f3f46;
  background: rgba(255, 255, 255, 0.82);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  padding: 11px 14px;
}

.tfc-note.is-bad {
  color: #881c24;
  background: rgba(246, 238, 237, 0.92);
  border-color: rgba(159, 45, 52, 0.24);
}

.composer-send-btn.tfc-stop {
  background: #09090b !important;
  color: #ffffff !important;
}

.composer-send-btn.tfc-stop svg {
  width: 13px;
  height: 13px;
}

.tfc-toasts {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 650;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  font-family: var(--font-apple-ui);
}

.tfc-toast {
  background: rgba(9, 9, 11, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #ffffff;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: var(--font-weight-max, 500);
  box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.45);
  max-width: min(560px, calc(100vw - 32px));
  pointer-events: auto;
  text-align: center;
}

.tfc-toast.is-success {
  background: #0D72CB;
}

.tfc-toast.is-error {
  background: #7e2c32;
}

html[data-theme="dark"] .tfc-thinking,
html[data-theme="dark"] .tfc-tool,
html[data-theme="dark"] .tfc-typing {
  background: rgba(24, 24, 27, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

html[data-theme="dark"] .tfc-thinking svg,
html[data-theme="dark"] .tfc-tool svg {
  color: #60A5FA;
}

html[data-theme="dark"] .tfc-typing i {
  background: #60A5FA;
}

html[data-theme="dark"] .tfc-typing span {
  background: linear-gradient(90deg, #a1a1aa 0%, #ffffff 45%, #a1a1aa 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="dark"] .tfc-caret {
  background: #f4f4f5;
}

html[data-theme="dark"] .tfc-note {
  background: #141417;
  border-color: rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

html[data-theme="dark"] .tfc-note.is-bad {
  background: rgba(126, 44, 50, 0.24);
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
}

html[data-theme="dark"] .composer-send-btn.tfc-stop {
  background: #ffffff !important;
  color: #09090b !important;
}

html[data-theme="dark"] .tfc-toast {
  background: rgba(244, 244, 245, 0.96);
  color: #09090b;
  border-color: rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] .tfc-toast.is-success {
  background: #0D72CB;
  color: #ffffff;
}

html[data-theme="dark"] .tfc-toast.is-error {
  background: #9f2d34;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {

  .tfc-typing i,
  .tfc-typing span,
  .tfc-caret {
    animation: none !important;
  }
}

/* --- 11. First-Timer 3-Step Personalize Wizard (Step 1: Access, Step 2: Appearance Live Preview, Step 3: Behavior) --- */
.gate-modal-card.is-wizard {
  max-width: 560px;
  padding: 30px 32px 28px;
  gap: 20px;
}

.gate-wizard-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gate-wizard-top .gate-modal-mark {
  height: 18px;
  margin: 0;
}

.gate-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gate-step-pill {
  width: 24px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.12);
  transition: background-color 0.2s ease, width 0.2s ease;
}

.gate-step-pill.is-active {
  width: 34px;
  background: #09090b;
}

.gate-step-pill.is-done {
  background: #0D72CB;
}

.gate-step-counter {
  font-size: 11.5px;
  font-weight: var(--font-weight-max, 500);
  color: #71717a;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.gate-step-pane {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: gateStepFade 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate-step-pane[hidden] {
  display: none !important;
}

@keyframes gateStepFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step 2: Live Workspace + Menu Appearance Preview Stage */
.gate-appearance-stage {
  width: 100%;
  border-radius: 20px;
  padding: 14px;
  border: 0.5px solid rgba(15, 23, 42, 0.12);
  background: #f2f2f2;
  color: #09090b;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background-color 0.26s ease, color 0.26s ease, border-color 0.26s ease;
}

.gate-appearance-stage[data-preview-theme="dark"] {
  background: #000000;
  color: #f4f4f5;
  border-color: rgba(255, 255, 255, 0.16);
}

.gate-prev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gate-prev-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  letter-spacing: -0.01em;
}

.gate-prev-badge {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  color: #52525b;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #a1a1aa;
}

.gate-prev-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gate-prev-icon-dot {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  display: inline-grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: var(--font-weight-max, 500);
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-icon-dot {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

.gate-prev-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 10px;
  align-items: stretch;
}

.gate-prev-chat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.gate-prev-bubble-user {
  align-self: flex-end;
  padding: 6px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  font-size: 10.5px;
  color: #09090b;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-bubble-user {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.gate-prev-bubble-ai {
  font-size: 10.5px;
  line-height: 1.45;
  color: #3f3f46;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-bubble-ai {
  color: #d4d4d8;
}

.gate-prev-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  font-size: 10px;
  color: #71717a;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-composer {
  background: rgba(24, 24, 27, 0.86);
  border-color: rgba(255, 255, 255, 0.14);
  color: #a1a1aa;
}

.gate-prev-send-dot {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #09090b;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-send-dot {
  background: #ffffff;
  color: #09090b;
}

/* Floating Menu Preview (shows how menus look in Light vs Dark!) */
.gate-prev-menu {
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu {
  background: rgba(20, 20, 23, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.72);
}

.gate-prev-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 10px;
  color: #18181b;
}

.gate-prev-menu-row.is-hi {
  background: rgba(15, 23, 42, 0.06);
  font-weight: var(--font-weight-max, 500);
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu-row {
  color: #e4e4e7;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu-row.is-hi {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.gate-prev-mini-pill {
  width: 20px;
  height: 11px;
  border-radius: 9999px;
  background: #0D72CB;
  position: relative;
}

.gate-prev-mini-pill::after {
  content: "";
  position: absolute;
  top: 1.5px;
  right: 1.5px;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #ffffff;
}

/* Theme Visual Selector Cards */
.gate-theme-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gate-theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(242, 242, 242, 0.55);
  cursor: pointer;
  font-family: var(--font-apple-ui);
  color: #09090b;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.gate-theme-card:hover {
  border-color: rgba(15, 23, 42, 0.28);
}

.gate-theme-card.is-active {
  border: 0.75px solid #0D72CB;
  background: #ffffff;
  box-shadow: 0 4px 16px -8px rgba(13, 114, 203, 0.24);
}

.gate-theme-swatch {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 0.5px solid rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.gate-theme-swatch.is-light {
  background: linear-gradient(135deg, #f2f2f2 0%, #ffffff 100%);
}

.gate-theme-swatch.is-dark {
  background: linear-gradient(135deg, #000000 0%, #1c1c1f 100%);
  border-color: rgba(255, 255, 255, 0.16);
}

.gate-theme-swatch.is-system {
  background: linear-gradient(135deg, #f2f2f2 0%, #f2f2f2 50%, #09090b 50%, #1c1c1f 100%);
}

.gate-theme-card span {
  font-size: 12.5px;
  font-weight: var(--font-weight-max, 500);
}

/* Step 3: Send Behavior Visual Cards */
.gate-behavior-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
}

.gate-behavior-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(242, 242, 242, 0.55);
  cursor: pointer;
  font-family: var(--font-apple-ui);
  color: #09090b;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.gate-behavior-card:hover {
  border-color: rgba(15, 23, 42, 0.28);
}

.gate-behavior-card.is-active {
  border: 0.75px solid #0D72CB;
  background: #ffffff;
  box-shadow: 0 4px 16px -8px rgba(13, 114, 203, 0.24);
}

.gate-behavior-demo {
  padding: 10px;
  border-radius: 12px;
  background: #f2f2f2;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #52525b;
}

.gate-kbd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  background: #ffffff;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  font-size: 11px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.gate-behavior-title {
  font-size: 14px;
  font-weight: var(--font-weight-max, 500);
  color: #09090b;
}

.gate-behavior-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #52525b;
}

.gate-behavior-tag {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: var(--font-weight-max, 500);
  padding: 2px 8px;
  border-radius: 9999px;
  background: #EAF3FC;
  color: #0D72CB;
}

.gate-nav-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.gate-nav-row.is-single {
  justify-content: center;
}

.gate-back-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9999px;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  background: transparent;
  color: #3f3f46;
  font-family: var(--font-apple-ui);
  font-size: 13.5px;
  font-weight: var(--font-weight-max, 500);
  cursor: pointer;
}

.gate-back-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #09090b;
}

/* Dark Mode for 3-Step Personalize Wizard */
html[data-theme="dark"] .gate-step-pill {
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .gate-step-pill.is-active {
  background: #ffffff;
}

html[data-theme="dark"] .gate-step-pill.is-done {
  background: #60A5FA;
}

html[data-theme="dark"] .gate-step-counter {
  color: #a1a1aa;
}

html[data-theme="dark"] .gate-theme-card,
html[data-theme="dark"] .gate-behavior-card {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

html[data-theme="dark"] .gate-theme-card.is-active,
html[data-theme="dark"] .gate-behavior-card.is-active {
  background: #1f1f24;
  border: 0.75px solid #60A5FA;
  box-shadow: 0 6px 20px -8px rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] .gate-behavior-demo {
  background: #0d0d0f;
  border-color: rgba(255, 255, 255, 0.10);
  color: #a1a1aa;
}

html[data-theme="dark"] .gate-kbd-chip {
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f4f5;
}

html[data-theme="dark"] .gate-behavior-title {
  color: #f4f4f5;
}

html[data-theme="dark"] .gate-behavior-desc {
  color: #a1a1aa;
}

html[data-theme="dark"] .gate-behavior-tag {
  background: rgba(37, 99, 235, 0.24);
  color: #60A5FA;
}

html[data-theme="dark"] .gate-back-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: #d4d4d8;
}

html[data-theme="dark"] .gate-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

@media (max-width: 600px) {
  .gate-modal-card.is-wizard {
    padding: 20px 16px 18px;
  }

  .gate-prev-body {
    grid-template-columns: 1fr;
  }

  .gate-behavior-grid {
    grid-template-columns: 1fr;
  }
}


/* Step 3: Looping Real-Behavior Preview Animations (Enter sends vs Button sends) */
.gate-anim-stage {
  width: 100%;
  height: 112px;
  border-radius: 14px;
  padding: 10px;
  background: #f2f2f2;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.gate-anim-thread {
  display: flex;
  justify-content: flex-end;
  min-height: 26px;
}

.gate-anim-bubble {
  padding: 4px 9px;
  border-radius: 10px;
  background: #0D72CB;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: var(--font-weight-max, 500);
  line-height: 1.3;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

.gate-anim-box {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px 7px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  min-height: 44px;
}

.gate-anim-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #09090b;
  min-width: 0;
}

.gate-anim-l1,
.gate-anim-l2 {
  white-space: nowrap;
  overflow: hidden;
  display: block;
}

.gate-anim-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.gate-anim-key {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f4f4f5;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  font-size: 9.5px;
  font-weight: var(--font-weight-max, 500);
  color: #3f3f46;
}

.gate-anim-send {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #e4e4e7;
  color: #52525b;
  display: inline-grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: var(--font-weight-max, 500);
}

/* Resting state (unselected & not hovered): calm static preview frame */
.gate-behavior-card:not(.is-active) .gate-anim-l1 {
  opacity: 0.82;
}

.gate-behavior-card:not(.is-active) .gate-anim-stage.is-button-sends .gate-anim-l2 {
  opacity: 0.55;
  max-height: 18px;
}

/* Mode A: Enter sends — plays ONLY when selected, hovered, or focused */
.gate-behavior-card.is-active .gate-anim-stage.is-enter-sends .gate-anim-l1 {
  animation: animEnterDraft 3.6s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-enter-sends .gate-anim-key {
  animation: animEnterKeyPress 3.6s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-enter-sends .gate-anim-bubble {
  animation: animEnterSent 3.6s ease-in-out infinite;
}

@keyframes animEnterDraft {

  0%,
  10% {
    opacity: 0;
  }

  22%,
  44% {
    opacity: 1;
  }

  48%,
  100% {
    opacity: 0;
  }
}

@keyframes animEnterKeyPress {

  0%,
  36% {
    background: #f4f4f5;
    color: #3f3f46;
    border-color: rgba(15, 23, 42, 0.14);
    transform: scale(1);
  }

  42%,
  50% {
    background: #0D72CB;
    color: #ffffff;
    border-color: #0D72CB;
    transform: scale(0.92);
  }

  58%,
  100% {
    background: #f4f4f5;
    color: #3f3f46;
    border-color: rgba(15, 23, 42, 0.14);
    transform: scale(1);
  }
}

@keyframes animEnterSent {

  0%,
  44% {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }

  54%,
  86% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  94%,
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* Mode B: Button sends — plays ONLY when selected, hovered, or focused */
.gate-behavior-card.is-active .gate-anim-stage.is-button-sends .gate-anim-l1 {
  animation: animBtnLine1 4.4s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-button-sends .gate-anim-l2 {
  animation: animBtnLine2 4.4s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-button-sends .gate-anim-key {
  animation: animBtnEnterKey 4.4s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-button-sends .gate-anim-send {
  animation: animBtnSendTap 4.4s ease-in-out infinite;
}

.gate-behavior-card.is-active .gate-anim-stage.is-button-sends .gate-anim-bubble {
  animation: animBtnSent 4.4s ease-in-out infinite;
}

@keyframes animBtnLine1 {

  0%,
  8% {
    opacity: 0;
  }

  16%,
  62% {
    opacity: 1;
  }

  66%,
  100% {
    opacity: 0;
  }
}

@keyframes animBtnEnterKey {

  0%,
  24% {
    background: #f4f4f5;
    color: #3f3f46;
    border-color: rgba(15, 23, 42, 0.14);
    transform: scale(1);
  }

  30%,
  38% {
    background: #0D72CB;
    color: #ffffff;
    border-color: #0D72CB;
    transform: scale(0.92);
  }

  44%,
  100% {
    background: #f4f4f5;
    color: #3f3f46;
    border-color: rgba(15, 23, 42, 0.14);
    transform: scale(1);
  }
}

@keyframes animBtnLine2 {

  0%,
  34% {
    opacity: 0;
    max-height: 0;
  }

  42%,
  62% {
    opacity: 1;
    max-height: 18px;
  }

  66%,
  100% {
    opacity: 0;
    max-height: 0;
  }
}

@keyframes animBtnSendTap {

  0%,
  54% {
    background: #e4e4e7;
    color: #52525b;
    transform: scale(1);
  }

  60%,
  70% {
    background: #0D72CB;
    color: #ffffff;
    transform: scale(0.9);
  }

  78%,
  100% {
    background: #e4e4e7;
    color: #52525b;
    transform: scale(1);
  }
}

@keyframes animBtnSent {

  0%,
  62% {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }

  70%,
  90% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  96%,
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

html[data-theme="dark"] .gate-anim-stage {
  background: #0d0d10;
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .gate-anim-box {
  background: #18181c;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .gate-anim-lines {
  color: #f4f4f5;
}

html[data-theme="dark"] .gate-anim-key {
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.16);
  color: #d4d4d8;
}

html[data-theme="dark"] .gate-anim-send {
  background: #27272a;
  color: #d4d4d8;
}

@media (prefers-reduced-motion: reduce) {
  .gate-anim-stage * {
    animation: none !important;
  }

  .gate-anim-bubble,
  .gate-anim-l1,
  .gate-anim-l2 {
    opacity: 1 !important;
    transform: none !important;
    max-height: none !important;
  }
}

/* Airy spacing polish for 3-Step Personalize Wizard */
.gate-modal-card.is-wizard .gate-step-pane {
  gap: 22px;
}

.gate-modal-card.is-wizard .gate-modal-sub {
  margin-top: -14px;
  margin-bottom: 4px;
}

.gate-modal-card.is-wizard .gate-perm-list {
  gap: 14px;
}

.gate-modal-card.is-wizard .gate-theme-cards,
.gate-modal-card.is-wizard .gate-behavior-grid {
  gap: 16px;
}

.gate-modal-card.is-wizard .gate-behavior-card {
  padding: 18px;
  gap: 14px;
}

.gate-modal-card.is-wizard .gate-behavior-desc {
  margin-top: -8px;
}

.gate-modal-card.is-wizard .gate-anim-stage {
  height: 124px;
  padding: 12px;
}

.gate-modal-card.is-wizard .gate-nav-row {
  margin-top: 16px;
  gap: 12px;
}

/* Step 2: Gentle Living Animation for Appearance Live Menu & Workspace Preview */
.gate-appearance-stage {
  transition: background-color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate-appearance-stage::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 30% 25%, rgba(13, 114, 203, 0.08) 0%, transparent 55%);
  pointer-events: none;
  animation: gatePrevMist 7.5s ease-in-out infinite alternate;
}

.gate-appearance-stage[data-preview-theme="dark"]::before {
  background: radial-gradient(circle at 30% 25%, rgba(96, 165, 250, 0.14) 0%, transparent 58%);
}

.gate-prev-header,
.gate-prev-body {
  position: relative;
  z-index: 1;
}

.gate-prev-bubble-user,
.gate-prev-bubble-ai,
.gate-prev-composer,
.gate-prev-menu,
.gate-prev-menu-row,
.gate-prev-icon-dot,
.gate-prev-send-dot,
.gate-prev-badge {
  transition: background-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate-prev-menu {
  animation: gatePrevMenuFloat 5.2s ease-in-out infinite;
}

.gate-appearance-stage.is-switching .gate-prev-menu {
  transform: translateY(-2px) scale(0.985);
}

.gate-prev-bubble-user {
  animation: gatePrevBubbleSoft 6.4s ease-in-out infinite;
}

.gate-prev-bubble-ai {
  animation: gatePrevReplySoft 6.4s ease-in-out infinite;
}

/* Gentle roving menu highlight across rows 1 -> 2 -> 3 */
.gate-prev-menu-row.is-hi {
  background: transparent;
  font-weight: var(--font-weight-ui-default, 350);
}

.gate-prev-menu-row:nth-child(1) {
  animation: gatePrevRowLight1 6s ease-in-out infinite;
}
.gate-prev-menu-row:nth-child(2) {
  animation: gatePrevRowLight2 6s ease-in-out infinite;
}
.gate-prev-menu-row:nth-child(3) {
  animation: gatePrevRowLight3 6s ease-in-out infinite;
}

.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu-row:nth-child(1) {
  animation: gatePrevRowDark1 6s ease-in-out infinite;
}
.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu-row:nth-child(2) {
  animation: gatePrevRowDark2 6s ease-in-out infinite;
}
.gate-appearance-stage[data-preview-theme="dark"] .gate-prev-menu-row:nth-child(3) {
  animation: gatePrevRowDark3 6s ease-in-out infinite;
}

.gate-prev-mini-pill::after {
  animation: gatePrevToggleSlide 6s ease-in-out infinite;
}

@keyframes gatePrevMist {
  0% { transform: translate(-4%, -3%) scale(1); }
  100% { transform: translate(6%, 4%) scale(1.06); }
}

@keyframes gatePrevMenuFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

@keyframes gatePrevBubbleSoft {
  0%, 100% { opacity: 0.94; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

@keyframes gatePrevReplySoft {
  0%, 100% { opacity: 0.86; }
  50% { opacity: 1; }
}

@keyframes gatePrevRowLight1 {
  0%, 28% { background: rgba(13, 114, 203, 0.10); color: #09090b; }
  36%, 100% { background: transparent; color: #18181b; }
}
@keyframes gatePrevRowLight2 {
  0%, 30% { background: transparent; color: #18181b; }
  36%, 64% { background: rgba(13, 114, 203, 0.10); color: #09090b; }
  72%, 100% { background: transparent; color: #18181b; }
}
@keyframes gatePrevRowLight3 {
  0%, 66% { background: transparent; color: #18181b; }
  72%, 94% { background: rgba(13, 114, 203, 0.10); color: #09090b; }
  100% { background: transparent; color: #18181b; }
}

@keyframes gatePrevRowDark1 {
  0%, 28% { background: rgba(96, 165, 250, 0.18); color: #ffffff; }
  36%, 100% { background: transparent; color: #e4e4e7; }
}
@keyframes gatePrevRowDark2 {
  0%, 30% { background: transparent; color: #e4e4e7; }
  36%, 64% { background: rgba(96, 165, 250, 0.18); color: #ffffff; }
  72%, 100% { background: transparent; color: #e4e4e7; }
}
@keyframes gatePrevRowDark3 {
  0%, 66% { background: transparent; color: #e4e4e7; }
  72%, 94% { background: rgba(96, 165, 250, 0.18); color: #ffffff; }
  100% { background: transparent; color: #e4e4e7; }
}

@keyframes gatePrevToggleSlide {
  0%, 36% { transform: translateX(-8px); opacity: 0.72; }
  46%, 82% { transform: translateX(0); opacity: 1; }
  92%, 100% { transform: translateX(-8px); opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-appearance-stage::before,
  .gate-prev-menu,
  .gate-prev-bubble-user,
  .gate-prev-bubble-ai,
  .gate-prev-menu-row,
  .gate-prev-mini-pill::after {
    animation: none !important;
  }
}

/* --- 12. Active Chatbox Focus-Only Feathered Blue Border Sheen --- */
.composer-glass-container > .composer-focus-svg,
.composer-focus-svg {
  position: absolute !important;
  inset: -1px !important;
  width: calc(100% + 2px) !important;
  height: calc(100% + 2px) !important;
  pointer-events: none !important;
  z-index: 6 !important;
  overflow: visible !important;
  margin: 0 !important;
  flex: none !important;
  opacity: 0;
}

.composer-focus-seg {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

html[data-theme="dark"] .composer-focus-seg {
  stroke-width: 1.3;
}

@media (prefers-reduced-motion: reduce) {
  .composer-focus-svg {
    opacity: 0 !important;
  }
}

/* --- 13. Settings -> Behavior Sub-Panel Helper Copy --- */
.profile-beh-note {
  margin: -2px 10px 8px 36px;
  font-size: 11.5px;
  line-height: 1.42;
  color: #71717a;
}

html[data-theme="dark"] .profile-beh-note {
  color: #a1a1aa;
}
