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

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: calc(16px * var(--ui-font-scale, 1) * var(--user-font-scale, 1));
  -webkit-text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}

/* ── THEME TOKENS ─────────────────────────────────────────────── */
:root {
  --font-family: "Inter", "Segoe UI", sans-serif;
  --ui-font-scale: 1;
  --user-font-scale: 1;
  --bg: #212121;
  --bg-sidebar: #171717;
  --bg-elevated: #2f2f2f;
  --bg-input: #2f2f2f;
  --bg-msg-user: #2f2f2f;
  --text: #ececec;
  --text-muted: #8e8ea0;
  --text-faint: #5c5c6b;
  --surface-1: rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.045);
  --surface-raised: #1b1b1b;
  --border: rgba(255,255,255,0.1);
  --border-input: rgba(255,255,255,0.2);
  --workspace-glow: rgba(255,77,103,0.16);
  --accent: #c45454;
  --accent-hover: #ab4545;
  --accent-rgb: 196, 84, 84;
  --accent-deep-rgb: 114, 36, 36;
  --accent-gradient: linear-gradient(135deg, #c45454 0%, #8f3838 100%);
  --accent-gradient-soft: linear-gradient(
    135deg,
    rgba(196, 84, 84, 0.24),
    rgba(196, 84, 84, 0.12)
  );
  --accent-soft-border: rgba(196, 84, 84, 0.22);
  --accent-soft-fill: rgba(196, 84, 84, 0.16);
  --accent-ring: rgba(196, 84, 84, 0.14);
  --accent-radial-soft: radial-gradient(
    circle at top right,
    rgba(196, 84, 84, 0.12),
    transparent 42%
  );
  --send-bg: #ececec;
  --send-fg: #212121;
  --send-disabled: #444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-w: 260px;
  --artifact-w: 44vw;
  --mono: "SF Mono", "Fira Code", Consolas, monospace;
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --topbar-h: 71px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --viewport-top-inset: 0px;
  --resolved-safe-top: max(var(--safe-area-top), var(--viewport-top-inset));
  --resolved-safe-bottom: max(var(--safe-area-bottom), 0px);
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-sidebar: #f9f9f9;
  --bg-elevated: #f4f4f5;
  --bg-input: #ffffff;
  --bg-msg-user: #f4f4f5;
  --surface: var(--surface-raised);
  --surface-1: rgba(15, 23, 42, 0.028);
  --surface-2: rgba(15, 23, 42, 0.05);
  --surface-raised: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --border-input: rgba(0, 0, 0, 0.2);
  --text: #0d0d0d;
  --text-muted: #6b6b80;
  --text-faint: #a0a0b0;
  --workspace-glow: rgba(196, 84, 84, 0.1);
  --send-bg: #0d0d0d;
  --send-fg: #ffffff;
  --send-disabled: #ccc;
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.18);
}

html[data-theme="black"] {
  --bg: #000000;
  --bg-sidebar: #050505;
  --bg-elevated: #0a0a0a;
  --bg-input: #0d0d0d;
  --bg-msg-user: #111111;
  --surface: var(--surface-raised);
  --surface-1: rgba(255, 255, 255, 0.012);
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-raised: #070707;
  --border: rgba(255, 255, 255, 0.12);
  --border-input: rgba(255, 255, 255, 0.22);
  --text: #f4f4f5;
  --text-muted: #9191a4;
  --text-faint: #65657a;
  --workspace-glow: rgba(255, 77, 103, 0.12);
  --send-bg: #f4f4f5;
  --send-fg: #000000;
  --send-disabled: #2f2f2f;
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 44px rgba(0, 0, 0, 0.7);
}

/* ── RESET ───────────────────────────────────────────────────── */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  height: var(--app-height, 100svh);
  overflow: hidden;
  display: flex;
  font-family: var(--font-family, "Inter", "Segoe UI", sans-serif);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.6;
  touch-action: pan-x pan-y;
}

.hidden {
  display: none !important;
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: var(--app-height, 100svh);
  overflow: hidden;
  z-index: 20;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

.sidebar.collapsed {
  transform: translateX(-110%);
  opacity: 0;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(5, 8, 13, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
  }
  .sidebar:not(.collapsed) {
    box-shadow: var(--shadow-lg);
  }
}

.app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: var(--app-height, 100svh);
  overflow: hidden;
}

/* ── SIDEBAR INTERNALS ───────────────────────────────────────── */
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: calc(env(safe-area-inset-top, 0px) + 0.75rem) 0.75rem 0.5rem;
}
.sidebar-close-btn {
  margin-right: auto;
}
.sidebar-close-btn {
  /* ensure fixed-position override doesn't inherit layout margins */
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.new-chat-btn {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.new-chat-btn:hover {
  background: var(--bg-elevated);
}
.new-chat-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-section {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.sidebar-section-label {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 0.35rem;
}
.sidebar-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sidebar-select-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 0.35rem;
}
.sidebar-select {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8ea0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
.sidebar-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sidebar-spacer {
  flex: 1;
}

.chatroom-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.chatroom-list::-webkit-scrollbar {
  width: 6px;
}
.chatroom-list::-webkit-scrollbar-track {
  background: transparent;
}
.chatroom-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
html[data-theme="light"] .chatroom-list {
  scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
}
html[data-theme="light"] .chatroom-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
}
.chatroom-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}
html[data-theme="light"] .chatroom-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.24);
}
.chatroom-list::-webkit-scrollbar-button {
  display: none;
  height: 0;
}

.chatroom-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.chatroom-item:hover {
  background: var(--bg-elevated);
}

.chatroom-item.active {
  background: var(--bg-elevated);
  border-color: var(--border-input);
}

.chatroom-item-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.chatroom-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatroom-item-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.chatroom-item-spinner-logo {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  fill: currentColor;
  color: var(--text-muted);
  animation: sidebarLogoSpin 1.25s linear infinite;
}

@keyframes sidebarLogoSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.sidebar-footer {
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-account-card {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  padding: 0.58rem 0.72rem;
  margin-bottom: 0.3rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.08),
      transparent 38%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-raised) 74%, transparent),
      color-mix(in srgb, var(--bg-elevated) 98%, transparent)
    );
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.sidebar-account-head {
  display: flex;
  align-items: center;
  gap: 0.62rem;
}
.sidebar-account-copy {
  min-width: 0;
  flex: 1;
}
.sidebar-account-kicker {
  display: none;
}
.sidebar-account-name {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.12;
  font-weight: 600;
}
.sidebar-account-email {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.34;
  word-break: break-word;
}
.sidebar-account-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
  background:
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 0.16),
      rgba(var(--accent-deep-rgb), 0.06)
    ),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  flex-shrink: 0;
}
.sidebar-quota-card {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  padding: 0.56rem 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-quota-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
}
.sidebar-quota-label {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sidebar-quota-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.74rem;
}
.sidebar-quota-meter {
  position: relative;
  height: 0.36rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.sidebar-quota-fill {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  transition:
    width 0.22s ease,
    background 0.22s ease;
}
.sidebar-quota-fill-credits {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.22s ease;
}
.sidebar-quota-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.sidebar-quota-fill.danger {
  background: linear-gradient(90deg, #ef4444, #fb7185);
}
.sidebar-quota-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.22;
}
.sidebar-quota-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 0;
}
.sidebar-quota-stat-text {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-quota-stat-credits {
  color: #10b981;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-quota-stat-credits:empty {
  display: none;
}
/* Legacy selectors kept for compat */
.sidebar-quota-summary {
  display: none;
}
.sidebar-quota-secondary-meta {
  display: none;
}
.sidebar-account-actions {
  display: flex;
  gap: 0.38rem;
  align-items: center;
}
.sidebar-account-btn {
  flex: 1 1 0;
  min-height: 2rem;
  padding: 0.5rem 0.72rem;
  border-radius: 10px;
  font-size: 0.82rem;
}
.sidebar-account-ghost {
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.8rem;
}
.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
}
.sidebar-footer-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.sidebar-footer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sidebar-footer-btn.active {
  background: var(--accent-gradient-soft);
  color: var(--text);
}
.sidebar-footer-btn svg {
  flex-shrink: 0;
}
.toolbar-action-btn,
#account-logout-btn,
#settings-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.toolbar-action-btn svg,
#account-logout-btn svg,
#settings-logout-btn svg {
  flex-shrink: 0;
}

.settings-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}

.settings-action-btn:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--border-input);
}

.settings-action-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.settings-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-action-btn svg {
  flex-shrink: 0;
}

.settings-action-btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.settings-action-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #fff;
}

.settings-action-btn--danger {
  border-color: color-mix(in srgb, var(--danger, #ef4444) 42%, var(--border));
  background: color-mix(
    in srgb,
    var(--danger, #ef4444) 10%,
    var(--bg-elevated)
  );
  color: var(--danger, #ef4444);
}

.settings-action-btn--danger:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--danger, #ef4444) 60%, var(--border));
  background: color-mix(
    in srgb,
    var(--danger, #ef4444) 16%,
    var(--bg-elevated)
  );
  color: var(--danger, #ef4444);
}

.sidebar-footer-btn-label {
  min-width: 0;
  white-space: nowrap;
}
.sidebar-btn-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 700;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ── TOP BAR ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--resolved-safe-top) + 0.9rem)
    max(1rem, var(--safe-area-right)) 0.65rem max(1rem, var(--safe-area-left));
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  height: calc(var(--topbar-h) + var(--resolved-safe-top) + 0.25rem);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-settings {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.topbar-select-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.topbar-select {
  min-width: 150px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8ea0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.topbar-model-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.topbar-badge:hover,
.topbar-badge[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border-input);
}

.topbar-badge-text {
  white-space: nowrap;
}

.topbar-badge-chevron {
  color: currentColor;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.topbar-badge[aria-expanded="true"] .topbar-badge-chevron {
  transform: rotate(180deg);
}

.topbar-settings-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 30;
  min-width: 240px;
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(140%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.chatroom-context-menu {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  padding: 0.55rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(140%);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.chatroom-context-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.chatroom-context-menu-item:hover {
  background: var(--bg-elevated);
}

.chatroom-context-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chatroom-context-menu-item:disabled:hover {
  background: transparent;
}

.chatroom-context-menu-item-danger {
  color: #fb7185;
}

.chatroom-context-menu-item-danger:hover {
  background: rgba(251, 113, 133, 0.12);
  color: #ff94a3;
}

.chatroom-context-menu-separator {
  height: 1px;
  margin: 0.2rem 0;
  background: var(--border);
}

.chatroom-action-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.chatroom-action-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.chatroom-action-shell {
  width: min(100%, 460px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: var(--shadow-lg);
  padding: 1.15rem;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease;
}

.chatroom-action-modal.visible .chatroom-action-shell {
  transform: translateY(0) scale(1);
}

.theme-onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 330;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(
      circle at top,
      rgba(var(--accent-rgb), 0.16),
      transparent 28%
    ),
    rgba(5, 8, 13, 0.64);
  backdrop-filter: blur(16px) saturate(138%);
}

.theme-onboarding-shell {
  width: min(100%, 780px);
  max-height: min(92svh, 760px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 28px;
  border: 1px solid
    color-mix(in srgb, var(--border) 86%, rgba(255, 255, 255, 0.08));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-raised) 96%, transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, transparent)
  );
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.28);
  padding: 1.4rem;
}

.theme-onboarding-header {
  text-align: center;
  margin-bottom: 1.15rem;
}

.theme-onboarding-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.theme-onboarding-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.theme-onboarding-copy {
  margin: 0.55rem auto 0;
  max-width: 34rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.theme-onboarding-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-height: 0;
}

.theme-onboarding-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  outline: none;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-onboarding-card:hover,
.theme-onboarding-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.theme-onboarding-card.active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-raised));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.theme-onboarding-preview {
  position: relative;
  height: 7rem;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 20, 0.14);
}

.theme-onboarding-preview-default {
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 77, 103, 0.22),
      transparent 36%
    ),
    linear-gradient(
      180deg,
      var(--theme-preview-surface-top, rgba(34, 36, 42, 0.98)),
      var(--theme-preview-surface-bottom, rgba(18, 20, 26, 0.98))
    );
}

html[data-theme="light"]
  :is(
    .theme-onboarding-preview-default,
    .settings-theme-option-preview-default
  ) {
  --theme-preview-surface-top: color-mix(
    in srgb,
    var(--surface-raised) 98%,
    transparent
  );
  --theme-preview-surface-bottom: color-mix(
    in srgb,
    var(--surface-1) 88%,
    transparent
  );
  --theme-preview-line-color: rgba(15, 23, 42, 0.18);
  --theme-preview-box-bg: #ffffff;
  --theme-preview-box-dark-bg: #000000;
  --theme-preview-box-border: rgba(15, 23, 42, 0.18);
  --theme-preview-box-shadow: rgba(15, 23, 42, 0.16);
  --theme-preview-grid-color: #000000;
}

html[data-theme="dark"]
  :is(
    .theme-onboarding-preview-default,
    .settings-theme-option-preview-default
  ) {
  --theme-preview-surface-top: rgba(34, 36, 42, 0.98);
  --theme-preview-surface-bottom: rgba(18, 20, 26, 0.98);
  --theme-preview-line-color: rgba(255, 255, 255, 0.18);
  --theme-preview-box-bg: #111317;
  --theme-preview-box-dark-bg: #f4f4f5;
  --theme-preview-box-border: rgba(255, 255, 255, 0.18);
  --theme-preview-box-shadow: rgba(255, 255, 255, 0.14);
  --theme-preview-grid-color: #ffffff;
}

html[data-theme="black"]
  :is(
    .theme-onboarding-preview-default,
    .settings-theme-option-preview-default
  ) {
  --theme-preview-surface-top: #0c0c0c;
  --theme-preview-surface-bottom: #000000;
  --theme-preview-line-color: rgba(255, 255, 255, 0.22);
  --theme-preview-box-bg: #050505;
  --theme-preview-box-dark-bg: #f4f4f5;
  --theme-preview-box-border: rgba(255, 255, 255, 0.22);
  --theme-preview-box-shadow: rgba(255, 255, 255, 0.12);
  --theme-preview-grid-color: #ffffff;
}

.theme-preview-chip,
.theme-preview-line,
.theme-preview-box,
.theme-preview-grid {
  position: absolute;
  display: block;
}

.theme-preview-chip {
  top: 1rem;
  left: 1rem;
  width: 4.2rem;
  height: 1rem;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--theme-preview-chip-start, #ff6a6f) 0%,
    var(--theme-preview-chip-mid, #ff4d67) 42%,
    var(--theme-preview-chip-end, #b31239) 100%
  );
}

.theme-preview-line {
  left: 1rem;
  right: 1rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--theme-preview-line-color, rgba(255, 255, 255, 0.18));
}

.theme-preview-line:nth-of-type(2) {
  top: 3.4rem;
}

.theme-preview-line.short {
  top: 5.2rem;
  right: 35%;
}

.theme-onboarding-preview-blocky {
  background: repeating-linear-gradient(
    45deg,
    var(--theme-preview-blocky-stripe-a, #efefef) 0,
    var(--theme-preview-blocky-stripe-a, #efefef) 1.2px,
    var(--theme-preview-blocky-stripe-b, #f9f9f9) 0,
    var(--theme-preview-blocky-stripe-b, #f9f9f9) 50%
  );
  background-size: 12px 12px;
}

html[data-theme="light"]
  :is(.theme-onboarding-preview-blocky, .settings-theme-option-preview-blocky) {
  --theme-preview-blocky-stripe-a: #efefef;
  --theme-preview-blocky-stripe-b: #f9f9f9;
  --theme-preview-grid-color: #000000;
  --theme-preview-box-bg: #ffffff;
  --theme-preview-box-dark-bg: #000000;
  --theme-preview-box-border: #000000;
  --theme-preview-box-shadow: rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"]
  :is(.theme-onboarding-preview-blocky, .settings-theme-option-preview-blocky) {
  --theme-preview-blocky-stripe-a: #1b1b1b;
  --theme-preview-blocky-stripe-b: #0f0f0f;
  --theme-preview-grid-color: #ffffff;
  --theme-preview-box-bg: #111317;
  --theme-preview-box-dark-bg: #f4f4f5;
  --theme-preview-box-border: #ffffff;
  --theme-preview-box-shadow: rgba(255, 255, 255, 0.12);
}

html[data-theme="black"]
  :is(.theme-onboarding-preview-blocky, .settings-theme-option-preview-blocky) {
  --theme-preview-blocky-stripe-a: #111111;
  --theme-preview-blocky-stripe-b: #000000;
  --theme-preview-grid-color: #ffffff;
  --theme-preview-box-bg: #050505;
  --theme-preview-box-dark-bg: #f4f4f5;
  --theme-preview-box-border: #ffffff;
  --theme-preview-box-shadow: rgba(255, 255, 255, 0.12);
}

.theme-preview-grid {
  inset: 0;
  border: 2px solid var(--theme-preview-grid-color, #000000);
  opacity: 0.14;
}

.theme-preview-box {
  left: 1rem;
  top: 1rem;
  width: calc(100% - 2rem);
  height: 2.2rem;
  border: 2px solid var(--theme-preview-box-border, #000000);
  background: var(--theme-preview-box-bg, #ffffff);
  box-shadow: -3px 3px 0 0 var(--theme-preview-box-shadow, rgba(0, 0, 0, 0.16));
}

.theme-preview-box.dark {
  top: 4.4rem;
  width: 38%;
  background: var(--theme-preview-box-dark-bg, #000000);
}

.theme-preview-chip,
.theme-preview-line {
  border-radius: 999px;
}

.theme-preview-box {
  border-radius: 10px;
}

.theme-onboarding-card-copy h3 {
  margin: 0;
  font-size: 1rem;
}

.theme-onboarding-card-copy p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.theme-onboarding-select-btn {
  align-self: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  color: var(--text);
  font-weight: 700;
}

.theme-onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  position: sticky;
  bottom: 0;
  padding-top: 0.85rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0),
    color-mix(in srgb, var(--bg-elevated) 94%, transparent) 32%
  );
}

.theme-onboarding-status {
  margin: 0;
  color: var(--text-muted);
}

.theme-onboarding-confirm {
  flex: 0 0 auto;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(circle at top, rgba(16, 163, 127, 0.12), transparent 32%),
    rgba(5, 8, 13, 0.58);
  backdrop-filter: blur(16px) saturate(135%);
}

.mfa-modal {
  z-index: 345;
}

.mfa-modal .auth-shell {
  width: min(100%, 860px);
  max-height: min(100%, calc(100svh - 1.5rem));
  padding: 1.3rem 1.25rem 1.05rem;
}

.mfa-modal .auth-copy {
  max-width: 42ch;
}

.mfa-modal .auth-footnote {
  max-width: 44ch;
}

.mfa-modal-setup {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 0.95rem;
  margin: 0.8rem auto 0.3rem;
  text-align: left;
}

.mfa-modal-qr {
  display: flex;
  grid-column: 1;
  grid-row: 1 / span 3;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 230px;
  padding: 0.4rem;
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  background: #fff;
}

.mfa-modal-qr-frame {
  position: relative;
  width: min(248px, 100%);
  display: grid;
  place-items: center;
}

.mfa-modal-qr-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
  isolation: isolate;
}

.mfa-modal-qr-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: conic-gradient(
    from 35deg,
    rgba(255, 255, 255, 0.94) 0 12%,
    rgba(255, 255, 255, 0.1) 12% 28%,
    rgba(255, 255, 255, 0.88) 28% 42%,
    rgba(255, 255, 255, 0.08) 42% 66%,
    rgba(255, 255, 255, 0.94) 66% 100%
  );
  opacity: 0.28;
  animation: mfaOrbSpin 20s linear infinite;
}

.mfa-modal-qr-orb-core {
  position: absolute;
  inset: 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(255, 255, 255, 0.12),
      transparent 34%
    ),
    #000;
  border: 3px solid #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.mfa-modal-qr-orb-core svg {
  width: 26px;
  height: 26px;
  display: block;
  transform-box: fill-box;
  transform-origin: center;
  animation: mfaOrbLogoSpin 14s linear infinite;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

html[data-theme="light"] .mfa-modal-qr-orb {
  background: transparent;
}

html[data-theme="light"] .mfa-modal-qr-orb-ring {
  background: conic-gradient(
    from 35deg,
    rgba(10, 10, 10, 0.96) 0 12%,
    rgba(10, 10, 10, 0.1) 12% 28%,
    rgba(10, 10, 10, 0.86) 28% 42%,
    rgba(10, 10, 10, 0.08) 42% 66%,
    rgba(10, 10, 10, 0.96) 66% 100%
  );
}

html[data-theme="light"] .mfa-modal-qr-orb-core {
  color: #111;
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(0, 0, 0, 0.08),
      transparent 34%
    ),
    #fff;
  border-color: #111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

html[data-theme="light"] .mfa-modal-qr-orb-core svg {
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.12));
}

@keyframes mfaOrbSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes mfaOrbLogoSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.mfa-modal-qr canvas,
.mfa-modal-qr img,
.mfa-modal-qr svg {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.mfa-modal-uri-btn {
  grid-column: 1;
  grid-row: 4;
  justify-self: center;
  font-size: 0.85rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.mfa-modal-setup > .auth-field {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  align-self: center;
}

.mfa-modal-setup .auth-code-input {
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.3em;
}

.mfa-modal-details {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.82rem;
  width: 100%;
  text-align: left;
  color: var(--tertiary);
  justify-self: stretch;
}
.mfa-modal-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.3rem;
  text-align: center;
}
.mfa-modal-detail-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin: 0.3rem 0;
  line-height: 1.6;
  text-align: center;
}
.mfa-modal-secret {
  display: inline-flex;
  font-family: monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: rgba(0,0,0,0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.mfa-modal-backup-codes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.mfa-modal-backup-codes > div {
  font-family: monospace;
  font-size: 0.76rem;
  background: rgba(var(--accent-rgb), 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.mfa-modal-setup .btn-primary {
  grid-column: 2;
  grid-row: 3;
  align-self: stretch;
  max-width: 360px;
  justify-self: center;
}

body.mfa-gate-open .app-shell,
body.mfa-gate-open #sidebar,
body.mfa-gate-open .sidebar-backdrop {
  visibility: hidden;
}

.auth-shell {
  position: relative;
  width: min(100%, 420px);
  max-height: min(100%, 760px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid
    color-mix(in srgb, var(--border) 86%, rgba(255, 255, 255, 0.06));
  background: color-mix(in srgb, var(--surface-raised) 97%, transparent);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  padding: 1.6rem 1.35rem 1.25rem;
  text-align: center;
}

.auth-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.auth-header-copy {
  min-width: 0;
  width: 100%;
}

.auth-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 0.38rem auto 0;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 30ch;
}

.auth-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  flex-shrink: 0;
}

.auth-provider-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.6));
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--border);
  opacity: 0.7;
}
.auth-divider span {
  padding: 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.7));
}

.auth-provider-btn {
  min-height: 4.25rem;
  padding: 0.7rem 0.55rem;
  border-radius: 16px;
  border: 1px solid
    color-mix(in srgb, var(--border) 88%, rgba(255, 255, 255, 0.06));
  background: color-mix(
    in srgb,
    var(--bg-elevated) 82%,
    rgba(255, 255, 255, 0.015)
  );
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.14s ease;
}

.auth-provider-btn:hover,
.auth-provider-btn.active {
  transform: translateY(-1px);
  border-color: rgba(16, 163, 127, 0.34);
  background: linear-gradient(
    180deg,
    rgba(16, 163, 127, 0.12),
    rgba(16, 163, 127, 0.04)
  );
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.auth-provider-btn.unavailable {
  opacity: 0.72;
  border-style: dashed;
}

.auth-provider-btn.unavailable:hover {
  transform: none;
  box-shadow: none;
}

.auth-provider-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-provider-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

#auth-provider-auoura .auth-provider-icon svg,
#auth-provider-google .auth-provider-icon svg,
#auth-provider-apple .auth-provider-icon svg {
  transform-origin: center;
}

#auth-provider-auoura .auth-provider-icon svg {
  transform: scale(1.08);
}

#auth-provider-google .auth-provider-icon svg {
  transform: scale(1.16);
}

#auth-provider-apple .auth-provider-icon svg {
  transform: scale(1.28);
}

.auth-provider-icon-auoura {
  color: var(--text);
}

.auth-provider-copy {
  margin: 0.85rem auto 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  min-height: 1.3em;
  max-width: 28ch;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  margin-top: 0.95rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  align-items: stretch;
  text-align: left;
}

.auth-field span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.auth-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid
    color-mix(in srgb, var(--border) 90%, rgba(255, 255, 255, 0.04));
  background: color-mix(in srgb, var(--bg) 94%, rgba(255, 255, 255, 0.02));
  color: var(--text);
  font: inherit;
  padding: 0.84rem 0.95rem;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(16, 163, 127, 0.4);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.auth-code-input {
  text-align: center;
  letter-spacing: 0.24em;
  font-weight: 700;
}

.auth-submit {
  width: 100%;
  min-height: 2.95rem;
  border-radius: 14px;
  margin-top: 0.12rem;
}

.auth-message {
  margin: 0.8rem 0 0;
  padding: 0.72rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(16, 163, 127, 0.22);
  background: rgba(16, 163, 127, 0.08);
  color: var(--text);
  font-size: 0.84rem;
  text-align: center;
}

.auth-message.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
}

.auth-footnote {
  margin: 0.8rem auto 0;
  color: var(--text-faint);
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 28ch;
  text-align: center;
}

.auth-mode-row {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
}

.auth-mode-toggle,
.auth-back-btn {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100%, 100vw - 1rem);
    max-height: min(100%, calc(100svh - 1rem));
    padding: 1.2rem 1rem 1rem;
    border-radius: 20px;
  }

  .mfa-modal .auth-shell {
    width: min(100%, calc(100vw - 0.75rem));
    max-height: min(100%, calc(100svh - 1rem));
  }

  .mfa-modal-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.7rem;
    text-align: center;
  }

  .mfa-modal-qr {
    width: min(100%, 240px);
    min-height: auto;
    align-self: center;
  }

  .mfa-modal-uri-btn {
    align-self: center;
  }

  .auth-provider-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auth-provider-btn {
    min-height: 4rem;
    padding-inline: 0.45rem;
  }

  .auth-copy {
    max-width: none;
  }
}

@media (max-width: 460px) {
  .auth-modal {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .auth-shell {
    width: 100%;
    max-height: min(100%, calc(100svh - 1.5rem));
    border-radius: 18px;
    padding: 1rem 0.9rem 0.9rem;
  }

  .auth-provider-switch {
    grid-template-columns: 1fr;
  }

  .auth-provider-btn {
    min-height: 3.2rem;
    flex-direction: row;
    justify-content: center;
    gap: 0.55rem;
  }

  .auth-title {
    font-size: 1.2rem;
  }

  .auth-copy,
  .auth-provider-copy,
  .auth-footnote {
    font-size: 0.78rem;
  }
}

.chatroom-action-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.chatroom-action-header-copy {
  min-width: 0;
}

.chatroom-action-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chatroom-action-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chatroom-action-close {
  flex-shrink: 0;
}

.chatroom-action-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.chatroom-action-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
}

.chatroom-action-input-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chatroom-action-input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.chatroom-action-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

html[data-theme="light"] .chatroom-action-input:focus {
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.chatroom-action-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.chatroom-action-cancel {
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}

.chatroom-action-cancel:hover {
  background: var(--bg-elevated);
  border-color: var(--border-input);
}

.chatroom-action-cancel:active {
  transform: scale(0.98);
}

.chatroom-action-confirm {
  min-width: 112px;
}

.chatroom-action-confirm-danger {
  background: #ef4444;
}

.chatroom-action-confirm-danger:hover {
  background: #dc2626;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.topbar-status-text {
  display: none;
}
@media (min-width: 600px) {
  .topbar-status-text {
    display: inline;
  }
}

/* ── STATUS DOT ──────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}
.status-dot.connected {
  background: var(--accent);
}

/* ── ICON BTN ────────────────────────────────────────────────── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

/* ── WORKSPACE ───────────────────────────────────────────────── */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── CHAT COLUMN ─────────────────────────────────────────────── */
.chat-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.memory-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(
      circle at top right,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 96%, #000 4%),
      var(--bg)
    );
}

.memory-page-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  min-height: 100%;
}

.memory-toolbar,
.memory-page-body,
.memory-board-panel,
.memory-detail-panel {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(135%);
}

.memory-toolbar {
  display: flex;
  align-items: end;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  flex-wrap: wrap;
}

.memory-toolbar-field,
.memory-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.memory-toolbar-field span,
.memory-form-field span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.memory-toolbar-field {
  min-width: min(320px, 100%);
  flex: 1;
}

.memory-input,
.memory-select,
.memory-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  padding: 0.8rem 0.9rem;
}

.memory-textarea {
  resize: vertical;
  min-height: 120px;
}

.memory-toolbar-check,
.memory-form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.memory-health {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--accent-soft-border);
  background: var(--accent-soft-bg);
  color: var(--text);
}

.memory-page-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-height: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.memory-board-panel,
.memory-detail-panel {
  min-width: 0;
  min-height: 0;
  padding: 1rem;
  border-radius: 28px;
}

.memory-board-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.memory-stat-card {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    var(--surface-1),
    rgba(var(--accent-rgb), 0.06)
  );
}

.memory-stat-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.memory-stat-label {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.memory-list {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(96px, auto);
  gap: 0.85rem;
  max-height: calc(100vh - 310px);
  overflow: auto;
  padding-right: 0.15rem;
  align-content: start;
}

.memory-list-item {
  width: 100%;
  grid-column: span 4;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-raised) 94%, transparent),
      color-mix(in srgb, var(--surface-1) 88%, transparent)
    ),
    var(--accent-radial-soft);
  color: var(--text);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 144px;
}

.memory-list-item:hover,
.memory-list-item.active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background:
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 0.16),
      rgba(var(--accent-deep-rgb), 0.08)
    ),
    color-mix(in srgb, var(--surface-raised) 88%, transparent);
  transform: translateY(-1px);
}

.memory-list-item[data-memory-size="wide"] {
  grid-column: span 8;
}
.memory-list-item[data-memory-size="tall"] {
  grid-row: span 2;
}
.memory-list-item[data-memory-size="hero"] {
  grid-column: span 8;
  grid-row: span 2;
}

.memory-list-item-top,
.memory-form-row,
.memory-form-actions,
.memory-list-item-badges {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.memory-list-item-top {
  justify-content: space-between;
  align-items: flex-start;
}

.memory-list-item-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
}

.memory-list-item-updated,
.memory-record-meta {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.memory-list-item-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.memory-list-item-badges {
  margin: 0.45rem 0 0.35rem;
}

.memory-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.memory-badge-highlight {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.memory-list-item-summary,
.memory-empty-state {
  margin: 0;
  color: var(--text-muted);
}

.memory-list-item-details {
  margin: 0.55rem 0 0;
  color: color-mix(in srgb, var(--text-muted) 88%, var(--text));
  font-size: 0.88rem;
}

.memory-list-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: 0.76rem;
}

.memory-empty-state {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface-1);
}

.memory-list > .memory-empty-state {
  grid-column: 1 / -1;
}

.memory-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.memory-form-row > * {
  flex: 1;
  min-width: 0;
}

.memory-form-actions {
  align-items: center;
}

.memory-delete-btn {
  color: #fda4af;
}

html[data-theme="light"] .memory-page {
  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.12),
      transparent 28%
    ),
    linear-gradient(180deg, #fcfcfb, #f7f8f6);
}

html[data-theme="light"] .memory-health {
  background: rgba(var(--accent-rgb), 0.06);
}

