
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

  :root {
    --bg: #1f1f1f;
    --sidebar-bg: #1f1f1f;
    --surface: #262626;
    --surface-hover: #2f2f2f;
    --surface-subtle: #242424;
    --surface-elevated: #262626;
    --card-bg: #262626;
    --card-border: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.07);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-hover: rgba(255, 255, 255, 0.14);
    --text: #f4f3f0;
    --text-muted: #a3a3a3;
    --text-dim: #737373;

    --brand-orange: #f4f3f0;
    --brand-orange-hover: #ffffff;
    --brand-orange-active: #e2e0d8;
    --brand-orange-light: #f4f3f0;
    --brand-orange-subtle: rgba(255, 255, 255, 0.08);
    --brand-orange-glow: rgba(255, 255, 255, 0.16);
    --brand-orange-border: rgba(255, 255, 255, 0.20);

    --accent: #f4f3f0;
    --accent-text: #1f1f1f;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-w: 240px;
  }

  /* Luxury Monochromatic Accent (Monochrome Luxury Dark - Zero Glow) */
  .btn-primary {
    background: #f4f3f0 !important;
    color: #1f1f1f !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .btn-primary:hover {
    background: #ffffff !important;
    color: #0d0d0c !important;
    transform: none !important;
    box-shadow: none !important;
  }
  .btn-primary:active {
    transform: none !important;
    background: #e2e0d8 !important;
  }

  * { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
  }
  html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
  }
  button, input, textarea, select, a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  @media (max-width: 768px) {
    input, textarea, select {
      font-size: 16px !important;
    }
  }
  svg.lucide, i[data-lucide] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
  }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: clip;
  }

  /* App Shell */
  .app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    width: 100%;
    overflow-x: clip;
  }

  /* Left Sidebar (ChatGPT style collapsible, fixed & locked) */
  .sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 40;
    user-select: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.28s ease,
                opacity 0.22s ease;
    will-change: transform;
  }

  html.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    border-right-color: transparent;
    pointer-events: none;
  }

  /* Desktop: Hide mobile controls */
  .btn-hamburger,
  .sidebar-close-btn,
  .sidebar-backdrop {
    display: none !important;
  }

  .sidebar-header {
    height: 60px;
    padding: 0 14px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: none !important;
  }

  /* Sidebar collapse button in sidebar-header (ChatGPT / Claude luxury style) */
  .sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    border: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.18s ease,
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    padding: 0;
  }

  .sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: none;
  }

  .sidebar-collapse-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.96);
  }

  /* Floating Expand Button (shown when collapsed, ChatGPT style) */
  .btn-sidebar-expand {
    position: fixed;
    top: 13px;
    left: 14px;
    z-index: 60;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #201f1d;
    background: rgba(32, 31, 29, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: rgba(255, 255, 255, 0.70);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-12px);
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.24s ease,
                background 0.18s ease,
                border-color 0.18s ease,
                color 0.18s ease;
    outline: none;
  }

  html.sidebar-collapsed .btn-sidebar-expand,
  body.sidebar-collapsed .btn-sidebar-expand {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .btn-sidebar-expand:hover {
    background: #272623;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
    transform: none;
  }

  .btn-sidebar-expand:active {
    transform: scale(0.96);
  }

  /* When collapsed, adjust top-header padding on desktop so title doesn't overlap floating button */
  html.sidebar-collapsed .top-header,
  body.sidebar-collapsed .top-header {
    padding-left: 62px;
  }

  .brand-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.18s ease;
  }

  .brand-wrap:hover {
    opacity: 0.92;
  }

  .brand-brandmark {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .brand-logo-svg {
    width: 124px;
    height: 22px;
    display: flex;
    align-items: center;
  }

  .brand-logo-svg svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
  }

  .brand-logo-svg svg path,
  .brand-logo-svg .doox-symbol,
  .brand-logo-svg .doox-text {
    fill: #ffffff !important;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .brand-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    display: block;
    line-height: 1.2;
  }

  .brand-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 400;
    display: block;
    line-height: 1;
    letter-spacing: 0.03em;
    padding-left: 1px;
  }

  /* Sidebar Navigation */
  .sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
  }

  .nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.32);
    padding: 14px 10px 4px;
    user-select: none;
  }

  .nav-section-label:first-child {
    padding-top: 2px;
  }

  .nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.82rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.18s ease,
                border-color 0.18s ease,
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    outline: none;
  }

  .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.045);
    color: #ffffff;
    transform: translateX(2px);
  }

  .nav-item:hover:not(.active) .nav-icon {
    color: #ffffff;
  }

  .nav-item.active {
    background: var(--surface, #262626);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
    color: #ffffff;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.18);
  }

  .nav-item.active .nav-icon {
    color: #ffffff;
    filter: none;
  }

  .nav-item.active .nav-label {
    color: #ffffff;
    font-weight: 500;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.42);
    flex-shrink: 0;
    transition: color 0.18s ease, filter 0.18s ease;
  }

  .nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }

  .nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    min-width: 18px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.68rem;
    font-weight: 500;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  }

  .nav-item:hover .nav-badge {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
  }

  #nav-badge-history-count {
    display: none !important;
  }

  /* Sidebar Footer (Super Clean - No separator line, Grok style) */
  .sidebar-footer {
    padding: 10px 10px 14px;
    margin-top: auto;
    position: relative;
    border-top: none;
  }

  .sidebar-profile-wrap {
    position: relative;
    width: 100%;
  }

  .sidebar-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 9px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: background 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
  }

  .sidebar-profile-btn:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-profile-btn:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .sidebar-signin-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 9px;
    background: transparent;
    border: none !important;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: background 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
    box-shadow: none !important;
  }

  .sidebar-signin-btn:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-signin-btn:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .signin-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #d4d4d8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.16s ease, color 0.16s ease;
  }

  .sidebar-signin-btn:hover .signin-btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .signin-btn-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 1px;
  }

  .signin-btn-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #f4f3f0;
    line-height: 1.25;
  }

  .signin-btn-sub {
    font-size: 0.68rem;
    color: #71717a;
    line-height: 1.2;
  }

  .signin-btn-chevron {
    width: 14px;
    height: 14px;
    color: #52525b;
    flex-shrink: 0;
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), color 0.16s ease;
  }

  .sidebar-signin-btn:hover .signin-btn-chevron {
    color: #a1a1aa;
    transform: translateX(2px);
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface, #262626);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
    color: #f4f3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    flex-shrink: 0;
  }


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

  .profile-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #f4f3f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  .profile-sub {
    font-size: 0.68rem;
    color: #888580;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .profile-chevron {
    width: 14px;
    height: 14px;
    color: #888580;
    flex-shrink: 0;
    opacity: 0.45;
    transition: opacity 0.16s ease, color 0.16s ease;
  }

  .sidebar-profile-btn:hover .profile-chevron {
    opacity: 0.9;
    color: #f4f3f0;
  }

  /* Profile Popover Menu (Upward Floating, Soft & Borderless, Matching App Palette) */
  /* Profile Popover Menu (Grok-Style Pure Minimalist, Cardless & Borderless) */
  .profile-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #191816;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.85), 0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .profile-popover.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .profile-popover-header {
    padding: 8px 12px 6px;
  }

  .profile-popover-email {
    display: block;
    font-size: 0.8rem;
    color: #8e8c87;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    letter-spacing: -0.01em;
  }

  /* Popover Items List - Grok Rhythm */
  .popover-items-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
  }

  .profile-popover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #f4f3f0;
    font-size: 0.84rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.14s ease, color 0.14s ease;
    outline: none;
    box-sizing: border-box;
  }

  .profile-popover-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
  }

  .profile-popover-item .popover-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .popover-item-icon {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.65);
    flex-shrink: 0;
    transition: color 0.14s ease;
  }

  .profile-popover-item:hover .popover-item-icon {
    color: #ffffff;
  }

  /* Quota Row Styling */
  .profile-popover-item.quota-item {
    cursor: default;
  }

  .popover-item-icon.quota-icon {
    color: #4ade80;
  }

  .popover-quota-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .popover-quota-track {
    width: 44px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
  }

  .popover-quota-fill {
    height: 100%;
    background: #4ade80;
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
  }

  .popover-quota-num {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f4f3f0;
    font-variant-numeric: tabular-nums;
  }

  /* Language Switcher Row */
  .profile-popover-item.lang-item {
    cursor: default;
  }

  .popover-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
  }

  .lang-toggle-btn {
    background: transparent;
    border: none;
    font-size: 0.74rem;
    font-weight: 500;
    color: #716f6a;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease;
  }

  .lang-toggle-btn.active {
    color: #ffffff;
    font-weight: 600;
  }

  .lang-toggle-sep {
    font-size: 0.68rem;
    color: #44423e;
    user-select: none;
  }

  /* Sign Out (Danger) */
  .profile-popover-item.danger {
    color: #f87171;
  }

  .profile-popover-item.danger .popover-item-icon {
    color: #f87171;
  }

  .profile-popover-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
  }

  .profile-popover-item.danger:hover .popover-item-icon {
    color: #ef4444;
  }

  .btn-sidebar-admin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.74rem;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.18s ease,
                border-color 0.18s ease,
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .btn-sidebar-admin:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
  }

  .btn-sidebar-admin:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-status-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px;
    font-size: 0.7rem;
    color: var(--text-dim);
  }

  .status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .live-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: liveDotPulse 2.4s ease-in-out infinite;
  }

  @keyframes liveDotPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(0.8); opacity: 0.4; }
  }

  /* Main Shell */
  .main-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    overflow-x: clip;
    background: var(--bg);
    transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  html.sidebar-collapsed .main-shell,
  body.sidebar-collapsed .main-shell {
    margin-left: 0;
    width: 100%;
  }

  /* ==========================================================================
     RBAC Zero-Leak / Anti-Flicker: Admin elements completely hidden by default
     ========================================================================== */
  .admin-only-section,
  .admin-only-action {
    display: none !important;
  }

  /* Revealed strictly and solely when document has class is-admin */
  html.is-admin .admin-only-section {
    display: block !important;
  }

  html.is-admin .profile-popover-item.admin-only-action,
  html.is-admin .bottom-nav-item.admin-only-action {
    display: flex !important;
  }

  html.is-admin .admin-only-action:not(.profile-popover-item):not(.bottom-nav-item) {
    display: inline-flex !important;
  }

  /* Top Header with Soft Blur and Auto-Hide Transitions */
  .top-header {
    height: 60px;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    background: rgba(31, 31, 31, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 50;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s ease,
                padding-left 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease,
                backdrop-filter 0.3s ease,
                -webkit-backdrop-filter 0.3s ease,
                box-shadow 0.3s ease;
    will-change: transform, opacity, padding-left;
  }

  .top-header.header-scrolled {
    background: rgba(31, 31, 31, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .top-header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
  }

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

  .header-titles {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
    max-width: 100%;
  }

  .page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }

  .page-caption {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
    flex-shrink: 0;
  }

  /* Grok-style Header Guest Auth Pill Buttons */
  .header-guest-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  html.is-authenticated .header-guest-auth,
  body.is-authenticated .header-guest-auth {
    display: none !important;
  }

  .btn-header-signin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #d4d4d8;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
    user-select: none;
    white-space: nowrap;
  }

  .btn-header-signin:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  .btn-header-signin:active {
    transform: scale(0.97);
  }

  .btn-header-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid transparent;
    color: #000000;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
    user-select: none;
    white-space: nowrap;
  }

  .btn-header-signup:hover {
    background: #f4f4f5;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  }

  .btn-header-signup:active {
    background: #e4e4e7;
    transform: translateY(0) scale(0.97);
  }

  @media (max-width: 480px) {
    .btn-header-signin {
      padding: 6px 10px;
      font-size: 0.78rem;
    }
    .btn-header-signup {
      padding: 6px 14px;
      font-size: 0.78rem;
    }
  }

  /* Soft Black & White Buttons (Zero Glow, Matte Luxury) */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface, #262626);
    border: none !important;
    color: #8b8f9c;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    box-shadow: none !important;
  }

  .btn:hover {
    background: var(--surface-hover, #2e2e2e);
    color: #ffffff;
  }

  .btn-primary {
    background: #f4f3f0 !important;
    border: none !important;
    color: #1f1f1f !important;
    font-weight: 600;
    box-shadow: none !important;
  }

  .btn-primary:hover {
    background: #ffffff !important;
    color: #1f1f1f !important;
    box-shadow: none !important;
  }

  .btn-secondary {
    background: var(--surface, #262626) !important;
    border: none !important;
    color: #8b8f9c !important;
    box-shadow: none !important;
  }

  .btn-secondary:hover {
    background: var(--surface-hover, #2e2e2e) !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  /* Content Body */
  .content-body {
    flex: 1;
    padding: 24px 28px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-x: clip;
  }

  .tab-content { display: none; }
  .tab-content.active {
    display: block;
    animation: tabFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

  /* Stats Grid - Frameless, quiet, soft black */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 16px 20px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    min-height: 90px;
    min-width: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .stat-card:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    transform: translateY(-1.5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  }

  .stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a3a3a3;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    height: 28px;
    display: flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-val-sm {
    font-size: 0.88rem !important;
    font-weight: 600;
    font-family: var(--font-sans);
  }

  .stat-desc {
    font-size: 0.7rem;
    color: #5d6170;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


  /* ==========================================================================
     ACCOUNTS MANAGEMENT (SUPER CLEAN, SOFT-BLACK BRANDED, FRAMELESS AESTHETIC)
     Modeled after Image Studio, API Keys, and modern luxury cloud observability
     ========================================================================== */

  /* Accounts Subtabs Navigation (Frameless Capsule Switcher) */
  .accounts-subtabs-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
  }

  .accounts-subtabs-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  }

  .accounts-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #a3a3a3;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .accounts-subtab-btn:hover {
    color: #ffffff;
    background: var(--surface-hover, #2f2f2f);
  }

  .accounts-subtab-btn.active {
    background: #333333 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .accounts-subtab-btn.active .badge-count-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  .btn-add-browserbase {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f3f0 !important;
    color: #1f1f1f !important;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
  }

  .btn-add-browserbase:hover {
    background: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  }

  /* Browserbase Bento Card */
  .bb-account-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
  }

  .bb-account-card:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
  }

  .bb-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .bb-card-email-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .bb-card-email-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #242320;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4c7d0;
    flex-shrink: 0;
  }

  .bb-card-email-meta {
    min-width: 0;
    flex: 1;
  }

  .bb-card-email-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .bb-card-edit-btn {
    background: transparent;
    border: none;
    color: #5d6170;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
  }

  .bb-card-edit-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  .bb-card-sublabel {
    font-size: 0.68rem;
    color: #8b8f9c;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Badges */
  .bb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    flex-shrink: 0;
  }

  .bb-status-badge.active {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
  }

  .bb-status-badge.cooldown {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
  }

  .bb-status-badge.disabled {
    background: rgba(139, 143, 156, 0.15);
    color: #8b8f9c;
  }

  .bb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }

  .bb-status-badge.active .bb-dot {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  }

  .bb-status-badge.cooldown .bb-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
  }

  .bb-status-badge.disabled .bb-dot {
    background: #8b8f9c;
  }

  /* Body details */
  .bb-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg, #1f1f1f);
    border-radius: 10px;
    padding: 10px 12px;
  }

  /* Real-time Quota Meter Section */
  .bb-quota-section {
    background: var(--surface, #262626);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .bb-quota-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
  }

  .bb-quota-title {
    color: #e4e4e7;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .bb-quota-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #4ade80;
    font-size: 0.72rem;
  }

  .bb-quota-val.exhausted {
    color: #f87171;
  }

  .bb-progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
  }

  .bb-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
  }

  .bb-progress-bar-fill.good {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
  }

  .bb-progress-bar-fill.warning {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  }

  .bb-progress-bar-fill.empty {
    background: #ef4444;
  }

  .bb-quota-subtext {
    font-size: 0.65rem;
    color: #8b8f9c;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Secondary Metrics Mini-Grid (4 cells) */
  .bb-metrics-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 2px 0;
  }

  .bb-mini-stat {
    background: var(--surface, #262626);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .bb-mini-label {
    font-size: 0.63rem;
    color: #71717a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .bb-mini-val {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: #f4f3f0;
    font-weight: 600;
  }

  .bb-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    gap: 8px;
  }

  .bb-info-label {
    color: #5d6170;
    font-weight: 500;
    white-space: nowrap;
  }

  .bb-info-val {
    color: #f4f3f0;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bb-copy-mini-btn {
    background: transparent;
    border: none;
    color: #5d6170;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: color 0.15s ease;
  }

  .bb-copy-mini-btn:hover {
    color: #ffffff;
  }

  /* Card Footer Actions */
  .bb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
  }

  .bb-card-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .bb-btn-test {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #333333;
    border: none;
    color: #e4e4e7;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .bb-btn-test:hover {
    background: #282724;
    color: #ffffff;
  }

  .bb-btn-test.testing {
    opacity: 0.6;
    pointer-events: none;
  }

  .bb-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #71717a;
    padding: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .bb-btn-delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
  }

  /* Section Header */
  .section-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .section-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
  }

  .badge-count-pill {
    background: #282724;
    color: #8b8f9c;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: var(--font-mono);
    border: none !important;
  }

  .section-toolbar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Search Input Capsule (Frameless Soft-Black) */
  .search-input-capsule {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 999px !important;
    padding: 6px 14px;
    width: 230px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .search-input-capsule:focus-within {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35) !important;
  }

  .search-input-capsule input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.78rem;
    font-family: inherit;
    min-width: 0;
  }

  .search-input-capsule input::-webkit-search-cancel-button,
  .search-input-capsule input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
  }

  .search-input-capsule input::placeholder {
    color: #a3a3a3;
  }

  .search-clear-btn {
    background: transparent;
    border: none;
    color: #a3a3a3;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    margin-left: 2px;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .search-clear-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  /* Filter Pill Group (Frameless Capsule) */
  .filter-pill-group {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 999px !important;
    padding: 3px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
  }

  .filter-pill {
    background: transparent;
    border: none !important;
    color: #a3a3a3;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
  }

  .filter-pill:hover {
    color: #ffffff;
    background: var(--surface-hover, #2f2f2f);
  }

  .filter-pill.active {
    background: #333333 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  /* Accounts Bento Grid - 4 Columns on Desktop */
  .accounts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
  }

  @media (max-width: 1279px) {
    .accounts-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (max-width: 1023px) {
    .accounts-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 639px) {
    .accounts-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }
  }

  /* Frameless Soft-Black Account Card */
  .account-card {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 18px !important;
    padding: 18px 20px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .account-card:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
  }

  .account-card.active {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35) !important;
  }

  /* Card Top Row */
  .acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  .acc-avatar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .acc-avatar-squircle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg, #1f1f1f) !important;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.82rem;
    flex-shrink: 0;
    border: none !important;
  }

  .account-card.active .acc-avatar-squircle {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f4f3f0 !important;
  }

  .acc-title-wrap {
    min-width: 0;
    flex: 1;
  }

  .acc-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.25;
  }

  .acc-badges-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .acc-pill-hot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f4f3f0 !important;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    border: none !important;
  }

  .acc-pill-standby {
    display: inline-flex;
    align-items: center;
    color: #5d6170;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0 4px;
    font-family: var(--font-mono);
  }

  .acc-pill-cooldown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(248, 113, 113, 0.12) !important;
    color: #f87171 !important;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.28) !important;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
  }

  .acc-btn-trash-ghost {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none !important;
    color: #5d6170;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
    padding: 0;
  }

  .account-card:hover .acc-btn-trash-ghost {
    opacity: 0.75;
  }

  .acc-btn-trash-ghost:hover {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    opacity: 1 !important;
  }

  /* Antigravity Model Groups Section (Recessed Soft-Black Inset Blocks) */
  .acc-antigravity-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
  }

  .acc-group-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--bg, #1f1f1f) !important;
    border-radius: 12px !important;
    padding: 9px 12px !important;
    border: none !important;
  }

  .acc-group-title {
    font-size: 0.64rem;
    font-weight: 600;
    color: #a3a3a3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .acc-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 2px 0;
  }

  .acc-item-left {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
  }

  .acc-item-name {
    font-size: 0.74rem;
    font-weight: 500;
    color: #d1d5db;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .acc-item-reset {
    font-size: 0.64rem;
    color: #5d6170;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .acc-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .acc-item-pct {
    font-size: 0.76rem;
    font-weight: 600;
    color: #ffffff;
    min-width: 32px;
    text-align: right;
    font-family: var(--font-mono);
  }

  /* Card Bottom Footer */
  .acc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    margin-top: auto;
  }

  .acc-tier-text {
    color: #5d6170;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .acc-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .acc-btn-main {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    color: #f4f3f0 !important;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .acc-btn-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #333333 !important;
    border: none !important;
    color: #d4d4d8 !important;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s ease;
  }

  .acc-btn-switch:hover {
    background: #282724 !important;
    color: #ffffff !important;
  }

  /* Modal Overlay */
  .modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
  }
  .modal-overlay.open { display: flex; }

  /* Fullscreen Image Preview Lightbox */
  .modal-overlay.image-preview-lightbox {
    z-index: 2500 !important;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .modal-overlay.image-preview-lightbox.open {
    display: flex !important;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .image-preview-meta-bar {
    max-width: 86vw;
    width: 100%;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
  }
  .image-preview-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 3px 12px;
    font-weight: 600;
  }
  .image-preview-prompt-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.45;
    max-height: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    margin: 0;
    font-weight: 500;
    max-width: 680px;
  }
  .image-preview-img {
    max-width: 86vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
  }
  .image-preview-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e1f20;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  }
  .image-preview-close:hover {
    transform: scale(1.1);
    background: #2b2c2e;
    color: #f4f3f0;
  }
  .image-preview-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 21, 24, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  .modal-title { font-size: 0.95rem; font-weight: 600; color: #fff; }
  .close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }

  .form-group { margin-bottom: 0.9rem; }
  .form-label { display: block; font-size: 0.74rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.35rem; }
  .form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #5f6368;
  }
  .form-textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); font-size: 0.76rem; }

  /* Autofill styling override for Chrome/Edge */
  input:-webkit-autofill,
  input:-webkit-autofill:hover, 
  input:-webkit-autofill:focus,
  textarea:-webkit-autofill,
  textarea:-webkit-autofill:hover,
  textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #131314 inset !important;
    transition: background-color 5000s ease-in-out 0s;
  }

  /* ==========================================================================
     Ultra-Clean Premium Auth Modal (Studio Soft-Black - Zero Glow)
     ========================================================================== */
  .auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000 !important;
    background: rgba(14, 13, 12, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: authOverlayFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

  .auth-modal-card {
    width: 100%;
    max-width: 396px;
    background: var(--bg, #1f1f1f); /* Exact match with web canvas background */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.02);
    padding: 34px 28px 24px;
    position: relative;
    box-sizing: border-box;
    animation: premiumModalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes premiumModalEnter {
    0% {
      opacity: 0;
      transform: scale(0.96) translateY(10px);
      filter: blur(4px);
    }
    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
      filter: blur(0px);
    }
  }

  .auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted, #9d9a93);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
  }

  .auth-modal-close:hover {
    color: var(--text, #f4f3f0);
    background: rgba(255, 255, 255, 0.07);
  }

  .auth-modal-close:active {
    transform: scale(0.92);
  }

  .auth-modal-header {
    text-align: center;
    margin-bottom: 20px;
  }

  .auth-brand-logo-clean {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
  }

  .auth-brand-logo-clean svg {
    width: 100%;
    height: 100%;
    filter: none !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .auth-brand-logo-clean:hover svg {
    transform: scale(1.05);
  }

  .auth-modal-title {
    font-size: 1.28rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.025em;
    margin-bottom: 5px;
  }

  .auth-modal-desc {
    font-size: 0.83rem;
    color: var(--text-muted, #9d9a93);
    line-height: 1.45;
  }

  .auth-google-wrapper {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 2px;
    width: 100%;
  }

  .google-btn-slot {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .auth-divider-minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 16px;
    width: 100%;
  }

  .auth-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border, rgba(255, 255, 255, 0.05));
  }

  .auth-divider-text {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-dim, #68655e);
    user-select: none;
    white-space: nowrap;
  }

  .auth-error-box {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    font-size: 0.78rem;
    padding: 9px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    line-height: 1.35;
    animation: authFormSlideFade 0.2s ease both;
  }

  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: authFormSlideFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

  .auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .auth-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-muted, #9d9a93);
    letter-spacing: 0.01em;
  }

  .auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .auth-forgot-link {
    font-size: 0.72rem;
    color: #8e8c87;
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .auth-forgot-link:hover {
    color: #f4f3f0;
    text-decoration: underline;
  }

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

  .auth-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--surface, #262626);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    border-radius: 12px;
    color: var(--text, #f4f3f0);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .auth-input-wrap .auth-input[type="password"],
  .auth-input-wrap .auth-input[type="text"] {
    padding-right: 38px;
  }

  .auth-input::placeholder {
    color: rgba(255, 255, 255, 0.22);
  }

  .auth-input:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: var(--border-hover, rgba(255, 255, 255, 0.12));
  }

  .auth-input:focus {
    background: var(--surface, #262626);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: none;
  }

  .auth-password-toggle {
    position: absolute;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted, #9d9a93);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
  }

  .auth-password-toggle:hover {
    color: var(--text, #f4f3f0);
  }

  .auth-submit-btn {
    margin-top: 4px;
    height: 44px;
    padding: 0 20px;
    background: var(--text, #f4f3f0);
    color: var(--bg, #1f1f1f);
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.01em;
  }

  .auth-submit-btn:hover {
    background: #ffffff;
    color: #0d0d0c;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.14);
  }

  .auth-submit-btn:active {
    background: #e2e0d8;
    transform: translateY(0) scale(0.98);
  }

  .auth-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .auth-mode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .auth-switch-prompt {
    color: var(--text-muted, #9d9a93);
    font-weight: 400;
  }

  .auth-switch-btn {
    background: none;
    border: none;
    color: var(--text, #f4f3f0);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .auth-switch-btn:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-decoration-skip-ink: auto;
  }

  .auth-switch-btn:active {
    opacity: 0.75;
  }

  .auth-footer-terms {
    font-size: 0.72rem;
    color: var(--text-dim, #78756e);
    text-align: center;
    margin-top: 16px;
    line-height: 1.55;
    user-select: none;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
    letter-spacing: 0.01em;
  }


  /* ==========================================================================
     Playground Container & Segmented Navigation (Quiet Luxury Soft-Black)
     ========================================================================== */

  /* Outer Container (Borderless Quiet Luxury Canvas) */
  .pg-container {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 16px;
    height: calc(100vh - 165px);
    min-height: 540px;
    max-height: 880px;
    width: 100%;
    box-shadow: none;
    transition: grid-template-columns 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .pg-controls {
    background: #262626;
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
  }

  .pg-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2px;
  }

  .pg-controls-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f4f3f0;
    letter-spacing: -0.01em;
  }

  /* Desktop Sidebar Collapsible State */
  .pg-container.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0;
  }

  .pg-container.sidebar-collapsed .pg-controls {
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }

  /* Shared Playground Form Controls (Quiet Luxury Soft-Black) */
  .pg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .pg-label {
    font-size: 0.72rem;
    font-weight: 550;
    color: #9d9a93;
    letter-spacing: 0.01em;
  }

  .pg-input,
  .pg-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    color: #f4f3f0;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 9px 12px;
    outline: none;
    transition: all 0.18s ease;
  }

  .pg-input:hover,
  .pg-select:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .pg-input:focus,
  .pg-select:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .pg-select option,
  .pg-select optgroup {
    background: #262626;
    color: #f4f3f0;
  }

  /* View Panes Switcher Base */
  .pg-view-pane {
    width: 100%;
  }

  /* Playground Subtabs Segmented Capsule Nav */
  .pg-subtabs-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .pg-subtabs-nav-wrapper::-webkit-scrollbar {
    display: none;
  }

  .pg-subtabs-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.025);
    border: none;
    border-radius: 10px;
    padding: 3px;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .pg-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    color: #9d9a93;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .pg-subtab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.045);
  }

  .pg-subtab-btn.active {
    background: #2e2e2e;
    color: #ffffff;
    font-weight: 550;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  }

  .pg-subtab-btn .badge-count-pill {
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #9d9a93;
    font-family: var(--font-mono);
  }

  .pg-subtab-btn.active .badge-count-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  /* Header Shared Utility Controls */
  .pg-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .pg-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pg-header-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 4px 10px;
  }

  .pg-header-select {
    background: transparent;
    border: none;
    outline: none;
    color: #f4f3f0;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 550;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .pg-header-select option,
  .pg-header-select optgroup {
    background: #262626;
    color: #f4f3f0;
  }

  .pg-effort-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    font-size: 0.67rem;
    font-family: var(--font-mono);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .pg-latency-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    letter-spacing: 0.02em;
    border: none;
  }

  .pg-btn-header-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #9d9a93;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .pg-btn-header-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
  }


  /* ==========================================================================
     ChatGPT Style Canvas & Layout
     ========================================================================== */

  .chatgpt-canvas-container {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    border-radius: 18px;
    height: calc(100vh - 165px);
    min-height: 540px;
    max-height: 880px;
    width: 100%;
    overflow: hidden;
    box-shadow: none;
  }

  /* --------------------------------------------------------------------------
     ChatGPT Top Header
     -------------------------------------------------------------------------- */
  .chatgpt-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    background: transparent;
    flex-shrink: 0;
    z-index: 10;
    gap: 12px;
  }

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

  /* ChatGPT-style Model Pill Dropdown */
  .chatgpt-model-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 6px 8px;
    transition: all 0.16s ease;
    cursor: pointer;
  }

  .chatgpt-model-dropdown:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .chatgpt-model-select {
    background: transparent;
    border: none;
    outline: none;
    color: #f4f3f0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2px;
  }

  .chatgpt-model-select option,
  .chatgpt-model-select optgroup {
    background: #1c1b18;
    color: #f4f3f0;
  }

  .chatgpt-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .chatgpt-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #9d9a93;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .chatgpt-btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
  }

  /* --------------------------------------------------------------------------
     ChatGPT Feed Viewport (Centered Column)
     -------------------------------------------------------------------------- */
  .chatgpt-feed-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    scroll-behavior: smooth;
  }

  .chatgpt-feed-inner {
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
  }

  /* --------------------------------------------------------------------------
     ChatGPT Hero / Empty State
     -------------------------------------------------------------------------- */
  .chatgpt-hero {
    margin: auto;
    max-width: 720px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 20px;
  }

  .chatgpt-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: none;
  }

  .chatgpt-hero-title {
    font-size: 1.55rem;
    font-weight: 600;
    color: #f4f3f0;
    letter-spacing: -0.025em;
    margin: 0;
  }

  .chatgpt-hero-desc {
    display: none;
  }

  .chatgpt-suggestions-grid {
    display: none;
  }

  /* --------------------------------------------------------------------------
     Messages Bubbles (Clean ChatGPT Alignment)
     -------------------------------------------------------------------------- */
  .chatgpt-msg-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    animation: fadeInMsg 0.22s ease;
  }

  .chatgpt-msg-user-wrap {
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .chatgpt-msg-user {
    max-width: 80%;
    background: #333333;
    border: none;
    border-radius: 20px;
    padding: 12px 18px;
    color: #f4f3f0;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .chatgpt-msg-assistant-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .chatgpt-msg-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
  }

  .chatgpt-author-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #f4f3f0;
  }

  .chatgpt-author-tag i {
    color: #f4f3f0;
  }

  .chatgpt-msg-assistant-card {
    background: transparent;
    border: none;
    padding: 4px 2px;
    color: #ececee;
    font-size: 0.88rem;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
    font-family: var(--font-sans);
  }

  /* --------------------------------------------------------------------------
     ChatGPT Floating Input Box (The Signature Element)
     -------------------------------------------------------------------------- */
  .chatgpt-input-wrapper {
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    flex-shrink: 0;
    z-index: 10;
  }

  .chatgpt-input-box {
    width: 100%;
    max-width: 768px;
    background: #2b2b2b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 26px;
    padding: 12px 14px 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chatgpt-input-box:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  }

  .chatgpt-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #f4f3f0;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    height: 26px;
    max-height: 150px;
    padding: 0;
    overflow-y: auto;
  }

  .chatgpt-textarea::placeholder {
    color: #68655e;
  }

  .chatgpt-input-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .chatgpt-input-tools {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .chatgpt-tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: #9d9a93;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .chatgpt-tool-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  .chatgpt-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f4f3f0;
    border: none;
    color: #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
  }

  .chatgpt-send-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: scale(1.06);
  }

  .chatgpt-send-btn:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
  }

  .chatgpt-disclaimer {
    font-size: 0.68rem;
    color: #68655e;
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
  }

  /* --------------------------------------------------------------------------
     Slide-Over Parameter Drawer (Inspector on Right)
     -------------------------------------------------------------------------- */
  .chatgpt-drawer-backdrop {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
    transition: opacity 0.25s ease;
  }

  .chatgpt-drawer-backdrop.open {
    display: block;
  }

  .chatgpt-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 330px;
    max-width: 90vw;
    background: #262626;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 20px;
    overflow-y: auto;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chatgpt-drawer.open {
    transform: translateX(0);
  }

  .chatgpt-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .chatgpt-drawer-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f4f3f0;
  }

  .chatgpt-drawer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Drawer Form Controls */
  .chatgpt-drawer .pg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .chatgpt-drawer .pg-label {
    font-size: 0.72rem;
    font-weight: 550;
    color: #9d9a93;
    letter-spacing: 0.01em;
  }

  .chatgpt-drawer .pg-select,
  .chatgpt-drawer .pg-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f4f3f0;
    font-family: inherit;
    font-size: 0.78rem;
    padding: 8px 12px;
    outline: none;
    transition: all 0.18s ease;
  }

  .chatgpt-drawer .pg-select:hover,
  .chatgpt-drawer .pg-input:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .chatgpt-drawer .pg-select:focus,
  .chatgpt-drawer .pg-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .chatgpt-drawer .pg-select option,
  .chatgpt-drawer .pg-select optgroup {
    background: #262626;
    color: #f4f3f0;
  }

  .chatgpt-drawer .pg-btn-reset {
    background: transparent;
    border: none;
    color: var(--text-dim, #9d9a93);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .chatgpt-drawer .pg-btn-reset:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
  }

  .chatgpt-drawer .pg-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
  }

  .chatgpt-drawer .pg-switch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .chatgpt-drawer .pg-switch-title {
    font-size: 0.76rem;
    font-weight: 550;
    color: #f4f3f0;
  }

  .chatgpt-drawer .pg-switch-subtitle {
    font-size: 0.68rem;
    color: #68655e;
  }

  .chatgpt-drawer .pg-toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
  }

  .chatgpt-drawer .pg-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .chatgpt-drawer .pg-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 999px;
  }

  .chatgpt-drawer .pg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }

  .chatgpt-drawer .pg-toggle-switch input:checked + .pg-toggle-slider {
    background-color: #f4f3f0;
  }

  .chatgpt-drawer .pg-toggle-switch input:checked + .pg-toggle-slider:before {
    transform: translateX(16px);
    background-color: #1f1f1f;
  }

  .chatgpt-drawer .pg-pool-status {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .chatgpt-drawer .pg-pool-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
  }

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

    .chatgpt-header {
      padding: 0 12px;
    }

    .chatgpt-input-wrapper {
      padding: 8px 12px 14px;
    }
  }


  /* ==========================================================================
     Playground Image Studio (Multi-Engine Visual Generator)
     ========================================================================== */

  .pg-img-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    height: calc(100vh - 165px);
    min-height: 560px;
    max-height: 880px;
    width: 100%;
  }

  /* Left Panel: Controls */
  .pg-img-controls {
    background: #262626;
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
  }

  .pg-img-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .pg-img-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pg-img-controls-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f4f3f0;
    letter-spacing: -0.01em;
  }

  .pg-img-tag {
    font-size: 0.65rem;
    background: rgba(255, 92, 0, 0.12);
    color: #ff8533;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
  }

  /* Form Elements */
  .pg-select-wrap {
    position: relative;
    width: 100%;
  }

  .pg-select-wrap select {
    width: 100%;
    appearance: none;
    background: #1f1f1f;
    color: #f4f3f0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 9px 32px 9px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: background 0.15s ease;
  }

  .pg-select-wrap select:focus {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.14);
  }

  .pg-select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    color: #71717a;
    pointer-events: none;
  }

  .pg-field-desc {
    font-size: 0.72rem;
    color: #8e8b82;
    line-height: 1.35;
    margin-top: 4px;
    display: block;
  }

  /* Aspect Ratio Grid */
  .pg-img-ratio-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 4px;
  }

  .pg-img-ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: #a3a3a3;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .pg-img-ratio-btn:hover {
    background: #2e2e2e;
    color: #f4f3f0;
  }

  .pg-img-ratio-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-weight: 600;
  }

  .ratio-box {
    border: 1.5px solid currentColor;
    border-radius: 3px;
    background: transparent;
    flex-shrink: 0;
  }
  .ratio-box.ratio-1-1 { width: 14px; height: 14px; }
  .ratio-box.ratio-16-9 { width: 18px; height: 10px; }
  .ratio-box.ratio-9-16 { width: 10px; height: 18px; }
  .ratio-box.ratio-4-5 { width: 12px; height: 15px; }
  .ratio-box.ratio-3-4 { width: 12px; height: 16px; }

  /* Prompt Textarea & Chips */
  .pg-img-textarea {
    width: 100%;
    min-height: 90px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    color: #f4f3f0;
    font-size: 0.8rem;
    line-height: 1.45;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .pg-img-textarea:focus {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.16);
  }

  .pg-btn-inline-clear {
    background: none;
    border: none;
    color: #71717a;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
  }

  .pg-btn-inline-clear:hover {
    color: #f4f3f0;
  }

  .pg-img-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
  }

  .pg-img-chips-label {
    width: 100%;
    font-size: 0.68rem;
    color: #71717a;
    margin-bottom: 2px;
  }

  .pg-img-chip {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.68rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .pg-img-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
  }

  .pg-img-actions {
    margin-top: auto;
    padding-top: 8px;
  }

  /* Right Panel: Viewport Canvas */
  .pg-img-stage {
    background: #262626;
    border: none;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .pg-img-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(22, 21, 20, 0.6);
  }

  .pg-img-stage-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pg-img-badge-engine {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 9px;
    border-radius: 999px;
  }

  .pg-img-info-pill {
    font-size: 0.7rem;
    color: #71717a;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 7px;
    border-radius: 6px;
  }

  .pg-img-stage-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Canvas Stage */
  .pg-img-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
    background: radial-gradient(circle at center, rgba(30, 29, 28, 0.4) 0%, rgba(18, 17, 16, 0.9) 100%);
    position: relative;
    min-height: 280px;
  }

  .pg-img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 360px;
    padding: 20px;
  }

  .pg-img-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
  }

  .pg-img-empty-title {
    font-size: 0.94rem;
    font-weight: 600;
    color: #f4f3f0;
    margin: 0 0 6px 0;
  }

  .pg-img-empty-desc {
    font-size: 0.78rem;
    color: #71717a;
    line-height: 1.45;
    margin: 0;
  }

  /* Loading Shimmer */
  .pg-img-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 420px;
  }

  .pg-img-shimmer-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 380px;
    background: #262626;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  }

  .pg-img-shimmer-wave {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    animation: pgImgShimmer 1.5s infinite;
  }

  @keyframes pgImgShimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
  }

  .pg-img-loading-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #8e8b82;
  }

  .pg-img-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff5c00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  /* Display Rendered Image */
  .pg-img-display-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 100%;
    max-width: 100%;
  }

  .pg-img-result {
    max-width: 100%;
    max-height: calc(100vh - 380px);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    cursor: zoom-in;
    transition: transform 0.2s ease;
    object-fit: contain;
  }

  .pg-img-result:hover {
    transform: scale(1.01);
  }

  /* Bottom Inspector Drawer */
  .pg-img-inspector {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #1f1f1f;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .pg-img-inspector-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .pg-img-inspect-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    color: #71717a;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .pg-img-inspect-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: #f4f3f0;
    font-weight: 500;
  }

  .pg-btn-copy-code {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 6px;
    font-size: 0.68rem;
    color: #8e8b82;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .pg-btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
  }

  .pg-img-code-block {
    margin: 0;
    padding: 10px 12px;
    background: #1f1f1f;
    border-radius: 8px;
    color: #cbd5e1;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 90px;
  }

  /* Responsive Rules */
  @media (max-width: 900px) {
    .pg-img-container {
      grid-template-columns: 1fr;
      height: auto;
      max-height: none;
    }
    .pg-img-controls {
      height: auto;
      max-height: 520px;
    }
    .pg-img-viewport {
      min-height: 380px;
    }
  }


  /* ==========================================================================
     Playground Web Tools Tester (Browserbase & Brave Search)
     ========================================================================== */

  .pg-wt-container {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 16px;
    height: calc(100vh - 165px);
    min-height: 540px;
    max-height: 880px;
    width: 100%;
    box-shadow: none;
  }

  .pg-wt-controls {
    background: #262626;
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
  }

  .pg-wt-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .pg-wt-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .pg-wt-controls-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f4f3f0;
    letter-spacing: -0.01em;
  }

  .pg-wt-tag {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    color: #9d9a93;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 500;
  }

  .pg-wt-mode-switch,
  .pg-wt-tool-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: rgba(255, 255, 255, 0.025);
    padding: 3px;
    border-radius: 10px;
    border: none;
  }

  .pg-wt-mode-btn,
  .pg-wt-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #9d9a93;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .pg-wt-mode-btn:hover,
  .pg-wt-tool-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
  }

  .pg-wt-mode-btn.active,
  .pg-wt-tool-btn.active {
    background: #2e2e2e;
    color: #ffffff;
    font-weight: 550;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  }

  .pg-wt-form,
  .pg-wt-form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .pg-wt-chips-group,
  .pg-wt-suggestions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
  }

  .pg-wt-chips-label,
  .pg-wt-suggestions-label {
    font-size: 0.68rem;
    color: #68655e;
    font-weight: 500;
  }

  .pg-wt-chip {
    background: rgba(255, 255, 255, 0.035);
    border: none;
    color: #9d9a93;
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.14s ease;
    font-family: inherit;
  }

  .pg-wt-chip:hover {
    background: #2e2e2e;
    color: #ffffff;
  }

  .pg-wt-number-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .pg-wt-slider {
    flex: 1;
    accent-color: #f4f3f0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
  }

  .pg-wt-num-input {
    width: 60px !important;
    text-align: center;
  }

  .pg-wt-run-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f4f3f0;
    color: #1f1f1f;
    border: none;
    cursor: pointer;
    transition: all 0.18s ease;
  }

  .pg-wt-run-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: none;
    box-shadow: none;
  }

  .pg-wt-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  /* Results Console (Borderless Luxury Panel) */
  .pg-wt-results-area {
    display: flex;
    flex-direction: column;
    background: #262626;
    border: none;
    border-radius: 16px;
    overflow: hidden;
  }

  .pg-wt-results-header {
    height: 52px;
    padding: 0 20px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
  }

  .pg-wt-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .pg-wt-results-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
  }

  .pg-wt-badge-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
  }

  .pg-wt-badge-status.success {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
  }

  .pg-wt-badge-status.error {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
  }

  .pg-wt-view-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    padding: 2px;
    border-radius: 8px;
  }

  .pg-wt-toggle-btn {
    border: none;
    background: transparent;
    color: #9d9a93;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .pg-wt-toggle-btn.active {
    background: #2e2e2e;
    color: #ffffff;
    font-weight: 600;
  }

  .pg-wt-results-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
  }

  .pg-wt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    max-width: 440px;
    margin: 0 auto;
  }

  .pg-wt-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f4f3f0;
    margin-bottom: 16px;
    box-shadow: none;
  }

  .pg-wt-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
  }

  .pg-wt-empty-desc {
    font-size: 0.78rem;
    color: #9d9a93;
    line-height: 1.5;
    margin: 0;
  }

  .pg-wt-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .pg-wt-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  .pg-wt-card:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
  }

  .pg-wt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  .pg-wt-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .pg-wt-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
  }

  .pg-wt-domain {
    font-size: 0.72rem;
    color: #a3a3a3;
    font-weight: 500;
  }

  .pg-wt-rank {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    color: #a3a3a3;
    padding: 1px 6px;
    border-radius: 999px;
  }

  .pg-wt-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f4f3f0;
    text-decoration: none;
    line-height: 1.4;
    display: inline-block;
    margin-bottom: 6px;
  }

  .pg-wt-card-snippet {
    font-size: 0.78rem;
    color: #d4d4d8;
    line-height: 1.5;
    margin: 0;
  }

  .pg-wt-article-content {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px;
    padding: 20px;
  }

  .pg-wt-content-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.82rem;
    color: #f4f3f0;
    line-height: 1.6;
  }

  .pg-wt-json-content pre {
    background: rgba(255, 255, 255, 0.025);
    border: none;
    border-radius: 12px;
    padding: 20px;
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    color: #9d9a93;
    overflow-x: auto;
    margin: 0;
  }

  .pg-wt-error-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 480px;
    margin: 40px auto;
  }


  /* ==========================================================================
     Playground Mobile & Responsive Adaptations (Bottom Sheet & Viewports)
     ========================================================================== */

  @media (max-width: 900px) {
    .pg-wt-container,
    .pg-container {
      grid-template-columns: 1fr;
      height: auto;
      max-height: none;
      gap: 12px;
    }

    .pg-wt-controls,
    .pg-controls {
      border: none;
    }
  }

  @media (max-width: 768px) {
    .chatgpt-canvas-container {
      border-radius: 12px;
      height: calc(100vh - 140px);
    }

    .chatgpt-hero-title {
      font-size: 1.25rem;
    }

    .chatgpt-hero-desc {
      font-size: 0.78rem;
      margin-bottom: 20px;
    }

    .chatgpt-suggestions-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .chatgpt-feed-viewport {
      padding: 14px 10px;
    }

    .chatgpt-msg-user {
      max-width: 90%;
      padding: 10px 14px;
      font-size: 0.84rem;
    }

    .chatgpt-input-wrapper {
      padding: 8px 10px env(safe-area-inset-bottom, 12px);
    }

    .chatgpt-input-box {
      border-radius: 20px;
      padding: 10px 12px 8px 14px;
    }

    .btn-label-desktop {
      display: none;
    }

    .chatgpt-drawer {
      width: 100%;
      max-width: 100vw;
      border-left: none;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
  }

  /* ============================================================
     TABLES & CARDS MODULE (IMAGE STUDIO CLEAN & SOFT BLACK)
     Zero-Lines Philosophy: Frameless pads, soft-black surfaces, no box cages.
     ============================================================ */

  /* Endpoint Cards & Snippets */
  .endpoint-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
  }

  .endpoint-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .endpoint-card:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .endpoint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .endpoint-tag {
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a3a3a3;
  }

  .endpoint-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .endpoint-method {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .endpoint-code {
    flex: 1 1 0;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
  }

  .btn-copy-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #8b8f9c;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .btn-copy-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateY(-1px);
  }

  .endpoint-desc {
    font-size: 0.74rem;
    color: #8b8f9c;
    line-height: 1.45;
    margin: 0;
  }

  /* Integration Snippet Card (Frameless Soft Black) */
  .integration-snippet-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 24px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
  }

  .snippet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .snippet-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 999px;
    padding: 3px;
  }

  .snippet-tab {
    background: transparent;
    border: none;
    color: #a3a3a3;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .snippet-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
  }

  .snippet-tab.active {
    background: var(--surface-hover, #2f2f2f);
    color: #ffffff;
    font-weight: 600;
  }

  .snippet-code-box {
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 14px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
  }

  /* Keys Section Header */
  .keys-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    border: none !important;
  }

  .keys-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .keys-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
  }

  .keys-header-sub {
    font-size: 0.76rem;
    color: #8b8f9c;
    margin: 0;
  }

  .btn-generate-key {
    background: #f4f3f0 !important; border: none !important; color: #1f1f1f !important;
    border-radius: 999px !important;
    padding: 7px 18px !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.35) !important;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .btn-generate-key:hover {
    background: var(--brand-orange-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.5) !important;
  }

  /* Table Container (Frameless Soft Black Canvas) */
  .table-container,
  .table-wrap {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  }

  table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.80rem;
    border: none;
  }

  th {
    background: var(--bg, #1f1f1f);
    color: #8e8e8e;
    font-weight: 600;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  td {
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.80rem;
    vertical-align: middle;
  }

  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--surface-hover, #2f2f2f); }

  .code-pill {
    font-family: var(--font-mono);
    color: #8b8f9c;
    font-size: 0.75rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
  }

  /* Frameless Badges */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.70rem;
    font-weight: 600;
    border: none;
  }
  .badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
  }
  .badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
  }
  .badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
  }

  /* Revoke ghost button */
  .btn-revoke-ghost {
    background: transparent;
    border: none;
    color: #f87171;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
  }

  .btn-revoke-ghost:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ff6b6b;
  }

  /* Toast */
  #toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #262626;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    font-size: 0.82rem;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 200;
  }
  #toast.show { display: flex; }
  #toast.error { background: #2a1416; color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
  #toast.success { background: #0f291e; color: #4ade80; border-color: rgba(74, 222, 128, 0.25); }

  /* Mobile and Tablet Base Tokens */
  .header-mobile-brand { display: none; }
  .mobile-only-btn { display: none; }
  .mobile-bottom-nav { display: none; }

  /* Medium Desktop / Large Tablet Header Optimization (<= 1200px) */
  @media (max-width: 1200px) {
    .page-caption { display: none !important; }
    .top-header { max-width: 100%; box-sizing: border-box; overflow: hidden; }
  }

  /* Tablet Adaptation: 769px - 1024px */
  @media (min-width: 769px) and (max-width: 1024px) {
    :root {
      --sidebar-w: 200px;
    }
    .top-header { padding: 0 20px; max-width: 100%; box-sizing: border-box; overflow: hidden; }
    .page-caption { display: none !important; }
    .btn-label-desktop { display: none !important; }
    .btn-icon-only-mobile {
      padding: 0 !important;
      width: 34px !important;
      height: 34px !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      border-radius: var(--radius-sm) !important;
    }
    .content-body { padding: 18px 20px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .accounts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .endpoint-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .pg-container { grid-template-columns: 240px 1fr; height: calc(100vh - 120px); }
    .table-container, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container table, .table-wrap table { min-width: 580px; }
  }

  /* Mobile Adaptation: <= 768px (Clean Flutter-like Mobile Experience) */
  @media (max-width: 768px) {
    html.sidebar-collapsed .sidebar,
    body.sidebar-collapsed .sidebar {
      margin-left: 0 !important;
      transform: translateX(-100%) !important;
      pointer-events: auto !important;
    }

    .sidebar-collapse-btn,
    .btn-sidebar-expand {
      display: none !important;
    }

    .app-layout {
      flex-direction: column;
      min-height: 100vh;
    }

    /* Mobile Sidebar Drawer (Menu Samping) */
    .sidebar {
      display: flex !important;
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      bottom: 0 !important;
      width: min(280px, 82vw) !important;
      max-width: 320px !important;
      height: 100vh !important;
      height: 100dvh !important;
      z-index: 1000 !important;
      background: var(--sidebar-bg) !important;
      border-right: 1px solid var(--border) !important;
      box-shadow: 14px 0 40px rgba(0, 0, 0, 0.75) !important;
      transform: translateX(-100%) !important;
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
      will-change: transform;
      padding-top: env(safe-area-inset-top, 0px);
      padding-bottom: calc(14px + env(safe-area-inset-bottom, 12px));
      padding-left: env(safe-area-inset-left, 0px);
      box-sizing: border-box;
    }

    .sidebar.sidebar-open,
    html.sidebar-collapsed .sidebar.sidebar-open,
    body.sidebar-collapsed .sidebar.sidebar-open {
      transform: translateX(0) !important;
    }

    .sidebar-backdrop {
      display: block !important;
      position: fixed !important;
      inset: 0 !important;
      background: rgba(0, 0, 0, 0.65) !important;
      backdrop-filter: blur(4px) !important;
      -webkit-backdrop-filter: blur(4px) !important;
      z-index: 999 !important;
      opacity: 0 !important;
      pointer-events: none !important;
      transition: opacity 0.25s ease !important;
    }

    .sidebar-backdrop.active {
      opacity: 1 !important;
      pointer-events: auto !important;
    }

    .sidebar-header {
      height: 56px !important;
      padding: 0 14px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
    }

    .sidebar-close-btn {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 32px !important;
      height: 32px !important;
      border-radius: var(--radius-sm) !important;
      border: 1px solid var(--border) !important;
      background: var(--surface) !important;
      color: var(--text-muted) !important;
      cursor: pointer !important;
      transition: background 0.15s ease, color 0.15s ease !important;
      flex-shrink: 0 !important;
    }

    .sidebar-close-btn:active {
      background: var(--surface-hover) !important;
      color: var(--text-main) !important;
    }

    .btn-hamburger {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 34px !important;
      height: 34px !important;
      border-radius: var(--radius-sm) !important;
      border: 1px solid var(--border) !important;
      background: var(--surface) !important;
      color: var(--text-main) !important;
      cursor: pointer !important;
      flex-shrink: 0 !important;
      margin-right: 4px !important;
      transition: background 0.15s ease, border-color 0.15s ease !important;
    }

    .btn-hamburger:active {
      background: var(--surface-hover) !important;
      border-color: #3c3e42 !important;
    }

    .sidebar-nav {
      padding: 12px 10px !important;
    }

    .nav-item {
      padding: 9px 12px !important;
      font-size: 0.84rem !important;
      border-radius: 8px !important;
      gap: 10px !important;
    }

    .nav-icon {
      width: 17px !important;
      height: 17px !important;
    }

    .main-shell {
      width: 100% !important;
      margin-left: 0 !important;
      min-width: 0;
      overflow-x: clip;
    }

    /* Top App Bar (Mobile) with Soft Blur, Auto-Hide & Safe Area Insets */
    .top-header {
      padding-top: env(safe-area-inset-top, 0px);
      padding-bottom: 0;
      padding-left: calc(14px + env(safe-area-inset-left, 0px));
      padding-right: calc(14px + env(safe-area-inset-right, 0px));
      height: calc(56px + env(safe-area-inset-top, 0px));
      box-sizing: border-box;
      position: sticky;
      top: 0;
      background: rgba(31, 31, 31, 0.88);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
      z-index: 50;
      transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                  opacity 0.28s ease,
                  background-color 0.3s ease,
                  backdrop-filter 0.3s ease,
                  -webkit-backdrop-filter 0.3s ease,
                  box-shadow 0.3s ease;
      will-change: transform, opacity;
    }

    .top-header.header-scrolled {
      background: rgba(31, 31, 31, 0.95);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }

    .top-header.header-hidden {
      transform: translateY(-100%);
      opacity: 0;
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      pointer-events: none;
    }

    .header-mobile-brand {
      display: flex;
      align-items: center;
      margin-right: 8px;
    }

    .mobile-brand-logo {
      width: 26px;
      height: 26px;
      object-fit: contain;
      display: block;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      flex: 1 1 auto;
      overflow: hidden;
    }

    .header-titles {
      min-width: 0;
      overflow: hidden;
      flex: 1 1 auto;
    }

    .page-title {
      font-size: 0.95rem;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.2;
      max-width: 100%;
    }

    .page-caption {
      display: none !important;
    }

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

    .btn-label-desktop {
      display: none !important;
    }

    .btn-icon-only-mobile {
      padding: 0;
      width: 34px;
      height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-sm);
    }

    .mobile-only-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      padding: 0;
      border-radius: var(--radius-sm);
    }

    /* Content Area with clean clearance on Mobile (No bottom-nav blocking & Safe Areas) */
    .content-body {
      padding: 14px calc(14px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
      box-sizing: border-box;
    }

    /* Stats Grid - 2-Grid */
    .stats-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 1rem;
    }

    .stat-card {
      padding: 10px 12px;
      min-width: 0;
    }

    .stat-val {
      font-size: 1.15rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stat-label {
      font-size: 0.68rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .stat-desc {
      font-size: 0.64rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* Search & Filter Toolbar */
    .section-header-modern {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      margin-bottom: 12px;
    }

    .section-toolbar-wrap {
      flex-direction: column;
      width: 100%;
      gap: 8px;
    }

    .search-input-capsule {
      width: 100%;
    }

    .filter-pill-group {
      width: 100%;
      display: flex;
    }

    .filter-pill {
      flex: 1;
      text-align: center;
      padding: 6px 8px;
      font-size: 0.72rem;
    }

    /* Accounts & Cards - Clean 2-Grid */
    .accounts-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 8px;
    }

    .account-card {
      padding: 10px 10px;
      gap: 8px;
      min-width: 0;
      border-radius: var(--radius-sm);
    }

    .card-top {
      gap: 8px;
      min-width: 0;
    }

    .avatar-clean {
      width: 28px;
      height: 28px;
      font-size: 0.72rem;
      flex-shrink: 0;
    }

    .profile-info {
      min-width: 0;
      flex: 1;
    }

    .profile-name-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      min-width: 0;
    }

    .profile-name {
      font-size: 0.75rem;
      line-height: 1.2;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
    }

    .status-badge {
      font-size: 0.58rem;
      padding: 1px 6px;
      line-height: 1.2;
    }

    .quota-minimal {
      padding: 4px 0 2px;
      gap: 3px;
    }

    .quota-minimal-label {
      font-size: 0.64rem;
    }

    .quota-minimal-val {
      font-size: 0.65rem;
    }

    .models-summary-line {
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      font-size: 0.62rem;
      line-height: 1.2;
      padding: 3px 0 1px;
      min-width: 0;
    }

    .models-summary-line span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
      display: block;
    }

    .card-actions {
      padding-top: 6px;
      gap: 5px;
      min-width: 0;
    }

    .btn-switch,
    .active-tag {
      padding: 4px 6px;
      font-size: 0.66rem;
      gap: 3px;
      min-width: 0;
      flex: 1;
      justify-content: center;
    }

    .btn-switch span,
    .active-tag span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .btn-trash {
      width: 26px;
      height: 26px;
      flex-shrink: 0;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* Playground on Mobile (Chat-First & Native Bottom Sheet) */
    .pg-container {
      display: flex;
      flex-direction: column;
      height: calc(100vh - 56px - 70px - env(safe-area-inset-bottom, 0px));
      min-height: 480px;
      max-height: none;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      position: relative;
      overflow: hidden;
      margin: 0;
      background: var(--surface);
    }

    /* Mobile Controls: Sleek Native Bottom Sheet */
    .pg-controls {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: var(--surface, #262626);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-bottom: none;
      border-radius: 20px 20px 0 0;
      padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
      max-height: 82vh;
      overflow-y: auto;
      z-index: 150;
      transform: translateY(105%);
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.65);
    }

    .pg-controls.open {
      transform: translateY(0);
    }

    .pg-sheet-handle {
      display: block;
      width: 36px;
      height: 4px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 2px;
      margin: 0 auto 12px;
    }

    .pg-btn-close-mobile {
      display: inline-flex;
    }

    .pg-btn-apply-mobile {
      display: flex;
      width: 100%;
      justify-content: center;
      padding: 10px;
      font-size: 0.82rem;
      margin-top: 6px;
      border-radius: var(--radius-sm);
    }

    /* Backdrop for Bottom Sheet */
    .pg-controls-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 140;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .pg-controls-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }

    /* Chat Area on Mobile */
    .pg-chat-area {
      flex: 1;
      height: 100%;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    .pg-chat-header {
      height: 50px;
      padding: 0 12px;
      flex-shrink: 0;
      gap: 6px;
    }

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

    .pg-model-picker-capsule {
      max-width: 150px;
      padding: 3px 6px 3px 8px;
    }

    .pg-header-model-select {
      font-size: 0.72rem;
      max-width: 105px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .pg-header-actions {
      gap: 5px;
      flex-shrink: 0;
    }

    .pg-btn-settings {
      padding: 4px 8px;
    }

    /* Messages Feed on Mobile */
    .pg-messages-feed {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 12px;
      gap: 12px;
    }

    .pg-welcome-state {
      padding: 8px 0;
      max-width: 100%;
    }

    .pg-welcome-title {
      font-size: 1.05rem;
      margin-bottom: 4px;
    }

    .pg-welcome-desc {
      font-size: 0.72rem;
      margin-bottom: 14px;
      line-height: 1.4;
      padding: 0 6px;
    }

    .pg-suggestions-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      width: 100%;
    }

    .pg-suggestion-card {
      padding: 9px 11px;
      gap: 3px;
    }

    .suggestion-title {
      font-size: 0.72rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .suggestion-arrow {
      display: none;
    }

    .suggestion-desc {
      font-size: 0.62rem;
      line-height: 1.25;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    /* Bottom Input Footer on Mobile */
    .pg-input-footer {
      padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
      gap: 4px;
      background: transparent;
      border-top: none;
    }

    .pg-input-capsule {
      padding: 4px 6px 4px 14px;
      gap: 6px;
    }

    .pg-input-field {
      font-size: 0.8rem;
      height: 28px;
      line-height: 28px;
    }

    .pg-send-btn {
      width: 30px;
      height: 30px;
    }

    .pg-input-hint {
      display: none !important;
    }

    /* Universal Mobile Anti-Zoom & Touch Sizing: inputs, selects & textareas MUST be 16px to prevent iOS auto-zoom */
    input,
    textarea,
    select,
    .form-control,
    .chat-composer-textarea,
    .chat-model-select,
    .chat-tool-select,
    .pg-composer-input {
      font-size: 16px !important;
    }

    /* Image Studio Mobile Experience (Flawless ChatGPT / Gemini Flow) */
    .chat-canvas-view {
      max-width: 100%;
      min-height: 100dvh;
      height: 100%;
      padding: 0;
    }

    .chat-canvas-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 2px 14px;
      width: 100%;
      box-sizing: border-box;
      flex-shrink: 0;
    }

    .chat-model-dropdown-wrap {
      min-width: 0;
      max-width: calc(100% - 110px);
      flex-shrink: 1;
      padding: 4px 10px;
      gap: 4px;
    }

    .chat-model-select {
      min-width: 0;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 16px !important;
      transform: scale(0.82);
      transform-origin: left center;
      width: 122%;
    }

    .chat-canvas-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .chat-status-pill {
      font-size: 0.68rem;
      white-space: nowrap;
      padding: 3px 7px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.07);
      border-radius: 6px;
    }

    .chat-icon-btn {
      width: 28px;
      height: 28px;
      flex-shrink: 0;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .chat-canvas-scroll {
      padding: calc(62px + env(safe-area-inset-top, 0px)) 12px calc(140px + env(safe-area-inset-bottom, 16px)) !important;
      gap: 16px;
    }

    /* Keep Initial Welcome State vertically balanced on mobile */
    .chat-canvas-view.is-initial .chat-canvas-scroll {
      display: flex !important;
      flex-direction: column !important;
      justify-content: center !important;
      align-items: center !important;
      min-height: 100% !important;
      padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(140px + env(safe-area-inset-bottom, 16px)) !important;
      overflow-y: auto !important;
    }

    /* Pinned Bottom Composer on Mobile (Grok style - never translate up) */
    .chat-canvas-view.is-initial .chat-composer-wrap,
    .chat-canvas-view .chat-composer-wrap {
      transform: none !important;
      animation: none !important;
      position: fixed !important;
      bottom: 0 !important;
      left: 0 !important;
      right: 0 !important;
      z-index: 50 !important;
    }

    .chat-hero {
      padding: 16px 12px 12px;
      margin: 0 auto;
      text-align: center;
    }

    .chat-hero-logo,
    .chat-hero-logo-svg {
      width: 44px !important;
      height: 44px !important;
      margin-bottom: 12px !important;
    }

    .chat-hero-heading {
      font-size: 1.55rem !important;
      margin-bottom: 8px !important;
      line-height: 1.25 !important;
      letter-spacing: -0.02em !important;
    }

    .chat-hero-subheading {
      font-size: 0.88rem !important;
      line-height: 1.45 !important;
      max-width: 320px !important;
      margin: 0 auto !important;
      color: rgba(255, 255, 255, 0.55) !important;
    }

    .chat-quick-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 6px;
      max-width: 100%;
    }

    .chat-quick-pill {
      padding: 8px 10px;
      font-size: 0.72rem;
      min-width: 0;
      max-width: 100%;
      overflow: hidden;
    }

    .chat-quick-tag {
      font-size: 0.60rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .chat-quick-text {
      font-size: 0.68rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
      max-width: 100%;
    }

    .chat-msg-user {
      max-width: 82%;
      width: auto;
      display: inline-block;
      padding: 7px 12px;
      font-size: 0.84rem;
      border-radius: 16px;
      box-shadow: none;
      line-height: 1.4;
      word-break: break-word;
      white-space: pre-wrap;
      text-align: left;
    }

    .chat-msg-assistant {
      width: 100%;
      max-width: 100%;
    }

    /* Mobile Responsive Artwork Sizing (Prevent tall 9:16 images from clipping or hiding buttons) */
    .chat-artwork-wrap {
      border-radius: 14px;
      max-width: 100%;
    }

    .chat-artwork-wrap.ratio-9-16 {
      width: min(236px, 68vw) !important;
      max-height: min(420px, calc(100dvh - 300px)) !important;
      aspect-ratio: 9 / 16 !important;
    }

    .chat-artwork-wrap.ratio-4-5 {
      width: min(280px, 82vw) !important;
      max-height: min(350px, calc(100dvh - 280px)) !important;
      aspect-ratio: 4 / 5 !important;
    }

    .chat-artwork-wrap.ratio-1-1 {
      width: min(280px, 82vw) !important;
      aspect-ratio: 1 / 1 !important;
    }

    .chat-artwork-wrap.ratio-16-9 {
      width: 100% !important;
      max-width: 340px !important;
      aspect-ratio: 16 / 9 !important;
    }

    .chat-artwork-actions {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 8px;
      width: fit-content;
      max-width: 100%;
    }

    .chat-action-btn {
      padding: 6px 10px;
      font-size: 0.72rem;
      border-radius: 7px;
    }

    /* Composer Capsule Mobile & Safe Area (Grok-inspired Island, Clean Transparent Backdrop) */
    .chat-composer-wrap {
      position: fixed !important;
      bottom: 0 !important;
      left: 0 !important;
      right: 0 !important;
      z-index: 50 !important;
      padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 10px)) !important;
      background: transparent !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      pointer-events: none !important;
      display: flex !important;
      justify-content: center !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }

    .chat-composer-box {
      padding: 12px 14px 10px 14px !important;
      border-radius: 26px !important;
      gap: 8px !important;
      background: rgba(30, 29, 27, 0.95) !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      backdrop-filter: blur(20px) !important;
      -webkit-backdrop-filter: blur(20px) !important;
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
      pointer-events: auto !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    .chat-composer-textarea {
      min-height: 38px !important;
      max-height: 120px !important;
      font-size: 15px !important;
      line-height: 1.45 !important;
      padding: 2px 2px 0 2px !important;
      color: #f4f3f0 !important;
      box-sizing: border-box !important;
      -webkit-font-smoothing: antialiased !important;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      overflow-y: hidden !important;
      resize: none !important;
    }
    .chat-composer-textarea::-webkit-scrollbar {
      display: none !important;
      width: 0 !important;
      height: 0 !important;
    }

    .chat-composer-bar {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 6px !important;
      padding-top: 2px !important;
    }

    .chat-composer-tools {
      display: flex !important;
      align-items: center !important;
      gap: 4px !important;
      min-width: 0 !important;
      flex: 1 !important;
    }

    .chat-tool-btn {
      width: 32px !important;
      height: 32px !important;
      border-radius: 50% !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      flex-shrink: 0 !important;
      background: transparent !important;
      border: none !important;
      color: rgba(255, 255, 255, 0.6) !important;
    }
    .chat-tool-btn:active {
      background: rgba(255, 255, 255, 0.1) !important;
      color: #ffffff !important;
    }

    .cdd.cdd-compact .cdd-pill-trigger,
    .chat-thinking-pill,
    .chat-plugin-pill {
      height: 30px !important;
      padding: 0 8px !important;
      font-size: 0.74rem !important;
      border: none !important;
      box-shadow: none !important;
      white-space: nowrap !important;
    }

    .chat-send-btn {
      width: 34px !important;
      height: 34px !important;
      border-radius: 50% !important;
      border: none !important;
      box-shadow: none !important;
      flex-shrink: 0 !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    .chat-disclaimer {
      display: none !important;
    }

    /* Endpoints & Integration Cards on Mobile - Clean 2-Grid */
    .endpoint-cards-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 8px;
      margin-bottom: 16px;
    }

    .endpoint-card {
      padding: 10px 10px;
      gap: 6px;
      min-width: 0;
      border-radius: var(--radius-sm);
    }

    .endpoint-tag {
      font-size: 0.58rem;
    }

    .endpoint-url-box {
      padding: 5px 8px;
      gap: 4px;
      min-width: 0;
      flex-direction: column;
      align-items: flex-start;
    }

    .endpoint-method {
      font-size: 0.56rem;
      padding: 1px 4px;
    }

    .endpoint-code {
      font-size: 0.65rem;
      min-width: 0;
      word-break: break-all;
    }

    .endpoint-desc {
      font-size: 0.64rem;
      line-height: 1.3;
    }

    .integration-snippet-card {
      padding: 12px;
      margin-bottom: 16px;
    }

    .snippet-tabs {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      white-space: nowrap;
      max-width: calc(100% - 90px);
    }

    .snippet-tab {
      padding: 4px 8px;
      font-size: 0.68rem;
    }

    .snippet-code-box {
      padding: 10px 12px;
      font-size: 0.70rem;
      max-height: 200px;
    }

    /* Tables Horizontal Scroll on Mobile */
    .table-container,
    .table-wrap,
    .flow-table-card,
    .logs-table-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      margin-bottom: 16px;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .table-container table,
    .table-wrap table,
    .flow-data-table,
    table.logs-table {
      min-width: 580px;
    }

    th, td {
      padding: 8px 10px;
      font-size: 0.74rem;
    }

    /* Modals - Clean Mobile Bottom Sheet */
    .modal-overlay {
      padding: 0;
      align-items: flex-end;
      background: rgba(0, 0, 0, 0.75);
    }
    .modal-overlay.image-preview-lightbox {
      align-items: center !important;
      justify-content: center !important;
      padding: 12px !important;
    }

    .modal {
      width: 100% !important;
      max-width: 100% !important;
      border-radius: 20px 20px 0 0 !important;
      max-height: 85vh;
      overflow-y: auto;
      padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
      border-bottom: none !important;
      animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes slideUpSheet {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    /* Hide bottom navigation on mobile (Replaced by clean Side Drawer) */
    .mobile-bottom-nav {
      display: none !important;
    }
  }

  /* ==========================================================================
     ULTRA-RESPONSIVE ADAPTATION FOR SMALL MOBILES (<= 520px & <= 360px)
     Eliminates squished cards, text bleeds, and component collisions
     ========================================================================== */
  @media (max-width: 520px) {
    /* 1. Accounts Grid becomes clean 1-column cards */
    .accounts-grid {
      grid-template-columns: 1fr !important;
      gap: 12px !important;
    }

    .account-card {
      padding: 14px !important;
      overflow: hidden !important;
      box-sizing: border-box !important;
      min-width: 0 !important;
      max-width: 100% !important;
    }

    .acc-header {
      flex-wrap: wrap !important;
      gap: 8px !important;
    }

    .acc-badges-wrap {
      flex-wrap: wrap !important;
    }

    .acc-footer {
      flex-wrap: wrap !important;
      gap: 8px !important;
    }

    .acc-footer-actions {
      flex-wrap: wrap !important;
      gap: 6px !important;
    }

    /* 2. Endpoints Cards become clean 1-column */
    .endpoint-cards-grid {
      grid-template-columns: 1fr !important;
      gap: 10px !important;
    }

    .endpoint-card {
      padding: 12px 14px !important;
      box-sizing: border-box !important;
      min-width: 0 !important;
      max-width: 100% !important;
    }

    .keys-section-header {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 10px !important;
    }

    .btn-generate-key {
      width: 100% !important;
      justify-content: center !important;
    }

    /* 3. Header spacing for narrow screens (320px - 360px) */
    .top-header {
      padding-left: calc(10px + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(10px + env(safe-area-inset-right, 0px)) !important;
    }

    .header-left {
      gap: 4px !important;
    }

    .page-title {
      font-size: 0.88rem !important;
    }

    .content-body {
      padding: 10px calc(10px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px)) !important;
    }

    /* 4. Stats Grid */
    .stats-grid {
      grid-template-columns: 1fr !important;
      gap: 8px !important;
    }

    /* 5. Flow Subtabs Nav */
    .flow-subtabs-nav {
      padding: 3px !important;
      gap: 2px !important;
    }

    .flow-subtab-btn {
      padding: 5px 8px !important;
      font-size: 0.70rem !important;
    }

    /* 6. Integration Snippets */
    .integration-snippet-card {
      padding: 10px 12px !important;
    }

    .snippet-tabs {
      max-width: 100% !important;
    }

    .snippet-header {
      flex-direction: column !important;
      align-items: flex-start !important;
      gap: 8px !important;
    }

    /* 7. Image Studio prompt composer */
    .chat-composer-box {
      padding: 8px 10px !important;
    }

    .chat-hero-heading {
      font-size: 1.45rem !important;
    }

    .chat-hero-subheading {
      font-size: 0.86rem !important;
    }
  }

  /* ==========================================================================
     IMAGE STUDIO & FEED STUDIO (SUPER CLEAN SOFT-BLACK)
     ========================================================================== */


  /* Full-Screen Pure Canvas for Image Studio (ChatGPT / Midjourney Style) */
  .app-layout:has(#tab-image.active) .top-header,
  body.tab-image-active .top-header {
    display: none !important;
  }

  .app-layout:has(#tab-image.active) .content-body,
  body.tab-image-active .content-body {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  #tab-image.tab-content {
    padding: 0 !important;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: none;
    background: var(--bg);
  }
  @supports (height: 100dvh) {
    #tab-image.tab-content {
      height: 100dvh;
    }
  }
  #tab-image.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: tabFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* Floating Hamburger for Mobile Drawer in Image Studio */
  .chat-canvas-mobile-menu {
    display: none;
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 50;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(31, 31, 31, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: all 0.15s ease;
  }
  .chat-canvas-mobile-menu:hover {
    background: var(--surface-hover);
    color: #ffffff;
    border-color: var(--border-hover);
  }
  @media (max-width: 768px) {
    .chat-canvas-mobile-menu {
      display: inline-flex;
    }
  }

  /* Floating Top Brand Pill for Chat Canvas (Disabled / Removed per user request) */
  .chat-canvas-brand-pill {
    display: none !important;
  }
  .chat-canvas-brand-pill:hover {
    background: rgba(45, 47, 52, 0.95);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  }
  .chat-canvas-brand-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .chat-canvas-brand-icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }
  .chat-canvas-brand-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
  }

  /* Floating Top Actions Group in Image Studio - Pinned to the top-right corner */
  .chat-canvas-top-actions {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 80;
    display: none;
    align-items: center;
    gap: 8px;
  }
  #tab-image.active .chat-canvas-top-actions {
    display: inline-flex;
  }

  /* Guest Auth (Grok-style Minimal text Sign In + Crisp White Pill Sign Up) */
  .canvas-guest-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  html.is-authenticated .canvas-guest-auth,
  body.is-authenticated .canvas-guest-auth {
    display: none !important;
  }

  .btn-canvas-signin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #d4d4d8;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
    user-select: none;
    white-space: nowrap;
  }

  .btn-canvas-signin:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  .btn-canvas-signin:active {
    transform: scale(0.97);
  }

  .btn-canvas-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid transparent;
    color: #000000;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
    user-select: none;
    white-space: nowrap;
  }

  .btn-canvas-signup:hover {
    background: #f4f4f5;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  }

  .btn-canvas-signup:active {
    background: #e4e4e7;
    transform: translateY(0) scale(0.97);
  }

  /* Floating New Chat Button (Shown when Authenticated) */
  .chat-canvas-new-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(28, 29, 32, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  html:not(.is-authenticated) .chat-canvas-new-btn,
  body:not(.is-authenticated) .chat-canvas-new-btn {
    display: none !important;
  }

  .chat-canvas-new-btn:hover {
    background: rgba(45, 47, 52, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  }

  .chat-canvas-new-btn:active {
    transform: translateY(0);
  }

  .chat-canvas-new-btn .chat-new-label {
    letter-spacing: -0.01em;
  }

  /* Mobile Bar / Top Header Wrapper (Unified Header on Mobile, Seamless on Desktop) */
  .chat-canvas-mobile-bar {
    display: contents;
  }

  @media (max-width: 768px) {
    .chat-canvas-mobile-bar {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      height: calc(52px + env(safe-area-inset-top, 0px)) !important;
      padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 6px 14px !important;
      background: rgba(31, 31, 31, 0.94) !important;
      backdrop-filter: blur(16px) !important;
      -webkit-backdrop-filter: blur(16px) !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
      z-index: 60 !important;
      box-sizing: border-box !important;
    }
    .chat-canvas-mobile-bar .chat-canvas-mobile-menu {
      display: inline-flex !important;
      position: static !important;
      width: 36px !important;
      height: 36px !important;
      margin: 0 !important;
      box-shadow: none !important;
      flex-shrink: 0 !important;
    }
    .chat-canvas-mobile-bar .chat-canvas-top-actions {
      display: inline-flex !important;
      position: static !important;
      top: auto !important;
      right: auto !important;
      gap: 8px !important;
      flex-shrink: 0 !important;
    }
  }

  @media (max-width: 480px) {
    .chat-canvas-mobile-bar {
      padding: calc(5px + env(safe-area-inset-top, 0px)) 12px 5px 12px !important;
    }
    .chat-canvas-mobile-bar .chat-canvas-top-actions {
      gap: 6px !important;
    }
    .btn-canvas-signin {
      padding: 6px 10px;
      font-size: 0.78rem;
    }
    .btn-canvas-signup {
      padding: 6px 14px;
      font-size: 0.78rem;
    }
    .chat-canvas-new-btn .chat-new-label {
      display: none;
    }
    .chat-canvas-new-btn {
      width: 34px;
      padding: 0;
      justify-content: center;
    }
  }

  .chat-canvas-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
  }

  .chat-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(13, 14, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 20;
  }

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

  .chat-model-dropdown-wrap {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    min-width: 0;
  }

  .chat-model-dropdown-wrap:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
  }

  .chat-model-icon {
    flex-shrink: 0;
  }

  .chat-model-select {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2px;
    min-width: 0;
  }

  .chat-model-select option {
    background: #262626;
    color: #ffffff;
  }

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

  .chat-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
  }

  .status-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f4f3f0; color: #1f1f1f;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }

  .chat-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .chat-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .chat-canvas-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 36px 32px 240px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  /* ── Initial / Empty State — Centered Composer (ChatGPT / Claude Standard) ── */
  .chat-canvas-view.is-initial .chat-canvas-scroll {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 0 24px 140px 24px;
    overflow-y: hidden;
  }

  /* ── Floating Scroll-to-Bottom Button (DOOX Warm Soft-Black Glass) ────────── */
  .chat-scroll-bottom-btn {
    position: absolute;
    bottom: 116px;
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.85);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(24, 25, 28, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1cfc7;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    z-index: 50;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.15s ease,
                border-color 0.15s ease,
                color 0.15s ease;
  }
  .chat-scroll-bottom-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  .chat-scroll-bottom-btn:hover {
    background: rgba(38, 36, 33, 0.98);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateX(-50%) translateY(-2px) scale(1.04);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
  }
  .chat-scroll-bottom-btn:active {
    transform: translateX(-50%) translateY(0) scale(0.96);
  }

  /* =========================================================================
     DOOX Studio Canvas & Split-Workspace (Fase 2 & Fase 3)
     ========================================================================= */
  .chat-workspace-wrap {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bg);
  }

  /* When canvas is NOT open, chat view takes center stage */
  .chat-workspace-wrap:not(.has-canvas-open) .chat-canvas-view {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                flex 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* When canvas IS open, seamless desktop split view (Linear / Claude style) */
  .chat-workspace-wrap.has-canvas-open .chat-canvas-view {
    flex: 0 0 46%;
    max-width: 48%;
    min-width: 360px;
    margin: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                flex 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Dock New Chat / Guest Auth cleanly to the top-right of the left Chat Column when Canvas is open */
  .chat-workspace-wrap.has-canvas-open .chat-canvas-top-actions {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 45;
  }

  .chat-workspace-wrap.has-canvas-open .chat-canvas-view:not(.is-initial) .chat-canvas-scroll {
    padding-top: 56px;
  }

  .doox-canvas-panel {
    flex: 1 1 54%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1f1f1f;
    position: relative;
    overflow: hidden;
    z-index: 40;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.42);
    animation: dooxCanvasSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

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

  .doox-canvas-header {
    height: 50px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface, #262626);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    gap: 12px;
  }

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

  .doox-canvas-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .doox-canvas-icon-box .doox-spin-svg {
    animation: dooxArtifactSpin 1.1s linear infinite;
  }

  .doox-canvas-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
  }

  .doox-canvas-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .doox-canvas-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: #f4f3f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  .doox-canvas-badge {
    font-size: 0.62rem;
    font-weight: 500;
    font-family: var(--font-mono, ui-monospace, monospace);
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: #d1cfc7;
    border: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.03em;
  }

  .doox-canvas-version-nav {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--surface, #262626);
    border: 1px solid var(--surface-hover, #2e2e2e);
    border-radius: 999px;
    padding: 1px 5px;
    margin-left: 2px;
  }

  .doox-canvas-vnav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: none;
    background: transparent;
    color: #85827a;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
  }

  .doox-canvas-vnav-btn:hover:not(:disabled) {
    color: #f4f3f0;
    background: var(--surface-hover, #2e2e2e);
  }

  .doox-canvas-vnav-btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .doox-canvas-version-label {
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono, ui-monospace, monospace);
    color: #d1cfc7;
    letter-spacing: 0.02em;
    min-width: 18px;
    text-align: center;
  }

  .chat-patch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface, #262626);
    border: 1px solid var(--surface-hover, #2e2e2e);
    border-left: 3px solid #d1cfc7;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #d1cfc7;
  }

  .chat-patch-card-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .chat-patch-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--surface-hover, #2e2e2e);
    color: #f4f3f0;
    flex-shrink: 0;
  }

  .chat-patch-card-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .chat-patch-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #f4f3f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-patch-card-sub {
    font-size: 10.5px;
    color: #85827a;
  }

  .chat-patch-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-hover, #2e2e2e);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
  }

  .chat-patch-card-btn:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .doox-canvas-sub {
    font-size: 0.69rem;
    color: #85827a;
    letter-spacing: -0.005em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .doox-canvas-sub.is-streaming {
    color: #d1cfc7;
  }

  .doox-canvas-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  .doox-canvas-tab-pills {
    display: flex;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    margin-right: 4px;
  }

  .doox-canvas-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    font-weight: 500;
    color: #85827a;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .doox-canvas-tab-pill:hover {
    color: #d1cfc7;
  }

  .doox-canvas-tab-pill.is-active {
    background: #2e2e2e;
    color: #f4f3f0;
  }

  .doox-canvas-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #85827a;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .doox-canvas-btn:hover {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
  }

  .doox-canvas-btn:active {
    transform: scale(0.96);
  }

  .doox-canvas-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }

  .doox-canvas-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #1f1f1f;
  }

  .doox-canvas-preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
  }

  .doox-canvas-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: block;
  }

  .doox-canvas-code-container {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    overflow: auto;
    padding: 18px 20px;
    background: #1f1f1f;
    box-sizing: border-box;
  }

  .doox-canvas-code-container pre {
    margin: 0;
    padding: 0;
    font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
    font-size: 0.79rem;
    line-height: 1.65;
    color: #d1cfc7;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Fullscreen Mode */
  .doox-canvas-panel.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    box-shadow: none !important;
  }

  /* Artifact Card inside Chat Bubble — DOOZE Warm Soft-Black Monochrome */
  .chat-artifact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin: 12px 0;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  .chat-artifact-card:hover {
    background: var(--surface-hover, #2e2e2e);
    border-color: rgba(255, 255, 255, 0.13);
  }

  .chat-artifact-card.is-streaming {
    border-color: rgba(255, 255, 255, 0.12);
  }

  .chat-artifact-card-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
  }

  .chat-artifact-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .chat-artifact-card-icon svg {
    display: block;
    flex-shrink: 0;
  }

  .chat-artifact-card-icon .doox-spin-svg {
    animation: dooxArtifactSpin 1.1s linear infinite;
  }

  .chat-artifact-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .chat-artifact-card-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f4f3f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  .chat-artifact-card-sub {
    font-size: 0.71rem;
    color: #85827a;
    font-family: inherit;
  }

  .chat-artifact-card.is-streaming .chat-artifact-card-sub {
    color: #d1cfc7;
  }

  .chat-artifact-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-artifact-card-btn svg {
    display: block;
    flex-shrink: 0;
  }

  .chat-artifact-card-btn:hover {
    background: #f4f3f0;
    border-color: #f4f3f0;
    color: #1f1f1f;
  }

  /* Inline Widget Card (Fase 2) — DOOZE Warm Soft-Black Monochrome */
  .chat-inline-widget-card {
    margin: 14px 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  }

  .chat-inline-widget-header {
    height: 38px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-hover, #2e2e2e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.74rem;
    font-weight: 600;
    color: #d1cfc7;
  }

  .chat-inline-widget-title {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .chat-inline-widget-badge {
    font-size: 0.62rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: #9d9a93;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
  }

  .chat-inline-widget-body {
    width: 100%;
    min-height: 280px;
    max-height: 520px;
    position: relative;
  }

  .chat-inline-widget-body iframe {
    width: 100%;
    height: 100%;
    min-height: 280px;
    border: none;
    display: block;
    background: transparent;
  }

  /* Responsive Mobile Bottom Sheet */
  @media (max-width: 860px) {
    .chat-workspace-wrap.has-canvas-open .chat-canvas-view {
      max-width: 100% !important;
      flex: 1 1 100% !important;
      border-right: none !important;
    }

    .doox-canvas-panel {
      position: fixed !important;
      inset: 0 !important;
      z-index: 1000 !important;
      max-width: 100% !important;
      width: 100% !important;
      height: 100% !important;
      border-radius: 0 !important;
    }
  }


  .chat-canvas-view.is-initial .chat-hero {
    margin: 0 auto;
    transform: translateY(-20px);
    animation: heroInitialReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: opacity, transform, filter;
  }

  @keyframes heroInitialReveal {
    0% {
      opacity: 0;
      transform: translateY(-6px);
      filter: blur(8px);
    }
    100% {
      opacity: 1;
      transform: translateY(-20px);
      filter: blur(0px);
    }
  }

  .chat-hero.is-fading-out {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-24px) !important;
    opacity: 0 !important;
    filter: blur(10px) !important;
    pointer-events: none !important;
    animation: none !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .chat-canvas-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .chat-hero {
    margin: 40px auto 20px;
    text-align: center;
    max-width: 640px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInMsg 0.3s ease;
  }

  .chat-hero-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
  }

  .chat-hero-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: none !important;
    filter: none !important;
    background: transparent !important;
  }

  .chat-hero-logo-svg {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chat-hero-logo-svg svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: none !important;
  }

  .chat-hero-heading {
    font-size: 1.95rem;
    font-weight: 600;
    color: #F9FAFB;
    margin: 0 0 10px 0;
    letter-spacing: -0.025em;
    line-height: 1.28;
    text-wrap: balance;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: nowrap;
    column-gap: 0.28em;
    row-gap: 4px;
    text-align: center;
  }

  .hero-heading-prefix,
  .hero-heading-suffix {
    color: #F9FAFB;
    font-weight: 600;
    letter-spacing: -0.025em;
    display: inline-block;
    vertical-align: baseline;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-word-track {
    display: inline-grid;
    grid-template-areas: "word";
    vertical-align: baseline;
    align-items: baseline;
    justify-content: center;
    overflow: hidden;
    height: 1.35em;
    min-height: 1.35em;
    padding: 0 0.04em;
    margin: 0;
    box-sizing: content-box;
    will-change: width;
    transition: width 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-rotating-word {
    grid-area: word;
    white-space: nowrap;
    font-weight: 600;
    color: #ff9800;
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: transform, opacity, filter;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hero-rotating-word.word-entering {
    transform: translateY(22px);
    opacity: 0;
    filter: blur(6px);
    pointer-events: none;
  }

  .hero-rotating-word.word-active {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }

  .hero-rotating-word.word-exiting {
    transform: translateY(-22px);
    opacity: 0;
    filter: blur(6px);
    pointer-events: none;
  }

  /* Defense-in-depth: Never allow multiple active words or unclassified words to render concurrently */
  .hero-rotating-word:not(.word-active):not(.word-entering):not(.word-exiting) {
    display: none !important;
  }

  .hero-rotating-word.word-active ~ .hero-rotating-word.word-active {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-word-track,
    .hero-rotating-word,
    .hero-heading-prefix,
    .hero-heading-suffix {
      transition: none !important;
      animation: none !important;
      transform: none !important;
      filter: none !important;
    }
  }

  .chat-hero-subheading {
    font-size: 0.95rem;
    color: #9CA3AF;
    margin: 0;
    max-width: 580px;
    line-height: 1.55;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  @media (max-width: 580px) {
    .chat-quick-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 6px;
    }
  }

  .chat-quick-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
  }

  .chat-quick-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
  }

  .chat-quick-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: #f4f3f0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .chat-quick-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
  }



  /* ── Chat Message Feed — ChatGPT Style ──────────────────────── */
  .chat-msg-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 12px 0;
  }

  .chat-msg-row.user {
    align-items: flex-end;
    animation: msgSlideRight 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .chat-msg-row.assistant {
    align-items: flex-start;
    animation: msgSlideLeft 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

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

  /* ── User Bubble — Clean, Borderless & Soft Warm Amber Tone ─── */
  .chat-msg-user {
    display: inline-block;
    max-width: 75%;
    width: auto;
    background: #87401d;
    border: none !important;
    border-radius: 20px;
    padding: 10px 18px;
    color: #fdf5f1;
    font-size: 0.95rem;
    line-height: 1.55;
    letter-spacing: -0.011em;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: none !important;
    text-align: left;
  }

  .chat-user-ref {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.85);
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  /* ── User Message Action Buttons (Copy & Edit on Hover) ───────── */
  .chat-user-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding-right: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-msg-row.user:hover .chat-user-actions {
    opacity: 1;
    pointer-events: auto;
  }

  @media (hover: none) {
    .chat-user-actions {
      opacity: 0.85;
      pointer-events: auto;
    }
  }

  .chat-user-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .chat-user-action-btn:hover {
    background: #262626;
    color: #f4f3f0;
  }

  .chat-user-action-btn:active {
    transform: scale(0.94);
  }

  .chat-user-action-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #1c1c1e;
    color: #f4f3f0;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 30;
  }

  .chat-user-action-btn:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateY(0);
  }

  /* ── Assistant Row ───────────────────────────────────────────── */
  .chat-msg-assistant {
    width: 100%;
    max-width: 100%;
  }

  .chat-assistant-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
  }

  .chat-assistant-avatar {
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .chat-assistant-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .chat-assistant-avatar img,
  .chat-assistant-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .chat-assistant-avatar-fallback {
    font-size: 14px;
    font-weight: 700;
    color: #ff7a00;
    line-height: 1;
  }

  .chat-meta-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.88rem;
    letter-spacing: -0.01em;
    line-height: 1;
  }

  .chat-meta-model {
    display: none !important;
  }

  .chat-meta-ratio {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.72rem;
    font-family: var(--font-mono);
  }

  .chat-meta-time {
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.73rem;
    font-variant-numeric: tabular-nums;
  }

  .chat-assistant-reply-text {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: #ececec;
    line-height: 1.75;
    margin-bottom: 8px;
    letter-spacing: -0.011em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .chat-assistant-reply-text:empty {
    display: none !important;
    margin-bottom: 0 !important;
  }

  .chat-assistant-reply-text .chat-p {
    margin: 0 0 16px 0;
    line-height: 1.75;
    color: #ececec;
    font-size: 1rem;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .chat-assistant-reply-text .chat-p:last-child {
    margin-bottom: 0;
  }

  .chat-assistant-reply-text .chat-ul,
  .chat-assistant-reply-text .chat-ol {
    margin: 8px 0 16px 0;
    padding-left: 24px;
  }

  .chat-assistant-reply-text li {
    margin-bottom: 8px;
    line-height: 1.75;
    color: #ececec;
    font-size: 1rem;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .chat-assistant-reply-text li::marker {
    color: #9ca3af;
  }

  .chat-assistant-reply-text strong {
    color: #ffffff;
    font-weight: 600;
  }

  .chat-assistant-reply-text em {
    color: #d1d5db;
    font-style: italic;
  }

  .chat-assistant-reply-text del {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: line-through;
  }

  .chat-assistant-reply-text .chat-link {
    color: #f4f3f0;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: all 0.15s ease;
  }
  .chat-assistant-reply-text .chat-link:hover {
    color: #ffffff;
  }

  .chat-assistant-reply-text .chat-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 24px 0;
  }

  .chat-assistant-reply-text .chat-inline-code {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 5px;
    padding: 2px 6px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.88em;
    color: #ffffff;
    display: inline;
    white-space: break-spaces;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .chat-text-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
  }

  .chat-text-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .chat-text-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
  }

  /* ── Streaming Cursor (ChatGPT / Claude / Dooze Signature) ────── */
  .chat-streaming-cursor {
    display: inline-block;
    width: 2.5px;
    height: 1.15em;
    vertical-align: -2px;
    margin-left: 3px;
    background: #f4f3f0;
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
    animation: streamingCursorBlink 0.9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  }

  @keyframes streamingCursorBlink {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50%      { opacity: 0.12; transform: scaleY(0.9); }
  }



  /* ── Modern Code Artifact Container (DOOX Clean & Soft-Black) ─────── */
  .chat-assistant-reply-text .chat-code-block {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin: 18px 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .chat-assistant-reply-text .chat-code-block:hover {
    border-color: rgba(255, 255, 255, 0.08);
  }

  .chat-assistant-reply-text .chat-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 4px 16px;
    height: auto;
    min-height: 38px;
    background: var(--surface, #262626);
    border-bottom: none;
    font-size: 0.74rem;
    color: #9d9a93;
    user-select: none;
  }

  .chat-code-header-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .chat-code-lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d1cfc7;
    font-weight: 500;
    font-size: 0.74rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    letter-spacing: 0.01em;
  }

  .chat-code-lang i {
    color: #85827a;
  }

  .chat-code-lines-badge {
    font-size: 0.68rem;
    color: #68655e;
    font-family: inherit;
  }

  .chat-code-tabs {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    padding: 2px;
    margin-left: 6px;
    gap: 2px;
  }

  .chat-code-tab-btn {
    background: transparent;
    border: none;
    color: #85827a;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .chat-code-tab-btn:hover {
    color: #d1cfc7;
  }

  .chat-code-tab-btn.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    font-weight: 500;
  }

  .chat-code-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .chat-assistant-reply-text .chat-code-btn {
    border: none;
    background: transparent;
    color: #85827a;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .chat-assistant-reply-text .chat-code-btn:hover {
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.04);
  }

  .chat-assistant-reply-text .chat-code-btn.is-copied {
    color: #4ade80 !important;
  }

  .chat-assistant-reply-text .chat-code-block pre {
    margin: 0;
    padding: 10px 16px 16px 16px;
    background: var(--surface, #262626);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px; /* Constrain vertical height for clean chat */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), scrollbar-color 0.2s ease;
  }

  .chat-assistant-reply-text .chat-code-block pre:hover {
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
  }

  .chat-assistant-reply-text .chat-code-block.is-expanded pre {
    max-height: none;
  }

  .chat-assistant-reply-text .chat-code-block pre.is-wrapped {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .chat-assistant-reply-text .chat-code-block pre::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  .chat-assistant-reply-text .chat-code-block pre::-webkit-scrollbar-track {
    background: transparent;
  }
  .chat-assistant-reply-text .chat-code-block pre::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 9999px;
    transition: background 0.2s ease;
  }
  .chat-assistant-reply-text .chat-code-block pre:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
  }

  .chat-assistant-reply-text .chat-code-block code {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.84rem;
    line-height: 1.68;
    color: #e2e0d8;
    display: block;
    letter-spacing: -0.01em;
  }

  /* Live Preview Iframe Container */
  .chat-code-preview-wrap {
    display: none;
    background: #ffffff;
    width: 100%;
    min-height: 380px;
    height: 440px;
    overflow: hidden;
  }

  .chat-code-block.is-previewing .chat-code-preview-wrap {
    display: block;
  }

  .chat-code-block.is-previewing pre,
  .chat-code-block.is-previewing .chat-code-expand-bar {
    display: none;
  }

  .chat-code-preview-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }

  /* Expand Bar: Seamless Gradient Fade (Zero harsh divider lines!) */
  .chat-code-expand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 14px 12px 14px;
    margin-top: -36px;
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, var(--surface, #262626) 65%, rgba(38, 38, 38, 0.85) 85%, transparent 100%);
    border: none;
    pointer-events: none;
  }

  .chat-code-block.is-expanded .chat-code-expand-bar {
    margin-top: 0;
    padding: 8px 14px 12px 14px;
    background: var(--surface, #262626);
  }

  .chat-code-expand-btn {
    pointer-events: auto;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: #9d9a93;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    transition: all 0.16s ease;
  }

  .chat-code-expand-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
  }

  .chat-assistant-reply-text .chat-blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.22);
    margin: 16px 0;
    padding: 4px 0 4px 16px;
    color: #d1d5db;
    font-style: normal;
    background: transparent;
    border-radius: 0;
  }

  .chat-assistant-reply-text .chat-h2,
  .chat-assistant-reply-text .chat-h3,
  .chat-assistant-reply-text .chat-h4,
  .chat-assistant-reply-text .chat-h5 {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
  }
  .chat-assistant-reply-text .chat-h2 {
    font-size: 1.35rem;
    margin: 28px 0 14px 0;
  }
  .chat-assistant-reply-text .chat-h3 {
    font-size: 1.18rem;
    margin: 24px 0 12px 0;
  }
  .chat-assistant-reply-text .chat-h4 {
    font-size: 1.05rem;
    margin: 20px 0 10px 0;
  }
  .chat-assistant-reply-text .chat-h5 {
    font-size: 0.95rem;
    margin: 16px 0 8px 0;
  }

  /* ── GFM Markdown Table (ChatGPT / Minimalist Borderless Standard) ──────────── */
  .chat-assistant-reply-text .chat-table-wrap {
    width: 100%;
    margin: 16px 0 20px 0;
    overflow-x: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  }
  .chat-assistant-reply-text .chat-table-wrap::-webkit-scrollbar {
    height: 4px;
  }
  .chat-assistant-reply-text .chat-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
  }
  .chat-assistant-reply-text .chat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
    min-width: 460px;
    border: none;
  }
  .chat-assistant-reply-text .chat-table th {
    background: transparent;
    color: #9ca3af;
    font-size: 0.80rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px 12px 16px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
  }
  .chat-assistant-reply-text .chat-table th:first-child,
  .chat-assistant-reply-text .chat-table td:first-child {
    padding-left: 2px;
  }
  .chat-assistant-reply-text .chat-table th:last-child,
  .chat-assistant-reply-text .chat-table td:last-child {
    padding-right: 2px;
  }
  .chat-assistant-reply-text .chat-table td {
    padding: 12px 16px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ececec;
    font-size: 0.88rem;
    line-height: 1.55;
    vertical-align: middle;
  }
  .chat-assistant-reply-text .chat-table tr:last-child td {
    border-bottom: none;
  }
  .chat-assistant-reply-text .chat-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
  }

  /* Compact citation pills in table cells (ChatGPT standard) */
  .chat-assistant-reply-text .chat-table td .chat-citation-cluster {
    gap: 3px;
    margin: 0 2px;
    vertical-align: middle;
  }
  .chat-assistant-reply-text .chat-table td .chat-citation-pill {
    height: 19px;
    padding: 0 6px;
    font-size: 0.65rem;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
  }
  .chat-assistant-reply-text .chat-table td .chat-citation-favicon {
    width: 11px;
    height: 11px;
  }
  .chat-assistant-reply-text .chat-table td .chat-citation-label {
    max-width: 80px;
  }



  /* ── Artwork Slot & Container (Forces Action Icons Underneath Card) ─── */
  [id^="chat-artwork-slot-"],
  .chat-assistant-artwork-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 6px;
  }

  /* ── Artwork Card (Pure Luxury Big-Brand Standard) ─── */
  .chat-artwork-wrap {
    position: relative;
    display: block !important;
    width: fit-content;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    cursor: zoom-in;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, aspect-ratio 0.3s ease;
    animation: artworkReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    margin: 0 !important;
  }

  .chat-artwork-wrap.is-generating {
    cursor: default;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), inset 0 0 35px rgba(255, 255, 255, 0.03);
  }

  /* Big-Brand Notice State: Graceful 16:10 ratio, eliminates empty black void */
  .chat-artwork-wrap.has-notice {
    aspect-ratio: 16 / 10 !important;
    min-height: 210px !important;
    max-height: 270px !important;
    cursor: default !important;
    background: #121214 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
  }

  @keyframes artworkReveal {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
  }

  .chat-artwork-wrap:not(.is-generating):hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  /* ── Generative Aurora Card (Ethereal Soft White & Luminous Silver Pearl Glow) ─── */
  .chat-artwork-shimmer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #121214;
    border-radius: inherit;
    z-index: 2;
    overflow: hidden;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter;
  }

  .chat-artwork-shimmer.fade-out {
    opacity: 0 !important;
    filter: blur(12px) !important;
    pointer-events: none !important;
  }

  /* Suppress luminous wave in error/retry notice state */
  .chat-artwork-shimmer:not(:empty)::before,
  .chat-artwork-shimmer:not(:empty)::after {
    display: none !important;
  }

  /* Primary Aurora Wave: Pure Soft White & Silver Pearl Luminous Mist */
  .chat-artwork-shimmer::before {
    content: "";
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: 
      radial-gradient(ellipse 50% 45% at 60% 40%, rgba(255, 255, 255, 0.22) 0%, rgba(240, 242, 248, 0.10) 40%, transparent 72%),
      radial-gradient(ellipse 46% 42% at 35% 55%, rgba(255, 255, 255, 0.16) 0%, rgba(220, 225, 235, 0.06) 45%, transparent 75%),
      radial-gradient(ellipse 42% 38% at 50% 35%, rgba(255, 255, 255, 0.25) 0%, rgba(200, 205, 220, 0.08) 50%, transparent 75%),
      radial-gradient(ellipse 48% 40% at 45% 70%, rgba(255, 255, 255, 0.14) 0%, transparent 68%),
      radial-gradient(circle 380px at 50% 50%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 55%, transparent 80%);
    filter: blur(48px);
    transform-origin: center center;
    animation: cardFluidAurora 10s ease-in-out infinite alternate;
    pointer-events: none;
    will-change: transform;
  }

  /* Secondary Subtle Luminous White Ripple Wave */
  .chat-artwork-shimmer::after {
    content: "";
    position: absolute;
    inset: -30%;
    width: 160%;
    height: 160%;
    background: 
      radial-gradient(ellipse 55% 45% at 55% 45%, rgba(255, 255, 255, 0.18) 0%, rgba(245, 245, 250, 0.08) 42%, transparent 72%),
      radial-gradient(ellipse 45% 45% at 30% 60%, rgba(255, 255, 255, 0.12) 0%, transparent 68%);
    filter: blur(52px);
    transform-origin: center center;
    animation: cardFluidRipple 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
    pointer-events: none;
    will-change: transform;
  }

  @keyframes cardFluidAurora {
    0% {
      transform: translate3d(-4%, -3%, 0) rotate(0deg) scale(1);
    }
    33% {
      transform: translate3d(3%, -5%, 0) rotate(4deg) scale(1.06);
    }
    66% {
      transform: translate3d(-3%, 4%, 0) rotate(-3deg) scale(0.96);
    }
    100% {
      transform: translate3d(5%, 3%, 0) rotate(2deg) scale(1.04);
    }
  }

  @keyframes cardFluidRipple {
    0% {
      transform: translate3d(3%, 4%, 0) rotate(0deg) scale(0.98);
      opacity: 0.75;
    }
    50% {
      transform: translate3d(-4%, -2%, 0) rotate(-4deg) scale(1.05);
      opacity: 1;
    }
    100% {
      transform: translate3d(2%, -4%, 0) rotate(3deg) scale(1.02);
      opacity: 0.85;
    }
  }

  .shimmer-status-pill,
  .shimmer-dot {
    display: none !important;
  }

  /* Clean High-Fidelity Artwork Image with Smooth Dissolve / Blur-Up Reveal */
  .chat-artwork-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    opacity: 0;
    transform: scale(1.02);
    filter: blur(14px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
  }

  .chat-artwork-img.revealed {
    opacity: 1 !important;
    transform: scale(1) !important;
    filter: blur(0px) !important;
  }

  .chat-artwork-wrap.ratio-4-5  { width: 440px; max-width: 100%; aspect-ratio: 4/5; min-height: 260px; }
  .chat-artwork-wrap.ratio-1-1  { width: 460px; max-width: 100%; aspect-ratio: 1/1; min-height: 260px; }
  .chat-artwork-wrap.ratio-16-9 { width: 660px; max-width: 100%; aspect-ratio: 16/9; min-height: 220px; }
  .chat-artwork-wrap.ratio-9-16 { width: 320px; max-width: 100%; aspect-ratio: 9/16; min-height: 280px; }
  .chat-artwork-wrap.ratio-3-4  { width: 420px; max-width: 100%; aspect-ratio: 3/4; min-height: 260px; }
  .chat-artwork-wrap.ratio-4-3  { width: 560px; max-width: 100%; aspect-ratio: 4/3; min-height: 240px; }
  .chat-artwork-wrap:not([class*="ratio-"]) { width: 460px; max-width: 100%; aspect-ratio: 1/1; min-height: 260px; }
  .chat-artwork-wrap:not([class*="ratio-"]) .chat-artwork-img { height: auto; max-height: 520px; object-fit: contain; }

  /* ── Super Clean Artwork Notice & Fallback State (Luxury Soft-Black Standard) ─── */
  .chat-artwork-notice {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.04) 0%, transparent 70%), #121214;
    border-radius: inherit;
    z-index: 3;
    box-sizing: border-box;
    animation: noticeFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

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

  .chat-notice-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    margin-bottom: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, color 0.25s ease;
  }

  .chat-artwork-notice:hover .chat-notice-icon-box {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f4f4f5;
  }

  .chat-notice-title {
    font-size: 0.90rem;
    font-weight: 600;
    color: #f4f4f5;
    margin: 0 0 5px 0;
    letter-spacing: -0.015em;
  }

  .chat-notice-desc {
    font-size: 0.78rem;
    color: #8e8e93;
    line-height: 1.46;
    max-width: 280px;
    margin: 0 0 16px 0;
    font-weight: 400;
  }

  .chat-notice-retry-btn,
  .chat-retry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 32px;
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: #f4f4f5;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-notice-retry-btn:hover,
  .chat-retry-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #0c0c0e;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
  }

  .chat-notice-retry-btn:active,
  .chat-retry-btn:active {
    transform: translateY(0) scale(0.98);
  }

  /* Artwork hover overlay */
  .chat-artwork-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: inherit;
    pointer-events: none;
  }

  .chat-artwork-wrap:not(.is-generating):hover .chat-artwork-hover-overlay {
    opacity: 1;
  }
  .chat-artwork-wrap.is-generating .chat-artwork-hover-overlay {
    display: none !important;
  }

  /* ── Minimal Floating Island Actions (Midjourney / Apple Style - Clean Hover Only) ───────── */
  .chat-artwork-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 3px 6px;
    width: fit-content;
    background: rgba(16, 16, 20, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    position: relative;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }

  /* Invisible hover bridge to prevent un-hover gap flickers */
  .chat-artwork-actions::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    pointer-events: auto;
  }

  .chat-artwork-wrap:hover + .chat-artwork-actions,
  .chat-artwork-actions:hover,
  .chat-msg-assistant:hover .chat-artwork-actions,
  .chat-assistant-artwork-container:hover .chat-artwork-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .chat-artwork-wrap.has-notice + .chat-artwork-actions,
  .chat-artwork-wrap.is-generating + .chat-artwork-actions,
  .chat-msg-assistant:has(.chat-artwork-wrap.has-notice) .chat-artwork-actions,
  .chat-msg-assistant:has(.chat-artwork-wrap.is-generating) .chat-artwork-actions {
    display: none !important;
  }

  @media (hover: none), (max-width: 768px) {
    .chat-artwork-actions {
      opacity: 1 !important;
      transform: none !important;
      pointer-events: auto !important;
    }
  }

  .chat-icon-action {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    outline: none;
  }

  .chat-icon-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
  }

  .chat-icon-action:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
  }

  .chat-icon-action i,
  .chat-icon-action svg {
    width: 14px;
    height: 14px;
  }

  /* Legacy action btn fallback */
  .chat-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
  }

  /* ── Premium Loading (3 bouncing dots) ──────────────────────── */
  .chat-pulse-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 4px;
  }

  .chat-pulse-dots {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .chat-pulse-dots span {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: dotBounce 1.4s ease-in-out infinite both;
  }

  .chat-pulse-dots span:nth-child(1) { animation-delay: 0s; }
  .chat-pulse-dots span:nth-child(2) { animation-delay: 0.18s; }
  .chat-pulse-dots span:nth-child(3) { animation-delay: 0.36s; }

  @keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; background: rgba(255,255,255,0.3); }
    40%           { transform: scale(1);   opacity: 1;   background: #ffffff; }
  }

  .chat-pulse-text {
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.01em;
    animation: textPulse 2s ease-in-out infinite;
  }

  @keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 0.9; }
  }

  .chat-action-btn.active-accent:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--brand-orange);
    color: #ffffff;
    transform: translateY(-1px);
  }

  .chat-composer-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    margin-top: auto;
    padding: 16px 16px max(14px, env(safe-area-inset-bottom, 12px));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    pointer-events: none;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, filter;
  }

  .chat-composer-wrap.is-gliding {
    animation: none !important;
    transition: transform 0.46s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.36s cubic-bezier(0.16, 1, 0.3, 1) !important;
    filter: blur(3px);
  }

  .chat-composer-box {
    background: var(--surface, #262626) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 28px;
    padding: 16px 20px 14px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important;
    width: 100%;
    max-width: 780px;
    box-sizing: border-box;
    pointer-events: auto;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .chat-composer-box:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
  }

  .chat-composer-box:focus-within {
    background: var(--surface, #262626) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
  }

  .chat-composer-textarea {
    background: transparent;
    border: none !important;
    outline: none !important;
    color: #f1f2f4;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    resize: none;
    min-height: 42px;
    max-height: 160px;
    line-height: 1.6;
    padding: 2px 0 0 0;
    width: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    transition: color 0.18s ease;
  }

  .chat-composer-textarea::placeholder {
    color: rgba(255, 255, 255, 0.36);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  }

  .chat-composer-box:focus-within .chat-composer-textarea::placeholder {
    color: rgba(255, 255, 255, 0.46);
  }

  .chat-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
  }

  .chat-composer-tools {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .chat-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none !important;
    transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
    flex-shrink: 0;
  }

  .chat-tool-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    transform: none !important;
  }

  .chat-tool-btn:active {
    transform: scale(0.96) !important;
    background: rgba(255, 255, 255, 0.10);
  }

  .chat-tool-divider {
    display: none !important;
  }

  .chat-tool-select-wrap {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
  }

  .chat-tool-select-wrap:hover .chat-tool-select {
    color: #ffffff;
  }

  .chat-tool-select {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 2px;
    letter-spacing: 0.01em;
  }

  .chat-tool-select:hover {
    color: #ffffff;
  }

  .chat-tool-select option {
    background: #262626;
    color: #ffffff;
  }

  .chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none !important;
    outline: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.15s ease;
    flex-shrink: 0;
  }

  .chat-send-btn svg,
  .chat-send-btn i {
    width: 16px;
    height: 16px;
    stroke-width: 2.2px;
    display: block;
  }

  .chat-send-btn.disabled,
  .chat-send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    border: none !important;
    color: rgba(255, 255, 255, 0.28);
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.85;
  }

  .chat-send-btn.active,
  .chat-send-btn:not(:disabled):not(.disabled) {
    background: #ffffff;
    color: #0c0d0e;
    border: none !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.20),
                0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 1;
    cursor: pointer;
  }

  .chat-send-btn.active:hover,
  .chat-send-btn:not(:disabled):not(.disabled):hover {
    background: #f7f7f8;
    color: #000000;
    transform: scale(1.04);
  }

  .chat-send-btn.active:hover svg,
  .chat-send-btn:not(:disabled):not(.disabled):hover svg {
    transform: none !important;
  }

  .chat-send-btn.active:active,
  .chat-send-btn:not(:disabled):not(.disabled):active {
    transform: scale(0.97);
  }

  .chat-disclaimer {
    display: none !important;
  }

  /* =========================================================================
     DOOZEM CHAT VIDEO CARD & PLAYER COMPONENT
     ========================================================================= */

  .chat-video-card-wrap {
    position: relative;
    display: block !important;
    width: 520px;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    margin: 10px 0 6px 0 !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
    animation: artworkReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .chat-video-card-wrap.ratio-16-9 {
    width: 520px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 240px;
  }

  .chat-video-card-wrap.ratio-9-16 {
    width: 280px;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    min-height: 380px;
  }

  .chat-video-card-wrap.is-generating {
    cursor: default;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), inset 0 0 35px rgba(255, 255, 255, 0.03);
  }

  /* Shimmer Aurora Canvas for Video Card (Identical to Doozem Image Aurora Canvas) */
  .chat-video-shimmer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #121214;
    border-radius: inherit;
    z-index: 1;
    overflow: hidden;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter;
  }

  .chat-video-shimmer.fade-out {
    opacity: 0 !important;
    filter: blur(12px) !important;
    pointer-events: none !important;
  }

  .chat-video-shimmer::before {
    content: "";
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: 
      radial-gradient(ellipse 50% 45% at 60% 40%, rgba(255, 255, 255, 0.22) 0%, rgba(240, 242, 248, 0.10) 40%, transparent 72%),
      radial-gradient(ellipse 46% 42% at 35% 55%, rgba(255, 255, 255, 0.16) 0%, rgba(220, 225, 235, 0.06) 45%, transparent 75%),
      radial-gradient(ellipse 42% 38% at 50% 35%, rgba(255, 255, 255, 0.25) 0%, rgba(200, 205, 220, 0.08) 50%, transparent 75%),
      radial-gradient(ellipse 48% 40% at 45% 70%, rgba(255, 255, 255, 0.14) 0%, transparent 68%),
      radial-gradient(circle 380px at 50% 50%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 55%, transparent 80%);
    filter: blur(48px);
    transform-origin: center center;
    animation: cardFluidAurora 10s ease-in-out infinite alternate;
    pointer-events: none;
    will-change: transform;
  }

  .chat-video-shimmer::after {
    content: "";
    position: absolute;
    inset: -30%;
    width: 160%;
    height: 160%;
    background: 
      radial-gradient(ellipse 55% 45% at 55% 45%, rgba(255, 255, 255, 0.18) 0%, rgba(245, 245, 250, 0.08) 42%, transparent 72%),
      radial-gradient(ellipse 45% 45% at 30% 60%, rgba(255, 255, 255, 0.12) 0%, transparent 68%);
    filter: blur(52px);
    transform-origin: center center;
    animation: cardFluidRipple 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
    pointer-events: none;
    will-change: transform;
  }

  /* Overlay inside Video Card */
  .chat-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2;
    background: transparent;
    pointer-events: none;
  }

  /* Center Progress Info */
  .chat-video-center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    text-align: center;
  }

  .chat-video-pct-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
  }

  .chat-video-pct {
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.18);
  }

  /* Hairline Progress Bar */
  .chat-video-progress-bar {
    width: 100%;
    max-width: 130px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin: 2px auto;
  }

  .chat-video-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.75), #ffffff);
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }

  .chat-video-stage-text {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.01em;
    text-align: center;
    max-width: 95%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }

  /* Completed HTML5 Video Player */
  .chat-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    border-radius: 14px;
  }

  /* Action Buttons below video card (Clean Floating Island Capsule) */
  .chat-video-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 3px 6px;
    width: fit-content;
    background: rgba(16, 16, 20, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-video-actions:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(22, 22, 28, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  }

  .chat-video-actions .chat-icon-action {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    outline: none;
  }

  .chat-video-actions .chat-icon-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
  }

  .chat-video-actions .chat-icon-action:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
  }

  .chat-video-actions .chat-icon-action i,
  .chat-video-actions .chat-icon-action svg {
    width: 14px;
    height: 14px;
  }

  /* Error state */
  .chat-video-card-wrap.has-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
    min-height: 180px;
  }

  .chat-video-error-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
  }

  .chat-video-error-text {
    font-size: 0.82rem;
    color: #fca5a5;
    margin-bottom: 12px;
    line-height: 1.4;
  }

  .chat-video-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fecaca;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .chat-video-retry-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
  }



  .chat-canvas-view.is-initial .chat-composer-wrap {
    transform: translate3d(0, var(--initial-delta, -118px), 0);
    animation: composerInitialReveal 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
    will-change: opacity, transform, filter;
  }

  .chat-canvas-view:not(.is-initial) .chat-composer-wrap {
    transform: none !important;
    background: transparent !important;
  }

  @keyframes composerInitialReveal {
    0% {
      opacity: 0;
      transform: translate3d(0, calc(var(--initial-delta, -118px) + 10px), 0);
      filter: blur(6px);
    }
    100% {
      opacity: 1;
      transform: translate3d(0, var(--initial-delta, -118px), 0);
      filter: blur(0px);
    }
  }

  /* ── Morphing Send / Stop Button ─────────────────────────────── */
  #btn-generate-image.is-streaming {
    background: #FFFFFF !important;
    border: none !important;
    color: #0E0F11 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    transform: none !important;
  }
  #btn-generate-image.is-streaming:hover {
    background: #E8E8EC !important;
    color: #000000 !important;
    transform: none !important;
  }
  #btn-generate-image.is-streaming:active {
    transform: scale(0.95) !important;
  }
  #btn-generate-image .stop-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #0E0F11;
    border-radius: 2px;
  }

  /* ── Custom Dropdown (CDD) ─────────────────────────────────── */
  .cdd {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  .cdd-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
  }

  .cdd-trigger:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
  }

  .cdd-chevron {
    width: 12px !important;
    height: 12px !important;
    opacity: 0.5;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
    flex-shrink: 0;
  }

  .cdd.cdd-open .cdd-chevron {
    transform: rotate(180deg);
    opacity: 0.85;
  }

  .cdd.cdd-open .cdd-trigger {
    color: #ffffff;
  }

  .cdd-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: #262626 !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1000;
    opacity: 0;
    transform: translateY(6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom left;
  }

  .cdd.cdd-open .cdd-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .cdd-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 8px 10px 4px;
  }

  .cdd-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
  }

  .cdd-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .cdd-item.cdd-selected {
    color: var(--brand-orange);
    font-weight: 500;
  }

  .cdd-item.cdd-selected:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .composer-ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 3px 9px 3px 5px;
    font-size: 0.72rem;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    color: #ffffff;
    width: fit-content;
    max-width: 100%;
  }

  #composer-ref-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  #composer-ref-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
  }

  .btn-clear-composer-ref {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 1px;
  }

  .btn-clear-composer-ref:hover {
    color: #ffffff;
  }

  /* Compact Ratio Pill - Ghost by default, rounded capsule appears on hover */
  .cdd.cdd-compact .cdd-pill-trigger {
    padding: 0 10px;
    height: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    gap: 4.5px;
    border-radius: 9999px;
    background: transparent !important;
    border: 1px solid transparent !important;
    outline: none !important;
    color: #9fa0a6;
    box-shadow: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    white-space: nowrap;
    user-select: none;
  }
  .cdd.cdd-compact .cdd-pill-trigger:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff;
    transform: none !important;
  }
  .cdd.cdd-compact .cdd-pill-trigger:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12) !important;
  }
  .cdd.cdd-compact.cdd-open .cdd-pill-trigger {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff;
    transform: none;
  }
  .cdd.cdd-compact .cdd-chevron {
    width: 10.5px;
    height: 10.5px;
    stroke-width: 2.3px;
    opacity: 0.75;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  }
  .cdd.cdd-compact .cdd-pill-trigger:hover .cdd-chevron {
    opacity: 0.95;
  }
  .cdd.cdd-compact.cdd-open .cdd-chevron {
    transform: rotate(180deg);
    opacity: 1;
  }
  .cdd.cdd-compact .cdd-panel-compact {
    position: absolute !important;
    bottom: calc(100% + 10px) !important;
    top: auto !important;
    left: 0 !important;
    margin: 0 !important;
    min-width: 154px;
    border-radius: 14px;
    padding: 6px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    outline: none !important;
    background: #262626 !important;
    box-shadow: 0 20px 48px -6px rgba(0, 0, 0, 0.95),
                0 6px 18px -2px rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 120;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .cdd.cdd-compact.cdd-open .cdd-panel-compact {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  .cdd.cdd-compact .cdd-item {
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 0.80rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: none !important;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .cdd.cdd-compact .cdd-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
  }
  .cdd.cdd-compact .cdd-item.cdd-selected {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    font-weight: 600;
  }

  /* Thinking Effort 5-Step Control - Clean Borderless Soft Style */
  .thinking-effort-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  /* Thinking Pill - Ghost by default, rounded capsule appears on hover */
  .chat-thinking-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4.5px;
    height: 30px;
    padding: 0 10px;
    border-radius: 9999px;
    background: transparent !important;
    border: 1px solid transparent !important;
    outline: none !important;
    color: #9fa0a6;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
  }
  .chat-thinking-pill:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff;
    transform: none !important;
  }
  .chat-thinking-pill:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12) !important;
  }
  .chat-thinking-pill.active {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff;
    transform: none;
  }
  .thinking-chevron {
    width: 10.5px;
    height: 10.5px;
    stroke-width: 2.3px;
    opacity: 0.75;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  }
  .chat-thinking-pill:hover .thinking-chevron {
    opacity: 0.95;
  }
  .chat-thinking-pill.active .thinking-chevron {
    transform: rotate(180deg);
    opacity: 1;
  }

  /* Popover Floating Card (DOOZE Warm Obsidian HD Style) */
  .thinking-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 242px;
    background: #262626 !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    outline: none !important;
    border-radius: 18px;
    padding: 14px 16px 15px 16px;
    box-shadow: 0 24px 52px -6px rgba(0, 0, 0, 0.95),
                0 8px 24px -3px rgba(0, 0, 0, 0.70) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 100;
    user-select: none;
    animation: thinkingFadeUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes thinkingFadeUp {
    from { opacity: 0; transform: translateY(8px) scale(0.96); filter: blur(3px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
  }

  .thinking-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .thinking-title-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 0.90rem;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
  }
  .thinking-level-num {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .thinking-level-title {
    color: #ff8c42;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .thinking-title-arrow {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
    margin-left: 1px;
    font-weight: 400;
  }
  .btn-thinking-reset {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.40);
    padding: 3px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }
  .btn-thinking-reset:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  /* Track & Slider (5 Steps - Precision Alignment) */
  .thinking-slider-wrap {
    margin: 0;
  }
  .thinking-track-container {
    position: relative;
    width: 100%;
    height: 20px;
    border-radius: 9999px;
    cursor: pointer;
    overflow: visible;
  }
  .thinking-track-bg {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  .thinking-track-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 9999px;
    background: #ff8c42;
    transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .thinking-step-dots {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 2;
  }
  .thinking-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .thinking-dot::after {
    content: '';
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.30);
    transition: all 0.15s ease;
  }
  .thinking-dot.in-fill::after {
    background: rgba(255, 255, 255, 0.75);
  }
  .thinking-dot:hover::after,
  .thinking-dot.active::after {
    background: #ffffff;
    transform: scale(1.3);
  }
  .thinking-thumb-knob {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.60), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: left 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    pointer-events: none;
  }

  .thinking-popover-desc {
    display: none !important;
  }



  /* ── Ultra-Clean Thinking Accordion (ChatGPT o1/o3 & Claude 3.7 Luxury Minimalist) ─────── */
  .chat-thinking-block {
    width: 100%;
    margin: 4px 0 8px 0;
    font-family: inherit;
    font-size: 0.82rem;
  }

  .chat-thinking-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    outline: none;
    cursor: default;
    padding: 2px 0;
    color: rgba(255, 255, 255, 0.44);
    font-size: 0.81rem;
    font-family: inherit;
    font-weight: 450;
    transition: color 0.15s ease;
    user-select: none;
  }

  .chat-thinking-block.has-thoughts .chat-thinking-toggle {
    cursor: pointer;
  }

  .chat-thinking-block.has-thoughts .chat-thinking-toggle:hover {
    color: rgba(255, 255, 255, 0.78);
  }

  .chat-thinking-pulse-icon {
    font-size: 0.75rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.48);
    display: inline-block;
  }

  /* Quiet Monochrome Breathing (No neon, no color change, zero drop-shadow) */
  .chat-thinking-block.is-thinking .chat-thinking-pulse-icon,
  .chat-thinking-block.is-thinking .chat-thinking-status-text {
    animation: quietBreathing 2s ease-in-out infinite;
  }

  @keyframes quietBreathing {
    0%, 100% { opacity: 0.40; }
    50%      { opacity: 0.82; }
  }

  .chat-thinking-status-text {
    letter-spacing: -0.01em;
    color: inherit;
  }

  .chat-thinking-chevron {
    width: 12px;
    height: 12px;
    stroke-width: 2px;
    color: currentColor;
    opacity: 0.5;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform: rotate(0deg);
  }

  .chat-thinking-block.is-collapsed .chat-thinking-chevron {
    transform: rotate(-90deg);
  }

  /* Hide chevron during thinking or if no thoughts to expand */
  .chat-thinking-block.is-thinking .chat-thinking-chevron,
  .chat-thinking-block:not(.has-thoughts) .chat-thinking-chevron {
    display: none !important;
  }

  /* Collapsible Body: Clean text with buttery CSS Grid transition */
  .chat-thinking-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.20s ease, margin 0.20s ease;
    opacity: 1;
    margin-top: 6px;
    padding-left: 10px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.12);
    background: transparent !important;
  }

  .chat-thinking-body-inner {
    overflow: hidden;
    min-height: 0;
  }

  /* When collapsed OR empty, smoothly animate grid rows to 0fr and fade out */
  .chat-thinking-block.is-collapsed .chat-thinking-body,
  .chat-thinking-body.is-empty,
  .chat-thinking-body:empty {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-left-color: transparent;
    pointer-events: none;
  }

  .chat-thinking-text {
    font-size: 0.80rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.45);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
  }

  .chat-thinking-text::-webkit-scrollbar {
    width: 3px;
  }
  .chat-thinking-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
  }



  /* ── Grok-Style Grounding / Web Research Accordion ────────────── */
  .chat-research-slot {
    width: 100%;
    margin-bottom: 6px;
  }
  .chat-research-slot:empty {
    display: none;
    margin: 0;
  }

  .chat-research-wrap {
    width: 100%;
    margin: 4px 0 12px 0;
    font-family: inherit;
    font-size: 0.82rem;
    color: #9ca3af;
    animation: chatSoftReveal 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

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

  .chat-research-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.81rem;
    color: #9ca3af;
    user-select: none;
    padding: 3px 0;
    transition: color 0.15s ease;
  }

  .chat-research-header:hover {
    color: #e4e7ec;
  }

  .chat-research-title {
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  .chat-research-chevron {
    width: 13px;
    height: 13px;
    stroke-width: 2px;
    color: currentColor;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    transform: rotate(0deg);
  }

  .chat-research-wrap.is-collapsed .chat-research-chevron {
    transform: rotate(-90deg);
  }

  .chat-research-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.20s ease, margin 0.20s ease;
    opacity: 1;
    margin-top: 6px;
  }

  .chat-research-body-inner {
    overflow: hidden;
    min-height: 0;
  }

  .chat-research-wrap.is-collapsed .chat-research-body {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .chat-research-tree {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 2px;
  }

  .chat-research-node {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 24px;
    padding: 2px 0;
    font-size: 0.81rem;
    line-height: 1.45;
    color: #9ca3af;
  }

  .chat-research-node:not(:last-child)::after {
    display: none;
  }

  .chat-research-timeline-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  .chat-research-node-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #a1a1aa;
    stroke-width: 1.75px;
    position: relative;
    z-index: 2;
  }

  .chat-research-node-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.81rem;
    color: #9ca3af;
  }

  .chat-research-node-main {
    font-weight: 500;
    color: #d4d4d8;
  }

  .chat-research-node-prefix {
    color: #8e9196;
  }

  .chat-research-link,
  .chat-research-query-val {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    font-size: 0.80rem;
    color: #d4d4d8;
    text-decoration: none;
    transition: color 0.15s ease;
    word-break: break-all;
  }

  .chat-research-node-sub {
    color: #71717a;
    font-size: 0.79rem;
  }

  .chat-research-link:hover {
    color: #ffffff;
    text-decoration: underline;
  }

  /* ── Live Research Status (Claude / Apple Intelligence Standard Shimmer) ── */
  .chat-research-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.81rem;
    color: #9da0a6;
    margin-bottom: 8px;
    padding: 3px 0;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
    animation: chatBlurIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .chat-research-live.is-exiting {
    opacity: 0;
    transform: translateY(-4px);
    filter: blur(5px);
    pointer-events: none;
  }

  @keyframes chatBlurIn {
    0% { opacity: 0; transform: translateY(4px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
  }

  .chat-research-spark-icon {
    font-size: 0.82rem;
    color: #f4f3f0;
    animation: sparkBreathe 1.8s ease-in-out infinite;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform, opacity;
    flex-shrink: 0;
  }

  @keyframes sparkBreathe {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(244, 243, 240, 0.45)); }
  }

  .chat-research-live-msg {
    background: linear-gradient(90deg, #8e8d8a 0%, #8e8d8a 35%, #ffffff 50%, #8e8d8a 65%, #8e8d8a 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: liveTextShimmer 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  @keyframes liveTextShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
  }

  .chat-research-micro-check {
    width: 12px;
    height: 12px;
    color: #10b981;
    stroke-width: 2.2px;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
  }

  .chat-research-thought-box {
    margin: 4px 0 14px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .chat-research-thought-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.70rem;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
  }

  .chat-research-thought-spark {
    color: #818cf8;
    font-size: 0.75rem;
  }

  .chat-research-thought-content {
    font-size: 0.80rem;
    color: #a1a1aa;
    line-height: 1.55;
    font-style: italic;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  }

  @keyframes chatPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
  }

  /* ── Research Source Cards Carousel (Apple / Linear / Perplexity Tier) ── */
  .chat-research-carousel-wrap {
    position: relative;
    margin: 8px 0 14px 0;
    width: 100%;
  }

  .chat-research-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 6px 8px 6px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 20px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 20px), transparent);
  }

  .chat-research-carousel::-webkit-scrollbar {
    display: none;
  }

  .chat-research-card {
    flex: 0 0 210px;
    width: 210px;
    scroll-snap-align: start;
    background: #141518;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-research-card:hover {
    background: #18191e;
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  .chat-research-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .chat-research-card-site {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .chat-research-favicon-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .chat-research-favicon-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    border-radius: 2px;
  }

  .chat-research-card-domain {
    font-size: 0.70rem;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-research-card-idx {
    font-size: 0.65rem;
    font-weight: 600;
    color: #71717a;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0 4px;
    line-height: 16px;
  }

  .chat-research-card-title {
    font-size: 0.77rem;
    font-weight: 500;
    color: #f4f4f5;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .chat-research-card-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.64rem;
    font-weight: 500;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 9999px;
    padding: 1px 6px;
    margin-top: auto;
    align-self: flex-start;
  }

  .chat-research-card-verified i {
    width: 10px;
    height: 10px;
  }

  /* Carousel Navigation Chevrons (Hover Reveal) */
  .chat-research-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(20, 21, 24, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-research-carousel-btn i {
    width: 14px;
    height: 14px;
  }

  .chat-research-carousel-btn.prev {
    left: -8px;
  }

  .chat-research-carousel-btn.next {
    right: -8px;
  }

  .chat-research-carousel-wrap:hover .chat-research-carousel-btn {
    opacity: 1;
    pointer-events: auto;
  }

  .chat-research-carousel-btn:hover {
    background: rgba(30, 31, 36, 0.96);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
  }

  /* ── Interactive Citation Chips (ChatGPT Style Capsule Pills) ── */
  .chat-citation-cluster {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 3px;
    vertical-align: baseline;
  }

  /* ── ChatGPT Super Clean Citation Pill (Exact Match to Reference) ── */
  .chat-citation-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    font-size: 0.72rem;
    font-weight: 550;
    line-height: 1;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #0f0f10;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    vertical-align: middle;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .chat-citation-pill:hover,
  .chat-citation-pill.is-active {
    background: #e8e8e8;
    color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  .chat-citation-favicon {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .chat-citation-label {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  /* ── ChatGPT Super Clean Citation Popover (Exact Match to Reference) ── */
  .chat-citation-popover {
    position: fixed;
    z-index: 9999;
    width: 270px;
    max-width: calc(100vw - 32px);
    background: #242320;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 4px 12px -2px rgba(0, 0, 0, 0.45);
    font-family: var(--font-sans, inherit);
    pointer-events: auto;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease;
    will-change: opacity, transform;
    animation: chatCitationFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .chat-citation-popover:hover {
    background: #2a2926;
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
  }

  .chat-citation-popover.is-hiding {
    opacity: 0;
    transform: translateY(3px) scale(0.98);
    pointer-events: none;
  }

  @keyframes chatCitationFadeIn {
    0% { opacity: 0; transform: translateY(4px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }

  .chat-assistant-reply-text .chat-table td .chat-citation-pill {
    margin: 0 2px;
    vertical-align: middle;
  }

  .chat-assistant-reply-text .chat-table td .chat-citation-pill .chat-citation-favicon {
    width: 11px;
    height: 11px;
  }

  .chat-citation-popover-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
  }

  .chat-citation-popover-favicon-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  .chat-citation-popover-favicon-img {
    width: 13px;
    height: 13px;
    object-fit: contain;
  }

  .chat-citation-popover-domain {
    font-size: 0.76rem;
    font-weight: 500;
    color: #e4e3df;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-citation-popover-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 5px;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .chat-citation-popover-meta {
    font-size: 0.74rem;
    color: #9d9a93;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ── Baris Kartu Kecil di Bawah Jawaban (Sources Row Beneath Answer) ── */
  .chat-sources-bottom-slot {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 4px;
  }
  .chat-sources-bottom-slot:empty {
    display: none;
    margin: 0;
  }

  .chat-bottom-sources-wrap {
    width: 100%;
    margin: 4px 0 6px 0;
    animation: chatSoftReveal 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .chat-bottom-sources-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.70rem;
    font-weight: 500;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
  }

  .chat-bottom-sources-header-icon {
    width: 12px;
    height: 12px;
    color: #a1a1aa;
    stroke-width: 2px;
  }

  .chat-bottom-sources-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
  }

  .chat-bottom-source-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    max-width: 230px;
    min-width: 120px;
    padding: 5px 10px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    text-decoration: none;
    color: #e4e7ec;
    box-sizing: border-box;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    flex: 0 1 auto;
  }

  .chat-bottom-source-card:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    color: #ffffff;
  }

  .chat-bottom-source-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .chat-bottom-source-favicon img {
    width: 14px;
    height: 14px;
    object-fit: contain;
  }

  .chat-bottom-source-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    line-height: 1.25;
  }

  .chat-bottom-source-domain {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-bottom-source-title {
    font-size: 0.73rem;
    font-weight: 450;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-bottom-source-card:hover .chat-bottom-source-title {
    color: #ffffff;
  }

  .chat-bottom-source-arrow {
    font-size: 0.72rem;
    color: #71717a;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 2px;
    transition: color 0.15s ease, transform 0.15s ease;
  }

  .chat-bottom-source-card:hover .chat-bottom-source-arrow {
    color: #ffffff;
    transform: translate(1px, -1px);
  }



  /* ==========================================================================
     INSTAGRAM FEED STUDIO (SUPER CLEAN, SOFT-BLACK BRANDED, FRAMELESS AESTHETIC)
     Modeled after Image Studio, API Keys, and luxury visual creator tooling
     ========================================================================== */

  /* Studio 2-Column Layout (Main Bento Grid on Left, Sticky Controls Sidebar on Right) */
  .feed-studio-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding-bottom: 80px;
    overflow: visible;
  }

  .feed-main-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* Stage Header & View Switcher */
  .feed-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
  }

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

  .feed-stage-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f4f4f5;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .feed-stage-sub {
    font-size: 0.7rem;
    color: #71717a;
    font-family: var(--font-mono);
  }

  .feed-view-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 3px;
    gap: 3px;
  }

  .feed-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #8b8b94;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .feed-view-btn:hover {
    color: #f4f4f5;
    background: rgba(255, 255, 255, 0.05);
  }

  .feed-view-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .feed-view-btn-text {
    font-size: 0.7rem;
  }

  /* Mobile Quick Header Bar (Hidden on desktop) */
  .feed-mobile-quick-bar {
    display: none;
  }

  .feed-sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }

  /* Right Sidebar Panel (Inspector style, sticky docked, non-cut-off) */
  .feed-studio-sidebar {
    width: 330px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    z-index: 20;
  }

  .feed-sidebar-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  }

  .feed-sidebar-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .feed-sidebar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f4f4f5;
    letter-spacing: -0.01em;
  }

  .feed-sidebar-pill {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b8b94;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
  }

  .feed-sidebar-card::-webkit-scrollbar {
    width: 3px;
  }

  .feed-sidebar-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }

  .feed-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .feed-sidebar-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: #d4d4d8;
    letter-spacing: 0;
    text-transform: none;
    font-family: var(--font-sans);
  }

  .feed-sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  @media (min-width: 981px) {
    .feed-sidebar-body > .feed-sidebar-section + .feed-sidebar-section {
      padding-top: 13px;
      border-top: 1px solid rgba(255, 255, 255, 0.055);
    }

    .feed-sidebar-body > .feed-sidebar-actions {
      padding-top: 13px;
      border-top: 1px solid rgba(255, 255, 255, 0.055);
    }
  }

  .feed-color-info-text {
    font-size: 0.68rem;
    font-weight: 500;
    color: #a1a1aa;
    font-family: var(--font-sans);
    text-align: right;
  }

  /* Preset Style Selector */
  .feed-style-select-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
  }

  .feed-style-select {
    width: 100%;
    height: 38px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 10px !important;
    padding: 9px 30px 9px 11px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #f4f4f5;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
  }

  .feed-style-select:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
  }

  .feed-style-select:focus {
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
  }

  .feed-style-select option {
    background: #262626;
    color: #ffffff;
    font-weight: 500;
  }

  .feed-select-chevron {
    position: absolute;
    right: 11px;
    pointer-events: none;
    width: 12px;
    height: 12px;
    color: #71717a;
  }

  /* Logo Brand Upload & Preview (Clean & Quiet) */
  .feed-logo-upload-wrap {
    width: 100%;
    position: relative;
  }

  .feed-logo-hidden-input {
    display: none;
  }

  .feed-logo-compact-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 7px 9px 7px 11px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .feed-logo-compact-zone:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .feed-logo-compact-zone.drag-over {
    background: rgba(255, 107, 0, 0.08);
    border-color: #ff6b00;
  }

  .feed-logo-zone-left {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .feed-logo-zone-title {
    font-size: 0.74rem;
    font-weight: 500;
    color: #d4d4d8;
  }

  .feed-logo-btn-tag {
    font-size: 0.66rem;
    font-weight: 500;
    color: #d4d4d8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    padding: 3px 8px;
    line-height: 1.4;
  }

  .feed-logo-compact-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    padding: 5px 8px;
    gap: 8px;
  }

  .feed-logo-thumb-sq {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: #09090b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 2px;
  }

  .feed-logo-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .feed-logo-info-compact {
    flex: 1;
    min-width: 0;
  }

  .feed-logo-filename {
    font-size: 0.72rem;
    font-weight: 500;
    color: #e4e4e7;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .btn-feed-logo-remove {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #71717a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease;
    flex-shrink: 0;
  }

  .btn-feed-logo-remove:hover {
    color: #ef4444;
  }

  /* Brand & Web Inputs (Clean minimal 2-column row) */
  .feed-sidebar-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .feed-sidebar-input {
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 8px 10px;
    color: #f4f4f5;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
  }

  .feed-sidebar-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .feed-sidebar-input::placeholder {
    color: #6b6b73;
    font-size: 0.74rem;
  }

  /* Topic / Niche Textarea & Chips (Clean without ugly native scrollbars) */
  .feed-topic-input-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .feed-sidebar-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 9px 10px;
    color: #f4f4f5;
    font-size: 0.76rem;
    font-weight: 400;
    font-family: inherit;
    line-height: 1.45;
    resize: none;
    min-height: 62px;
    max-height: 84px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    scrollbar-width: none;
  }

  .feed-sidebar-textarea::-webkit-scrollbar {
    display: none;
  }

  .feed-sidebar-textarea:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .feed-sidebar-textarea::placeholder {
    color: #6b6b73;
    font-size: 0.74rem;
  }

  .feed-topic-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .feed-topic-chips::-webkit-scrollbar {
    display: none;
  }

  .feed-topic-chip {
    flex-shrink: 0;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 0.67rem;
    font-weight: 500;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
  }

  .feed-topic-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .feed-topic-char-count {
    font-size: 0.62rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: #9a9aa3;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    padding: 2px 7px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  /* Color Palette */
  .feed-color-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
  }

  .color-swatch-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
  }

  .color-dot:hover {
    transform: scale(1.12);
  }

  .color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8);
    transform: scale(1.12);
  }

  .color-picker-label {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8b8b94;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .color-picker-label:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
  }

  .color-picker-label.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8);
  }

  .native-color-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }

  /* Style Meta & Guidelines (Clean Minimalist Bar) */
  .feed-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .feed-meta-bar:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .feed-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .feed-meta-badge-text {
    font-size: 0.72rem;
    font-weight: 500;
    color: #d4d4d8;
  }

  .feed-meta-dot {
    color: #3f3f46;
    font-size: 0.65rem;
    user-select: none;
  }

  .feed-meta-sub {
    color: #8b8f9c;
    font-size: 0.69rem;
    font-family: var(--font-sans);
  }

  .feed-meta-toggle-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.66rem;
    color: #8b8b94;
    transition: color 0.15s ease;
  }

  .feed-meta-bar:hover .feed-meta-toggle-hint {
    color: #d4d4d8;
  }

  .feed-meta-desc {
    font-size: 0.72rem;
    color: #8b8f9c;
    line-height: 1.45;
    margin: 4px 0 0 0;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
  }

  /* Studio Actions (Bottom of Sidebar) */
  .feed-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 6px;
  }

  .btn-feed-render-all {
    width: 100%;
    height: 42px;
    background: #ffffff !important;
    color: #0c0b0a !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.08);
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .btn-feed-render-all:hover {
    background: #eae8e3 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
  }

  .btn-feed-render-all.is-generating {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12);
  }

  .btn-feed-render-all.is-generating:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
  }

  .feed-sidebar-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .btn-feed-sidebar-action {
    min-height: 34px;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 9px !important;
    padding: 7px 12px;
    font-size: 0.73rem;
    font-weight: 500;
    color: #a1a1aa !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .btn-feed-sidebar-action:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
  }

  /* 9-Grid Cards (3x3 Bento Layout - Frameless Soft-Black Cards) */
  .feed-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 6px;
    overflow: visible;
  }

  .feed-post-card {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 18px 16px !important;
    aspect-ratio: 4 / 5;
    min-height: 310px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  }

  .feed-post-card:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5) !important;
  }

  /* Accent Tint Card */
  .feed-post-card.card-accent-tint {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .feed-post-card.card-accent-tint:hover {
    background: var(--surface-hover, #2f2f2f) !important;
  }

  /* Loading State - Super Clean High-End Generative Canvas (No Text, No Icons, Silky Smooth) */
  /* Loading State - Fluid Aurora Gradient Waves (Gelombang Gradien Blur Halus) */
  .feed-post-card.card-loading {
    background: #191b17 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 16px !important;
    aspect-ratio: 4 / 5;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45), inset 0 0 35px rgba(255, 255, 255, 0.03) !important;
    cursor: default;
  }

  /* Soft Vignette Edge for seamless frameless blending */
  .feed-post-card.card-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(25, 27, 23, 0.65) 95%);
    z-index: 2;
    border-radius: 16px;
  }

  .feed-aurora-canvas {
    position: absolute;
    inset: -35%;
    width: 170%;
    height: 170%;
    overflow: hidden;
    pointer-events: none;
    filter: blur(48px);
    -webkit-filter: blur(48px);
    transform: translateZ(0);
    will-change: transform;
    opacity: 0.9;
    z-index: 1;
  }

  .feed-aurora-wave {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    mix-blend-mode: screen;
  }

  /* Wave 1: Luminous Silver / Soft White fluid wave */
  .feed-aurora-wave.wave-1 {
    width: 250px;
    height: 250px;
    top: 22%;
    left: 20%;
    background: radial-gradient(
      circle at 45% 45%,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(240, 240, 245, 0.12) 40%,
      transparent 72%
    );
    animation: auroraWaveFlow1 9.5s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  }

  /* Wave 2: Infused with accent color if defined */
  .feed-aurora-wave.wave-2 {
    width: 280px;
    height: 280px;
    top: 32%;
    right: 18%;
    background: radial-gradient(
      circle at 55% 55%,
      var(--aurora-accent, rgba(255, 255, 255, 0.22)) 0%,
      rgba(255, 255, 255, 0.08) 45%,
      transparent 75%
    );
    opacity: 0.75;
    animation: auroraWaveFlow2 12s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  }

  /* Wave 3: Deep ambient breathing wave */
  .feed-aurora-wave.wave-3 {
    width: 310px;
    height: 310px;
    bottom: 18%;
    left: 24%;
    background: radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(190, 195, 205, 0.05) 50%,
      transparent 80%
    );
    animation: auroraWaveFlow3 7.8s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  }

  @keyframes auroraWaveFlow1 {
    0% {
      transform: translate3d(-18%, -22%, 0) rotate(0deg) scale(0.92);
      opacity: 0.65;
    }
    35% {
      transform: translate3d(24%, 12%, 0) rotate(125deg) scale(1.18);
      opacity: 0.95;
    }
    70% {
      transform: translate3d(-12%, 26%, 0) rotate(245deg) scale(0.98);
      opacity: 0.75;
    }
    100% {
      transform: translate3d(-18%, -22%, 0) rotate(360deg) scale(0.92);
      opacity: 0.65;
    }
  }

  @keyframes auroraWaveFlow2 {
    0% {
      transform: translate3d(22%, 18%, 0) rotate(0deg) scale(1.15);
      opacity: 0.7;
    }
    40% {
      transform: translate3d(-24%, -14%, 0) rotate(-135deg) scale(0.88);
      opacity: 0.92;
    }
    75% {
      transform: translate3d(14%, -24%, 0) rotate(-260deg) scale(1.08);
      opacity: 0.6;
    }
    100% {
      transform: translate3d(22%, 18%, 0) rotate(-360deg) scale(1.15);
      opacity: 0.7;
    }
  }

  @keyframes auroraWaveFlow3 {
    0%, 100% {
      transform: translate3d(0, 0, 0) scale(0.88);
      opacity: 0.45;
    }
    50% {
      transform: translate3d(8%, -10%, 0) scale(1.28);
      opacity: 0.85;
    }
  }

  /* Rendered Card State (Pure Luxury Big-Brand Standard with Shimmer Skeleton) */
  .feed-post-card.card-rendered {
    position: relative;
    padding: 0 !important;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: linear-gradient(110deg, #121214 15%, #18181b 30%, #242429 45%, #18181b 60%, #121214 85%) !important;
    background-size: 220% 100% !important;
    animation: feedCardShimmer 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, feedArtworkReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
  }

  .feed-post-card.card-rendered.is-loaded {
    animation: none !important;
    background: #262626 !important;
  }

  @keyframes feedCardShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  @keyframes feedArtworkReveal {
    from { opacity: 0; transform: scale(0.98) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
  }

  .feed-post-card.card-rendered:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.10) !important;
  }

  /* Cinematic Clean Hover State - no darkening vignette over the art */
  .feed-post-card.card-rendered::after {
    display: none;
  }

  .feed-rendered-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
  }

  .feed-rendered-img.is-loaded {
    opacity: 1;
  }

  .feed-post-card.card-rendered:hover .feed-rendered-img.is-loaded {
    transform: scale(1.02);
  }

  /* Centered Symmetrical Floating Island Glass Dock (Luxury Midjourney / Apple Standard) */
  .feed-rendered-overlay-bottom {
    position: absolute;
    bottom: 12px;
    left: 50%;
    right: auto;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    z-index: 3;
    background: rgba(16, 17, 20, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  }

  .feed-post-card.card-rendered:hover .feed-rendered-overlay-bottom,
  .feed-post-card.card-rendered:focus-within .feed-rendered-overlay-bottom {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .btn-feed-glass {
    background: transparent;
    border: none !important;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    padding: 0;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-sizing: border-box;
  }

  .btn-feed-glass:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: scale(1.08);
  }

  .btn-feed-glass:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
  }

  .btn-feed-glass i,
  .btn-feed-glass svg {
    width: 14px;
    height: 14px;
  }

  /* Refined Monochromatic Glass Accent Button (No stark white sticker look) */
  .btn-feed-glass-accent {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 5px 11px;
  }

  .btn-feed-glass-accent:hover {
    background: rgba(255, 255, 255, 0.24) !important;
    border-color: rgba(255, 255, 255, 0.30) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12);
  }

  /* Card Interior Elements */
  .feed-card-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
  }

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

  /* Prompt Card Cover (Designed 4:5 placeholder shown before an image is rendered) */
  .feed-card-cover {
    position: relative;
    flex: 1;
    min-height: 140px;
    margin-top: 2px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    background: var(--bg, #1f1f1f);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
    isolation: isolate;
  }

  .feed-card-cover::before {
    content: '';
    position: absolute;
    top: -90px;
    right: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--post-accent, #ff6b00) 0%, transparent 68%);
    opacity: 0.28;
    filter: blur(6px);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .feed-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(circle at 25% 15%, #000 0%, transparent 78%);
    mask-image: radial-gradient(circle at 25% 15%, #000 0%, transparent 78%);
    opacity: 0.7;
    z-index: 0;
  }

  .feed-post-card:hover .feed-card-cover::before {
    opacity: 0.5;
    transform: scale(1.08);
  }

  .feed-cover-brand,
  .feed-cover-title,
  .feed-cover-footer {
    position: relative;
    z-index: 1;
  }

  .feed-cover-brand {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
  }

  .feed-cover-title {
    font-size: clamp(1rem, 1.35vw, 1.3rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: balance;
  }

  .feed-cover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
  }

  .feed-card-cover.is-light {
    background: #f5f4f0;
    border-color: rgba(31, 31, 31, 0.08);
  }

  .feed-card-cover.is-light::after {
    background-image:
      linear-gradient(rgba(31, 31, 31, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(31, 31, 31, 0.06) 1px, transparent 1px);
    opacity: 0.55;
  }

  .feed-card-cover.is-light .feed-cover-brand,
  .feed-card-cover.is-light .feed-cover-footer {
    color: rgba(31, 31, 31, 0.5);
  }

  .feed-card-cover.is-light .feed-cover-title {
    color: #1f1f1f;
  }

  .feed-post-number {
    font-size: 0.68rem;
    font-weight: 500;
    color: #71717a;
    font-family: var(--font-mono);
  }

  .feed-post-badge {
    font-size: 0.68rem;
    font-weight: 500;
    color: #71717a;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.02em;
  }

  .feed-badge-color-dot {
    display: none !important;
  }

  .feed-post-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f4f4f5;
    line-height: 1.35;
    letter-spacing: -0.01em;
  }

  .feed-post-sub {
    font-size: 0.73rem;
    color: #71717a;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .feed-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    margin-top: auto;
  }

  .btn-feed-action {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a1a1aa !important;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .btn-feed-action:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #ffffff !important;
  }

  .btn-feed-action.btn-feed-generate {
    background: #ffffff !important;
    color: #0c0b0a !important;
    border: none !important;
    border-radius: 999px !important;
    font-weight: 600;
  }

  .btn-feed-action.btn-feed-generate:hover {
    background: #eae8e3 !important;
    color: #0c0b0a !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.16);
  }

  /* Viral Instagram Caption Assistant Bubble */
  .feed-caption-card {
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 22px 24px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  .caption-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .caption-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    flex: 1 1 auto;
    min-width: 0;
  }

  .caption-display-box {
    background: #1f1f1f !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 0.8rem;
    color: #e2e4e9;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    max-height: 320px;
    overflow-y: auto;
  }

  /* ==========================================================================
     RESPONSIVE RULES FOR FEED STUDIO (ULTRA-CLEAN, ANTI-BLUR, ANTI-OVERLAP)
     ========================================================================== */

  /* Large Tablet / Medium Desktop (981px - 1200px) */
  @media (max-width: 1200px) {
    .feed-studio-layout {
      gap: 20px;
    }
    .feed-studio-sidebar {
      width: 310px;
    }
    .feed-grid-3x3 {
      gap: 14px;
    }
    .feed-post-card {
      min-height: 280px;
      padding: 16px 14px !important;
    }
    .feed-post-title {
      font-size: 0.86rem;
    }
  }

  /* Tablet / Foldable (769px - 980px) */
  @media (max-width: 980px) {
    .feed-studio-layout {
      flex-direction: column;
      gap: 20px;
      width: 100%;
      padding-bottom: 60px;
    }

    /* Move controls to top on tablet/mobile so users don't have to scroll past 9 cards */
    .feed-studio-sidebar {
      order: -1;
      width: 100%;
      position: static;
      max-height: none;
      z-index: 10;
    }

    .feed-sidebar-card {
      max-height: none;
      overflow: visible;
      padding: 18px 20px;
      border-radius: 16px;
      gap: 14px;
      display: flex;
      flex-direction: column;
      width: 100%;
      box-sizing: border-box;
    }

    .feed-sidebar-body {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      width: 100%;
    }

    /* Sections grid mapping for sleek horizontal dashboard deck */
    .feed-sidebar-body > .feed-sidebar-section:nth-child(1) { grid-column: 1 / 2; }
    .feed-sidebar-body > .feed-sidebar-section:nth-child(2) { grid-column: 2 / 3; }
    .feed-sidebar-body > .feed-sidebar-section:nth-child(3) { grid-column: 1 / -1; }
    .feed-sidebar-body > .feed-sidebar-section:nth-child(4) { grid-column: 1 / 2; }
    .feed-sidebar-body > .feed-sidebar-section:nth-child(5) { grid-column: 2 / 3; }
    .feed-sidebar-body > .feed-sidebar-actions { grid-column: 1 / -1; }

    .feed-main-stage {
      width: 100%;
      gap: 18px;
    }

    .feed-grid-3x3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .feed-post-card {
      min-height: 260px;
      padding: 15px 13px !important;
    }
  }

  /* Phablet / Mobile Landscape (541px - 768px) */
  @media (max-width: 768px) {
    .feed-studio-layout {
      flex-direction: column;
      gap: 16px;
      width: 100%;
      padding-bottom: 40px;
    }

    .feed-sidebar-titlebar {
      display: none;
    }

    .feed-studio-sidebar {
      order: -1;
      width: 100%;
      position: static;
      max-height: none;
    }

    .feed-sidebar-card {
      display: flex;
      flex-direction: column;
      max-height: none;
      overflow: visible;
      padding: 14px 14px;
      border-radius: 16px;
      gap: 12px;
    }

    /* Mobile Quick Bar (Visible on mobile <= 768px) */
    .feed-mobile-quick-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
      padding: 0;
    }

    .feed-mobile-quick-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }

    .feed-mobile-style-badge {
      font-size: 0.72rem;
      font-weight: 600;
      color: #f4f4f5;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 6px;
      padding: 4px 8px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 130px;
      font-family: var(--font-mono);
    }

    .feed-mobile-color-indicator {
      width: 13px;
      height: 13px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.25);
      flex-shrink: 0;
    }

    .feed-mobile-quick-right {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .btn-feed-mobile-toggle {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 0.72rem;
      font-weight: 500;
      color: #e4e4e7;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s ease;
    }

    .btn-feed-mobile-toggle:hover,
    .btn-feed-mobile-toggle.active {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(255, 255, 255, 0.2);
      color: #ffffff;
    }

    .btn-feed-mobile-render {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #ffffff;
      color: #09090b;
      border: 1px solid #ffffff;
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 0.72rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.15s ease;
    }

    .btn-feed-mobile-render:hover {
      background: #e4e4e7;
    }

    /* Collapsible detailed settings body on mobile */
    .feed-sidebar-body {
      display: none;
      flex-direction: column;
      gap: 13px;
      padding-top: 12px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .feed-sidebar-body.mobile-open {
      display: flex;
    }

    .feed-sidebar-header-row {
      flex-wrap: wrap;
      gap: 6px;
    }

    .feed-meta-bar {
      flex-wrap: wrap;
      gap: 6px;
    }

    /* Bento 3x3 Mode on Mobile (Standard Instagram profile preview) */
    .feed-grid-3x3.view-mode-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 8px !important;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-card {
      aspect-ratio: 4 / 5 !important;
      min-height: 0 !important;
      padding: 8px 6px !important;
      border-radius: 10px !important;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-number {
      font-size: 0.58rem;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-badge {
      font-size: 0.52rem;
      padding: 1px 4px;
      max-width: 55px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-title {
      font-size: 0.68rem;
      line-height: 1.2;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-sub {
      display: none !important;
    }

    .feed-grid-3x3.view-mode-grid .feed-card-cover {
      min-height: 0;
      margin-top: 2px;
      padding: 7px 6px;
      border-radius: 8px;
      gap: 4px;
    }

    .feed-grid-3x3.view-mode-grid .feed-cover-brand,
    .feed-grid-3x3.view-mode-grid .feed-cover-footer {
      display: none;
    }

    .feed-grid-3x3.view-mode-grid .feed-cover-title {
      font-size: 0.64rem;
      line-height: 1.18;
      -webkit-line-clamp: 3;
    }

    .feed-grid-3x3.view-mode-cards .feed-card-cover {
      min-height: 150px;
    }

    .feed-grid-3x3.view-mode-grid .feed-card-actions {
      padding-top: 4px;
      gap: 4px;
      display: flex;
      flex-direction: row;
      width: 100%;
    }

    .feed-grid-3x3.view-mode-grid .btn-feed-action {
      flex: 1;
      padding: 4px 2px;
      font-size: 0.6rem;
      border-radius: 6px !important;
      justify-content: center;
      min-width: 0;
      gap: 2px;
    }

    .feed-grid-3x3.view-mode-grid .btn-feed-action span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .feed-grid-3x3.view-mode-grid .feed-rendered-overlay-bottom {
      bottom: 4px !important;
      padding: 2px 2px !important;
      gap: 2px !important;
      max-width: 96% !important;
    }

    .feed-grid-3x3.view-mode-grid .btn-feed-glass {
      width: 22px !important;
      height: 22px !important;
      padding: 0 !important;
    }

    .feed-grid-3x3.view-mode-grid .btn-feed-glass svg {
      width: 11px !important;
      height: 11px !important;
    }

    /* Cards Mode on Mobile (Single wide column, comfortable reading) */
    .feed-grid-3x3.view-mode-cards {
      grid-template-columns: 1fr !important;
      gap: 12px !important;
    }

    .feed-grid-3x3.view-mode-cards .feed-post-card {
      aspect-ratio: auto !important;
      min-height: auto !important;
      padding: 14px 14px !important;
      border-radius: 14px !important;
    }

    .feed-grid-3x3.view-mode-cards .feed-post-card.card-rendered {
      aspect-ratio: 4 / 5 !important;
      max-width: 440px;
      margin: 0 auto;
      width: 100%;
    }

    .feed-grid-3x3.view-mode-cards .feed-post-card.card-loading {
      aspect-ratio: 4 / 5 !important;
      max-width: 440px;
      margin: 0 auto;
      width: 100%;
    }

    .feed-grid-3x3.view-mode-cards .feed-post-sub {
      display: -webkit-box !important;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
      overflow: hidden;
      font-size: 0.72rem;
      line-height: 1.4;
      margin-top: 6px;
    }

    .feed-grid-3x3.view-mode-cards .feed-card-actions {
      display: flex;
      gap: 8px;
      padding-top: 10px;
    }

    .feed-grid-3x3.view-mode-cards .btn-feed-action {
      padding: 7px 14px;
      font-size: 0.75rem;
    }

    /* Action dock visible on touch/mobile so users can tap download / lightbox */
    .feed-rendered-overlay-bottom {
      opacity: 1 !important;
      pointer-events: auto !important;
      transform: translateX(-50%) translateY(0) !important;
      bottom: 8px !important;
      background: rgba(16, 17, 20, 0.94) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      padding: 2px 4px;
      gap: 2px;
    }

    .btn-feed-glass {
      width: 32px;
      height: 32px;
      color: #ffffff;
    }

    .caption-card-header {
      flex-wrap: wrap;
      gap: 8px;
    }

    .caption-title {
      flex: 1 1 auto;
      min-width: 0;
    }
  }

  /* Small Mobile Phones (<= 540px) */
  @media (max-width: 540px) {
    .feed-stage-header {
      flex-wrap: wrap;
      gap: 8px;
    }

    .feed-studio-layout {
      gap: 14px;
      padding-bottom: 30px;
    }

    .feed-sidebar-card {
      padding: 12px 12px;
      border-radius: 14px;
      gap: 10px;
    }

    .feed-mobile-style-badge {
      max-width: 100px;
      font-size: 0.68rem;
      padding: 3px 6px;
    }

    .btn-feed-mobile-toggle,
    .btn-feed-mobile-render {
      padding: 5px 8px;
      font-size: 0.68rem;
    }

    .feed-sidebar-label {
      font-size: 0.62rem;
    }

    .feed-sidebar-inputs-row {
      gap: 6px;
    }

    .feed-sidebar-input {
      padding: 6px 9px;
      font-size: 0.72rem;
    }

    .feed-sidebar-textarea {
      min-height: 42px;
      font-size: 0.72rem;
      padding: 6px 9px;
    }

    .feed-topic-chips {
      gap: 4px;
    }

    .feed-topic-chip {
      font-size: 0.62rem;
      padding: 2px 7px;
    }

    .btn-feed-render-all {
      padding: 10px 14px;
      font-size: 0.8rem;
      border-radius: 8px !important;
    }

    .btn-feed-sidebar-action {
      padding: 6px 10px;
      font-size: 0.7rem;
    }

    .feed-grid-3x3.view-mode-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 6px !important;
    }

    .feed-grid-3x3.view-mode-cards {
      grid-template-columns: 1fr !important;
      gap: 10px !important;
    }

    .feed-caption-card {
      padding: 14px 14px;
      border-radius: 14px;
      gap: 10px;
    }

    .caption-title {
      font-size: 0.8rem;
    }

    .caption-display-box {
      padding: 12px;
      font-size: 0.72rem;
      border-radius: 10px;
    }
  }

  /* Extra Small Devices (< 360px) */
  @media (max-width: 360px) {
    .feed-sidebar-inputs-row {
      grid-template-columns: 1fr;
    }

    .feed-mobile-style-badge {
      max-width: 80px;
      font-size: 0.64rem;
    }

    .feed-grid-3x3.view-mode-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 4px !important;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-card {
      padding: 6px 3px !important;
      border-radius: 8px !important;
    }

    .feed-grid-3x3.view-mode-grid .feed-post-title {
      font-size: 0.62rem;
    }

    .feed-grid-3x3.view-mode-grid .feed-cover-title {
      font-size: 0.58rem;
    }

    .feed-grid-3x3.view-mode-grid .btn-feed-glass {
      width: 19px !important;
      height: 19px !important;
    }

    .feed-grid-3x3.view-mode-cards {
      grid-template-columns: 1fr !important;
      gap: 8px !important;
    }

    .feed-post-card {
      min-height: auto;
    }
  }


  /* ==========================================================================
     DOCUMENTATION PAGE (SUPER CLEAN, SOFT-BLACK BRANDED, FRAMELESS AESTHETIC)
     Modeled after high-end engineering docs & Image Studio soft-black canvas
     ========================================================================== */

  .docs-wrap {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 16px 120px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Floating Sticky Capsule Navigation */
  .docs-nav-bar {
    position: sticky;
    top: 72px;
    z-index: 35;
    margin-bottom: 6px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .docs-nav-capsule {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .docs-nav-capsule::-webkit-scrollbar {
    display: none;
  }

  .docs-nav-btn {
    border: none !important;
    background: transparent;
    color: #8b8f9c;
    font-size: 0.76rem;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    user-select: none;
  }

  .docs-nav-btn:hover {
    color: #ffffff;
    background: var(--surface-hover, #2f2f2f);
  }

  .docs-nav-btn.active {
    color: #ffffff !important;
    background: #333333 !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .docs-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
  }

  /* Section Blocks */
  .docs-block {
    scroll-margin-top: 140px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .docs-block-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .docs-pill-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 9px;
    border-radius: 6px;
    border: none !important;
  }

  .docs-heading {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 2px 0 4px;
  }

  .docs-lead {
    font-size: 0.88rem;
    color: #8b8f9c;
    line-height: 1.6;
    margin: 0;
    max-width: 820px;
  }

  .docs-lead code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg, #1f1f1f);
    color: #f4f3f0;
    padding: 2px 6px;
    border-radius: 5px;
    border: none !important;
  }

  /* Frameless Soft-Black Card Panels */
  .docs-panel {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 18px !important;
    padding: 24px 26px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  .docs-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
  }

  .docs-panel-caption {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #a3a3a3;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .docs-panel-meta {
    font-size: 0.72rem;
    color: #a3a3a3;
    font-family: var(--font-mono);
  }

  /* Mono Box (Base URL) */
  .docs-mono-box {
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .docs-mono-method {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    background: #282724;
    color: #ffffff;
    border: none !important;
    display: inline-flex;
    align-items: center;
  }

  .docs-mono-method.post {
    background: rgba(255, 255, 255, 0.12);
    color: #f4f3f0;
  }

  .docs-mono-method.get {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
  }

  .docs-mono-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #f4f3f0;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
  }

  .btn-docs-copy {
    background: #333333 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #d4d4d8 !important;
    padding: 6px 12px !important;
    font-size: 0.74rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .btn-docs-copy:hover {
    color: #ffffff !important;
    background: #3f3f46 !important;
  }

  /* Note Callout (Recessed Soft Black, Frameless) */
  .docs-note {
    border-radius: 14px !important;
    padding: 14px 18px !important;
    font-size: 0.82rem;
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #1f1f1f !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: var(--text-muted, #a3a3a3);
  }

  .docs-note code {
    background: #262626 !important;
    color: #ffffff !important;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    border: none !important;
  }

  .docs-endpoint-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
  }

  .docs-endpoint-url {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
  }

  /* Code Switcher Card */
  .docs-code-card {
    background: var(--bg, #1f1f1f) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  }

  .docs-code-bar {
    background: var(--surface, #262626) !important;
    border: none !important;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .docs-code-nav {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .docs-code-tab {
    background: transparent;
    border: none !important;
    color: #8b8f9c;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .docs-code-tab:hover {
    color: #ffffff;
    background: var(--surface-hover, #2f2f2f);
  }

  .docs-code-tab.active {
    color: #ffffff;
    background: #333333 !important;
    font-weight: 600;
  }

  .btn-copy-code {
    background: #333333 !important;
    border: none !important;
    color: #d4d4d8 !important;
    font-size: 0.74rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    transition: all 0.15s ease;
  }

  .btn-copy-code:hover {
    color: #ffffff !important;
    background: #3f3f46 !important;
  }

  .docs-snippet {
    display: none;
    padding: 18px 20px;
    overflow-x: auto;
    background: #191919;
  }

  .docs-snippet.active {
    display: block;
  }

  .docs-snippet pre {
    margin: 0;
  }

  .docs-snippet code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #e2e4e9;
    line-height: 1.65;
    white-space: pre;
  }

  /* Specification Rows (Card Stack without Cage Borders) */
  .docs-spec-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: none !important;
    background: transparent !important;
    padding: 0;
    margin: 0;
  }

  .docs-spec-row {
    background: #1f1f1f !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s ease;
  }

  .docs-spec-row:hover {
    background: #242424 !important;
  }

  .docs-spec-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .docs-spec-meta code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    background: #262626 !important;
    padding: 3px 8px;
    border-radius: 6px;
    border: none !important;
  }

  .docs-type-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #8b8f9c;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 6px;
    border: none !important;
  }

  .docs-status-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
    border: none !important;
  }

  .docs-status-tag.required {
    color: #f4f3f0 !important;
    background: rgba(255, 255, 255, 0.12) !important;
  }

  .docs-status-tag.optional {
    color: #5d6170 !important;
    background: rgba(255, 255, 255, 0.03) !important;
  }

  .docs-spec-detail {
    font-size: 0.82rem;
    color: #8b8f9c;
    line-height: 1.55;
  }

  .docs-spec-detail p {
    margin: 0;
  }

  .docs-spec-detail code {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #f4f3f0;
    background: #201f1d !important;
    padding: 2px 6px;
    border-radius: 5px;
    border: none !important;
  }

  .docs-example-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #4ade80 !important;
    background: #1f1f1f !important;
    border: none !important;
    padding: 3px 9px;
    border-radius: 6px;
    margin-bottom: 6px;
  }

  /* Example Box */
  .docs-example-box {
    background: #191919 !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 14px !important;
    padding: 16px 18px !important;
  }

  .docs-example-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b8f9c;
    font-family: var(--font-mono);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .docs-example-box pre {
    margin: 0;
  }

  .docs-example-box code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #e2e4e9;
    line-height: 1.6;
  }

  /* Models Grid */
  .docs-model-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .docs-model-item {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px !important;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .docs-model-item:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    transform: translateY(-1px);
  }

  .docs-model-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .docs-model-top code {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--bg, #1f1f1f) !important;
    padding: 2px 7px;
    border-radius: 6px;
    border: none !important;
  }

  .docs-tag-clean {
    font-size: 0.7rem;
    color: #a3a3a3;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    border: none !important;
  }

  .docs-model-item p {
    font-size: 0.8rem;
    color: #a3a3a3;
    line-height: 1.55;
    margin: 0;
  }

  /* IDE Grid */
  .docs-ide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .docs-ide-card {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 18px !important;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  .docs-ide-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .docs-ide-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
  }

  .docs-ide-sub {
    font-size: 0.74rem;
    color: #a3a3a3;
    font-family: var(--font-mono);
    background: var(--bg, #1f1f1f);
    padding: 3px 8px;
    border-radius: 6px;
  }

  .docs-step-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.82rem;
    color: #a3a3a3;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .docs-step-list strong {
    color: #ffffff;
    font-weight: 600;
  }

  .docs-step-list code {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #f4f3f0;
    background: var(--bg, #1f1f1f) !important;
    padding: 2px 6px;
    border-radius: 5px;
    border: none !important;
  }

  .docs-substep-list {
    margin: 6px 0 0;
    padding-left: 18px;
    list-style-type: circle;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Failover Flow (Cards without Box Borders) */
  .docs-flow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .docs-flow-item {
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px !important;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .docs-flow-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #282724;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
  }

  .docs-flow-item strong {
    font-size: 0.88rem;
    color: #ffffff;
    font-weight: 600;
  }

  .docs-flow-item p {
    font-size: 0.78rem;
    color: #8b8f9c;
    line-height: 1.55;
    margin: 0;
  }

  /* Responsive Rules */
  @media (max-width: 860px) {
    .docs-wrap {
      padding: 4px 6px 60px;
      gap: 24px;
    }

    .docs-panel {
      padding: 18px 16px !important;
      border-radius: 14px !important;
    }

    .docs-ide-grid,
    .docs-model-cards,
    .docs-flow-grid {
      grid-template-columns: 1fr !important;
      gap: 10px;
    }

    .docs-ide-card {
      padding: 16px !important;
      border-radius: 14px !important;
    }

    .docs-mono-box {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }

    .btn-docs-copy {
      justify-content: center;
    }
  }


  /* ==========================================================================
     GOOGLE FLOW TAB (SUPER CLEAN, SOFT-BLACK BRANDED, FRAMELESS AESTHETIC)
     Modeled after Image Studio, API Keys, and luxury cloud AI dashboards
     ========================================================================== */

  /* Milestone 2D: Google Flow Job Stepper Card */
  .flow-job-card {
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 20px 22px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  .flow-job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .flow-job-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
  }

  .flow-job-id {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a3a3a3;
    background: var(--bg, #1f1f1f);
    padding: 3px 8px;
    border-radius: 6px;
    border: none !important;
  }

  .flow-stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding: 6px 0;
  }

  .flow-step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
  }

  .flow-step-spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
  }

  .flow-step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: var(--bg, #1f1f1f);
    border: none !important;
    color: #a3a3a3;
    transition: all 0.25s ease;
    z-index: 2;
  }

  .flow-step-line {
    width: 2px;
    height: 26px;
    background: rgba(255, 255, 255, 0.06);
    margin: 2px 0;
    transition: background 0.25s ease;
  }

  .flow-step-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 16px;
  }

  .flow-step-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b8f9c;
    transition: color 0.25s ease;
  }

  .flow-step-desc {
    font-size: 0.72rem;
    color: #5d6170;
  }

  /* Stepper States */
  .flow-step-item.completed .flow-step-dot {
    background: #282724 !important;
    color: #ffffff;
  }

  .flow-step-item.completed .flow-step-line {
    background: rgba(255, 255, 255, 0.16);
  }

  .flow-step-item.completed .flow-step-title {
    color: #ffffff;
  }

  .flow-step-item.active .flow-step-dot {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #f4f3f0;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
    animation: flowPulse 2s infinite;
  }

  .flow-step-item.active .flow-step-title {
    color: #f4f3f0;
  }

  .flow-step-item.unknown .flow-step-dot,
  .flow-step-item.failed .flow-step-dot {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #f87171;
  }

  .flow-step-item.unknown .flow-step-title {
    color: #f4f3f0;
  }

  .flow-step-item.failed .flow-step-title {
    color: #f87171;
  }

  @keyframes flowPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(255, 255, 255, 0.3); }
    50% { transform: scale(1.08); box-shadow: 0 0 14px rgba(255, 255, 255, 0.6); }
  }

  .flow-bridge-action-box {
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .flow-bridge-hint {
    font-size: 0.74rem;
    color: #8b8f9c;
    line-height: 1.5;
  }

  .flow-bridge-code-row {
    display: flex;
    align-items: center;
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
  }

  .flow-bridge-code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #38bdf8;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
  }

  .flow-btn-copy-code {
    background: var(--surface-hover, #2e2e2e) !important;
    border: none !important;
    color: #8b8f9c;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .flow-btn-copy-code:hover {
    color: #ffffff;
    background: #333333 !important;
  }

  /* ========================================================
     GOOGLE FLOW SUB-TABS NAVIGATION (Floating Soft-Black Capsule)
     ======================================================== */
  .flow-subtabs-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 5px;
    margin-bottom: 1.5rem;
    max-width: 100%;
    width: max-content;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  }

  .flow-subtabs-nav::-webkit-scrollbar {
    display: none;
  }

  .flow-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    background: transparent;
    border: none !important;
    border-radius: 999px;
    color: #8b8f9c;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
  }

  .flow-subtab-btn:hover {
    color: #ffffff;
    background: var(--surface-hover, #2e2e2e);
  }

  .flow-subtab-btn.active {
    background: #333333 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .subtab-badge {
    background: var(--bg, #1f1f1f);
    color: #8b8f9c;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 1px 7px;
    border-radius: 999px;
    border: none;
  }

  .flow-subtab-btn.active .subtab-badge {
    background: var(--surface, #262626);
    color: #ffffff;
  }

  .badge-subtab-coming {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 0.64rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: none;
  }

  .flow-subtab-panel {
    display: none;
  }

  .flow-subtab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
  }

  /* Overview Grid */
  .flow-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
  }

  /* Frameless Soft-Black Panel Card */
  .flow-panel-card {
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 22px 24px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .flow-panel-card:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3) !important;
  }

  .flow-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2px;
  }

  .flow-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
  }

  .flow-panel-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--surface-hover, #2e2e2e) !important;
    border: none !important;
    border-radius: 8px;
    color: #8b8f9c;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .flow-panel-action-btn:hover {
    background: #282724 !important;
    color: #ffffff;
  }

  .flow-health-list,
  .flow-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Health Item (Recessed Soft-Black Inset) */
  .flow-health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 14px;
    gap: 12px;
    transition: all 0.15s ease;
  }

  .flow-health-item:hover {
    background: var(--surface-hover, #2f2f2f) !important;
  }

  .flow-health-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .flow-health-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .flow-health-sub {
    font-size: 0.72rem;
    color: #717584;
    font-family: var(--font-mono);
  }

  .flow-btn-ghost-sm {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none !important;
    color: #717584;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
  }

  .flow-btn-ghost-sm:hover {
    color: #f4f3f0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
  }

  /* Recent Generation Item (Recessed Soft-Black Inset) */
  .flow-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .flow-recent-item:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    transform: translateY(-1px);
  }

  .flow-recent-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #0d0e11;
    border: none !important;
    object-fit: cover;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .flow-recent-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
  }

  .flow-recent-prompt {
    font-size: 0.82rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .flow-recent-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #717584;
  }

  /* Micro Status Pills - Clean, Soft, Borderless */
  .flow-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: var(--font-sans);
    white-space: nowrap;
    border: none !important;
  }

  .flow-status-pill.ready {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #4ade80 !important;
  }

  .flow-status-pill.busy {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #f4f3f0 !important;
  }

  .flow-status-pill.cooldown {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
  }

  .flow-status-pill.reauth {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
  }

  .flow-status-pill.exhausted {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
  }

  .flow-status-pill.disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #717584 !important;
  }

  .flow-status-pill.completed {
    background: #201f1d !important;
    color: #8b8f9c !important;
  }

  .flow-status-pill.failed {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
  }

  .flow-status-pill.running {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f4f3f0 !important;
  }

  .flow-empty-hint {
    text-align: center;
    color: #717584;
    font-size: 0.8rem;
    padding: 32px 16px;
  }

  /* Frameless Table Card */
  .flow-table-card {
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 18px !important;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  /* Table Modern Elements */
  .flow-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
  }

  .flow-data-table th {
    padding: 14px 18px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #717584;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg, #1f1f1f) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .flow-data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text);
    vertical-align: middle;
  }

  .flow-data-table tr:hover td {
    background: var(--surface-hover, #2e2e2e);
  }

  .badge-r2-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border: none !important;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: 6px;
  }

  /* Video Jobs Coming Soon Card */
  .flow-coming-soon-card {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface, #262626) !important;
    border: none !important;
    border-radius: 18px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22) !important;
  }

  .flow-coming-icon-wrap {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--bg, #1f1f1f);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border: none !important;
  }

  .flow-coming-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
  }

  .flow-coming-desc {
    font-size: 0.8rem;
    color: #a3a3a3;
    line-height: 1.6;
    max-width: 480px;
  }

  .flow-coming-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
  }

  .flow-pill-tag {
    font-size: 0.7rem;
    color: #a3a3a3;
    background: var(--bg, #1f1f1f);
    border: none !important;
    padding: 4px 12px;
    border-radius: 999px;
  }

  /* Activity Timeline */
  .flow-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0;
  }

  .flow-timeline-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .flow-timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg, #1f1f1f);
    border: none !important;
  }

  .flow-timeline-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
  }

  .flow-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .flow-timeline-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
  }

  .flow-timeline-time {
    font-size: 0.7rem;
    color: #717584;
    font-family: var(--font-mono);
  }

  .flow-timeline-desc {
    font-size: 0.75rem;
    color: #8b8f9c;
  }

  /* Flow Job Detail Modal */
  .flow-job-detail-modal {
    max-width: 640px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .flow-detail-preview-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg, #1f1f1f);
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 360px;
    margin-bottom: 1rem;
  }

  #flow-detail-preview-img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    display: block;
  }

  .flow-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: #717584;
    font-size: 0.78rem;
    text-align: center;
  }

  .flow-detail-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
  }

  .flow-detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .flow-detail-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .flow-detail-prompt-box {
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.8rem;
    color: #ffffff;
    line-height: 1.55;
    word-break: break-word;
    user-select: text;
  }

  .flow-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .flow-meta-item {
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .flow-meta-label {
    font-size: 0.68rem;
    color: #717584;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .flow-meta-val {
    font-size: 0.78rem;
    color: #ffffff;
    font-weight: 500;
    word-break: break-all;
  }

  @media (max-width: 600px) {
    .flow-overview-grid {
      grid-template-columns: 1fr !important;
      gap: 12px;
    }
    .flow-panel-card {
      padding: 16px !important;
    }
    .flow-panel-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }
    .flow-panel-title {
      font-size: 0.82rem;
    }
    .flow-recent-item {
      flex-direction: column;
      align-items: flex-start;
      padding: 10px;
      gap: 8px;
    }
    .flow-recent-thumb {
      width: 100%;
      height: 80px;
      border-radius: 8px;
    }
    .flow-recent-info {
      width: 100%;
    }
    .flow-recent-meta {
      flex-wrap: wrap;
      gap: 4px;
    }
    .flow-detail-meta-grid {
      grid-template-columns: 1fr !important;
      gap: 6px;
    }
  }

  /* ==============================================================================
     GOOGLE FLOW TEST STUDIO (PLAYGROUND) STYLING
     ============================================================================== */
  .flow-studio-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  .flow-studio-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .flow-studio-main-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
  }

  .flow-studio-main-desc {
    font-size: 0.78rem;
    color: #8b8f9c;
    margin: 0;
  }

  .flow-studio-type-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface, #262626);
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .flow-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: #8b8f9c;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
  }

  .flow-type-btn.active {
    background: #333333;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }

  .flow-type-badge-beta {
    font-size: 0.62rem;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
  }

  .flow-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  @media (max-width: 900px) {
    .flow-studio-grid {
      grid-template-columns: 1fr;
    }
  }

  .flow-studio-card {
    background: var(--surface, #262626);
    border-radius: 16px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }

  .flow-studio-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .flow-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .flow-form-label {
    font-size: 0.74rem;
    font-weight: 500;
    color: #8b8f9c;
  }

  .flow-form-select {
    width: 100%;
    height: 40px;
    background: var(--bg, #1f1f1f);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    color: #f4f3f0;
    font-size: 0.8rem;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.15s ease;
  }

  .flow-form-select:focus {
    border-color: rgba(255, 255, 255, 0.25);
  }

  .flow-ratio-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .flow-ratio-btn {
    padding: 7px 14px;
    background: var(--bg, #1f1f1f);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #a3a3a3;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .flow-ratio-btn:hover {
    color: #ffffff;
    background: #201f1d;
  }

  .flow-ratio-btn.active {
    background: #2b2a27;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 600;
  }

  .flow-label-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .flow-btn-ghost-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: #8b8f9c;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
  }

  .flow-btn-ghost-sm:hover {
    color: #f4f3f0;
  }

  /* Reference Image Dropzone & Preview Styling */
  .flow-form-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .flow-badge-count {
    background: rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    color: #a1a5b7;
    font-weight: 500;
  }

  .flow-ref-dropzone {
    background: var(--bg, #1f1f1f);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    position: relative;
    user-select: none;
  }

  .flow-ref-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: var(--surface-hover, #2f2f2f);
  }

  .flow-ref-dropzone.dragover {
    border-color: #f4f3f0;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  }

  .flow-ref-dropzone-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .flow-ref-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .flow-ref-text-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .flow-ref-drop-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f4f3f0;
  }

  .flow-ref-drop-subtitle {
    font-size: 0.7rem;
    color: #717584;
  }

  .flow-ref-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
  }

  @media (max-width: 600px) {
    .flow-ref-preview-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .flow-ref-thumb-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0e11;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .flow-ref-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .flow-ref-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
  }

  .flow-ref-thumb-item:hover .flow-ref-thumb-overlay {
    opacity: 1;
  }

  .flow-ref-thumb-remove {
    align-self: flex-end;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
  }

  .flow-ref-thumb-remove:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.08);
  }

  .flow-ref-thumb-name {
    font-size: 0.62rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  }

  .flow-ref-add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    aspect-ratio: 1;
    cursor: pointer;
    color: #8b8f9c;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.02);
  }

  .flow-ref-add-tile:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #f4f3f0;
    background: rgba(255, 255, 255, 0.05);
  }

  .flow-form-textarea {
    width: 100%;
    background: var(--bg, #1f1f1f);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    color: #f4f3f0;
    font-size: 0.82rem;
    padding: 10px 12px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.45;
  }

  .flow-form-textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
  }

  .flow-studio-run-btn {
    width: 100%;
    height: 44px;
    background: #f4f3f0;
    color: #1f1f1f;
    border: none;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    margin-top: 4px;
  }

  .flow-studio-run-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
  }

  .flow-studio-run-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
  }

  /* Live Stepper */
  .flow-live-stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
    background: var(--bg, #1f1f1f);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .flow-stepper-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    opacity: 0.35;
    transition: all 0.2s ease;
  }

  .flow-stepper-stage.active {
    opacity: 1;
  }

  .flow-stage-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-hover, #2e2e2e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b8f9c;
    font-size: 0.7rem;
  }

  .flow-stepper-stage.active .flow-stage-dot {
    background: #ffffff;
    color: #1f1f1f;
  }

  .flow-stage-text {
    font-size: 0.66rem;
    font-weight: 500;
    color: #f4f3f0;
    line-height: 1.25;
  }

  /* Output Display Box */
  .flow-studio-output-container {
    min-height: 280px;
    background: var(--bg, #1f1f1f);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 16px;
    box-sizing: border-box;
  }

  .flow-studio-placeholder {
    text-align: center;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .flow-placeholder-icon-wrap {
    margin-bottom: 4px;
  }

  .flow-placeholder-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #ffffff;
  }

  .flow-placeholder-desc {
    font-size: 0.74rem;
    color: #717584;
    line-height: 1.45;
  }

  /* Generated Media Result */
  .flow-result-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .flow-result-media-box {
    position: relative;
    max-width: 100%;
    max-height: 380px;
    border-radius: 10px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .flow-result-img {
    max-width: 100%;
    max-height: 380px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
  }

  .flow-result-video {
    max-width: 100%;
    max-height: 380px;
    border-radius: 10px;
    outline: none;
  }

  .flow-result-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .flow-result-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #242320;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    font-size: 0.74rem;
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
  }

  .flow-result-action-btn:hover {
    background: #2e2d29;
    color: #ffffff;
  }

  /* Telemetry Accordion */
  .flow-studio-telemetry {
    background: var(--bg, #1f1f1f);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .flow-telemetry-header {
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: var(--surface, #262626);
  }

  .flow-telemetry-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #8b8f9c;
    font-weight: 500;
  }

  .flow-telemetry-body {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
  }

  .flow-telemetry-code {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #a1a1aa;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
  }

  /* ==============================================================================
     GALLERY TAB STYLING (SUPER CLEAN, HIGH PERFORMANCE, ANTI-AI SLOP)
     ============================================================================== */
  .gallery-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Compact Minimalist Toolbar (Matched to User Reference: Pill Search + Circular Filter) */
  .gallery-toolbar {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 0;
    padding: 2px 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: none;
    margin-bottom: 6px;
    position: relative;
    z-index: 40;
  }

  .gallery-toolbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }

  /* Search & Filter Trigger Cluster */
  .gallery-search-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 480px;
  }

  .gallery-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
  }

  .gallery-search-icon {
    position: absolute;
    left: 14px;
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    pointer-events: none;
  }

  .gallery-search-input {
    width: 100%;
    height: 38px;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    padding: 0 34px 0 38px;
    font-size: 0.8rem;
    color: #ffffff;
    font-family: inherit;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery-search-input::placeholder {
    color: var(--text-dim);
    font-size: 0.78rem;
  }

  .gallery-search-input:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
  }

  .gallery-search-input:focus {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none !important;
  }

  .gallery-search-clear-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s ease;
  }

  .gallery-search-clear-btn:hover {
    color: #ffffff;
  }

  /* Circular Filter Trigger Button (Matched to User Reference) */
  .gallery-filter-wrap {
    position: relative;
    display: inline-flex;
  }

  .gallery-filter-trigger-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
  }

  .filter-trigger-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
  }

  .gallery-filter-trigger-btn:hover,
  .gallery-filter-trigger-btn.active {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    box-shadow: none !important;
  }

  .gallery-filter-trigger-btn.has-filter {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: none !important;
  }

  .gallery-filter-active-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f4f3f0;
    box-shadow: none !important;
  }

  /* Luxury Floating Popover Card */
  .gallery-filter-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 290px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
    z-index: 100;
    animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  /* ==========================================================================
     Center Spotlight Command Bar (Apple / Linear / Stripe Premium Quality - Zero Glow, Zero Overlap)
     ========================================================================== */
  .header-center {
    position: relative;
    left: auto;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
    pointer-events: auto;
    z-index: 20;
  }

  .header-gallery-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    justify-content: center;
    min-width: 0;
  }

  /* Linear / Apple Style Search Pill (Exact Theme Match: #262626, Zero Glow, Fluid Max-Width) */
  .header-gallery-cluster .gallery-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 340px;
    min-width: 0;
    flex: 1 1 auto;
    transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-gallery-cluster .gallery-search-wrap:focus-within {
    max-width: 440px;
  }

  .header-gallery-cluster .gallery-search-input {
    width: 100%;
    height: 38px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 0 38px 0 38px;
    font-size: 0.81rem;
    color: #f4f3f0;
    font-family: inherit;
    outline: none;
    box-shadow: none !important;
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  .header-gallery-cluster .gallery-search-input::placeholder {
    color: #a3a3a3;
    font-size: 0.79rem;
    font-weight: 400;
  }

  .header-gallery-cluster .gallery-search-input:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: none !important;
  }

  .header-gallery-cluster .gallery-search-input:focus {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none !important;
  }

  .header-gallery-cluster .gallery-search-icon {
    position: absolute;
    left: 14px;
    width: 14px;
    height: 14px;
    color: #68655e;
    pointer-events: none;
    transition: color 0.18s ease;
  }

  .header-gallery-cluster .gallery-search-wrap:focus-within .gallery-search-icon {
    color: #9d9a93;
  }

  /* Linear-Style Delicate Keyboard Hint (Zero Glow) */
  .gallery-search-kbd-hint {
    position: absolute;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #68655e;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    box-shadow: none !important;
    transition: opacity 0.15s ease;
  }

  .header-gallery-cluster .gallery-search-wrap:focus-within .gallery-search-kbd-hint {
    opacity: 0.25;
  }

  .header-gallery-cluster .gallery-search-clear-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #8b8f9c;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: none !important;
    transition: color 0.15s ease;
  }

  .header-gallery-cluster .gallery-search-clear-btn:hover {
    color: #ffffff;
  }

  /* Circular Filter Trigger Button (Exact Match: #262626, Zero Glow) */
  .header-gallery-cluster .gallery-filter-wrap {
    position: relative;
    display: inline-flex;
  }

  .header-gallery-cluster .gallery-filter-trigger-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #8b8f9c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: none !important;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
  }

  .header-gallery-cluster .filter-trigger-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
  }

  .header-gallery-cluster .gallery-filter-trigger-btn:hover,
  .header-gallery-cluster .gallery-filter-trigger-btn.active {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    box-shadow: none !important;
  }

  .header-gallery-cluster .gallery-filter-trigger-btn.has-filter {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: none !important;
  }

  .header-gallery-cluster .gallery-filter-active-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f4f3f0;
    box-shadow: none !important;
  }



  @keyframes popoverFadeIn {
    from {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .filter-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .filter-popover-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.01em;
  }

  .filter-reset-link {
    background: none;
    border: none;
    color: var(--brand-orange, #ff6b00);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s ease;
  }

  .filter-reset-link:hover {
    opacity: 0.8;
  }

  .filter-popover-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .filter-popover-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .filter-ratio-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .filter-chip {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
  }

  .filter-chip:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .filter-chip.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  .filter-select-wrap {
    position: relative;
    width: 100%;
  }

  .filter-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0 28px 0 12px;
    font-size: 0.76rem;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.16s ease;
  }

  .filter-select:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .filter-select:focus {
    border-color: rgba(255, 255, 255, 0.2);
  }

  .filter-select-chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    color: var(--text-dim);
    pointer-events: none;
  }

  /* Telemetry Indicator & Refresh Button */
  .gallery-counter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  .gallery-counter-pill {
    font-size: 0.76rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
    background: transparent;
    border: none;
    padding: 4px 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
  }

  .gallery-refresh-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery-refresh-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    transform: rotate(45deg);
  }

  /* Smart Waterfall Masonry Grid (4-Column Desktop, 2-Column Mobile, Zero Empty Space) */
  .gallery-grid {
    display: flex !important;
    gap: 16px;
    width: 100%;
    align-items: flex-start;
  }

  .gallery-grid[style*="display: none"],
  .gallery-grid.is-hidden {
    display: none !important;
  }

  .gallery-masonry-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  @media (max-width: 1060px) {
    .gallery-grid {
      gap: 12px;
    }
    .gallery-masonry-col {
      gap: 12px;
    }
    #gallery-loading .gallery-masonry-col:nth-child(n+4) {
      display: none;
    }
  }

  @media (max-width: 680px) {
    .gallery-grid {
      gap: 10px;
    }
    .gallery-masonry-col {
      gap: 10px;
    }
    #gallery-loading .gallery-masonry-col:nth-child(n+3) {
      display: none;
    }
  }

  @media (max-width: 360px) {
    .gallery-grid {
      gap: 8px !important;
    }
    .gallery-masonry-col {
      gap: 8px !important;
    }
    #gallery-loading .gallery-masonry-col:nth-child(n+2) {
      display: none;
    }
    .gallery-card {
      border-radius: 12px !important;
    }
  }

  /* Rounded, Pure-Visual Gallery Card (Big Brand Minimal Luxury) */
  .gallery-card {
    margin-bottom: 0;
    display: block;
    width: 100%;
    background: #121214;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.32);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    user-select: none;
  }

  .gallery-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    z-index: 2;
  }

  /* Pre-allocated Aspect Ratio Container with Shimmer Skeleton (Option 1: Luxury Charcoal & Graphite) */
  .gallery-thumb-container {
    position: relative;
    width: 100%;
    background: linear-gradient(110deg, #121214 15%, #18181b 30%, #242429 45%, #18181b 60%, #121214 85%);
    background-size: 220% 100%;
    animation: galleryShimmer 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    overflow: hidden;
    display: block;
    border-radius: inherit;
    will-change: background-position;
  }

  /* Freeze animation when thumbnail has successfully rendered to conserve GPU */
  .gallery-thumb-container.is-loaded,
  .gallery-thumb-container:has(.gallery-thumb-img.is-loaded) {
    animation: none !important;
    background: #121214;
  }

  @keyframes galleryShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .gallery-thumb-container.ratio-1-1 { aspect-ratio: 1 / 1; }
  .gallery-thumb-container.ratio-4-5 { aspect-ratio: 4 / 5; }
  .gallery-thumb-container.ratio-16-9 { aspect-ratio: 16 / 9; }
  .gallery-thumb-container.ratio-9-16 { aspect-ratio: 9 / 16; }
  .gallery-thumb-container.ratio-4-3 { aspect-ratio: 4 / 3; }
  .gallery-thumb-container.ratio-3-4 { aspect-ratio: 3 / 4; }

  .gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery-thumb-img.is-loaded {
    opacity: 1;
  }

  .gallery-card:hover .gallery-thumb-img.is-loaded {
    transform: scale(1.04);
  }

  /* Broken Image Luxury Fallback (Zero Browser Broken Alt-Text Bleed) */
  .gallery-broken-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    color: var(--text-dim);
    padding: 16px;
    text-align: center;
    border-radius: inherit;
  }

  /* Smooth Cinematic Vignette Glass Overlay (Zero Blur on Artwork) */
  .gallery-card-glass-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 28%, transparent 60%, rgba(0, 0, 0, 0.88) 100%);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    z-index: 5;
    overflow: hidden;
  }

  .gallery-card:hover .gallery-card-glass-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-glass-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-shrink: 0;
    min-width: 0;
  }

  .gallery-glass-ratio {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.03em;
  }

  .gallery-glass-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .gallery-glass-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery-glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
  }

  .gallery-glass-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
  }

  .gallery-glass-prompt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .gallery-glass-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .gallery-glass-model {
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--brand-orange-light);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1px 7px;
    border-radius: 999px;
  }

  /* Skeleton Cards for High Performance Shimmer (Option 1: Luxury Charcoal & Graphite) */
  .gallery-skeleton-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 0;
    display: block;
    width: 100%;
    background: linear-gradient(110deg, #121214 15%, #18181b 30%, #242429 45%, #18181b 60%, #121214 85%);
    background-size: 220% 100%;
    animation: skeleton-shimmer 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: 18px;
    border: 1px solid var(--border);
    will-change: background-position;
  }

  .gallery-skeleton-card.ratio-1-1 { aspect-ratio: 1 / 1; }
  .gallery-skeleton-card.ratio-4-5 { aspect-ratio: 4 / 5; }
  .gallery-skeleton-card.ratio-16-9 { aspect-ratio: 16 / 9; }
  .gallery-skeleton-card.ratio-9-16 { aspect-ratio: 9 / 16; }

  @keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  /* Empty State */
  .gallery-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
  }

  .gallery-empty-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
  }

  .gallery-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
  }

  .gallery-empty-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.5;
  }

  /* Load More Wrap */
  .gallery-pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0;
  }

  /* ==============================================================================
  /* ==============================================================================
     LIGHTBOX FULLSCREEN MODAL (LUXURY SIDE-INSPECTOR STUDIO)
     Aligned with Image Studio Warm Soft-Black Palette & Minimal Luxury Aesthetic
     ============================================================================== */
  html.lightbox-active,
  body.lightbox-active {
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
  }
  html.lightbox-active::-webkit-scrollbar,
  body.lightbox-active::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .gallery-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(31, 31, 31, 0.95);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .gallery-lightbox-overlay::-webkit-scrollbar {
    display: none;
  }

  .gallery-lightbox-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: transparent;
  }

  /* Left: Image Presentation Canvas Stage */
  .lightbox-stage-canvas {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: space-between;
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .lightbox-canvas-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
    width: 100%;
  }

  .lightbox-pill-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    background: rgba(23, 22, 21, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    user-select: none;
  }

  .lightbox-counter {
    font-size: 0.74rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    color: #f4f3f0;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }

  .lightbox-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: inline-block;
    flex-shrink: 0;
    font-size: 0;
    line-height: 0;
  }

  .lightbox-aspect-pill {
    font-size: 0.72rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    color: #9d9a93;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }

  /* Canvas Top Actions: ONLY SHOWN WHEN INSPECTOR IS COLLAPSED */
  .lightbox-canvas-top-actions {
    display: none;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .gallery-lightbox-layout.is-collapsed .lightbox-canvas-top-actions,
  .gallery-lightbox-layout:has(.lightbox-inspector-panel.collapsed) .lightbox-canvas-top-actions {
    display: flex;
  }

  .lightbox-top-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(23, 22, 21, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .lightbox-top-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
    transform: scale(1.05);
  }

  .lightbox-top-icon-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.16);
  }

  /* Main Image Viewport Area */
  .lightbox-stage-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    width: 100%;
  }

  .lightbox-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    pointer-events: auto;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 84px);
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.85);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
  }

  .lightbox-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 31, 31, 0.6);
    z-index: 5;
    border-radius: var(--radius);
  }

  .lightbox-canvas-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(23, 22, 21, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 15;
    opacity: 0.85;
  }

  .lightbox-canvas-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: translateY(-50%) scale(1.06);
    color: #ffffff;
  }

  .lightbox-canvas-nav.prev {
    left: 12px;
  }

  .lightbox-canvas-nav.next {
    right: 12px;
  }

  /* Right: Luxury Side-Inspector Panel (Studio Soft-Black Palette) */
  .lightbox-inspector-panel {
    width: 380px;
    flex-shrink: 0;
    height: 100vh;
    background: var(--surface, #262626);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    z-index: 30;
    overflow: hidden;
  }

  .lightbox-inspector-panel.collapsed {
    width: 0 !important;
    border-left-color: transparent;
    opacity: 0;
    pointer-events: none;
  }

  .inspector-header {
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .inspector-model-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
  }

  .inspector-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .inspector-header-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .inspector-header-icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
  }

  .inspector-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .inspector-scroll-body::-webkit-scrollbar {
    display: none;
  }

  .inspector-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .inspector-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .inspector-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .inspector-action-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
  }

  .inspector-action-link:hover {
    color: var(--text);
    background: var(--surface-hover);
  }

  /* Prompt text - Pure luxury typography, zero border boxes */
  .inspector-prompt-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    word-break: break-word;
    user-select: text;
    cursor: pointer;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: color 0.15s ease;
  }

  .inspector-prompt-text::-webkit-scrollbar {
    display: none;
  }

  .inspector-prompt-text:hover {
    color: #ffffff;
  }

  /* Specs list - Clean Apple / Linear property rows, zero rectangular card frames */
  .inspector-specs-list {
    display: flex;
    flex-direction: column;
  }

  .inspector-spec-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .inspector-spec-item:last-child {
    border-bottom: none;
  }

  .spec-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
  }

  .spec-value {
    font-size: 0.78rem;
    color: var(--text);
    font-weight: 500;
  }

  /* Inspector Footer - Consistently docked at the bottom, clean luxury dock style */
  .inspector-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 16px 20px 20px 20px;
    background: var(--surface, #262626);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
  }

  .btn-inspector-primary {
    width: 100%;
    height: 42px;
    background: var(--text) !important;
    color: var(--bg) !important;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
    border: none;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .btn-inspector-primary:hover {
    background: #ffffff !important;
    color: #0d0d0c !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  }

  .btn-inspector-primary:active {
    transform: translateY(0);
  }

  .inspector-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .btn-inspector-secondary {
    flex: 1;
    height: 38px;
    background: rgba(255, 255, 255, 0.045);
    border: none;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .btn-inspector-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }

  .btn-inspector-secondary:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .btn-inspector-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
  }

  .btn-inspector-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }

  .btn-inspector-icon:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .btn-inspector-icon.danger:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
  }

  /* Fluid Header Controls on Medium & Small Desktop (<= 1120px) */
  @media (max-width: 1120px) {
    #header-btn-gallery-refresh .btn-label-desktop,
    #header-btn-gallery-create .btn-label-desktop {
      display: none !important;
    }

    #header-btn-gallery-refresh,
    #header-btn-gallery-create {
      padding: 0 10px !important;
      min-width: 36px !important;
      height: 36px !important;
      justify-content: center !important;
    }

    .header-gallery-cluster .gallery-search-wrap {
      width: 250px;
    }

    .header-gallery-cluster .gallery-search-wrap:focus-within {
      width: 290px;
    }
  }

  /* Responsive Rules for Small Devices / Mobile (<= 880px) */
  @media (max-width: 880px) {
    .header-center {
      position: static;
      transform: none;
      flex: 1 1 auto;
      display: flex;
      justify-content: center;
      margin: 0 8px;
      min-width: 0;
    }

    .header-gallery-cluster {
      gap: 6px;
      margin-right: 0;
      width: 100%;
      max-width: 440px;
      justify-content: center;
      min-width: 0;
    }

    .header-gallery-cluster .gallery-search-wrap {
      width: 100%;
      max-width: 100%;
      flex: 1 1 auto;
      min-width: 0;
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .header-gallery-cluster .gallery-search-wrap:focus-within {
      max-width: 100%;
    }

    .header-gallery-cluster .gallery-search-input {
      height: 36px;
      padding: 0 28px 0 32px;
      font-size: 0.78rem;
    }

    .header-gallery-cluster .gallery-search-icon {
      left: 10px;
      width: 13px;
      height: 13px;
    }

    .gallery-search-kbd-hint {
      display: none;
    }

    .header-gallery-cluster .gallery-filter-trigger-btn {
      width: 36px;
      height: 36px;
    }

    .header-gallery-cluster .gallery-filter-popover {
      position: fixed;
      top: 60px;
      right: 12px;
      left: 12px;
      width: auto;
      max-width: calc(100vw - 24px);
    }

    .gallery-toolbar {
      padding: 0 0 12px 0;
    }

    .gallery-card {
      margin-bottom: 8px;
    }

    .gallery-lightbox-layout {
      flex-direction: column;
      overflow-y: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .gallery-lightbox-layout::-webkit-scrollbar {
      display: none;
    }

    .lightbox-stage-canvas {
      height: 52vh;
      min-height: 280px;
      padding: 12px 14px;
      flex: none;
    }

    .lightbox-image {
      max-height: calc(52vh - 60px);
    }

    .lightbox-canvas-nav {
      width: 36px;
      height: 36px;
    }

    .lightbox-inspector-panel {
      width: 100% !important;
      height: auto;
      min-height: 48vh;
      border-left: none;
      border-top: 1px solid var(--border);
      flex: 1;
      opacity: 1 !important;
      pointer-events: auto !important;
    }

    #lightbox-inspector-toggle {
      display: none;
    }

    .inspector-header {
      height: 48px;
      padding: 0 14px;
    }

    .inspector-scroll-body {
      padding: 14px;
      gap: 16px;
    }

    .inspector-footer {
      padding: 12px 14px 16px 14px;
      position: sticky;
      bottom: 0;
      background: #171615;
    }
  }

  /* Mobile Clean Optimization (<= 640px) */
  @media (max-width: 640px) {
    /* Hide page title in top-header when gallery tab is active to give full width to search */
    body.tab-gallery-active .header-titles,
    .app-layout:has(#tab-gallery.active) .header-titles {
      display: none !important;
    }

    .header-center {
      margin: 0 4px;
    }

    .header-gallery-cluster {
      max-width: 100%;
    }

    /* Clean Card Overlay on Touch/Mobile Screens (Prompt & Ratio Visible, 100% Sharp Artwork - Zero Blur) */
    .gallery-card-glass-overlay {
      opacity: 1 !important;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, transparent 24%, transparent 64%, rgba(10, 11, 14, 0.88) 100%) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      pointer-events: none !important;
      padding: 8px 10px !important;
    }

    .gallery-glass-top {
      opacity: 0.95;
    }

    .gallery-glass-actions {
      pointer-events: auto !important;
    }

    .gallery-glass-prompt {
      font-size: 0.68rem !important;
      -webkit-line-clamp: 1 !important;
      line-clamp: 1 !important;
      margin-bottom: 2px !important;
    }

    .gallery-glass-ratio {
      font-size: 0.58rem !important;
      padding: 2px 5px !important;
    }

    .gallery-glass-btn {
      width: 26px !important;
      height: 26px !important;
    }

    .gallery-glass-meta-line {
      display: none !important;
    }
  }

  @media (max-width: 480px) {
    .gallery-filters-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      width: 100%;
    }

    .gallery-select-wrap {
      width: 100%;
    }

    .gallery-select {
      width: 100%;
      font-size: 0.74rem;
      padding: 6px 24px 6px 8px;
    }
  }


  /* ==========================================================================
     CHAT & PROMPT HISTORY PAGE (SUPER CLEAN, SOFT-BLACK, FRAMELESS AESTHETIC)
     Consistent with Image Studio, API Keys, Logs, and Accounts tooling
     ========================================================================== */

  .history-page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px 80px;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
  }

  .history-mobile-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffffff;
    cursor: pointer;
    margin-bottom: 4px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.18s ease;
  }

  .history-mobile-menu:hover {
    background: var(--surface-hover, #2f2f2f);
  }

  /* ── Top Toolbar (Frameless Floating Capsules) ───────────────────────── */
  .history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 4px;
    border-bottom: none !important;
  }

  .history-search-wrap {
    position: relative;
    flex: 1;
    min-width: 260px;
    max-width: 440px;
  }

  .history-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color 0.18s ease;
  }

  .history-search-wrap:focus-within .history-search-icon {
    color: var(--brand-orange);
  }

  .history-search-input {
    width: 100%;
    height: 40px;
    padding: 0 38px 0 42px;
    border-radius: 999px !important;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22) !important;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
  }

  .history-search-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
  }

  .history-search-input:focus {
    background: var(--surface-hover, #2f2f2f) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.22) !important;
  }

  .history-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface-hover, #2f2f2f);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .history-search-clear:hover {
    background: #2b2a27;
    color: #ffffff;
  }

  .history-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .history-count-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 7px 15px;
    border-radius: 999px !important;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
  }

  .history-btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 999px !important;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .history-btn-clear:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.16) !important;
  }

  .history-actions-group .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 18px;
    border-radius: 999px !important;
    background: #f4f3f0 !important; border: none !important; color: #1f1f1f !important;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.28) !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .history-actions-group .btn-primary:hover {
    background: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.38) !important;
  }

  /* ── History Feed Container ──────────────────────────────────────────── */
  .history-feed-container {
    display: flex;
    flex-direction: column;
    gap: 26px;
  }

  .history-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 70px 20px;
    color: var(--text-muted);
    font-size: 0.84rem;
  }

  /* ── Group Header (Clean Typographic Section, NO Line Dividers) ──────── */
  .history-group-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .history-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 4px;
    margin-top: 6px;
  }

  .history-group-header::after {
    display: none !important;
    content: none !important;
  }

  /* ── History Grid & Cards (Frameless Soft-Black Surfaces) ────────────── */
  .history-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
  }

  .history-card {
    display: flex;
    gap: 14px;
    padding: 15px;
    background: var(--surface, #262626) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.22) !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
  }

  .history-card:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.36) !important;
  }

  /* ── Card Thumbnail / Icon Wrap ──────────────────────────────────────── */
  .history-thumb-wrap {
    width: 80px;
    height: 80px;
    min-height: 80px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .history-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .history-thumb-wrap:hover .history-thumb-img {
    transform: scale(1.08);
  }

  .history-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
  }

  .history-thumb-wrap:hover .history-thumb-overlay {
    opacity: 1;
  }

  /* ── Card Body & Typography ─────────────────────────────────────────── */
  .history-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
  }

  .history-card-prompt {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f3f4f6;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    cursor: pointer;
    transition: color 0.15s ease;
  }

  .history-card-prompt:hover {
    color: var(--brand-orange) !important;
  }

  /* ── Card Metadata (Capsule Pills, No Borders) ───────────────────────── */
  .history-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.68rem;
    color: var(--text-dim);
  }

  .history-model-pill {
    padding: 3px 9px;
    border-radius: 999px !important;
    background: var(--bg, #1f1f1f) !important;
    color: #f4f3f0 !important;
    border: none !important;
    font-family: inherit !important;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .history-ratio-pill {
    padding: 3px 8px;
    border-radius: 999px !important;
    background: var(--bg, #1f1f1f) !important;
    color: var(--text-dim) !important;
    border: none !important;
    font-family: inherit !important;
    font-size: 0.66rem;
    font-weight: 600;
  }

  /* ── Card Action Buttons (Capsule Pills, Recessed Pad Backgrounds) ───── */
  .history-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 0 !important;
    border-top: none !important;
  }

  .history-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px !important;
    font-size: 0.70rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--bg, #1f1f1f) !important;
    border: none !important;
    color: var(--text-muted) !important;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .history-action-btn:hover {
    background: var(--surface-hover, #2f2f2f) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
  }

  .history-action-btn.primary {
    background: #1e2026 !important;
    color: var(--brand-orange) !important;
  }

  .history-action-btn.primary:hover {
    background: #f4f3f0 !important; color: #1f1f1f !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.28) !important;
  }

  .history-action-btn.danger {
    color: var(--text-dim) !important;
  }

  .history-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #f87171 !important;
  }

  /* ── History Empty State ─────────────────────────────────────────────── */
  .history-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    gap: 16px;
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
    margin-top: 8px;
  }

  .history-empty-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg, #1f1f1f);
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-orange);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }

  .history-empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
  }

  .history-empty-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 440px;
    line-height: 1.55;
    margin: 0;
  }

  /* ── Responsive Mobile Rules ─────────────────────────────────────────── */
  @media (max-width: 768px) {
    .history-page-shell {
      padding: 16px 14px 100px;
      gap: 18px;
    }

    .history-mobile-menu {
      display: flex;
    }

    .history-toolbar {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }

    .history-search-wrap {
      max-width: 100%;
      min-width: 0;
    }

    .history-actions-group {
      justify-content: space-between;
    }

    .history-items-grid {
      grid-template-columns: 1fr;
    }
  }


  /* ============================================================
     AUDIT LOGS & OBSERVABILITY MODULE (IMAGE STUDIO CLEAN & SOFT BLACK)
     Strict Zero-Lines Philosophy: Frameless pads, soft-black surfaces, no box cages.
     ============================================================ */

  /* Section Header */
  .logs-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
    border: none !important;
  }

  .logs-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .logs-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0;
  }

  .logs-header-sub {
    font-size: 0.76rem;
    font-weight: 400;
    color: #8b8f9c;
    margin: 0;
    line-height: 1.4;
  }

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

  /* Auto-refresh & Refresh ghost pills (Image Studio style) */
  .logs-autorefresh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    border-radius: 999px;
    padding: 6px 14px;
    color: #8b8f9c;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .logs-autorefresh-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
  }

  .logs-autorefresh-toggle.active {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
  }

  .pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #606370;
    transition: all 0.2s ease;
  }

  .logs-autorefresh-toggle.active .pulse-indicator {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
    animation: livePulse 1.8s infinite;
  }

  @keyframes livePulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
  }

  .logs-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    border-radius: 999px;
    padding: 6px 14px;
    color: #8b8f9c;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .logs-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateY(-1px);
  }

  /* KPI Metrics Grid (Frameless Soft-Black Pads) */
  .logs-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }

  .logs-metric-card {
    background: var(--surface, #262626);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .logs-metric-card:hover {
    background: var(--surface-hover, #2f2f2f);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .logs-metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .logs-metric-title {
    font-size: 0.67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #a3a3a3);
  }

  .logs-metric-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: #8b8f9c;
    border: none !important;
  }

  .logs-metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .logs-metric-sub {
    font-size: 0.70rem;
    color: var(--text-dim, #737373);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .logs-metric-sub.good {
    color: #4ade80;
  }

  .logs-metric-sub.warn {
    color: #fbbf24;
  }

  /* Floating Capsule Toolbar (Like Image Studio Composer) */
  .logs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    background: var(--surface, #262626);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 999px;
    padding: 6px 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }

  .logs-toolbar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 260px;
  }

  .logs-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
  }

  .logs-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #606370;
    pointer-events: none;
  }

  .logs-search-input {
    width: 100%;
    background: transparent;
    border: none !important;
    outline: none;
    padding: 6px 12px 6px 32px;
    font-size: 0.78rem;
    color: #ffffff;
    font-family: inherit;
    transition: all 0.15s ease;
  }

  .logs-search-input::placeholder {
    color: #606370;
  }

  /* Ghost Segmented Filter Tabs */
  .logs-filter-group {
    display: flex;
    align-items: center;
    background: transparent;
    border: none !important;
    padding: 0;
    gap: 3px;
  }

  .logs-filter-btn {
    background: transparent;
    border: none !important;
    color: #8b8f9c;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
  }

  .logs-filter-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
  }

  .logs-filter-btn.active {
    background: #282724;
    color: #ffffff;
    font-weight: 600;
  }

  .logs-filter-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
  }

  .logs-filter-dot.dot-all { background: #8b8f9c; }
  .logs-filter-dot.dot-2xx { background: #4ade80; }
  .logs-filter-dot.dot-4xx { background: #fbbf24; }
  .logs-filter-dot.dot-5xx { background: #f87171; }

  /* Soft Dropdown Select */
  .logs-model-select {
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    border-radius: 999px;
    color: #8b8f9c;
    font-size: 0.73rem;
    padding: 5px 12px;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
  }

  .logs-model-select:hover,
  .logs-model-select:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .logs-model-select option {
    background: #262626;
    color: #ffffff;
  }

  .logs-toolbar-right {
    display: flex;
    align-items: center;
    padding-right: 6px;
  }

  /* Modern Observability Table (Frameless Canvas, Zero Lines) */
  .logs-table-wrap {
    background: var(--surface, #262626) !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 18px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
  }

  table.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
    border: none !important;
  }

  table.logs-table th {
    background: #1f1f1f !important;
    color: var(--text-muted, #a3a3a3) !important;
    font-size: 0.67rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 14px 18px !important;
    border: none !important;
    white-space: nowrap !important;
  }

  table.logs-table td {
    padding: 14px 18px !important;
    border: none !important;
    color: var(--text) !important;
    vertical-align: middle !important;
    background: transparent;
  }

  table.logs-table tbody tr {
    transition: background 0.12s ease;
    cursor: pointer;
  }

  table.logs-table tbody tr:hover td {
    background: var(--surface-hover, #2f2f2f) !important;
  }

  /* Frameless Status Tags */
  .log-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.70rem;
    font-weight: 600;
    font-family: var(--font-mono);
    line-height: 1.3;
    white-space: nowrap;
    border: none !important;
  }

  .log-status-tag.status-2xx {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
  }

  .log-status-tag.status-4xx {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
  }

  .log-status-tag.status-5xx {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
  }

  .log-status-tag .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
  }

  /* Monospace & Text Typography in Table (Clean, Zero-Lines) */
  .log-mono-id {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: #8b8f9c;
    letter-spacing: -0.01em;
  }

  .log-mono-id:hover {
    color: #ffffff;
  }

  .log-model-name {
    font-weight: 500;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .log-model-sub {
    font-size: 0.67rem;
    color: #606370;
    font-weight: 400;
  }

  .log-latency-cell {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
  }

  .log-tokens-cell {
    font-size: 0.74rem;
    color: #8b8f9c;
    font-feature-settings: "tnum";
  }

  .log-attempt-flow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.70rem;
    font-family: var(--font-mono);
  }

  .log-attempt-step {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #8b8f9c;
    border: none !important;
  }

  .log-attempt-step.step-fail {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
  }

  .log-attempt-step.step-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
  }

  .log-attempt-arrow {
    color: #606370;
    font-size: 0.65rem;
  }

  .log-failover-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: none !important;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-weight: 600;
  }

  .log-ghost-action-btn {
    background: transparent;
    border: none !important;
    color: #8b8f9c;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
  }

  .log-ghost-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  /* Log Inspector Drawer / Modal (Frameless Soft Black - Image Studio Style) */
  .log-detail-modal {
    max-width: 720px;
    width: 90vw;
    background: #262626 !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07)) !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85) !important;
  }

  .log-detail-section {
    margin-bottom: 16px;
  }

  .log-detail-section-title {
    font-size: 0.69rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #a3a3a3);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .log-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .log-detail-cell {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .log-detail-cell-label {
    font-size: 0.67rem;
    color: var(--text-dim, #737373);
  }

  .log-detail-cell-value {
    font-size: 0.78rem;
    color: #ffffff;
    font-weight: 500;
    word-break: break-all;
  }

  .log-detail-cell-value.mono {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted, #a3a3a3);
  }

  /* Error banner in inspector */
  .log-error-banner {
    background: rgba(239, 68, 68, 0.09);
    border: none !important;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
  }

  .log-error-code {
    font-size: 0.72rem;
    font-weight: 700;
    color: #f87171;
    font-family: var(--font-mono);
    margin-bottom: 4px;
  }

  .log-error-text {
    font-size: 0.74rem;
    color: #e2e8f0;
    line-height: 1.4;
    word-break: break-word;
  }

  /* Fallback Stepper in inspector */
  .log-steps-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .log-step-item {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  /* Raw JSON Viewer */
  .log-raw-json-wrap {
    position: relative;
    background: #191919;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 14px;
    padding: 14px 16px;
    max-height: 240px;
    overflow-y: auto;
  }

  .log-raw-json-code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #8b8f9c;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
  }

  .log-raw-json-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: none !important;
    color: #8b8f9c;
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .log-raw-json-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  @media (max-width: 900px) {
    .logs-metrics-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 600px) {
    .logs-header-bar {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
    .logs-header-actions {
      width: 100%;
      justify-content: flex-start;
      flex-wrap: wrap;
    }
    .logs-metrics-grid {
      grid-template-columns: 1fr;
    }
    .logs-toolbar {
      flex-direction: column;
      align-items: stretch;
      border-radius: 16px;
      gap: 10px;
      padding: 10px;
    }
    .logs-toolbar-left {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
      width: 100%;
    }
    .logs-search-wrap {
      max-width: 100%;
      width: 100%;
    }
    .logs-filter-group {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      width: 100%;
      padding-bottom: 2px;
    }
    .logs-model-select {
      width: 100%;
      max-width: 100%;
    }
    .logs-detail-grid {
      grid-template-columns: 1fr;
    }
    .logs-table-wrap {
      border-radius: 12px !important;
      max-width: 100%;
      box-sizing: border-box;
    }
    table.logs-table {
      min-width: 580px;
    }
  }


  /* === DOOZE PLUGINS & INTEGRATIONS HUB (TIER-1 BRAND GRAND SCALE) === */
  .grok-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(8, 8, 7, 0.76) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    z-index: 99999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    box-sizing: border-box !important;
  }
  .grok-modal-backdrop.open {
    display: flex !important;
  }

  .grok-hub-dialog {
    background: #161513;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 28px;
    width: 1060px;
    max-width: 94vw;
    height: 680px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.02);
    position: relative;
    padding: 34px 42px 30px;
    box-sizing: border-box !important;
    animation: grokFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes grokFadeIn {
    from { opacity: 0; transform: scale(0.985) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* Header (Spacious, Zero-line) */
  .grok-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px;
    border-bottom: none !important;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .grok-hub-tabs {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .grok-tab-btn {
    background: transparent;
    border: none;
    color: #7b7871;
    font-size: 15.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    letter-spacing: -0.1px;
    transition: color 0.18s ease;
  }
  .grok-tab-btn:hover { color: #dcd9d2; }
  .grok-tab-btn.active {
    color: #f4f3f0;
    font-weight: 600;
  }

  .grok-hub-actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  /* Grand Search Pill */
  .grok-search-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    border-radius: 9999px;
    padding: 0 18px;
    height: 38px;
    width: 230px;
    transition: background 0.15s ease;
  }
  .grok-search-pill:focus-within {
    background: rgba(255, 255, 255, 0.08);
  }
  .grok-search-pill input {
    background: transparent;
    border: none;
    color: #f4f3f0;
    font-size: 13px;
    outline: none;
    width: 100%;
  }
  .grok-search-pill input::placeholder { color: #6d6a63; }

  .grok-btn-new-connector {
    background: #f4f3f0;
    color: #1f1f1f;
    font-size: 13px;
    font-weight: 600;
    height: 38px;
    padding: 0 20px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s;
  }
  .grok-btn-new-connector:hover { background: #ffffff; transform: scale(1.02); }
  .grok-btn-new-connector:active { transform: scale(0.98); }

  .grok-btn-close-subtle {
    background: transparent;
    border: none;
    color: #726f68;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
  }
  .grok-btn-close-subtle:hover { color: #f4f3f0; background: rgba(255, 255, 255, 0.06); }

  /* Body & Scroll Area (Zero Horizontal Scroll, Ample Right Padding) */
  .grok-hub-body {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    box-sizing: border-box !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  }

  .grok-hub-body::-webkit-scrollbar { width: 5px; }
  .grok-hub-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; }

  .grok-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #f4f3f0;
    margin: 6px 0 14px;
    letter-spacing: -0.1px;
  }

  .grok-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 52px;
    row-gap: 20px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  @media (max-width: 820px) {
    .grok-hub-dialog { padding: 24px 22px; width: 95vw; height: 85vh; border-radius: 20px; }
    .grok-grid-2col { grid-template-columns: 1fr !important; column-gap: 0; row-gap: 16px; }
    .grok-search-pill { width: 140px; }
  }

  .grok-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .grok-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden;
  }

  /* Luxurious Rounded Brand Icon */
  .grok-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .grok-item-icon svg { width: 21px; height: 21px; }

  .grok-item-text {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden;
  }

  .grok-item-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #f4f3f0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Full Non-clipped Description */
  .grok-item-desc {
    font-size: 12.5px;
    color: #8c8982;
    margin-top: 3px;
    line-height: 1.4;
    white-space: normal !important;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100% !important;
  }

  /* Prominent Action Pill Buttons (Never Clipped) */
  .grok-btn-action {
    background: rgba(255, 255, 255, 0.07);
    color: #f4f3f0;
    font-size: 12.5px;
    font-weight: 600;
    height: 33px;
    padding: 0 17px;
    border-radius: 9999px;
    border: none !important;
    cursor: pointer;
    flex-shrink: 0 !important;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    white-space: nowrap !important;
  }
  .grok-btn-action:hover { background: rgba(255, 255, 255, 0.13); color: #ffffff; }

  .grok-btn-action.is-active {
    background: rgba(240, 123, 56, 0.14);
    color: #fb923c;
  }
  .grok-btn-action.is-active:hover { background: rgba(240, 123, 56, 0.22); }

  .grok-btn-action.is-config {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
  }
  .grok-btn-action.is-config:hover { background: rgba(255, 255, 255, 0.18); }

  .grok-btn-action.is-upcoming {
    background: transparent !important;
    color: #55524b !important;
    cursor: default !important;
    font-weight: 500;
  }

  /* Seamless Config Drawer */
  .plugin-config-drawer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #161513;
    border-radius: 28px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 34px 42px;
    animation: grokFadeIn 0.16s ease;
  }
  .plugin-config-header { display: flex; align-items: center; justify-content: space-between; border-bottom: none !important; padding-bottom: 20px; }
  .btn-back-hub { display: flex; align-items: center; gap: 8px; background: none; border: none; color: #8e8b84; cursor: pointer; font-size: 13.5px; }
  .btn-back-hub:hover { color: #f4f3f0; }
  .plugin-config-title { font-size: 16.5px; color: #f4f3f0; margin: 0; font-weight: 600; }
  .plugin-config-body { flex: 1; overflow-y: auto; padding: 22px 0; display: flex; flex-direction: column; gap: 18px; }
  .config-field-group { display: flex; flex-direction: column; gap: 8px; }
  .config-field-label { font-size: 13px; font-weight: 500; color: #d4d1c9; }
  .config-field-input { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); color: #f4f3f0; border-radius: 10px; padding: 11px 14px; font-size: 13px; outline: none; }
  .config-field-input:focus { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.07); }
  .config-field-help { font-size: 11.5px; color: #726f68; }
  .plugin-config-footer { display: flex; justify-content: flex-end; gap: 12px; border-top: none !important; padding-top: 18px; }
  .btn-cancel-config { background: none; border: none; color: #8e8b84; cursor: pointer; padding: 8px 16px; font-size: 13px; }
  .btn-save-config { background: #f4f3f0; color: #1f1f1f; border: none; border-radius: 9999px; padding: 9px 22px; font-weight: 600; font-size: 13px; cursor: pointer; }
  .btn-save-config:hover { background: #ffffff; }

  /* Composer Quick Pill - Ghost by default, rounded capsule appears on hover */
  .chat-plugins-wrap { position: relative; display: inline-flex; align-items: center; }
  .chat-plugin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4.5px;
    height: 30px;
    padding: 0 10px;
    border-radius: 9999px;
    background: transparent !important;
    border: 1px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    color: #9fa0a6;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
  }
  .chat-plugin-pill:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff;
    transform: none !important;
  }
  .chat-plugin-pill:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12) !important;
  }
  .chat-plugin-pill.active {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff;
    transform: none;
  }
  .chat-plugin-pill svg,
  .chat-plugin-pill [data-lucide] {
    width: 12.5px;
    height: 12.5px;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.15s ease, color 0.15s ease;
  }
  .chat-plugin-pill.has-active {
    background: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    color: #9fa0a6;
  }
  .chat-plugin-pill.has-active:hover {
    background: rgba(240, 123, 56, 0.14) !important;
    border-color: rgba(240, 123, 56, 0.38) !important;
    color: #ffffff;
  }
  .chat-plugin-pill.has-active:active {
    transform: scale(0.97);
    background: rgba(240, 123, 56, 0.20) !important;
    border-color: rgba(240, 123, 56, 0.48) !important;
  }
  .chat-plugin-pill.has-active.active {
    background: rgba(240, 123, 56, 0.16) !important;
    border-color: rgba(240, 123, 56, 0.42) !important;
    color: #ffffff;
  }
  .chat-plugin-pill.has-active [data-lucide="blocks"],
  .chat-plugin-pill.has-active svg:first-child {
    width: 13px;
    height: 13px;
    stroke-width: 2.2px;
    color: #f07b38 !important;
    stroke: #f07b38 !important;
    opacity: 1 !important;
  }
  .plugin-chevron {
    width: 10.5px;
    height: 10.5px;
    stroke-width: 2.3px;
    opacity: 0.75;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  }
  .chat-plugin-pill:hover .plugin-chevron {
    opacity: 0.95;
  }
  .chat-plugin-pill.active .plugin-chevron {
    transform: rotate(180deg);
    opacity: 1;
  }

  /* === COMPOSER PLUGINS QUICK POPOVER (OPTION B - MATCH COMPOSER THEME) === */
  .plugins-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 284px;
    background: #1e1d1b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px;
    box-shadow: 0 24px 52px -6px rgba(0, 0, 0, 0.95),
                0 8px 24px -3px rgba(0, 0, 0, 0.70) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 12px;
    z-index: 100;
    box-sizing: border-box;
    animation: grokFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .plugins-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px 10px;
    border-bottom: none !important;
  }

  .plugins-popover-title {
    font-size: 11px;
    font-weight: 600;
    color: #9fa0a6;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  .plugins-popover-count {
    font-size: 11px;
    color: #fb923c;
    background: rgba(240, 123, 56, 0.14);
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: -0.1px;
  }

  .plugins-quick-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px 0 6px;
  }

  .quick-plugin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.14s ease;
    user-select: none;
  }

  .quick-plugin-row:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .quick-plugin-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  /* Clean Transparent Icon Container - Zero Background */
  .quick-plugin-icon-box {
    width: 20px;
    height: 20px;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* STRICT 18px SVG LOCK - CLEAN & SHARP WITHOUT BACKGROUND BOX */
  .quick-plugin-icon-box svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
  }

  .quick-plugin-name {
    font-size: 13px;
    font-weight: 500;
    color: #f4f3f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  /* Mini Toggle Switch (Option B - iOS / Linear Style) */
  .quick-toggle-switch {
    width: 32px;
    height: 18px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    position: relative;
    transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    margin-left: 8px;
  }

  .quick-toggle-switch .quick-toggle-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }

  .quick-toggle-switch.is-active {
    background: #f07b38;
  }

  .quick-toggle-switch.is-active .quick-toggle-thumb {
    transform: translateX(14px);
  }

  .plugins-popover-footer {
    border-top: none !important;
    padding-top: 6px;
  }

  .btn-manage-plugins {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #9fa0a6;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-manage-plugins:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  @media (max-width: 768px) {
    .plugins-popover {
      left: auto !important;
      right: -36px !important;
      max-width: calc(100vw - 24px) !important;
      width: min(280px, calc(100vw - 24px)) !important;
    }
  }


  /* === DOOZE IN-CHAT ACTION CARDS & CLEAN TOOL BADGES (TIER-1 BRAND STANDARD) === */
  .chat-plugin-slot {
    margin: 8px 0 6px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .chat-plugin-slot:empty {
    display: none;
    margin: 0;
  }

  /* ── Clean Borderless Tool Badge / Pill (No Border, No Green Dot, Official Icon Only) ── */
  .plugin-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 12px 0 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
    font-size: 12.5px;
    font-weight: 500;
    color: #e2e0d8;
    letter-spacing: -0.01em;
    width: fit-content;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-shadow: none;
  }
  .plugin-action-pill:hover {
    background: rgba(255, 255, 255, 0.065);
    color: #ffffff;
  }

  /* Running state */
  .plugin-action-pill.is-running {
    color: #e5a00d;
    background: rgba(229, 160, 13, 0.07);
    border: none !important;
    animation: pillSoftPulse 1.6s ease-in-out infinite;
  }
  /* Completed state: Zero border, clean soft ivory/gray text, subtle dark surface */
  .plugin-action-pill.is-done {
    color: #e2e0d8;
    background: rgba(255, 255, 255, 0.04);
    border: none !important;
  }
  /* Error state */
  .plugin-action-pill.is-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.06);
    border: none !important;
  }
  /* Cancelled state */
  .plugin-action-pill.is-cancelled {
    color: #716f68;
    background: rgba(255, 255, 255, 0.02);
    border: none !important;
  }

  /* No green dot / status pulse */
  .plugin-status-pulse {
    display: none !important;
  }

  @keyframes pillSoftPulse {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1; }
  }

  /* ── Ultra-Clean Minimal Action Confirmation Bar (Single Level, No Nested Cards, Tier-1) ──── */
  .plugin-confirm-bar,
  .plugin-confirm-box {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 10px;
    padding: 7px 10px 7px 12px;
    max-width: 440px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: pluginCardSoftEnter 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .plugin-confirm-bar:hover,
  .plugin-confirm-box:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.09);
  }

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

  .plugin-confirm-left {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .plugin-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
  }
  .plugin-brand-icon svg {
    display: block;
    flex-shrink: 0;
  }

  .plugin-confirm-title {
    font-size: 12.5px;
    font-weight: 550;
    color: #f4f3f0;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .plugin-confirm-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Monochromatic Luxury Primary Button (Ivory) */
  .btn-plugin-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 28px;
    padding: 0 12px;
    border-radius: 7px;
    background: #f4f3f0;
    color: #1f1f1f;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
  }
  .btn-plugin-confirm:hover {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(-0.5px);
  }
  .btn-plugin-confirm:active {
    background: #e6e4dc;
    transform: translateY(0);
  }

  /* Refined Ghost Secondary Button */
  .btn-plugin-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    background: transparent;
    color: #8e8b82;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: 1px solid rgba(255, 255, 255, 0.055);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
  }
  .btn-plugin-cancel:hover {
    background: rgba(255, 255, 255, 0.045);
    color: #f4f3f0;
    border-color: rgba(255, 255, 255, 0.12);
  }
  .btn-plugin-cancel:active {
    background: rgba(255, 255, 255, 0.07);
  }

  @media (max-width: 480px) {
    .plugin-confirm-bar,
    .plugin-confirm-box {
      width: 100%;
      flex-wrap: wrap;
      gap: 10px;
    }
  }


  /* Voice Call Modal & HUD (Minimalist Soft-Black Obsidian) */
  .voice-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 9, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .voice-call-overlay.open {
    display: flex !important;
    opacity: 1;
  }

  .voice-call-modal {
    background: #262626;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    min-height: 480px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .voice-call-overlay.open .voice-call-modal {
    transform: scale(1);
  }

  .voice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .voice-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #4ade80;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
  }

  .voice-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #9d9a93;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .voice-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
  }

  /* Center Orb & Waves */
  .voice-modal-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    flex: 1;
    justify-content: center;
  }

  .voice-orb-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
  }

  .voice-orb-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.16) 0%, rgba(74, 222, 128, 0) 70%);
    animation: voiceBreathe 2.4s ease-in-out infinite;
  }

  @keyframes voiceBreathe {
    0% { transform: scale(0.9); opacity: 0.2; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0.9); opacity: 0.2; }
  }

  .voice-orb {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2;
    transition: transform 0.12s ease;
  }

  .voice-wave-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
  }

  .wave-bar {
    width: 3.5px;
    background: #f4f3f0;
    border-radius: 999px;
    transition: height 0.08s ease;
  }

  .wave-bar.bar-1 { height: 12px; }
  .wave-bar.bar-2 { height: 22px; }
  .wave-bar.bar-3 { height: 32px; }
  .wave-bar.bar-4 { height: 20px; }
  .wave-bar.bar-5 { height: 10px; }

  /* Animated Talking Waves */
  .voice-talking .wave-bar {
    animation: waveBounce 0.8s ease-in-out infinite alternate;
  }
  .voice-talking .wave-bar.bar-1 { animation-delay: 0.1s; }
  .voice-talking .wave-bar.bar-2 { animation-delay: 0.25s; }
  .voice-talking .wave-bar.bar-3 { animation-delay: 0.4s; }
  .voice-talking .wave-bar.bar-4 { animation-delay: 0.2s; }
  .voice-talking .wave-bar.bar-5 { animation-delay: 0.05s; }

  @keyframes waveBounce {
    0% { height: 8px; }
    100% { height: 32px; }
  }

  .voice-status-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f4f3f0;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
  }

  .voice-status-sub {
    font-size: 0.82rem;
    color: #9d9a93;
    max-width: 340px;
    line-height: 1.45;
  }

  .voice-transcript-box {
    margin-top: 18px;
    width: 100%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .voice-transcript-bubble {
    font-size: 0.82rem;
    color: #c4c2bb;
    font-style: italic;
    line-height: 1.4;
    word-break: break-word;
  }

  /* Real-time Mic Level Indicator */
  .voice-mic-level-box {
    margin-top: 10px;
    width: 100%;
    max-width: 260px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 6px 10px;
  }

  .voice-mic-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: #9d9a93;
    font-family: var(--font-mono, monospace);
    margin-bottom: 4px;
  }

  .voice-mic-mode-tag {
    font-size: 0.62rem;
    padding: 1px 5px;
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.2);
  }

  .voice-mic-level-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
  }

  .voice-mic-level-bar {
    width: 0%;
    height: 100%;
    background: #4ade80;
    border-radius: 999px;
    transition: width 0.08s ease, background-color 0.15s ease;
  }

  /* Quick Text Fallback Input Bar */
  .voice-fallback-bar {
    width: 100%;
    max-width: 400px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .voice-input-group {
    display: flex;
    align-items: center;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 3px 4px 3px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .voice-input-group:focus-within {
    border-color: rgba(74, 222, 128, 0.35);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
  }

  .voice-modal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f4f3f0;
    font-size: 0.8rem;
    padding: 6px 0;
  }

  .voice-modal-input::placeholder {
    color: var(--text-dim, #737373);
  }

  .voice-modal-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #4ade80;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .voice-modal-send-btn:hover {
    background: rgba(74, 222, 128, 0.22);
    color: #86efac;
  }

  .voice-preset-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .voice-preset-chip {
    font-size: 0.7rem;
    color: #9d9a93;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .voice-preset-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    border-color: rgba(255, 255, 255, 0.15);
  }

  /* Bottom Controls */
  .voice-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .voice-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 48px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .voice-action-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
    transform: translateY(-1px);
  }

  .voice-action-btn.is-speaking {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
  }

  .voice-action-btn.is-recording {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    animation: voiceActionPulse 1.2s infinite alternate;
  }

  @keyframes voiceActionPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  }

  .voice-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f4f3f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .voice-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .voice-control-btn.is-muted {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
  }

  .voice-end-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 44px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
  }

  .voice-end-btn:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
  }

  /* Chat Composer Voice Call Button */
  .chat-voice-call-btn {
    color: #9d9a93;
    transition: all 0.15s ease;
  }
  .chat-voice-call-btn:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
  }


