/* Google Material Design 3 (M3 Expressive) — June 2026
   Primary typeface: Google Sans (open-sourced 2025)
   Tokens: tonal surfaces, expressive shapes (12-32px), emphasized motion
   This is current 2026 Google design language, not speculative.
*/
/* Fonts vendored locally (lib/vendor/fonts) — same families, zero external requests */
@import url('/lib/vendor/fonts/roboto.css');
@import url('/lib/vendor/fonts/material-symbols.css');

/* Base rule for Material Symbols — must be present for icons to render as symbols instead of boxes/text */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Force unified 2026 Google M3 font (Google Sans first) — but NEVER override icon fonts */
html, body {
  font-family: var(--font-sans);
}
button, input, textarea, select,
.product-card-name, .google-header, .header-search-bar input,
#replica-viewport, .portal-hero, .detail-back-bar,
#gnimaSettingsModal, #gnimaSettingsModal h2, #gnimaSettingsModal button,
h1, h2, h3, h4, .product-card {
  font-family: var(--font-sans) !important;
}

/* Explicitly protect Material Symbols icons everywhere, especially in header */
.material-symbols-outlined,
.google-header .material-symbols-outlined,
.header-search-bar .material-symbols-outlined,
.header-actions .material-symbols-outlined,
.icon-btn .material-symbols-outlined,
.profile-dropdown-item .material-symbols-outlined,
.google-waffle-menu .material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal !important;
  font-style: normal !important;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

:root {
  /* Google Palette */
  --google-blue-rgb: 66, 133, 244;
  --google-red-rgb: 234, 67, 53;
  --google-yellow-rgb: 251, 188, 5;
  --google-green-rgb: 52, 168, 83;

  --google-blue: rgb(var(--google-blue-rgb));
  --google-red: rgb(var(--google-red-rgb));
  --google-yellow: rgb(var(--google-yellow-rgb));
  --google-green: rgb(var(--google-green-rgb));

  /* M3 Expressive Tonal Palette */
  --md-primary: #1b6ef3;
  --md-on-primary: #ffffff;
  --md-primary-container: #d3e3fd;
  --md-on-primary-container: #062e6f;
  --md-secondary-container: #dde3ea;
  --md-tertiary-container: #f3daff;
  --md-error: #ba1a1a;
  --md-error-container: #ffdad6;

  /* Core Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-tertiary: #747775;
  --border-color: transparent;
  --border-subtle: rgba(0,0,0,0.08);

  /* M3 Expressive Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
  --shadow-lg: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-xl: 0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3);

  /* M3 Surface Tint (tonal elevation) */
  --surface-tint: var(--google-blue);
  --surface-1: color-mix(in srgb, var(--surface-tint) 5%, var(--bg-primary));
  --surface-2: color-mix(in srgb, var(--surface-tint) 8%, var(--bg-primary));
  --surface-3: color-mix(in srgb, var(--surface-tint) 11%, var(--bg-primary));
  --surface-4: color-mix(in srgb, var(--surface-tint) 12%, var(--bg-primary));
  --surface-5: color-mix(in srgb, var(--surface-tint) 14%, var(--bg-primary));

  --glass-bg: rgba(255,255,255,0.72);
  --glass-blur: blur(24px);

  /* M3 Expressive Shape Scale */
  --border-radius-xs: 8px;
  --border-radius-sm: 12px;
  --border-radius-md: 16px;
  --border-radius-lg: 28px;
  --border-radius-xl: 32px;
  --border-radius-pill: 9999px;

  /* M3 Expressive Motion — Spring physics */
  --md-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-easing-emphasized-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-easing-emphasized-accel: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-easing-standard-decel: cubic-bezier(0, 0, 0, 1);
  --md-easing-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --md-duration-short1: 50ms;
  --md-duration-short2: 100ms;
  --md-duration-short3: 150ms;
  --md-duration-short4: 200ms;
  --md-duration-medium1: 250ms;
  --md-duration-medium2: 300ms;
  --md-duration-medium3: 350ms;
  --md-duration-medium4: 400ms;
  --md-duration-long1: 450ms;
  --md-duration-long2: 500ms;

  --transition-normal: all var(--md-duration-medium2) var(--md-easing-emphasized);
  /* 2026 Google M3 font stack — Google Sans (brand, open-sourced 2025) first for visible change from previous Outfit.
     Falls back to Roboto (M3 default) + system. */
  --font-sans: 'Google Sans', 'Google Sans Text', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  --header-height: 56px;

  /* Portal homepage — φ rhythm (shortcuts + vertical spacing) */
  --phi: 1.6180339887;
  --portal-band: calc(100vh - var(--header-height));
  --ntp-search-h: 44px;
  --ntp-search-max: min(584px, calc(100vw - 48px));
  --ntp-logo-size: clamp(306px, 48vw, 387px);
  --ntp-logo-search-gap: calc(var(--ntp-logo-size) / var(--phi));
  --portal-logo-shift: clamp(40px, 7vh, 72px);
  /* Shortcut row: icon → gap = icon/φ, col = icon×φ, label gap = gap/φ */
  --portal-shortcut-icon: clamp(34px, 5.25vw, 40px);
  --portal-shortcut-gap: calc(var(--portal-shortcut-icon) / var(--phi));
  --portal-shortcut-col: calc(var(--portal-shortcut-icon) * var(--phi));
  --portal-shortcut-label-gap: calc(var(--portal-shortcut-gap) / var(--phi));
  --portal-search-shortcut-gap: calc(var(--portal-shortcut-icon) * var(--phi));
  --ntp-shortcut-size: var(--portal-shortcut-icon);
  --ntp-shortcut-col: var(--portal-shortcut-col);
  --ntp-shortcut-gap: var(--portal-shortcut-gap);
  --ntp-shortcut-label-gap: var(--portal-shortcut-label-gap);
  --ntp-search-shortcut-gap: var(--portal-search-shortcut-gap);
  --portal-content-max: min(920px, 94vw);
  --portal-input-max: min(780px, calc(100vw - 48px));
  --portal-grid-max: calc((var(--portal-shortcut-col) * 4) + (var(--portal-shortcut-gap) * 3));
  --portal-gap-xl: 40px;
  --portal-gap-lg: calc(var(--portal-gap-xl) / var(--phi));
  --portal-gap-md: calc(var(--portal-gap-lg) / var(--phi));
  --portal-gap-sm: calc(var(--portal-gap-md) / var(--phi));
  --portal-logo-size: var(--ntp-logo-size);
  --portal-hero-inset: 0;
  --portal-type-base: 15px;
  --portal-type-sm: 13px;
  --portal-type-xs: 11px;
}

/* Dark Mode Tokens — M3 Expressive Dark Scheme */
[data-theme="dark"],
[data-theme="dark"] html {
  --bg-primary: #111111;
  --bg-secondary: #1b1b1f;
  --bg-tertiary: #232327;
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-tertiary: #8e918f;
  --border-color: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.5);
  --shadow-md: 0 2px 6px 2px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 8px 3px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.5);
  --shadow-xl: 0 6px 10px 4px rgba(0,0,0,0.4), 0 2px 3px rgba(0,0,0,0.5);
  --glass-bg: rgba(27,27,31,0.82);
  --glass-blur: blur(24px);

  --md-primary: #a8c7fa;
  --md-on-primary: #062e6f;
  --md-primary-container: #0842a0;
  --md-on-primary-container: #d3e3fd;
  --md-secondary-container: #3e4759;
  --md-tertiary-container: #633b7a;
  --md-error: #ffb4ab;
  --md-error-container: #93000a;

  --surface-tint: #a8c7fa;
  --surface-1: color-mix(in srgb, var(--surface-tint) 5%, var(--bg-primary));
  --surface-2: color-mix(in srgb, var(--surface-tint) 8%, var(--bg-primary));
  --surface-3: color-mix(in srgb, var(--surface-tint) 11%, var(--bg-primary));
  --surface-4: color-mix(in srgb, var(--surface-tint) 12%, var(--bg-primary));
  --surface-5: color-mix(in srgb, var(--surface-tint) 14%, var(--bg-primary));
}

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

html {
  background-color: var(--bg-primary);
}

html, body {
  height: 100%; /* better for percentage height propagation in immersive views like Gnima */
  min-height: 100vh;
}

body, button, input, select, textarea {
  font-family: var(--font-sans);
}
body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
body::before {
  content: '';
  position: fixed;
  left: 50%;
  top: 48%;
  width: min(720px, 70vw);
  height: min(440px, 48vh);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 52% 49% in oklab,
    oklch(0.63 0.2 251.22) 27%,
    oklch(0.67 0.21 25.81) 33%,
    oklch(0.9 0.19 93.93) 41%,
    oklch(0.79 0.25 150.49) 49%,
    oklch(0.63 0.2 251.22) 65%,
    oklch(0.72 0.21 150.89) 93%,
    oklch(0.63 0.2 251.22)
  );
  filter: blur(56px);
  opacity: 0.48;
  transform: translate(-50%, -50%);
  animation: gooAuraSpin 28s linear infinite;
  isolation: isolate;
  will-change: transform;
}
body:not([data-theme="dark"])::before { opacity: 0.22; }
@keyframes gooAuraSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

a {
  color: var(--google-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Google Header Navigation — transparent seamless */
.google-header {
  height: var(--header-height);
  border-bottom: none;
  background-color: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
  box-sizing: border-box;
  padding: 0;
}
.header-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  color: #e8eaed;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 4px;
  transition: background 0.2s, color 0.2s;
}
.header-back-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.product-active .header-back-btn {
  display: flex;
}
.product-active #currentAppPill {
  display: inline-flex !important;
}
.product-active .detail-back-bar {
  display: none !important;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 14px;
}

#headerSearchBar[data-gnima-hidden="1"] {
  display: none !important;
}
.header-search-bar {
  display: flex !important;
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 560px;
  align-items: center;
  background-color: rgba(128,128,128,0.08);
  border: none;
  border-radius: var(--border-radius-pill);
  padding: 0 12px;
  height: 40px;
  transition: var(--transition-normal);
}

.header-search-bar:focus-within {
  background-color: rgba(128,128,128,0.12);
  border: none;
  box-shadow: 0 2px 12px rgba(66,133,244,0.12);
}

.header-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 40px;
  padding: 0 4px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
}
.header-search-bar > span {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-size: 18px;
  line-height: 1;
}

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

.icon-btn {
  background: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Last-resort protection: HEADER icons must be symbols, not text (fixes "变成文本了") */
.google-header span.material-symbols-outlined,
.header-actions span.material-symbols-outlined,
.header-search-bar span.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-size: 20px !important;
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--google-blue), var(--google-red));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
  font-size: 13px;
  user-select: none;
  cursor: pointer;
  transition: box-shadow 0.2s, opacity 0.2s;
}
.profile-avatar:hover {
  box-shadow: 0 0 0 4px var(--hover-overlay);
  opacity: 0.9;
}

/* Hero & Main Portal View */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  padding: 0;
  min-height: 0; /* allow detail-view / Gnima to take exact remaining height without overflow */
}

.portal-hero {
  text-align: center;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--portal-band);
  /* Chrome NTP: block sits slightly above true vertical center */
  padding-bottom: calc(var(--header-height) + var(--ntp-search-shortcut-gap));
  margin-top: 0;
  font-family: var(--font-sans);
  font-size: var(--portal-type-base);
}

.hero-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(var(--portal-logo-shift));
  margin-bottom: max(12px, calc(var(--ntp-logo-search-gap) - var(--portal-logo-shift)));
  perspective: 1000px;
}

.hero-logo-img {
  display: block;
  width: var(--portal-logo-size);
  height: auto;
  max-width: min(92vw, calc(var(--portal-logo-size) * 2.85));
  max-height: none;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.12));
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: transparent;
  border-radius: 8px;
}

[data-theme="dark"] .hero-logo-img {
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4)) brightness(1.02);
}

.hero-logo-img:hover {
  transform: scale(1.03) rotateX(3deg) rotateY(-3deg);
  filter: drop-shadow(0 14px 36px rgba(0,0,0,0.2));
}

[data-theme="dark"] .hero-logo-img:hover {
  filter: drop-shadow(0 16px 40px rgba(0,0,0,0.55)) brightness(1.03);
}

/* Search Autocomplete Suggestions */
.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--ntp-search-h) + 8px);
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 150;
  display: none;
  flex-direction: column;
  padding: 8px 0;
  overflow: hidden;
  text-align: left;
}

.search-suggestions.active {
  display: flex;
}

.suggestion-item {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.suggestion-item:hover {
  background-color: var(--bg-secondary);
}

.suggestion-icon {
  color: var(--text-tertiary);
  font-size: 20px;
  display: grid;
  place-items: center;
}

.suggestion-info {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-size: var(--portal-type-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.suggestion-tagline {
  font-size: var(--portal-type-xs);
  color: var(--text-tertiary);
  font-family: var(--font-sans);
}

.hero-title {
  font-size: 56px;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.hero-search-wrapper {
  width: 100%;
  max-width: min(780px, calc(100% - 24px));
  margin-bottom: 0;
}

.portal-shortcuts {
  width: 100%;
  max-width: min(var(--portal-grid-max), 100%);
  margin-top: var(--portal-search-shortcut-gap);
}

/* ── Hero Gnima Input (from gnima input/ — Gemini animated pill) ── */
@property --hero-gemini-rotation {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.hero-gnima-input-wrap {
  position: relative;
  width: 100%;
}

.hero-gemini-input {
  --border-size: 2px;
  --hero-gemini-gradient: conic-gradient(
    from 0deg at 52% 49% in oklab,
    oklch(0.63 0.2 251.22) 27%,
    oklch(0.67 0.21 25.81) 33%,
    oklch(0.9 0.19 93.93) 41%,
    oklch(0.79 0.25 150.49) 49%,
    oklch(0.63 0.2 251.22) 65%,
    oklch(0.72 0.21 150.89) 93%,
    oklch(0.63 0.2 251.22)
  );
  border-radius: 4rem;
  background: none;
  position: relative;
  padding: 0;
  border: var(--border-size) solid var(--border-subtle);
  width: 100%;
  height: var(--ntp-search-h);
  box-sizing: border-box;
}

/* Shared chat-style interior (homepage + Gnima) */
.hero-gemini-input.gemini-chat-input {
  height: auto;
  min-height: 52px;
  border-radius: 28px;
}

.hero-gemini-input.gemini-chat-input .inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 6px;
  height: auto;
  min-height: 48px;
  grid-template-columns: unset;
}

.hero-gemini-input.gemini-chat-input .gnima-input-field {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  font-size: 15px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  min-width: 0;
  max-height: 120px;
  -webkit-appearance: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
  box-shadow: none;
}

.hero-gemini-input.gemini-chat-input .gnima-input-field::placeholder {
  color: var(--text-tertiary);
}

.hero-gemini-input::after {
  content: '';
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--hero-gemini-gradient);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 0;
  filter: blur(15px);
  border-radius: inherit;
  pointer-events: none;
}

.hero-gemini-input .inner {
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0 14px;
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 2;
  border-radius: inherit;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--portal-type-base);
  width: 100%;
  box-sizing: border-box;
  transition: background 0.2s var(--md-easing-standard);
}

.hero-gemini-input .border {
  position: absolute;
  inset: calc(var(--border-size) * -1);
  mask: linear-gradient(white, white);
  -webkit-mask: linear-gradient(white, white);
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hero-gemini-input .border::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--hero-gemini-gradient);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: -1;
  filter: blur(5px);
}

.hero-gemini-icon-btn,
.hero-gemini-input input {
  color: var(--text-secondary);
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.hero-gemini-icon-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.hero-gemini-icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.hero-gemini-input input {
  font-size: var(--portal-type-base);
  font-weight: 400;
  line-height: 1.4;
  width: 100%;
  min-width: 0;
  outline: none;
  box-shadow: none;
  border: none;
}

/* No focus ring / box on Gemini pill inputs — keep shell visually stable while typing */
.hero-gemini-input input:focus,
.hero-gemini-input input:focus-visible,
.hero-gemini-input textarea:focus,
.hero-gemini-input textarea:focus-visible,
.hero-gemini-icon-btn:focus,
.hero-gemini-icon-btn:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  border: none !important;
  border-color: transparent !important;
}

.hero-gemini-input input:not(:placeholder-shown) {
  color: var(--text-primary);
}

.hero-gemini-input:focus-within .inner {
  background: var(--bg-primary);
}

@keyframes heroGeminiRotate {
  to {
    --hero-gemini-rotation: 360deg;
  }
}

.hero-gnima-input-wrap .search-suggestions {
  top: calc(100% + 6px);
}

.hero-gemini-input.has-suggestions {
  border-bottom-left-radius: 1.25rem;
  border-bottom-right-radius: 1.25rem;
}

.hero-gemini-input.has-suggestions .inner {
  border-bottom-left-radius: 1.25rem;
  border-bottom-right-radius: 1.25rem;
}

.hero-gemini-input.has-suggestions + .search-suggestions {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: -2px;
}

.search-box-large {
  display: flex;
  align-items: center;
  background-color: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-pill);
  padding: 0 24px;
  height: 52px;
  box-shadow: none;
  transition: all 0.25s ease;
}