.settings-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 97%, #000 3%),
    var(--bg)
  );
}

.settings-page-shell {
  --settings-shell-max-width: 1360px;
  --settings-panel-max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
  width: min(100%, var(--settings-shell-max-width));
  min-height: 100%;
  margin: 0 auto;
  overflow: visible;
}

.settings-tabs,
.settings-card {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(135%);
}

.settings-tabs {
  width: min(100%, var(--settings-panel-max-width));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 18px;
}

.settings-tab-btn {
  min-height: 2.65rem;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-tab-btn:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
}

.settings-tab-btn.active,
.settings-tab-btn[aria-selected="true"] {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(var(--accent-rgb), 0.12);
}

.settings-tab-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 2px;
}

.settings-card-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.settings-card-title {
  margin: 0;
  line-height: 1.1;
}
.settings-card-copy {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  width: 100%;
  justify-items: center;
  justify-content: center;
  align-content: start;
  flex: 0 0 auto;
}

.settings-card {
  width: 100%;
  max-width: var(--settings-panel-max-width);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 24px;
  text-align: center;
  min-height: 0;
  overflow: visible;
}

.settings-billing-panel {
  width: 100%;
  max-width: 1320px;
  justify-self: center;
}

.settings-tab-panel[hidden] {
  display: none;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.settings-field span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.settings-input,
.settings-value {
  min-height: 3rem;
  display: flex;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.settings-input {
  width: 100%;
  font: inherit;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.settings-input:focus {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.settings-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.settings-mfa-inline-field {
  min-width: 0;
}

.settings-mfa-inline-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}

.settings-mfa-inline-row .settings-input {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.settings-mfa-inline-btn {
  flex: 0 0 auto;
  min-height: 3rem;
  padding-inline: 1rem;
  white-space: nowrap;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

@media (max-width: 720px) {
  .settings-mfa-inline-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .settings-mfa-inline-row .settings-input {
    border-radius: 14px;
  }

  .settings-mfa-inline-btn {
    width: 100%;
    border-left: 1px solid var(--border);
    border-radius: 14px;
  }
}

.settings-provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.settings-location-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.7rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  text-align: left;
}

.settings-location-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.settings-location-copy {
  min-width: 0;
}

.settings-location-copy strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

.settings-location-copy p {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.settings-location-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.settings-location-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-location-track {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.settings-location-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.settings-location-input:checked + .settings-location-track {
  background: rgba(var(--accent-rgb), 0.68);
}

.settings-location-input:checked + .settings-location-track::after {
  transform: translateX(18px);
}

.settings-location-details {
  padding-top: 0.2rem;
}

.settings-provider-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.settings-accent-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.settings-theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.settings-color-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.settings-font-size-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.settings-font-size-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 6rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-font-size-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.settings-font-size-option.active,
.settings-font-size-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-1));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset,
    0 14px 28px rgba(0, 0, 0, 0.16);
}

.settings-font-size-option-preview {
  font-family: var(--font-family, "Inter", "Segoe UI", sans-serif);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.settings-font-size-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.settings-font-size-option-copy {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.settings-color-mode-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-height: 5.6rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-color-mode-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.settings-color-mode-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.settings-color-mode-option.active,
.settings-color-mode-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-1));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset,
    0 14px 28px rgba(0, 0, 0, 0.16);
}

.settings-color-mode-option-title {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text);
}

.settings-color-mode-option-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.42;
}

.settings-theme-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 9.4rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-theme-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}

.settings-theme-option.active,
.settings-theme-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-1));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset,
    0 14px 28px rgba(0, 0, 0, 0.16);
}

.settings-theme-option-preview {
  position: relative;
  width: 100%;
  height: 4.25rem;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(17, 17, 20, 0.14);
}

.settings-theme-option-preview-default {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-raised) 98%, transparent),
    color-mix(in srgb, var(--surface-1) 90%, transparent)
  );
}

.settings-theme-option-preview-blocky {
  background: repeating-linear-gradient(
    45deg,
    #efefef 0,
    #efefef 1.2px,
    #f9f9f9 0,
    #f9f9f9 50%
  );
  background-size: 12px 12px;
}

.settings-theme-option-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.settings-theme-option-copy {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.settings-accent-option {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.46rem;
  padding: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-accent-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(
    in srgb,
    var(--accent-option-color, var(--accent)) 44%,
    var(--border)
  );
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.settings-accent-option.active {
  border-color: color-mix(
    in srgb,
    var(--accent-option-color, var(--accent)) 58%,
    var(--border)
  );
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  box-shadow:
    0 0 0 1px rgba(var(--accent-option-rgb, var(--accent-rgb)), 0.18) inset,
    0 12px 24px rgba(0, 0, 0, 0.22);
}

/* ── Font Selector ────────────────────────────────────────────── */
.settings-font-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.8rem;
}

.settings-font-option {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: clamp(6.7rem, 18vw, 8.3rem);
  padding: clamp(0.85rem, 1.8vw, 1rem) clamp(0.85rem, 2vw, 1.1rem);
  border-radius: 18px;
  border: 1.2px solid color-mix(in srgb, var(--text) 15%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-raised) 96%, transparent),
    color-mix(in srgb, var(--surface-1) 86%, transparent)
  );
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.settings-font-option:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.settings-font-option.active,
.settings-font-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-1));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset,
    0 16px 34px rgba(0, 0, 0, 0.24);
}

.settings-font-option-preview {
  display: block;
  width: 100%;
  font-size: clamp(1.16rem, 1.2vw + 0.55rem, 1.7rem);
  font-weight: 500;
  line-height: 1.03;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  max-width: 100%;
}

.settings-accent-option-swatch {
  position: relative;
  display: block;
  width: 100%;
  min-height: 2.75rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-option-color);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 6px 12px rgba(0, 0, 0, 0.16);
}

.settings-accent-option-swatch::after {
  display: none;
}

.settings-accent-option-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
}

.settings-segmented {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.settings-segment-btn {
  min-width: 110px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.settings-segment-btn.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: rgba(var(--accent-rgb), 0.12);
}

.settings-card-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.settings-save-status {
  margin: -0.1rem 0 0;
  min-height: 1.2rem;
  color: var(--text-muted);
  text-align: center;
}

.settings-save-status.error {
  color: #ff8686;
}

.settings-muted-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.settings-billing-panel {
  padding: 2rem;
}

.settings-billing-layout {
  --billing-bg: var(--bg);
  --billing-panel: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  --billing-panel-strong: color-mix(
    in srgb,
    var(--bg-elevated) 92%,
    transparent
  );
  --billing-ink: var(--text);
  --billing-muted: var(--text-muted);
  --billing-line: var(--border);
  --billing-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 404px);
  gap: 24px;
  align-items: start;
  color: var(--billing-ink);
  font-family: inherit;
  letter-spacing: normal;
}

.settings-billing-layout button {
  font: inherit;
  color: inherit;
}

.settings-billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  grid-column: 1 / -1;
  align-items: end;
}

.settings-billing-kicker,
.settings-billing-section-label,
.settings-billing-stat-label {
  margin: 0;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.settings-billing-title {
  margin: 0.45rem 0 0.55rem;
  color: var(--billing-ink);
  text-transform: none;
  font-size: clamp(1.6rem, 2.9vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.settings-billing-copy {
  max-width: 720px;
  margin: 0;
  color: var(--billing-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.settings-billing-mfa-card,
.settings-billing-stat-card,
.settings-billing-side-card,
.settings-pack-card {
  background: var(--billing-panel);
  border: 1px solid var(--billing-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.settings-billing-mfa-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.5;
  text-transform: none;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--billing-panel) 96%, transparent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.settings-billing-status {
  grid-column: 1 / -1;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--billing-line));
  background: color-mix(in srgb, var(--billing-panel) 97%, transparent);
  color: var(--billing-ink);
  text-align: left;
  text-transform: none;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 18px;
}

.settings-billing-status.error {
  border-color: rgba(239, 68, 68, 0.32);
  background: color-mix(
    in srgb,
    var(--billing-panel) 94%,
    rgba(239, 68, 68, 0.08)
  );
}

.settings-billing-main {
  min-width: 0;
  width: 100%;
  position: relative;
}

.settings-billing-main.mfa-locked > :not(.settings-billing-gate) {
  opacity: 0.35;
  filter: grayscale(0.12);
  pointer-events: none;
  user-select: none;
}

.settings-billing-gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: start center;
  justify-items: center;
  padding: 12px 28px 28px;
  text-align: center;
}

.settings-billing-mfa-card-gate {
  max-width: 420px;
  width: min(100%, 420px);
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: clamp(12px, 4vh, 44px);
}

.settings-billing-gate-copy {
  margin: 0;
}

.settings-billing-gate-btn {
  min-width: 210px;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: normal;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.28);
}

.settings-billing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 34px;
}

.settings-billing-stat-card {
  min-height: 186px;
  padding: 28px 26px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--billing-panel) 97%, transparent);
}

.settings-billing-stat-value {
  display: block;
  margin-top: 24px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1;
  text-transform: none;
}

.settings-billing-stat-copy,
.settings-pack-copy,
.settings-billing-note,
.settings-billing-empty-copy {
  margin: 18px 0 0;
  color: var(--billing-muted);
  font-size: 15px;
  line-height: 1.55;
}

.settings-billing-empty-copy {
  max-width: 280px;
  margin: 0;
}

.settings-billing-section-label {
  margin-bottom: 18px;
}

.settings-billing-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.settings-pack-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 300px;
  padding: 42px 28px 34px;
  text-align: center;
  cursor: pointer;
  overflow: visible;
  border-radius: 26px;
  background: color-mix(in srgb, var(--billing-panel) 97%, transparent);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-width 160ms ease;
}

.settings-pack-card:hover,
.settings-pack-card.active {
  box-shadow: var(--billing-shadow);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--billing-line));
}

.settings-pack-card:focus-visible {
  outline: 4px solid var(--billing-ink);
  outline-offset: 4px;
}

.settings-coin-stage {
  position: relative;
  width: 170px;
  height: 130px;
  margin-bottom: 34px;
  overflow: visible;
}

.settings-coin {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: 86px;
  height: 50px;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
  transition:
    transform 220ms ease,
    filter 220ms ease;
}

.settings-coin-svg {
  width: 86px;
  height: 50px;
  display: block;
  overflow: visible;
}

.settings-coin-shadow,
.settings-stack-shadow {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: 64px;
  height: 12px;
  background: rgba(0, 0, 0, 0.58);
  border-radius: 50%;
  transition:
    transform 220ms ease,
    opacity 220ms ease,
    filter 220ms ease;
  pointer-events: none;
}

.settings-coin-stack {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 86px;
  height: 80px;
  overflow: visible;
}

.settings-coin-stack .settings-coin {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: none;
  width: 86px;
  height: 50px;
  overflow: visible;
  transition:
    transform 220ms ease,
    filter 220ms ease;
}

.settings-coin-stack .settings-coin:nth-child(1) {
  bottom: 0;
  z-index: 1;
}

.settings-coin-stack .settings-coin:nth-child(2) {
  bottom: 16px;
  z-index: 2;
}

.settings-coin-stack .settings-coin:nth-child(3) {
  bottom: 32px;
  z-index: 3;
}

.settings-coin-stack .settings-coin:nth-child(4) {
  bottom: 48px;
  z-index: 4;
}

.settings-pack-card.single:hover .settings-coin,
.settings-pack-card.single.active .settings-coin {
  transform: translate(-50%, -24px);
}

.settings-pack-card.single:hover .settings-coin-shadow,
.settings-pack-card.single.active .settings-coin-shadow {
  transform: translateX(-50%) scale(1.45, 0.55);
  opacity: 0.45;
  filter: blur(2.5px);
}

.settings-pack-card.medium .settings-coin-stack:first-of-type {
  transform: translateX(-50%) translateX(-22px);
}

.settings-pack-card.medium .settings-coin-stack:nth-of-type(2) {
  transform: translateX(-50%) translate(32px, 20px);
}

.settings-pack-card.large .settings-coin-stack:nth-of-type(1) {
  transform: translateX(-50%) translate(-56px, 20px);
}

.settings-pack-card.large .settings-coin-stack:nth-of-type(2) {
  transform: translateX(-50%) translate(0, -8px);
}

.settings-pack-card.large .settings-coin-stack:nth-of-type(3) {
  transform: translateX(-50%) translate(56px, 20px);
}

.settings-pack-card:hover .settings-coin-stack,
.settings-pack-card.active .settings-coin-stack,
.settings-pack-card.is-settling .settings-coin-stack {
  filter: none !important;
}

@keyframes settings-float-svg-2 {
  0%,
  14%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  86% {
    transform: translateY(0);
  }
}

@keyframes settings-float-svg-3 {
  0%,
  14%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  86% {
    transform: translateY(0);
  }
}

@keyframes settings-float-svg-4 {
  0%,
  14%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
  86% {
    transform: translateY(0);
  }
}

.settings-pack-card:hover
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg,
.settings-pack-card.active
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg,
.settings-pack-card.is-settling
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg {
  transform: translateY(0);
  animation: none !important;
}

.settings-pack-card:hover
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg,
.settings-pack-card.active
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg {
  animation: settings-float-svg-2 2800ms cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.settings-pack-card.is-settling
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg {
  animation: settings-float-svg-2 2800ms cubic-bezier(0.37, 0, 0.63, 1) 1;
}

.settings-pack-card:hover
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg,
.settings-pack-card.active
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg {
  animation: settings-float-svg-3 2800ms cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.settings-pack-card.is-settling
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg {
  animation: settings-float-svg-3 2800ms cubic-bezier(0.37, 0, 0.63, 1) 1;
}

.settings-pack-card:hover
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg,
.settings-pack-card.active
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg {
  animation: settings-float-svg-4 2800ms cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.settings-pack-card.is-settling
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg {
  animation: settings-float-svg-4 2800ms cubic-bezier(0.37, 0, 0.63, 1) 1;
}

.settings-pack-inner {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 160ms ease;
}

.settings-pack-card:hover .settings-pack-inner,
.settings-pack-card.active .settings-pack-inner,
.settings-pack-card.is-settling .settings-pack-inner {
  transform: translateY(-1px);
}

/* For medium (500K) and large (1M) packs: lift and hold while hovered/active,
   then transition back down when unhovered/unselected. This overrides
   the default floating animations so the coin graphics move up and stay. */
.settings-pack-card.medium:hover .settings-pack-inner,
.settings-pack-card.medium.active .settings-pack-inner,
.settings-pack-card.large:hover .settings-pack-inner,
.settings-pack-card.large.active .settings-pack-inner {
  transform: translateY(-10px);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-pack-card.medium:hover .settings-pack-inner,
.settings-pack-card.medium.active .settings-pack-inner,
.settings-pack-card.large:hover .settings-pack-inner,
.settings-pack-card.large.active .settings-pack-inner {
  transform: translateY(-10px);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Precise per-coin lifts and is-settling overrides to prevent play-through animations.
   Coins will translate up and hold while hovered or active, then smoothly
   transition back when unhovered/unselected without replaying keyframe floats. */

/* Medium / Large: per-coin static lifts while hovered/active */
.settings-pack-card.medium:hover
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg,
.settings-pack-card.medium.active
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg,
.settings-pack-card.large:hover
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg,
.settings-pack-card.large.active
  .settings-coin-stack
  .settings-coin:nth-child(1)
  .settings-coin-svg {
  transform: translateY(-6px) !important;
  animation: none !important;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.settings-pack-card.medium:hover
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg,
.settings-pack-card.medium.active
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg,
.settings-pack-card.large:hover
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg,
.settings-pack-card.large.active
  .settings-coin-stack
  .settings-coin:nth-child(2)
  .settings-coin-svg {
  transform: translateY(-10px) !important;
  animation: none !important;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.settings-pack-card.medium:hover
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg,
.settings-pack-card.medium.active
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg,
.settings-pack-card.large:hover
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg,
.settings-pack-card.large.active
  .settings-coin-stack
  .settings-coin:nth-child(3)
  .settings-coin-svg {
  transform: translateY(-14px) !important;
  animation: none !important;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.settings-pack-card.medium:hover
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg,
.settings-pack-card.medium.active
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg,
.settings-pack-card.large:hover
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg,
.settings-pack-card.large.active
  .settings-coin-stack
  .settings-coin:nth-child(4)
  .settings-coin-svg {
  transform: translateY(-18px) !important;
  animation: none !important;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Also cover the single coin stage (non-stacked) */
.settings-pack-card.medium:hover
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg,
.settings-pack-card.medium.active
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg,
.settings-pack-card.large:hover
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg,
.settings-pack-card.large.active
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg {
  transform: translateY(-12px) !important;
  animation: none !important;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Prevent 'is-settling' from playing float keyframe animations; instead
   allow a smooth transform back to the resting position. */
.settings-pack-card.is-settling.medium .settings-coin-stack .settings-coin-svg,
.settings-pack-card.is-settling.large .settings-coin-stack .settings-coin-svg,
.settings-pack-card.is-settling.medium
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg,
.settings-pack-card.is-settling.large
  .settings-coin-stage
  > .settings-coin
  .settings-coin-svg {
  animation: none !important;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.settings-pack-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: none;
  line-height: 1.05;
}

.settings-pack-price {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
  color: color-mix(in srgb, var(--text) 92%, var(--accent));
}

.settings-pack-card:hover
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(2),
.settings-pack-card:hover
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(3),
.settings-pack-card.active
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(2),
.settings-pack-card.active
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(3),
.settings-pack-card.is-settling
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(2),
.settings-pack-card.is-settling
  .settings-coin-stage
  > .settings-coin-stack:nth-of-type(3) {
  filter: none !important;
}

@keyframes settings-float-vertical {
  0%,
  14%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  86% {
    transform: translateY(0);
  }
}

.settings-pack-card.single:hover .settings-coin-svg,
.settings-pack-card.single.active .settings-coin-svg {
  animation: settings-float-vertical 2800ms cubic-bezier(0.37, 0, 0.63, 1)
    infinite;
}

.settings-pack-card.single.is-settling .settings-coin-svg {
  animation: settings-float-vertical 2800ms cubic-bezier(0.37, 0, 0.63, 1) 1;
}

.settings-checkout-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  margin-top: 36px;
  min-height: 2rem;
  padding: 0.5rem 0.72rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 600;
  gap: 0.5rem;
  box-shadow: none;
}

.settings-checkout-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: none;
}

.settings-checkout-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-billing-main.mfa-locked .settings-checkout-btn,
.settings-billing-main.mfa-locked .settings-pack-card {
  pointer-events: none;
}

.settings-checkout-arrow {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
}

.settings-billing-note {
  text-transform: none;
  font-size: 0.82rem;
}

.settings-billing-sidebar {
  display: grid;
  grid-template-rows: 1fr 1fr;
  border: 1px solid var(--billing-line);
  border-radius: 24px;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  align-self: stretch;
  background: color-mix(in srgb, var(--billing-panel) 97%, transparent);
}

.settings-billing-sidebar.mfa-locked {
  opacity: 0.35;
  filter: grayscale(0.12);
  pointer-events: none;
  user-select: none;
}

.settings-billing-side-card {
  display: flex;
  flex-direction: column;
  border: 0;
  padding: 36px 26px 28px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.settings-billing-side-card + .settings-billing-side-card {
  border-top: 1px solid var(--billing-line);
}

.settings-billing-side-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.15;
  text-transform: none;
}

.settings-billing-side-list {
  display: grid;
  flex: 1;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable both-edges;
}

.settings-billing-method,
.settings-billing-history-item,
.settings-billing-empty-state {
  min-height: 266px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed
    color-mix(in srgb, var(--border) 94%, rgba(var(--accent-rgb), 0.16));
  text-align: center;
  text-transform: none;
  border-radius: 18px;
}

.settings-billing-method,
.settings-billing-history-item {
  min-height: auto;
  place-items: stretch;
  text-align: left;
  border-style: solid;
  background: var(--billing-panel-strong);
}

.settings-billing-method-copy,
.settings-billing-history-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.settings-billing-method-title,
.settings-billing-history-title {
  font-weight: 600;
  text-transform: none;
}

.settings-billing-method-meta,
.settings-billing-history-meta {
  color: var(--billing-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  text-transform: none;
}

.settings-billing-method-row,
.settings-billing-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 1400px) {
  .settings-billing-layout {
    grid-template-columns: 1fr;
  }

  .settings-billing-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .settings-billing-side-card + .settings-billing-side-card {
    border-top: 0;
    border-left: 1px solid var(--billing-line);
  }

  .settings-billing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-billing-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .settings-billing-hero,
  .settings-billing-stats,
  .settings-billing-pack-grid,
  .settings-billing-sidebar {
    grid-template-columns: 1fr;
  }

  .settings-billing-side-card + .settings-billing-side-card {
    border-left: 0;
    border-top: 1px solid var(--billing-line);
  }

  .settings-pack-card {
    min-height: 0;
  }
}

.settings-billing-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--billing-ink);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
}

.settings-mfa-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settings-mfa-setup {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
}

.settings-mfa-qr-card {
  grid-row: 1 / span 3;
  align-self: stretch;
}

.settings-mfa-setup > .settings-field {
  min-width: 0;
}

.settings-mfa-qr-card {
  position: relative;
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  background:
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 0.12),
      rgba(var(--accent-rgb), 0.035)
    ),
    color-mix(in srgb, var(--surface-raised) 92%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.settings-mfa-qr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.16),
      transparent 34%
    ),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  opacity: 0.72;
}

.settings-mfa-qr-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-mfa-qr-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.56);
}

.settings-mfa-qr-stage {
  position: relative;
  z-index: 1;
  width: min(292px, 100%);
  margin: 0 auto;
  padding: 0.7rem;
  border-radius: 24px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.025)
    ),
    rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* "Add to authenticator app" deep-link button — only shown on touch devices */
.settings-mfa-open-uri {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

@media (pointer: coarse) {
  .settings-mfa-open-uri {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: min(292px, 100%);
    margin: 0.75rem auto 0;
    padding: 0.72rem 1rem;
    border-radius: 14px;
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    color: rgb(var(--accent-rgb));
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
      background 0.15s,
      opacity 0.15s;
  }

  .settings-mfa-open-uri:active {
    background: rgba(var(--accent-rgb), 0.22);
    opacity: 0.85;
  }
}

.settings-mfa-qr {
  min-height: 236px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 12px 28px rgba(0, 0, 0, 0.28);
  color: #111;
}

.settings-mfa-qr canvas,
.settings-mfa-qr img,
.settings-mfa-qr svg {
  width: min(248px, 100%) !important;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  image-rendering: auto;
}

.settings-mfa-qr .settings-mfa-stylized-qr {
  display: block;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 26px rgba(0, 0, 0, 0.12);
}

.settings-mfa-qr-logo-frame {
  position: relative;
  width: min(248px, 100%);
  display: grid;
  place-items: center;
}

.settings-mfa-qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(255, 255, 255, 0.42),
      transparent 36%
    ),
    linear-gradient(
      135deg,
      rgba(var(--accent-rgb), 1),
      rgba(var(--accent-deep-rgb), 1)
    );
  border: 4px solid #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 6px 14px rgba(0, 0, 0, 0.18),
    0 0 20px rgba(var(--accent-rgb), 0.2);
  transform: translate(-50%, -50%);
}

.settings-mfa-qr-logo svg {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

html[data-visual-theme="blocky"] .settings-mfa-qr-logo {
  color: #fff;
  background: #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 6px 14px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"][data-visual-theme="blocky"] .settings-mfa-qr-logo {
  color: #000;
  background: #fff;
  border-color: #111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 6px 14px rgba(255, 255, 255, 0.08);
}

.settings-mfa-secret {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.settings-mfa-backup-codes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.settings-mfa-backup-code {
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  text-align: center;
}

.settings-billing-list,
.settings-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.settings-billing-item,
.settings-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  text-align: left;
}

.settings-billing-item-copy,
.settings-history-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.settings-billing-item-title,
.settings-history-item-title {
  font-weight: 600;
}

.settings-billing-item-meta,
.settings-history-item-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.settings-billing-item-action {
  flex-shrink: 0;
}

.settings-history-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-empty-state {
  padding: 1rem;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .settings-accent-preview-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-color-mode-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-font-size-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-font-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-page-body {
    grid-template-columns: 1fr;
  }

  .settings-font-option {
    min-height: 5.9rem;
  }

  .settings-font-option-preview {
    font-size: clamp(1.05rem, 4.8vw, 1.4rem);
  }
  .memory-list {
    max-height: none;
  }

  .settings-field-grid,
  .settings-stat-grid,
  .settings-pack-grid {
    grid-template-columns: 1fr;
  }

  .settings-accent-preview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-mfa-setup {
    grid-template-columns: 1fr;
  }

  .settings-mfa-backup-codes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-mfa-qr-card {
    grid-row: auto;
  }

  .settings-billing-layout,
  .settings-billing-hero {
    grid-template-columns: 1fr;
  }

  .settings-billing-sidebar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .settings-billing-side-card + .settings-billing-side-card {
    border-top: 0;
    border-left: 1.5px solid var(--billing-line);
  }
}

@media (max-width: 720px) {
  .memory-page-shell {
    padding: 0.85rem;
  }

  .memory-toolbar,
  .memory-board-panel {
    border-radius: 18px;
    padding: 0.9rem;
  }

  .memory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .memory-list-item {
    grid-column: span 3;
  }

  .memory-list-item[data-memory-size="wide"],
  .memory-list-item[data-memory-size="hero"] {
    grid-column: span 6;
  }

  .settings-page-shell {
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .settings-card {
    border-radius: 18px;
    padding: 0.9rem;
  }

  .settings-tabs {
    border-radius: 16px;
  }

  .settings-accent-preview-list {
    grid-template-columns: 1fr;
  }

  .settings-billing-item,
  .settings-history-item,
  .settings-billing-method-row,
  .settings-billing-history-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-billing-panel {
    padding: 1.25rem;
  }

  .settings-billing-stats,
  .settings-billing-pack-grid,
  .settings-billing-sidebar {
    grid-template-columns: 1fr;
  }

  .settings-billing-side-card + .settings-billing-side-card {
    border-left: 0;
    border-top: 1.5px solid var(--billing-line);
  }
}

/* ── MESSAGES ────────────────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
html[data-theme="light"] .messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

/* ── WELCOME STATE ───────────────────────────────────────────── */
.welcome-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  gap: 0.9rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}
.welcome-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}

.welcome-greeting {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.7) 8%,
    var(--accent) 30%,
    var(--accent-hover) 52%,
    rgba(var(--accent-deep-rgb), 0.95) 78%,
    var(--accent) 96%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform: translateY(8px);
  animation:
    welcomeGreetingReveal 0.9s ease-out 0.15s forwards,
    welcomeGradientShift 6s ease-in-out infinite;
}

.welcome-typing-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  padding-inline: clamp(10px, 3vw, 28px);
  box-sizing: border-box;
  margin: 0 auto;
}

.welcome-typing-text {
  margin: 0;
  min-height: calc(1.2em + 0.22em);
  padding-block: 0.11em;
  box-sizing: border-box;
  text-align: center;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: middle;
  max-width: none;
  flex-shrink: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  /* Trailing-edge softener: active only during typing/deleting (toggled by
     the .is-revealing class). The mask extent is a transitionable length,
     so the fade itself eases in when motion starts and eases out when the
     sentence settles — last character is fully solid at rest. */
  --reveal-fade: 0px;
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - var(--reveal-fade)),
    rgba(0, 0, 0, 0.85) calc(100% - var(--reveal-fade) * 0.72),
    rgba(0, 0, 0, 0.5) calc(100% - var(--reveal-fade) * 0.46),
    rgba(0, 0, 0, 0.22) calc(100% - var(--reveal-fade) * 0.24),
    rgba(0, 0, 0, 0.06) calc(100% - var(--reveal-fade) * 0.08),
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - var(--reveal-fade)),
    rgba(0, 0, 0, 0.85) calc(100% - var(--reveal-fade) * 0.72),
    rgba(0, 0, 0, 0.5) calc(100% - var(--reveal-fade) * 0.46),
    rgba(0, 0, 0, 0.22) calc(100% - var(--reveal-fade) * 0.24),
    rgba(0, 0, 0, 0.06) calc(100% - var(--reveal-fade) * 0.08),
    rgba(0, 0, 0, 0) 100%
  );
  transition: --reveal-fade 480ms ease-out;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.7) 8%,
    var(--accent) 30%,
    var(--accent-hover) 52%,
    rgba(var(--accent-deep-rgb), 0.95) 78%,
    var(--accent) 96%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: welcomeGradientShift 6s ease-in-out infinite;
}

@property --reveal-fade {
  syntax: "<length>";
  initial-value: 1.1em;
  inherits: false;
}

.welcome-typing-text.is-revealing {
  overflow: hidden;
  white-space: nowrap;
  --reveal-fade: 1.1em;
}

.welcome-cursor-svg {
  width: clamp(22px, 3.1vw, 34px);
  height: auto;
  display: block;
  flex-shrink: 0;
  align-self: center;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.welcome-cursor-svg path {
  fill: var(--accent);
}

@keyframes welcomeGradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  33% {
    background-position: 100% 30%;
  }
  66% {
    background-position: 50% 100%;
  }
}

@keyframes welcomeGreetingReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

svg {
  shape-rendering: geometricPrecision;
}

/* ── MESSAGE ROWS ────────────────────────────────────────────── */
.message-row {
  width: 100%;
  padding: 1.25rem 1rem 0;
}
.message-row:last-child {
  padding-bottom: 0.75rem;
}

.message-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.message-row.role-user .message-inner {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0;
}
.msg-avatar svg {
  display: block;
}
.role-user .msg-avatar {
  background: var(--text);
  color: var(--bg);
}
.role-assistant .msg-avatar {
  background: var(--accent);
  color: #fff;
}
.role-block .msg-avatar {
  background: #ef4444;
  color: #fff;
}

.message-row.role-assistant.assistant-row-reasoning-only .msg-avatar {
  margin-top: calc(0.62rem + ((20px - 30px) / 2));
}

.msg-content {
  flex: 1;
  min-width: 0;
}
.role-user .msg-content {
  text-align: right;
}

.msg-bubble {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-lg);
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 100%;
}
.role-user .msg-bubble {
  background: var(--bg-msg-user);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm)
    var(--radius-lg);
  text-align: left;
}
.role-assistant .msg-bubble {
  background: transparent;
  padding: 0.1rem 0;
  border-radius: 0;
  border: none;
  display: block;
}
.role-block .msg-bubble {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
}

.msg-meta {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: 0.35rem;
}

/* System pills */
.message-system {
  text-align: center;
  padding: 0.75rem 1.5rem;
}
.message-system-inner {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── MARKDOWN ────────────────────────────────────────────────── */
.msg-bubble p,
.artifact-markdown p {
  margin: 0 0 0.75rem;
}
.msg-bubble :last-child,
.artifact-markdown :last-child {
  margin-bottom: 0;
}

:where(.msg-bubble, .artifact-markdown) a:not(.message-inline-source-card) {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 58%, transparent);
  text-underline-offset: 0.14em;
}

:where(.msg-bubble, .artifact-markdown)
  a:not(.message-inline-source-card):hover {
  color: var(--accent-hover);
}

.msg-bubble ul,
.msg-bubble ol,
.artifact-markdown ul,
.artifact-markdown ol {
  margin: 0 0 0.75rem;
  padding-left: 1.4rem;
}
.msg-bubble li,
.artifact-markdown li {
  margin-bottom: 0.25rem;
}