/* Composio Hub Dedicated Page Layout (Warm Monochrome) */
#tab-composio {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 0 40px 0;
}

#tab-composio.active {
  display: block;
}

.comp-hub-header {
  margin-bottom: 22px;
}

.comp-hub-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.comp-hub-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.comp-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 122, 0, 0.09);
  border: none;
  color: #ff7a00;
  box-shadow: none;
  flex-shrink: 0;
}

.comp-hub-copy {
  min-width: 0;
}

.comp-hub-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--text, #f4f3f0);
  font-size: 1.45rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.comp-hub-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  color: var(--text-muted, #a3a3a3);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comp-hub-subtitle {
  margin: 5px 0 0;
  color: var(--text-muted, #a3a3a3);
  font-size: 0.84rem;
  line-height: 1.45;
}

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

.comp-header-btn {
  border: none;
  border-radius: 9px;
  padding: 9px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-header-btn-ghost {
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  color: #d4d4d8;
}

.comp-header-btn-ghost:hover {
  background: var(--surface-hover, #2f2f2f);
  color: #ffffff;
}

.comp-header-btn-primary {
  background: #f4f3f0;
  color: #1f1f1f;
}

.comp-header-btn-primary:hover {
  background: #ffffff;
}

/* Subtabs Segmented Switcher (Frameless) */
.comp-subtabs-nav-wrapper {
  margin-bottom: 18px;
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}

.comp-subtabs-nav-wrapper::-webkit-scrollbar {
  display: none;
}

.comp-subtabs-nav {
  display: inline-flex;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  gap: 2px;
  box-shadow: none;
}

.comp-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted, #9d9a93);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.comp-subtab-btn:hover {
  color: var(--text, #f4f3f0);
  background: var(--surface, #262626);
}

.comp-subtab-btn.active {
  background: var(--surface-hover, #2f2f2f);
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}

.comp-subtab-btn.active .badge-count-pill {
  background: #383838;
  color: #f4f3f0;
}

.comp-subtab-label-short {
  display: none;
}

.comp-subtab-pane {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.comp-subtab-pane.active {
  display: block;
}

/* 4 Metric Stats Panel (Single Frameless Surface) */
.comp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: 16px;
  padding: 18px 8px;
  margin-bottom: 22px;
}

.comp-stat-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: visible;
  transition: none;
}

.comp-stat-card:hover {
  border-color: transparent;
  transform: none;
}

.comp-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #a3a3a3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comp-stat-value {
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--text, #f4f3f0);
  letter-spacing: -0.02em;
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}

.comp-stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim, #737373);
}

.comp-stat-status {
  font-size: 1.05rem;
  color: #4ade80;
}

@media (max-width: 820px) {
  .comp-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 6px;
  }

  .comp-stat-card {
    padding: 6px 14px;
  }
}

@media (max-width: 680px) {
  .comp-hub-header-row {
    flex-direction: column;
    gap: 14px;
  }

  .comp-hub-title {
    font-size: 1.3rem;
  }

  .comp-hub-badge {
    font-size: 0.6rem;
  }

  .comp-header-actions {
    width: 100%;
  }

  .comp-header-btn {
    flex: 1;
  }

  .comp-subtabs-nav-wrapper {
    overflow: visible;
  }

  .comp-subtabs-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
  }

  .comp-subtab-btn {
    justify-content: center;
    padding: 8px 6px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .comp-subtab-label-full {
    display: none;
  }

  .comp-subtab-label-short {
    display: inline;
  }
}

@media (max-width: 480px) {
  .comp-subtabs-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Composio Hub Multi-Account Manager (Warm Monochrome) */
.comp-platforms-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.comp-platform-card {
  background: var(--surface, #262626);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: background 0.18s ease;
  box-shadow: none;
}

.comp-platform-card:hover {
  background: var(--surface-hover, #2f2f2f);
  border-color: rgba(255, 255, 255, 0.09);
}

.comp-platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.comp-platform-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.comp-platform-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-hover, #2f2f2f);
  border: none;
  color: #d4d4d8;
}

.comp-icon-youtube,
.comp-icon-tiktok,
.comp-icon-instagram,
.comp-icon-facebook {
  background: #333333;
  border: none;
  color: #d4d4d8;
}

.comp-platform-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #f4f3f0);
  margin: 0;
  line-height: 1.2;
}

.comp-platform-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-dim, #68655e);
}

.comp-platform-badge-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg, #1f1f1f);
  color: var(--text-muted, #9d9a93);
  border: none;
  flex-shrink: 0;
}

.comp-platform-badge-pill.has-accounts {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.comp-platform-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #9d9a93);
  line-height: 1.5;
  margin: 0 0 14px;
  min-height: 54px;
}

/* Multi-Account List inside Platform Card */
.comp-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  flex: 1;
}