.search-box-large .material-symbols-outlined {
  font-size: 24px;
}

.search-box-large:hover {
  background-color: var(--surface-2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.search-box-large:focus-within {
  background-color: var(--surface-2);
  border-color: var(--google-blue);
  box-shadow: 0 4px 24px rgba(66, 133, 244, 0.15);
}

.search-box-large input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  padding-left: 14px;
  font-size: 17px;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.search-buttons {
  display: flex;
  gap: var(--portal-gap-sm);
  margin-top: var(--portal-gap-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Google Homepage button row (1:1 vs google.com .FPdoLc + .gNO89b / .RNmpXc) ── */
.hero-search-wrapper .search-buttons {
  /* .FPdoLc: padding-top 18px; buttons carry margin-top 11px → 29px below search bar */
  display: block;
  margin-top: 0;
  padding: 18px 0 0;
  text-align: center;
  gap: 0;
  flex-wrap: nowrap;
}

.hero-search-wrapper .search-buttons .btn.btn-secondary-google {
  /* Override global .btn pill / flex — match google.com submit inputs */
  display: inline-block;
  vertical-align: middle;
  align-items: unset;
  justify-content: unset;
  gap: 0;
  box-sizing: border-box;
  background-color: #f8f9fa;
  border: 1px solid #f8f9fa;
  border-radius: 8px;
  color: #3c4043;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  height: 36px;
  min-height: 0;
  min-width: 54px;
  padding: 0 16px;
  margin: 11px 4px;
  box-shadow: none;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: none;
}

.hero-search-wrapper .search-buttons .btn.btn-secondary-google:hover {
  background-color: #f8f9fa;
  border-color: #dadce0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  color: #202124;
}

.hero-search-wrapper .search-buttons .btn.btn-secondary-google:active {
  border-color: #4285f4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .hero-search-wrapper .search-buttons .btn.btn-secondary-google {
  background-color: #303134;
  border-color: #303134;
  color: #e8eaed;
}

[data-theme="dark"] .hero-search-wrapper .search-buttons .btn.btn-secondary-google:hover {
  background-color: #303134;
  border-color: #5f6368;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  color: #e8eaed;
}

@media (max-width: 420px) {
  .hero-search-wrapper .search-buttons .btn.btn-secondary-google {
    font-size: 13px;
    padding: 0 12px;
  }
}

/* Material Design Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 0 24px;
  height: 38px;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
  user-select: none;
}

.btn-secondary-google {
  background-color: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--portal-type-sm);
  height: 34px;
  padding: 0 18px;
}
.btn-secondary-google:hover {
  border-color: var(--border-color);
  background-color: var(--surface-3);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--google-blue);
  color: white;
}
.btn-primary:hover {
  background-color: #1557b0;
  box-shadow: 0 1px 3px 0 rgba(66,133,244,0.3), 0 4px 8px 3px rgba(66,133,244,0.15);
}

.btn-outline {
  border: none;
  background: rgba(66, 133, 244, 0.08);
  color: var(--google-blue);
}
.btn-outline:hover {
  background-color: rgba(66, 133, 244, 0.14);
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
}
.btn-text:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Product shortcut row — Chrome NTP proportions */
.products-grid-section {
  display: none;
}

.portal-shortcuts .products-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--portal-shortcut-gap);
  max-width: 100%;
  margin: 0 auto;
}

.product-card {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  width: var(--portal-shortcut-col);
  flex: 0 0 var(--portal-shortcut-col);
  transition: background-color 0.15s ease;
}

.product-card:hover {
  background-color: transparent;
}

.product-card::after {
  display: none;
}

.product-card-icon {
  width: var(--portal-shortcut-icon);
  height: var(--portal-shortcut-icon);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: calc(var(--portal-shortcut-icon) * 0.46);
  margin-bottom: var(--portal-shortcut-label-gap);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.product-card:hover .product-card-icon {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.product-card-name {
  font-size: clamp(10px, calc(var(--portal-shortcut-icon) / var(--phi) / 1.05), var(--portal-type-xs));
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: var(--portal-shortcut-col);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card:hover .product-card-name {
  color: var(--text-primary);
}

.icon-blue { background-color: var(--google-blue); }
.icon-red { background-color: var(--google-red); }
.icon-yellow { background-color: var(--google-yellow); }
.icon-green { background-color: var(--google-green); }
.icon-img {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  /* Ensure embedded product icons (logo style round images) always display */
}
.icon-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.product-badge { display: none; }
.card-header-info { display: none; }
.product-card h3 { display: none; }
.product-card .tagline { display: none; }
.product-card .desc { display: none; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-footer { display: none; }
.card-learn-more { display: none; }

/* Product Detail Views */
.product-detail-view {
  display: none; /* Controlled by routing */
  padding: 0;
  flex: 1;
  min-height: 0;
  background-color: transparent;
  position: relative;
}

/* When a product (especially immersive Gnima) is active, make the detail fill the exact remaining height */
body.product-active .product-detail-view {
  height: 100%;
  min-height: 0;
}

#replica-viewport {
  background-color: transparent;
  min-height: calc(100vh - var(--header-height));
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0; /* allow Gnima root inside to shrink properly */
}

.detail-back-bar {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 50;
  background-color: transparent;
  border-bottom: none;
  padding: 0;
  transition: all 0.3s ease;
}

.detail-back-bar .container {
  padding: 0;
  max-width: none;
}

.detail-back-bar .back-link {
  margin-bottom: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--md-easing-standard);
  background: var(--surface-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.back-link:hover {
  color: var(--text-primary);
  background: var(--surface-3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media(min-width: 900px) {
  .product-detail-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.product-info-column {
  display: flex;
  flex-direction: column;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.product-detail-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
}

.product-detail-title {
  font-size: 36px;
  font-weight: 600;
}

.product-detail-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

/* Material Tab System */
.tab-container {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  font-family: var(--font-sans);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--google-blue);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--google-blue);
  border-radius: 3px 3px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Spec Tables */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.spec-table th, .spec-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table th {
  font-weight: 600;
  color: var(--text-primary);
  background-color: transparent;
}

.spec-table td {
  color: var(--text-secondary);
}

/* Satire Callout Alerts */
.satire-quote {
  background-color: rgba(128,128,128,0.05);
  border-left: 3px solid var(--google-red);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: var(--border-radius-sm);
}

.satire-quote p {
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.satire-quote cite {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Product Simulator Layout (Right Column) */
.product-simulator-column {
  background-color: rgba(128,128,128,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 480px;
  box-shadow: none;
  transition: all 0.3s ease;
}

.simulator-header {
  margin-bottom: 24px;
}

.simulator-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.simulator-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.simulator-screen {
  flex: 1;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 1. Cream Ciao Simulator */
.ciao-phone-container {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.ciao-phone-header {
  height: 40px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ciao-phone-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-content: start;
}

.ciao-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
}

.ciao-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  transition: transform 0.2s;
}

.ciao-app-item:hover .ciao-app-icon {
  transform: scale(1.08);
}

.ciao-app-label {
  font-size: 11px;
  font-weight: 500;
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ciao-detail-modal {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary);
  display: none;
  flex-direction: column;
  padding: 16px;
  z-index: 10;
}

.ciao-detail-header {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ciao-detail-info h4 {
  font-size: 16px;
  font-weight: 600;
}

.ciao-detail-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.ciao-install-banner {
  background-color: #e8f0fe;
  color: var(--google-blue);
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* 2. CreamGram Simulator */
.gram-chat-container {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.gram-messages-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-message {
  max-width: 75%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 18px;
  word-wrap: break-word;
}

.gram-message.incoming {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.gram-message.outgoing {
  background-color: var(--google-blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.gram-input-area {
  border-top: 1px solid var(--border-color);
  padding: 12px;
  display: flex;
  gap: 8px;
}

.gram-input-area input {
  flex: 1;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-pill);
  padding: 0 14px;
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
}

.gram-input-area input:focus {
  border-color: var(--google-blue);
}

.gram-stats-banner {
  font-size: 11px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
}

/* 3. Creammy Simulator */
.creammy-player-container {
  height: 380px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.creammy-video-screen {
  flex: 1;
  background-color: #000;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.creammy-video-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.creammy-video-overlay.ad-running {
  background-color: var(--google-red);
}

.creammy-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.9);
  color: #000;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 4;
}

.creammy-play-btn:hover {
  transform: scale(1.1);
}

.creammy-canvas-loading {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: none;
}

.creammy-controls {
  height: 48px;
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.creammy-controls span {
  color: white;
  cursor: pointer;
}

.creammy-progress {
  flex: 1;
  height: 4px;
  background-color: #555;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.creammy-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--google-red);
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
}

.creammy-compare-panel {
  padding: 12px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 12px;
}

.creammy-compare-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* 4. Creampie Simulator */
.pie-calc-container {
  padding: 20px;
  height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pie-slider-group {
  margin-bottom: 16px;
}

.pie-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.pie-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--google-blue);
}

.pie-compare-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  font-size: 12px;
}

.pie-compare-grid {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  gap: 8px;
  margin-top: 8px;
}

.pie-compare-header {
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
}

.pie-cost-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 16px;
}

.pie-cost-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--google-green);
}

/* 5. EroClub Simulator */
.eroclub-code-container {
  height: 380px;
  display: flex;
  flex-direction: column;
}

.eroclub-toolbar {
  height: 48px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.toggle-switch input {
  cursor: pointer;
}

.eroclub-editor {
  flex: 1;
  background-color: #1e1e1e;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 16px;
  position: relative;
  overflow-y: auto;
  line-height: 1.5;
}

.eroclub-line {
  display: flex;
}

.eroclub-line-num {
  width: 24px;
  color: #858585;
  user-select: none;
}

.eroclub-suggest {
  color: #6a9955;
  background-color: rgba(106, 153, 85, 0.15);
  border-bottom: 1px dashed #6a9955;
  cursor: pointer;
  position: relative;
}

.eroclub-suggest::after {
  content: 'Tab to accept Copilot (Wrong 40% of the time)';
  position: absolute;
  bottom: 18px;
  left: 0;
  background-color: var(--google-red);
  color: white;
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  font-family: var(--font-sans);
}

.eroclub-status {
  padding: 8px 16px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-secondary);
}

/* 6. Gnima Simulator */
/* 5b. GNIMA (Gemini-replica) — kept for legacy compat */
.gnima-chat-container { display:none; }

/* 7. Gream Simulator */
.gream-browser-container {
  height: 380px;
  display: flex;
  flex-direction: column;
}

.gream-address-bar {
  height: 48px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.gream-nav-icons {
  display: flex;
  gap: 4px;
}

.gream-url-input {
  flex: 1;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background-color: var(--bg-primary);
  padding: 0 12px;
  font-size: 12px;
  outline: none;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.gream-viewport {
  flex: 1;
  background-color: var(--bg-primary);
  padding: 20px;
  overflow-y: auto;
}

.gream-webpage {
  font-size: 13px;
}

.gream-tracker-log {
  margin-top: 16px;
  padding: 10px;
  background-color: #fff9e6;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  font-size: 11px;
  color: #856404;
}

.gream-tracker-log.clean {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* 8. JOI Simulator */
.joi-dashboard-container {
  padding: 20px;
  height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.joi-rings-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.joi-ring-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.joi-svg-ring {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.joi-svg-ring circle {
  fill: none;
  stroke-width: 8;
}

.joi-svg-ring .bg-circle {
  stroke: var(--bg-tertiary);
}

.joi-svg-ring .fg-circle {
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transition: stroke-dashoffset 1s ease-out;
  stroke-linecap: round;
}

.joi-svg-ring.steps .fg-circle { stroke: var(--google-blue); }
.joi-svg-ring.heart .fg-circle { stroke: var(--google-red); }
.joi-svg-ring.sleep .fg-circle { stroke: var(--google-purple, #8a2be2); }

.joi-ring-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.joi-ring-value {
  font-size: 14px;
  font-weight: 700;
}

.joi-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.joi-status-bar {
  padding: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 11px;
  text-align: center;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer elements */
.google-footer {
  background-color: transparent;
  border-top: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
}

/* Hide footer when viewing a product */
body.product-active .google-footer {
  display: none;
}

/* ========== Header Responsive Layout & Typography ========== */

/* Wide desktop: give search a bit more room */
@media (min-width: 1200px) {
  :root { --header-height: 56px; }
  .header-search-bar { max-width: 620px; }
  .header-container { gap: 16px; }
}

/* Tablet (with back-btn possible): balanced compact */
@media (min-width: 601px) and (max-width: 1199px) {
  .header-search-bar {
    max-width: 340px;
    height: 38px;
    padding: 0 10px;
  }
  .header-container { gap: 10px; }
  .header-search-bar input { font-size: 13.5px; }
  .header-search-bar > span { font-size: 17px; }
  .icon-btn { width: 36px; height: 36px; }
  .profile-avatar { width: 28px; height: 28px; font-size: 12px; }
}

/* Mobile: hide search by default, compact everything */
@media (max-width: 600px) {
  :root { --header-height: 50px; }
  .google-header {
    padding: 0;
  }
  .google-header .container {
    padding: 0 10px;
  }
  .header-search-bar {
    display: none !important;
    max-width: none;
    height: 36px;
    padding: 0 8px;
  }
  .header-container { gap: 6px; }
  .header-back-btn {
    width: 32px;
    height: 32px;
    margin-right: 2px;
  }
  .icon-btn { width: 32px; height: 32px; }
  .profile-avatar { width: 26px; height: 26px; font-size: 11px; }
  .header-actions { gap: 4px; }
  .header-search-bar input { font-size: 13px; }
  .header-search-bar > span { font-size: 16px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .google-header .container { padding: 0 6px; }
  .header-container { gap: 4px; }
  .icon-btn { width: 30px; height: 30px; }
  .profile-avatar { width: 24px; height: 24px; }
}

@media (max-width: 600px) {
  .portal-shortcuts .products-grid {
    flex-wrap: nowrap;
    gap: var(--portal-shortcut-gap);
    max-width: 100%;
  }
  .hero-search-wrapper {
    max-width: min(100%, 780px);
    padding: 0 8px;
  }
  .hero-gemini-input.gemini-chat-input { border-radius: 22px; min-height: 46px; }
  .hero-gemini-input.gemini-chat-input .inner { padding: 3px 6px 3px 4px; min-height: 42px; }
  .portal-hero {
    min-height: var(--portal-band);
    padding: 0 16px calc(var(--header-height) + var(--portal-search-shortcut-gap));
  }
  .portal-shortcuts {
    margin-top: var(--portal-search-shortcut-gap);
  }
}

@media (max-width: 380px) {
  :root {
    --portal-shortcut-icon: clamp(30px, 9vw, 36px);
  }
}

/* Google Waffle Menu */
.google-waffle-menu {
  position: absolute;
  right: 0;
  top: calc(var(--header-height) + 4px);
  width: 320px;
  max-height: 480px;
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 16px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
  z-index: 200;
  overflow-y: auto;
  animation: waffle-slide-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes waffle-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.google-waffle-menu.active {
  display: grid;
}
@media (max-width: 600px) {
  .google-waffle-menu .waffle-item { padding: 6px 4px; gap: 6px; }
  .google-waffle-menu .waffle-icon-wrapper { width: 44px; height: 44px; }
  .google-waffle-menu .waffle-item-name { font-size: 11px; max-width: 100%; }
}

.goo-sheet {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: auto;
  box-sizing: border-box;
  font-family: var(--font-sans);
}
.goo-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  font-size: 16px;
  font-weight: 500;
}
.goo-sheet-head button,
.goo-card-refresh {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: inherit;
}
.goo-sheet-head button:hover,
.goo-card-refresh:hover { background: var(--bg-secondary); }
.goo-sheet-list { padding: 0 0 4px; }
.goo-empty {
  padding: 28px 18px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}
.goo-card {
  margin: 8px 12px 14px;
  padding: 14px;
  border-radius: 20px;
  background: var(--bg-secondary);
}
.goo-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}
.goo-card-title .material-symbols-outlined { font-size: 20px; }
.goo-card-refresh { margin-left: auto; }
.goo-card-copy {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.goo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.goo-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border: none;
  border-radius: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
}
.goo-action .material-symbols-outlined { font-size: 20px; color: #8ab4f8; }
.goo-action:hover { background: var(--bg-tertiary, rgba(255,255,255,0.06)); }
.goo-notif-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.goo-notif-row strong { display: block; font-size: 14px; font-weight: 500; }
.goo-notif-row span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
#notifPanel.notif-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  left: auto;
  bottom: auto;
  width: 360px;
  max-width: min(360px, calc(100vw - 16px));
  height: auto;
  max-height: min(72vh, 520px);
  margin: 0;
  z-index: 9999;
}
#notifPanel.notif-panel.open { display: block; }
@media (max-width: 600px) {
  .google-waffle-menu,
  .google-waffle-menu.active,
  #notifPanel.notif-panel,
  #notifPanel.notif-panel.open,
  .profile-dropdown,
  .profile-dropdown.active {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 12px;
    right: 12px;
    bottom: auto;
    width: auto;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - var(--header-height) - 20px);
    margin: 0;
    animation: none;
    transform: none;
  }
}

.waffle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: center;
}

.waffle-item:hover {
  background-color: var(--bg-secondary);
}

.waffle-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: white;
}

.waffle-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.waffle-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waffle-item:hover .waffle-icon-wrapper {
  transform: scale(1.06);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border-color: var(--google-blue);
}

.waffle-icon-wrapper {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, box-shadow 0.2s;
}

/* Autocomplete suggestion keyboard select highlight styling */
.suggestion-item.selected {
  background-color: var(--bg-tertiary);
}

/* ==========================================
   HIGH-FIDELITY 1-to-1 MOCKUP STYLES
   ========================================== */

/* Universal Mockup Container */
.replica-container {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: visible;
  position: relative;
}

/* 1. YOUTUBE REPLICA (Creammy) */
.yt-layout {
  display: flex;
  flex: 1;
  background-color: #f9f9f9;
}
[data-theme="dark"] .yt-layout {
  background-color: #0f0f0f;
}
.yt-sidebar {
  width: 240px;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  font-size: 14px;
}
.yt-sidebar-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  cursor: pointer;
  border-radius: 10px;
  margin: 0 12px;
}
.yt-sidebar-item:hover, .yt-sidebar-item.active {
  background-color: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .yt-sidebar-item:hover, [data-theme="dark"] .yt-sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.1);
}
.yt-main {
  flex: 1;
  padding: 24px;
  display: flex;
  gap: 24px;
  overflow-y: auto;
  max-height: 600px;
}
.yt-video-column {
  flex: 2.2;
  display: flex;
  flex-direction: column;
}
.yt-player {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.yt-player-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.yt-player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.yt-progress-container {
  height: 4px;
  background-color: rgba(255,255,255,0.3);
  cursor: pointer;
  position: relative;
  border-radius: 2px;
}
.yt-progress-bar {
  height: 100%;
  background-color: #ff0000;
  width: 0;
}
.yt-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}
.yt-title {
  font-size: 20px;
  font-weight: bold;
  margin: 12px 0 8px 0;
  line-height: 1.4;
}
.yt-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.yt-channel-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.yt-channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.yt-sub-btn {
  background-color: #0f0f0f;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 18px;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}
[data-theme="dark"] .yt-sub-btn {
  background-color: #fff;
  color: #0f0f0f;
}
.yt-actions {
  display: flex;
  gap: 8px;
}
.yt-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}
[data-theme="dark"] .yt-action-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}
.yt-description {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  cursor: pointer;
}
[data-theme="dark"] .yt-description {
  background-color: rgba(255, 255, 255, 0.05);
}
.yt-sidebar-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.yt-side-card {
  display: flex;
  gap: 8px;
  cursor: pointer;
}
.yt-side-thumb {
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  background-color: #333;
  position: relative;
  overflow: hidden;
}
.yt-side-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.yt-side-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
}
.yt-side-author {
  font-size: 11px;
  color: var(--text-secondary);
}

/* 2. GOOGLE DRIVE REPLICA (Creampie) */
.drive-layout {
  display: flex;
  flex: 1;
}
.drive-sidebar {
  width: 240px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}
.drive-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  width: fit-content;
  transition: box-shadow 0.2s;
}
.drive-new-btn:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.drive-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 2px;
}
.drive-menu-item.active {
  background-color: rgba(66, 133, 244, 0.15);
  color: var(--google-blue);
  font-weight: 500;
}
.drive-menu-item:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .drive-menu-item:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
}
.drive-storage-section {
  margin-top: auto;
  padding: 16px 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drive-storage-bar {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}
.drive-storage-fill {
  height: 100%;
  background-color: var(--google-blue);
  width: 40%;
}
.drive-main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 600px;
}
.drive-grid-title {
  font-size: 14px;
  font-weight: 500;
  margin: 16px 0 12px 0;
  color: var(--text-secondary);
}
.drive-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.drive-folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--bg-secondary);
  transition: background-color 0.2s;
}
.drive-folder-card:hover {
  background-color: rgba(0, 0, 0, 0.03);
}
[data-theme="dark"] .drive-folder-card:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
.drive-files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.drive-files-table th, .drive-files-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.drive-files-table th {
  color: var(--text-secondary);
  font-weight: 500;
}
.drive-files-table tr:hover {
  background-color: rgba(0,0,0,0.02);
}
[data-theme="dark"] .drive-files-table tr:hover {
  background-color: rgba(255,255,255,0.02);
}
.drive-calc-overlay {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

/* 3. GOOGLE CHAT REPLICA (CreamGram) */
.chat-layout {
  display: flex;
  flex: 1;
  background-color: var(--bg-primary);
}
.chat-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.chat-sidebar-section {
  padding: 12px;
}
.chat-section-header {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.chat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
}
.chat-user-item.active {
  background-color: rgba(66, 133, 244, 0.1);
  color: var(--google-blue);
  font-weight: 500;
}
.chat-user-item:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .chat-user-item:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
}
.chat-avatar-status {
  position: relative;
  width: 32px;
  height: 32px;
}
.chat-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  background-color: #34a853;
}
.chat-status-dot.away {
  background-color: #fbbc05;
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 600px;
}
.chat-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg-row {
  display: flex;
  gap: 12px;
}
.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--border-color);
  display: grid;
  place-items: center;
  font-weight: bold;
}
.chat-msg-bubble {
  background-color: var(--bg-secondary);
  padding: 10px 16px;
  border-radius: 0 16px 16px 16px;
  max-width: 70%;
  font-size: 14px;
  line-height: 1.4;
}
.chat-msg-row.outgoing {
  flex-direction: row-reverse;
}
.chat-msg-row.outgoing .chat-msg-bubble {
  background-color: rgba(66, 133, 244, 0.15);
  border-radius: 16px 0 16px 16px;
}
.chat-input-container {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}
.chat-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 16px;
}
.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

/* 4. GOOGLE PLAY STORE REPLICA (Cream Ciao) */
.play-layout {
  display: flex;
  flex: 1;
  background-color: var(--bg-primary);
}
.play-sidebar {
  width: 220px;
  border-right: 1px solid var(--border-color);
  padding: 16px 8px;
}
.play-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}
.play-menu-item.active {
  background-color: rgba(1, 135, 95, 0.1);
  color: #01875f;
  font-weight: 500;
}
.play-menu-item:hover:not(.active) {
  background-color: rgba(0,0,0,0.03);
}
.play-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: 600px;
}
.play-detail-layout {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
}
.play-app-icon {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.play-app-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.play-app-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 4px;
}
.play-app-dev {
  color: #01875f;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 12px;
}
.play-app-stats {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}
.play-stat-item {
  text-align: center;
}
.play-stat-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.play-install-btn {
  background-color: #01875f;
  color: white;
  border: none;
  padding: 10px 32px;
  border-radius: 20px;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
}
.play-install-btn:hover {
  background-color: #00704e;
}
.play-install-btn:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
}