.msg-bubble h1,
.msg-bubble h2,
.msg-bubble h3,
.artifact-markdown h1,
.artifact-markdown h2,
.artifact-markdown h3 {
  margin: 1.1rem 0 0.45rem;
  font-weight: 600;
  line-height: 1.3;
}
.msg-bubble h1,
.artifact-markdown h1 {
  font-size: 1.3rem;
}
.msg-bubble h2,
.artifact-markdown h2 {
  font-size: 1.1rem;
}
.msg-bubble h3,
.artifact-markdown h3 {
  font-size: 0.975rem;
}

.msg-bubble hr,
.artifact-markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.msg-bubble blockquote,
.artifact-markdown blockquote {
  margin: 0 0 0.75rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.msg-bubble code,
.artifact-markdown code {
  padding: 0.13rem 0.38rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 0.875em;
}
html[data-theme="light"] .msg-bubble code,
html[data-theme="light"] .artifact-markdown code {
  background: rgba(0, 0, 0, 0.07);
}

.code-block-shell {
  position: relative;
  margin: 0.75rem 0;
}

.msg-bubble pre,
.artifact-markdown pre,
.artifact-code-pane pre {
  margin: 0.75rem 0;
  border-radius: var(--radius-md);
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: auto;
}

.code-block-shell > pre {
  margin: 0;
}
html[data-theme="light"] .msg-bubble pre,
html[data-theme="light"] .artifact-markdown pre {
  background: #1a1a2e;
}

.msg-bubble pre code,
.artifact-markdown pre code,
.artifact-code-pane pre code {
  display: block;
  padding: 1rem;
  background: transparent;
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e8eaf6;
}

.msg-bubble .word,
.msg-bubble .assistant-speech-word,
.msg-bubble .voice-mode-spoken-word {
  display: inline;
  border-radius: 3px;
  padding: 0 1px;
  transition:
    background 60ms ease,
    color 60ms ease,
    box-shadow 60ms ease;
  cursor: default;
}

.msg-bubble.is-tts-speaking {
  position: relative;
  white-space: pre-wrap;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.msg-bubble.is-tts-speaking .assistant-speech-word {
  opacity: 1;
}

.msg-bubble .word.spoken,
.msg-bubble .assistant-speech-word.is-spoken,
.msg-bubble .voice-mode-spoken-word.is-spoken {
  color: var(--muted);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.msg-bubble .word.active,
.msg-bubble .assistant-speech-word.is-active,
.msg-bubble .voice-mode-spoken-word.is-active {
  color: #0d0d0d;
  background: rgb(var(--accent-rgb, 196, 84, 84));
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 196, 84, 84), 0.5),
    0 0 18px rgba(var(--accent-rgb, 196, 84, 84), 0.28);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  z-index: 1;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

html[data-theme="light"] .msg-bubble .word.active,
html[data-theme="light"] .msg-bubble .assistant-speech-word.is-active,
html[data-theme="light"] .msg-bubble .voice-mode-spoken-word.is-active {
  color: #0d0d0d;
  background: rgb(var(--accent-rgb, 196, 84, 84));
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 196, 84, 84), 0.42),
    0 0 18px rgba(var(--accent-rgb, 196, 84, 84), 0.18);
}

.msg-bubble .word.upcoming {
  color: inherit;
}

html[data-theme="light"] .msg-bubble .word.spoken {
  color: rgba(15, 23, 42, 0.64);
}

html[data-theme="light"] .msg-bubble.is-tts-speaking {
  background: transparent;
  box-shadow: none;
}

.code-copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 17, 0.9);
  color: #f4f6fb;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.code-copy-btn:hover {
  background: rgba(36, 36, 36, 0.96);
  border-color: rgba(255, 255, 255, 0.2);
}

.code-copy-btn.copied {
  background: color-mix(in srgb, var(--accent) 28%, rgba(17, 17, 17, 0.94));
  border-color: color-mix(
    in srgb,
    var(--accent) 56%,
    rgba(255, 255, 255, 0.18)
  );
  color: #fff;
}

/* Source links */
.message-inline-sources {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  border: 1px solid var(--border);
}
.message-inline-sources-title {
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.message-inline-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}
.message-inline-source-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-raised) 92%, transparent),
    color-mix(in srgb, var(--bg-elevated) 92%, transparent)
  );
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.message-inline-source-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}
.message-inline-source-name {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.message-inline-source-host {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
img.message-inline-image {
  display: inline-block;
  max-width: min(100%, 320px);
  height: auto;
  margin: 0.2rem 0;
  border-radius: 14px;
  vertical-align: middle;
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}
.message-inline-image-figure {
  position: relative;
  margin: 0.95rem 0;
  padding: 0.66rem;
  max-width: min(100%, 340px);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  border: 1px solid var(--border);
  overflow: hidden;
}
.message-inline-image-figure > a,
.message-inline-image-figure > img {
  display: block;
}
.message-inline-image-figure img.message-inline-image {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.message-inline-image-figure--qr {
  max-width: min(100%, 240px);
  padding: 0.58rem;
}
.message-inline-image-figure--qr img.message-inline-image {
  max-width: 100%;
}
.message-inline-image-download {
  position: absolute;
  top: 0.52rem;
  right: 0.52rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 78%, rgba(0, 0, 0, 0.18));
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  opacity: 0.9;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    background-color 0.16s ease;
}
.message-inline-image-download:hover,
.message-inline-image-download:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}
.message-inline-image-download svg {
  width: 13px;
  height: 13px;
  display: block;
}
.message-inline-image-caption {
  margin-top: 0.6rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.message-inline-image-inline-note {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
  vertical-align: middle;
}
.message-inline-video {
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0.95rem 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 6px 22px color-mix(in srgb, #000 28%, transparent);
}
.message-inline-video-trigger {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
}
.message-inline-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.message-inline-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
  pointer-events: none;
}
.message-inline-video-play::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.message-inline-video-trigger:hover .message-inline-video-play,
.message-inline-video-trigger:focus-visible .message-inline-video-play {
  background: #c00;
  transform: translate(-50%, -50%) scale(1.05);
}
.message-inline-video-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.message-inline-video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.message-inline-video-file {
  aspect-ratio: auto;
  background: #000;
}
.message-inline-video-file .message-inline-video-player {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
}
.message-inline-video-caption-below {
  position: static;
  margin-top: 0.45rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  text-shadow: none;
}
.message-sources {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  border: 1px solid var(--border);
}
.message-sources-title {
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.message-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}
.message-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.message-source img {
  width: 16px;
  height: 16px;
  display: block;
}
.message-source:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.source-card {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0.85rem;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-raised) 92%, transparent),
    color-mix(in srgb, var(--bg-elevated) 92%, transparent)
  );
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}
.source-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}
.source-card img {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
}
.source-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.source-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-card-host {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-card--compact {
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  gap: 0.58rem;
}
.source-card--compact img {
  width: 16px;
  height: 16px;
}
.source-card--compact .source-card-title {
  font-size: 0.84rem;
}
.source-card--compact .source-card-host {
  font-size: 0.72rem;
}

.favicon-popover {
  position: absolute;
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.favicon-popover.hidden {
  display: none;
}
.favicon-popover .favicon-popover-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.favicon-popover .favicon-popover-url {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.favicon-popover .favicon-popover-actions {
  text-align: center;
}
.favicon-popover .favicon-popover-open {
  display: inline-block;
  margin: 0 auto;
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.message-reasoning {
  display: none;
}
.message-reasoning-body {
  display: none;
}

/* ── Reasoning Panel (Timeline Design) ── */
.reasoning-panel {
  margin-top: 0.55rem;
  border: 1px solid var(--border-input);
  border-radius: 26px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  background: var(--bg-elevated);
}

.message-row.role-assistant.assistant-row-reasoning-only .reasoning-panel {
  margin-top: 0;
}

.reasoning-panel--minimized .reasoning-panel-body {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* Header — toggle on the left, then the current step title */
.reasoning-panel-header {
  padding: 0.62rem 0.85rem;
  border-bottom: 0.5px solid var(--border-input);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease;
}

/* Collapsed: no divider, tighter — reads as one clean pill */
.reasoning-panel--minimized .reasoning-panel-header {
  border-bottom-color: transparent;
}

.reasoning-toggle-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transform: rotate(180deg);
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.15s;
}
.reasoning-toggle-btn:hover {
  color: var(--text);
}
.reasoning-toggle-btn.reasoning-toggle-collapsed {
  transform: rotate(0deg);
}

/* Panel body (scrollable) */
.reasoning-panel-body {
  max-height: 500px;
  overflow: auto;
  opacity: 1;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    padding 0.2s ease;
}

.reasoning-panel-body--collapsed {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.reasoning-panel-body::-webkit-scrollbar {
  width: 3px;
}
.reasoning-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.reasoning-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

/* Preview text (hidden in new design, kept for JS compat) */
.reasoning-panel-preview {
  display: none;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reasoning-panel-preview.show {
  display: block;
}
.reasoning-status-chip {
  display: none;
}
.reasoning-confidence-badge {
  display: none;
}
.reasoning-header-content {
  display: none;
}
.reasoning-icon {
  display: none;
}

/* ── Timeline ── */
.rp-timeline {
  padding: 1rem 1rem 0.5rem;
}

.rp-step-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.rp-step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

/* Orb */
.rp-orb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition:
    border-color 0.35s,
    background 0.35s;
  color: var(--text-muted);
}

.rp-orb i {
  font-size: 12px;
  transition: color 0.25s;
  color: inherit;
}

.rp-orb[data-state="active"] {
  border-color: rgba(255, 255, 255, 0.13);
  background: var(--bg-elevated);
  color: var(--text);
}

.rp-orb[data-state="done"] {
  border-color: var(--border-input);
  background: var(--bg-input);
  color: var(--text-muted);
}

/* Spinning SVG for active step 0 */
@keyframes rp-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rp-spin-wrap {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rp-spin 1.4s linear infinite;
  transform-origin: center center;
}
.rp-spin-wrap svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}

.rp-static-wrap {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rp-static-wrap svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}

.rp-connector {
  width: 1px;
  background: var(--border-input);
  flex: 1;
  min-height: 10px;
}

/* Step content */
.rp-step-content {
  padding-left: 11px;
  padding-top: 3px;
  padding-bottom: 0.9rem;
  flex: 1;
  min-width: 0;
}

.rp-step-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s;
  line-height: 1.4;
}

.rp-step-title[data-state="active"] {
  color: var(--text);
}
.rp-step-title[data-state="done"] {
  color: var(--text-muted);
}

.rp-step-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  font-weight: 300;
  opacity: 0.6;
}

/* Stream wrap */
.rp-stream-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s;
}

.rp-stream-wrap.visible {
  max-height: 160px;
  opacity: 1;
}

/* ── Redesigned chronological timeline (Apple-clean) ── */
.rp-ts-timeline {
  padding: 0.85rem 1rem 0.4rem;
}

.rp-ts-row {
  display: flex;
  align-items: flex-start;
}
.rp-ts-row .rp-step-content {
  padding-bottom: 0.55rem;
}

/* New step fades + slides in cleanly */
@keyframes rp-step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.rp-ts-row {
  animation: rp-step-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rp-ts-row.rp-enter {
  opacity: 0;
  transform: translateY(6px);
  animation: none;
}

/* Title — crisp active, receding done */
.rp-ts-row .rp-step-title {
  font-size: 12.5px;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}
.rp-ts-row[data-state="done"] .rp-step-title {
  color: var(--text-muted);
  font-weight: 450;
  opacity: 0.72;
}
.rp-ts-row[data-state="active"] .rp-step-title {
  color: var(--text);
  font-weight: 560;
  letter-spacing: -0.01em;
  opacity: 1;
}

/* ── Single continuous timeline rail ──
   One unbroken vertical line runs behind every node so all steps stay
   visually connected. Past steps are just a small dot ON the rail; the
   current step is the circular orb with the spinning SVG. */
.rp-ts-row .rp-step-left {
  position: relative;
  align-self: stretch; /* rail spans the full row height */
  width: 28px;
}
.rp-ts-row .rp-step-left::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  transform: translateX(-50%);
  background: var(--border-input);
}
/* Don't draw the rail above the first node or below the last node */
.rp-ts-row .rp-step-left--first::before {
  top: 13px;
}
.rp-ts-row .rp-step-left--last::before {
  bottom: auto;
  height: 13px;
}

/* Nodes sit on top of the rail */
.rp-ts-row .rp-orb {
  position: relative;
  z-index: 1;
}

/* Past step = just a calm dot on the rail (no surrounding circle) */
.rp-ts-row[data-state="done"] .rp-orb {
  width: auto;
  height: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}
@keyframes rp-dot-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.rp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  display: block;
  /* opaque ring in the panel colour so the rail reads as flowing into it */
  box-shadow: 0 0 0 3px var(--bg-elevated);
  animation: rp-dot-in 0.3s ease both;
}

/* Current step = the circular orb with the spinning SVG; its filled
   background masks the rail inside the circle for a crisp node. */
.rp-ts-row[data-state="active"] .rp-orb {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--bg-elevated);
}
.rp-spin-wrap {
  transition: opacity 0.3s ease;
}

/* Body reveal. Reasoning = fully visible, never scrolls (full trace stays).
   Tool output = capped + scroll so the panel stays tidy. */
.rp-ts-stream {
  transition:
    max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}
.rp-ts-stream.visible {
  max-height: 4000px;
  opacity: 1;
}
.rp-ts-stream.rp-ts-collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
}
.rp-ts-stream .rp-stream-text {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.rp-stream-text.rp-tool-body {
  white-space: normal;
  color: var(--text);
}
.rp-tool-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.72rem 0.78rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
}
.rp-tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.rp-tool-card-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.rp-tool-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.rp-tool-card-value {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}
.rp-tool-source-grid {
  display: grid;
  gap: 0.48rem;
}
.rp-tool-card-summary {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Beautifully formatted reasoning markdown */
.rp-ts-stream .rp-stream-text.rp-md {
  white-space: normal;
  color: var(--text-muted);
}
.rp-stream-text.rp-md > :first-child {
  margin-top: 0;
}
.rp-stream-text.rp-md > :last-child {
  margin-bottom: 0;
}
.rp-stream-text.rp-md p {
  margin: 0 0 0.55em;
}
.rp-stream-text.rp-md h1,
.rp-stream-text.rp-md h2,
.rp-stream-text.rp-md h3,
.rp-stream-text.rp-md h4 {
  margin: 0.8em 0 0.4em;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}
.rp-stream-text.rp-md h1 {
  font-size: 13.5px;
}
.rp-stream-text.rp-md h2 {
  font-size: 13px;
}
.rp-stream-text.rp-md h3,
.rp-stream-text.rp-md h4 {
  font-size: 12px;
}
.rp-stream-text.rp-md strong {
  color: var(--text);
  font-weight: 600;
}
.rp-stream-text.rp-md ul,
.rp-stream-text.rp-md ol {
  margin: 0.3em 0 0.6em;
  padding-left: 1.25em;
}
.rp-stream-text.rp-md li {
  margin: 0.18em 0;
}
.rp-stream-text.rp-md li::marker {
  color: var(--text-muted);
}
.rp-stream-text.rp-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
.rp-stream-text.rp-md pre {
  margin: 0.5em 0;
  padding: 0.7em 0.85em;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  overflow-x: auto;
}
.rp-stream-text.rp-md pre code {
  background: none;
  padding: 0;
  font-size: 11px;
}
.rp-stream-text.rp-md blockquote {
  margin: 0.5em 0;
  padding: 0.1em 0 0.1em 0.8em;
  border-left: 2px solid var(--border-input);
  color: var(--text-muted);
}
.rp-stream-text.rp-md a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rp-stream-text.rp-md table {
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: 11px;
}
.rp-stream-text.rp-md th,
.rp-stream-text.rp-md td {
  border: 1px solid var(--border-input);
  padding: 0.3em 0.5em;
}
.rp-stream-text.rp-md hr {
  border: 0;
  border-top: 1px solid var(--border-input);
  margin: 0.8em 0;
}

/* Keep reasoning markdown aligned with the step title text column. */
.rp-stream-wrap.rp-ts-stream .rp-stream-left {
  display: none;
}

.rp-stream-wrap.rp-ts-stream .rp-stream-content {
  padding-left: 0;
}
/* Reasoning: no inner scroll, no clipping — show all of it */
.rp-ts-stream--reasoning .rp-stream-body {
  max-height: none;
  overflow: visible;
}
/* Tool output: keep it compact with a gentle fade + scroll */
.rp-ts-stream--tool .rp-stream-body {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 10px,
    #000 calc(100% - 10px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 10px,
    #000 calc(100% - 10px),
    transparent 100%
  );
}

.rp-stream-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.rp-stream-line {
  width: 1px;
  background: var(--border-input);
  flex: 1;
}

.rp-stream-content {
  padding-left: 11px;
  padding-top: 2px;
  padding-bottom: 12px;
  flex: 1;
  min-width: 0;
}

.rp-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.rp-stream-label {
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rp-stream-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 400;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.rp-stream-toggle:hover {
  opacity: 1;
}
.rp-stream-toggle i {
  font-size: 10px;
  transition: transform 0.25s;
}
.rp-stream-toggle.collapsed i {
  transform: rotate(-90deg);
}

.rp-stream-body {
  overflow: hidden;
  max-height: 110px;
  opacity: 1;
  overflow-y: auto;
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s;
}

.rp-stream-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.rp-stream-body::-webkit-scrollbar {
  width: 2px;
}
.rp-stream-body::-webkit-scrollbar-track {
  background: transparent;
}
.rp-stream-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}

.rp-stream-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "Geist Mono", "Fira Mono", monospace;
  font-weight: 400;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer */
.rp-footer {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border-input);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  opacity: 0;
  transition: opacity 0.45s;
}
.rp-footer.show {
  opacity: 1;
}
.rp-footer i {
  font-size: 12px;
  color: #5a9e6f;
}

/* Compat: hide old activity/steps elements if they get injected */
.reasoning-activity-log {
  display: none;
}
.reasoning-steps-log {
  display: none;
}
.reasoning-meta-grid {
  display: none;
}

.reasoning-activity {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.52rem 0.58rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--border-input);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.018)
  );
}

.reasoning-activity--running {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-input));
}

.reasoning-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}

.reasoning-activity-copy {
  min-width: 0;
}

.reasoning-activity-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem;
  min-width: 0;
}

.reasoning-activity-label {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reasoning-activity-status {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reasoning-activity-detail {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rp-memory-wrap {
  display: grid;
  gap: 0.65rem;
  padding: 0 1rem 0.85rem;
}

.rp-memory-section {
  display: grid;
  gap: 0.42rem;
}

.rp-memory-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rp-memory-section-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-memory-section-count {
  flex-shrink: 0;
  min-width: 1.6rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.rp-memory-list {
  display: grid;
  gap: 0.42rem;
}

.rp-memory-item[data-memory-action="stored"] {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-input));
}

.rp-memory-item .reasoning-activity-detail {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.reasoning-highlights {
  display: grid;
  gap: 0.35rem;
}

.reasoning-highlight {
  display: flex;
  align-items: flex-start;
  gap: 0.48rem;
  padding: 0.45rem 0.5rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  background: transparent;
}

.reasoning-highlight-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.33rem;
  border-radius: 999px;
  background: var(--text-faint);
}

.reasoning-highlight-copy {
  flex: 1;
  min-width: 0;
}

.reasoning-highlight-meta {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  margin-bottom: 0.14rem;
  flex-wrap: wrap;
}

.reasoning-highlight-step {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reasoning-highlight-confidence {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.34rem;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.reasoning-highlight-text {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reasoning-panel a,
.reasoning-panel code,
.reasoning-panel .msg-prose,
.reasoning-panel .msg-prose * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reasoning-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.35rem;
}

.reasoning-meta-chip {
  display: grid;
  gap: 0.08rem;
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  background: transparent;
}

.reasoning-meta-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
}

.reasoning-meta-value {
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--text);
}

html[data-theme="light"] .reasoning-toggle-btn:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .reasoning-panel-header {
    padding: 0.58rem 0.64rem;
  }

  .reasoning-panel-body {
    padding: 0 0.64rem 0.64rem;
  }

  .reasoning-panel-preview {
    white-space: normal;
  }

  .reasoning-meta-grid {
    grid-template-columns: 1fr;
  }

  .message-sources-grid {
    grid-template-columns: 1fr;
  }

  .fusion-ask-modal.is-visible {
    max-height: var(--ask-modal-max-height, min(82svh, 720px));
    padding: 0.72rem;
    gap: 0.65rem;
  }

  .fusion-ask-modal-card .fusion-inline-option-list {
    grid-template-columns: 1fr;
  }

  .fusion-ask-modal-card .fusion-inline-prompt-textarea {
    min-height: 56px;
  }
}

.message-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.55rem;
}

.message-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.message-nav-label {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.message-edit-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.role-user .message-edit-actions {
  justify-content: flex-end;
}

.message-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.message-edit-actions .message-edit-btn {
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  flex-shrink: 0;
}

.message-edit-actions .message-edit-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.message-edit-actions .message-edit-btn:hover {
  color: var(--text);
  border-color: var(--border-input);
  background: var(--bg-elevated);
}

.message-editing-box {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.message-editing-box textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 0.8rem;
  resize: vertical;
}

.msg-bubble-editing {
  width: min(100%, 680px);
  padding: 0;
  overflow: hidden;
}

.message-editing-textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  padding: 0.9rem 1rem;
}

.message-editing-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

/* Artifact cards in messages */
.artifact-card-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.artifact-card {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: inherit;
}
.artifact-card:hover {
  border-color: var(--accent);
}
.artifact-card-filetype {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.artifact-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.artifact-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.artifact-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-card-cta {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.1rem;
}

@keyframes artifact-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.artifact-card-pop-in {
  animation: artifact-pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Wrapper and actions for artifact cards to host control buttons */
.artifact-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.artifact-card-actions {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.5rem;
}
.artifact-continue-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
  border-radius: 10px;
}

/* ── ARTIFACT CREATION CARD ─────────────────────────────────── */
.artifact-loading-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.65rem;
}
.artifact-loading-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-raised) 92%, transparent),
      color-mix(in srgb, var(--surface-1) 86%, transparent)
    ),
    var(--accent-radial-soft);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.artifact-loading-icon-shell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
}

.artifact-loading-icon-shell::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  border-right-color: rgba(255, 255, 255, 0.22);
  animation: artifact-ring-spin 0.95s linear infinite;
  animation-delay: var(--artifact-spinner-delay, 0s);
  will-change: transform;
  transform-origin: center;
  backface-visibility: hidden;
}

.artifact-loading-logo {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.92;
  transform: translateZ(0);
}

.artifact-loading-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes artifact-ring-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.artifact-loading-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.14rem;
}

.artifact-loading-topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}

.artifact-loading-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.artifact-loading-type {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.38rem;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.artifact-loading-title {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-loading-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .artifact-loading-bar {
  background:
    radial-gradient(
      circle at top left,
      rgba(var(--accent-rgb), 0.08),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96),
      rgba(244, 246, 248, 0.92)
    );
}

/* ── THINKING BAR ────────────────────────────────────────────── */
.thinking-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}
.thinking-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.thinking-dots {
  display: flex;
  gap: 4px;
}
.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: thinking-pulse 1.2s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes thinking-pulse {
  0%,
  80%,
  100% {
    transform: scale(0.75);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.thinking-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.thinking-text {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

.assistant-plan-panel {
  margin-top: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
}

.assistant-plan-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.assistant-plan-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.assistant-plan-body {
  color: var(--text);
}

.assistant-plan-body > :last-child {
  margin-bottom: 0;
}

.assistant-plan-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.95rem;
}

.assistant-plan-implement-btn {
  min-width: 220px;
  text-align: center;
}

.assistant-plan-implement-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: color-mix(in srgb, var(--accent) 60%, var(--bg-elevated));
  transform: none;
}

/* ── INPUT AREA ──────────────────────────────────────────────── */
.input-area {
  padding: 0.75rem max(1rem, var(--safe-area-right))
    calc(0.9rem + var(--resolved-safe-bottom)) max(1rem, var(--safe-area-left));
  background: linear-gradient(to bottom, transparent, var(--bg) 40%);
  flex-shrink: 0;
}
.input-container {
  max-width: 700px;
  margin: 0 auto;
}

.input-shell {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-xl);
  padding: 0.85rem 0.85rem 0.75rem 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.input-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
html[data-theme="light"] .input-shell:focus-within {
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.input-field {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  resize: none;
  max-height: 200px;
  outline: none;
  padding: 0;
  /* hide scrollbar up/down arrow buttons */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.input-field::placeholder {
  color: var(--text-faint);
}
.input-field::-webkit-scrollbar {
  width: 4px;
}
.input-field::-webkit-scrollbar-track {
  background: transparent;
}
.input-field::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.input-field::-webkit-scrollbar-button {
  display: none;
  height: 0;
}

/* Row that wraps the upload prefix button + textarea + send button */
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  width: 100%;
}
.input-row .input-field {
  flex: 1;
}

/* Upload button sitting to the left of the textarea */
.attach-prefix-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  /* sits flush with last line of textarea text */
  padding: 0;
  line-height: 1;
}
.attach-prefix-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-input);
}
.attach-prefix-btn.has-files {
  color: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(100%, 320px);
  padding: 0.42rem 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.attachment-chip-uploading,
.attachment-chip-processing {
  border-color: rgba(var(--accent-rgb), 0.32);
}

.attachment-chip-failed {
  border-color: rgba(239, 68, 68, 0.45);
}

.attachment-thumb,
.attachment-file-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
}

.attachment-thumb {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.attachment-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.attachment-chip-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.attachment-chip-name,
.attachment-chip-meta,
.attachment-chip-error {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip-name {
  color: var(--text);
  font-weight: 600;
}

.attachment-chip-meta {
  color: var(--text-faint);
}

.attachment-chip-error {
  color: var(--danger, #ef4444);
}

.attachment-chip .attachment-ai-label {
  margin-top: 0.45rem;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 600;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.attachment-chip .attachment-ai-label:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.48);
  transform: translateY(-1px);
}

.attachment-chip button {
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
}

.attachment-chip-remove {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attachment-chip-remove svg {
  width: 14px;
  height: 14px;
  display: block;
}

.input-area.auoura-composer.is-dragging-files .glow-box {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.38),
    0 18px 50px rgba(0, 0, 0, 0.55);
}

.role-user .attachment-list {
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.role-user .attachment-chip {
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}
.role-user .attachment-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: color-mix(
    in srgb,
    var(--bg-elevated) 80%,
    rgba(var(--accent-rgb), 0.08)
  );
}
.role-user .attachment-chip:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 2px;
}
.role-user .attachment-chip-clickable:active {
  transform: scale(0.985);
}

.msg-bubble.is-attachment-only {
  display: none;
}

/* Lock down text selection on UI chrome. Only chat messages, artifact
   previews, attachment previews, and form inputs are selectable. */
html,
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#messages,
#messages *,
.msg-bubble,
.msg-bubble *,
.artifact-markdown,
.artifact-markdown *,
.artifact-code-pane,
.artifact-code-pane *,
.attachment-preview-body,
.attachment-preview-body *,
input,
textarea,
[contenteditable="true"],
[contenteditable="true"] *,
[data-app-selectable],
[data-app-selectable] * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.app-context-menu {
  position: fixed;
  z-index: 400;
  min-width: 180px;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
}
.app-context-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: inherit;
}
.app-context-menu-item:hover:not(:disabled),
.app-context-menu-item:focus-visible {
  background: color-mix(
    in srgb,
    var(--bg-elevated) 60%,
    rgba(var(--accent-rgb), 0.18)
  );
  outline: none;
}
.app-context-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}
.app-context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.long-press-active {
  transform: scale(0.985);
  transition: transform 0.12s ease;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.45);
}

.attachment-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.attachment-preview-modal.visible {
  opacity: 1;
  pointer-events: auto;
}
.attachment-preview-shell {
  width: min(100%, 960px);
  max-height: min(92svh, 820px);
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  box-shadow: var(--shadow-lg, 0 28px 72px rgba(0, 0, 0, 0.32));
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease;
}
.attachment-preview-modal.visible .attachment-preview-shell {
  transform: translateY(0) scale(1);
}
.attachment-preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}
.attachment-preview-titles {
  flex: 1;
  min-width: 0;
}
.attachment-preview-name {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.attachment-preview-download {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
.attachment-preview-download:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
}
.attachment-preview-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.attachment-preview-close:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
}
.attachment-preview-body {
  overflow: auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
}
.attachment-preview-body img.attachment-preview-image {
  max-width: 100%;
  max-height: 72svh;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}
.attachment-preview-body iframe.attachment-preview-iframe {
  width: 100%;
  height: 72svh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.attachment-preview-body pre.attachment-preview-text {
  width: 100%;
  max-height: 72svh;
  overflow: auto;
  margin: 0;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}
.attachment-preview-body .attachment-preview-empty {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: 0.92rem;
}
.attachment-preview-body .attachment-preview-empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.attachment-ai-detection-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 9, 12, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.attachment-ai-detection-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.attachment-ai-detection-shell {
  width: min(640px, 100%);
  max-height: min(82svh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: color-mix(
    in srgb,
    var(--bg-elevated) 92%,
    rgba(255, 255, 255, 0.04)
  );
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(16px) scale(0.985);
  transition: transform 0.18s ease;
}

.attachment-ai-detection-modal.visible .attachment-ai-detection-shell {
  transform: translateY(0) scale(1);
}

.attachment-ai-detection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  text-align: center;
  position: relative;
}

.attachment-ai-detection-headline {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}

.attachment-ai-detection-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.attachment-ai-detection-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.attachment-ai-detection-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  word-break: break-word;
}

.attachment-ai-detection-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  position: absolute;
  right: 0.9rem;
  top: 0.75rem;
}

.attachment-ai-detection-close:hover {
  color: var(--text);
  border-color: var(--border-input);
}

.attachment-ai-detection-body {
  padding: 0.9rem 1.1rem 1.1rem;
  display: grid;
  gap: 0.9rem;
  overflow: auto;
  color: var(--text);
  text-align: center;
}

.attachment-ai-detection-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  max-width: 520px;
  margin: 0 auto;
}

.attachment-ai-detection-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  text-align: center;
  justify-items: center;
}

.attachment-ai-detection-card--wide {
  grid-column: span 2;
}