.comp-account-row {
  background: var(--bg, #1f1f1f);
  border: none;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s ease;
}

.comp-account-row:hover {
  background: var(--surface-hover, #2f2f2f);
}

.comp-account-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.comp-account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #333333;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d8;
  font-size: 0.74rem;
  font-weight: 600;
  flex-shrink: 0;
  object-fit: cover;
}

.comp-account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.comp-account-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #f4f3f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-account-handle {
  font-size: 0.7rem;
  color: var(--text-dim, #68655e);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-account-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.comp-btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim, #68655e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-btn-icon-sm:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* Empty State per Platform */
.comp-empty-accounts {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 0;
  text-align: left;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #8b8f9c;
}

/* Add Account Button in Card Footer */
.comp-btn-add-account {
  width: 100%;
  background: #2a2a2a;
  border: none;
  border-radius: 9px;
  padding: 9px 12px;
  color: #e8e7e3;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-btn-add-account:hover {
  background: #333333;
  color: #ffffff;
}

@media (max-width: 1400px) {
  .comp-platforms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .comp-platform-desc {
    min-height: 36px;
  }
}

@media (max-width: 720px) {
  .comp-platforms-grid {
    grid-template-columns: 1fr;
  }

  .comp-platform-card {
    padding: 16px;
  }

  .comp-platform-desc {
    min-height: 0;
  }
}


/* Composio Hub Action Studio Runner (Warm Monochrome) */
.comp-runner-container {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .comp-runner-container {
    grid-template-columns: 1fr;
  }
}

.comp-runner-panel {
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: none;
}

.comp-runner-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #f4f3f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comp-live-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim, #68655e);
}

.comp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comp-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted, #9d9a93);
  letter-spacing: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.comp-label-hint {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim, #68655e);
}

.comp-select,
.comp-input {
  width: 100%;
  background: var(--bg, #1f1f1f);
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text, #f4f3f0);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  color-scheme: dark;
  transition: box-shadow 0.15s ease;
}

.comp-select:focus,
.comp-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(244, 243, 240, 0.14);
}

.comp-textarea {
  width: 100%;
  background: var(--bg, #1f1f1f);
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text, #f4f3f0);
  font-size: 0.76rem;
  font-family: var(--font-mono, monospace);
  outline: none;
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
  transition: box-shadow 0.15s ease;
}

.comp-textarea:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(244, 243, 240, 0.14);
}

.comp-btn-run {
  background: #f4f3f0;
  border: none;
  border-radius: 9px;
  padding: 11px 18px;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
  transition: background 0.15s ease;
}

.comp-btn-run:hover:not(:disabled) {
  background: #ffffff;
  transform: none;
}

.comp-btn-run:active:not(:disabled) {
  background: #e2e0d8;
}

.comp-btn-run:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Console Output Viewer */
.comp-console-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 400px;
}