/* 5. GEMINI REPLICA (Gnima) */
/* ============================================
   5. GNIMA — Authentic Gemini-style UI (Safari + Chrome + Firefox)
   ============================================ */
.gnima-root {
  display: -webkit-flex;
  display: flex;
  height: 100%;
  flex: 1; /* ensure it consumes the full available height from replica-viewport */
  min-height: 0; /* critical for flex children to be able to shrink below content size */
  background: transparent;
  color: #e3e3e3;
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  contain: layout size style;
}

/* Small window / not "full screen" robustness */
@media (max-height: 700px) {
  .gnima-root { min-height: 280px; }
  .gnima-chat-scroll { padding-top: 28px; }
}

/* ---------- Sidebar ---------- */
:root {
  --gnima-sidebar-w: 268px;
  --gnima-sidebar-collapsed-w: 72px;
}
.gnima-sidebar {
  width: var(--gnima-sidebar-w);
  background: #000;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  padding: 12px 8px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  overflow: hidden;
  -webkit-transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
  contain: layout style;
}
body.product-active .gnima-root { contain: none; }
body.product-active .gnima-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  z-index: 400;
  contain: none;
  background: #000;
}
body.product-active .gnima-main { margin-left: var(--gnima-sidebar-w); }
body.product-active .gnima-sidebar.collapsed + .gnima-main {
  margin-left: var(--gnima-sidebar-collapsed-w);
}
body.product-active:has(#gnimaRoot) .google-header { display: none !important; }
body.product-active:has(#gnimaRoot) #detail-view {
  animation: none;
  transform: none !important;
}
body.product-active:has(#gnimaRoot) #replica-viewport { min-height: 100dvh; }
.gnima-sidebar-logo { cursor: pointer; }
.gnima-sidebar.collapsed {
  width: var(--gnima-sidebar-collapsed-w);
  padding: 12px 4px;
}
.gnima-sidebar-header {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
}
.gnima-sidebar.collapsed .gnima-sidebar-header {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  margin-bottom: 10px;
}
.gnima-sidebar.collapsed .gnima-sidebar-logo {
  width: 24px; height: 24px;
  flex-shrink: 0;
}
.gnima-sidebar.collapsed .gnima-sidebar-toggle {
  width: 32px; height: 32px;
  margin-left: 0;
}
.gnima-sidebar-logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.gnima-sidebar-logo img {
  width: 28px; height: 28px;
  object-fit: contain;
}
.gnima-sidebar.collapsed .gnima-sidebar-logo img {
  width: 24px; height: 24px;
}
.gnima-sidebar-logo .material-symbols-outlined { font-size: 16px; color: white; }
.gnima-sidebar .material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400; }
.gnima-sidebar-title {
  font-size: 18px; font-weight: 500; color: #e3e3e3;
  white-space: nowrap; overflow: hidden;
  transition: opacity .12s ease, max-width .18s ease;
}
.gnima-sidebar.collapsed .gnima-sidebar-title,
.gnima-sidebar.collapsed .gnima-newchat-text,
.gnima-sidebar.collapsed .gnima-search-text,
.gnima-sidebar.collapsed .gnima-nav-text,
.gnima-sidebar.collapsed .gnima-nav-label,
.gnima-sidebar.collapsed .gnima-hist-text,
.gnima-sidebar.collapsed .gnima-sidebar-footer-info {
  display: none;
  opacity: 0;
  max-width: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.gnima-sidebar.collapsed .gnima-newchat-btn,
.gnima-sidebar.collapsed .gnima-search-btn,
.gnima-sidebar.collapsed .gnima-nav-btn,
.gnima-sidebar.collapsed .gnima-hist-item {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
  width: 100%;
}
.gnima-sidebar.collapsed .gnima-newchat-btn .material-symbols-outlined,
.gnima-sidebar.collapsed .gnima-search-btn .material-symbols-outlined,
.gnima-sidebar.collapsed .gnima-nav-btn .material-symbols-outlined,
.gnima-sidebar.collapsed .gnima-hist-item .material-symbols-outlined {
  font-size: 20px;
}

/* Collapsed: pure icon mode — tight, centered, consistent sizing */
.gnima-sidebar.collapsed {
  padding: 8px 2px;
}
.gnima-sidebar.collapsed .gnima-sidebar-header {
  padding: 8px 0 4px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.gnima-sidebar.collapsed .gnima-newchat-btn,
.gnima-sidebar.collapsed .gnima-search-btn,
.gnima-sidebar.collapsed .gnima-nav-btn {
  padding: 8px 0;
  min-height: 40px;
  margin-bottom: 2px;
  background: transparent;
}
.gnima-sidebar.collapsed .gnima-hist-item {
  padding: 4px 0;
  min-height: 26px;
  border-radius: 6px;
}
.gnima-sidebar.collapsed .gnima-hist-item .material-symbols-outlined,
.gnima-sidebar.collapsed #gnimaMemList .material-symbols-outlined {
  font-size: 18px;
}
.gnima-sidebar.collapsed .gnima-sidebar-footer {
  padding: 4px 0;
  gap: 4px;
}
.gnima-sidebar.collapsed .gnima-sidebar-avatar {
  width: 28px; height: 28px;
  font-size: 12px;
}
.gnima-sidebar.collapsed .gnima-sidebar-settings {
  width: 22px; height: 22px;
}

.gnima-sidebar-toggle {
  margin-left: auto;
  background: none; border: none; cursor: pointer; color: #9aa0a6;
  width: 32px; height: 32px; border-radius: 50%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.gnima-sidebar-toggle:hover { background: rgba(255,255,255,0.08); }

.gnima-newchat-btn {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 10px;
  padding: 10px 16px; border-radius: 24px;
  background: #2d2e30; border: none;
  color: #e3e3e3; font-size: 14px;
  cursor: pointer; margin-bottom: 3px; width: 100%;
  text-align: left; font-family: inherit;
  -webkit-appearance: none;
  transition: background .1s ease, transform .08s ease;
}
.gnima-newchat-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-newchat-btn:active { transform: scale(0.985); }
.gnima-newchat-btn .material-symbols-outlined { font-size: 18px; }
.gnima-newchat-text, .gnima-search-text { transition: opacity .12s ease, max-width .18s ease; overflow: hidden; white-space: nowrap; }

.gnima-search-btn {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  padding: 10px 16px; border-radius: 24px;
  background: transparent; border: none;
  color: #c4c7c5; font-size: 14px;
  cursor: pointer; margin-bottom: 8px; width: 100%;
  text-align: left; font-family: inherit;
  -webkit-appearance: none;
}
.gnima-search-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-search-btn .material-symbols-outlined { font-size: 18px; }
.gnima-nav-btn {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  padding: 10px 16px; border-radius: 24px;
  background: transparent; border: none;
  color: #c4c7c5; font-size: 14px;
  cursor: pointer; margin-bottom: 1px; width: 100%;
  text-align: left; font-family: inherit;
  -webkit-appearance: none;
}
.gnima-nav-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-nav-btn .material-symbols-outlined { font-size: 18px; color: #c4c7c5; }
.gnima-nav-label {
  font-size: 12px; color: #9aa0a6; padding: 14px 16px 4px;
  font-weight: 500;
}

#ie-toolbar,
#slide-counter,
.edit-toast {
  display: none !important;
}
body.slides-open #ie-toolbar,
body.slides-open #slide-counter {
  display: flex !important;
}
.gnima-hist-section {
  -webkit-flex: 1;
  flex: 1; overflow-y: auto; padding: 0 2px;
  scrollbar-width: thin; scrollbar-color: #444 transparent;
  -webkit-overflow-scrolling: touch;
  contain: content;
}
.gnima-hist-section::-webkit-scrollbar { width: 4px; }
.gnima-hist-section::-webkit-scrollbar-track { background: transparent; }
.gnima-hist-section::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }
.gnima-hist-label {
  font-size: 12px; color: #9aa0a6; padding: 10px 12px 6px;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}
.gnima-sidebar.collapsed .gnima-hist-label {
  display: none !important;
}
.gnima-sidebar.collapsed .gnima-hist-section { display: none; }
.gnima-hist-item {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 8px;
  padding: 10px 14px; border-radius: 16px;
  cursor: pointer; font-size: 14px; color: #e3e3e3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative;
  -webkit-transition: background 0.12s ease;
  transition: background 0.12s ease;
}
.gnima-hist-item:hover { background: rgba(255,255,255,0.08); }
.gnima-hist-item.active { background: rgba(255,255,255,0.12); }
.gnima-hist-item .material-symbols-outlined { font-size: 17px; -webkit-flex-shrink: 0; flex-shrink: 0; color: #9aa0a6; }
.gnima-hist-item > .material-symbols-outlined:first-child { display: none; }
.gnima-hist-text { transition: opacity .1s ease, max-width .16s ease; overflow: hidden; }
.gnima-sidebar.collapsed .gnima-hist-item { justify-content: center; padding: 6px 0; gap: 0; }
.gnima-sidebar.collapsed .gnima-hist-item .gnima-hist-text,
.gnima-sidebar.collapsed .gnima-hist-item .hist-title { opacity:0; max-width:0; padding:0; margin:0; }
.gnima-sidebar.collapsed .gnima-hist-item > span:not(.material-symbols-outlined) {
  opacity:0; max-width:0; width:0; flex: 0 0 0; padding:0; margin:0; overflow:hidden;
}
.gnima-sidebar.collapsed .gnima-hist-summary,
.gnima-sidebar.collapsed .gnima-hist-del,
.gnima-sidebar.collapsed #gnimaMemCount { display: none !important; }

.gnima-sidebar.collapsed #gnimaMemList > div {
  justify-content: center;
  padding: 3px 0;
  gap: 0;
  border-radius: 4px;
}
.gnima-sidebar.collapsed #gnimaMemList > div:hover {
  background: rgba(255,255,255,0.06);
}
.gnima-sidebar.collapsed #gnimaMemList .gnima-mem-placeholder,
.gnima-sidebar.collapsed #gnimaMemList .gnima-mem-name,
.gnima-sidebar.collapsed #gnimaMemList .gnima-mem-action,
.gnima-sidebar.collapsed #gnimaMemList span:not(.material-symbols-outlined) {
  display: none !important;
}
.gnima-hist-item-actions {
  display: none; position: absolute; right: 8px; top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  gap: 2px;
}
.gnima-hist-item:hover .gnima-hist-item-actions { display: -webkit-flex; display: flex; }
.gnima-hist-item-actions button {
  background: none; border: none; cursor: pointer; color: #9aa0a6;
  width: 28px; height: 28px; border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-appearance: none;
}
.gnima-hist-item-actions button:hover { background: rgba(255,255,255,0.1); }

.gnima-sidebar-footer {
  border-top: none; padding: 12px 10px 10px;
  margin-top: auto;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 8px;
}
.gnima-sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #34a853, #4285f4);
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  color: white;
  font-size: 12px; font-weight: 600;
  -webkit-flex-shrink: 0; flex-shrink: 0;
}
.gnima-sidebar-footer-info { -webkit-flex: 1; flex: 1; min-width: 0; transition: opacity .12s ease; }
.gnima-sidebar-footer-name {
  font-size: 13px; color: #e3e3e3; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gnima-sidebar-footer-badge {
  font-size: 10px; color: #9aa0a6;
}
.gnima-sidebar-settings {
  background: none; border: none; cursor: pointer; color: #9aa0a6;
  width: 28px; height: 28px; border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  position: relative; -webkit-appearance: none;
  transition: background .1s ease;
}
.gnima-sidebar.collapsed .gnima-sidebar-footer {
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  padding: 8px 0 12px;
}
.gnima-sidebar.collapsed .gnima-sidebar-avatar { width: 28px; height: 28px; font-size: 12px; }
.gnima-sidebar-settings:hover { background: rgba(255,255,255,0.08); }
.gnima-sidebar-settings::after { content: none; }