.attachment-ai-detection-card-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.attachment-ai-detection-card-value {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.attachment-ai-detection-section {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.attachment-ai-detection-section-title {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.attachment-ai-detection-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  max-width: 560px;
  margin: 0 auto;
}

.attachment-ai-detection-signal {
  display: grid;
  gap: 0.3rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  text-align: center;
  justify-items: center;
}

.attachment-ai-detection-signal-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.attachment-ai-detection-signal-value {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text);
}

.attachment-ai-detection-note {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.attachment-ai-detection-footnote {
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 520px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .attachment-ai-detection-bento {
    grid-template-columns: 1fr;
  }
  .attachment-ai-detection-card--wide {
    grid-column: span 1;
  }
  .attachment-ai-detection-signals {
    grid-template-columns: 1fr;
  }
  .attachment-ai-detection-close {
    right: 0.7rem;
    top: 0.7rem;
  }
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.composer-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.composer-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;

  /* Disabled state for tool buttons (visual + non-interactive) */
  .composer-tool-btn.disabled {
    opacity: 0.45;
    filter: grayscale(30%);
    pointer-events: none;
    cursor: default;
  }
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.composer-tool-btn:hover,
.composer-tool-btn.active {
  background: var(--bg-elevated);
  border-color: var(--border-input);
  color: var(--text);
}

.input-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  padding: 0;
  line-height: 1;
  background: var(--send-bg);
  color: var(--send-fg);
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.1s,
    background 0.15s;
  box-shadow: none;
  animation: none;
}
.send-btn:not(.send-btn-cancel) {
  box-shadow: none !important;
  animation: none !important;
}
.send-btn:hover:not(:disabled) {
  transform: scale(1.06);
}
.send-btn:disabled {
  background: var(--send-disabled);
  color: var(--text-faint);
  cursor: not-allowed;
}
.send-btn-cancel {
  background: var(--danger, #ef4444) !important;
  color: #fff !important;
  animation: cancel-pulse 1.6s ease-in-out infinite;
}
.send-btn-cancel:hover {
  transform: scale(1.08);
  opacity: 0.92;
}
@keyframes cancel-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* ── COMPOSER ORB — absolutely centred so toggle widths can't shift it ── */
.composer-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.composer-orb-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 1;
}

.composer-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

.orb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  color: #ffffff;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.orb-btn svg {
  width: 30px;
  height: 30px;
  display: block;
}
.orb-btn:hover {
  opacity: 0.7;
}

/* Spin during generation */
.orb-btn.orb-spinning {
  color: #ffffff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.35));
}
.orb-btn.orb-spinning svg {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: orb-spin 1.4s linear infinite;
}
@keyframes orb-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Flash red when risk is detected */
.orb-btn.orb-risk {
  animation: orb-risk-flash 0.45s ease-in-out 5;
  color: var(--danger, #ef4444);
}
@keyframes orb-risk-flash {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 0px #ef4444);
  }
  50% {
    opacity: 0.2;
    filter: drop-shadow(0 0 10px #ef4444);
  }
}

/* Glow twice when generation completes */
.orb-btn.orb-done {
  animation: orb-done-glow 1.4s ease-in-out 1 forwards;
  color: #ffffff;
}
@keyframes orb-done-glow {
  0% {
    filter: drop-shadow(0 0 0px #fff);
    opacity: 1;
  }
  20% {
    filter: drop-shadow(0 0 14px #fff);
    opacity: 1;
  }
  40% {
    filter: drop-shadow(0 0 2px #fff);
    opacity: 0.55;
  }
  60% {
    filter: drop-shadow(0 0 14px #fff);
    opacity: 1;
  }
  80% {
    filter: drop-shadow(0 0 2px #fff);
    opacity: 0.55;
  }
  100% {
    filter: drop-shadow(0 0 0px #fff);
    opacity: 1;
  }
}

/* Risk popover — pops up from the orb */
.input-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.25rem 0;
  font-size: 0.73rem;
  color: var(--text-faint);
  border: none !important;
  border-left: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* ── AUOURA COMPOSER ────────────────────────────────────────── */
.input-area.auoura-composer {
  --composer-bg: #000;
  --composer-panel: #111317;
  --composer-panel-2: #0d0f12;
  --composer-border: rgba(255, 255, 255, 0.08);
  --composer-text: #fff;
  --composer-muted: rgba(255, 255, 255, 0.62);
  --composer-cyan: 0, 255, 255;
  width: min(920px, 100%);
  margin: auto auto 0;
  --composer-panel-clearance: 0px;
  /* Anchor composer to the viewport bottom; internal padding handles safe-area */
  padding: 0 max(0.75rem, var(--safe-area-right)) calc(0.95rem)
    max(0.75rem, var(--safe-area-left));
  background: transparent !important;
  box-sizing: border-box;
  position: sticky;
  bottom: 0;
  z-index: 12;
}

@media (max-width: 900px) {
  .input-area.auoura-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0; /* keep flush to viewport bottom */
    padding: 0 max(0.75rem, var(--safe-area-right)) calc(0.95rem)
      max(0.75rem, var(--safe-area-left));
    width: 100%;
    z-index: 999;
  }

  .input-area.auoura-composer .input-container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 920px;
    margin: 0 auto;
  }

  .messages {
    padding-bottom: calc(6.5rem + constant(safe-area-inset-bottom));
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
}

.input-area.auoura-composer .input-container {
  display: flex;
  justify-content: center;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

/* Ensure internal composer card honors the safe-area inset so visible card sits above home indicator */
.input-area.auoura-composer .glow-box {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.input-area.auoura-composer * {
  box-sizing: border-box;
}

.input-area.auoura-composer .input-shell {
  position: relative;
  width: 100%;
  gap: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.input-area.auoura-composer .input-glow-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border-radius: 26px;
  isolation: isolate;
}

.input-area.auoura-composer .halo {
  position: absolute;
  inset: -16px;
  border-radius: 28px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle at 50% 50%,
    var(--halo-c1, rgba(var(--accent-rgb), 0.18)),
    var(--halo-c2, rgba(var(--accent-rgb), 0.08)) 38%,
    transparent 72%
  );
  filter: blur(28px);
  opacity: var(--halo, 0);
  transform: scale(1);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    background 0.2s linear;
  will-change: opacity, transform, background;
}

.input-area.auoura-composer .glow {
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    circle at var(--x, 5%) var(--y, 9%),
    var(--gc1, rgba(var(--accent-rgb), 0.95)) 0%,
    var(--gc2, rgba(var(--accent-rgb), 0.45)) 18%,
    transparent 48%
  );
  filter: blur(calc(10px + 6px * var(--g, 0)));
  opacity: calc(var(--g, 0) * 1);
  transition:
    background 0.16s linear,
    opacity 0.12s linear;
  will-change: opacity, filter, background-position;
}

/* ── Voice mode: glow wraps all around, reacts to mic ──────── */
.input-glow-wrapper:has(.glow-box.voice-mode-active) .glow {
  --x: 50%;
  --y: 50%;
  inset: -16px;
  border-radius: 36px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--accent-rgb), calc(0.80 + var(--voice-energy, 0) * 0.95)) 0%,
    rgba(var(--accent-rgb), calc(0.45 + var(--voice-energy, 0) * 0.45)) 18%,
    rgba(var(--accent-rgb), calc(0.14 + var(--voice-energy, 0) * 0.20)) 38%,
    transparent 58%
  );
  filter: blur(calc(16px + 14px * var(--voice-level, 0)));
  opacity: calc(0.50 + var(--voice-energy, 0) * 0.80);
  transform: scale(calc(1.00 + var(--voice-level, 0) * 0.06));
  transition:
    filter 0.10s ease-out,
    opacity 0.10s ease-out,
    transform 0.08s ease-out;
}

.input-area.auoura-composer .glow-box {
  position: relative;
  z-index: 2;
  overflow: hidden;
  margin: 0 auto;
  border-radius: 26px;
  --voice-level: 0;
  --voice-energy: 0;
  --voice-emotion-rgb: var(--accent-rgb);
  --voice-transition-x: 50%;
  --voice-transition-y: 50%;
  --voice-transition-radius: 180%;
  transform-origin: var(--voice-transition-x) var(--voice-transition-y);
  transform: translateY(0);
  background: linear-gradient(
    180deg,
    rgba(20, 22, 26, 0.98),
    rgba(12, 14, 18, 0.98)
  );
  border: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transition:
    padding 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    height 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    min-height 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    background 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    filter 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: height, min-height, transform, box-shadow, background, padding,
    filter;
}

.input-area.auoura-composer .glow-box.voice-mode-active {
  height: var(
    --voice-panel-height,
    156px
  );
  min-height: var(
    --voice-panel-height,
    156px
  );
  max-height: var(
    --voice-panel-height,
    156px
  );
  padding-bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 22, 26, 0.98),
    rgba(12, 14, 18, 0.98)
  );
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(var(--voice-emotion-rgb), 0.10) inset;
  transform: translateY(-2px) scale(1.003);
  filter: saturate(1.03);
}

.input-area.auoura-composer .glow-box.voice-mode-active .input-row,
.input-area.auoura-composer .glow-box.voice-mode-active .input-footer {
  opacity: 0 !important;
  pointer-events: none !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  transform: translateY(10px) scale(0.985);
  filter: blur(6px) saturate(0.9);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    margin 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* In voice mode the composer toolbar is collapsed, but its child
   .orb-style-panel (absolutely positioned) must stay visible when open. */
.input-area.auoura-composer .glow-box.voice-mode-active .composer-toolbar {
  opacity: 0 !important;
  pointer-events: none !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
  transform: translateY(8px) scale(0.985);
  filter: blur(5px) saturate(0.9);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    margin 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* The orb-style-panel lives inside the collapsed toolbar; restore its
   visibility and interactivity when it's open. */
.input-area.auoura-composer .glow-box.voice-mode-active .composer-toolbar .orb-style-panel:not(.hidden) {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.input-area.auoura-composer .voice-reactor {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.input-area.auoura-composer .glow-box.voice-mode-active .voice-reactor {
  opacity: 1;
  transform: scale(1);
}

.input-area.auoura-composer .voice-reactor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--voice-emotion-rgb), calc(0.06 + var(--voice-energy) * 0.10)) 0%,
    transparent 55%
  );
  opacity: calc(0.12 + var(--voice-energy) * 0.18);
  transform: scale(calc(0.96 + var(--voice-level) * 0.08));
}

.input-area.auoura-composer .voice-reactor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(50%, 140px);
  height: min(50%, 140px);
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(var(--voice-emotion-rgb), calc(0.06 + var(--voice-energy) * 0.08)) 0%,
    transparent 70%
  );
  filter: blur(calc(6px + 8px * var(--voice-level)));
  opacity: calc(0.10 + var(--voice-energy) * 0.16);
  transform: translate(-50%, -50%) scale(calc(0.94 + var(--voice-level) * 0.12));
}

.input-area.auoura-composer .voice-reactor-core {
  position: absolute;
  left: 50%;
  bottom: 12px;
  top: auto;
  width: min(82%, 360px);
  height: min(64%, 164px);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.input-area.auoura-composer .voice-bars {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(6px, 1.4vw, 12px);
  padding: 6px 8px 2px;
  box-sizing: border-box;
}

.input-area.auoura-composer .voice-bar {
  --bar-width: 10px;
  --bar-color: rgba(var(--voice-emotion-rgb), 0.9);
  flex: 1 1 0;
  max-width: var(--bar-width);
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(var(--voice-emotion-rgb), 0.08) 0%,
    rgba(var(--voice-emotion-rgb), 0.44) 42%,
    rgba(var(--voice-emotion-rgb), 0.94) 100%
  );
  border-radius: 999px 999px 10px 10px;
  transform-origin: bottom center;
  transform: scaleY(calc(0.14 + var(--voice-level, 0) * var(--bar-mult, 1)));
  opacity: calc(0.22 + var(--voice-energy, 0) * 0.78);
  filter: blur(0.3px) saturate(128%);
  box-shadow:
    0 0 18px
      rgba(var(--voice-emotion-rgb), calc(0.1 + var(--voice-energy) * 0.16)),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transition:
    transform 0.08s linear,
    opacity 0.12s linear,
    filter 0.12s linear,
    box-shadow 0.12s linear;
}

.input-area.auoura-composer .voice-bar:nth-child(1) {
  --bar-mult: 0.38;
}
.input-area.auoura-composer .voice-bar:nth-child(2) {
  --bar-mult: 0.54;
}
.input-area.auoura-composer .voice-bar:nth-child(3) {
  --bar-mult: 0.78;
}
.input-area.auoura-composer .voice-bar:nth-child(4) {
  --bar-mult: 1;
}
.input-area.auoura-composer .voice-bar:nth-child(5) {
  --bar-mult: 1.18;
}
.input-area.auoura-composer .voice-bar:nth-child(6) {
  --bar-mult: 1.18;
}
.input-area.auoura-composer .voice-bar:nth-child(7) {
  --bar-mult: 1;
}
.input-area.auoura-composer .voice-bar:nth-child(8) {
  --bar-mult: 0.78;
}
.input-area.auoura-composer .voice-bar:nth-child(9) {
  --bar-mult: 0.54;
}
.input-area.auoura-composer .voice-bar:nth-child(10) {
  --bar-mult: 0.38;
}

.input-area.auoura-composer .voice-reactor-ring {
  position: absolute;
  left: 50%;
  bottom: 6px;
  top: auto;
  border-radius: 999px;
  transform: translateX(-50%);
  border: 1px solid rgba(var(--voice-emotion-rgb), 0.12);
  box-shadow:
    0 0 0 1px rgba(var(--voice-emotion-rgb), 0.04) inset,
    0 0 28px rgba(var(--voice-emotion-rgb), 0.12);
  opacity: 0.22;
  animation: voice-reactor-breathe 3s ease-in-out infinite;
}

.input-area.auoura-composer .voice-reactor-ring--inner {
  width: 128px;
  height: 128px;
}

.input-area.auoura-composer .voice-reactor-ring--outer {
  width: 212px;
  height: 212px;
  animation-duration: 3.6s;
}

@keyframes voice-reactor-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(0.96);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

.input-area.auoura-composer .glow-box.fusion-ask-open {
  padding-top: 0.85rem;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.58);
}

/* Tighter spacing when running as a homescreen/standalone app */
body.is-standalone-app .input-area.auoura-composer {
  padding-bottom: 0; /* composer anchored flush */
}
body.is-standalone-app .input-area.auoura-composer .glow-box {
  /* use a clamped safe inset to avoid large PWA shell gaps */
  padding-bottom: calc(0.25rem + var(--glow-safe-bottom));
}
body.is-standalone-app .input-area.auoura-composer .composer-orb-wrap {
  top: auto;
  bottom: calc(0.125rem + var(--glow-safe-bottom));
  transform: translateX(-50%);
}
body.is-standalone-app .messages {
  /* smaller final gap to counter iOS homescreen shell inflation */
  padding-bottom: calc(
    var(--composer-height) + var(--glow-safe-bottom) - 0.25rem
  );
}

/* When the orb style panel is open allow the panel to overflow the glow box
   so it isn't clipped on desktop (desktop behaviour previously relied on
   the mobile fixed layout). */
.input-area.auoura-composer.orb-panel-open .glow-box {
  overflow: visible;
}

.input-area.auoura-composer .attachment-list {
  gap: 0.5rem;
  padding: 12px 12px 0;
  position: relative;
  z-index: 1;
}

.input-area.auoura-composer .attachment-chip {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
}

.input-area.auoura-composer .input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 14px 12px;
  position: relative;
  z-index: 1;
}

.input-area.auoura-composer .input-field {
  flex: 1;
  min-width: 0;
  min-height: 23px;
  max-height: min(240px, 34vh);
  overflow: hidden;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--composer-text);
  font-size: 16px;
  line-height: 1.45;
  caret-color: rgb(0, 255, 255);
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.input-area.auoura-composer .input-field::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.input-area.auoura-composer .attach-prefix-btn,
.input-area.auoura-composer .send-btn,
.input-area.auoura-composer .composer-tool-btn,
.input-area.auoura-composer .orb-btn,
.input-area.auoura-composer .risk-popover-dismiss {
  appearance: none;
  border: 0;
  outline: none;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.18s ease;
}

.input-area.auoura-composer .attach-prefix-btn,
.input-area.auoura-composer .send-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.input-area.auoura-composer .send-btn:not(.send-btn-cancel) {
  box-shadow: none;
  animation: none;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.input-area.auoura-composer .attach-prefix-btn:hover,
.input-area.auoura-composer .send-btn:hover,
.input-area.auoura-composer .composer-tool-btn:hover,
.input-area.auoura-composer .orb-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.input-area.auoura-composer .send-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.input-area.auoura-composer .composer-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 14px;
  z-index: 1;
}

.input-area.auoura-composer .composer-toolbar-left,
.input-area.auoura-composer .composer-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.input-area.auoura-composer .composer-toolbar-left {
  flex: 1 1 0;
  position: relative;
}

.input-area.auoura-composer .composer-toolbar-right {
  flex: 1 1 0;
  justify-content: flex-end;
}

.input-area.auoura-composer .composer-tool-btn {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-area.auoura-composer .voice-mode-btn {
  min-width: 86px;
}

.input-area.auoura-composer .voice-mode-btn svg {
  flex-shrink: 0;
}

.input-area.auoura-composer .composer-tool-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-area.auoura-composer .conversation-todo-btn {
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 auto;
}

.input-area.auoura-composer .conversation-todo-btn.hidden {
  display: none !important;
}

.input-area.auoura-composer .conversation-todo-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(520px, calc(100vw - 24px));
  max-height: min(72svh, 560px);
  overflow: visible;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--composer-panel) 96%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
  z-index: 30;
}

.input-area.auoura-composer .conversation-todo-panel.hidden {
  display: none !important;
}

.input-area.auoura-composer .conversation-todo-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.input-area.auoura-composer .conversation-todo-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.input-area.auoura-composer .conversation-todo-summary {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.input-area.auoura-composer .conversation-todo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.input-area.auoura-composer .conversation-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  min-height: 100%;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-area.auoura-composer .conversation-todo-item input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.input-area.auoura-composer .conversation-todo-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.input-area.auoura-composer .conversation-todo-text {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

.input-area.auoura-composer
  .conversation-todo-item.is-completed
  .conversation-todo-text,
.input-area.auoura-composer
  .conversation-todo-item.is-cancelled
  .conversation-todo-text {
  text-decoration: line-through;
  opacity: 0.7;
}

.input-area.auoura-composer .conversation-todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.input-area.auoura-composer .conversation-todo-status,
.input-area.auoura-composer .conversation-todo-priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.48rem;
  font-size: 0.67rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.input-area.auoura-composer .conversation-todo-status--completed {
  background: rgba(74, 222, 128, 0.14);
  color: #9ae6b4;
}

.input-area.auoura-composer .conversation-todo-status--in_progress {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.input-area.auoura-composer .conversation-todo-status--cancelled {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

html[data-theme="light"] .input-area.auoura-composer .conversation-todo-panel {
  border-color: rgba(15, 23, 42, 0.08);
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .input-area.auoura-composer .conversation-todo-item {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .input-area.auoura-composer .conversation-todo-status,
html[data-theme="light"]
  .input-area.auoura-composer
  .conversation-todo-priority {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.68);
}

.input-area.auoura-composer .composer-tool-btn.active {
  background: rgba(0, 255, 255, 0.08);
  border-color: rgba(0, 255, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.06) inset;
}

.input-area.auoura-composer .composer-orb-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 3;
}

@media (max-width: 900px) {
  /* Lower the orb on small screens so it's closer to the bottom of the glow-box */
  .input-area.auoura-composer .composer-orb-wrap {
    top: auto;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
  }
}

.input-area.auoura-composer .orb-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.input-area.auoura-composer .orb-btn.orb-panel-open {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.22),
    rgba(var(--accent-rgb), 0.08)
  );
  border-color: rgba(var(--accent-rgb), 0.36);
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(var(--accent-rgb), 0.16);
  transform: translateY(-1px);
}

.voice-mode-modal {
  position: absolute;
  inset: 0;
  z-index: 1400;
  display: block;
  padding: 0;
  background: transparent;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: auto;
  opacity: 1;
  clip-path: circle(
    var(--voice-transition-radius, 180%) at var(--voice-transition-x, 50%)
      var(--voice-transition-y, 50%)
  );
  transform-origin: var(--voice-transition-x, 50%) var(--voice-transition-y, 50%);
  transform: scale(1);
  filter: blur(0) saturate(1);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, clip-path, transform, filter;
}

.voice-mode-modal.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: circle(
    0px at var(--voice-transition-x, 50%) var(--voice-transition-y, 50%)
  );
  transform: scale(0.965);
  filter: blur(10px) saturate(0.92);
}

.voice-mode-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border-radius: inherit;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
  transform-origin: var(--voice-transition-x, 50%) var(--voice-transition-y, 50%);
  transform: translateY(0) scale(1);
  filter: blur(0) saturate(1);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

.voice-mode-modal.hidden .voice-mode-shell {
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  filter: blur(12px) saturate(0.9);
}

.voice-mode-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

.voice-mode-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: stretch;
  gap: 4px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding: 8px 0 6px;
  overflow: hidden;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.voice-mode-modal.hidden .voice-mode-stage {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}



.voice-mode-copy {
  display: none;
}

.voice-mode-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.92);
}

.voice-mode-title {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.voice-mode-status {
  margin: 0;
  max-width: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
  padding: 2px 12px 6px;
}

.voice-mode-visual-shell {
  width: 100%;
  position: relative;
  display: grid;
  place-items: center;
  gap: 0;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  padding: 1px 0 0;
}

/* ── Voice mode camera strip ──────────────────────────────── */
.voice-mode-camera-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.92);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    max-height 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
    padding 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.voice-mode-camera-strip.active {
  max-height: 100%;
  padding: 0;
}

.voice-mode-camera-strip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  display: block;
}

.voice-mode-camera-capture-btn,
.voice-mode-camera-close-btn {
  position: absolute;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 12;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.18s ease;
}

.voice-mode-camera-capture-btn {
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  opacity: 0.7;
}

.voice-mode-camera-capture-btn:hover {
  opacity: 1;
}

.voice-mode-camera-close-btn {
  right: 14px;
  opacity: 0.7;
}

.voice-mode-camera-close-btn:hover {
  opacity: 1;
}

.voice-mode-camera-capture-btn:hover,
.voice-mode-camera-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.voice-mode-orb {
  position: relative;
  width: 120px;
  height: 120px;
  max-width: 70%;
  max-height: 70%;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  border: none;
  box-shadow: none;
  flex-shrink: 0;
  pointer-events: none;
  --voice-level: 0;
  --voice-energy: 0;
  --voice-emotion-rgb: var(--accent-rgb);
}

.voice-mode-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--voice-emotion-rgb), calc(0.14 + var(--voice-energy) * 0.20)) 0%,
    rgba(var(--voice-emotion-rgb), calc(0.06 + var(--voice-energy) * 0.08)) 40%,
    transparent 68%
  );
  opacity: calc(0.20 + var(--voice-energy) * 0.35);
  transform: scale(calc(0.92 + var(--voice-level) * 0.16));
  filter: blur(calc(4px + 6px * var(--voice-level))) saturate(120%);
  transition:
    transform 0.10s ease-out,
    opacity 0.15s ease-out;
}

.voice-mode-camera-strip.active ~ .voice-mode-orb {
  z-index: 11;
  cursor: pointer;
  width: 68px;
  height: 68px;
  max-width: 68px;
  max-height: 68px;
  border: 2.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.45);
  transition:
    width 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    height 0.25s cubic-bezier(0.25, 0.1, 0.25, 1),
    border 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.voice-mode-camera-strip.active ~ .voice-mode-orb:hover {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.28),
    0 10px 34px rgba(0, 0, 0, 0.55);
}

.voice-mode-camera-strip.active ~ .voice-mode-orb .voice-mode-glow {
  opacity: 0.35;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    transparent 68%
  );
}

.voice-mode-orb.listening .voice-mode-glow {
  opacity: calc(0.32 + var(--voice-energy) * 0.52);
}

.voice-mode-bars,
.voice-mode-orb-ring {
  display: none !important;
  pointer-events: none;
}

.voice-mode-bars {
  left: 14px;
  right: 14px;
  bottom: 10px;
  top: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(4px, 1vw, 8px);
}

.voice-mode-bar {
  --bar-color: rgba(var(--voice-emotion-rgb), 0.92);
  flex: 1 1 0;
  height: 100%;
  max-width: 12px;
  align-self: flex-end;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(
    180deg,
    rgba(var(--voice-emotion-rgb), 0.08) 0%,
    rgba(var(--voice-emotion-rgb), 0.42) 44%,
    rgba(var(--voice-emotion-rgb), 0.92) 100%
  );
  box-shadow:
    0 0 24px
      rgba(var(--voice-emotion-rgb), calc(0.08 + var(--voice-energy) * 0.18)),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transform-origin: bottom center;
  transform: scaleY(calc(0.14 + var(--voice-level, 0) * var(--bar-mult, 1)));
  opacity: calc(0.24 + var(--voice-energy, 0) * 0.76);
  filter: blur(0.2px) saturate(120%);
  transition:
    transform 0.08s linear,
    opacity 0.12s linear,
    box-shadow 0.12s linear;
}

.voice-mode-orb-ring {
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(var(--voice-emotion-rgb), 0.14);
  box-shadow:
    0 0 0 1px rgba(var(--voice-emotion-rgb), 0.04) inset,
    0 0 36px rgba(var(--voice-emotion-rgb), 0.12);
  opacity: calc(0.16 + var(--voice-energy) * 0.18);
  animation: voice-mode-reactor-breathe 3.2s ease-in-out infinite;
}

.voice-mode-orb-ring--inner {
  bottom: 10px;
  width: min(42%, 160px);
  height: calc(28px + (18px * var(--voice-level)));
}

.voice-mode-orb-ring--outer {
  bottom: 2px;
  width: min(64%, 240px);
  height: calc(44px + (28px * var(--voice-level)));
  animation-duration: 4s;
}

.voice-mode-bar:nth-child(1) {
  --bar-mult: 0.42;
}
.voice-mode-bar:nth-child(2) {
  --bar-mult: 0.62;
}
.voice-mode-bar:nth-child(3) {
  --bar-mult: 0.88;
}
.voice-mode-bar:nth-child(4) {
  --bar-mult: 1.08;
}
.voice-mode-bar:nth-child(5) {
  --bar-mult: 1.24;
}
.voice-mode-bar:nth-child(6) {
  --bar-mult: 1.24;
}
.voice-mode-bar:nth-child(7) {
  --bar-mult: 1.08;
}
.voice-mode-bar:nth-child(8) {
  --bar-mult: 0.88;
}
.voice-mode-bar:nth-child(9) {
  --bar-mult: 0.62;
}
.voice-mode-bar:nth-child(10) {
  --bar-mult: 0.42;
}

@keyframes voice-mode-reactor-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(0.98);
  }
  50% {
    transform: translateX(-50%) scale(1.03);
  }
}

.voice-mode-readout {
  width: 100%;
  display: grid;
  gap: 6px;
}

.voice-mode-readout-line {
  margin: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: clamp(0.74rem, 1.15vw, 0.95rem);
  font-weight: 500;
  line-height: 1.08;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  backdrop-filter: none;
  box-shadow: none;
}

.voice-mode-readout-line--user {
  color: var(--text);
  width: 100%;
  max-height: 3.5em;
  text-shadow: 0 0 28px rgba(var(--accent-rgb), 0.18);
  white-space: normal;
}

.voice-mode-readout-line--interim {
  min-height: 0;
  margin-top: 0.1em;
  color: rgba(var(--accent-rgb), 0.98);
  font-size: clamp(0.62rem, 0.95vw, 0.82rem);
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.voice-mode-readout-line--assistant {
  color: var(--text-muted);
  font-size: clamp(0.62rem, 0.95vw, 0.78rem);
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.voice-mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 0;
  pointer-events: none;
}

.voice-mode-overlay-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 0;
  text-align: center;
}

.voice-mode-assistant-overlay {
  position: static;
  margin: 0;
  width: min(92%, 620px);
  padding: 0;
  text-align: center;
  display: block;
  white-space: pre-wrap;
  line-height: 2;
  font-size: clamp(0.8rem, 1vw, 0.98rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.96);
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  overflow: visible;
  max-height: none;
}

.voice-mode-spoken-word {
  display: inline;
  border-radius: 0.24em;
  padding: 0 0.08em;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.voice-mode-spoken-word.is-spoken {
  color: rgba(255, 255, 255, 0.72);
}

.voice-mode-spoken-word.is-active {
  color: #0d0d0d;
  background: var(--accent);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb, 124, 58, 237), 0.4),
    0 0 18px rgba(var(--accent-rgb, 124, 58, 237), 0.28);
  text-decoration: none;
}

.voice-mode-playback-chip {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(8, 12, 18, 0.82);
  color: rgba(255, 255, 255, 0.96);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transform: translateX(-50%);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(var(--accent-rgb), 0.12) inset;
  backdrop-filter: blur(18px);
  pointer-events: auto;
  cursor: pointer;
}

.voice-mode-playback-chip.hidden {
  display: none !important;
}

.voice-mode-playback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.voice-transcript-chunk {
  position: relative;
  display: block;
  z-index: 1;
  animation: voice-transcript-chunk-fade 420ms ease-out both;
}

.voice-transcript-chunk + .voice-transcript-chunk {
  margin-top: -0.18em;
}

.voice-transcript-chunk--new {
  animation-duration: 560ms;
}

.voice-transcript-token {
  display: inline;
}

.voice-transcript-token--new {
  animation: voice-transcript-chunk-fade 420ms ease-out both;
}

@keyframes voice-transcript-chunk-fade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.voice-mode-actions {
  position: static;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 4px;
  padding: 4px 8px 10px;
  background: transparent;
  border: none;
  flex-wrap: nowrap;
}

.voice-mode-actions > .orb-btn.voice-mode-orb-host {
  width: var(--voice-mode-orb-size, 42px) !important;
  height: var(--voice-mode-orb-size, 42px) !important;
  min-width: var(--voice-mode-orb-size, 42px);
  min-height: var(--voice-mode-orb-size, 42px);
  max-width: var(--voice-mode-orb-size, 42px);
  max-height: var(--voice-mode-orb-size, 42px);
  flex: 0 0 var(--voice-mode-orb-size, 42px);
  align-self: center;
  position: relative;
  top: -1px;
  box-sizing: border-box;
  line-height: 0;
  padding: 0;
}

.voice-mode-action {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.voice-mode-action:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
}

.voice-mode-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.voice-mode-action--primary {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-rgb), 0.14)
  );
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.14);
}

.voice-mode-action.active {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.34),
    rgba(var(--accent-rgb), 0.18)
  );
  box-shadow: 0 16px 34px rgba(var(--accent-rgb), 0.18);
}

.voice-mode-orb.listening .voice-mode-bar {
  box-shadow:
    0 0 30px
      rgba(var(--voice-emotion-rgb), calc(0.12 + var(--voice-energy) * 0.22)),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.voice-mode-orb.listening .voice-mode-orb-ring {
  opacity: calc(0.22 + var(--voice-energy) * 0.22);
}

.voice-mode-action--close {
  background: rgba(255, 255, 255, 0.03);
  border: none;
}

.voice-mode-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-mode-support {
  margin: 0;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
  display: none;
}

/* ── Camera popup overlay ──────────────────────────────────── */
.voice-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: voiceCameraFadeIn 0.2s ease-out;
}

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

.voice-camera-overlay video {
  width: min(100%, 480px);
  border-radius: 18px;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.voice-camera-overlay .camera-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.voice-camera-overlay .capture-btn {
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  background: var(--accent, #c85454);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.voice-camera-overlay .capture-btn:hover {
  opacity: 0.85;
}

.voice-camera-overlay .cancel-btn {
  padding: 10px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.voice-camera-overlay .cancel-btn:hover {
  background: rgba(255,255,255,0.08);
}

.input-area.auoura-composer .orb-btn.orb-snake-joystick {
  position: relative;
  width: 68px !important;
  height: 68px !important;
  touch-action: none;
  cursor: grab;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--accent-rgb), 0.18),
    rgba(255, 255, 255, 0.04)
  );
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(var(--accent-rgb), 0.18);
}

.input-area.auoura-composer
  .orb-btn.orb-snake-joystick.orb-snake-joystick-hint {
  animation: snake-joystick-pulse 1.7s ease-out infinite;
}

.input-area.auoura-composer .orb-btn.orb-snake-joystick::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  background: radial-gradient(
    circle at center,
    rgba(var(--accent-rgb), 0.1),
    transparent 72%
  );
  pointer-events: none;
}

.input-area.auoura-composer .orb-btn.orb-snake-joystick svg {
  position: relative;
  z-index: 1;
  transform: translate(
      var(--snake-joystick-x, 0px),
      var(--snake-joystick-y, 0px)
    )
    scale(0.92);
  transition: transform 0.05s linear;
}