.comp-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: none;
}

.comp-console-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text, #f4f3f0);
  font-size: 0.84rem;
  font-weight: 600;
}

.comp-console-heading svg {
  color: var(--text-muted, #9d9a93);
}

.comp-console-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-console-duration {
  font-size: 0.7rem;
  color: var(--text-dim, #68655e);
  font-family: var(--font-mono, monospace);
}

.comp-console-status-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #2a2a2a;
  color: var(--text-muted, #a3a3a3);
  border: none;
}

.comp-console-status-pill.success {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.comp-console-status-pill.error {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

.comp-console-body {
  flex: 1;
  background: var(--bg, #1f1f1f);
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  color: #d4d4d8;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 480px;
  margin-top: 4px;
}

.comp-btn-inspect {
  background: #2a2a2a;
  border: none;
  border-radius: 7px;
  color: var(--text-muted, #a3a3a3);
  padding: 4px 9px;
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-btn-inspect:hover {
  background: #333333;
  color: #ffffff;
}


/* Composio Hub Execution History & Enterprise Observability (Warm Monochrome) */

/* 1. KPI Metric Grid */
.comp-log-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .comp-log-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .comp-log-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.comp-log-kpi-card {
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comp-log-kpi-label {
  font-size: 0.72rem;
  font-weight: 550;
  color: var(--text-muted, #9d9a93);
  letter-spacing: 0.02em;
}

.comp-log-kpi-value {
  font-size: 1.45rem;
  font-weight: 650;
  color: var(--text, #f4f3f0);
  font-family: var(--font-mono, monospace);
  line-height: 1.2;
}

.comp-log-kpi-value.text-emerald {
  color: #4ade80;
}

.comp-log-kpi-value.text-rose {
  color: #f87171;
}

.comp-log-kpi-sub {
  font-size: 0.7rem;
  color: var(--text-dim, #68655e);
  margin-top: 2px;
}

/* 2. Main History Panel */
.comp-history-panel {
  background: var(--surface, #262626);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.07));
  border-radius: 16px;
  padding: 20px;
  box-shadow: none;
}

.comp-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.comp-history-title {
  margin: 0;
  color: var(--text, #f4f3f0);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.comp-history-subtitle {
  margin: 4px 0 0;
  color: var(--text-dim, #68655e);
  font-size: 0.76rem;
  line-height: 1.45;
}

.comp-history-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.comp-btn-secondary {
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: var(--text, #f4f3f0);
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.comp-btn-secondary:hover {
  background: var(--surface-hover, #2f2f2f);
  border-color: rgba(255, 255, 255, 0.14);
}

.comp-btn-refresh {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  color: var(--text, #f4f3f0);
  padding: 7px 12px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.comp-btn-refresh:hover {
  background: #333333;
}

/* 3. Toolbar & Filter Controls */
.comp-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.comp-log-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.comp-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim, #68655e);
  pointer-events: none;
}

.comp-log-search-input {
  width: 100%;
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 8px 34px 8px 34px;
  color: var(--text, #f4f3f0);
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comp-log-search-input:focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.comp-search-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim, #68655e);
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
}

.comp-search-clear.active {
  display: flex;
}

.comp-log-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-log-filter-select {
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 7px 11px;
  color: var(--text, #f4f3f0);
  font-size: 0.76rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.comp-log-filter-select:focus {
  border-color: rgba(255, 255, 255, 0.18);
}

/* 4. Table Styling */
.comp-history-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: none;
  background: var(--bg, #1f1f1f);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}

.comp-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  color: var(--text-muted, #9d9a93);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.comp-table td {
  padding: 11px 14px;
  color: var(--text, #f4f3f0);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.comp-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.comp-table tbody tr:hover {
  background: var(--surface-hover, #2a2a2a);
}

.comp-table tbody tr:last-child td {
  border-bottom: none;
}

.comp-table-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-dim, #68655e);
  font-size: 0.8rem;
}

/* Platform Tag Pills */
.comp-platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-transform: uppercase;
}

.comp-platform-tag.youtube {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
}

.comp-platform-tag.tiktok {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.2);
  background: rgba(56, 189, 248, 0.06);
}

.comp-platform-tag.instagram {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.2);
  background: rgba(244, 114, 182, 0.06);
}

.comp-platform-tag.facebook {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(96, 165, 250, 0.06);
}

/* Tool Monospace */
.comp-tool-cell {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: #818cf8;
  font-weight: 550;
  white-space: nowrap;
}

.comp-account-cell {
  font-size: 0.74rem;
  color: var(--text-muted, #9d9a93);
  white-space: nowrap;
}

/* Status Chips with Pulsing Dot */
.comp-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.comp-status-chip .comp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.comp-status-chip.success {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.comp-status-chip.success .comp-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.comp-status-chip.failed {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.comp-status-chip.failed .comp-dot {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
}

.comp-btn-inspect {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  color: var(--text-muted, #a3a3a3);
  padding: 4px 9px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-btn-inspect:hover {
  background: #333333;
  color: #ffffff;
}

/* 5. Table Footer */
.comp-log-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 4px 2px;
  flex-wrap: wrap;
  gap: 10px;
}

.comp-log-counter-label {
  font-size: 0.74rem;
  color: var(--text-dim, #68655e);
}

.comp-log-limit-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-limit-select {
  padding: 4px 8px;
  font-size: 0.72rem;
}

/* 6. Slide-Over Detail Drawer (Stripe style) */
.comp-log-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.comp-log-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.comp-log-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 100vw;
  background: var(--surface, #262626);
  border-left: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.comp-log-drawer.active {
  transform: translateX(0);
}

.comp-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.comp-drawer-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.comp-drawer-tool-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text, #f4f3f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-drawer-id {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--text-dim, #68655e);
}

.comp-drawer-close {
  background: transparent;
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  color: var(--text-dim, #68655e);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.comp-drawer-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comp-drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
}

.comp-drawer-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.comp-drawer-meta-label {
  font-size: 0.68rem;
  color: var(--text-dim, #68655e);
  font-weight: 550;
}

.comp-drawer-meta-val {
  font-size: 0.78rem;
  color: var(--text, #f4f3f0);
  font-family: var(--font-mono, monospace);
}

.comp-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comp-drawer-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #9d9a93);
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-drawer-account-box {
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--text, #f4f3f0);
}

.comp-drawer-error-alert {
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comp-drawer-alert-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 650;
  color: #f87171;
}

.comp-drawer-alert-msg {
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #fca5a5;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.comp-drawer-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.comp-drawer-tab-switchers {
  display: inline-flex;
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.comp-drawer-tab-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-dim, #68655e);
  font-size: 0.72rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.comp-drawer-tab-btn.active {
  background: #2f2f2f;
  color: var(--text, #f4f3f0);
}

.comp-btn-copy-code {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 4px 9px;
  color: var(--text-muted, #9d9a93);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.comp-btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.comp-drawer-code-wrap {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg, #1f1f1f);
  padding: 12px 14px;
  max-height: 280px;
  overflow: auto;
}

.comp-drawer-code {
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #d4d4d8;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.comp-drawer-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
}

/* 7. Upload Pipeline & Stepper Observability */
.comp-drawer-pipeline-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comp-pipeline-video-card {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comp-pipeline-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comp-pipeline-meta-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.comp-pipeline-meta-url {
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim, #68655e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.comp-pipeline-verify-box {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0.02) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comp-pipeline-verify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comp-pipeline-verify-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #f4f3f0;
}

.comp-pipeline-verify-badge {
  font-size: 0.66rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.comp-pipeline-verify-badge.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.comp-pipeline-verify-badge.processing {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.comp-pipeline-verify-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.comp-pipeline-verify-details {
  font-size: 0.72rem;
  color: var(--text-muted, #9d9a93);
  font-family: var(--font-mono, monospace);
}

.comp-btn-verify-poll {
  background: #f4f3f0;
  color: #18181b;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.comp-btn-verify-poll:hover {
  opacity: 0.9;
}

.comp-btn-verify-poll:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comp-pipeline-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  background: var(--bg, #1f1f1f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px 14px;
}

.comp-step-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}

.comp-step-item:last-child {
  padding-bottom: 0;
}

.comp-step-line {
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.comp-step-item:last-child .comp-step-line {
  display: none;
}

.comp-step-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  font-size: 0.75rem;
}

.comp-step-icon-wrap.done {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.comp-step-icon-wrap.processing {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.comp-step-icon-wrap.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.comp-step-icon-wrap.pending {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim, #68655e);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.comp-step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.comp-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.comp-step-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f4f3f0;
}

.comp-step-badge {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
}

.comp-step-badge.done {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.comp-step-badge.processing {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.comp-step-badge.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.comp-step-badge.pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim, #68655e);
}

.comp-step-desc {
  font-size: 0.72rem;
  color: var(--text-dim, #9d9a93);
  line-height: 1.45;
}

.comp-step-meta-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.comp-step-chip {
  font-size: 0.66rem;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
  color: #d4d4d8;
}

.comp-badge-upload {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.comp-badge-upload.feed {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.comp-badge-upload.inbox {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.comp-tool-sub {
  display: block;
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim, #71717a);
  margin-top: 2px;
}

@media (max-width: 600px) {
  .comp-log-drawer {
    width: 100vw;
    border-left: none;
  }
  .comp-drawer-header {
    padding: 14px 16px;
  }
  .comp-drawer-body {
    padding: 14px 16px;
  }
  .comp-drawer-footer {
    padding: 14px 16px;
    flex-direction: column-reverse;
  }
  .comp-drawer-footer button {
    width: 100%;
    justify-content: center;
  }
  .comp-drawer-meta-grid {
    grid-template-columns: 1fr;
  }
}


  /* ============================================================
     TIKTOK AFFILIATE STUDIO (DOOZE ZERO-LINES & SOFT-BLACK THEME)
     Philosophy: Frameless pads, soft-black surfaces, zero box cages,
     high-contrast clean typography, and quiet accents.
     ============================================================ */

  /* 1. Hero Banner */
  .comp-aff-hero {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    box-shadow: none;
  }

  @media (max-width: 900px) {
    .comp-aff-hero {
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
    }
  }

  .comp-aff-hero-content {
    flex: 1;
    min-width: 0;
  }

  .comp-aff-badge-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .comp-aff-tag-shop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: none;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .comp-aff-tag-hybrid {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    border: none;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 500;
  }

  .comp-aff-title {
    font-size: 1.35rem;
    font-weight: 650;
    color: var(--text, #f4f3f0);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .comp-aff-desc {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted, #a3a3a3);
    margin: 0;
    max-width: 680px;
  }

  .comp-aff-desc strong {
    color: #e4e4e7;
    font-weight: 600;
  }

  /* Account Card (Frameless Soft Pad) */
  .comp-aff-account-card {
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
  }

  @media (max-width: 900px) {
    .comp-aff-account-card {
      width: 100%;
      box-sizing: border-box;
    }
  }

  .comp-aff-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .comp-aff-acc-label {
    font-size: 0.68rem;
    color: #71717a;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
  }

  .comp-aff-acc-body {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .comp-aff-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2f2f35;
    color: #f4f3f0;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .comp-aff-acc-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .comp-aff-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f4f3f0;
  }

  .comp-aff-account-select {
    background: transparent;
    border: none;
    padding: 2px 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: #f4f3f0;
    cursor: pointer;
    outline: none;
    width: 100%;
    font-family: inherit;
    color-scheme: dark;
  }

  .comp-aff-account-select:focus {
    box-shadow: none;
  }

  .comp-aff-account-select option {
    background: #1f1f1f;
    color: #f4f3f0;
    padding: 6px;
  }

  .comp-aff-handle {
    font-size: 0.73rem;
    color: #71717a;
    font-family: var(--font-mono, monospace);
  }

  /* 2. Dispatcher Grid (2-Column Clean Layout) */
  .comp-aff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  @media (max-width: 980px) {
    .comp-aff-grid {
      grid-template-columns: 1fr;
    }
  }

  .comp-aff-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* Frameless Main Cards */
  .comp-aff-card {
    background: var(--surface, #262626);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    box-shadow: none;
    box-sizing: border-box;
    width: 100%;
  }

  .comp-aff-card-sub {
    font-size: 0.73rem;
    color: #71717a;
  }

  /* Video Source Switcher (Segmented Frameless Pill) */
  .comp-aff-video-modes {
    display: inline-flex;
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    width: fit-content;
  }

  .comp-aff-vmode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 500;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
  }

  .comp-aff-vmode-btn:hover {
    color: #f4f3f0;
  }

  .comp-aff-vmode-btn.active {
    background: var(--surface-hover, #2f2f2f);
    color: #ffffff;
    font-weight: 600;
    box-shadow: none;
  }

  /* Input Fields & Textareas (Zero Border, Soft Surface) */
  .comp-text-input,
  .comp-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg, #1f1f1f);
    border: none;
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text, #f4f3f0);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    color-scheme: dark;
    transition: box-shadow 0.15s ease;
  }

  .comp-text-input:focus,
  .comp-textarea:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
  }

  .comp-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
  }

  /* Field Labels, Hints & Rows */
  .comp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .comp-field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .comp-field-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: #a1a1aa;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
  }

  .comp-field-sublabel,
  .comp-aff-count,
  .comp-aff-badge-opt {
    font-size: 0.7rem;
    color: #71717a;
    font-weight: 500;
  }

  .comp-field-hint {
    font-size: 0.72rem;
    color: #71717a;
    line-height: 1.45;
    margin-top: 2px;
  }

  /* Video URL Input Wrapper with Paste Button */
  .comp-input-wrapper {
    position: relative;
    width: 100%;
  }

  .comp-btn-paste {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #71717a;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
  }

  .comp-btn-paste:hover {
    color: #ffffff;
  }

  /* Dropzone (Frameless Subtle Canvas) */
  .comp-aff-dropzone {
    background: var(--bg, #1f1f1f);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
  }

  .comp-aff-dropzone:hover {
    background: var(--surface-hover, #2f2f2f);
    border-color: rgba(245, 158, 11, 0.35);
  }

  .comp-dropzone-title {
    font-size: 0.82rem;
    font-weight: 550;
    color: #f4f3f0;
  }

  .comp-dropzone-sub {
    font-size: 0.72rem;
    color: #71717a;
    margin-top: 3px;
  }

  .comp-aff-progress-text {
    font-size: 0.74rem;
    color: #fbbf24;
    margin-top: 4px;
  }

  /* Toggles Section (Frameless, Zero Border Box) */
  .comp-aff-toggles-clean {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
  }

  .comp-aff-section-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: #a1a1aa;
  }

  .comp-aff-toggles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .comp-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.79rem;
    color: #d4d4d8;
    cursor: pointer;
    user-select: none;
  }

  .comp-toggle-row input[type="checkbox"] {
    accent-color: #f59e0b;
    width: 15px;
    height: 15px;
    cursor: pointer;
    border-radius: 4px;
  }

  /* Quick Chips (Templates & Hashtags, Frameless Pill) */
  .comp-aff-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .comp-aff-chips-label {
    font-size: 0.72rem;
    color: #71717a;
    font-weight: 500;
  }

  .comp-aff-chips-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .comp-chip-btn {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.72rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    font-weight: 500;
  }

  .comp-chip-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
  }

  .comp-tag-chip {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #a1a1aa;
    cursor: pointer;
    font-family: var(--font-mono, monospace);
    transition: all 0.15s ease;
  }

  .comp-tag-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
  }

  /* Scheduling Options (Frameless Segmented Options) */
  .comp-aff-schedule-segmented {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .comp-aff-seg-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #d4d4d8;
    cursor: pointer;
    background: var(--bg, #1f1f1f);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    user-select: none;
  }

  .comp-aff-seg-option:hover {
    background: var(--surface-hover, #2f2f2f);
  }

  .comp-aff-seg-option input[type="radio"] {
    accent-color: #f59e0b;
    cursor: pointer;
  }

  /* Launch Primary Button (Dooze Signature High-Contrast White) */
  .comp-btn-launch-affiliate {
    background: #f4f3f0;
    color: #18191d;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.08);
    font-family: inherit;
  }

  .comp-btn-launch-affiliate:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.16);
  }

  .comp-btn-launch-affiliate:active {
    transform: translateY(0);
  }

  .comp-btn-launch-affiliate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  /* Table Refresh Subtle Button */
  .comp-btn-refresh-subtle {
    background: var(--bg, #1f1f1f);
    border: none;
    color: #a1a1aa;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    font-family: inherit;
  }

  .comp-btn-refresh-subtle:hover {
    background: var(--surface-hover, #2f2f2f);
    color: #ffffff;
  }

  /* Table Zero-Lines Styling */
  .comp-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-top: 12px;
  }

  .comp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.80rem;
    border: none;
  }

  .comp-table th {
    background: var(--bg, #1f1f1f);
    color: #8e8e8e;
    font-weight: 600;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .comp-table td {
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text, #f4f3f0);
    font-size: 0.80rem;
    vertical-align: middle;
  }

  .comp-table tr:last-child td {
    border-bottom: none;
  }

  .comp-table tr:hover td {
    background: var(--surface-hover, #2f2f2f);
  }

  .comp-table-empty {
    text-align: center;
    color: #71717a;
    padding: 36px 16px;
    font-size: 0.80rem;
    line-height: 1.5;
  }



@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Full-Screen Pure Studio: Hide top-header & reset shell constraints */
.app-layout:has(#tab-music.active) .top-header,
body.tab-music-active .top-header { display: none !important; }

.app-layout:has(#tab-music.active) .main-shell,
body.tab-music-active .main-shell { background: transparent !important; }

.app-layout:has(#tab-music.active) .content-body,
body.tab-music-active .content-body {
  padding: 0 !important; max-width: 100% !important; width: 100% !important; background: transparent !important;
}

#tab-music.tab-content {
  padding: 0 !important; max-width: 100% !important; width: 100% !important; position: relative; min-height: 100vh;
}

/* Eliminate transform on active tab so position: fixed locks strictly to viewport */
#tab-music.tab-content.active { display: block; animation: none !important; transform: none !important; }

/* 4K Music Studio Ambient 16:9 Wallpaper Backdrop (Fixed to Viewport, Non-Scrolling) */
#tab-music::before {
  content: ""; position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0;
  background-image: 
    linear-gradient(180deg, rgba(8, 9, 13, 0.28) 0%, rgba(6, 7, 10, 0.52) 100%),
    url('/assets/music-wallpaper.webp?v=gargantua-4k');
  background-size: cover; background-position: center center; background-repeat: no-repeat;
  pointer-events: none; opacity: 0; transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform;
}
#tab-music.active::before { opacity: 1; }

.music-workspace-wrap {
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 80px;
  display: flex; flex-direction: column; gap: 22px; min-height: 100vh; position: relative; z-index: 1; box-sizing: border-box;
}

/* Header */
.music-header-clean { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.music-header-title-row { display: flex; align-items: center; gap: 12px; }
.music-header-title {
  font-family: 'Poppins', sans-serif; font-size: 1.35rem; font-weight: 600; color: #ffffff; margin: 0;
  letter-spacing: -0.02em; text-shadow: 0 0 24px rgba(255, 255, 255, 0.45), 0 0 48px rgba(129, 140, 248, 0.25), 0 2px 10px rgba(0, 0, 0, 0.9);
}
.music-engine-tag {
  font-family: 'Poppins', sans-serif; font-size: 0.72rem; font-weight: 600; color: #f4f4f5;
  background: rgba(255, 255, 255, 0.045); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05); padding: 4px 12px; border-radius: 9999px;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.03em;
  box-shadow: 0 0 16px -2px rgba(129, 140, 248, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.engine-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: #a5b4fc; box-shadow: 0 0 8px #a5b4fc; }
.music-credit-pill {
  font-family: 'Poppins', sans-serif; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(18, 19, 25, 0.65); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.04); padding: 6px 14px; border-radius: 9999px;
  cursor: pointer; color: #94949e; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.6), 0 0 20px -4px rgba(255, 255, 255, 0.08);
}
.music-credit-pill:hover {
  background: rgba(24, 25, 34, 0.85); color: #ffffff;
  box-shadow: 0 6px 28px -2px rgba(0, 0, 0, 0.7), 0 0 24px -2px rgba(129, 140, 248, 0.25);
  transform: translateY(-1px);
}
.music-credit-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399, 0 0 18px rgba(52, 211, 153, 0.4); }
.music-credit-num { font-family: 'Poppins', sans-serif; font-size: 0.84rem; font-weight: 600; color: #ffffff; letter-spacing: 0.01em; text-shadow: 0 0 12px rgba(255, 255, 255, 0.3); }
.music-credit-label { font-family: 'Poppins', sans-serif; font-size: 0.72rem; font-weight: 500; color: #94949e; }

/* Sleek custom scrollbar */
.chatgpt-prompt-textarea::-webkit-scrollbar,
.music-composer-drawer textarea::-webkit-scrollbar { width: 4px; height: 4px; }
.chatgpt-prompt-textarea::-webkit-scrollbar-thumb,
.music-composer-drawer textarea::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

@media (max-width: 640px) {
  .music-workspace-wrap { padding: 14px 12px 60px; gap: 14px; }
  .music-header-title { font-size: 1.05rem; white-space: nowrap; }
  .music-credit-pill { padding: 4px 8px; gap: 5px; }
  .music-credit-label { display: none; }
}


/* Unified Studio Card containing Composer + Music Collection */
.music-studio-unified-card {
  background: rgba(18, 19, 25, 0.72); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.025); border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.75); display: flex; flex-direction: column;
}

.music-generator-card, .music-composer-section {
  padding: 22px 24px 10px; display: flex; flex-direction: column; gap: 12px; max-height: 800px; opacity: 1;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.3s ease; overflow: visible;
}
.music-generator-card.is-collapsed, .music-composer-section.is-collapsed {
  max-height: 0 !important; opacity: 0 !important; overflow: hidden !important; pointer-events: none !important; margin: 0 !important; padding: 0 24px !important;
}
.music-suite-divider { display: none !important; }

/* Header & Mode Tabs */
.composer-header-row { display: flex; align-items: center; justify-content: space-between; }
.music-segmented-tabs { display: inline-flex; background: rgba(255, 255, 255, 0.035); padding: 3px; border-radius: 10px; gap: 2px; }
.btn-music-mode {
  background: transparent; border: none; border-radius: 8px; padding: 5px 12px; font-size: 0.76rem;
  font-weight: 500; color: var(--text-dim); cursor: pointer; transition: all 0.15s ease;
}
.btn-music-mode:hover { color: var(--text); }
.btn-music-mode.is-active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.btn-composer-mini-close {
  background: transparent; border: none; color: #71717a; cursor: pointer; padding: 4px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease;
}
.btn-composer-mini-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }

/* Target Banner & Range */
.music-target-banner {
  display: flex; align-items: center; justify-content: space-between; background: rgba(129, 140, 248, 0.08);
  border-radius: 10px; padding: 7px 12px; font-size: 0.74rem; color: #c7d2fe;
}
.music-target-left { display: flex; align-items: center; gap: 8px; }
.music-target-badge { font-weight: 600; text-transform: uppercase; font-size: 0.68rem; color: #818cf8; }
.btn-target-clear { background: transparent; border: none; color: #c7d2fe; cursor: pointer; font-size: 0.8rem; }
.music-replace-range-bar { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--text-dim); }
.range-input { width: 56px; background: rgba(255, 255, 255, 0.05); border: none; border-radius: 6px; color: #fff; padding: 4px 6px; font-size: 0.74rem; text-align: center; }

/* Collapsible Body & ChatGPT / Gemini Style Prompt Capsule */
.composer-collapsible-body { display: flex; flex-direction: column; gap: 12px; }
.chatgpt-input-capsule {
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.035); border-radius: 16px;
  padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; transition: all 0.2s ease;
}
.chatgpt-input-capsule:focus-within {
  background: rgba(255, 255, 255, 0.035); border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.chatgpt-prompt-textarea, .music-studio-textarea {
  width: 100%; min-height: 52px; max-height: 140px; background: transparent; border: none; color: #f4f3f0;
  font-size: 0.88rem; line-height: 1.5; outline: none; resize: none; font-family: inherit;
}
.chatgpt-prompt-textarea::placeholder, .music-studio-textarea::placeholder { color: var(--text-dim); opacity: 0.5; }

.chatgpt-toolbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.chatgpt-toolbar-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-chatgpt-attach, .btn-music-attachment {
  width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); border: none;
  color: #a1a1aa; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s ease;
}
.btn-chatgpt-attach:hover, .btn-music-attachment:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }

.chatgpt-tool-pill {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.035); border: none;
  border-radius: 8px; padding: 5px 10px; font-size: 0.74rem; font-weight: 500; color: #94949e; cursor: pointer; transition: all 0.15s ease;
}
.chatgpt-tool-pill:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }

/* Obsidian Switch Pill */
.chatgpt-switch-pill { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.chatgpt-switch-input { display: none; position: absolute; opacity: 0; pointer-events: none; }
.chatgpt-switch-track {
  width: 26px; height: 15px; background: rgba(255, 255, 255, 0.12); border-radius: 9999px;
  position: relative; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); flex-shrink: 0;
}
.chatgpt-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
  background: #a1a1aa; border-radius: 50%; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.chatgpt-switch-input:checked + .chatgpt-switch-track { background: #6366f1; box-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }
.chatgpt-switch-input:checked + .chatgpt-switch-track .chatgpt-switch-thumb { transform: translateX(11px); background: #ffffff; }

.btn-chatgpt-submit, .btn-music-generate-primary {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 9999px;
  background: #ffffff; color: #09090b; border: none; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}
.btn-chatgpt-submit:hover, .btn-music-generate-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25); }
.btn-chatgpt-submit:active, .btn-music-generate-primary:active { transform: translateY(0); }
.btn-chatgpt-submit:disabled, .btn-music-generate-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Gemini Minimalist Ghost Style Suggestion Chips */
.chatgpt-quick-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-gemini-chip, .btn-style-chip {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 9999px; padding: 4px 11px; font-size: 0.72rem; font-family: 'Poppins', sans-serif;
  color: #94949e; cursor: pointer; transition: all 0.18s ease; backdrop-filter: blur(8px);
}
.btn-gemini-chip:hover, .btn-style-chip:hover {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.1); color: #ffffff; transform: translateY(-1px);
}


  .music-attachment-container { position: relative; }
  .music-attachment-popover {
    position: absolute; top: calc(100% + 8px); left: 0; width: 270px;
    background: rgba(18, 19, 25, 0.96); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px;
    padding: 10px; box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.85), 0 0 24px rgba(129, 140, 248, 0.18); z-index: 100;
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); font-family: 'Poppins', sans-serif;
  }
  .popover-section-label {
    font-size: 0.68rem; font-weight: 600; color: #71717a; padding: 4px 10px 4px;
    text-transform: uppercase; letter-spacing: 0.08em;
  }
  .popover-menu-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px;
    background: transparent; border: none; border-radius: 10px; cursor: pointer;
    text-align: left; transition: all 0.15s ease;
  }
  .popover-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
  .popover-icon-box {
    width: 32px; height: 32px; min-width: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
  }
  .popover-icon-mic { background: rgba(248, 113, 113, 0.14); color: #f87171; }
  .popover-icon-audio { background: rgba(192, 132, 252, 0.14); color: #c084fc; }
  .popover-icon-image { background: rgba(56, 189, 248, 0.14); color: #38bdf8; }
  .popover-title { font-size: 0.82rem; font-weight: 600; color: #ffffff; }
  .popover-desc { font-size: 0.7rem; color: #94949e; margin-top: 1px; line-height: 1.2; }
  .popover-divider { height: 1px; background: rgba(255, 255, 255, 0.04); margin: 6px 0; }
  .music-attachment-pill-wrap { margin-bottom: 8px; }
  .music-attached-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px; font-size: 0.75rem; color: #f4f3f0;
  }
  .pill-badge { padding: 2px 6px; border-radius: 999px; font-size: 0.65rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
  .pill-audio { background: rgba(217, 70, 239, 0.2); color: #e879f9; }
  .pill-image { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
  .pill-thumb { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
  .btn-pill-play {
    background: rgba(255, 255, 255, 0.1); border: none; border-radius: 50%;
    width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
    color: #ffffff; cursor: pointer; padding: 0;
  }
  .btn-pill-remove { background: transparent; border: none; color: #8b8f9c; font-size: 1rem; cursor: pointer; padding: 0 2px; line-height: 1; }
  .btn-pill-remove:hover { color: #ef4444; }


/* Custom Lyrics Wrapper & Panel */
.music-lyrics-wrapper {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
}

.music-lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 8px 0;
  user-select: none;
}

.music-lyrics-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px 0;
}

.music-chips-sm {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.music-chip-sm {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.music-chip-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f4f3f0;
}

.music-chip-template {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.music-lyrics-textarea {
  min-height: 120px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  resize: vertical;
}

.music-lyrics-textarea:focus {
  border-color: rgba(255, 255, 255, 0.1);
  outline: none;
}


/* Advanced Sound Controls */
.music-advanced-wrapper {
  display: flex; flex-direction: column; background: transparent; border: none; font-family: 'Poppins', sans-serif;
}

.music-advanced-panel { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px 0; }
.music-advanced-field { display: flex; flex-direction: column; gap: 6px; }
.music-advanced-field-header { display: flex; align-items: center; justify-content: space-between; }
.music-advanced-input-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.music-input-sm {
  width: 80px; padding: 5px 9px; background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04); border-radius: 8px; color: var(--text);
  font-size: 0.76rem; font-family: 'Poppins', monospace; transition: all 0.15s ease;
}
.music-input-sm:focus { border-color: rgba(255, 255, 255, 0.15); outline: none; background: rgba(255, 255, 255, 0.04); }

.music-chips-row { display: flex; flex-wrap: wrap; gap: 5px; }
.music-chip-sm.is-active {
  background: rgba(129, 140, 248, 0.15); border-color: rgba(129, 140, 248, 0.3); color: #818cf8; font-weight: 500;
}


@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite !important;
  display: inline-block !important;
  transform-origin: center center !important;
}

@keyframes music-pending-shimmer {
  0%, 100% { border-color: rgba(255, 255, 255, 0.05); background: var(--surface-subtle); }
  50% { border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.025); }
}

@keyframes music-soundwave {
  0%, 100% { height: 4px; opacity: 0.35; }
  50% { height: 14px; opacity: 1; }
}

/* Soundwave Equalizer Bars */
.music-soundwave-bars { display: inline-flex; align-items: center; gap: 2.5px; height: 14px; }
.music-soundwave-bar {
  width: 2.5px; height: 6px; background: #f4f3f0; border-radius: 2px;
  animation: music-soundwave 1.1s ease-in-out infinite;
}
.music-soundwave-bar:nth-child(1) { animation-delay: 0.0s; }
.music-soundwave-bar:nth-child(2) { animation-delay: 0.22s; }
.music-soundwave-bar:nth-child(3) { animation-delay: 0.44s; }
.music-soundwave-bar:nth-child(4) { animation-delay: 0.16s; }
.music-soundwave-bar:nth-child(5) { animation-delay: 0.38s; }

/* Generation Pending State Card */
.music-pending-row {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  background: var(--surface-subtle); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px; margin-bottom: 8px; gap: 12px; animation: music-pending-shimmer 2.2s ease-in-out infinite;
}
.music-pending-left { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.music-pending-title { font-size: 0.85rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-pending-subtitle { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.music-pending-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 500;
  color: #f4f3f0; background: rgba(255, 255, 255, 0.08); padding: 4px 10px; border-radius: 6px; flex-shrink: 0;
}

/* Dual-Variation Studio Generation Cards */
.music-pending-container {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; transition: all 0.35s ease;
}
.music-pending-header { display: flex; align-items: center; justify-content: space-between; }
.music-pending-main-badge { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 600; color: #f4f3f0; }
.music-pending-elapsed { font-size: 0.72rem; color: var(--text-dim); }

.music-pending-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .music-pending-grid { grid-template-columns: 1fr; } }

.music-pending-card {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 13px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px; transition: all 0.25s ease;
}
.music-pending-card.is-success {
  border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.04);
}
.music-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.music-card-title-box { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.music-var-tag {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: #818cf8;
  background: rgba(129, 140, 248, 0.12); padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.music-var-title { font-size: 0.78rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-var-status { font-size: 0.7rem; color: var(--text-dim); flex-shrink: 0; }
.music-pending-card.is-success .music-var-status { color: #34d399; font-weight: 600; }

.music-progress-track { width: 100%; height: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden; }
.music-progress-fill { height: 100%; width: 5%; background: linear-gradient(90deg, #818cf8, #38bdf8); transition: width 0.7s ease; }
.music-pending-card.is-success .music-progress-fill { background: #34d399; width: 100% !important; }


.music-docked-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(18, 18, 22, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  margin-top: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.music-player-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 180px; }
.music-player-art {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center; color: var(--text-dim); flex-shrink: 0;
}
.music-player-info { display: flex; flex-direction: column; min-width: 0; }
.music-player-title { font-size: 0.84rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player-sub { font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.music-player-center { display: flex; align-items: center; gap: 12px; flex: 2 1 280px; max-width: 560px; }
.btn-music-play-circle {
  width: 32px; height: 32px; border-radius: 50%; background: #f4f3f0; color: #111; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform 0.15s ease;
}
.btn-music-play-circle:hover { transform: scale(1.05); background: #fff; }

.music-player-scrub-row { display: flex; align-items: center; gap: 8px; flex: 1; }
.music-time-num { font-size: 0.7rem; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 26px; }

.music-scrub-track {
  flex: 1; height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; cursor: pointer; position: relative; overflow: hidden;
}
.music-scrub-track:hover { height: 5px; }
.music-scrub-fill { height: 100%; background: #818cf8; border-radius: 2px; width: 0%; }

.music-player-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; flex: 1 1 120px; justify-content: flex-end; }
.btn-player-icon-action {
  width: 28px; height: 28px; border-radius: 6px; background: transparent; border: none;
  color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s ease;
}
.btn-player-icon-action:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }


.music-clean-feed-container {
  background: rgba(18, 19, 25, 0.72);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.02);
}

.music-feed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.music-feed-nav { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.04); padding: 3px; border-radius: 9px; }
.btn-music-tab-feed {
  background: transparent; border: none; font-size: 0.78rem; font-weight: 500;
  color: var(--text-dim); padding: 5px 12px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: all 0.15s ease;
}
.btn-music-tab-feed:hover { color: var(--text); }
.btn-music-tab-feed.is-active { color: #f4f3f0; background: rgba(255, 255, 255, 0.12); font-weight: 600; }
.music-tab-count { font-size: 0.7rem; color: var(--text-dim); }

.music-tracks-feed {
  display: flex; flex-direction: column; gap: 4px; max-height: 480px; overflow-y: auto; flex: 1; padding-right: 2px;
}
.music-tracks-feed::-webkit-scrollbar { width: 3px; }
.music-tracks-feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }

/* Empty State */
.music-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; min-height: 280px; text-align: center; color: var(--text-dim); gap: 6px; padding: 20px 0;
}
.music-empty-icon {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.035);
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px; color: var(--text-dim);
}
.music-empty-title { font-size: 0.92rem; font-weight: 600; color: #f4f3f0; margin: 0; }
.music-empty-text { font-size: 0.78rem; color: var(--text-dim); max-width: 280px; line-height: 1.5; margin: 0; }

/* Playlist Track Row */
.music-track-row {
  display: flex; align-items: center; justify-content: space-between; padding: 9px 12px;
  border-radius: 10px; background: transparent; cursor: pointer; transition: all 0.15s ease; user-select: none;
}
.music-track-row:hover { background: rgba(255, 255, 255, 0.035); }
.music-track-row.is-active { background: rgba(129, 140, 248, 0.08); }

.music-track-row-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.music-row-play-icon {
  width: 20px; height: 20px; background: transparent; border: none; display: flex; align-items: center;
  justify-content: center; font-size: 0.65rem; color: var(--text-dim); flex-shrink: 0; transition: color 0.15s ease;
}
.music-track-row:hover .music-row-play-icon, .music-track-row.is-active .music-row-play-icon { color: #f4f3f0; }

.music-row-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.music-row-title { font-size: 0.84rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-row-desc { font-size: 0.68rem; color: var(--text-dim); margin-top: 1px; }

.music-row-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.music-row-duration { font-size: 0.72rem; color: var(--text-dim); font-variant-numeric: tabular-nums; margin-right: 4px; }

.btn-music-track-action {
  width: 26px; height: 26px; border-radius: 6px; background: transparent; border: none;
  color: var(--text-dim); display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0.4; transition: all 0.15s ease;
}
.music-track-row:hover .btn-music-track-action { opacity: 0.9; }
.btn-music-track-action:hover { background: rgba(255, 255, 255, 0.08); color: #f4f3f0; opacity: 1; }
.btn-music-track-action.is-video:hover { color: #818cf8; background: rgba(129, 140, 248, 0.12); }


/* Feed Navigation Switcher (Lagu vs Video) */
.music-feed-nav { display: flex; align-items: center; gap: 4px; }
.btn-music-tab-feed {
  background: transparent; border: none; font-size: 0.82rem; font-weight: 500;
  color: var(--text-dim); padding: 4px 10px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: all 0.15s ease;
}
.btn-music-tab-feed:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn-music-tab-feed.is-active { color: #f4f3f0; background: rgba(255, 255, 255, 0.08); font-weight: 600; }
.music-tab-count { font-size: 0.7rem; color: var(--text-dim); font-family: monospace; }
.btn-music-track-action.is-video:hover { color: #818cf8; background: rgba(129, 140, 248, 0.12); }

/* Modal Backdrop & Cards */
.music-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(6px);
  z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.music-modal-card {
  background: rgba(18, 19, 25, 0.95); backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px; width: 100%; max-width: 460px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8); display: flex; flex-direction: column;
  font-family: 'Poppins', sans-serif;
}
.music-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.music-modal-title { font-size: 0.95rem; font-weight: 600; color: #f4f3f0; margin: 0; }
.music-modal-subtitle { font-size: 0.74rem; color: var(--text-dim); margin: 2px 0 0; }
.btn-music-modal-close { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; }
.btn-music-modal-close:hover { color: #f4f3f0; }

.music-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.music-field-label { font-size: 0.72rem; font-weight: 500; color: var(--text-dim); margin-bottom: 4px; display: block; }
.music-modal-track-badge {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; color: #f4f3f0;
}
.music-modal-textarea {
  width: 100%; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px; color: #f4f3f0; padding: 8px 10px; font-size: 0.8rem; outline: none; resize: vertical;
}
.music-modal-textarea:focus { border-color: rgba(255, 255, 255, 0.2); }

.music-modal-options-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.music-ratio-selector { display: flex; gap: 6px; }
.btn-ratio-option {
  flex: 1; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px; padding: 6px 8px; font-size: 0.72rem; color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-ratio-option.is-active { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); color: #f4f3f0; }
.music-modal-toggle-label { display: flex; align-items: center; gap: 6px; margin-top: 4px; cursor: pointer; }
.toggle-text { font-size: 0.74rem; color: var(--text-dim); }

.music-modal-credit-notice { display: flex; align-items: center; gap: 8px; }
.credit-pill { font-size: 0.68rem; background: rgba(99, 102, 241, 0.12); color: #818cf8; padding: 2px 7px; border-radius: 4px; }
.credit-desc { font-size: 0.7rem; color: var(--text-dim); }

.music-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.btn-music-modal-cancel { background: transparent; border: none; color: var(--text-dim); padding: 6px 12px; font-size: 0.78rem; cursor: pointer; font-family: 'Poppins', sans-serif; }
.btn-music-modal-submit {
  background: #f4f3f0; color: #121214; font-weight: 600; border: none; padding: 7px 16px;
  border-radius: 9999px; font-size: 0.78rem; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-family: 'Poppins', sans-serif; transition: all 0.2s ease; box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}
.btn-music-modal-submit:hover { background: #ffffff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25); }

/* Video Player Viewport Lightbox */
.music-video-player-card {
  background: rgba(18, 19, 25, 0.95); backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px; max-width: 600px; width: 100%; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}
.music-player-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.player-modal-title { font-size: 0.8rem; font-weight: 500; color: #f4f3f0; }
.player-modal-actions { display: flex; align-items: center; gap: 8px; }
.btn-player-action { color: var(--text-dim); display: flex; align-items: center; padding: 4px; }
.btn-player-action:hover { color: #f4f3f0; }
.music-video-viewport { width: 100%; max-height: 70vh; background: #000; display: flex; align-items: center; justify-content: center; }
.music-video-viewport video { width: 100%; max-height: 70vh; outline: none; }


/* Legacy compatibility classes */
.music-hero-card { display: none !important; }
.music-chat-container { display: none !important; }


.player-card {
  width: 100%; aspect-ratio: 16 / 9; min-height: 380px; max-height: 520px;
  background: rgba(18, 19, 25, 0.72); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.025); border-radius: 20px; overflow: hidden;
  display: grid; grid-template-columns: 44% 56%; box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.75);
  position: relative; font-family: 'Poppins', sans-serif;
}

.ambient-glow {
  position: absolute; top: -15%; left: -15%; width: 380px; height: 380px;
  background-image: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=400&q=80');
  background-size: cover; background-position: center; filter: blur(80px) saturate(160%); opacity: 0.18; pointer-events: none; z-index: 0;
  transition: opacity 0.8s cubic-bezier(0.2, 0.85, 0.25, 1), transform 0.8s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.player-card.playing .ambient-glow { opacity: 0.32; transform: scale(1.08); }

.track-section {
  position: relative; z-index: 1; padding: 32px 28px; display: flex; flex-direction: column;
  justify-content: space-between; border: none; font-family: 'Poppins', sans-serif;
}

.top-meta { display: flex; align-items: center; justify-content: space-between; }
.format-pill {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
  color: #94949e; background: rgba(255, 255, 255, 0.04); padding: 4px 10px; border-radius: 20px;
}
.visualizer-box { display: flex; align-items: center; gap: 8px; }
.spectrum-canvas { width: 64px; height: 18px; display: block; }

.track-core { display: flex; flex-direction: column; gap: 14px; margin: auto 0; }
.artwork-wrapper {
  position: relative; width: 72px; height: 72px; border-radius: 16px; background: #141417;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 36px -6px rgba(0, 0, 0, 0.6); flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.25, 1), box-shadow 0.6s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.artwork-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.8s; }
.player-card.playing .artwork-wrapper { transform: translateY(-2px); box-shadow: 0 18px 44px -6px rgba(0, 0, 0, 0.75); }
.player-card.playing .artwork-img { transform: scale(1.08); }
.artwork-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.3) 100%); pointer-events: none; }

.track-info { display: flex; flex-direction: column; gap: 3px; }
.track-name {
  font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Poppins', sans-serif;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.2); transition: text-shadow 0.3s ease;
}
.player-card.playing .track-name { text-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 18px rgba(255, 255, 255, 0.2), 0 0 32px rgba(129, 140, 248, 0.25); }
.track-artist { font-size: 12px; color: #94949e; font-weight: 400; letter-spacing: 0.01em; }

.controls-zone { display: flex; flex-direction: column; gap: 14px; }
.scrubber-container { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.scrubber-tooltip {
  position: absolute; top: -26px; left: 0; transform: translateX(-50%) translateY(4px);
  background: rgba(32, 32, 38, 0.95); backdrop-filter: blur(8px); color: #fff;
  font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; padding: 2px 7px;
  border-radius: 10px; pointer-events: none; opacity: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: opacity 0.2s, transform 0.2s; white-space: nowrap;
}
.scrubber-container:hover .scrubber-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.progress-bar {
  position: relative; width: 100%; height: 4px; background: rgba(255, 255, 255, 0.07);
  border-radius: 10px; cursor: pointer; transition: height 0.2s, background 0.2s;
}
.progress-bar:hover { height: 6px; background: rgba(255, 255, 255, 0.12); }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: #ffffff; border-radius: 10px; pointer-events: none; }
.time-readout { display: flex; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; color: #94949e; font-weight: 500; }

.action-row { display: flex; align-items: center; justify-content: space-between; }
.btn-clean {
  background: none; border: none; color: #94949e; cursor: pointer; width: 34px; height: 34px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
}
.btn-clean:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); transform: scale(1.08); }
.btn-clean:active { transform: scale(0.94); }
.btn-clean svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-main-play {
  width: 44px; height: 44px; border-radius: 50%; background: #ffffff; color: #09090b; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  box-shadow: 0 8px 24px -4px rgba(255, 255, 255, 0.2);
}
.btn-main-play:hover { transform: scale(1.08); box-shadow: 0 10px 30px -2px rgba(255, 255, 255, 0.3); }
.btn-main-play:active { transform: scale(0.95); }
.btn-main-play svg { width: 18px; height: 18px; fill: currentColor; }

.volume-group { display: flex; align-items: center; position: relative; }
.volume-slider-wrap { width: 0px; overflow: hidden; opacity: 0; transition: width 0.3s, opacity 0.25s, margin 0.3s; display: flex; align-items: center; }
.volume-group:hover .volume-slider-wrap, .volume-group:focus-within .volume-slider-wrap { width: 62px; opacity: 1; margin-left: 6px; }
.volume-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; outline: none; cursor: pointer; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #ffffff; cursor: pointer; }


.lyrics-section {
  position: relative; z-index: 1; padding: 32px 34px; display: flex; flex-direction: column;
  overflow: hidden; background: transparent; border: none; font-family: 'Poppins', sans-serif;
}

.right-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; z-index: 2; }
.view-toggle { display: inline-flex; background: rgba(255, 255, 255, 0.05); border-radius: 20px; padding: 3px; gap: 2px; }
.toggle-pill {
  background: none; border: none; color: #94949e; font-family: 'Poppins', sans-serif; font-size: 11px;
  font-weight: 500; padding: 4px 12px; border-radius: 16px; cursor: pointer; transition: all 0.25s ease;
}
.toggle-pill.active { background: rgba(255, 255, 255, 0.12); color: #ffffff; font-weight: 600; }
.view-indicator {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
  color: #94949e; background: rgba(255, 255, 255, 0.04); border: none;
  border-radius: 20px; padding: 4px 10px; cursor: pointer; transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
}
.view-indicator:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.sync-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #e4e4e7; opacity: 0.8; box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  transition: all 0.25s ease; flex-shrink: 0;
}
.sync-dot.is-syncing {
  background: #818cf8; box-shadow: 0 0 8px #818cf8; animation: syncPulse 1.2s infinite ease-in-out;
}
@keyframes syncPulse { 0%, 100% { opacity: 0.4; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.3); } }

.lyrics-viewport {
  flex: 1; overflow-y: auto; scroll-behavior: smooth; display: flex; flex-direction: column;
  gap: 18px; padding: 36px 12px 64px 12px; scrollbar-width: none;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 6%, rgba(0,0,0,1) 16%, rgba(0,0,0,1) 84%, rgba(0,0,0,0.4) 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 6%, rgba(0,0,0,1) 16%, rgba(0,0,0,1) 84%, rgba(0,0,0,0.4) 94%, transparent 100%);
}
.lyrics-viewport::-webkit-scrollbar { display: none; }

.lyric-line {
  font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.55;
  color: rgba(255, 255, 255, 0.38); cursor: pointer; padding: 4px 6px; border-radius: 8px; transform: scale(0.98);
  transform-origin: left center; transition: color 0.35s ease, transform 0.35s ease, opacity 0.35s ease, text-shadow 0.35s ease; user-select: none;
}
.lyric-line:hover { color: rgba(255, 255, 255, 0.8); transform: scale(1) translateX(4px); }
.lyric-line.active {
  color: #ffffff; font-weight: 600; font-size: 20px; line-height: 1.5; transform: scale(1.02);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 18px rgba(255, 255, 255, 0.25), 0 0 32px rgba(129, 140, 248, 0.25), 0 0 54px rgba(129, 140, 248, 0.12);
}
.lyric-line.passed { color: rgba(255, 255, 255, 0.22); font-weight: 400; transform: scale(0.97); }

.video-viewport { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; border-radius: 16px; }
.video-ambient-back {
  position: absolute; inset: 6px; background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  filter: blur(24px); opacity: 0.35; pointer-events: none; z-index: 0; transition: opacity 0.5s ease;
}
.player-card.playing .video-ambient-back { opacity: 0.6; }

.video-container {
  position: relative; z-index: 1; width: 100%; height: 100%; min-height: 200px; border-radius: 16px;
  overflow: hidden; background: #09090b; box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.04);
}
.music-video-elem { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.92) contrast(1.15) saturate(0.8); }
.player-card.playing .music-video-elem { filter: brightness(0.96) contrast(1.18) saturate(0.85); transform: scale(1.02); }

.video-cinematic-mask {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 10, 13, 0.6) 0%, transparent 28%, transparent 65%, rgba(10, 10, 13, 0.82) 100%),
              radial-gradient(circle at center, transparent 40%, rgba(9, 9, 11, 0.4) 100%);
}
.video-overlay-info { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 2; }
.video-badge-group { display: flex; align-items: center; gap: 6px; }
.video-badge {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; background: rgba(18, 18, 22, 0.7); backdrop-filter: blur(12px); color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.video-live-tag {
  font-size: 9px; letter-spacing: 0.08em; font-weight: 500; padding: 3px 8px; border-radius: 20px;
  background: rgba(18, 18, 22, 0.7); backdrop-filter: blur(12px); color: #94949e; border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; gap: 5px;
}
.rec-dot { width: 5px; height: 5px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.8); animation: recPulse 1.8s infinite ease-in-out; }
@keyframes recPulse { 0%, 100% { opacity: 0.3; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }
.video-status-tag {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: #94949e;
  background: rgba(18, 18, 22, 0.7); backdrop-filter: blur(12px); padding: 3px 8px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-subtitle-wrapper { position: absolute; bottom: 14px; left: 12px; right: 12px; display: flex; justify-content: center; pointer-events: none; z-index: 2; }
.video-subtitle-pill {
  background: rgba(14, 14, 18, 0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09); padding: 6px 14px; border-radius: 24px; font-size: 12px;
  font-weight: 500; color: #ffffff; text-align: center; max-width: 90%; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.35s ease; opacity: 0.95; font-family: 'Poppins', sans-serif;
}

@media (max-width: 800px) {
  .player-card { aspect-ratio: auto; grid-template-columns: 1fr; max-height: none; }
  .lyrics-viewport { max-height: 220px; padding: 30px 0; }
}


.spectrum-viewport {
  flex: 1; position: relative; display: flex; flex-direction: column;
  justify-content: center; align-items: center; background: transparent;
  box-shadow: none; border: none; min-height: 260px; width: 100%; overflow: hidden;
}

.spectrum-canvas-wrap {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
}

#auraSpectrumCanvas {
  width: 100%; height: 100%; display: block;
}

/* Minimalist Clean Floating Studio Dock - Zero Background */
.spectrum-control-dock {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 4px 8px; background: transparent; border: none; box-shadow: none;
}

.spectrum-mode-capsule {
  display: inline-flex; align-items: center; gap: 12px; background: transparent; padding: 0; border: none;
}

.btn-spectrum-mode {
  background: transparent !important; border: none !important; box-shadow: none !important;
  color: rgba(255, 255, 255, 0.38); font-family: 'Poppins', sans-serif;
  font-size: 0.72rem; font-weight: 500; padding: 2px 4px; cursor: pointer;
  position: relative; transition: color 0.2s ease, text-shadow 0.2s ease;
}
.btn-spectrum-mode:hover { color: rgba(255, 255, 255, 0.85); }
.btn-spectrum-mode.is-active {
  color: #ffffff; font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(129, 140, 248, 0.35);
}
.btn-spectrum-mode.is-active::after {
  content: ''; position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 1.5px; border-radius: 2px; background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.spectrum-theme-capsule {
  display: inline-flex; align-items: center; gap: 7px;
}

.btn-spectrum-theme {
  width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid transparent; cursor: pointer;
  opacity: 0.45; transition: all 0.2s ease; padding: 0; background: transparent;
}
.btn-spectrum-theme:hover { opacity: 0.85; }
.btn-spectrum-theme[data-theme="cyan"] { background: #38bdf8; }
.btn-spectrum-theme[data-theme="gold"] { background: #e5b955; }
.btn-spectrum-theme[data-theme="silver"] { background: #f0f2f5; }
.btn-spectrum-theme.is-active {
  opacity: 1; transform: scale(1.3); border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 8px currentColor;
}

.spectrum-peak-meter {
  font-size: 0.66rem; font-weight: 500; color: rgba(255, 255, 255, 0.38); letter-spacing: 0.04em;
  background: transparent !important; box-shadow: none !important; border: none !important; padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}


.playlist-wrapper {
  background: rgba(18, 19, 25, 0.72);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.025);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.75);
}

.music-studio-unified-card .playlist-wrapper,
.playlist-section-wrap {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 16px 24px 22px !important;
}

.playlist-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.playlist-header-right { display: flex; align-items: center; gap: 12px; }
.playlist-tabs-group { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.035); padding: 3px; border-radius: 10px; border: none; }
.playlist-count { font-size: 11px; color: #94949e; font-weight: 500; letter-spacing: 0.04em; }

.btn-composer-collapse {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.04);
  border: none; border-radius: 20px; padding: 5px 12px; font-size: 0.72rem; font-weight: 500;
  color: #d4d4d8; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; flex-shrink: 0;
}
.btn-composer-collapse:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

@media (max-width: 640px) {
  .playlist-count { display: none; }
  .playlist-section-wrap { padding: 14px 14px 18px !important; }
}

.btn-music-tab-feed {
  background: transparent; border: none; border-radius: 8px; padding: 5px 12px; font-size: 0.76rem;
  font-weight: 500; color: #94949e; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn-music-tab-feed:hover { color: #fff; }
.btn-music-tab-feed.is-active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.music-tab-count { font-size: 0.68rem; opacity: 0.6; }

.playlist-list { display: flex; flex-direction: column; gap: 4px; }
.playlist-items-box { display: flex; flex-direction: column; gap: 4px; }

.track-item {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;
  border-radius: 12px; border: none; cursor: pointer; transition: background 0.2s ease;
  user-select: none;
}
.track-item:hover { background: rgba(255, 255, 255, 0.04); }
.track-item.active { background: rgba(255, 255, 255, 0.07); }

.track-item-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.track-item-num { font-size: 11px; font-weight: 500; color: #484852; width: 18px; text-align: center; flex-shrink: 0; }
.track-item.active .track-item-num { color: #ffffff; font-weight: 600; }

.track-item-thumb {
  width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: #141417; flex-shrink: 0; border: none;
  transition: opacity 0.25s ease;
}
.track-item-thumb.skeleton-thumb {
  background: linear-gradient(90deg, #181922 25%, #252733 50%, #181922 75%);
  background-size: 200% 100%; animation: thumbShimmer 1.5s infinite;
}
@keyframes thumbShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.track-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-family: 'Poppins', sans-serif; }
.track-item-title { font-size: 13px; font-weight: 500; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Poppins', sans-serif; }
.track-item.active .track-item-title { font-weight: 600; text-shadow: 0 0 14px rgba(255, 255, 255, 0.25); }
.track-item-artist { font-size: 11px; color: #94949e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-item-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.track-item-duration { font-size: 11px; font-variant-numeric: tabular-nums; color: #94949e; font-weight: 500; }
.track-item-status { width: 16px; height: 14px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.track-item.active .track-item-status { opacity: 1; }
.mini-bar { width: 2.5px; background: #818cf8; border-radius: 2px; }
.mini-bar.b1 { height: 6px; animation: dzrBar1 0.7s ease-in-out infinite alternate; }
.mini-bar.b2 { height: 12px; animation: dzrBar2 0.5s ease-in-out infinite alternate 0.2s; }
.mini-bar.b3 { height: 8px; animation: dzrBar3 0.6s ease-in-out infinite alternate 0.4s; }
@keyframes dzrBar1 { 0% { height: 3px; } 100% { height: 11px; } }
@keyframes dzrBar2 { 0% { height: 5px; } 100% { height: 14px; } }
@keyframes dzrBar3 { 0% { height: 4px; } 100% { height: 10px; } }

.track-item-actions { display: flex; align-items: center; gap: 2px; }



  .music-accounts-panel {
    background: rgba(18, 17, 16, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(16px);
  }
  .music-accounts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .music-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }
  .music-account-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s ease;
  }
  .music-account-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
  }
  .music-account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .music-acc-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
  }
  .music-acc-email {
    font-size: 0.75rem;
    color: #8b8f9c;
    font-family: var(--font-mono);
  }
  .music-acc-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .music-acc-badge.active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
  .music-acc-badge.cooldown { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
  .music-acc-badge.error { background: rgba(239, 68, 68, 0.15); color: #f87171; }

  .music-acc-credits-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
  }
  .music-acc-credits-label {
    font-size: 0.7rem;
    color: #8b8f9c;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .music-acc-credits-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-mono);
    margin-top: 2px;
  }
  .music-acc-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .music-acc-synced-time {
    font-size: 0.7rem;
    color: #606370;
  }
  .drawer-account-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
  }
  .drawer-account-item:hover { background: rgba(255, 255, 255, 0.06); }


  @media (max-width: 768px) {
    /* iOS Safari Auto-Zoom Fix & High-Precision Inputs */
    .chat-composer-textarea,
    textarea.chat-composer-textarea,
    .music-prompt-input,
    textarea.music-prompt-input,
    #music-prompt,
    #flow-music-prompt,
    input[type="text"],
    input[type="search"],
    textarea,
    select {
      font-size: 16px !important;
      line-height: 1.45 !important;
      -webkit-text-size-adjust: 100% !important;
    }

    /* Floating Composer Capsule - Grok Warm Dark Refinement */
    .chat-composer-container,
    .chat-composer-box {
      border-radius: 24px !important;
      background: #201f1d !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    }

    /* Precision Touch Targets (Min 40px for mobile thumb reach) */
    .chat-tool-btn,
    .btn-clean,
    .player-action-btn,
    .composer-tool-btn {
      min-width: 40px !important;
      min-height: 40px !important;
      touch-action: manipulation !important;
      -webkit-tap-highlight-color: transparent !important;
      border-radius: 50% !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    .btn-main-play {
      min-width: 48px !important;
      min-height: 48px !important;
      touch-action: manipulation !important;
      -webkit-tap-highlight-color: transparent !important;
    }

    .chat-tool-btn:active,
    .btn-clean:active,
    .player-action-btn:active,
    .btn-main-play:active,
    .btn-primary:active {
      transform: scale(0.96) !important;
      transition: transform 0.1s ease !important;
    }

    /* Mobile Bottom Navigation Bar & Safe Area */
    .mobile-bottom-nav {
      padding-bottom: env(safe-area-inset-bottom, 8px) !important;
      touch-action: manipulation !important;
      -webkit-tap-highlight-color: transparent !important;
    }

    .bottom-nav-item {
      min-height: 48px !important;
      touch-action: manipulation !important;
      -webkit-tap-highlight-color: transparent !important;
    }

    /* Bottom Viewport & Scroll Elasticity */
    .content-body,
    .chat-main-area,
    .tab-pane.active {
      padding-bottom: calc(76px + env(safe-area-inset-bottom, 16px)) !important;
      -webkit-overflow-scrolling: touch !important;
    }

    /* Music Player & Scrubber Touch Precision */
    .scrubber-track-container,
    .scrubber-container,
    .music-scrubber-container {
      padding: 10px 0 !important;
      touch-action: none !important;
      cursor: pointer !important;
    }

    .music-track-item,
    .playlist-item {
      min-height: 48px !important;
      padding: 8px 12px !important;
      touch-action: manipulation !important;
    }

    /* Music Studio Generator Toolbar Responsive Wrap */
    .chatgpt-toolbar-inner {
      flex-wrap: wrap !important;
      gap: 8px !important;
    }
  }