/* ---------- Main Area ---------- */
.gnima-main {
  -webkit-flex: 1 1 0; flex: 1 1 0;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  position: relative; min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Top-right menu button */
.gnima-topbar {
  position: fixed; top: 12px; right: 16px; z-index: 401;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  gap: 8px;
}
.gnima-topbar-btn {
  background: none; border: none; cursor: pointer; color: #9aa0a6;
  width: 36px; height: 36px; border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-appearance: none;
}
.gnima-topbar-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-mobile-toggle { display: none !important; }

/* Chat scroll area */
.gnima-chat-scroll {
  -webkit-flex: 1 1 0; flex: 1 1 0;
  overflow-y: auto;
  display: -webkit-flex; display: flex;
  position: relative;
  z-index: 1;
  contain: content;
  -webkit-flex-direction: column; flex-direction: column;
  padding: 48px 0 110px;
  scrollbar-width: thin; scrollbar-color: #444 transparent;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  box-sizing: border-box;
}
.gnima-chat-scroll::-webkit-scrollbar { width: 6px; }
.gnima-chat-scroll::-webkit-scrollbar-track { background: transparent; }
.gnima-chat-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.gnima-chat-scroll::-webkit-scrollbar-thumb:hover { background: #666; }

/* Welcome / empty state */
.gnima-welcome {
  -webkit-flex: 1; flex: 1;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  padding: 32px 24px 40px; text-align: center;
}
.gnima-welcome-icon { display: none; }
.gnima-welcome .gnima-suggestion-chips { display: none; }
.gnima-welcome-greeting {
  font-size: 32px; font-weight: 400;
  background: none;
  -webkit-text-fill-color: #e3e3e3;
  color: #e3e3e3;
  margin-bottom: 32px;
  line-height: 1.25;
}
.gnima-suggestion-chips {
  display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap;
  gap: 12px;
  -webkit-justify-content: center; justify-content: center;
  max-width: 720px;
}
.gnima-chip {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  gap: 8px;
  padding: 12px 16px; border-radius: 24px;
  background: #1e1f20; border: 1px solid transparent;
  color: #c4c7c5; font-size: 14px;
  cursor: pointer;
  -webkit-transition: background 0.2s, border-color 0.2s;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit; -webkit-appearance: none;
}
.gnima-chip:hover { background: #2d2f30; border-color: #5f6368; }
.gnima-chip .material-symbols-outlined { font-size: 18px; color: #9aa0a6; }

/* ---------- Messages ---------- */
.gnima-messages {
  padding: 24px 0;
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
}
.gnima-msg-row {
  padding: 12px 24px;
  max-width: 768px;
  width: 100%;
  margin: 0 auto 8px;
  box-sizing: border-box;
  -webkit-animation: gnima-fade 0.35s ease;
  animation: gnima-fade 0.35s ease;
}
@-webkit-keyframes gnima-fade {
  from { opacity: 0; -webkit-transform: translateY(8px); transform: translateY(8px); }
  to { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
}
@keyframes gnima-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.gnima-msg-row.user {
  display: -webkit-flex; display: flex;
  -webkit-justify-content: flex-end; justify-content: flex-end;
}
.gnima-msg-user-bubble {
  background: #2f3133; color: #e3e3e3;
  padding: 10px 16px; border-radius: 24px;
  max-width: 75%; font-size: 16px; line-height: 1.5;
  word-wrap: break-word; overflow-wrap: break-word;
}
.gnima-msg-row.ai {
  display: -webkit-flex; display: flex;
  gap: 16px;
  -webkit-align-items: flex-start; align-items: flex-start;
}
.gnima-msg-ai-icon {
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-flex-shrink: 0; flex-shrink: 0;
  margin-top: 2px;
}
.gnima-msg-ai-icon img {
  width: 32px; height: 32px; object-fit: contain;
}
.gnima-msg-ai-icon .material-symbols-outlined { font-size: 16px; color: white; }
.gnima-msg-ai-content {
  -webkit-flex: 1; flex: 1; min-width: 0;
  font-size: 16px; line-height: 1.6; color: #e3e3e3;
}
.gnima-msg-ai-content h1,
.gnima-msg-ai-content h2,
.gnima-msg-ai-content h3 {
  margin: 16px 0 8px; font-weight: 600;
}
.gnima-msg-ai-content h1 { font-size: 20px; }
.gnima-msg-ai-content h2 { font-size: 17px; }
.gnima-msg-ai-content h3 { font-size: 15px; }
.gnima-msg-ai-content p { margin: 0 0 12px; }
.gnima-msg-ai-content ul, .gnima-msg-ai-content ol {
  margin: 0 0 12px; padding-left: 24px;
}
.gnima-msg-ai-content li { margin-bottom: 4px; }
.gnima-msg-ai-content code {
  background: #282a2c; padding: 2px 6px; border-radius: 4px;
  font-family: 'Roboto Mono', 'SF Mono', 'Menlo', monospace; font-size: 13px;
}
.gnima-msg-ai-content pre {
  background: #1e1f20; border: 1px solid #3c4043;
  border-radius: 8px; padding: 16px; overflow-x: auto;
  margin: 8px 0 16px; font-size: 13px;
  -webkit-overflow-scrolling: touch;
}
.gnima-msg-ai-content pre code {
  background: none; padding: 0; border-radius: 0;
}
.gnima-msg-ai-content blockquote {
  border-left: 3px solid #8b5cf6; padding-left: 16px;
  margin: 8px 0 16px; color: #bdc1c6;
}
.gnima-msg-ai-content strong { color: #e8eaed; }
.gnima-msg-ai-content a { color: #a78bfa; text-decoration: none; }
.gnima-msg-ai-content a:hover { text-decoration: underline; }
.gnima-msg-ai-content table {
  border-collapse: collapse; margin: 8px 0 16px; width: 100%;
}
.gnima-msg-ai-content th, .gnima-msg-ai-content td {
  border: 1px solid #3c4043; padding: 8px 12px; text-align: left;
}
.gnima-msg-ai-content th { background: #282a2c; font-weight: 600; }
.gnima-msg-ai-content img {
  max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0;
}

/* AI response action buttons */
.gnima-msg-actions {
  display: -webkit-flex; display: flex;
  gap: 4px; margin-top: 12px;
  opacity: 0;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}
.gnima-msg-row.ai:hover .gnima-msg-actions { opacity: 1; }
@media (hover: none) {
  .gnima-msg-actions { opacity: 1; }
}
.gnima-msg-action-btn {
  background: none; border: none; cursor: pointer;
  color: #9aa0a6; width: 32px; height: 32px;
  border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-appearance: none;
  -webkit-transition: background 0.15s, color 0.15s;
  transition: background 0.15s, color 0.15s;
}
.gnima-msg-action-btn:hover { background: rgba(255,255,255,0.08); color: #e3e3e3; }
.gnima-msg-action-btn .material-symbols-outlined { font-size: 18px; }
.gnima-msg-action-btn.active { color: #a78bfa; }

/* Typing indicator */
.gnima-typing-dots {
  display: -webkit-flex; display: flex;
  gap: 4px; padding: 8px 0;
}
.gnima-typing-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #5f6368;
  -webkit-animation: gnima-dot-pulse 1.4s infinite;
  animation: gnima-dot-pulse 1.4s infinite;
}
.gnima-typing-dots span:nth-child(2) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.gnima-typing-dots span:nth-child(3) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s; }
@-webkit-keyframes gnima-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; -webkit-transform: scale(0.8); transform: scale(0.8); }
  40% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes gnima-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ---------- Input Area ---------- */
.gnima-input-area {
  padding: 0 15% 20px; /* extra bottom padding so the pill has clearance from the window edge */
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-align-items: center; align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: transparent;
  /* ensure the input is always fully inside the viewport even when window height is small */
}
.gnima-input-attachment-preview {
  display: none;
  -webkit-align-items: center; align-items: center;
  gap: 8px;
  background: #1e1f20; border: 1px solid #3c4043;
  border-radius: 12px; padding: 8px 12px; margin-bottom: 8px;
  font-size: 12px; color: #c4c7c5;
  -webkit-align-self: flex-start; align-self: flex-start;
}
.gnima-input-attachment-preview.visible { display: -webkit-flex; display: flex; }
.gnima-input-attachment-preview .material-symbols-outlined { font-size: 16px; color: #a78bfa; }
.gnima-input-attachment-close {
  background: none; border: none; cursor: pointer; color: #9aa0a6;
  width: 20px; height: 20px; border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  margin-left: 4px; -webkit-appearance: none;
}
.gnima-input-attachment-close:hover { background: rgba(255,255,255,0.1); }

.gnima-input-shell-wrap {
  width: 100%;
  max-width: min(780px, calc(100% - 24px));
  margin-bottom: 4px;
}

/* Gnima page shell — inherits .gemini-chat-input; keep page-local color tweaks */
.gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field {
  color: #e3e3e3;
}

.gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field::placeholder { color: #80868b; }
.gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field::-webkit-input-placeholder { color: #80868b; }

.gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field:focus,
.gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field:focus-visible,
.gnima-input-area .hero-gemini-input.gnima-gemini-input .hero-gemini-icon-btn:focus,
.gnima-input-area .hero-gemini-input.gnima-gemini-input .hero-gemini-icon-btn:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  border: none !important;
  border-color: transparent !important;
}

.gnima-input-area .hero-gemini-input.gnima-gemini-input:focus-within .inner {
  background: var(--bg-primary);
}

.gnima-input-add-btn {
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: #9aa0a6;
  -webkit-appearance: none;
}

.gnima-input-add-btn .material-symbols-outlined { font-size: 22px; }

.gnima-input-right {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: flex-end; justify-content: flex-end;
  gap: 2px;
  height: 36px;
  -webkit-flex-shrink: 0; flex-shrink: 0;
}
.gnima-input-right .gnima-focus-btn,
.gnima-input-right .gnima-model-select,
.gnima-input-right .gnima-mic-btn,
.gnima-input-right .gnima-send-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  -webkit-flex-shrink: 0; flex-shrink: 0;
  -webkit-appearance: none;
  cursor: pointer;
}
.gnima-input-right .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  width: 20px;
  height: 20px;
}
.gnima-persona-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  -webkit-flex-shrink: 0; flex-shrink: 0;
}
.gnima-focus-btn {
  background: transparent;
  color: var(--text-secondary);
}
.gnima-focus-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-model-select {
  background: none;
  color: #c4c7c5;
  font-family: inherit;
}
.gnima-model-select:hover { background: rgba(255,255,255,0.08); }
.gnima-mic-btn {
  background: none; color: #9aa0a6;
}
.gnima-mic-btn:hover { background: rgba(255,255,255,0.08); }
.gnima-send-btn {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  opacity: 0; pointer-events: none;
  -webkit-transition: opacity 0.2s, width 0.15s;
  transition: opacity 0.2s, width 0.15s;
}
.gnima-send-btn.visible {
  width: 36px;
  min-width: 36px;
  opacity: 1;
  pointer-events: auto;
}
.gnima-input-right:has(.gnima-send-btn.visible) .gnima-mic-btn { display: none; }
.gnima-send-btn:hover {
  -webkit-transform: scale(1.08);
  transform: scale(1.08);
}

.gnima-disclaimer {
  text-align: center; font-size: 12px; color: #80868b;
  padding: 8px 0 4px; line-height: 1.4;
}

/* ---------- Model / Persona dropdown ---------- */
.gnima-persona-dropdown {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: #292a2b; border: 1px solid #3c4043;
  border-radius: 16px; padding: 8px;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  gap: 4px;
  width: max-content;
  max-width: min(280px, 92vw);
  justify-content: center;
}
.hero-search-wrapper .gnima-persona-dropdown {
  bottom: auto;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
}
.gnima-persona-dropdown.open { display: -webkit-flex; display: flex; }
.gnima-persona-opt {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #c4c7c5;
  -webkit-transition: background 0.15s;
  transition: background 0.15s;
  -webkit-flex-shrink: 0; flex-shrink: 0;
}
.gnima-persona-opt:hover { background: rgba(255,255,255,0.08); }
.gnima-persona-opt.selected { color: #a78bfa; background: rgba(167,139,250,0.12); }
.gnima-persona-opt .material-symbols-outlined { font-size: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gnima-sidebar { width: var(--gnima-sidebar-collapsed-w); }
  /* On forced narrow (tablet-ish), hide texts to prevent overflow/cutoff. */
  .gnima-sidebar .gnima-sidebar-title,
  .gnima-sidebar .gnima-newchat-text,
  .gnima-sidebar .gnima-search-text,
  .gnima-sidebar .gnima-nav-text,
  .gnima-sidebar .gnima-nav-label,
  .gnima-sidebar .gnima-hist-text,
  .gnima-sidebar .gnima-sidebar-footer-info { display: none; }
  .gnima-sidebar .gnima-hist-label { display: none; }
  .gnima-sidebar .gnima-newchat-btn,
  .gnima-sidebar .gnima-search-btn,
  .gnima-sidebar .gnima-nav-btn { justify-content: center; padding: 10px 0; gap: 0; }
  body.product-active .gnima-main,
  body.product-active .gnima-sidebar.collapsed + .gnima-main {
    margin-left: var(--gnima-sidebar-collapsed-w);
  }
  .gnima-msg-row { padding-left: 24px; padding-right: 24px; }
  .gnima-welcome-greeting { font-size: 28px; }
}

/* Short viewport: keep the footer (input) usable and prevent overlap/cutoff */
@media (max-height: 720px) {
  .gnima-chat-scroll { padding-bottom: 64px; padding-top: 32px; }
  .gnima-input-area { padding-bottom: 6px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input,
  .hero-gemini-input.gemini-chat-input { border-radius: 22px; min-height: 46px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input .inner,
  .hero-gemini-input.gemini-chat-input .inner { padding: 3px 6px 3px 4px; min-height: 42px; }
  .gnima-input-add-btn { width: 32px; height: 32px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field { font-size: 14px; padding: 5px 8px; }
}

@media (max-height: 600px) {
  .gnima-chat-scroll { padding-bottom: 52px; padding-top: 28px; }
  .gnima-input-area { padding: 0 8% 4px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input,
  .hero-gemini-input.gemini-chat-input { border-radius: 20px; min-height: 42px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input .inner,
  .hero-gemini-input.gemini-chat-input .inner { padding: 2px 4px 2px 2px; min-height: 38px; }
  .gnima-input-add-btn { width: 28px; height: 28px; }
  .gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field { font-size: 13px; padding: 4px 6px; }
}

@media (max-width: 640px) {
  .gnima-sidebar,
  .gnima-sidebar.collapsed {
    width: var(--gnima-sidebar-collapsed-w);
    padding: 8px 2px;
    overflow: hidden;
  }
  .gnima-sidebar.mobile-open,
  .gnima-sidebar.collapsed.mobile-open {
    width: min(280px, 86vw);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 8px 12px;
    position: fixed;
    z-index: 400;
    height: 100dvh;
    left: 0;
    top: 0;
    box-shadow: 8px 0 32px rgba(0,0,0,0.45);
    transition: width .18s ease, transform .18s ease;
  }
  .gnima-sidebar.mobile-open .gnima-sidebar-title,
  .gnima-sidebar.mobile-open .gnima-newchat-text,
  .gnima-sidebar.mobile-open .gnima-search-text,
  .gnima-sidebar.mobile-open .gnima-nav-text,
  .gnima-sidebar.mobile-open .gnima-nav-label,
  .gnima-sidebar.mobile-open .gnima-hist-text,
  .gnima-sidebar.mobile-open .gnima-sidebar-footer-info,
  .gnima-sidebar.mobile-open .gnima-hist-label { display: block; }
  .gnima-sidebar.mobile-open .gnima-newchat-btn,
  .gnima-sidebar.mobile-open .gnima-search-btn,
  .gnima-sidebar.mobile-open .gnima-nav-btn { justify-content: flex-start; padding: 10px 16px; gap: 12px; }
  .gnima-sidebar.mobile-open .gnima-hist-section { display: block; }
  body.product-active .gnima-main,
  body.product-active .gnima-sidebar.collapsed + .gnima-main,
  .gnima-main { margin-left: var(--gnima-sidebar-collapsed-w); }
  .gnima-root:has(.gnima-sidebar.mobile-open)::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 350;
  }
  .gnima-msg-row { padding: 12px 16px; }
  .gnima-welcome-greeting { font-size: 22px; margin-bottom: 24px; }
  .gnima-suggestion-chips { gap: 8px; max-width: 100%; }
  .gnima-chip { font-size: 14px; padding: 10px 14px; }
}

#gnimaSettingsModal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  font-family: var(--font-sans);
}
.gnima-settings {
  width: min(340px, 92vw);
  background: #1e1f20;
  border-radius: 28px;
  padding: 6px 6px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-family: var(--font-sans);
}
.gnima-settings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 2px;
}
.gnima-settings-head h2 {
  margin: 0; font-size: 18px; font-weight: 500; letter-spacing: 0;
  color: #e3e3e3; font-family: var(--font-sans);
}
.gnima-settings-head button {
  width: 36px; height: 36px; border: 0; background: none;
  color: #c4c7c5; border-radius: 50%; cursor: pointer;
}
.gnima-settings-head button:hover { background: rgba(255,255,255,0.08); }
.gnima-settings-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 0 16px; border-radius: 20px;
  color: #e3e3e3; font-size: 14px; font-weight: 400;
  font-family: var(--font-sans);
}
.gnima-settings-row:hover { background: rgba(255,255,255,0.06); }
.gnima-settings-row span { color: #9aa0a6; font-size: 14px; font-weight: 400; }
.gnima-settings-clear {
  display: block; width: calc(100% - 12px); margin: 4px 6px 0;
  padding: 10px; border: 0; background: none; border-radius: 20px;
  color: #f28b82; font-size: 14px; font-weight: 400;
  font-family: var(--font-sans); cursor: pointer;
}
.gnima-settings-clear:hover { background: rgba(234,67,53,0.1); }

/* ---------- Light mode overrides ---------- */
body:not([data-theme="dark"]) .gnima-root { background: transparent; color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-sidebar { background: #f0f4f9; }
body:not([data-theme="dark"]) .gnima-newchat-btn,
body:not([data-theme="dark"]) .gnima-search-btn,
body:not([data-theme="dark"]) .gnima-nav-btn { color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-newchat-btn { background: #d3e3fd; }
body:not([data-theme="dark"]) .gnima-newchat-btn:hover,
body:not([data-theme="dark"]) .gnima-search-btn:hover,
body:not([data-theme="dark"]) .gnima-nav-btn:hover { background: rgba(0,0,0,0.06); }
body:not([data-theme="dark"]) .gnima-hist-item { color: #444746; }
body:not([data-theme="dark"]) .gnima-hist-item:hover { background: rgba(0,0,0,0.06); }
body:not([data-theme="dark"]) .gnima-sidebar-footer { border-top-color: #dadce0; }
body:not([data-theme="dark"]) .gnima-sidebar-footer-name { color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-msg-user-bubble { background: #e9eef6; color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-msg-ai-content { color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-msg-ai-content strong { color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-msg-ai-content code { background: #f1f3f4; }
body:not([data-theme="dark"]) .gnima-msg-ai-content pre { background: #f8f9fa; border-color: #dadce0; }
body:not([data-theme="dark"]) .gnima-msg-ai-content th { background: #f1f3f4; }
body:not([data-theme="dark"]) .gnima-msg-ai-content th,
body:not([data-theme="dark"]) .gnima-msg-ai-content td { border-color: #dadce0; }
body:not([data-theme="dark"]) .hero-gemini-input.gemini-chat-input .gnima-input-field,
body:not([data-theme="dark"]) .gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field { color: #1f1f1f; }
body:not([data-theme="dark"]) .hero-gemini-input.gemini-chat-input .gnima-input-field::placeholder,
body:not([data-theme="dark"]) .gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field::placeholder { color: #80868b; }
body:not([data-theme="dark"]) .hero-gemini-input.gemini-chat-input .gnima-input-field::-webkit-input-placeholder,
body:not([data-theme="dark"]) .gnima-input-area .hero-gemini-input.gnima-gemini-input .gnima-input-field::-webkit-input-placeholder { color: #80868b; }
body:not([data-theme="dark"]) .gnima-chip { background: #f0f4f9; border-color: #dadce0; color: #444746; }
body:not([data-theme="dark"]) .gnima-chip:hover { background: #e1e6eb; }
body:not([data-theme="dark"]) .gnima-persona-dropdown { background: #fff; border-color: #dadce0; }
body:not([data-theme="dark"]) .gnima-persona-opt { color: #444746; }
body:not([data-theme="dark"]) .gnima-persona-opt:hover { background: rgba(0,0,0,0.06); }
body:not([data-theme="dark"]) .gnima-persona-opt.selected { color: #7c3aed; }
body:not([data-theme="dark"]) .gnima-send-btn { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
body:not([data-theme="dark"]) .gnima-input-attachment-preview { background: #f0f4f9; border-color: #dadce0; color: #444746; }
body:not([data-theme="dark"]) .gnima-welcome-greeting {
  background: none;
  -webkit-text-fill-color: #1f1f1f;
  color: #1f1f1f;
}
body:not([data-theme="dark"]) .gnima-msg-action-btn:hover { background: rgba(0,0,0,0.06); color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-topbar-btn:hover { background: rgba(0,0,0,0.06); }
body:not([data-theme="dark"]) .gnima-sidebar-toggle:hover { background: rgba(0,0,0,0.06); }
body:not([data-theme="dark"]) .gnima-sidebar-avatar { background: linear-gradient(135deg, #7c3aed, #2563eb); }
body:not([data-theme="dark"]) .gnima-settings { background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body:not([data-theme="dark"]) .gnima-settings-head h2,
body:not([data-theme="dark"]) .gnima-settings-row { color: #1f1f1f; }
body:not([data-theme="dark"]) .gnima-settings-row:hover { background: rgba(0,0,0,0.04); }
body:not([data-theme="dark"]) .gnima-settings-head button { color: #444746; }

/* 6. GOOGLE DOCS REPLICA (EroClub) */
.docs-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  background-color: #f8f9fa;
}
[data-theme="dark"] .docs-layout {
  background-color: #1a1a1a;
}
.docs-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
}
.docs-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.docs-menu-row {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.docs-menu-item {
  cursor: pointer;
}
.docs-menu-item:hover {
  color: var(--text-primary);
}
.docs-toolbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.docs-tool-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  color: var(--text-primary);
}
.docs-tool-btn:hover {
  background-color: rgba(0,0,0,0.05);
}
[data-theme="dark"] .docs-tool-btn:hover {
  background-color: rgba(255,255,255,0.05);
}
.docs-editor-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 520px;
}
.docs-page-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.docs-page-sheet {
  width: 100%;
  max-width: 800px;
  background-color: white;
  color: black;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  padding: 60px 80px;
  min-height: 800px;
  font-family: 'Courier New', Courier, monospace;
}
.docs-sidebar {
  width: 240px;
  background-color: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* 7. GOOGLE FIT REPLICA (JOI) */
.fit-layout {
  display: flex;
  flex: 1;
  background-color: var(--bg-primary);
}
.fit-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: 600px;
}
.fit-rings-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 24px;
}
.fit-ring-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.fit-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.fit-ring-svg circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.fit-ring-svg .bg {
  stroke: var(--border-color);
}
.fit-ring-svg .fg {
  stroke-dasharray: 301.6;
  stroke-dashoffset: 301.6;
  transition: stroke-dashoffset 0.8s ease-in-out;
}
.fit-ring-svg.steps .fg { stroke: #4285f4; }
.fit-ring-svg.heart .fg { stroke: #ea4335; }
.fit-ring-svg.sleep .fg { stroke: #34a853; }
.fit-ring-title {
  font-size: 16px;
  font-weight: 500;
  margin-top: 16px;
}
.fit-ring-value {
  font-size: 24px;
  font-weight: bold;
  margin-top: 4px;
}
.fit-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.fit-metric-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  background-color: var(--bg-secondary);
}
.fit-status-banner {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* 8. CHROME BROWSER REPLICA (Gream) */
.gream-chrome-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
.gream-tab-bar {
  display: flex;
  align-items: flex-end;
  background-color: var(--bg-secondary);
  padding-top: 8px;
  padding-left: 8px;
  border-bottom: 1px solid var(--border-color);
}
.gream-chrome-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
}
.gream-tab-close {
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
}
.gream-tab-close:hover {
  color: var(--text-primary);
}
.gream-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-primary);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
}
.gream-nav-buttons {
  display: flex;
  gap: 8px;
  color: var(--text-secondary);
}
.gream-nav-btn {
  cursor: pointer;
}
.gream-address-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 13px;
}
.gream-address-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
}
.gream-guard-badge {
  background-color: rgba(52, 168, 83, 0.1);
  color: #34a853;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}
.gream-chrome-viewport {
  background-color: white;
  color: #333;
  min-height: 480px;
  overflow-y: auto;
  position: relative;
}
.gream-chrome-content {
  padding: 40px;
}

/* ==========================================
   PHASE 2 UPGRADE STYLES
   ========================================== */

/* Custom Toast Notification Stack */
.googoblin-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.googoblin-toast {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 18px;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
  transition: transform 0.2s, opacity 0.2s;
}
.googoblin-toast.toast-success {
  border-left: 4px solid var(--google-green);
}
.googoblin-toast.toast-warning {
  border-left: 4px solid var(--google-yellow);
}
.googoblin-toast.toast-error {
  border-left: 4px solid var(--google-red);
}
.googoblin-toast.toast-info {
  border-left: 4px solid var(--google-blue);
}
.googoblin-toast-close {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
}
.googoblin-toast-close:hover {
  color: var(--text-primary);
}
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.googoblin-toast.fade-out {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
}

/* YouTube Comment and Search Input Transitions */
.yt-main input[type="text"] {
  border-bottom: 1px solid var(--border-color);
  transition: border-bottom-color 0.25s ease-in-out;
}
.yt-main input[type="text"]:focus {
  border-bottom: 2px solid var(--google-blue) !important;
}

/* Chrome/Gream Search Address Input Transitions */
.gream-address-input-wrapper {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gream-address-input-wrapper:focus-within {
  border-color: var(--google-yellow) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Google Drive Delete Action Hover styling */
.drive-files-table tr .drive-delete-btn {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}
.drive-files-table tr:hover .drive-delete-btn {
  opacity: 1;
}

/* Google Chat Typing Dot Animations */
.typing-dots-bubble {
  padding: 12px 20px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1s infinite ease-in-out;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Gnima chip selection hover */
.gnima-chip {
  transition: transform 0.2s, background-color 0.2s;
}
.gnima-chip:hover {
  transform: translateY(-2px);
}

/* Google Docs Editor Outline and Sidebar Vault style */
#eroclubDocTitle:focus {
  outline: none;
  border-bottom: 1px dashed var(--google-blue);
}
#eroclubDocsList {
  scrollbar-width: thin;
}
#eroclubDocsList::-webkit-scrollbar {
  width: 4px;
}
#eroclubDocsList::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Star rating radio styles */
.star-rating-radio {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.star-rating-radio input {
  display: none;
}
.star-rating-radio label {
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}
.star-rating-radio label:hover,
.star-rating-radio label:hover ~ label,
.star-rating-radio input:checked ~ label {
  color: var(--google-yellow) !important;
}

/* Chrome address star button */
#greamBookmarkBtn {
  transition: transform 0.2s ease, color 0.2s ease;
}
#greamBookmarkBtn:hover {
  transform: scale(1.1);
}

/* Drive folder action deletion */
.drive-folder-card {
  position: relative;
  overflow: hidden;
}
.drive-folder-card span.material-symbols-outlined:last-child {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drive-folder-card:hover span.material-symbols-outlined:last-child {
  opacity: 1;
}

/* Phase 4 - Docs Outline Panel Styles */
.docs-outline-panel::-webkit-scrollbar {
  width: 6px;
}
.docs-outline-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
.outline-item {
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 4px 6px;
  border-radius: 4px;
}
.outline-item:hover {
  background: rgba(66, 133, 244, 0.08);
  transform: translateX(4px);
}

/* Phase 4 - CreamMail Styles */
.mail-row-hover:hover {
  background: var(--bg-secondary) !important;
  box-shadow: inset 2px 0 0 var(--google-blue);
}
.mail-folder {
  transition: background 0.2s, color 0.2s;
}
.mail-folder:hover {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .mail-folder:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Phase 4 - CreamMaps Styles */
.map-landmark-item {
  transition: border-left-color 0.2s, background-color 0.2s, transform 0.2s;
}
.map-landmark-item:hover {
  background: rgba(0, 0, 0, 0.02) !important;
  transform: scale(1.02);
}
[data-theme="dark"] .map-landmark-item:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}
.maps-pin {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.maps-pin:hover {
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Phase 5 - Premium UI/UX & Transitions Overhaul */
.view-section {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Waffle Menu Item Animations */
.waffle-item {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease !important;
  border-radius: 12px;
}
.waffle-item:hover {
  transform: translateY(-4px) scale(1.03);
  background-color: var(--bg-tertiary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.waffle-item:hover .waffle-icon-wrapper img {
  transform: scale(1.08) rotate(2deg);
}
.waffle-icon-wrapper img {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* G Suite Replica Entrance Transitions & Styling */
.replica-container {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Docs (EroClub) Letter-Style Sheet Upgrades */
.docs-page-sheet {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 8px 24px rgba(0,0,0,0.05);
  border-radius: 4px;
  transition: box-shadow 0.3s ease;
  min-height: 800px;
  padding: 60px 80px !important;
  max-width: 800px;
  margin: 20px auto !important;
  font-family: var(--font-sans);
}
.docs-page-sheet:focus {
  outline: none;
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.1), 0 12px 36px rgba(0,0,0,0.08);
}
.docs-page-scroller {
  background: var(--bg-tertiary);
  padding: 20px;
}

/* Chat (CreamGram) Modern Bubbles */
.chat-msg-bubble {
  border-radius: 18px !important;
  padding: 10px 14px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.chat-msg-row.me .chat-msg-bubble {
  background: linear-gradient(135deg, #1a73e8, #1557b0) !important;
  color: white !important;
  border-bottom-right-radius: 4px !important;
}
.chat-msg-row.other .chat-msg-bubble {
  background: var(--bg-secondary) !important;
  border-bottom-left-radius: 4px !important;
  border: 1px solid var(--border-color);
}

/* Chrome (Gream) Tab Bar and Input */
.gream-chrome-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}
.gream-tab {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  transition: background-color 0.2s, color 0.2s;
}
.gream-address-input-wrapper {
  background: var(--bg-tertiary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 4px 16px;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.gream-address-input-wrapper:focus-within {
  background: var(--bg-primary);
  border-color: var(--google-blue);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

/* Fit (JOI) Slider Customization */
.joi-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  transition: background 0.15s ease-in-out;
}
.joi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--google-green);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.1s ease-in-out;
}
.joi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Maps Pin bounce highlight */
.maps-pin {
  transform-origin: 150px 200px;
}
#pin-tax {
  transform-origin: 450px 120px;
}
#pin-cookie {
  transform-origin: 600px 420px;
}
.maps-pin:hover {
  animation: pinBounce 0.6s ease infinite alternate;
}
@keyframes pinBounce {
  from {
    transform: translateY(0) scale(1.05);
  }
  to {
    transform: translateY(-8px) scale(1.05);
  }
}

/* ==========================================
   PHASE 6 - SLIDES & CALENDAR STYLES
   ========================================== */

/* CreamSlides layout styling */
.slides-sidebar {
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.slide-preview-card {
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s ease;
}
.slide-preview-card:hover {
  background: rgba(66, 133, 244, 0.05) !important;
  border-color: var(--google-blue) !important;
  transform: translateX(2px);
}
.slide-preview-card.active {
  background: rgba(249, 171, 0, 0.08) !important;
  border-color: var(--google-yellow) !important;
}
.slide-canvas-card {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
[data-theme="dark"] .slide-canvas-card {
  background: #1e1e1e !important;
  border-color: #333 !important;
}
[data-theme="dark"] .slide-canvas-card input,
[data-theme="dark"] .slide-canvas-card textarea {
  color: #e8eaed !important;
}
[data-theme="dark"] #slideshowContent {
  background: #1e1e1e !important;
  border-color: #333 !important;
}
[data-theme="dark"] #slideshowContent h1 {
  color: #e8eaed !important;
}
[data-theme="dark"] #slideshowContent p {
  color: #9aa0a6 !important;
}

/* CreamCalendar layout styling */
.calendar-sidebar {
  border-right: 1px solid var(--border-color);
}
.calendar-day-cell {
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}
.calendar-day-cell:hover {
  background-color: var(--bg-secondary) !important;
}
.calendar-event-badge {
  transition: transform 0.1s ease, filter 0.1s ease;
}
.calendar-event-badge:hover {
  transform: scale(1.02);
  filter: brightness(0.95);
}

@keyframes pulseRed {
  0% {
    opacity: 0.7;
    text-shadow: 0 0 2px rgba(234, 67, 53, 0.2);
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 8px rgba(234, 67, 53, 0.6);
  }
}

/* ==========================================
   PHASE 9 - GOBLIN SYSTEM MONITOR
   ========================================== */

#goblinSystemGauge:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.7) !important;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.08);
    opacity: 1;
  }
}
/* ==========================================
   PHASE 10 - PERFORMANCE & FUNCTIONS MAX
   ========================================== */

/* Breadcrumbs style for Creampie */
#driveBreadcrumbs span:hover {
  text-decoration: underline;
}

/* System switch slider */
.sys-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.sys-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sys-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: .3s;
  border-radius: 20px;
}
.sys-slider:before {
  position: absolute;
  content: "";
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.sys-switch input:checked + .sys-slider {
  background-color: #a04ef6;
}
.sys-switch input:checked + .sys-slider:before {
  transform: translateX(14px);
}

/* CreamGram & CreamMail Phase 12 Additions */
.chat-attachment-card {
  transition: background-color 0.2s, border-color 0.2s;
}
.chat-attachment-card:hover {
  background-color: rgba(66, 133, 244, 0.08) !important;
  border-color: var(--google-blue) !important;
}
.mail-compose-status-badge {
  animation: statusFade 2s infinite ease-in-out alternate;
}
@keyframes statusFade {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Phase 13 - Google-style Search Experience Upgrades */
.serp-view-root {
  display: none;
  flex-direction: column;
  background-color: var(--bg-primary);
}

/* Ensure SERP view is visible when route activates it (robust against other display rules) */
body.on-search-page #search-results-view,
body.on-search-page .serp-view-root {
  display: flex !important;
}

/* 2026 generative polish */
#serp-ai-overview {
  border-radius: 20px;
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}
#serp-ai-overview::before {
  content: '';
  position: absolute; top: -50%; right: -20%; width: 40%; height: 200%;
  background: radial-gradient(circle, rgba(66,133,244,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.gnima-chip[onclick*="DailyBrief"], .gnima-chip[onclick*="gnimaDailyBrief"] {
  background: #1a73e8; color: #fff; border-color: #1a73e8; font-weight: 500;
}

/* Collapsible Neural Expressive reasoning (Gnima tool trace) + more fluid motion */
.gnima-reasoning {
  transition: all .22s cubic-bezier(.2,0,0,1);
  will-change: transform, opacity;
}
.gnima-reasoning[open] {
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}
.gnima-reasoning summary {
  outline: none;
  transition: background .12s ease;
}
.gnima-reasoning summary:hover { background: rgba(255,255,255,.035); }
.gnima-reasoning summary:active { transform: scale(0.985); }
.gnima-reasoning[open] summary span:last-child { opacity: 0; pointer-events: none; }

/* Neural Expressive: gentle entry animations for generative content */
#serp-ai-overview, .gnima-reasoning, .gnima-msg-ai-content > * {
  animation: neFadeUp .28s cubic-bezier(.2,0,.0,1) both;
}
@keyframes neFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* SERP overview responsive — no black screen on smaller windows */
#serp-ai-overview-body { min-height: 1.4em; }
@media (max-width: 900px) {
  #serp-ai-overview { margin-bottom: 16px; padding: 12px 14px; font-size: 13px; }
}

.serp-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.serp-header-top-row {
  display: flex;
  align-items: center;
  padding: 16px 24px 10px;
  gap: 24px;
}
.serp-header-logo-img {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}
.serp-header-logo-text {
  font-size: 20px !important;
  font-weight: 500;
  cursor: pointer;
}
.serp-header-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 652px;
  margin-left: 8px;
}
.serp-header-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--border-radius-pill);
  padding: 0 16px;
  height: 44px;
  transition: var(--transition-normal);
}
.serp-header-search-bar:focus-within {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05);
}
.serp-header-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding-left: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
}
.serp-filters-bar {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 24px 0 160px;
}
.serp-filter-tab {
  padding: 6px 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  color: var(--text-secondary);
  font-weight: 400;
  transition: color 0.2s;
}
.serp-filter-tab:hover {
  color: var(--google-blue);
}
.serp-filter-tab.active {
  color: var(--google-blue);
  font-weight: 600;
}
.serp-filter-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--google-blue);
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.serp-container {
  display: flex;
  gap: 60px;
  padding: 24px 24px 40px 160px;
  text-align: left;
  max-width: 1240px;
  width: 100%;
}
.serp-main-column {
  flex: 1;
  max-width: 652px;
}
.serp-sidebar-column {
  width: 360px;
  flex-shrink: 0;
}
.serp-item {
  margin-bottom: 28px;
  font-family: Arial, sans-serif;
}
.serp-breadcrumb {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.serp-breadcrumb-link {
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
}
.serp-breadcrumb-link:hover {
  text-decoration: underline;
}
.serp-title {
  font-size: 19px;
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 4px;
  line-height: 1.3;
  color: var(--google-blue);
  cursor: pointer;
  display: inline-block;
}
.serp-title:hover {
  text-decoration: underline;
}
.serp-snippet {
  font-size: 14px;
  line-height: 1.58;
  color: var(--text-secondary);
  margin: 0;
  word-wrap: break-word;
}
.serp-snippet em {
  font-weight: bold;
  font-style: normal;
  color: var(--text-primary);
}
.serp-sitelinks-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}
.serp-sitelink-item {
  cursor: pointer;
}
.serp-sitelink-title {
  color: var(--google-blue);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}
.serp-sitelink-title:hover {
  text-decoration: underline;
}
.serp-sitelink-snippet {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.suggestion-item.selected {
  background-color: var(--bg-tertiary);
}

@media (max-width: 1024px) {
  .serp-container {
    padding-left: 24px;
    flex-direction: column;
    gap: 40px;
  }
  .serp-filters-bar {
    padding-left: 24px;
  }
}

/* Phase 14 - Images & Videos Search Integration styling */
.serp-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.serp-image-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
.serp-image-card:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: var(--shadow-md);
}
.serp-image-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}
.serp-image-info {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.serp-image-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.serp-images-carousel-scroll::-webkit-scrollbar {
  height: 6px;
}
.serp-images-carousel-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.serp-images-carousel-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.serp-blend-image-card {
  transition: transform 0.2s, border-color 0.2s;
}
.serp-blend-image-card:hover {
  transform: translateY(-1px);
  border-color: var(--google-blue) !important;
}

@keyframes zoomIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Google search results page header style modifications */
.on-search-page .header-container {
  justify-content: flex-start;
  gap: 10px;
}

.on-search-page .header-actions {
  margin-left: auto;
  flex-shrink: 0;
}

@media (min-width: 1025px) {
  .on-search-page .serp-filters-bar {
    padding-left: 72px;
  }
  .on-search-page .serp-container {
    padding-left: 72px;
  }
}

@media (max-width: 600px) {
  .on-search-page .header-search-bar {
    display: flex !important;
    flex: 1 1 auto;
    max-width: none;
    min-width: 80px;
    height: 36px;
    padding: 0 8px;
  }
  .on-search-page .header-container {
    gap: 6px;
  }
}

/* Suggestions dropdown integration overlay */
.search-box-large.has-suggestions {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.header-search-bar.has-suggestions {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.search-box-large.has-suggestions + .search-suggestions {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: -1px;
}
.header-search-bar.has-suggestions .search-suggestions {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: 0px;
  left: -1px;
  right: -1px;
}

/* ============================================ */
/* Phase 16 - Material 3 Profile, Google Footer */
/* ============================================ */

/* Profile Dropdown Menu (Material 3 Expressive) */
.profile-dropdown {
  position: absolute;
  right: 0;
  /* Position from the bottom of the (small) relative wrapper that contains the avatar.
     This is robust across different header heights and .product-active compacting. */
  top: 100%;
  margin-top: 4px;
  width: 320px;
  max-height: min(78vh, 520px);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 300;
  display: none;
  overflow: auto;
  animation: profileDropIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes profileDropIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-dropdown.active {
  display: block;
  z-index: 99999;
}

.profile-dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 14px;
  text-align: center;
}

.profile-dropdown-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--google-blue), var(--google-red), var(--google-yellow));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(var(--google-blue-rgb), 0.25);
  transition: transform 0.2s ease;
}

.profile-dropdown-avatar-lg:hover {
  transform: scale(1.03);
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.profile-dropdown-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-manage-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--google-blue);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-manage-btn:hover {
  background: rgba(var(--google-blue-rgb), 0.08);
  border-color: rgba(var(--google-blue-rgb), 0.25);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 2px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.12s ease;
  line-height: 1.2;
}

.profile-dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.profile-dropdown-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Sign out row — subtle danger treatment like Google */
.profile-dropdown-item.profile-signout {
  color: #ea4335;
}
.profile-dropdown-item.profile-signout .material-symbols-outlined {
  color: #ea4335;
}
.profile-dropdown-item.profile-signout:hover {
  background: rgba(234, 67, 53, 0.08);
}

/* Google-style tiny section labels */
.profile-section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  padding: 6px 18px 2px;
  user-select: none;
}

/* Extra breathing at the very bottom (Google polish) */
.profile-dropdown > .profile-dropdown-item:last-child {
  padding-bottom: 11px;
}

/* Footer area removed — everything is now grouped inside the menu for Google-style compactness */


/* Google-Style Footer (2026) */

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 0;
  gap: 12px;
}

.footer-links-left,
.footer-links-right {
  display: flex;
  gap: 20px;
}

.footer-links-left a,
.footer-links-right a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links-left a:hover,
.footer-links-right a:hover {
  color: var(--text-primary);
}

/* Settings Page */
.settings-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-family: var(--font-sans);
}

.settings-page h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.settings-page .settings-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section h3 .material-symbols-outlined {
  font-size: 22px;
  color: var(--google-blue);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.settings-row-label {
  font-size: 14px;
  color: var(--text-primary);
}

.settings-row-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.settings-row select,
.settings-row input[type="text"] {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.settings-row select:focus,
.settings-row input[type="text"]:focus {
  outline: none;
  border-color: var(--google-blue);
  box-shadow: 0 0 0 2px rgba(var(--google-blue-rgb), 0.12);
}

/* Toggle switch for settings */
.settings-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--text-tertiary);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}

.settings-toggle.active {
  background: var(--google-blue);
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s;
}

.settings-toggle.active::after {
  transform: translateX(20px);
}

/* Responsive */
@media (max-width: 600px) {
  .profile-dropdown,
  .profile-dropdown.active {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 12px;
    right: 12px;
    bottom: auto;
    width: auto;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - var(--header-height) - 20px);
    margin: 0;
    border-radius: 28px;
    animation: none;
    transform: none;
  }
  .profile-dropdown-avatar-lg {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .profile-dropdown-item {
    padding: 7px 16px;
    font-size: 12.5px;
  }
  .footer-bottom-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }
  .footer-links-left,
  .footer-links-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .settings-row select {
    width: 100%;
  }
}

/* Product Page Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════ */
/* v3.1 — Enhanced Product UI/UX Styles                       */
/* ═══════════════════════════════════════════════════════════ */

/* Global Smooth Transitions for Product Pages */
#replica-viewport * {
  transition-property: background-color, border-color, color, opacity, box-shadow;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Styling */
#replica-viewport ::-webkit-scrollbar { width: 8px; height: 8px; }
#replica-viewport ::-webkit-scrollbar-track { background: transparent; }
#replica-viewport ::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 4px; }
#replica-viewport ::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.5); }

/* ── Creammy (YouTube) ── */
.video-js .vjs-big-play-button {
  border-radius: 50% !important;
  width: 68px !important;
  height: 68px !important;
  line-height: 68px !important;
  border: none !important;
  background: rgba(234,67,53,0.9) !important;
  font-size: 28px !important;
  transition: transform 0.2s, background 0.2s !important;
}
.video-js .vjs-big-play-button:hover {
  transform: scale(1.1) !important;
  background: rgba(234,67,53,1) !important;
}
.video-js .vjs-control-bar {
  background: linear-gradient(transparent, rgba(0,0,0,0.8)) !important;
  height: 40px !important;
}
.video-js .vjs-play-progress { background: #ea4335 !important; }
.video-js .vjs-slider:hover .vjs-play-progress { background: #ea4335 !important; }

/* ── EroClub (VS Code) ── */
#aceEditorContainer .ace_editor {
  font-family: 'Roboto Mono', 'Fira Code', monospace !important;
}
.ero-file-item {
  transition: background 0.15s, padding-left 0.15s !important;
}
.ero-file-item:hover {
  padding-left: 28px !important;
}

/* ── CreamMail (Gmail) ── */
#cmailQuillEditor .ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  background: var(--bg-secondary) !important;
}
#cmailQuillEditor .ql-container.ql-snow {
  border: none !important;
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
}
#cmailQuillEditor .ql-editor {
  padding: 16px !important;
  min-height: 160px !important;
  color: var(--text-primary) !important;
}
#cmailQuillEditor .ql-editor.ql-blank::before {
  color: var(--text-tertiary) !important;
  font-style: normal !important;
}

/* ── CreamSlides (Reveal.js) ── */
#revealContainer .reveal {
  font-family: var(--font-sans) !important;
}
#revealContainer .reveal h1, #revealContainer .reveal h2, #revealContainer .reveal h3 {
  font-family: var(--font-sans) !important;
  text-transform: none !important;
  letter-spacing: -0.5px !important;
}
#revealContainer .reveal .controls {
  color: rgba(255,255,255,0.7) !important;
}
#revealContainer .reveal .progress span {
  background: var(--google-blue) !important;
}

/* ── FullCalendar Theme Override ── */
#fullCalendarContainer .fc {
  font-family: var(--font-sans) !important;
}
#fullCalendarContainer .fc .fc-button-primary {
  background: var(--google-blue) !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 4px 12px !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  transition: background 0.2s !important;
}
#fullCalendarContainer .fc .fc-button-primary:hover {
  background: #1a73e8 !important;
}
#fullCalendarContainer .fc .fc-button-primary:not(:disabled).fc-button-active {
  background: #1557b0 !important;
}
#fullCalendarContainer .fc .fc-col-header-cell {
  padding: 8px 0 !important;
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}
#fullCalendarContainer .fc .fc-daygrid-day-number {
  padding: 8px !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
}
#fullCalendarContainer .fc .fc-day-today {
  background: rgba(66,133,244,0.08) !important;
}
#fullCalendarContainer .fc .fc-event {
  border-radius: 4px !important;
  padding: 2px 4px !important;
  font-size: 12px !important;
  border: none !important;
}
#fullCalendarContainer .fc .fc-toolbar-title {
  font-family: var(--font-sans) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
}
#fullCalendarContainer .fc .fc-scrollgrid {
  border-color: var(--border-color) !important;
}
#fullCalendarContainer .fc td, #fullCalendarContainer .fc th {
  border-color: var(--border-color) !important;
}

/* ── CubicleSoft FileExplorer Override ── */
#driveFileManager .fe_fileexplorer_wrap {
  background: var(--bg-primary) !important;
  font-family: var(--font-sans) !important;
}
#driveFileManager .fe_fileexplorer_toolbar {
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}
#driveFileManager .fe_fileexplorer_item_text {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
}
#driveFileManager .fe_fileexplorer_item_selected {
  background: rgba(66,133,244,0.15) !important;
}