.input-area.auoura-composer
  .orb-btn.orb-snake-joystick.orb-snake-joystick-hint::after {
  content: attr(data-snake-joystick-hint);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(7, 11, 19, 0.9);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 2;
}

@keyframes snake-joystick-pulse {
  0% {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(var(--accent-rgb), 0.3),
      0 0 0 1px rgba(var(--accent-rgb), 0.18);
  }
  70% {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.4),
      0 0 0 14px rgba(var(--accent-rgb), 0),
      0 0 0 1px rgba(var(--accent-rgb), 0.18);
  }
  100% {
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(var(--accent-rgb), 0),
      0 0 0 1px rgba(var(--accent-rgb), 0.18);
  }
}

.input-area.auoura-composer .orb-btn.orb-panel-spin-open {
  animation: orb-panel-spin-open 0.72s cubic-bezier(0.22, 1, 0.36, 1) 1;
}

.input-area.auoura-composer .orb-btn.orb-panel-spin-close {
  animation: orb-panel-spin-close 0.72s cubic-bezier(0.22, 1, 0.36, 1) 1;
}

@keyframes orb-panel-spin-open {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes orb-panel-spin-close {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

.input-area.auoura-composer .orb-style-panel {
  position: absolute;
  /* Position above the orb by default on desktop */
  bottom: calc(100% + 14px);
  top: auto;
  left: 50%;
  width: min(370px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  /* Height-constrained flex column so the nav stays fixed and content scrolls */
  max-height: var(--orb-panel-max-height, min(calc(100svh - 24px), 680px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--composer-panel) 96%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  z-index: 6;
  backdrop-filter: blur(18px);
}

.input-area.auoura-composer .orb-style-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.input-area.auoura-composer .orb-style-panel-kicker,
.input-area.auoura-composer .orb-style-control-label,
.input-area.auoura-composer .orb-style-control-copy {
  margin: 0;
}

.input-area.auoura-composer .orb-style-panel-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.input-area.auoura-composer .orb-style-panel-title {
  margin: 4px 0 0;
  font-size: 0.98rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
}

.input-area.auoura-composer .orb-style-control {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.input-area.auoura-composer .orb-style-control + .orb-style-control {
  margin-top: 10px;
}

.input-area.auoura-composer .orb-style-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.input-area.auoura-composer .orb-style-control-head > div {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-area.auoura-composer .orb-style-control-label-row {
  position: relative;
  display: inline-block;
}

.input-area.auoura-composer .orb-style-control-label {
  margin: 0;
  display: inline-block;
}

.input-area.auoura-composer .orb-style-control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.input-area.auoura-composer .orb-style-control-copy {
  margin-top: 3px;
  font-size: 0.73rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.52);
}

.input-area.auoura-composer .fusion-permission-row,
.composer-overlay-root .fusion-permission-row,
.fusion-memory-row {
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  gap: 10px;
  padding: 12px 12px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  min-width: 0;
  text-align: left;
  width: 100%;
  cursor: context-menu;
}

.fusion-memory-row:hover {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.1),
    rgba(255, 255, 255, 0.03)
  );
}

.input-area.auoura-composer .fusion-permission-row:last-child,
.composer-overlay-root .fusion-permission-row:last-child,
.input-area.auoura-composer .fusion-memory-row:last-child,
.composer-overlay-root .fusion-memory-row:last-child {
  padding: 14px;
}

.input-area.auoura-composer .fusion-permission-name,
.composer-overlay-root .fusion-permission-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.input-area.auoura-composer .fusion-permission-select,
.composer-overlay-root .fusion-permission-select {
  flex-shrink: 0;
  min-width: 96px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input-area.auoura-composer .fusion-permission-select:hover,
.composer-overlay-root .fusion-permission-select:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.input-area.auoura-composer .fusion-permission-select:focus,
.composer-overlay-root .fusion-permission-select:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.input-area.auoura-composer .fusion-permission-select option,
.composer-overlay-root .fusion-permission-select option {
  background: #1a1c20;
  color: rgba(255, 255, 255, 0.88);
}

.input-area.auoura-composer .fusion-memory-info,
.composer-overlay-root .fusion-memory-info,
.fusion-memory-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
  justify-items: start;
  text-align: left;
}

.input-area.auoura-composer .fusion-memory-key,
.composer-overlay-root .fusion-memory-key,
.input-area.auoura-composer .fusion-memory-meta,
.composer-overlay-root .fusion-memory-meta,
.input-area.auoura-composer .fusion-memory-value,
.composer-overlay-root .fusion-memory-value {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.input-area.auoura-composer .fusion-memory-key,
.composer-overlay-root .fusion-memory-key {
  font-size: 12px;
  font-weight: 600;
}

.input-area.auoura-composer .fusion-memory-meta,
.composer-overlay-root .fusion-memory-meta,
.input-area.auoura-composer .fusion-memory-value,
.composer-overlay-root .fusion-memory-value {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.input-area.auoura-composer .fusion-memory-delete,
.composer-overlay-root .fusion-memory-delete {
  width: 100%;
}

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

.fusion-memory-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fusion-memory-row-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fusion-memory-row-badge-pinned {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent, #c6b0f5);
}

/* ── Shared dark-glass input for orb panel ───────────────────── */
.input-area.auoura-composer .orb-panel-input,
.composer-overlay-root .orb-panel-input {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
  box-sizing: border-box;
}

.input-area.auoura-composer .orb-panel-input::placeholder,
.composer-overlay-root .orb-panel-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.input-area.auoura-composer .orb-panel-input:focus,
.composer-overlay-root .orb-panel-input:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.fusion-memory-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}

.fusion-memory-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s;
}

.fusion-memory-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.fusion-memory-tab.active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.fusion-memory-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.fusion-memory-tab.active .fusion-memory-tab-count {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.orb-panel-content#orb-panel-memory .orb-style-control {
  display: grid;
  justify-items: center;
}

.orb-panel-content#orb-panel-memory .orb-style-control-copy,
.orb-panel-content#orb-panel-memory .orb-style-control-label {
  text-align: center;
}

.fusion-memory-panel {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.fusion-memory-panel > * {
  width: min(100%, 560px);
  margin-inline: auto;
}

.fusion-memory-panel .fusion-memory-empty {
  max-width: 100%;
}

#fusion-permissions-list,
#fusion-memory-list,
#fusion-memory-system-list,
.composer-overlay-root #fusion-permissions-list,
.composer-overlay-root #fusion-memory-list,
.composer-overlay-root #fusion-memory-system-list {
  display: grid;
  gap: 6px;
  max-height: min(38vh, 340px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  width: min(100%, 560px);
  margin-inline: auto;
  padding: 2px 14px;
  scrollbar-gutter: stable both-edges;
  min-width: 0;
}

#fusion-memory-system-list {
  max-height: min(26vh, 220px);
  margin-top: 6px;
}

.fusion-memory-empty {
  display: block;
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0;
  margin: 0;
}

.fusion-memory-delete-dialog {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
}

.fusion-memory-delete-dialog.hidden {
  display: none;
}

.fusion-memory-delete-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.fusion-memory-delete-dialog-card {
  position: relative;
  width: min(92vw, 340px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--surface-raised) 92%, #000 8%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  padding: 18px 18px 16px;
  z-index: 1;
}

.fusion-memory-delete-dialog-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.fusion-memory-delete-dialog-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text);
}

.fusion-memory-delete-dialog-copy {
  margin: 10px 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fusion-memory-delete-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fusion-memory-delete-dialog-actions button {
  min-width: 88px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.72rem 0.95rem;
  font: inherit;
  cursor: pointer;
}

.fusion-memory-delete-dialog-cancel {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.fusion-memory-delete-dialog-confirm {
  background: var(--danger, #ef4444);
  border-color: transparent;
  color: #fff;
}

.input-area.auoura-composer .orb-style-info-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.input-area.auoura-composer .orb-style-info-btn:hover,
.input-area.auoura-composer .orb-style-info-btn[aria-expanded="true"] {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.32);
  color: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.input-area.auoura-composer .orb-style-slider {
  --selected-index: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 18px;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.input-area.auoura-composer .orb-style-slider.is-dragging {
  cursor: grabbing;
}

.input-area.auoura-composer .orb-style-slider::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  /* Subtle track for the slider to make the UI cleaner */
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  transform: translateY(-50%);
  z-index: 0;
}

.input-area.auoura-composer .orb-style-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  /* Prefer an explicit indicator position provided from JS which accounts
     for padding and grid gaps; fall back to the old percentage calculation. */
  left: var(--indicator-left, calc(12.5% + (var(--selected-index) * 25%)));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-rgb), 0.12)
  );
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
  transition:
    left 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
  z-index: 1; /* sit below the stop icons */
  pointer-events: none; /* allow clicks to reach the buttons */
}

.input-area.auoura-composer
  .orb-style-slider.orb-style-slider-no-indicator-motion::after {
  transition:
    background 0.22s ease,
    border-color 0.22s ease;
}

.input-area.auoura-composer .orb-style-slider:focus-visible {
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.22),
    0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

/* Personality toggle: 2-option pill switch */
.input-area.auoura-composer .orb-style-slider.orb-style-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 48px;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: default;
}
.input-area.auoura-composer .orb-style-slider.orb-style-toggle.is-dragging {
  cursor: default;
}
.input-area.auoura-composer .orb-style-slider.orb-style-toggle::before {
  display: none;
}
.input-area.auoura-composer .orb-style-slider.orb-style-toggle::after {
  display: none;
}
.input-area.auoura-composer .orb-style-slider.orb-style-toggle .orb-style-stop {
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
.input-area.auoura-composer
  .orb-style-slider.orb-style-toggle
  .orb-style-stop:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.06);
}
.input-area.auoura-composer
  .orb-style-slider.orb-style-toggle
  .orb-style-stop.is-active {
  transform: none;
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-rgb), 0.12)
  );
  border-color: rgba(var(--accent-rgb), 0.44);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.input-area.auoura-composer .orb-toggle-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
}