/* ── Gream Browser ── */
#greamViewport {
  scrollbar-width: thin;
  scrollbar-color: rgba(128,128,128,0.3) transparent;
}
#greamViewport img {
  max-width: 100% !important;
  height: auto !important;
}
#greamViewport a {
  color: #4285f4 !important;
  text-decoration: underline !important;
}

/* ── Leaflet Map Override ── */
#leafletMap .leaflet-control-zoom a {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
#leafletMap .leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
  font-family: var(--font-sans) !important;
}

/* ── Toast Notification Enhancement ── */
.toast-notification {
  animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Chart.js Canvas Styles ── */
#joiStepsChart, #joiHeartChart {
  border-radius: 8px;
}

/* ── Micro-Animation Utilities ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}
.skeleton-loading {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* ── Hover Ripple Effect ── */
.ripple-btn {
  position: relative;
  overflow: hidden;
}
.ripple-btn::after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}
.ripple-btn:active::after {
  transform: scale(0);
  opacity: 0.3;
  transition: 0s;
}

/* ── Product Page Entry Animation ── */
.product-page-enter > * {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}
.product-page-enter > *:nth-child(1) { animation-delay: 0s; }
.product-page-enter > *:nth-child(2) { animation-delay: 0.05s; }
.product-page-enter > *:nth-child(3) { animation-delay: 0.1s; }
.product-page-enter > *:nth-child(4) { animation-delay: 0.15s; }

/* ── Focus Ring for Accessibility ── */
input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--google-blue);
  outline-offset: 2px;
}

.hero-gemini-input input:focus-visible,
.hero-gemini-input textarea:focus-visible,
.hero-gemini-icon-btn:focus-visible,
#portal-view .search-buttons .btn:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

/* ── Dark Mode Product Page Overrides ── */
[data-theme="dark"] .video-js .vjs-control-bar {
  background: linear-gradient(transparent, rgba(0,0,0,0.9)) !important;
}
[data-theme="dark"] #fullCalendarContainer .fc {
  --fc-border-color: rgba(255,255,255,0.06);
  --fc-neutral-bg-color: transparent;
  --fc-page-bg-color: transparent;
}
[data-theme="dark"] #fullCalendarContainer .fc .fc-scrollgrid,
[data-theme="dark"] #fullCalendarContainer .fc td,
[data-theme="dark"] #fullCalendarContainer .fc th {
  border-color: rgba(255,255,255,0.06) !important;
}
[data-theme="dark"] #fullCalendarContainer .fc .fc-col-header-cell {
  color: var(--text-secondary) !important;
}
[data-theme="dark"] #fullCalendarContainer .fc .fc-daygrid-day-number {
  color: var(--text-primary) !important;
}
[data-theme="dark"] #driveFileManager .fe_fileexplorer_wrap {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] #cmailQuillEditor .ql-toolbar.ql-snow {
  background: var(--bg-tertiary) !important;
}
[data-theme="dark"] .leaflet-popup-content-wrapper {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}
[data-theme="dark"] #greamViewport {
  background: #1e1e1e !important;
  color: #e8eaed !important;
}