.input-area.auoura-composer .orb-style-stop {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.input-area.auoura-composer .orb-style-stop:hover,
.input-area.auoura-composer .orb-style-stop.is-active {
  color: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.input-area.auoura-composer .orb-style-stop {
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-area.auoura-composer .orb-style-stop svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

/* Ensure inline SVG strokes use the button color so currentColor works reliably */
.input-area.auoura-composer .orb-style-stop svg,
.input-area.auoura-composer .orb-style-stop svg path,
.input-area.auoura-composer .orb-style-stop svg line,
.input-area.auoura-composer .orb-style-stop svg circle {
  color: inherit;
  stroke: currentColor;
}

/* If an icon uses fill rather than stroke, make it visible too */
.input-area.auoura-composer .orb-style-stop svg[fill]:not([fill="none"]) path,
.input-area.auoura-composer
  .orb-style-stop
  svg[fill]:not([fill="none"])
  circle {
  fill: currentColor;
}

/* Position the info button outside the centered label without affecting layout */
.input-area.auoura-composer .orb-style-control-label-row .orb-style-info-btn {
  position: absolute;
  left: 100%;
  margin-left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.input-area.auoura-composer .orb-style-control-copy {
  text-align: center;
}

/* Center header text and hide the assistant-only title */
.input-area.auoura-composer .orb-style-panel {
  text-align: center;
}

.input-area.auoura-composer .orb-style-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.input-area.auoura-composer .orb-style-panel-title {
  display: none;
}

.input-area.auoura-composer .orb-style-stop:hover svg {
  background: rgba(255, 255, 255, 0.05);
}

.input-area.auoura-composer .orb-style-stop.is-active svg {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.18),
    rgba(var(--accent-rgb), 0.08)
  );
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

/* Slightly reduce the hover lift to keep things stable visually */
.input-area.auoura-composer .orb-style-stop:hover,
.input-area.auoura-composer .orb-style-stop.is-active {
  transform: translateY(-0.6px);
}

/* Mobile: make orb panel tab buttons wrap and size-friendly */
@media (max-width: 520px) {
  .input-area.auoura-composer .orb-style-panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .input-area.auoura-composer .orb-style-stop {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
  }
  .input-area.auoura-composer .orb-style-control-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.input-area.auoura-composer .orb-style-info-popover {
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(6, 7, 9, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.input-area.auoura-composer .orb-style-info-title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
}

.input-area.auoura-composer .orb-style-info-copy {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
}

.input-area.auoura-composer .risk-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 88vw);
  overflow: hidden;
  border-radius: 18px;
  background: rgba(18, 20, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  z-index: 5;
}

.input-area.auoura-composer .risk-popover-header,
.input-area.auoura-composer .risk-popover-body {
  padding: 12px 14px;
}

/* ── AUOURA TOPBAR SPIN (scoped) ───────────────────────────────── */
.topbar {
  position: relative;
}
.topbar .topbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  z-index: 6;
  pointer-events: auto;
}
.auoura-topbar-scene {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  user-select: none;
  perspective: 600px;
}
.auoura-topbar-scene .letter-wrap {
  perspective: 600px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    filter 0.16s ease;
  transform-origin: center;
}
.auoura-topbar-scene .letter {
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 600;
  font-family: var(--font-sans, Inter, sans-serif);
  color: var(--text);
  display: inline-block;
  cursor: default;
  transition:
    color 0.18s,
    text-shadow 0.18s;
  will-change: transform;
  transform-style: preserve-3d;
  line-height: 1;
  padding: 2px 1px;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}
.auoura-topbar-scene .letter.spinning {
  color: color-mix(in srgb, var(--accent) 78%, #9fd9ff);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.22);
}
.auoura-topbar-scene .auoura-topbar-time {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-family:
    "DS-Digital", "Digital-7", "Segment7", "Share Tech Mono",
    var(--font-mono, monospace);
  font-size: clamp(12px, 2vw, 15px);
  font-weight: 400;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  font-feature-settings:
    "tnum" 1,
    "zero" 1;
  text-transform: uppercase;
  color: var(--text);
  transform: translateY(1px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 1;
}
.auoura-topbar-scene.auoura-time-reveal .letter-wrap {
  opacity: 0;
  transform: scale(0.82);
  filter: blur(1px);
}
.auoura-topbar-scene.auoura-time-reveal .letter-wrap {
  pointer-events: none;
}
.auoura-topbar-scene.auoura-time-reveal .auoura-topbar-time {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .topbar .topbar-brand {
    position: static;
    transform: none;
    margin-left: 0;
  }
  .auoura-topbar-scene .letter {
    font-size: 14px;
  }
}

.input-area.auoura-composer .risk-popover-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.input-area.auoura-composer .risk-popover-title {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.input-area.auoura-composer .risk-popover-dismiss {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.input-area.auoura-composer .risk-popover-reason,
.input-area.auoura-composer .risk-popover-tier {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.input-area.auoura-composer .risk-popover-hazards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.input-area.auoura-composer .input-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0 14px 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.4;
  border: none !important;
  border-left: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.input-area.auoura-composer .input-row,
.input-area.auoura-composer .composer-toolbar,
.input-area.auoura-composer .input-footer {
  will-change: opacity, transform, filter, max-height;
}

.input-area.auoura-composer .input-hint {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .input-area.auoura-composer {
  --composer-bg: #ffffff;
  --composer-panel: #ffffff;
  --composer-panel-2: #f7f7f8;
  --composer-border: rgba(0, 0, 0, 0.08);
  --composer-text: #0b0b0b;
  --composer-muted: rgba(0, 0, 0, 0.62);
  --composer-cyan: 0, 122, 255;
}

html[data-theme="light"] .input-area.auoura-composer .glow-box {
  background: linear-gradient(180deg, #f4f6f8, #eef0f2);
  border: none !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .glow-box.voice-mode-active {
  box-shadow:
    0 18px 52px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(var(--voice-emotion-rgb), 0.14) inset;
}

html[data-theme="black"] .input-area.auoura-composer .glow-box {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.985) 0%,
    rgba(0, 0, 0, 1) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

html[data-theme="black"] .input-area.auoura-composer .glow-box.fusion-ask-open {
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.86),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

html[data-theme="black"] .input-area.auoura-composer .orb-style-panel,
html[data-theme="black"] .composer-overlay-root .orb-style-panel-overlay {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.985) 0%,
    rgba(0, 0, 0, 1) 100%
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

html[data-theme="black"]
  .input-area.auoura-composer
  .orb-panel-content
  .orb-style-panel-header,
html[data-theme="black"]
  .composer-overlay-root
  .orb-panel-content
  .orb-style-panel-header {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.985) 0%,
    rgba(0, 0, 0, 0.97) 100%
  );
}

html[data-theme="light"] .input-area.auoura-composer .attach-prefix-btn,
html[data-theme="light"] .input-area.auoura-composer .send-btn,
html[data-theme="light"] .input-area.auoura-composer .composer-tool-btn,
html[data-theme="light"] .input-area.auoura-composer .orb-btn,
html[data-theme="light"] .input-area.auoura-composer .risk-popover-dismiss {
  color: rgba(0, 0, 0, 0.88);
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .input-area.auoura-composer .attach-prefix-btn:hover,
html[data-theme="light"] .input-area.auoura-composer .send-btn:hover,
html[data-theme="light"] .input-area.auoura-composer .composer-tool-btn:hover,
html[data-theme="light"] .input-area.auoura-composer .orb-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

html[data-theme="light"] .input-area.auoura-composer .composer-tool-btn.active {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

html[data-theme="light"] .input-area.auoura-composer .input-footer {
  color: rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] .input-area.auoura-composer .orb-btn {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.03));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.88);
}

html[data-theme="light"] .input-area.auoura-composer .orb-btn.orb-panel-open {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.16),
    rgba(var(--accent-rgb), 0.06)
  );
  border-color: rgba(var(--accent-rgb), 0.24);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(var(--accent-rgb), 0.1);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-btn.orb-snake-joystick {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--accent-rgb), 0.14),
    rgba(0, 0, 0, 0.03)
  );
  border-color: rgba(var(--accent-rgb), 0.26);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-btn.orb-snake-joystick.orb-snake-joystick-hint::after {
  background: rgba(255, 255, 255, 0.96);
  color: rgba(15, 23, 42, 0.88);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .input-area.auoura-composer .orb-btn svg {
  fill: currentColor;
  color: inherit;
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-panel {
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 22px 48px rgba(16, 24, 40, 0.12);
}

html[data-theme="light"] .voice-mode-modal {
  background: transparent;
}

html[data-theme="light"] .voice-mode-shell {
  background: linear-gradient(
    180deg,
    rgba(252, 253, 255, 0.12),
    rgba(243, 246, 250, 0.38) 24%,
    rgba(243, 246, 250, 0.74) 100%
  );
}

html[data-theme="light"] .voice-mode-status,
html[data-theme="light"] .voice-mode-support,
html[data-theme="light"] .voice-mode-copy,
html[data-theme="light"] .voice-mode-readout-line--assistant {
  color: rgba(15, 23, 42, 0.62);
}

html[data-theme="light"] .voice-mode-readout-line,
html[data-theme="light"] .voice-mode-action,
html[data-theme="light"] .voice-mode-orb {
  border-color: rgba(15, 23, 42, 0.06);
  background: transparent;
  color: rgba(15, 23, 42, 0.9);
  box-shadow: none;
}

html[data-theme="light"] .voice-mode-readout-line {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-theme="light"] .voice-mode-readout-line--user,
html[data-theme="light"] .voice-mode-action--primary,
html[data-theme="light"] .voice-mode-action.active {
  background: transparent;
}

html[data-theme="light"] .voice-mode-orb {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.84),
      rgba(248, 250, 252, 0.7)
    ),
    radial-gradient(
      ellipse at 50% 100%,
      rgba(var(--voice-emotion-rgb), 0.18),
      transparent 72%
    );
}

html[data-theme="light"] .voice-mode-glow {
  background:
    radial-gradient(
      ellipse at 50% 100%,
      rgba(var(--accent-rgb), calc(0.18 + var(--voice-energy) * 0.2)) 0%,
      rgba(var(--accent-rgb), calc(0.08 + var(--voice-energy) * 0.08)) 26%,
      transparent 74%
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(var(--accent-rgb), calc(0.03 + var(--voice-energy) * 0.05)) 42%,
      rgba(var(--accent-rgb), calc(0.1 + var(--voice-energy) * 0.12)) 100%
    );
  opacity: calc(0.28 + var(--voice-energy) * 0.44);
}

html[data-theme="light"] .voice-mode-assistant-overlay {
  color: rgba(15, 23, 42, 0.9);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-shadow: none;
}

html[data-theme="light"] .voice-mode-spoken-word.is-active {
  color: rgba(15, 23, 42, 0.98);
  background: rgba(var(--accent-rgb, 124, 58, 237), 0.22);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 124, 58, 237), 0.18);
}

html[data-theme="light"] .voice-mode-spoken-word.is-spoken {
  color: rgba(15, 23, 42, 0.64);
}

html[data-theme="light"] .voice-mode-action--close {
  background: rgba(255, 255, 255, 0.56);
}

html[data-theme="light"] .voice-mode-actions {
  background: transparent;
  border: none;
  box-shadow: none;
}

html[data-visual-theme="blocky"] .voice-mode-shell,
html[data-visual-theme="blocky"] .voice-mode-shell * {
  font-family: "Space Grotesk", "Inter", sans-serif !important;
}

html[data-visual-theme="blocky"] .voice-mode-shell {
  border-radius: 22px !important;
}

html[data-visual-theme="blocky"] .voice-mode-readout-line,
html[data-visual-theme="blocky"] .voice-mode-orb,
html[data-visual-theme="blocky"] .voice-mode-action {
  border-radius: 26px !important;
}

html[data-visual-theme="blocky"] .voice-mode-copy,
html[data-visual-theme="blocky"] .voice-mode-status,
html[data-visual-theme="blocky"] .voice-mode-support {
  display: none !important;
}

html[data-visual-theme="blocky"] .voice-mode-readout-line {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html[data-visual-theme="blocky"] .voice-mode-assistant-overlay {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-visual-theme="blocky"] .voice-mode-spoken-word.is-active {
  box-shadow: none !important;
}

html[data-visual-theme="blocky"]
  .input-area.auoura-composer
  .glow-box.voice-mode-active {
  background:
    linear-gradient(180deg, rgba(18, 20, 24, 0.98), rgba(10, 12, 16, 0.98)),
    radial-gradient(
      circle at 50% 100%,
      rgba(var(--voice-emotion-rgb), 0.18),
      transparent 56%
    ) !important;
  border: 1px solid rgba(var(--voice-emotion-rgb), 0.2) !important;
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(var(--voice-emotion-rgb), 0.12) inset,
    0 0 42px rgba(var(--voice-emotion-rgb), 0.12) !important;
}

html[data-theme="black"] .voice-mode-modal {
  background: transparent;
}

html[data-theme="black"] .voice-mode-shell {
  background: linear-gradient(
    180deg,
    rgba(8, 8, 8, 0.18),
    rgba(0, 0, 0, 0.4) 28%,
    rgba(0, 0, 0, 0.82) 100%
  );
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-panel-content
  .orb-style-panel-header {
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-panel-kicker {
  color: rgba(0, 0, 0, 0.36);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-content {
  background: transparent;
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-content,
html[data-theme="light"] .composer-overlay-root .orb-panel-content {
  scrollbar-color: rgba(0, 0, 0, 0.14) transparent;
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-panel-content::-webkit-scrollbar-thumb,
html[data-theme="light"]
  .composer-overlay-root
  .orb-panel-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-panel-title,
html[data-theme="light"] .input-area.auoura-composer .orb-style-control-label {
  color: rgba(0, 0, 0, 0.92);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-control {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-control-copy {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-info-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.62);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-info-btn:hover,
html[data-theme="light"]
  .input-area.auoura-composer
  .orb-style-info-btn[aria-expanded="true"] {
  color: rgba(0, 0, 0, 0.9);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-slider::before {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.16),
    rgba(0, 0, 0, 0.08)
  );
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-stop {
  color: rgba(0, 0, 0, 0.44);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-stop:hover,
html[data-theme="light"] .input-area.auoura-composer .orb-style-stop.is-active {
  color: rgba(0, 0, 0, 0.94);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-info-popover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.8);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-stop svg {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-style-stop.is-active
  svg {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.12),
    rgba(var(--accent-rgb), 0.06)
  );
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-info-title {
  color: rgba(0, 0, 0, 0.94);
}

html[data-theme="light"] .input-area.auoura-composer .orb-style-info-copy {
  color: rgba(0, 0, 0, 0.62);
}

html[data-theme="light"] .input-area.auoura-composer .fusion-permission-row,
html[data-theme="light"] .composer-overlay-root .fusion-permission-row {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .input-area.auoura-composer .fusion-permission-select,
html[data-theme="light"] .composer-overlay-root .fusion-permission-select {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.9);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
  padding: 4px 8px;
}

html[data-theme="light"]
  .input-area.auoura-composer
  .fusion-permission-select:hover,
html[data-theme="light"] .composer-overlay-root .fusion-permission-select:hover,
html[data-theme="light"]
  .input-area.auoura-composer
  .fusion-permission-select:focus,
html[data-theme="light"]
  .composer-overlay-root
  .fusion-permission-select:focus {
  border-color: rgba(var(--accent-rgb), 0.35);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--accent-rgb), 0.12),
    0 8px 18px rgba(16, 24, 40, 0.06);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .fusion-permission-select
  option,
html[data-theme="light"]
  .composer-overlay-root
  .fusion-permission-select
  option {
  color: #111;
  background: #fff;
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-input,
html[data-theme="light"] .composer-overlay-root .orb-panel-input,
html[data-theme="light"] .input-area.auoura-composer #fusion-skill-name,
html[data-theme="light"] .input-area.auoura-composer #fusion-skill-desc,
html[data-theme="light"] .input-area.auoura-composer #fusion-skill-prompt {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: rgba(0, 0, 0, 0.88) !important;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-panel-input::placeholder,
html[data-theme="light"] .composer-overlay-root .orb-panel-input::placeholder,
html[data-theme="light"]
  .input-area.auoura-composer
  #fusion-skill-name::placeholder,
html[data-theme="light"]
  .input-area.auoura-composer
  #fusion-skill-desc::placeholder,
html[data-theme="light"]
  .input-area.auoura-composer
  #fusion-skill-prompt::placeholder {
  color: rgba(0, 0, 0, 0.38) !important;
}

html[data-theme="light"] .input-area.auoura-composer #fusion-skill-save {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.92),
    rgba(var(--accent-deep-rgb), 0.92)
  ) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(var(--accent-rgb), 0.18);
}

html[data-theme="light"] .input-area.auoura-composer #fusion-skills-list,
html[data-theme="light"] .input-area.auoura-composer #fusion-memory-list {
  color: rgba(0, 0, 0, 0.82);
}

html[data-theme="light"] .fusion-memory-tab {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .fusion-memory-tab:hover {
  border-color: rgba(0, 0, 0, 0.16);
  color: rgba(0, 0, 0, 0.75);
}

html[data-theme="light"] .fusion-memory-tab.active {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.22);
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .fusion-memory-tab-count {
  background: rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .fusion-memory-tab.active .fusion-memory-tab-count {
  background: rgba(var(--accent-rgb), 0.14);
  color: rgba(0, 0, 0, 0.7);
}

@media (max-width: 720px) {
  .input-area.auoura-composer .orb-style-panel {
    position: fixed;
    left: max(8px, calc(var(--safe-area-left) + 8px));
    right: max(8px, calc(var(--safe-area-right) + 8px));
    top: auto;
    bottom: calc(var(--composer-panel-clearance) + 8px);
    width: auto;
    max-width: none;
    max-height: min(var(--orb-panel-max-height, 580px), 72svh);
    transform: none;
    border-radius: 24px;
    padding: 16px;
  }

  .input-area.auoura-composer .orb-style-panel-header {
    margin-bottom: 14px;
  }

  .input-area.auoura-composer .orb-style-panel-kicker {
    font-size: 0.63rem;
    letter-spacing: 0.12em;
  }

  .input-area.auoura-composer .orb-style-control {
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .input-area.auoura-composer .orb-style-control + .orb-style-control {
    margin-top: 8px;
  }

  .input-area.auoura-composer .orb-style-control-head > div {
    align-items: stretch;
  }

  .input-area.auoura-composer .orb-style-control-label-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .input-area.auoura-composer .orb-style-control-label-row .orb-style-info-btn {
    position: static;
    margin-left: 0;
    top: auto;
    left: auto;
    transform: none;
  }

  .input-area.auoura-composer .orb-style-control-copy {
    margin-top: 2px;
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .input-area.auoura-composer .orb-style-slider {
    min-height: 54px;
    padding: 6px 4px;
    gap: 4px;
  }

  .input-area.auoura-composer .orb-style-slider::before {
    left: 12px;
    right: 12px;
  }

  .input-area.auoura-composer .orb-style-slider::after {
    width: 32px;
    height: 32px;
  }

  .input-area.auoura-composer .orb-style-stop {
    min-height: 34px;
  }

  .input-area.auoura-composer .orb-style-stop svg {
    width: 16px;
    height: 16px;
    padding: 6px;
  }
}

html[data-theme="light"] .input-area.auoura-composer .input-field::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .welcome-logo svg path,
html[data-theme="light"] .welcome-logo svg circle,
html[data-theme="light"] .welcome-logo svg rect {
  fill: #ffffff !important;
  stroke: #000 !important;
  stroke-width: 1.6px !important;
  stroke-linejoin: round !important;
  stroke-linecap: round !important;
}

/* ── ARTIFACT PANEL ──────────────────────────────────────────── */
.artifact-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.artifact-panel {
  position: relative;
  width: var(--artifact-w);
  min-width: 360px;
  max-width: min(1100px, 82vw);
  flex-shrink: 0;
  background: linear-gradient(180deg, #1c1c1e, #0f0f0f);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    width 0.25s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
  font-family: system-ui, sans-serif;
  container-type: inline-size;
  container-name: artifact-panel;
}
.artifact-panel.panel-hidden {
  width: 0;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  border-left: none;
  overflow: hidden;
}

.artifact-panel-resizer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
  touch-action: none;
  z-index: 4;
}

.artifact-panel-resizer::after {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  opacity: 0.72;
  transition:
    background 0.16s ease,
    opacity 0.16s ease;
}

.artifact-panel-resizer:hover::after,
.artifact-panel-resizer:active::after {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
}

.artifact-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  min-width: 0;
}
.artifact-panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.artifact-panel-title {
  font-size: 0.88rem;
  font-weight: 650;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.artifact-meta-chip {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}
.artifact-panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.artifact-panel-counts {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.artifact-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.artifact-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.artifact-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  padding: 4px;
  gap: 2px;
}

.artifact-project-shell {
  width: 200px;
  min-width: 36px;
  max-width: 500px;
  flex-shrink: 0;
  padding: 8px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    width 0.22s ease,
    padding 0.22s ease;
}

.projectName {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.project-collapse-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  line-height: 0;
  opacity: 0.8;
  flex-shrink: 0;
}

.project-collapse-btn svg {
  transition: transform 0.2s;
}

.artifact-project-shell.collapsed .project-collapse-btn svg {
  transform: rotate(-90deg);
}

.artifact-project-shell.collapsed .projectTitle,
.artifact-project-shell.collapsed .projectSub,
.artifact-project-shell.collapsed .artifact-project-tree,
.artifact-project-shell.collapsed .projectName-label {
  display: none;
}

.artifact-project-shell.collapsed {
  width: 36px !important;
  max-width: 36px !important;
  padding: 8px 4px;
}

.artifact-project-shell.collapsed .projectName {
  justify-content: center;
  margin-bottom: 0;
}

.artifact-project-shell.collapsed + .artifact-resizer {
  display: none;
}

.projectTitle {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.projectSub {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 10px;
}

.artifact-project-tree {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.artifact-project-tree::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.artifact-project-tree::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.treeItem {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
  color: #fff;
  user-select: none;
}

.treeItem:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.treeItem.active {
  background: rgba(10, 132, 255, 0.2);
  color: #0a84ff;
}

.folderRow {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.caret {
  font-size: 16px;
  width: 16px;
  flex: 0 0 16px;
  text-align: center;
}

.children {
  margin-left: 14px;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.children.open {
  display: flex;
}

.artifact-resizer {
  width: 2px;
  flex: 0 0 2px;
  cursor: col-resize;
}

.artifact-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.artifact-tabs {
  display: flex;
  justify-content: center;
  padding: 6px 8px;
  gap: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin: 6px 8px 2px;
}

.artifact-tabs .tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.55;
  background: transparent;
  color: #fff;
  font-family: inherit;
  transition:
    background 0.15s,
    opacity 0.15s;
  flex: 1;
  justify-content: center;
}

.artifact-tabs .tab svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.artifact-tabs .tab:hover {
  opacity: 0.85;
}

.artifact-tabs .tab.active {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.artifact-toolbar {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  margin: 0 6px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  align-items: center;
}

.artifact-toolbar button {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: none;
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 12px;
  flex-shrink: 0;
}

.artifact-toolbar button svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.artifact-toolbar button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Instant tooltip on toolbar buttons */
.artifact-toolbar button[title] {
  position: relative;
}
.artifact-toolbar button[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.9);
  color: #fff;
  font-size: 11px;
  font-family: inherit;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0s;
  z-index: 100;
}
.artifact-toolbar button[title]:hover::after {
  opacity: 1;
}

.artifact-toolbar button svg,
.deviceToggle button svg {
  width: 16px;
  height: 16px;
}

.deviceToggle button svg {
  fill: currentColor;
  stroke: none;
}

.deviceToggle {
  display: none;
  gap: 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.artifact-main.previewMode .deviceToggle {
  display: flex;
}

.deviceToggle button.active {
  background: #0a84ff;
}

.artifact-code-pane,
.previewWrapper {
  flex: 1;
  min-height: 0;
}

.artifact-code-pane {
  overflow: auto;
  padding: 14px;
  margin: 0 2px 2px;
  font-family: Menlo, monospace;
  background: #0a0a0a;
  border-radius: 14px;
  color: #f4f4f4;
  white-space: pre;
}

.artifact-code-pane code {
  display: block;
  min-height: 100%;
  white-space: pre;
  font: inherit;
  color: inherit;
  tab-size: 2;
}

.previewWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px 2px;
  overflow: auto;
}

.previewWrapper iframe {
  border: none;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 767px) {
  .artifact-backdrop {
    z-index: 120;
  }

  .artifact-panel {
    position: fixed;
    right: 0;
    top: 52px;
    bottom: 0;
    z-index: 130;
    width: min(90vw, 520px);
    min-width: 0;
    max-width: min(90vw, 520px);
    box-shadow: var(--shadow-lg);
  }

  .artifact-panel.panel-hidden {
    transform: translateX(110%);
    width: min(90vw, 520px);
    max-width: min(90vw, 520px);
    opacity: 0;
  }

  .artifact-panel-resizer {
    display: none;
  }
}

@media (max-width: 640px) {
  .artifact-panel {
    top: 0;
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
  }

  .artifact-panel.panel-hidden {
    width: 100vw;
  }

  .artifact-workspace {
    padding: 4px;
  }
}

@container artifact-panel (max-width: 760px) {
  .artifact-workspace {
    padding: 6px 6px 0;
    gap: 4px;
  }

  .artifact-project-shell:not(.collapsed) {
    width: 180px;
  }

  .artifact-resizer {
    display: none;
  }

  .artifact-toolbar button {
    font-size: 12px;
    padding: 6px;
  }
}

@container artifact-panel (max-width: 480px) {
  .artifact-project-shell:not(.collapsed) {
    width: 140px;
  }
}

/* ── FAILSAFE OVERLAY ────────────────────────────────────────── */

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-primary {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-wide {
  width: 100%;
  margin-top: 0.25rem;
}

.chatroom-action-confirm.btn-primary {
  min-width: 112px;
}

.chatroom-action-confirm.btn-primary:hover {
  background: var(--accent-hover);
}

.chatroom-action-confirm.btn-primary.chatroom-action-confirm-danger {
  background: #ef4444;
}

.chatroom-action-confirm.btn-primary.chatroom-action-confirm-danger:hover {
  background: #dc2626;
}

/* ── TOAST ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  max-width: 380px;
  text-align: center;
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.toast-fade {
  opacity: 0;
  transform: translateY(6px);
}

/* Ensure toast icons (e.g., lightning) use theme text color, not tone color */
.toast .toast-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  margin: 0 0.35em;
  color: var(--text);
}
.toast .toast-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
  }
  .sidebar:not(.collapsed) {
    box-shadow: var(--shadow-lg);
  }
  .sidebar.collapsed {
    opacity: 0;
  }
}
@media (min-width: 961px) {
  body:not(.sidebar-collapsed) #sidebar-open {
    display: none;
  }
}
@media (max-width: 640px) {
  .toast-container {
    bottom: 0.85rem;
    gap: 0.35rem;
  }
  .toast {
    max-width: calc(100vw - 1rem);
    padding: 0.5rem 0.8rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .settings-accent-preview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-font-size-options,
  .settings-color-mode-options,
  .settings-font-options,
  .settings-theme-options,
  .theme-onboarding-options {
    grid-template-columns: 1fr;
  }

  .theme-onboarding-modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .theme-onboarding-shell {
    width: 100%;
    max-height: min(100%, calc(100svh - 1.5rem));
    overflow: hidden;
    padding: 0.9rem;
    border-radius: 22px;
  }

  .theme-onboarding-header {
    margin-bottom: 0.85rem;
  }

  .theme-onboarding-title {
    font-size: 1.5rem;
  }

  .theme-onboarding-options {
    gap: 0.7rem;
  }

  .theme-onboarding-card {
    gap: 0.55rem;
    padding: 0.75rem;
    border-radius: 20px;
  }

  .theme-onboarding-preview {
    height: 4.5rem;
  }

  .theme-onboarding-card-copy h3 {
    font-size: 0.9rem;
  }

  .theme-onboarding-card-copy p {
    font-size: 0.82rem;
  }

  .theme-onboarding-select-btn {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }

  .theme-onboarding-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    margin-top: 0.7rem;
  }

  .theme-onboarding-confirm {
    width: 100%;
  }

  .theme-onboarding-status {
    text-align: center;
  }

  .sidebar-footer {
    padding: 0.65rem;
    gap: 0.35rem;
  }

  .sidebar-account-card {
    gap: 0.56rem;
    padding: 0.66rem;
    margin-bottom: 0.18rem;
    border-radius: 16px;
  }

  .sidebar-account-head {
    gap: 0.56rem;
  }

  .sidebar-account-kicker {
    display: none;
  }

  .sidebar-account-name {
    font-size: 0.84rem;
  }

  .sidebar-account-email,
  .sidebar-quota-meta {
    font-size: 0.69rem;
    line-height: 1.24;
  }

  .sidebar-account-avatar {
    width: 1.95rem;
    height: 1.95rem;
    font-size: 0.72rem;
  }

  .sidebar-quota-card {
    gap: 0.24rem;
    padding: 0.4rem 0 0.02rem;
  }

  .sidebar-quota-head {
    font-size: 0.68rem;
    gap: 0.38rem;
  }

  .sidebar-quota-meter {
    height: 0.3rem;
  }

  .sidebar-quota-stats {
    gap: 0.3rem;
  }

  .sidebar-account-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.32rem;
  }

  .sidebar-account-btn,
  .sidebar-account-ghost {
    width: 100%;
    min-height: 1.95rem;
    font-size: 0.78rem;
  }

  .sidebar-account-btn {
    padding: 0.5rem 0.78rem;
  }

  .sidebar-account-ghost {
    min-width: 0;
  }

  .auth-provider-switch {
    grid-template-columns: 1fr;
  }

  .input-area:not(.auoura-composer) {
    padding: 0.6rem 0.75rem 0.8rem;
  }
  .welcome-state {
    padding: 1.5rem 1rem 0.5rem;
  }
  .welcome-typing-row {
    gap: 8px;
  }
  .welcome-cursor-svg {
    width: clamp(20px, 5vw, 27px);
  }
  .message-row {
    padding: 0.9rem 0.75rem 0;
  }
  .topbar {
    height: auto;
    align-items: stretch;
    gap: 0.75rem;
    flex-direction: column;
  }
  .topbar-left {
    width: 100%;
    justify-content: center;
    position: relative;
    min-height: 2rem;
  }
  #sidebar-open {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    touch-action: manipulation;
  }
  .topbar .topbar-brand {
    position: static;
    left: auto;
    transform: none;
    margin: 0 auto;
    width: auto;
    max-width: calc(100% - 3rem);
  }
  .topbar-right,
  .topbar-settings,
  .topbar-settings-menu {
    width: 100%;
  }
  .topbar-right {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .topbar-settings-menu {
    left: 0;
    right: auto;
    min-width: 0;
  }
  .topbar-select {
    min-width: 0;
    width: 100%;
  }
  .topbar-select-wrap {
    flex: 1 1 150px;
  }
  .input-area:not(.auoura-composer) .composer-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .input-area:not(.auoura-composer) .composer-toolbar-left {
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .input-area.auoura-composer {
    width: 100%;
    padding: 0 8px max(14px, var(--resolved-safe-bottom) + 14px);
    box-shadow: none;
  }

  .message-row {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .message-inner {
    width: 100%;
    gap: 0.6rem;
  }

  .msg-content {
    min-width: 0;
  }

  .input-area.auoura-composer .input-glow-wrapper {
    border-radius: 24px;
  }

  .input-area.auoura-composer .voice-reactor {
    inset: 0;
    border-radius: inherit;
  }

  .input-area.auoura-composer .glow-box {
    border-radius: 22px;
    background: linear-gradient(
      180deg,
      rgba(20, 22, 26, 0.98),
      rgba(12, 14, 18, 0.98)
    );
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  }

  .input-area.auoura-composer .attachment-list {
    gap: 0.4rem;
    padding: 9px 10px 0;
  }

  .input-area.auoura-composer .attachment-chip {
    padding: 0.34rem 0.46rem;
    border-radius: 12px;
    font-size: 0.7rem;
  }

  .input-area.auoura-composer .input-row {
    gap: 8px;
    padding: 10px 10px 7px;
    align-items: flex-end;
  }

  .input-area.auoura-composer .input-field {
    min-height: 34px;
    max-height: 32vh;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.35;
    padding: 4px 0;
  }

  .input-area.auoura-composer .attach-prefix-btn,
  .input-area.auoura-composer .send-btn,
  .input-area.auoura-composer .orb-btn {
    width: 36px;
    height: 36px;
  }

  .input-area.auoura-composer .composer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px 10px 9px;
  }

  .input-area.auoura-composer .composer-toolbar-left,
  .input-area.auoura-composer .composer-toolbar-right {
    gap: 6px;
    min-width: 0;
  }

  .input-area.auoura-composer .composer-toolbar-left {
    justify-content: flex-start;
    grid-column: 1;
    justify-self: start;
  }

  .input-area.auoura-composer .composer-toolbar-right {
    justify-content: flex-end;
    grid-column: 3;
    justify-self: end;
  }

  .input-area.auoura-composer .composer-orb-wrap {
    position: static;
    transform: none;
    grid-column: 2;
    justify-self: center;
  }

  .input-area.auoura-composer .composer-tool-btn {
    padding: 7px 9px;
    border-radius: 12px;
    font-size: 12px;
    min-width: 0;
    max-width: 100%;
  }

  .input-area.auoura-composer .composer-toolbar-left > *,
  .input-area.auoura-composer .composer-toolbar-right > * {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
  }

  .input-area.auoura-composer .voice-mode-btn {
    min-width: 0;
    padding-inline: 10px;
  }

  .input-area.auoura-composer .input-footer {
    padding: 0 8px 10px;
    font-size: 11px;
    justify-content: center;
  }

  .input-area.auoura-composer .input-hint {
    margin-top: 4px;
    max-width: 100%;
    text-align: center;
  }

  .voice-mode-modal {
    inset: 0;
    padding: 0;
  }

  .voice-mode-shell {
    width: 100%;
    border-radius: 18px;
  }

  .voice-mode-stage {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 9px 0 7px;
    gap: 4px;
  }

  .voice-mode-orb {
    width: 100%;
    height: min(100%, clamp(54px, 8.8svh, 84px));
  }

  .voice-mode-readout-line {
    min-height: 0;
    padding: 0;
    border-radius: 0;
  }

  .voice-mode-actions {
    gap: 4px;
    padding: 4px 8px 9px;
    background: transparent;
    border: none;
    backdrop-filter: blur(12px);
  }

  .input-area.auoura-composer .halo,
  .input-area.auoura-composer .glow {
    display: block;
  }

  .input-area.auoura-composer .halo {
    inset: -12px;
    border-radius: 26px;
    filter: blur(22px);
    opacity: calc(var(--halo, 0) * 0.82);
  }

  .input-area.auoura-composer .glow {
    inset: -5px;
    border-radius: 22px;
    filter: blur(calc(8px + 4px * var(--g, 0)));
    opacity: calc(var(--g, 0) * 0.82);
  }
}

@media (max-width: 480px) {
  .input-area.auoura-composer {
    padding-left: 6px;
    padding-right: 6px;
  }

  .welcome-state {
    padding: 0.9rem 0.75rem 0.25rem;
    gap: 0.55rem;
  }

  .welcome-intro {
    gap: 2px;
  }

  .welcome-greeting,
  .welcome-typing-text {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }

  .welcome-cursor-svg {
    width: 21px;
  }

  .input-area.auoura-composer .orb-style-panel {
    left: max(6px, calc(var(--safe-area-left) + 6px));
    right: max(6px, calc(var(--safe-area-right) + 6px));
    padding: 10px;
    border-radius: 20px;
    max-height: min(var(--orb-panel-max-height, 480px), 68svh);
  }

  .input-area.auoura-composer .orb-panel-home,
  .composer-overlay-root .orb-panel-home {
    grid-template-columns: 1fr;
  }

  .input-area.auoura-composer .orb-panel-menu-card,
  .composer-overlay-root .orb-panel-menu-card {
    min-height: 96px;
    padding: 0.85rem;
  }

  .input-area.auoura-composer .orb-style-panel-header {
    margin-bottom: 8px;
  }

  .input-area.auoura-composer .orb-style-control {
    gap: 6px;
    padding: 9px;
    border-radius: 15px;
  }

  .input-area.auoura-composer .orb-style-control + .orb-style-control {
    margin-top: 6px;
  }

  .input-area.auoura-composer .orb-style-control-copy {
    font-size: 0.64rem;
  }

  .input-area.auoura-composer .orb-style-info-btn {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .input-area.auoura-composer .orb-style-slider {
    min-height: 50px;
    padding: 5px 4px;
  }

  .input-area.auoura-composer .orb-style-slider::after {
    width: 30px;
    height: 30px;
  }

  .input-area.auoura-composer .orb-style-stop {
    min-height: 32px;
  }

  .input-area.auoura-composer .orb-style-stop svg {
    width: 14px;
    height: 14px;
    padding: 5px;
  }

  .input-area.auoura-composer .input-glow-wrapper {
    border-radius: 22px;
  }

  .input-area.auoura-composer .glow-box {
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  }

  .input-area.auoura-composer .input-row {
    gap: 6px;
    padding: 8px 8px 6px;
  }

  .input-area.auoura-composer .input-field {
    min-height: 34px;
    font-size: 16px;
  }

  .input-area.auoura-composer .composer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 5px 8px 8px;
  }

  .input-area.auoura-composer .composer-orb-wrap {
    position: static;
    transform: none;
    grid-column: 2;
    justify-self: center;
    margin: 0;
  }

  .input-area.auoura-composer .composer-toolbar-left,
  .input-area.auoura-composer .composer-toolbar-right {
    width: auto;
    min-width: 0;
  }

  .input-area.auoura-composer .composer-toolbar-left > *,
  .input-area.auoura-composer .composer-toolbar-right > * {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
  }

  .input-area.auoura-composer .composer-tool-btn {
    width: auto;
    justify-content: center;
  }

  .voice-mode-shell {
    width: 100%;
    border-radius: 20px;
  }

  .voice-mode-stage {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 10px 0 8px;
    gap: 4px;
  }

  .voice-mode-orb {
    height: min(100%, clamp(60px, 10svh, 88px));
    border-radius: 22px;
  }

  .voice-mode-overlay {
    padding: 0;
    gap: 2px;
  }

  .voice-mode-overlay-stack {
    gap: 2px;
    width: 100%;
    padding: 0;
  }

  .voice-mode-assistant-overlay {
    width: min(94%, 100%);
    padding: 0;
    font-size: 0.66rem;
  }

  .voice-mode-camera-strip.active {
    max-height: 160px;
    padding: 4px;
  }

  .voice-mode-camera-capture-btn {
    width: 34px;
    height: 34px;
  }

  .voice-mode-actions {
    gap: 4px;
    padding: 4px 8px 9px;
    background: transparent;
    border: none;
  }

  .voice-mode-readout-line {
    font-size: 0.74rem;
    line-height: 1.12;
  }

  .voice-mode-action {
    min-height: 40px;
    padding: 0;
    gap: 0;
    border-radius: 14px;
  }

  .voice-mode-status {
    font-size: 0.66rem;
    padding: 0 2px;
  }

  .voice-mode-support {
    font-size: 0.6rem;
    line-height: 1.22;
  }

  .voice-mode-action-icon {
    width: 18px;
    height: 18px;
  }

  .voice-mode-playback-chip {
    bottom: 8px;
    min-height: 32px;
    padding: 0.4rem 0.78rem;
    font-size: 0.68rem;
  }

  .composer-overlay-root .conversation-todo-panel {
    max-height: min(78svh, 640px);
    padding: 10px;
  }

  .composer-overlay-root .conversation-todo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .composer-overlay-root .conversation-todo-item {
    gap: 8px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .composer-overlay-root .conversation-todo-text {
    font-size: 0.77rem;
    line-height: 1.3;
  }

  .composer-overlay-root .conversation-todo-meta {
    gap: 5px;
  }

  .composer-overlay-root .conversation-todo-status,
  .composer-overlay-root .conversation-todo-priority {
    font-size: 0.62rem;
    padding: 0.18rem 0.42rem;
  }

  .input-area.auoura-composer .conversation-todo-panel {
    position: fixed;
    left: max(8px, calc(var(--safe-area-left) + 8px));
    right: max(8px, calc(var(--safe-area-right) + 8px));
    bottom: calc(var(--resolved-safe-bottom) + 88px);
    width: auto;
    max-height: min(78svh, 640px);
    padding: 10px;
  }

  .input-area.auoura-composer .conversation-todo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .input-area.auoura-composer .conversation-todo-item {
    gap: 8px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .input-area.auoura-composer .conversation-todo-text {
    font-size: 0.77rem;
    line-height: 1.3;
  }

  .input-area.auoura-composer .conversation-todo-meta {
    gap: 5px;
  }

  .input-area.auoura-composer .conversation-todo-status,
  .input-area.auoura-composer .conversation-todo-priority {
    font-size: 0.62rem;
    padding: 0.18rem 0.42rem;
  }

  .input-area.auoura-composer .attachment-list {
    padding: 6px 6px 0;
  }

  .input-area.auoura-composer .input-footer {
    justify-content: center;
    padding: 0 6px 9px;
  }

  .input-area.auoura-composer .input-hint {
    margin-top: 0;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .input-area.auoura-composer .send-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 360px) {
  .input-area.auoura-composer {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: calc(var(--resolved-safe-bottom) + 4px);
  }

  .input-area.auoura-composer .glow-box {
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  }

  .input-area.auoura-composer .attachment-list {
    gap: 0.3rem;
    padding: 5px 5px 0;
  }

  .input-area.auoura-composer .attachment-chip {
    padding: 0.3rem 0.42rem;
    font-size: 0.68rem;
  }

  .input-area.auoura-composer .input-row {
    gap: 5px;
    padding: 5px 5px 4px;
  }

  .input-area.auoura-composer .attach-prefix-btn,
  .input-area.auoura-composer .send-btn,
  .input-area.auoura-composer .orb-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .input-area.auoura-composer .composer-toolbar {
    gap: 5px;
    padding: 4px 6px 6px;
  }

  .input-area.auoura-composer .composer-tool-btn {
    padding: 7px 8px;
    font-size: 11px;
  }

  .composer-overlay-root .conversation-todo-panel {
    padding: 8px;
  }

  .composer-overlay-root .conversation-todo-list {
    grid-template-columns: 1fr;
  }

  .input-area.auoura-composer .conversation-todo-panel {
    padding: 8px;
  }

  .input-area.auoura-composer .conversation-todo-list {
    grid-template-columns: 1fr;
  }

  .input-area.auoura-composer .input-footer {
    padding: 0 5px 6px;
    font-size: 10px;
  }
}

/* Final override: keep orb centered by using a 3-column grid on very small screens */
@media (max-width: 420px) {
  .input-area.auoura-composer .composer-toolbar {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 6px !important;
  }

  .input-area.auoura-composer .composer-toolbar-left {
    grid-column: 1;
    justify-self: start;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .input-area.auoura-composer .composer-orb-wrap {
    grid-column: 2;
    justify-self: center;
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .input-area.auoura-composer .composer-toolbar-right {
    grid-column: 3;
    justify-self: end;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  /* Prevent children from becoming full-width under other responsive rules */
  .input-area.auoura-composer .composer-toolbar-left > *,
  .input-area.auoura-composer .composer-toolbar-right > * {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .input-area.auoura-composer .composer-tool-btn {
    width: auto !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    min-width: 0 !important;
  }

  .input-area.auoura-composer .composer-tool-btn > * {
    flex: 0 0 auto !important;
  }

  .input-area.auoura-composer #search-mode-label .tool-name,
  .input-area.auoura-composer #reasoning-mode-label .tool-name,
  .input-area.auoura-composer #model-select-label .tool-name {
    display: none !important;
  }

  .input-area.auoura-composer .orb-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ── AUTHORITATIVE MOBILE / HOMESCREEN LAYOUT ───────────────── */
:root {
  --layout-safe-top: 0px;
  --layout-safe-bottom: 0px;
  --layout-header-boost: 0px;
  --composer-height: 168px;
}

body.is-standalone-app {
  --layout-header-boost: 18px;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

.composer-overlay-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}

.composer-overlay-root[aria-hidden="true"] {
  visibility: hidden;
}

.composer-overlay-root .orb-style-panel-overlay {
  --composer-bg: #000;
  --composer-panel: #111317;
  --composer-panel-2: #0d0f12;
  --composer-border: rgba(255, 255, 255, 0.08);
  --composer-text: #fff;
  --composer-muted: rgba(255, 255, 255, 0.62);
  position: fixed;
  top: var(--panel-top, auto);
  right: var(--panel-right, auto);
  bottom: var(--panel-bottom, auto);
  left: var(--panel-left, 50%);
  width: var(--panel-width, min(370px, calc(100vw - 28px)));
  max-width: calc(100vw - 24px);
  max-height: var(--orb-panel-max-height, min(calc(100svh - 24px), 680px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 14px;
  transform: var(--panel-transform, translateX(-50%));
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--composer-panel) 96%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px);
  z-index: 999999;
  pointer-events: auto;
}

.composer-overlay-root .conversation-todo-panel {
  position: fixed;
  top: var(--todo-panel-top, auto);
  right: var(--todo-panel-right, auto);
  bottom: var(--todo-panel-bottom, auto);
  left: var(--todo-panel-left, 50%);
  width: var(--todo-panel-width, min(520px, calc(100vw - 24px)));
  max-width: calc(100vw - 24px);
  max-height: min(72svh, 560px);
  overflow: auto;
  margin: 0;
  padding: 12px;
  transform: var(--todo-panel-transform, translateX(-50%));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--composer-panel) 96%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  z-index: 999998;
}

.composer-overlay-root .conversation-todo-panel.hidden {
  display: none !important;
}

.composer-overlay-root .conversation-todo-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.composer-overlay-root .conversation-todo-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.composer-overlay-root .conversation-todo-summary {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.composer-overlay-root .conversation-todo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.composer-overlay-root .conversation-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  min-height: 100%;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.composer-overlay-root .conversation-todo-item input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.composer-overlay-root .conversation-todo-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.composer-overlay-root .conversation-todo-text {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

.composer-overlay-root
  .conversation-todo-item.is-completed
  .conversation-todo-text,
.composer-overlay-root
  .conversation-todo-item.is-cancelled
  .conversation-todo-text {
  text-decoration: line-through;
  opacity: 0.7;
}

.composer-overlay-root .conversation-todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-overlay-root .conversation-todo-status,
.composer-overlay-root .conversation-todo-priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.48rem;
  font-size: 0.67rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.composer-overlay-root .conversation-todo-status--completed {
  background: rgba(74, 222, 128, 0.14);
  color: #9ae6b4;
}

.composer-overlay-root .conversation-todo-status--in_progress {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.composer-overlay-root .conversation-todo-status--cancelled {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

html[data-theme="light"] .composer-overlay-root .conversation-todo-panel {
  border-color: rgba(15, 23, 42, 0.08);
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .composer-overlay-root .conversation-todo-item {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .composer-overlay-root .conversation-todo-status,
html[data-theme="light"] .composer-overlay-root .conversation-todo-priority {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.68);
}

.composer-overlay-root .orb-style-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.composer-overlay-root .orb-style-panel-kicker,
.composer-overlay-root .orb-style-control-label,
.composer-overlay-root .orb-style-control-copy {
  margin: 0;
}

.composer-overlay-root .orb-style-panel-kicker {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.composer-overlay-root .orb-style-control-copy {
  font-size: 0.68rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.52);
}

.composer-overlay-root .orb-style-info-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
}

.composer-overlay-root .orb-style-slider {
  --selected-index: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 18px;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.composer-overlay-root .orb-style-slider.is-dragging {
  cursor: grabbing;
}

.composer-overlay-root .orb-style-slider::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  transform: translateY(-50%);
  z-index: 0;
}

.composer-overlay-root .orb-style-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--indicator-left, calc(12.5% + (var(--selected-index) * 25%)));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-rgb), 0.12)
  );
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
  transition:
    left 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
  z-index: 1;
  pointer-events: none;
}

.composer-overlay-root .orb-style-stop {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    color 0.18s ease,
    transform 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-overlay-root .orb-style-stop:hover,
.composer-overlay-root .orb-style-stop.is-active {
  color: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.composer-overlay-root .orb-style-slider.orb-style-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 48px;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: default;
}
.composer-overlay-root .orb-style-slider.orb-style-toggle::before,
.composer-overlay-root .orb-style-slider.orb-style-toggle::after {
  display: none;
}
.composer-overlay-root .orb-style-slider.orb-style-toggle .orb-style-stop {
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}
.composer-overlay-root
  .orb-style-slider.orb-style-toggle
  .orb-style-stop:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.06);
}
.composer-overlay-root
  .orb-style-slider.orb-style-toggle
  .orb-style-stop.is-active {
  transform: none;
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-rgb), 0.12)
  );
  border-color: rgba(var(--accent-rgb), 0.44);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.composer-overlay-root .orb-style-stop svg {
  /* Show the same stop icons the desktop panel uses so the overlay matches visually */
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 8px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease !important;
}

.composer-overlay-root .orb-style-panel-title {
  display: none;
}

.composer-overlay-root .orb-style-info-popover {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(6, 7, 9, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

html[data-theme="light"] .composer-overlay-root .orb-style-panel-overlay {
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 22px 48px rgba(16, 24, 40, 0.12);
}

html[data-theme="light"] .composer-overlay-root .orb-style-panel-kicker,
html[data-theme="light"] .composer-overlay-root .orb-style-control-copy {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"]
  .composer-overlay-root
  .orb-panel-content
  .orb-style-panel-header {
  background: color-mix(in srgb, var(--composer-panel) 99%, transparent);
}

html[data-theme="light"] .composer-overlay-root .orb-style-control-label,
html[data-theme="light"] .composer-overlay-root .orb-style-stop:hover,
html[data-theme="light"] .composer-overlay-root .orb-style-stop.is-active {
  color: rgba(0, 0, 0, 0.92);
}

html[data-theme="light"] .composer-overlay-root .orb-style-control {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .composer-overlay-root .orb-style-info-btn,
html[data-theme="light"] .composer-overlay-root .orb-style-stop svg {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.62);
}

html[data-theme="light"] .composer-overlay-root .orb-style-info-popover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.8);
}

.theme-onboarding-modal {
  z-index: 1400 !important;
}

body.theme-onboarding-open .app-shell,
body.theme-onboarding-open #sidebar {
  pointer-events: none;
}

body.theme-onboarding-open .composer-overlay-root {
  opacity: 0;
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: calc(
      64px + max(var(--resolved-safe-top), var(--layout-safe-top)) +
        var(--layout-header-boost)
    );
    height: auto;
    padding: calc(
        max(var(--resolved-safe-top), var(--layout-safe-top)) +
          var(--layout-header-boost) + 0.75rem
      )
      max(0.9rem, var(--safe-area-right)) 0.75rem
      max(0.9rem, var(--safe-area-left));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
  }

  .topbar-left {
    width: 100%;
    min-height: 2.25rem;
    justify-content: center;
    position: relative;
  }

  #sidebar-open {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  @media (max-width: 960px) {
    .sidebar-toggle-btn {
      width: 2.55rem;
      height: 2.55rem;
      border-radius: 14px;
      border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
      background:
        radial-gradient(
          circle at top right,
          rgba(var(--accent-rgb), 0.12),
          transparent 52%
        ),
        color-mix(in srgb, var(--bg-elevated) 88%, transparent);
      color: var(--text);
      box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
      backdrop-filter: blur(16px) saturate(135%);
      -webkit-backdrop-filter: blur(16px) saturate(135%);
      transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
    }

    .sidebar-toggle-btn:hover,
    .sidebar-toggle-btn:focus-visible {
      background:
        radial-gradient(
          circle at top right,
          rgba(var(--accent-rgb), 0.18),
          transparent 56%
        ),
        color-mix(in srgb, var(--bg-elevated) 96%, transparent);
      border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
      color: var(--text);
      box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
      outline: none;
    }

    .sidebar-toggle-btn:active {
      transform: translateY(1px) scale(0.98);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    }

    .sidebar-toggle-btn svg {
      width: 18px;
      height: 18px;
    }

    html[data-theme="light"] .sidebar-toggle-btn {
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    }

    html[data-visual-theme="blocky"] body .sidebar-toggle-btn {
      width: 2.45rem !important;
      height: 2.45rem !important;
      padding: 0.4rem !important;
      border-radius: 10px !important;
      border: 2px solid var(--border) !important;
      background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bg-elevated) 100%, transparent),
        color-mix(in srgb, var(--surface-1) 100%, var(--bg-elevated))
      ) !important;
      color: var(--text) !important;
      box-shadow: var(--shadow-md) !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    html[data-visual-theme="blocky"] body .sidebar-toggle-btn:hover,
    html[data-visual-theme="blocky"] body .sidebar-toggle-btn:focus-visible {
      border-color: var(--border) !important;
      background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-soft-fill) 60%, var(--bg-elevated)),
        var(--bg-elevated)
      ) !important;
      box-shadow: -2px 2px 0 0 rgba(var(--accent-rgb), 0.16) !important;
    }

    html[data-visual-theme="blocky"] body .sidebar-toggle-btn:active {
      box-shadow: -1px 1px 0 0 rgba(var(--accent-rgb), 0.14) !important;
    }

    html[data-visual-theme="blocky"]
      body
      #sidebar-open.sidebar-toggle-btn:hover,
    html[data-visual-theme="blocky"]
      body
      #sidebar-open.sidebar-toggle-btn:focus-visible {
      transform: translateY(calc(-50% - 1px)) !important;
    }

    html[data-visual-theme="blocky"]
      body
      #sidebar-open.sidebar-toggle-btn:active {
      transform: translateY(-50%) scale(0.97) !important;
    }

    html[data-visual-theme="blocky"]
      body
      #sidebar-close.sidebar-toggle-btn:hover,
    html[data-visual-theme="blocky"]
      body
      #sidebar-close.sidebar-toggle-btn:focus-visible {
      transform: translateY(-1px) !important;
    }

    html[data-visual-theme="blocky"]
      body
      #sidebar-close.sidebar-toggle-btn:active {
      transform: scale(0.97) !important;
    }

    #sidebar-open {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      z-index: 40;
      touch-action: manipulation;
    }

    #sidebar-close {
      position: relative;
      left: auto;
      top: auto;
      transform: none;
      z-index: 1;
      display: inline-flex;
      margin-right: auto !important;
    }

    /* Default: hide the close button; show it when sidebar is open */
    #sidebar-close {
      display: none;
    }
    body:not(.sidebar-collapsed) #sidebar-open {
      display: none;
    }
    body:not(.sidebar-collapsed) #sidebar-close {
      display: inline-flex;
    }
  }

  .topbar .topbar-brand {
    position: static;
    left: auto;
    transform: none;
    width: auto;
    max-width: calc(100% - 3rem);
    margin: 0 auto;
  }

  .workspace {
    min-height: 0;
    overflow: hidden;
  }

  .chat-column {
    padding-bottom: calc(
      var(--composer-height) +
        max(var(--resolved-safe-bottom), var(--layout-safe-bottom))
    );
  }

  .messages {
    padding-bottom: 1rem !important;
  }

  .welcome-state {
    padding-bottom: 1.25rem;
  }

  .input-area.auoura-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    z-index: 60;
    padding: 0 max(8px, var(--safe-area-right))
      max(8px, max(var(--resolved-safe-bottom), var(--layout-safe-bottom)))
      max(8px, var(--safe-area-left));
    background: linear-gradient(
      to top,
      color-mix(in srgb, var(--bg) 96%, transparent),
      transparent 65%
    );
  }

  .input-area.auoura-composer .input-container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 4px;
  }

  .input-area.auoura-composer .input-glow-wrapper {
    border-radius: 24px;
  }

  .input-area.auoura-composer .glow-box {
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
  }

  .input-area.auoura-composer .input-row {
    gap: 8px;
    padding: 10px 10px 8px;
    align-items: flex-end;
  }

  .input-area.auoura-composer .composer-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 10px 10px !important;
  }

  .input-area.auoura-composer .composer-toolbar-left,
  .input-area.auoura-composer .composer-toolbar-right {
    min-width: 0;
    gap: 6px !important;
  }

  .input-area.auoura-composer .composer-toolbar-left {
    grid-column: 1;
    justify-self: start;
  }

  .input-area.auoura-composer .composer-toolbar-right {
    grid-column: 3;
    justify-self: end;
  }

  .input-area.auoura-composer .composer-orb-wrap {
    position: static !important;
    grid-column: 2;
    justify-self: center;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
  }

  .input-area.auoura-composer .composer-tool-btn {
    max-width: 100%;
    min-width: 0 !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }

  .input-area.auoura-composer #search-mode-label .tool-name,
  .input-area.auoura-composer #reasoning-mode-label .tool-name,
  .input-area.auoura-composer #model-select-label .tool-name {
    display: none !important;
  }

  .input-area.auoura-composer .composer-tool-btn > *,
  .input-area.auoura-composer .composer-toolbar-left > *,
  .input-area.auoura-composer .composer-toolbar-right > * {
    min-width: 0;
  }

  .input-area.auoura-composer .orb-btn,
  .input-area.auoura-composer .attach-prefix-btn,
  .input-area.auoura-composer .send-btn {
    width: 38px;
    height: 38px;
  }

  .input-area.auoura-composer .input-footer {
    padding: 0 10px 10px;
  }

  .input-area.auoura-composer .input-hint {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .theme-onboarding-modal {
    align-items: flex-end;
    padding: max(0.75rem, max(var(--resolved-safe-top), var(--layout-safe-top)))
      max(0.75rem, var(--safe-area-right))
      max(0.75rem, max(var(--resolved-safe-bottom), var(--layout-safe-bottom)))
      max(0.75rem, var(--safe-area-left));
  }

  .theme-onboarding-shell {
    width: min(100%, 34rem);
    max-height: calc(
      var(--app-height) -
        max(var(--resolved-safe-top), var(--layout-safe-top)) - 1rem
    );
    overflow-y: auto;
    border-radius: 24px;
  }
}