/* ── Sortable.js Ghost Styles ── */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(66,133,244,0.15) !important;
  border: 2px dashed var(--google-blue) !important;
  border-radius: 8px;
}
.sortable-drag {
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ── Monaco Editor Override ── */
#aceEditorContainer .monaco-editor {
  border-radius: 0;
}
#aceEditorContainer .monaco-editor .minimap {
  opacity: 0.6;
}
#aceEditorContainer .monaco-editor .minimap:hover {
  opacity: 1;
}

/* ── xterm.js Override ── */
#greamTerminal .xterm {
  padding: 4px 8px;
}
#greamTerminal .xterm-viewport::-webkit-scrollbar {
  width: 6px;
}
#greamTerminal .xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* ── EasyMDE Override ── */
#cmailMdEditor .EasyMDEContainer {
  border: none !important;
}
#cmailMdEditor .EasyMDEContainer .editor-toolbar {
  background: var(--bg-secondary) !important;
  border: none !important;
  border-bottom: 1px solid var(--border-color) !important;
}
#cmailMdEditor .EasyMDEContainer .editor-toolbar button {
  color: var(--text-secondary) !important;
}
#cmailMdEditor .EasyMDEContainer .editor-toolbar button:hover {
  background: var(--bg-tertiary) !important;
}
#cmailMdEditor .EasyMDEContainer .CodeMirror {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: none !important;
  font-family: var(--font-mono) !important;
}