/* =======================================
   Orb Panel Tabbed Interface
   ======================================= */

.input-area.auoura-composer .orb-panel-nav,
.composer-overlay-root .orb-panel-nav {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  flex-shrink: 0;
}

.input-area.auoura-composer .orb-panel-back,
.composer-overlay-root .orb-panel-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.input-area.auoura-composer .orb-panel-home,
.composer-overlay-root .orb-panel-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-auto-rows: minmax(112px, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 1px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Scrollable tab content area — fills remaining height after the nav */
.input-area.auoura-composer .orb-panel-content,
.composer-overlay-root .orb-panel-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding: 1px 1px 4px;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.input-area.auoura-composer .orb-panel-content::-webkit-scrollbar,
.composer-overlay-root .orb-panel-content::-webkit-scrollbar {
  width: 3px;
}

.input-area.auoura-composer .orb-panel-content::-webkit-scrollbar-track,
.composer-overlay-root .orb-panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.input-area.auoura-composer .orb-panel-content::-webkit-scrollbar-thumb,
.composer-overlay-root .orb-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* Sticky section header inside a scrolling panel content area */
.input-area.auoura-composer .orb-panel-content .orb-style-panel-header,
.composer-overlay-root .orb-panel-content .orb-style-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0 2px 12px;
  margin: 0 -2px 2px;
  background: color-mix(in srgb, var(--composer-panel) 96%, transparent);
  backdrop-filter: blur(18px);
}

.input-area.auoura-composer
  :is(
    #orb-panel-apps,
    #orb-panel-permissions,
    #orb-panel-memory,
    #orb-panel-files
  )
  .orb-style-control,
.composer-overlay-root
  :is(
    #orb-panel-apps,
    #orb-panel-permissions,
    #orb-panel-memory,
    #orb-panel-files
  )
  .orb-style-control {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.input-area.auoura-composer .orb-panel-menu-card,
.composer-overlay-root .orb-panel-menu-card {
  display: grid;
  grid-template-rows: 32px auto 1fr;
  gap: 0.35rem;
  align-content: start;
  justify-items: center;
  min-width: 0;
  min-height: 112px;
  padding: 0.95rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  text-align: center;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.input-area.auoura-composer .orb-panel-menu-card:hover,
.composer-overlay-root .orb-panel-menu-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: transparent;
}

.input-area.auoura-composer .orb-panel-menu-icon,
.composer-overlay-root .orb-panel-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.input-area.auoura-composer .orb-panel-menu-label,
.composer-overlay-root .orb-panel-menu-label {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.input-area.auoura-composer .orb-panel-menu-copy,
.composer-overlay-root .orb-panel-menu-copy {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.input-area.auoura-composer .orb-panel-tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 10px;
  padding: 0;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
  list-style: none;
}

.input-area.auoura-composer .orb-panel-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.input-area.auoura-composer .orb-panel-tab:hover {
  color: rgba(255, 255, 255, 0.75);
}

.input-area.auoura-composer .orb-panel-tab.active {
  color: var(--accent, rgb(255, 77, 103));
  border-bottom-color: var(--accent, rgb(255, 77, 103));
}

.input-area.auoura-composer .orb-panel-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.input-area.auoura-composer .orb-panel-tab.active svg {
  opacity: 1;
}

.composer-overlay-root .orb-panel-tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 10px;
  padding: 0;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
  list-style: none;
}

.composer-overlay-root .orb-panel-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.composer-overlay-root .orb-panel-tab:hover {
  color: rgba(255, 255, 255, 0.75);
}

.composer-overlay-root .orb-panel-tab.active {
  color: var(--accent, rgb(255, 77, 103));
  border-bottom-color: var(--accent, rgb(255, 77, 103));
}

.composer-overlay-root .orb-panel-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.composer-overlay-root .orb-panel-tab.active svg {
  opacity: 1;
}

.input-area.auoura-composer .orb-panel-content.hidden {
  display: none;
}

.composer-overlay-root .orb-panel-content:not(.active),
.composer-overlay-root .orb-panel-content.hidden {
  display: none;
}

.input-area.auoura-composer .orb-snake-header,
.composer-overlay-root .orb-snake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.input-area.auoura-composer .orb-snake-scoreboard,
.composer-overlay-root .orb-snake-scoreboard {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.input-area.auoura-composer .orb-snake-score-pill,
.composer-overlay-root .orb-snake-score-pill {
  min-width: 60px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.14),
    rgba(var(--accent-deep-rgb), 0.1)
  );
  display: grid;
  gap: 2px;
  text-align: right;
}

.input-area.auoura-composer .orb-snake-score-label,
.composer-overlay-root .orb-snake-score-label {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-area.auoura-composer .orb-snake-score-pill strong,
.composer-overlay-root .orb-snake-score-pill strong {
  font-size: 0.94rem;
  line-height: 1;
}

.input-area.auoura-composer .orb-snake-panel,
.composer-overlay-root .orb-snake-panel {
  display: grid;
  gap: 10px;
  outline: none;
}

.input-area.auoura-composer .orb-snake-stage-shell,
.composer-overlay-root .orb-snake-stage-shell {
  position: relative;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  background:
    radial-gradient(
      circle at top,
      rgba(var(--accent-rgb), 0.24),
      transparent 56%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.015)
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.input-area.auoura-composer .orb-snake-canvas,
.composer-overlay-root .orb-snake-canvas {
  display: block;
  width: min(100%, 304px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  background: #040912;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.input-area.auoura-composer .orb-snake-overlay,
.composer-overlay-root .orb-snake-overlay {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(10px);
}

.input-area.auoura-composer .orb-snake-overlay.hidden,
.composer-overlay-root .orb-snake-overlay.hidden {
  display: none;
}

.input-area.auoura-composer .orb-snake-overlay-card,
.composer-overlay-root .orb-snake-overlay-card {
  width: min(214px, calc(100% - 20px));
  display: grid;
  gap: 8px;
  text-align: center;
}

.input-area.auoura-composer .orb-snake-overlay-title,
.composer-overlay-root .orb-snake-overlay-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.input-area.auoura-composer .orb-snake-overlay-copy,
.composer-overlay-root .orb-snake-overlay-copy {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.input-area.auoura-composer .orb-snake-primary-btn,
.input-area.auoura-composer .orb-snake-secondary-btn,
.composer-overlay-root .orb-snake-primary-btn,
.composer-overlay-root .orb-snake-secondary-btn {
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 999px;
  padding: 0.58rem 0.84rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.input-area.auoura-composer .orb-snake-primary-btn,
.composer-overlay-root .orb-snake-primary-btn {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.98),
    rgba(var(--accent-deep-rgb), 0.96)
  );
  color: #fff;
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.24);
}

.input-area.auoura-composer .orb-snake-secondary-btn,
.composer-overlay-root .orb-snake-secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input-area.auoura-composer .orb-snake-primary-btn:hover,
.input-area.auoura-composer .orb-snake-secondary-btn:hover,
.composer-overlay-root .orb-snake-primary-btn:hover,
.composer-overlay-root .orb-snake-secondary-btn:hover {
  transform: translateY(-1px);
}

.input-area.auoura-composer .orb-snake-toolbar,
.composer-overlay-root .orb-snake-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.input-area.auoura-composer .orb-snake-status,
.composer-overlay-root .orb-snake-status {
  margin: 0;
  flex: 1 1 160px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.input-area.auoura-composer .orb-snake-actions,
.composer-overlay-root .orb-snake-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

@media (min-width: 640px) {
  .input-area.auoura-composer .orb-snake-toolbar,
  .composer-overlay-root .orb-snake-toolbar {
    flex-wrap: nowrap;
  }
}

html[data-theme="light"] .input-area.auoura-composer .orb-snake-stage-shell,
html[data-theme="light"] .composer-overlay-root .orb-snake-stage-shell {
  background:
    radial-gradient(
      circle at top,
      rgba(var(--accent-rgb), 0.18),
      transparent 56%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

html[data-theme="light"] .input-area.auoura-composer .orb-snake-overlay,
html[data-theme="light"] .composer-overlay-root .orb-snake-overlay {
  background: rgba(245, 247, 251, 0.84);
}

html[data-theme="light"] .input-area.auoura-composer .orb-snake-overlay-title,
html[data-theme="light"] .input-area.auoura-composer .orb-snake-overlay-copy,
html[data-theme="light"] .composer-overlay-root .orb-snake-overlay-title,
html[data-theme="light"] .composer-overlay-root .orb-snake-overlay-copy {
  color: var(--text);
}

html[data-theme="light"] .input-area.auoura-composer .orb-snake-secondary-btn,
html[data-theme="light"] .composer-overlay-root .orb-snake-secondary-btn {
  background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 900px) {
  .input-area.auoura-composer .orb-snake-canvas,
  .composer-overlay-root .orb-snake-canvas {
    width: min(100%, 272px);
  }

  .input-area.auoura-composer .orb-snake-status,
  .composer-overlay-root .orb-snake-status {
    flex-basis: 100%;
  }
}

.input-area.auoura-composer .orb-files-open-btn,
.composer-overlay-root .orb-files-open-btn {
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.18),
    rgba(var(--accent-deep-rgb), 0.18)
  );
  color: rgba(255, 255, 255, 0.94);
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  text-align: center;
}
.input-area.auoura-composer .orb-files-open-btn:hover,
.composer-overlay-root .orb-files-open-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.28),
    rgba(var(--accent-deep-rgb), 0.28)
  );
  border-color: rgba(var(--accent-rgb), 0.55);
}

.input-area.auoura-composer .orb-apps-store-btn,
.composer-overlay-root .orb-apps-store-btn {
  width: 100%;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(255, 255, 255, 0.94);
  padding: 0.62rem 0.9rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
  text-align: center;
}

.input-area.auoura-composer .orb-apps-store-btn:hover,
.composer-overlay-root .orb-apps-store-btn:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-1px);
}

.input-area.auoura-composer #orb-apps-list,
.composer-overlay-root #orb-apps-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.input-area.auoura-composer .orb-apps-list-shell,
.composer-overlay-root .orb-apps-list-shell {
  display: grid;
  gap: 0;
  flex: 1;
  min-height: 0;
  width: min(100%, 560px);
  margin-inline: auto;
  padding: 2px 14px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.input-area.auoura-composer .orb-apps-empty,
.composer-overlay-root .orb-apps-empty {
  margin: 0;
  padding: 10px 0;
  text-align: center;
}

.input-area.auoura-composer .orb-apps-item,
.composer-overlay-root .orb-apps-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.input-area.auoura-composer .orb-apps-item-icon,
.composer-overlay-root .orb-apps-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.input-area.auoura-composer .orb-apps-item-copy,
.composer-overlay-root .orb-apps-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.input-area.auoura-composer .orb-apps-item-title,
.composer-overlay-root .orb-apps-item-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-area.auoura-composer .orb-apps-item-tagline,
.composer-overlay-root .orb-apps-item-tagline,
.input-area.auoura-composer .orb-apps-item-meta,
.composer-overlay-root .orb-apps-item-meta {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.input-area.auoura-composer .orb-apps-item-meta,
.composer-overlay-root .orb-apps-item-meta {
  color: color-mix(in srgb, var(--text-muted) 92%, transparent);
}

.input-area.auoura-composer .orb-apps-divider,
.composer-overlay-root .orb-apps-divider {
  height: 1px;
  margin: 0 14px;
  background: rgba(255, 255, 255, 0.08);
}

.input-area.auoura-composer .orb-apps-footer,
.composer-overlay-root .orb-apps-footer {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 8px 14px 2px;
}

.input-area.auoura-composer .orb-apps-toggle,
.composer-overlay-root .orb-apps-toggle {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.input-area.auoura-composer .orb-apps-toggle input,
.composer-overlay-root .orb-apps-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.input-area.auoura-composer .orb-apps-toggle-track,
.composer-overlay-root .orb-apps-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.input-area.auoura-composer .orb-apps-toggle-thumb,
.composer-overlay-root .orb-apps-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.input-area.auoura-composer
  .orb-apps-toggle
  input:checked
  + .orb-apps-toggle-track,
.composer-overlay-root .orb-apps-toggle input:checked + .orb-apps-toggle-track {
  background: var(--accent, #ff4d67);
}

.input-area.auoura-composer
  .orb-apps-toggle
  input:checked
  + .orb-apps-toggle-track
  + .orb-apps-toggle-thumb,
.composer-overlay-root
  .orb-apps-toggle
  input:checked
  + .orb-apps-toggle-track
  + .orb-apps-toggle-thumb {
  transform: translateX(14px);
}

html[data-theme="light"] .input-area.auoura-composer .orb-apps-divider,
html[data-theme="light"] .composer-overlay-root .orb-apps-divider {
  background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .input-area.auoura-composer .orb-apps-toggle-track,
html[data-theme="light"] .composer-overlay-root .orb-apps-toggle-track {
  background: rgba(0, 0, 0, 0.12);
}

/* Bento grid for files & projects */
.input-area.auoura-composer .orb-files-section-list,
.composer-overlay-root .orb-files-section-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.input-area.auoura-composer .orb-files-section-list.is-empty,
.composer-overlay-root .orb-files-section-list.is-empty {
  grid-template-columns: minmax(0, 1fr);
  min-height: 5.5rem;
  align-items: center;
  justify-items: center;
}

.input-area.auoura-composer .orb-files-summary-card,
.composer-overlay-root .orb-files-summary-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.input-area.auoura-composer .orb-files-summary-card strong,
.composer-overlay-root .orb-files-summary-card strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-area.auoura-composer .orb-files-summary-card span,
.composer-overlay-root .orb-files-summary-card span,
.input-area.auoura-composer .orb-files-empty,
.composer-overlay-root .orb-files-empty {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

.input-area.auoura-composer .orb-files-section-list.is-empty .orb-files-empty,
.composer-overlay-root .orb-files-section-list.is-empty .orb-files-empty {
  width: auto;
  max-width: 100%;
}

.input-area.auoura-composer .orb-files-item,
.composer-overlay-root .orb-files-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.14s,
    border-color 0.14s;
  min-width: 0;
}
.input-area.auoura-composer .orb-files-item:hover,
.composer-overlay-root .orb-files-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.input-area.auoura-composer .orb-files-item-name,
.composer-overlay-root .orb-files-item-name {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 550;
}

.input-area.auoura-composer .orb-files-item-meta,
.composer-overlay-root .orb-files-item-meta {
  color: var(--text-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Supervisor tab */
.input-area.auoura-composer .orb-supervisor-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.input-area.auoura-composer .orb-supervisor-stat {
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-area.auoura-composer .orb-supervisor-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.2;
}

.input-area.auoura-composer .orb-supervisor-stat-label {
  display: block;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

.input-area.auoura-composer .orb-supervisor-note {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 10px 0 0;
  text-align: center;
  line-height: 1.4;
}

/* Hide non-active tab panels */
.input-area.auoura-composer .orb-panel-content:not(.active) {
  display: none;
}

/* Light mode overrides */
html[data-theme="light"] .input-area.auoura-composer .orb-panel-tab {
  color: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-back,
html[data-theme="light"] .composer-overlay-root .orb-panel-back,
html[data-theme="light"] .input-area.auoura-composer .orb-panel-menu-card,
html[data-theme="light"] .composer-overlay-root .orb-panel-menu-card,
html[data-theme="light"] .input-area.auoura-composer .orb-files-summary-card,
html[data-theme="light"] .composer-overlay-root .orb-files-summary-card,
html[data-theme="light"] .input-area.auoura-composer .orb-files-item,
html[data-theme="light"] .composer-overlay-root .orb-files-item {
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-back,
html[data-theme="light"] .composer-overlay-root .orb-panel-back,
html[data-theme="light"] .input-area.auoura-composer .orb-files-item,
html[data-theme="light"] .composer-overlay-root .orb-files-item,
html[data-theme="light"] .input-area.auoura-composer .orb-files-summary-card,
html[data-theme="light"] .composer-overlay-root .orb-files-summary-card {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.86);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-menu-card,
html[data-theme="light"] .composer-overlay-root .orb-panel-menu-card {
  background: transparent;
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-menu-copy,
html[data-theme="light"] .composer-overlay-root .orb-panel-menu-copy,
html[data-theme="light"]
  .input-area.auoura-composer
  .orb-files-summary-card
  span,
html[data-theme="light"] .composer-overlay-root .orb-files-summary-card span,
html[data-theme="light"] .input-area.auoura-composer .orb-files-empty,
html[data-theme="light"] .composer-overlay-root .orb-files-empty,
html[data-theme="light"] .input-area.auoura-composer .orb-files-item-meta,
html[data-theme="light"] .composer-overlay-root .orb-files-item-meta {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-tab:hover {
  color: rgba(0, 0, 0, 0.7);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-tab.active {
  color: var(--accent, rgb(255, 77, 103));
}

html[data-theme="light"] .composer-overlay-root .orb-panel-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .composer-overlay-root .orb-panel-tab {
  color: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .composer-overlay-root .orb-panel-tab:hover {
  color: rgba(0, 0, 0, 0.7);
}

html[data-theme="light"] .composer-overlay-root .orb-panel-tab.active {
  color: var(--accent, rgb(255, 77, 103));
}

html[data-theme="light"] .settings-location-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .settings-location-copy p {
  color: rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] .settings-location-track {
  background: rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .settings-location-track::after {
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .input-area.auoura-composer .orb-supervisor-stat {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"]
  .input-area.auoura-composer
  .orb-supervisor-stat-value {
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .input-area.auoura-composer .orb-supervisor-note {
  color: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* Orb panel compact pass */
.input-area.auoura-composer .orb-panel-menu-card,
.composer-overlay-root .orb-panel-menu-card {
  gap: 0.3rem;
  min-height: 104px;
  padding: 0.82rem 0.8rem;
}

.input-area.auoura-composer .orb-panel-menu-copy,
.composer-overlay-root .orb-panel-menu-copy {
  line-height: 1.35;
}

.input-area.auoura-composer .orb-panel-tabs,
.composer-overlay-root .orb-panel-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  align-items: stretch;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  border-bottom: none;
  list-style: none;
}

.input-area.auoura-composer .orb-panel-tab,
.composer-overlay-root .orb-panel-tab {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.52rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input-area.auoura-composer .orb-panel-tab:hover,
.composer-overlay-root .orb-panel-tab:hover {
  border-color: rgba(var(--accent-rgb), 0.24);
}

.input-area.auoura-composer .orb-panel-tab.active,
.composer-overlay-root .orb-panel-tab.active {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.09);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-tab,
html[data-theme="light"] .composer-overlay-root .orb-panel-tab {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .input-area.auoura-composer .orb-panel-tab.active,
html[data-theme="light"] .composer-overlay-root .orb-panel-tab.active {
  background: rgba(var(--accent-rgb), 0.11);
  border-color: rgba(var(--accent-rgb), 0.26);
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .input-area.auoura-composer .orb-panel-home,
  .composer-overlay-root .orb-panel-home {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .input-area.auoura-composer .orb-panel-tab {
    font-size: 0.65rem;
    padding: 6px 4px;
  }
  .composer-overlay-root .orb-panel-tab {
    font-size: 0.65rem;
    padding: 6px 4px;
  }
  .input-area.auoura-composer .orb-panel-tab svg {
    width: 10px;
    height: 10px;
  }
  .composer-overlay-root .orb-panel-tab svg {
    width: 10px;
    height: 10px;
  }
  .input-area.auoura-composer .orb-supervisor-summary {
    grid-template-columns: 1fr;
  }
  .input-area.auoura-composer .orb-files-section-list,
  .composer-overlay-root .orb-files-section-list {
    grid-template-columns: 1fr;
  }
}

/* Weather card in message bubbles */
.weather-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  margin: 10px 0 4px;
  border-radius: 12px;
  background: var(--surface, #111);
  border: 1px solid var(--border, #1e1e1e);
  font-family: inherit;
  max-width: 420px;
}

.weather-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weather-card-header svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--muted, #888);
}

.weather-card-location {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.weather-card-temp-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.weather-card-temp {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
}

.weather-card-conditions {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.weather-card-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.weather-card-detail {
  text-align: center;
  padding: 6px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, #1e1e1e);
}

.weather-card-detail-label {
  display: block;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.weather-card-detail-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.weather-card-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.weather-card-day {
  text-align: center;
  padding: 6px 2px;
}

.weather-card-day-name {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.weather-card-day-temps {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.weather-card-day-icon {
  display: block;
  margin: 2px auto;
  width: 18px;
  height: 18px;
  color: var(--accent, rgb(255, 77, 103));
}

/* Light mode weather card */
html[data-theme="light"] .weather-card {
  background: rgba(var(--accent-rgb), 0.04);
  border-color: rgba(var(--accent-rgb), 0.12);
}

html[data-theme="light"] .weather-card-location {
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .weather-card-temp {
  color: rgba(0, 0, 0, 0.9);
}

html[data-theme="light"] .weather-card-conditions {
  color: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .weather-card-detail {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .weather-card-detail-value {
  color: rgba(0, 0, 0, 0.8);
}

html[data-theme="light"] .weather-card-forecast {
  border-top-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .weather-card-day-name {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .weather-card-day-temps {
  color: rgba(0, 0, 0, 0.75);
}

/* ── Weather Modal ──────────────────────────────────────────────────────────── */
.weather-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: weather-modal-bg-in 0.2s ease;
}
.weather-modal-overlay.hidden {
  display: none;
}
@keyframes weather-modal-bg-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.weather-modal-shell {
  position: relative;
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  padding: 28px 24px 20px;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: weather-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.weather-modal-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 70% 20%,
    rgba(99, 179, 237, 0.12) 0%,
    transparent 60%
  );
  pointer-events: none;
}
@keyframes weather-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.weather-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
  z-index: 1;
}
.weather-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.weather-modal-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.weather-modal-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(99, 179, 237, 0.4));
  animation: weather-icon-float 3s ease-in-out infinite;
}
@keyframes weather-icon-float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}
.weather-modal-hero-text {
  flex: 1;
  min-width: 0;
}
.weather-modal-location {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-modal-conditions {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.weather-modal-temp-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.weather-modal-temp {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -2px;
}
.weather-modal-feels {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
}
.weather-modal-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.weather-modal-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.weather-modal-detail svg {
  color: rgba(99, 179, 237, 0.8);
}
.weather-modal-detail-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.35);
}
.weather-modal-detail-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.weather-modal-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 16px;
}
.weather-modal-forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.weather-modal-forecast-day-name {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}
.weather-modal-forecast-day-icon {
  font-size: 20px;
  line-height: 1;
}
.weather-modal-forecast-day-hi {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
.weather-modal-forecast-day-lo {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}
.weather-modal-source {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  margin: 0;
}
.weather-modal-shell.wm-sunny::before {
  background: radial-gradient(
    ellipse at 70% 10%,
    rgba(251, 191, 36, 0.2) 0%,
    transparent 60%
  );
}
.weather-modal-shell.wm-cloudy::before {
  background: radial-gradient(
    ellipse at 70% 10%,
    rgba(148, 163, 184, 0.15) 0%,
    transparent 60%
  );
}
.weather-modal-shell.wm-rain::before {
  background: radial-gradient(
    ellipse at 70% 10%,
    rgba(99, 179, 237, 0.18) 0%,
    transparent 60%
  );
}
.weather-modal-shell.wm-snow::before {
  background: radial-gradient(
    ellipse at 70% 10%,
    rgba(219, 234, 254, 0.2) 0%,
    transparent 60%
  );
}
.weather-modal-shell.wm-storm::before {
  background: radial-gradient(
    ellipse at 70% 10%,
    rgba(167, 139, 250, 0.2) 0%,
    transparent 60%
  );
}
/* .weather-card-open-modal removed — modal is no longer triggered from inline card */

/* MCP add/edit form */
.mcp-form-shell {
  width: 100%;
  margin-top: 0.75rem;
}

.mcp-form-grid {
  display: grid;
  gap: 0.55rem;
}

.mcp-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.mcp-form-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 2px;
}

.mcp-form-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.mcp-form-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.mcp-form-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mcp-form-field > span {
  font-size: 0.69rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.03em;
}

.mcp-form-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.82rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
}

.mcp-form-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.mcp-form-input:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.mcp-form-input:focus {
  border-color: rgba(var(--accent-rgb, 255, 77, 103), 0.55);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 255, 77, 103), 0.1);
}

.mcp-form-input[type="number"]::-webkit-inner-spin-button,
.mcp-form-input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

.mcp-form-field--checkbox {
  flex-direction: row;
  align-items: center;
}

.mcp-form-field--checkbox > span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.mcp-form-field--checkbox input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent, rgb(255, 77, 103));
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.mcp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 0;
}

.mcp-form-submit {
  padding: 7px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent, rgb(255, 77, 103));
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.13s ease;
}

.mcp-form-submit:hover {
  opacity: 0.88;
}

.mcp-form-cancel {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.13s ease,
    color 0.13s ease;
}

.mcp-form-cancel:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .mcp-form-kicker {
  color: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .mcp-form-title {
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .mcp-form-input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .mcp-form-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] .mcp-form-input:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .mcp-form-field > span {
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .mcp-form-field--checkbox > span {
  color: rgba(0, 0, 0, 0.72);
}

html[data-theme="light"] .mcp-form-cancel {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .mcp-form-close {
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.55);
}

/* ── Model toggle logo ───────────────────────────────────────── */
#model-select-btn.model-logo-toggle {
  display: inline-flex;
  position: relative;
  min-width: min(82px, 24vw);
  padding: 0.06rem 0.1rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

html[data-visual-theme="blocky"] #model-select-btn.model-logo-toggle {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
}

#model-select-btn.model-logo-toggle:hover,
#model-select-btn.model-logo-toggle.active,
#model-select-btn.model-logo-toggle:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #fff;
}

html[data-visual-theme="blocky"] #model-select-btn.model-logo-toggle:hover,
html[data-visual-theme="blocky"] #model-select-btn.model-logo-toggle.active,
html[data-visual-theme="blocky"]
  #model-select-btn.model-logo-toggle:focus-visible {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
}

#model-select-btn .model-logo-svg {
  width: min(82px, 24vw);
  max-width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

#model-select-btn .model-logo-pill {
  opacity: 0;
  transition: opacity 0.25s ease;
}

#model-select-btn:hover .model-logo-pill,
#model-select-btn:focus-visible .model-logo-pill {
  opacity: 0;
}

#model-select-btn .model-logo-word {
  transform-origin: center;
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

#model-select-btn .model-select-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme="light"] #model-select-btn.model-logo-toggle {
  color: rgba(12, 18, 28, 0.92);
}

html[data-theme="light"][data-visual-theme="blocky"]
  #model-select-btn.model-logo-toggle,
html[data-theme="light"][data-visual-theme="blocky"]
  #model-select-btn.model-logo-toggle:hover,
html[data-theme="light"][data-visual-theme="blocky"]
  #model-select-btn.model-logo-toggle.active,
html[data-theme="light"][data-visual-theme="blocky"]
  #model-select-btn.model-logo-toggle:focus-visible {
  color: #000 !important;
}

html[data-theme="light"] #model-select-btn.model-logo-toggle:hover,
html[data-theme="light"] #model-select-btn.model-logo-toggle.active,
html[data-theme="light"] #model-select-btn.model-logo-toggle:focus-visible {
  color: rgba(12, 18, 28, 0.98);
}

html[data-theme="light"] #model-select-btn:hover .model-logo-pill,
html[data-theme="light"] #model-select-btn:focus-visible .model-logo-pill {
  opacity: 0;
}

/* ── Model badge on assistant messages ───────────────────────── */
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
}
.model-badge-axis,
.model-badge-fusion {
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff;
}
.model-badge-nova,
.model-badge-flow {
  background: linear-gradient(135deg, #334155, #64748b);
  color: #fff;
}

/* ── Generation loading dots ─────────────────────────────────── */
.msg-generating-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
}
.msg-generating-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, rgba(255, 255, 255, 0.35));
  animation: msg-dot-bounce 1.2s infinite ease-in-out both;
}
.msg-generating-dots span:nth-child(1) {
  animation-delay: 0s;
}
.msg-generating-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.msg-generating-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes msg-dot-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
html[data-theme="light"] .msg-generating-dots span {
  background: var(--text-muted, rgba(0, 0, 0, 0.3));
}

/* ── Agentic tool call cards ─────────────────────────────────── */
.tool-call-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--bg-elevated, #1e1e2e);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-size: 13px;
  margin: 6px 0;
  width: fit-content;
  max-width: 100%;
  transition: opacity 0.3s;
}
.tool-call-card--running .tool-call-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent, #7c3aed);
  border-top-color: transparent;
  border-radius: 50%;
  animation: tool-card-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes tool-card-spin {
  to {
    transform: rotate(360deg);
  }
}
.tool-call-card--done {
  opacity: 0.65;
}
.tool-call-done {
  color: #22c55e;
  font-weight: 700;
}

.fusion-inline-panel {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

/* Unified brief-message card — subtle background, no heavy shadow */
.fusion-inline-card--brief-message {
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  border-color: var(--border-input);
  box-shadow: none;
}

/* ── Activity list ─────────────────────────────────────────────── */
.fusion-inline-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.fusion-inline-activity-list--spaced {
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.fusion-inline-activity-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.835rem;
  line-height: 1.4;
  padding: 0.1rem 0;
  color: var(--text-muted);
}

.fusion-inline-activity-icon {
  flex: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.fusion-inline-activity-row--success .fusion-inline-activity-icon {
  color: rgba(34, 197, 94, 0.85);
}
.fusion-inline-activity-row--error .fusion-inline-activity-icon {
  color: rgba(248, 113, 113, 0.9);
}
.fusion-inline-activity-row--waiting .fusion-inline-activity-icon {
  color: rgba(245, 158, 11, 0.85);
}
.fusion-inline-activity-row--running .fusion-inline-activity-icon {
  color: var(--text-faint);
}

/* Spinner for running state */
.fusion-activity-spinner {
  display: block;
  width: 11px;
  height: 11px;
  border: 1.5px solid color-mix(in srgb, var(--text-faint) 40%, transparent);
  border-top-color: var(--accent, #818cf8);
  border-radius: 50%;
  animation: fusion-spin 0.7s linear infinite;
}

@keyframes fusion-spin {
  to {
    transform: rotate(360deg);
  }
}

.fusion-inline-activity-name {
  flex: 0 0 auto;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.fusion-inline-activity-target {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* ── Inline permission section ─────────────────────────────────── */
.fusion-inline-perm-section {
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Embedded prompt card — strip the outer card chrome so it fits cleanly */
.fusion-inline-embedded-prompt {
  margin-top: 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  padding-top: 0.6rem;
  background: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
}

.fusion-inline-brief-message {
  margin: 0;
  color: var(--text);
}

.fusion-inline-brief-message-stream {
  position: relative;
  margin-top: 0.9rem;
  padding-top: 0;
  border-top: none;
}

/* Header chip that labels the section */
.fusion-inline-brief-message-stream::before {
  content: "Reasoning";
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-muted) 65%, transparent);
  margin-bottom: 0.45rem;
}

/* Scrollable text viewport */
.fusion-inline-brief-message-stream-body {
  position: relative;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: color-mix(in srgb, var(--surface-1, #0f172a) 55%, transparent);
  font-size: 0.835rem;
  line-height: 1.65;
  color: var(--text-muted);
  word-break: break-word;
}

.fusion-inline-brief-message-stream-body > :first-child {
  margin-top: 0;
}
.fusion-inline-brief-message-stream-body > :last-child {
  margin-bottom: 0;
}

/* Bottom fade so scroll depth is implied */
.fusion-inline-brief-message-stream-body::after {
  content: "";
  display: block;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2rem;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--surface-1, #0f172a) 70%, transparent)
  );
  pointer-events: none;
  margin: 0 -0.75rem -0.65rem;
}

/* Blinking cursor on the last child element while still streaming */
.fusion-inline-brief-message-stream-body[data-reasoning-live]
  > :last-child::after {
  content: "▋";
  display: inline-block;
  color: var(--accent, #818cf8);
  opacity: 0.8;
  margin-left: 2px;
  animation: reasoning-cursor-blink 0.85s step-end infinite;
}

@keyframes reasoning-cursor-blink {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0;
  }
}

/* Separator above the reasoning trace */
.fusion-inline-brief-message-stream-separator {
  display: block;
  width: 100%;
  height: 1px;
  background: color-mix(in srgb, var(--border) 60%, transparent);
  margin-bottom: 0.75rem;
}

.fusion-inline-brief-message > :first-child {
  margin-top: 0;
}

.fusion-inline-brief-message > :last-child {
  margin-bottom: 0;
}

.fusion-ask-modal {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 0;
  display: grid;
  gap: 0.8rem;
  padding: 0 0.9rem;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.12),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-raised) 94%, transparent),
      color-mix(in srgb, var(--surface-1) 92%, transparent)
    );
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  overflow: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  opacity: 0;
  transform: var(--ask-modal-position-transform, translateX(0))
    translateY(-10px);
  transition:
    max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    transform 0.24s ease,
    padding 0.24s ease;
}

.composer-overlay-root .fusion-ask-modal {
  position: fixed;
  top: var(--ask-modal-top, auto);
  right: var(--ask-modal-right, auto);
  bottom: var(--ask-modal-bottom, auto);
  left: var(--ask-modal-left, 50%);
  width: var(--ask-modal-width, min(760px, calc(100vw - 24px)));
  max-width: calc(100vw - 24px);
  margin: 0;
  z-index: 999999;
  pointer-events: auto;
}

.fusion-ask-modal.is-visible {
  opacity: 1;
  max-height: var(--ask-modal-max-height, min(78svh, 640px));
  padding: 0.9rem;
  transform: var(--ask-modal-position-transform, translateX(0)) translateY(0);
  overflow: auto;
}

.fusion-ask-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 0.35rem;
  background: inherit;
}

.fusion-ask-modal-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.fusion-ask-modal-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.fusion-ask-modal-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.2;
  color: var(--text);
}

.fusion-ask-modal-status {
  flex-shrink: 0;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.fusion-ask-modal-stack {
  display: grid;
  gap: 0.8rem;
}

.fusion-ask-modal-card {
  margin: 0;
}

.fusion-ask-modal-card .fusion-inline-prompt-form {
  margin-top: 0.65rem;
  gap: 0.65rem;
}

.fusion-ask-modal-card .fusion-inline-option-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0.55rem 0.75rem;
  align-items: start;
  margin-top: 0.65rem;
}

.fusion-ask-modal-card .fusion-inline-prompt-textarea {
  min-height: 72px;
}

html[data-theme="light"] .fusion-ask-modal {
  border-color: rgba(0, 0, 0, 0.08);
  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.08),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96),
      rgba(244, 246, 248, 0.96)
    );
  box-shadow: 0 22px 48px rgba(16, 24, 40, 0.14);
}

html[data-theme="light"] .input-area.auoura-composer .glow-box.fusion-ask-open {
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.12);
}

.fusion-inline-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface-raised) 92%, transparent),
      color-mix(in srgb, var(--surface-1) 86%, transparent)
    ),
    var(--accent-radial-soft);
  padding: 0.9rem 1rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
}

.fusion-inline-card--waiting {
  border-color: rgba(245, 158, 11, 0.35);
}

.fusion-inline-card--error {
  border-color: rgba(248, 113, 113, 0.35);
}

.fusion-inline-card--success {
  border-color: rgba(34, 197, 94, 0.35);
}

.fusion-inline-card-head,
.fusion-inline-actions,
.fusion-inline-option,
.fusion-inline-option-list {
  display: flex;
  gap: 0.6rem;
}

.fusion-inline-card-head {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-width: 0;
  margin-bottom: 0.5rem;
}

.fusion-inline-card-title {
  flex: 1 1 14rem;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fusion-inline-card-status {
  flex: 0 0 auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.fusion-inline-card-summary,
.fusion-inline-card-context {
  min-width: 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fusion-inline-card-summary > :first-child,
.fusion-inline-card-context > :first-child,
.fusion-inline-card-body > :first-child {
  margin-top: 0;
}

.fusion-inline-card-summary > :last-child,
.fusion-inline-card-context > :last-child,
.fusion-inline-card-body > :last-child {
  margin-bottom: 0;
}

.fusion-inline-card-context {
  margin-top: 0.45rem;
}

.fusion-inline-card-body {
  margin: 0.75rem 0 0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fusion-inline-card--send-message {
  gap: 0.7rem;
}

.fusion-sendmessage-block {
  margin-top: 0.6rem;
  color: var(--text);
}

.fusion-sendmessage-block > :first-child {
  margin-top: 0;
}

.fusion-sendmessage-block > :last-child {
  margin-bottom: 0;
}

.fusion-inline-sendmessage-body {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  color: var(--text);
}

.fusion-inline-sendmessage-body > :first-child {
  margin-top: 0;
}

.fusion-inline-sendmessage-body > :last-child {
  margin-bottom: 0;
}

.fusion-inline-actions {
  flex-wrap: wrap;
  margin-top: 0.85rem;
  position: sticky;
  bottom: 0;
  padding-top: 0.75rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0),
    color-mix(in srgb, var(--surface-1) 94%, transparent) 36%
  );
}

.fusion-inline-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.fusion-inline-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: rgba(var(--accent-rgb), 0.12);
}

.fusion-inline-action--primary {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.24),
    rgba(var(--accent-deep-rgb), 0.22)
  );
  border-color: rgba(var(--accent-rgb), 0.45);
}

.fusion-inline-action--danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.fusion-inline-card-perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
}

.fusion-inline-card-perm-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.84rem;
}

.fusion-inline-card-perm-name {
  flex: 0 0 auto;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

.fusion-inline-card-perm-target {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fusion-inline-continuing {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-style: italic;
  padding: 0.2rem 0;
}

.fusion-inline-prompt-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.fusion-inline-option-list {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.fusion-inline-option {
  align-items: center;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.fusion-inline-option span,
.fusion-inline-card a,
.fusion-inline-card code,
.fusion-inline-card .msg-prose,
.fusion-inline-card .msg-prose * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fusion-inline-prompt-textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  font: inherit;
}

/* MCP panel active badge */
.mcp-active-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}

.mcp-active-badge--muted {
  background: color-mix(in srgb, var(--text-dim, #aab2c5) 30%, transparent);
  color: var(--text, #f5f7ff);
}

.mcp-server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mcp-server-card {
  gap: 12px;
}

.mcp-server-badge-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mcp-server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  color: var(--text-dim, #aab2c5);
}

.mcp-server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.mcp-server-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mcp-server-tools span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--surface-raised, #1f2431) 80%,
    transparent
  );
  border: 1px solid
    color-mix(in srgb, var(--border-subtle, #334155) 70%, transparent);
  font-size: 11px;
  color: var(--text, #f5f7ff);
}

/* ── MCP panel: slim scroll as safety net, content sized to fit ─ */
#orb-panel-mcp {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#orb-panel-mcp::-webkit-scrollbar {
  width: 3px;
}
#orb-panel-mcp::-webkit-scrollbar-track {
  background: transparent;
}
#orb-panel-mcp::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* tighter padding and gap on the form card so steps fit without overflow */
#orb-panel-mcp .orb-style-control.mcp-form-shell {
  padding: 12px;
  gap: 8px;
}

/* ── MCP panel header with inline actions ───────────────────── */
.mcp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.mcp-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.mcp-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.mcp-header-btn--primary {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.mcp-header-btn--primary:hover {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.65);
}

/* ── MCP server list helpers ────────────────────────────────── */
.mcp-server-identity {
  flex: 1;
  min-width: 0;
}

.mcp-server-url {
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.mcp-server-error {
  color: #fca5a5;
  font-size: 11px;
}

.mcp-empty-copy,
.mcp-loading-copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.44);
  text-align: center;
  padding: 14px 0 6px;
  margin: 0;
}

/* ── MCP server action buttons (compact row inside card) ─────── */
.mcp-action-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.13s ease,
    border-color 0.13s ease,
    color 0.13s ease;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.mcp-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

.mcp-action-btn--danger {
  border-color: rgba(239, 68, 68, 0.22);
  color: rgba(252, 165, 165, 0.8);
}

.mcp-action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

html[data-theme="light"] .mcp-header-btn {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.58);
}

html[data-theme="light"] .mcp-header-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.8);
}

html[data-theme="light"] .mcp-header-btn--primary {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
  color: rgba(0, 0, 0, 0.8);
}

html[data-theme="light"] .mcp-action-btn {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .mcp-action-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.8);
}

html[data-theme="light"] .mcp-empty-copy,
html[data-theme="light"] .mcp-loading-copy {
  color: rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] .mcp-server-error {
  color: #dc2626;
}

html[data-theme="light"] .mcp-server-meta {
  color: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .mcp-server-url {
  color: rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] .mcp-server-tools span {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.65);
}

html[data-theme="light"] .mcp-active-badge--muted {
  background: rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.5);
}

/* ── MCP add/edit form: stepper, slides, review ─────────────── */
.mcp-form-stepper {
  display: flex;
  align-items: stretch;
  gap: 3px;
  margin: 0;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mcp-form-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease;
  -webkit-appearance: none;
  appearance: none;
}

.mcp-form-step:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
}

.mcp-form-step.active {
  background: rgba(var(--accent-rgb), 0.16);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.28);
}

.mcp-form-step-index {
  font-size: 0.56rem;
  font-weight: 800;
  color: inherit;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.mcp-form-step.active .mcp-form-step-index {
  color: var(--accent, rgb(255, 77, 103));
  opacity: 1;
}

.mcp-form-step-label {
  font-size: 0.63rem;
  font-weight: 600;
  line-height: 1.1;
}

/* Slide container */
.mcp-form-stage {
  display: grid;
}

.mcp-form-slide {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mcp-form-slide.hidden {
  display: none;
}

/* Slide header with icon + copy */
.mcp-form-slide-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  text-align: center;
}

.mcp-form-icon-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
  flex-shrink: 0;
}

.mcp-form-favicon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.mcp-form-slide-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  width: 100%;
}

.mcp-form-slide-kicker {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
  margin: 0;
}

.mcp-form-slide-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  line-height: 1.2;
}

.mcp-form-slide-copy-text {
  font-size: 0.69rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.44);
  margin: 0;
  max-width: 28ch;
}

/* Two-column field grid */
.mcp-form-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

/* Note */
.mcp-form-note {
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.36);
  margin: 0;
}

/* Review section (step 3) */
.mcp-form-review {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcp-form-review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.mcp-form-review-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mcp-form-review-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.36);
  flex-shrink: 0;
  min-width: 56px;
}

.mcp-form-review-value {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Form action bar */
.mcp-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
}

.mcp-form-actions-left,
.mcp-form-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mcp-form-back {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.13s ease,
    color 0.13s ease;
}

.mcp-form-back:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
}

.mcp-form-next {
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.13s ease,
    border-color 0.13s ease;
}

.mcp-form-next:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.55);
}

/* Light theme overrides for form */
html[data-theme="light"] .mcp-form-stepper {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .mcp-form-step {
  color: rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] .mcp-form-step:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.65);
}

html[data-theme="light"] .mcp-form-step.active {
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(0, 0, 0, 0.85);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.22);
}

html[data-theme="light"] .mcp-form-slide-kicker {
  color: rgba(0, 0, 0, 0.36);
}

html[data-theme="light"] .mcp-form-slide-title {
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .mcp-form-slide-copy-text,
html[data-theme="light"] .mcp-form-note {
  color: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .mcp-form-icon-shell {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .mcp-form-review-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .mcp-form-review-label {
  color: rgba(0, 0, 0, 0.4);
}

html[data-theme="light"] .mcp-form-review-value {
  color: rgba(0, 0, 0, 0.85);
}

html[data-theme="light"] .mcp-form-back {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .mcp-form-next {
  color: rgba(0, 0, 0, 0.8);
}
/* ── App Store Panel ───────────────────────────────────────────────────────── */
.app-store-panel {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  animation: app-store-fade-in 0.18s ease;
}
.app-store-panel.hidden {
  display: none;
}
@keyframes app-store-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app-store-shell {
  width: min(780px, 100vw);
  height: 100%;
  background: var(--surface-raised, #111);
  border-left: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: app-store-slide-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes app-store-slide-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.app-store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}
.app-store-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted, #888);
  min-width: 0;
}
.app-store-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--text, #e8e8e8);
}
.app-store-subtitle {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin: 2px 0 0;
}
.app-store-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.app-store-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated, #0d0d0d);
  border-radius: 8px;
  padding: 3px;
}
.app-store-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
}
.app-store-tab.active {
  background: var(--surface, #1a1a1a);
  color: var(--text, #e8e8e8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.app-store-tab:hover:not(.active) {
  color: var(--text, #e8e8e8);
}

.app-store-toolbar {
  padding: 14px 22px 0;
  flex-shrink: 0;
}

.app-store-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--surface, #111);
  color: var(--text-muted, #888);
}

.app-store-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-store-search {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text, #e8e8e8);
  font-size: 13px;
  font-family: inherit;
}

.app-store-search::placeholder {
  color: var(--text-muted, #888);
}

.app-store-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 22px 10px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}
.app-store-filters:empty {
  display: none;
}
.app-store-filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.app-store-filter-btn.active,
.app-store-filter-btn:hover {
  border-color: var(--accent, #ff4d67);
  color: var(--accent, #ff4d67);
  background: rgba(255, 77, 103, 0.08);
}

.app-store-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}
.app-store-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #888);
  font-size: 14px;
}

.app-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.app-store-card {
  background: var(--surface, #111);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.app-store-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.app-store-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.app-store-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: color-mix(
    in srgb,
    var(--surface, #111) 70%,
    rgba(255, 255, 255, 0.06)
  );
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.app-store-card-icon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-store-card-meta {
  flex: 1;
  min-width: 0;
}
.app-store-card-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #e8e8e8);
}
.app-store-card-cat {
  font-size: 11px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}
.app-store-card-tagline {
  font-size: 12px;
  color: var(--text-muted, #888);
  line-height: 1.4;
  flex: 1;
}
.app-store-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.app-store-card-tools {
  font-size: 11px;
  color: var(--text-muted, #888);
  flex: 1;
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.app-store-badge--featured {
  background: rgba(255, 77, 103, 0.12);
  color: var(--accent, #ff4d67);
}
.app-store-badge--builtin {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.app-store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: inherit;
}
.app-store-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.app-store-btn--primary {
  background: var(--accent, #ff4d67);
  color: #fff;
}
.app-store-btn--primary:hover:not(:disabled) {
  filter: brightness(1.1);
}
.app-store-btn--ghost {
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  color: var(--text-muted, #888);
}
.app-store-btn--ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text, #e8e8e8);
}

.app-store-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.app-store-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.app-store-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s;
}
.app-store-toggle input:checked ~ .app-store-toggle-track {
  background: var(--accent, #ff4d67);
}
.app-store-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  pointer-events: none;
}
.app-store-toggle
  input:checked
  ~ .app-store-toggle-track
  .app-store-toggle-thumb {
  transform: translateX(16px);
}

.app-store-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #888);
}
.app-store-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.app-store-empty h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #e8e8e8);
  margin: 0 0 6px;
}
.app-store-empty p {
  font-size: 13px;
  margin: 0;
  max-width: 280px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .app-store-shell {
    width: 100vw;
    border-left: none;
  }
  .app-store-grid {
    grid-template-columns: 1fr;
  }
  .app-store-subtitle {
    display: none;
  }
  .app-store-toolbar,
  .app-store-filters,
  .app-store-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ================================================================== */
/*  AI Supervisor panel (zero-token realtime monitor)                 */
/* ================================================================== */
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* LIVE badge in the header */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ff5d73;
  background: rgba(255, 77, 103, 0.12);
  border: 1px solid rgba(255, 77, 103, 0.4);
  align-self: flex-start;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-live-badge.hidden {
  display: none;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ff5d73;
  box-shadow: 0 0 0 0 rgba(255, 77, 103, 0.7);
  animation: supPulse 1.4s ease-out infinite;
}
@keyframes supPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 77, 103, 0.6);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 77, 103, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 103, 0);
  }
}

/* Master toggle block */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-master {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  padding: 18px 14px;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(var(--accent-rgb), 0.16),
      transparent 70%
    ),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-switch {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-switch-track {
  display: block;
  width: 76px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  transition:
    background 0.22s ease,
    border-color 0.22s ease;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-switch[aria-checked="true"]
  .sup-switch-track {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.95),
    rgba(var(--accent-deep-rgb), 0.95)
  );
  border-color: rgba(var(--accent-rgb), 0.6);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-switch[aria-checked="true"]
  .sup-switch-thumb {
  transform: translateX(36px);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-switch:focus-visible
  .sup-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-master-state {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-master-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  max-width: 280px;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-master-note
  strong {
  color: #5fd6a0;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-master-note.sup-note-warn
  strong {
  color: #fbbf24;
}

/* Sub-tab nav */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 7px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-tab.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.32),
    rgba(var(--accent-deep-rgb), 0.28)
  );
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-tab-count {
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-tab-count.has-risk {
  background: rgba(255, 77, 103, 0.85);
  color: #fff;
}

/* Disabled veil */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-disabled-veil {
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-disabled-veil p {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off
  .sup-pane,
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off
  .sup-tabs {
  display: none;
}

/* Panes */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-pane.hidden {
  display: none;
}

/* Live status row */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-status-led {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-status-pill.is-active {
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.5);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-status-pill.is-active
  .sup-status-led {
  background: var(--accent);
  animation: supPulse 1.4s ease-out infinite;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-status-pill.is-risk {
  color: #ff8a9b;
  border-color: rgba(255, 77, 103, 0.5);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-status-pill.is-risk
  .sup-status-led {
  background: #ff5d73;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-status-pill.is-done
  .sup-status-led {
  background: #4ade80;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

/* Live metrics grid */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-metric-value.sup-metric-risk.has-risk {
  color: #ff5d73;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-metric-label {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

:is(.input-area.auoura-composer, .composer-overlay-root) .sup-section-label {
  margin: 4px 0 0;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* Live ticker */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-ticker {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-ticker-line {
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  gap: 8px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-ticker-line time {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.32);
  font-variant-numeric: tabular-nums;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-ticker-line.is-risk {
  color: #ff8a9b;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-ticker-line.is-good {
  color: #6ee7a8;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-ticker-empty {
  margin: 0;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 8px 0;
}

/* Risk / activity lists */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-empty {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  padding: 18px 8px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-risk-card.sev-high {
  border-left-color: #ff4d67;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-risk-card.sev-medium {
  border-left-color: #fbbf24;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-risk-card.sev-low {
  border-left-color: #60a5fa;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-sev-badge {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sev-high
  .sup-sev-badge {
  background: rgba(255, 77, 103, 0.2);
  color: #ff8a9b;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sev-medium
  .sup-sev-badge {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sev-low
  .sup-sev-badge {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-desc {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.6);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-snippet {
  margin: 0;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: 8px;
  word-break: break-word;
  max-height: 56px;
  overflow: hidden;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-risk-time {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-act-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-act-row time {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-act-row.is-risk {
  color: #ff8a9b;
}

/* Sensitivity segmented control */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-sensitivity {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 7px 4px;
  border-radius: 9px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup-seg-btn.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.3),
    rgba(var(--accent-deep-rgb), 0.26)
  );
}

/* Light theme tweaks */
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-master-state,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-metric-value,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-risk-label {
  color: #121821;
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-master-note,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-risk-desc,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-tab {
  color: rgba(15, 23, 42, 0.6);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup-ticker {
  background: rgba(15, 23, 42, 0.05);
}

/* =================================================================== */
/*  Supervisor v2 — compact, single-pane, Apple-like                    */
/* =================================================================== */

:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup2 {
  /* Never scroll — everything fits in the panel */
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  /* Hide any stragglers from legacy markup */
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup2
  .sup2-legacy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  pointer-events: none;
}

/* Header with inline switch + integrated LIVE badge */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px !important;
  flex: 0 0 auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-header-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-header-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-live-badge
  .sup2-elapsed {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.85);
  padding-left: 4px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-live-text {
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* Compact Apple-style switch */
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-switch
  .sup-switch-track {
  width: 48px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-switch
  .sup-switch-thumb {
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.25);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-switch[aria-checked="true"]
  .sup-switch-thumb {
  transform: translateX(20px);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-switch[aria-checked="true"]
  .sup-switch-track {
  background: linear-gradient(135deg, #34d27a, #22a55a);
  border-color: rgba(52, 210, 122, 0.55);
}

/* The legacy status pill is rendered into a hidden node now — the LIVE badge
   in the header carries the active-state signal instead. */
:is(.input-area.auoura-composer, .composer-overlay-root) #supervisor-status {
  display: none !important;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ff8a9b;
  border-radius: 999px;
  background: rgba(255, 77, 103, 0.15);
  border: 1px solid rgba(255, 77, 103, 0.35);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-live-badge
  .sup-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ff5d73;
  animation: supPulse 1.4s ease-out infinite;
}

/* Graph card */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-card {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 0% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.015)
    );
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-segs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-seg-mini {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg-mini
  > button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg-mini
  > button:hover {
  color: rgba(255, 255, 255, 0.85);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg-mini
  > button.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.32),
    rgba(var(--accent-deep-rgb), 0.28)
  );
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-wrap {
  position: relative;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-canvas {
  display: block;
  width: 100%;
  height: 90px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.05));
  cursor: crosshair;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-tip {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  min-width: 90px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(10, 12, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  font-size: 0.7rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.92);
  transform: translate(-50%, calc(-100% - 8px));
  transition: opacity 0.1s ease;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip.hidden {
  display: none;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip
  strong {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  margin-bottom: 2px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-tip em {
  font-style: normal;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-tip span {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.62rem;
  margin-top: 3px;
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.92);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip
  em {
  color: #0f172a;
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip
  strong,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-tip
  span {
  color: rgba(15, 23, 42, 0.55);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg-mini
  > button {
  color: rgba(15, 23, 42, 0.55);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg-mini
  > button.active {
  color: #fff;
}

/* Brief highlight when a supervisor click navigates the user to a turn */
.message-row.supervisor-target-flash {
  animation: supTargetFlash 1.6s ease-out;
  border-radius: 12px;
}
@keyframes supTargetFlash {
  0% {
    box-shadow:
      0 0 0 0 rgba(var(--accent-rgb), 0.55),
      0 0 0 0 rgba(var(--accent-rgb), 0) inset;
    background-color: rgba(var(--accent-rgb), 0.08);
  }
  60% {
    box-shadow:
      0 0 0 4px rgba(var(--accent-rgb), 0),
      0 0 18px 0 rgba(var(--accent-rgb), 0.35) inset;
    background-color: rgba(var(--accent-rgb), 0.04);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(var(--accent-rgb), 0),
      0 0 0 0 rgba(var(--accent-rgb), 0) inset;
    background-color: transparent;
  }
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-empty {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-empty.hidden {
  opacity: 0;
}

/* Metric chips */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 4px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip-label {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip-risk {
  background: rgba(255, 77, 103, 0.06);
  border-color: rgba(255, 77, 103, 0.18);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-chip-risk
  .sup2-chip-value.has-risk {
  color: #ff7a8c;
}

/* Threats feed */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threats {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threats-badge {
  font-size: 0.6rem;
}

/* Severity histogram inline next to the threat-feed header */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-sevbar {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-sevdot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-sevdot.sev-high {
  background: #ff5d73;
  box-shadow: 0 0 4px rgba(255, 93, 115, 0.55);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-sevdot.sev-medium {
  background: #fbbf24;
  box-shadow: 0 0 4px rgba(251, 191, 36, 0.55);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-sevdot.sev-low {
  background: #60a5fa;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.55);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-sevcount {
  margin-right: 4px;
  font-weight: 700;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-sevcount[data-zero="true"] {
  color: rgba(255, 255, 255, 0.28);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-sevbar {
  color: rgba(15, 23, 42, 0.55);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-sevcount[data-zero="true"] {
  color: rgba(15, 23, 42, 0.3);
}

/* 1d/1w range segmented toggle */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-range {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-left: auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-range-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-range-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-range-btn.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 0.32),
    rgba(var(--accent-deep-rgb), 0.28)
  );
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-range-btn {
  color: rgba(15, 23, 42, 0.55);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-range-btn.active {
  color: #fff;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threats-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-empty {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.38);
  text-align: center;
  padding: 8px 0 4px;
  line-height: 1.4;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threat-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.74rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.85);
  transition:
    background 0.12s ease,
    transform 0.12s ease,
    border-color 0.12s ease;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.is-clickable {
  cursor: pointer;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.is-clickable:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(1px);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threat-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.sev-high
  .sup2-threat-dot {
  background: #ff5d73;
  box-shadow: 0 0 6px rgba(255, 93, 115, 0.7);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.sev-medium
  .sup2-threat-dot {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row.sev-low
  .sup2-threat-dot {
  background: #60a5fa;
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.55);
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threat-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #fff;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-threat-time {
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

/* Footer: sensitivity */
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-footer-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  flex-shrink: 0;
}
:is(.input-area.auoura-composer, .composer-overlay-root) .sup2-seg {
  flex: 1;
  padding: 3px;
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-seg
  .sup-seg-btn {
  padding: 5px 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Disabled (OFF) state */
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off.sup2
  .sup2-graph-card,
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off.sup2
  .sup2-chips,
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off.sup2
  .sup2-threats {
  opacity: 0.4;
  filter: grayscale(0.6);
}
:is(.input-area.auoura-composer, .composer-overlay-root)
  #orb-panel-supervisor.sup-off.sup2
  .sup2-status-pill {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

/* Light theme */
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-chip-value,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-label {
  color: #121821;
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-canvas {
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.06),
    rgba(15, 23, 42, 0.02)
  );
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-chip,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-row,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threats,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-card {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-empty,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-chip-label,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-footer-label,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-empty,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-graph-legend,
html[data-theme="light"]
  :is(.input-area.auoura-composer, .composer-overlay-root)
  .sup2-threat-time {
  color: rgba(15, 23, 42, 0.55);
}

/* Mobile: tighten paddings so it still fits */
@media (max-width: 720px) {
  :is(.input-area.auoura-composer, .composer-overlay-root) .sup2-graph-canvas {
    height: 76px;
  }
  :is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip-value {
    font-size: 0.86rem;
  }
  :is(.input-area.auoura-composer, .composer-overlay-root) .sup2-chip-label {
    font-size: 0.54rem;
  }
}