/* ── Leaflet Routing Machine Override ── */
.leaflet-routing-container {
  background: var(--bg-primary) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
  font-family: var(--font-sans) !important;
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
}
.leaflet-routing-alt h2 {
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
  color: var(--google-blue) !important;
}

/* ── M3 Expressive Modal Animations ── */
@keyframes calModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes m3FadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes m3SlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── M3 Expressive FullCalendar Override ── */
#fullCalendarContainer .fc {
  --fc-border-color: var(--border-subtle);
  --fc-button-bg-color: var(--bg-secondary);
  --fc-button-border-color: var(--border-subtle);
  --fc-button-text-color: var(--text-primary);
  --fc-button-hover-bg-color: var(--surface-3);
  --fc-button-hover-border-color: var(--border-subtle);
  --fc-button-active-bg-color: var(--google-blue);
  --fc-button-active-border-color: var(--google-blue);
  --fc-today-bg-color: rgba(66, 133, 244, 0.06);
  --fc-event-border-color: transparent;
  --fc-page-bg-color: transparent;
  font-family: var(--font-sans);
}

#fullCalendarContainer .fc .fc-button {
  border-radius: 9999px;
  font-size: 13px;
  padding: 6px 16px;
  font-weight: 500;
  transition: all var(--md-duration-short4) var(--md-easing-standard);
}

#fullCalendarContainer .fc .fc-toolbar-title {
  font-size: 22px;
  font-weight: 400;
}

#fullCalendarContainer .fc .fc-daygrid-event {
  border-radius: 6px;
  font-size: 12px;
  padding: 2px 6px;
  border: none;
  transition: transform var(--md-duration-short3) var(--md-easing-spring);
}

#fullCalendarContainer .fc .fc-daygrid-event:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#fullCalendarContainer .fc .fc-col-header-cell-cushion,
#fullCalendarContainer .fc .fc-daygrid-day-number {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
}

#fullCalendarContainer .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--google-blue);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── M3 Expressive Global Component Polish ── */
[class*="card"]:not(.product-card) {
  border-radius: var(--border-radius-lg) !important;
  transition: transform var(--md-duration-medium1) var(--md-easing-spring),
              box-shadow var(--md-duration-medium2) var(--md-easing-standard) !important;
}

/* M3 Expressive Pill Buttons */
button[style*="border-radius:20px"],
button[style*="border-radius: 20px"] {
  transition: all var(--md-duration-short4) var(--md-easing-standard);
}

/* M3 Expressive Input Fields */
input[type="text"], input[type="search"], textarea {
  transition: border-color var(--md-duration-short4) var(--md-easing-standard),
              box-shadow var(--md-duration-short4) var(--md-easing-standard);
}

input[type="text"]:focus, input[type="search"]:focus, textarea:focus {
  border-color: var(--google-blue) !important;
  box-shadow: 0 0 0 1px var(--google-blue);
}

.hero-gemini-input input[type="text"]:focus,
.hero-gemini-input input[type="search"]:focus,
.hero-gemini-input textarea:focus,
.hero-gemini-input input:focus-visible,
.hero-gemini-input textarea:focus-visible,
.hero-gemini-icon-btn:focus-visible {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  outline-offset: 0 !important;
}

/* M3 Expressive Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
  background-clip: padding-box;
}

/* ── Creammy Responsive Layout ── */
@media (max-width: 900px) {
  #creammyLayout {
    flex-direction: column !important;
    padding: 8px 12px !important;
    gap: 12px !important;
  }
  #cmSidebarWrap {
    width: 100% !important;
    max-height: none !important;
  }
  #cmSidebar {
    max-height: 300px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 8px !important;
  }
  .cm-sb-item {
    flex-direction: column !important;
    min-width: 160px !important;
    flex-shrink: 0 !important;
  }
  .cm-sb-item > div:first-of-type {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }
}
@media (max-width: 600px) {
  #creammyLayout {
    padding: 4px 8px !important;
  }
  #cmPlayer {
    border-radius: 0 !important;
    margin: 0 -8px !important;
    width: calc(100% + 16px) !important;
  }
  .cm-row {
    gap: 2px !important;
  }
  #cmTime {
    font-size: 10px !important;
  }
}

/* ── Global product-active header compact (back button + tight space) ── */
.product-active .container.header-container {
  gap: 6px;
}
.product-active .header-search-bar {
  max-width: 260px;
  opacity: 0.85;
  height: 34px;
  padding: 0 8px;
}
.product-active .header-search-bar input {
  font-size: 12.5px;
}
.product-active .header-search-bar > span {
  font-size: 16px;
}
.product-active .header-actions {
  gap: 3px;
}
.product-active .icon-btn {
  width: 30px;
  height: 30px;
}
.product-active .profile-avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

/* ========================================
   GLOBAL COMMAND PALETTE (⌘K / Ctrl+K)
   ======================================== */
#goo-command-palette {
  position: fixed;
  top: 18vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 92vw);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#goo-command-palette.active { display: flex; }
#goo-cmd-input {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 16px; padding: 14px 16px; color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
#goo-cmd-results {
  max-height: 320px; overflow-y: auto; padding: 6px 0;
}
.goo-cmd-item {
  padding: 8px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px;
}
.goo-cmd-item:hover, .goo-cmd-item.selected { background: var(--bg-secondary); }
.goo-cmd-item .material-symbols-outlined { opacity: .7; font-size: 18px; }
.goo-cmd-item .meta { margin-left: auto; font-size: 10px; opacity: .5; }

/* Visible Gnima Plan (2026 agentic) */
.gnima-plan-step.done { opacity: 0.65; text-decoration: line-through; }
.gnima-plan-step .gnima-plan-btn:hover { background:#202124; border-color:#8ab4f8; color:#8ab4f8; }
.gnima-plan-list { display: flex; flex-direction: column; gap: 2px; }

/* I'm Feeling Gnima lucky button */
.feeling-gnima-btn {
  background: linear-gradient(90deg, #a78bfa, #8ab4f8);
  color: #0f0f10;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feeling-gnima-btn:hover { filter: brightness(1.05); }

/* Realtime status dot */
.realtime-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-left: 4px; vertical-align: middle;
  background: #34a853;
  box-shadow: 0 0 0 2px rgba(52,168,83,0.2);
}
.realtime-dot.off { background: #5f6368; box-shadow: none; }

/* Gnima Focus Mode */
.gnima-root.focus-mode .gnima-sidebar,
.gnima-root.focus-mode .gnima-topbar { display: none !important; }
.gnima-root.focus-mode .gnima-main { padding-left: 0; }
.gnima-root.focus-mode .gnima-chat-scroll { padding-left: 8%; padding-right: 8%; }

/* Sparkle micro animation */
.gnima-msg-row.tool { position: relative; }

/* Search filter active hint */
.serp-live-filters button[style*="background"] { background: rgba(138,180,248,0.12) !important; border-color: #8ab4f8; }

/* Gnima message micro-lift */
.gnima-msg-ai-content, .gnima-msg-user-bubble { transition: transform .12s ease, box-shadow .12s ease; }
.gnima-msg-ai-content:hover, .gnima-msg-user-bubble:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0,0,0,0.12); }

/* Plan header shimmer (Neural Expressive) */
.gnima-msg-row.plan .gnima-msg-ai-content { position: relative; overflow: hidden; }
.gnima-msg-row.plan .gnima-msg-ai-content::after {
  content: '';
  position: absolute; top: -50%; left: -40%;
  width: 30%; height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: gnima-shimmer 2.4s linear infinite;
}
@keyframes gnima-shimmer { to { transform: translateX(260%); } }

/* Neural Expressive 2026 micro polish */
.gnima-msg-ai-content, .gnima-msg-user-bubble {
  transition: transform .15s cubic-bezier(0.2,0,0,1), box-shadow .15s;
}
.gnima-msg-row:hover .gnima-msg-ai-content,
.gnima-msg-row:hover .gnima-msg-user-bubble { transform: translateY(-0.5px); }

.serp-ai-overview {
  position: relative;
  overflow: hidden;
}
.serp-ai-overview::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.06) 50%, transparent 80%);
  animation: neShimmer 2.8s linear infinite;
  pointer-events: none;
}
@keyframes neShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

.drive-folder-card, .drive-file-row {
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s;
  contain: layout style paint;
  will-change: transform;
}
.drive-folder-card:hover, .drive-file-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Stronger focus rings everywhere */
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

.hero-gemini-input input:focus-visible,
.hero-gemini-input textarea:focus-visible,
.hero-gemini-icon-btn:focus-visible,
#portal-view .search-buttons .btn:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

/* Better empty + skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255,255,255,0.06) 50%, var(--bg-secondary) 75%); background-size: 200% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* === Free Blast 4: GooSpark, Sidekicks, Activity, Drive power === */
.goo-spark-card {
  margin: 16px auto; max-width: 980px; background: var(--bg-primary);
  border: 1px solid var(--border-color); border-radius: 16px; padding: 14px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.goo-spark-header { display:flex; align-items:center; gap:8px; font-weight:600; margin-bottom:6px; }
.goo-spark-header .spark-icon { color: #fbbc04; }
.goo-spark-body { font-size:13px; line-height:1.45; color: var(--text-primary); margin-bottom:8px; }
.goo-spark-chips { display:flex; gap:6px; flex-wrap:wrap; }
.goo-spark-chips .gnima-chip { font-size:11px; }

.gnima-sidekick {
  position: fixed; bottom: 18px; right: 18px; z-index: 999;
  background: var(--bg-primary); border:1px solid var(--border-color); border-radius:999px;
  padding: 6px 14px; display:flex; align-items:center; gap:8px; font-size:12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15); cursor:pointer;
}
.gnima-sidekick:hover { border-color:#8ab4f8; }

.live-activity-strip {
  height: 26px; background: var(--bg-secondary); border-bottom:1px solid var(--border-color);
  font-size:11px; display:flex; align-items:center; gap:12px; padding:0 16px; overflow:hidden;
  color: var(--text-secondary);
}
.live-activity-strip .event { white-space:nowrap; opacity:.85; }
.live-activity-strip .event + .event::before { content:"·"; margin:0 8px; opacity:.4; }

.drive-file-row .thumb {
  width:28px; height:28px; border-radius:4px; object-fit:cover; margin-right:8px; vertical-align:middle; border:1px solid var(--border-color);
}
.drive-quick-menu { position:relative; }
.drive-quick-menu .menu-pop {
  position:absolute; right:0; top:22px; background:var(--bg-primary); border:1px solid var(--border-color);
  border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,.12); z-index:50; min-width:140px; font-size:12px; display:none;
}
.drive-quick-menu.open .menu-pop { display:block; }
.drive-quick-menu .menu-item { padding:6px 12px; cursor:pointer; }
.drive-quick-menu .menu-item:hover { background:var(--bg-secondary); }

.goo-success-burst {
  position:absolute; pointer-events:none; width:6px;height:6px;border-radius:50%; background:#34a853;
  animation: burst-pop .6s ease forwards;
}
@keyframes burst-pop {
  0% { transform: scale(.2); opacity:1; }
  80% { transform: scale(1.6); opacity:.9; }
  100% { transform: scale(2.2); opacity:0; }
}

/* === Round 5: Breathe, Remember, Connect === */
#gooRecentRow { scrollbar-width: thin; }
#gooRecentRow::-webkit-scrollbar { height: 4px; }
.goo-recent-pill { transition: transform .08s ease, box-shadow .08s ease; }
.goo-recent-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.1); }

.cmail-drop-hint, .cg-drop-hint {
  border: 1px dashed transparent;
  transition: border-color .15s, background .15s;
}
.cmail-drop-hint.dragover, .cg-drop-hint.dragover {
  border-color: #8ab4f8;
  background: rgba(138,180,248,0.06);
}

/* Typing indicator (CreamGram) */
.cg-typing {
  font-size: 11px; color: var(--text-tertiary); padding: 2px 10px; display: flex; align-items: center; gap: 6px;
}
.cg-typing .dots { display: inline-flex; gap: 2px; }
.cg-typing .dots span { width: 3px; height: 3px; background: currentColor; border-radius: 50%; animation: cg-typing-bounce 1.2s infinite; }
.cg-typing .dots span:nth-child(2) { animation-delay: .15s; }
.cg-typing .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes cg-typing-bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-3px); } }

/* Ecosystem pulse */
.eco-pulse {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-tertiary);
}
.eco-pulse .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34a853;
  box-shadow: 0 0 0 0 rgba(52,168,83,0.6);
  animation: pulse-live 2.2s infinite;
}
@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(52,168,83,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(52,168,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,168,83,0); }
}

/* Alive skeleton variant */
.skeleton-alive {
  background: linear-gradient(90deg, var(--bg-secondary) 20%, rgba(138,180,248,0.12) 50%, var(--bg-secondary) 80%);
  background-size: 220% 100%;
  animation: sk-alive 1.6s linear infinite;
}
@keyframes sk-alive { to { background-position: -220% 0; } }

/* Virtual list hint row */
.drive-virtual-spacer { height: 1px; background: transparent; }

/* EroClub History + Diff */
#eroHistList > div:hover { background: #2a2a2a !important; }
#eroDiffView { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#eroDiffView div { padding: 1px 0; }

/* CreamGram media messages */
#cgMessages img, #cgMessages video { max-width: 100%; height: auto; border: 1px solid var(--border-color); }

/* CreamMail compose fullscreen feel */
#cmailComposeModal.cmail-full { box-shadow: 0 10px 60px rgba(0,0,0,0.5); }

