@import url("/tokens.css?v=3.2");

.rail-theme-toggle {
  margin-top: auto;
  margin-bottom: 8px;
}

.rail-lang-toggle {
  position: relative;
  margin-bottom: 8px;
}

.rail-lang-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 14px;
  height: 12px;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 3px;
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.05));
  pointer-events: none;
  transition: all 140ms ease;
}

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

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--theme-blue-border, rgba(99, 128, 255, 0.62));
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--foreground);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.navigation-rail {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--rail-width);
  padding: 14px 8px max(16px, env(safe-area-inset-bottom)) 8px;
  border-right: 1px solid var(--border-subtle);
  background: transparent;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms ease, visibility 0s linear 0s;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
}

.rail-profile-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  margin-top: 0;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.rail-profile-avatar {
  flex: 0 0 auto;
}

.rail-profile-button:hover {
  border-color: var(--border-subtle);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.rail-profile-button:focus-visible {
  outline: 3px solid var(--theme-blue-border, rgba(79, 110, 232, 0.28));
  outline-offset: 2px;
}

.rail-profile-button::after {
  position: absolute;
  z-index: 60;
  top: 50%;
  left: calc(100% + 10px);
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--theme-inverse-surface, #181f2e);
  box-shadow: 0 4px 14px var(--theme-shadow-strong, rgba(0, 0, 0, 0.16));
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.rail-profile-button:hover::after,
.rail-profile-button:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

body.sidebar-open .rail-profile-button {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.rail-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 140ms ease;
}

.rail-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.rail-button.is-active {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--theme-blue-ink, var(--accent));
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(16, 24, 40, 0.06));
}

.rail-button::after {
  position: absolute;
  z-index: 60;
  top: 50%;
  left: calc(100% + 10px);
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--theme-inverse-surface, #181f2e);
  box-shadow: 0 4px 14px var(--theme-shadow-strong, rgba(0, 0, 0, 0.16));
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.rail-button:hover::after,
.rail-button:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Rail Archive Hover Popover */
.rail-archive-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

@media (min-width: 768px) {
  #railStrategiesButton::after {
    display: none !important;
  }
}

.rail-archive-popover {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  z-index: 120;
  width: 260px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 12px 36px var(--theme-shadow-soft, rgba(16, 24, 40, 0.12)), 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: auto;
}

.rail-archive-popover[hidden] {
  display: none !important;
}

.rail-archive-popover.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Invisible hover bridge to eliminate gap flicker */
.rail-archive-popover::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -14px;
  width: 14px;
}

.rail-archive-popover-header {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.rail-archive-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-archive-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
  color: var(--text-primary);
}

.rail-archive-popover-item:hover,
.rail-archive-popover-item:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.rail-archive-popover-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.rail-archive-popover-item:hover .rail-archive-popover-item-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.rail-archive-popover-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.rail-archive-popover-item-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.rail-archive-popover-item-date {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.rail-archive-popover-empty {
  padding: 12px 10px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  text-align: center;
}

.rail-archive-popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.rail-archive-popover-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--accent);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.rail-archive-popover-all:hover,
.rail-archive-popover-all:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-hover);
  outline: none;
}

.rail-archive-popover-item > *,
.rail-archive-popover-all > * {
  pointer-events: none;
}

.rail-archive-popover-all-arrow {
  display: flex;
  align-items: center;
  transition: transform 140ms ease;
}

.rail-archive-popover-all:hover .rail-archive-popover-all-arrow {
  transform: translateX(2px);
}

:root[data-theme="dark"] .rail-archive-popover {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .rail-archive-popover-item-icon {
  background: #1e293b;
  color: #94a3b8;
}

.rail-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  margin-bottom: 4px;
  padding: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 140ms ease;
}

.rail-mode-toggle:hover {
  background: var(--bg-hover);
}

.rail-mode-toggle.is-default-saved {
  animation: railDefaultSavedPulse 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-mode-toggle.is-default-saved .rail-toggle-track {
  box-shadow: 0 0 0 3px var(--accent-light, rgba(37, 99, 235, 0.35));
  border-color: var(--accent, #2563eb);
}

@keyframes railDefaultSavedPulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.rail-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 16px;
  border-radius: 10px;
  background: var(--theme-surface-muted, #d5dae2);
  border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.08));
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 1px 3px var(--theme-shadow-strong, rgba(0, 0, 0, 0.22));
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease;
}

body[data-mode="ask"] .rail-toggle-track {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
}

body[data-mode="ask"] .rail-toggle-thumb {
  transform: translateX(12px);
}

.rail-new {
  margin-top: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.04));
}

.rail-new:hover {
  background: var(--theme-surface, #ffffff);
  border-color: var(--border-hover);
  color: var(--theme-blue-ink, var(--accent));
}

.sidebar {
  position: fixed;
  z-index: 45;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 14px;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  box-shadow: 8px 0 32px var(--theme-shadow-soft, rgba(16, 24, 40, 0.06));
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 200ms;
}

.sidebar.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-open .navigation-rail {
  transform: translateX(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 150ms ease, visibility 0s linear 200ms;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  text-decoration: none;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-wordmark {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 130ms ease;
}

.sidebar-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.sidebar-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.sidebar-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 36px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: 9999px;
  background: var(--theme-surface-soft, #f1f3f5);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.sidebar-mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
  user-select: none;
  gap: 6px;
  padding: 0 8px;
}

.sidebar-mode-option:hover {
  color: var(--text-primary);
}

.sidebar-mode-option.is-active {
  background: var(--theme-surface, #ffffff);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.06));
}

.sidebar-mode-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
  line-height: 1;
}

.sidebar-mode-option.is-active .sidebar-mode-badge {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
}

.new-strategy-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 130ms ease, color 130ms ease;
}

.new-strategy-button:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.new-strategy-button .nav-svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  color: var(--text-secondary);
  transition: color 130ms ease;
  flex-shrink: 0;
}

.new-strategy-button:hover .nav-svg {
  color: var(--text-primary);
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  height: 36px;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.nav-item.is-active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-blue-ink, var(--accent));
  font-weight: 600;
  box-shadow: none;
}

.nav-svg {
  width: 20px;
  height: 20px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item .nav-svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  color: var(--text-tertiary, #64748b);
  opacity: 0.85;
  transition: color 130ms ease, opacity 130ms ease;
}

.nav-item:hover .nav-svg {
  opacity: 1;
  color: var(--text-primary, #0f172a);
}

.nav-item.is-active .nav-svg {
  opacity: 1;
  color: var(--theme-blue-ink, var(--accent));
}

.nav-count {
  min-width: 17px;
  height: 16px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-item.is-active .nav-count {
  background: rgba(79, 110, 232, 0.14);
  color: var(--theme-blue-ink, var(--accent));
  border-color: transparent;
}

.recent-section {
  min-height: 0;
  margin-top: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-label {
  padding: 0 8px 6px;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recent-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.recent-collapse-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

[data-theme="dark"] .recent-collapse-toggle:hover,
html.dark .recent-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.recent-collapse-chevron {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.recent-section.is-collapsed .recent-collapse-chevron {
  transform: rotate(-90deg);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  transition: max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}

.recent-section.is-collapsed .recent-list {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.recent-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 4px;
  padding: 12px 10px;
  background: var(--theme-wash, rgba(16, 24, 40, 0.02));
  border-radius: 8px;
  border: 1px dashed var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 11.5px;
  line-height: 1.45;
}

.recent-empty strong {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 550;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 120ms ease;
  position: relative;
}

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

.recent-item.is-active {
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.04));
}

.recent-icon-wrap {
  display: none;
}

.recent-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.recent-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.recent-date {
  color: var(--text-tertiary);
  font-size: 10.5px;
  line-height: 1.25;
}

.recent-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: auto;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
  flex-shrink: 0;
}

.recent-item:hover .recent-delete-btn,
.recent-item:focus-within .recent-delete-btn {
  opacity: 1;
}

.recent-delete-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger, #dc2626);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.03));
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 140ms ease;
}

.sidebar-footer:hover {
  background: var(--theme-surface, #ffffff);
  border-color: var(--border-hover);
  box-shadow: 0 2px 5px var(--theme-shadow-soft, rgba(16, 24, 40, 0.06));
}

.workspace-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f6ee8 0%, #3b50b2 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(79, 110, 232, 0.25);
}

.sidebar-footer-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-footer strong {
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer span {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 140ms ease, color 140ms ease;
}

.sidebar-footer:hover .account-chevron {
  color: var(--text-secondary);
  transform: translateX(1px);
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--rail-width);
  transition: margin-left 190ms ease;
}

body.sidebar-open .app-main {
  margin-left: var(--sidebar-width);
}

.workspace {
  min-height: 100vh;
}

.mobile-overlay {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: none;
  background: var(--theme-overlay, rgba(0, 0, 0, 0.46));
  backdrop-filter: blur(3px);
}

.mobile-overlay[hidden] {
  display: none;
}

.mobile-header {
  display: none;
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: none;
  background: transparent;
  color: var(--theme-muted, #f4f4f5);
}

.workspace-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  background: var(--bg-canvas);
  box-sizing: border-box;
}

.workspace-intake,
.workspace-centered:has(.intake-view) {
  background:
    radial-gradient(ellipse 72% 56% at 50% 48%, rgba(var(--theme-blue-rgb, 186, 220, 255), 0.65) 0%, rgba(var(--theme-blue-rgb, 219, 234, 254), 0.42) 35%, rgba(var(--theme-blue-rgb, 239, 246, 255), 0.18) 58%, transparent 75%),
    radial-gradient(ellipse 46% 38% at 50% 45%, rgba(var(--theme-blue-rgb, 147, 197, 253), 0.4) 0%, transparent 60%),
    var(--bg-canvas);
}

.intake-view {
  width: min(100%, 760px);
  max-width: 760px;
  margin: 0 auto;
  transform: translateY(-44px);
  animation: rise-in 420ms ease both;
}

.product-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.eyebrow-mark {
  font-size: 14px;
}

.intake-title,
.clarification-title,
.loading-title,
.strategy-title,
.list-heading h1 {
  margin: 0;
  font-family: inherit;
  letter-spacing: -0.045em;
}

.intake-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto 32px;
  text-align: center;
}

.intake-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(30px, 3.4vw, 36px);
  font-weight: 450;
  letter-spacing: -0.035em;
  line-height: 1.18;
  text-align: center;
}

.intake-title.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}

.intake-description {
  display: none;
}

/* Compact Build input — Ask style */

.workspace-centered .composer-card {
  display: grid;
  width: min(100%, 760px);
  min-height: 58px;
  grid-template-columns: 40px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;

  margin-inline: auto;
  padding: 8px 10px;

  overflow: visible;

  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  background: var(--bg-elevated);

  box-shadow: 0 14px 38px var(--theme-shadow-soft, rgba(31, 41, 55, 0.11));
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.workspace-centered .composer-card:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
  box-shadow: 0 16px 42px var(--theme-shadow-soft, rgba(31, 41, 55, 0.12));
  outline: none;
}

.workspace-centered .composer-input {
  grid-column: 2;
  grid-row: 1;

  width: 100%;
  min-height: 24px;
  max-height: 160px;

  padding: 8px 0;

  overflow-y: auto;
  resize: none;

  border: 0;
  outline: 0;
  background: transparent;

  font-size: 15px;
  line-height: 1.5;
  align-self: center;
}

.workspace-centered .composer-footer {
  display: contents;
}

.workspace-centered .composer-tools {
  display: contents;
}

.workspace-centered .composer-tool {
  grid-column: 1;
  grid-row: 1;

  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  align-self: center;

  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.workspace-centered .composer-tool:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.workspace-centered .composer-hint {
  display: none;
}

.workspace-centered .composer-submit {
  grid-column: 3;
  grid-row: 1;

  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  align-self: center;

  padding: 0;
  border-radius: 50%;
  background: #0b1f3a;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  transition: background 150ms ease, transform 120ms ease, opacity 150ms ease;
  flex-shrink: 0;
}

.workspace-centered .composer-submit:hover:not(:disabled) {
  background: #132d52;
  transform: scale(1.02);
}

.workspace-centered .composer-submit:active:not(:disabled) {
  background: #08172c;
  transform: scale(0.95);
}

.workspace-centered .composer-submit:disabled {
  background: var(--bg-soft);
  color: var(--text-tertiary);
  opacity: 0.7;
}

.workspace-centered .composer-submit .button-arrow {
  font-size: 17px;
  line-height: 1;
}

.intake-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 0;
  text-align: center;
}

.intake-disclaimer {
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  user-select: none;
}

.composer-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.composer-tool {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  color: var(--text-tertiary);
}

.composer-tool:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.composer-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.composer-hint {
  color: var(--theme-muted, #717178);
  font-size: 11px;
}

.primary-button,
.secondary-button,
.text-button,
.quick-action,
.example-chip {
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 11px;
  font-weight: 600;
}

.primary-button {
  background: #0b1f3a;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(11, 31, 58, 0.22);
}

.primary-button:not(:disabled):hover {
  background: #132d52;
  box-shadow: 0 6px 18px rgba(11, 31, 58, 0.28);
  transform: translateY(-1px);
}

.primary-button:not(:disabled):active {
  background: #08172c;
  transform: translateY(0);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--foreground-soft);
}

.secondary-button:not(:disabled):hover {
  border-color: var(--theme-border-strong, #b9c1ce);
  background: var(--surface-soft);
}

.compact {
  min-height: 36px;
  padding-inline: 13px;
  border-radius: 9px;
  font-size: 12px;
}

.composer-submit {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.workspace-centered .composer-submit {
  min-height: 40px;
  border-radius: 50%;
  background: #0b1f3a;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.22);
}

.workspace-centered .composer-submit:not(:disabled):active {
  transform: scale(0.98);
}

.button-arrow {
  font-size: 17px;
  line-height: 1;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 17px;
}

.examples-label {
  margin-right: 3px;
  color: var(--theme-copy, #6f6f76);
  font-size: 11px;
}

.example-chip,
.quick-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.67);
  color: var(--muted);
  font-size: 13px;
}

.workspace-centered .example-chip {
  border-color: var(--border-subtle);
  background: transparent;
  color: var(--theme-muted, #8d8d94);
}

.workspace-centered .example-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.example-chip:hover,
.quick-action:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--theme-danger-border, rgba(227, 118, 118, 0.24));
  border-radius: 12px;
  background: rgba(227, 118, 118, 0.08);
  color: var(--theme-danger-ink, #f0a1a1);
}

.error-banner strong,
.error-banner p {
  margin: 0;
}

.error-banner p {
  margin-top: 2px;
  font-size: 12px;
}



.clarification-view {
  width: min(100%, 760px);
  padding-block: 20px;
  animation: rise-in 380ms ease both;
}

.clarification-heading {
  margin-bottom: 28px;
}

.step-label {
  margin-bottom: 12px;
  color: var(--theme-blue-ink, #7897ff);
}

.clarification-title {
  max-width: 670px;
  color: var(--theme-muted, #f4f4f5);
  font-size: clamp(29px, 4vw, 40px);
  line-height: 1.18;
}

.clarification-copy {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--theme-muted, #85858d);
}

.clarification-form {
  display: grid;
  gap: 13px;
}

.question-card {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--theme-border-strong, #2f2f34);
  border-radius: var(--radius-md);
  background: var(--theme-inverse-surface, #171719);
  box-shadow: 0 12px 36px var(--theme-shadow-strong, rgba(0, 0, 0, 0.2));
}

.question-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  color: var(--theme-muted, #e8e8ea);
  font-weight: 600;
}

.question-number {
  display: inline-grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: rgba(65, 101, 220, 0.18);
  color: var(--theme-blue-ink, #8ba5ff);
  font-size: 11px;
}

.question-reason {
  margin: 6px 0 13px 35px;
  color: var(--theme-muted, #7f7f87);
  font-size: 12px;
}

.question-input {
  width: 100%;
  min-height: 74px;
  margin-top: 13px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid var(--theme-border-strong, #37373d);
  border-radius: 10px;
  outline: 0;
  background: var(--theme-inverse-surface, #202023);
  color: var(--theme-muted, #f4f4f5);
}

.question-input:focus {
  border-color: var(--theme-blue-border, #5d7be5);
  background: var(--theme-inverse-surface, #222226);
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.choice-pill {
  position: relative;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--theme-border-strong, #37373d);
  border-radius: 10px;
  background: var(--theme-inverse-surface, #202023);
  color: var(--theme-muted, #b8b8be);
  font-size: 12px;
  transition: all 140ms ease;
}

.choice-pill input:checked + span {
  border-color: var(--theme-blue-border, #6481e8);
  background: rgba(65, 101, 220, 0.18);
  color: var(--theme-blue-ink, #aebdff);
  box-shadow: inset 0 0 0 1px #6481e8;
}

.choice-pill input:focus-visible + span {
  outline: 3px solid var(--theme-blue-border, rgba(49, 87, 213, 0.22));
  outline-offset: 2px;
}

.clarification-actions {
  justify-content: flex-end;
  gap: 14px;
  padding-top: 9px;
}

.text-button {
  padding: 6px 3px;
  background: transparent;
  color: var(--theme-muted, #8a8a91);
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover {
  color: var(--theme-blue-ink, var(--accent));
}

.workspace-document {
  padding: 20px 32px 72px;
  background: var(--bg-canvas);
}

.strategy-view {
  width: min(100%, var(--content));
  margin: 0 auto;
  animation: rise-in 400ms ease both;
}

.strategy-toolbar {
  position: sticky;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  top: 0;
  min-height: 56px;
  margin-bottom: 22px;
  background: var(--theme-overlay, rgba(9, 9, 10, 0.88));
  backdrop-filter: blur(14px);
}

.toolbar-actions {
  gap: 8px;
}

.export-wrap {
  position: relative;
}

.export-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 242px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.export-menu.is-open {
  display: grid;
  animation: menu-in 150ms ease both;
}

.export-label {
  padding: 7px 9px 6px;
}

.export-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 9px;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground-soft);
  font-size: 12px;
  text-align: left;
}

.export-option:hover {
  background: var(--surface-soft);
  color: var(--foreground);
}

.export-option.is-coming {
  color: var(--muted);
}

.export-separator {
  height: 1px;
  margin: 6px 3px;
  background: var(--border);
}

.coming-badge {
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--bg-hover);
  color: var(--muted-light);
  font-size: 9px;
}

.strategy-header,
.refinement-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.strategy-block {
  margin-top: 0;
  padding: clamp(32px, 5vw, 48px) clamp(12px, 3vw, 28px);
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.strategy-header {
  padding: clamp(30px, 6vw, 56px);
  border-radius: var(--radius-lg);
}

.strategy-meta {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-light);
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(85, 185, 150, 0.12);
  color: var(--success);
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-refining {
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
}

.meta-divider {
  color: var(--text-tertiary);
}

.strategy-title {
  max-width: 760px;
  margin-top: 20px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
}

.strategy-lede {
  max-width: 770px;
  margin: 20px 0 0;
  color: var(--foreground-soft);
  font-size: 17px;
  line-height: 1.72;
  white-space: pre-line;
}

.change-note {
  margin-top: 24px;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 5px 10px 10px 5px;
  background: var(--accent-soft);
  color: var(--theme-blue-ink, #aebcff);
  font-size: 12px;
}

.section-heading {
  margin-bottom: 25px;
}

.section-heading h2,
.closeout-card h2,
.refinement-panel h2 {
  margin: 6px 0 0;
  font-family: inherit;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.035em;
}

.section-heading p,
.refinement-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.context-item {
  min-width: 0;
  padding: 18px;
}

.context-item:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.context-item:nth-child(-n + 2) {
  border-bottom: 1px solid var(--border);
}

.context-item dt {
  margin-bottom: 5px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-item dd {
  margin: 0;
  color: var(--foreground-soft);
  line-height: 1.55;
}

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

.priority-card,
.kpi-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.priority-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.priority-number {
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.priority-level {
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(227, 118, 118, 0.12);
  color: var(--theme-danger-ink, #ee9999);
}

.priority-medium {
  background: rgba(214, 164, 95, 0.12);
  color: var(--warning);
}

.priority-low {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.priority-card h3,
.kpi-card h3,
.strategy-section h3,
.timeline-body h3 {
  margin: 15px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.priority-card p,
.kpi-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.strategy-sections {
  border-top: 1px solid var(--border);
}

.strategy-section {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 27px 0;
  border-bottom: 1px solid var(--border);
}

.strategy-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.section-index {
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.strategy-section h3 {
  margin-top: 0;
  font-size: 18px;
}

.section-summary {
  margin: 7px 0 0;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 12px;
  font-weight: 600;
}

.section-content {
  margin: 11px 0 0;
  color: var(--foreground-soft);
  line-height: 1.7;
  white-space: pre-line;
}

.decision-list {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.decision-list li {
  position: relative;
  padding-left: 18px;
  color: var(--foreground-soft);
}

.decision-list li::before {
  position: absolute;
  top: 0.62em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.timeline {
  display: grid;
}

.timeline-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
}

.timeline-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.timeline-dot {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--theme-blue-border, rgba(99, 128, 255, 0.3));
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 10px;
  font-weight: 700;
}

.timeline-line {
  width: 1px;
  min-height: 50px;
  flex: 1;
  background: var(--border);
}

.timeline-row:last-child .timeline-line {
  display: none;
}

.timeline-body {
  padding: 3px 0 30px;
}

.timeline-body h3 {
  margin: 0;
  font-size: 17px;
}

.compact-list {
  margin-top: 11px;
  gap: 7px;
}

.expected-outcome {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.expected-outcome strong {
  color: var(--foreground-soft);
}

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

.kpi-card h3 {
  margin-top: 0;
}

.kpi-target {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 10px;
  font-weight: 700;
}

.risk-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.risk-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.risk-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.risk-row p {
  margin: 5px 0 0;
  color: var(--foreground-soft);
}

.risk-label {
  font-size: 9px;
}

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

.closeout-card h2 {
  font-size: 20px;
}

.next-list {
  display: grid;
  gap: 13px;
  margin: 17px 0 0;
  padding: 0;
  counter-reset: next-step;
  list-style: none;
}

.next-list li {
  position: relative;
  padding-left: 34px;
  color: var(--foreground-soft);
  counter-increment: next-step;
}

.next-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: var(--foreground);
  color: var(--bg-canvas);
  content: counter(next-step);
  font-size: 10px;
  font-weight: 700;
}

.refinement-panel {
  position: relative;
  margin-top: 16px;
  padding: clamp(26px, 5vw, 44px);
  border-color: var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.refinement-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  margin-top: 22px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.refinement-form:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.16));
  box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(0, 0, 0, 0.05));
  outline: none;
}

.refinement-input {
  min-height: 55px;
  max-height: 160px;
  padding: 9px 10px;
  resize: vertical;
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  background: transparent;
}

.refinement-input:focus,
.refinement-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.refine-submit {
  align-self: end;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0b1f3a;
  color: #ffffff;
  font-size: 18px;
}

.refine-submit:not(:disabled):hover {
  background: #132d52;
}

.refine-submit:not(:disabled):active {
  background: #08172c;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.quick-action {
  min-height: 32px;
  background: transparent;
}

.refining-banner {
  position: sticky;
  z-index: 14;
  top: 14px;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 9px 13px;
  border: 1px solid var(--theme-blue-border, rgba(99, 128, 255, 0.25));
  border-radius: 99px;
  background: var(--theme-overlay, rgba(23, 23, 25, 0.95));
  box-shadow: var(--shadow-sm);
  color: var(--theme-blue-ink, #aebcff);
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.inline-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--theme-blue-border, rgba(99, 128, 255, 0.24));
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.is-refining .strategy-header,
.is-refining .strategy-block {
  pointer-events: none;
}

.workspace-list {
  padding: 0 !important;
}

.strategies-view {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 28px 108px;
  box-sizing: border-box;
}

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

.saved-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.saved-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 14px 35px var(--theme-shadow-strong, rgba(0, 0, 0, 0.18));
  transform: translateY(-2px);
}

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

.saved-status,
.saved-version {
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.saved-version {
  color: var(--muted-light);
}

.saved-card h2 {
  margin: 19px 0 0;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.saved-card > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.saved-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted-light);
  font-size: 10px;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  padding: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.015);
  text-align: center;
}

.empty-icon {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 18px;
}

.empty-state h2 {
  margin: 10px 0 0;
  font-family: inherit;
}

.empty-state p {
  margin: 6px 0 20px;
  color: var(--muted);
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--theme-overlay, rgba(23, 23, 25, 0.96));
  box-shadow: var(--shadow-lg);
  color: var(--foreground-soft);
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(10px);
}

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

.toast-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.toast-error .toast-dot {
  background: var(--danger);
}

.toast-info .toast-dot,
.toast-neutral .toast-dot {
  background: var(--accent);
}

.toast-default .toast-dot {
  background: var(--foreground-soft);
}

.entry-notice {
  position: fixed;
  z-index: 90;
  top: 20px;
  right: 20px;
  display: grid;
  width: min(520px, calc(100vw - 40px));
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.18));
  border-radius: 14px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.96);
  box-shadow: 0 16px 44px var(--theme-shadow-soft, rgba(31, 41, 55, 0.13));
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(14px);
}

.entry-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.entry-notice p {
  margin: 0;
}

.entry-notice-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 12px;
  font-weight: 700;
}

/* Strategy workflow — Minimalist Premium Brief Analysis */
.loading-view {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
  text-align: center;
  animation: loading-card-rise 280ms ease-out both;
}

.loading-top-actions {
  position: fixed !important;
  top: 14px !important;
  right: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

.loading-cancel-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 38px !important;
  padding: 0 13px !important;
  border-radius: 10px !important;
  border: 1px solid var(--theme-border, #e2e8f0) !important;
  background: var(--theme-surface, #ffffff) !important;
  color: var(--theme-muted, #64748b) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05)), 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02)) !important;
  transition: all 140ms ease !important;
}

.loading-cancel-button:hover {
  background: var(--theme-danger-surface, #fef2f2) !important;
  border-color: var(--theme-danger-border, #fecaca) !important;
  color: var(--theme-danger-ink, #dc2626) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08) !important;
}

.loading-cancel-button svg {
  color: inherit;
}

.loading-history-button {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--theme-border, #e2e8f0) !important;
  background: var(--theme-surface, #ffffff) !important;
  color: var(--theme-copy, #334155) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05)), 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02)) !important;
  transition: all 140ms ease !important;
}

.loading-history-button:hover {
  background: var(--theme-surface, #f8fafc) !important;
  border-color: var(--theme-border, #cbd5e1) !important;
  color: var(--theme-ink, #0f172a) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px var(--theme-shadow-soft, rgba(15, 23, 42, 0.09)) !important;
}

.loading-history-button svg {
  color: var(--theme-muted, #64748b);
  transition: color 140ms ease;
}

.loading-history-button:hover svg {
  color: var(--theme-blue-ink, #2563eb);
}

.loading-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--theme-blue-surface, #eff6ff);
  border: 1px solid var(--theme-blue-border, #dbeafe);
  color: var(--theme-blue-ink, #2563eb);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Card actions on Mobile (below brief analysis card) */
.loading-card-actions {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin: 20px auto 0;
  width: 100%;
  max-width: 480px;
}

.loading-card-actions .loading-back-btn-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #1e293b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05));
  transition: all 140ms ease;
}

.loading-card-actions .loading-back-btn-mobile svg {
  color: var(--theme-copy, #475569);
  flex-shrink: 0;
}

.loading-card-actions .loading-back-btn-mobile:hover,
.loading-card-actions .loading-back-btn-mobile:active {
  background: var(--theme-surface, #f8fafc);
  border-color: var(--theme-border, #cbd5e1);
  transform: translateY(-1px);
}

.loading-card-actions-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.loading-card-actions-secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  flex: 1;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  transition: all 140ms ease;
}

.loading-card-actions .loading-cancel-btn-mobile {
  border: 1px solid var(--theme-danger-border, #fee2e2);
  background: var(--theme-danger-surface, #fff5f5);
  color: var(--theme-danger-ink, #dc2626);
}

.loading-card-actions .loading-cancel-btn-mobile:hover,
.loading-card-actions .loading-cancel-btn-mobile:active {
  background: var(--theme-danger-surface, #fee2e2);
  border-color: var(--theme-danger-border, #fca5a5);
  transform: translateY(-1px);
}

.loading-card-actions .loading-history-btn-mobile {
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-copy, #334155);
}

.loading-card-actions .loading-history-btn-mobile:hover,
.loading-card-actions .loading-history-btn-mobile:active {
  background: var(--theme-surface, #f8fafc);
  border-color: var(--theme-border, #cbd5e1);
  color: var(--theme-ink, #0f172a);
  transform: translateY(-1px);
}

.loading-card-actions .loading-history-btn-mobile svg {
  color: var(--theme-muted, #64748b);
  flex-shrink: 0;
}

.loading-card-actions .loading-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--theme-blue-surface, #eff6ff);
  border: 1px solid var(--theme-blue-border, #dbeafe);
  color: var(--theme-blue-ink, #2563eb);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Background Analysis: Back Button */
.loading-back-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--theme-border, #e2e8f0) !important;
  background: var(--theme-surface, #ffffff) !important;
  color: var(--theme-copy, #334155) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05)), 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02)) !important;
  transition: all 140ms ease !important;
}

.loading-back-button:hover {
  background: var(--theme-surface, #f8fafc) !important;
  border-color: var(--theme-border, #cbd5e1) !important;
  color: var(--theme-ink, #0f172a) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08)) !important;
}

.loading-back-button:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Background Job Status in Archive */
.strategy-library-row.library-row-progress {
  background: rgba(34, 197, 94, 0.02);
  border-bottom: 1px solid var(--theme-success-border, rgba(34, 197, 94, 0.12));
  transition: background 160ms ease;
}

.strategy-library-row.library-row-progress:hover {
  background: rgba(34, 197, 94, 0.045);
}

.strategy-library-row.library-row-progress .library-row-main h2 {
  color: var(--text-primary);
  font-weight: 600;
}

.strategy-library-row.library-row-progress .library-row-main p {
  color: var(--theme-success-ink, #16a34a);
  opacity: 0.9;
}

.strategy-library-row.library-row-error {
  background: rgba(239, 68, 68, 0.02);
  border-bottom: 1px solid var(--theme-danger-border, rgba(239, 68, 68, 0.12));
}

.saved-status.is-generating {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--theme-success-ink, #16a34a);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.saved-status.is-error {
  color: var(--theme-danger-ink, #dc2626);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bg-job-pulse {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.bg-job-pulse::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.35);
  animation: bg-beacon-pulse 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes bg-beacon-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.85;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.bg-job-error-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bg-job-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--theme-danger-border, #fecaca);
  background: var(--theme-surface, #fff);
  color: var(--theme-danger-ink, #dc2626);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 130ms ease;
}

.bg-job-retry-btn:hover {
  background: var(--theme-danger-surface, #fef2f2);
  border-color: var(--theme-danger-border, #f87171);
}

.bg-job-delete-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #fff);
  color: var(--theme-muted, #64748b);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 130ms ease;
}

.bg-job-delete-btn:hover {
  background: var(--theme-surface, #f8fafc);
  color: var(--theme-ink, #1e293b);
  border-color: var(--theme-border, #cbd5e1);
}

.recent-item.is-bg-job .recent-title {
  color: var(--theme-success-ink, #16a34a);
}

.recent-item.is-bg-job .recent-icon-wrap {
  position: relative;
}

.recent-bg-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: bg-beacon-pulse 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

/* Floating Ask Helmer Chat Button (Bottom-Right, Brief Analysis Only) */
.loading-ask-floating-wrap {
  position: fixed !important;
  bottom: 24px !important;
  right: 28px !important;
  z-index: 9990 !important;
  pointer-events: auto !important;
  animation: floating-btn-fade 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes floating-btn-fade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.loading-ask-floating-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  height: 42px !important;
  padding: 0 16px 0 12px !important;
  border-radius: 99px !important;
  border: 1px solid var(--theme-border, #e2e8f0) !important;
  background: var(--theme-surface, #ffffff) !important;
  color: var(--theme-ink, #1e293b) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  cursor: pointer !important;
  box-shadow: 0 4px 18px -2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.1)), 0 1px 3px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04)) !important;
  transition: all 150ms ease !important;
}

.loading-ask-floating-btn:hover {
  border-color: var(--theme-border, #cbd5e1) !important;
  background: var(--theme-surface, #f8fafc) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.14)) !important;
}

.loading-ask-floating-btn:active {
  transform: scale(0.97) !important;
}

.loading-ask-floating-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
}

.loading-ask-floating-spark {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 10px;
  color: var(--theme-blue-ink, #2563eb);
  line-height: 1;
}

.loading-ask-floating-label {
  line-height: 1;
}

.loading-ask-welcome {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
}

.loading-ask-welcome-spark {
  font-size: 16px;
  color: var(--theme-blue-ink, #2563eb);
  line-height: 1;
  margin-top: 1px;
}

.loading-ask-welcome-text strong {
  display: block;
  font-size: 13.5px;
  color: var(--theme-ink, #0f172a);
  margin-bottom: 3px;
}

.loading-ask-welcome-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--theme-muted, #64748b);
  line-height: 1.45;
}

.loading-ask-suggestions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.loading-ask-suggestion-pill {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-copy, #334155);
  font-size: 13px;
  cursor: pointer;
  transition: all 130ms ease;
}

.loading-ask-suggestion-pill:hover {
  background: var(--theme-blue-surface, #eff6ff);
  border-color: var(--theme-blue-border, #bfdbfe);
  color: var(--theme-blue-ink, #2563eb);
  transform: translateX(2px);
}

/* Ask Side Drawer / Right Chat Panel Overlay */
.loading-ask-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-wash, rgba(15, 23, 42, 0.16));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  animation: history-overlay-fade 180ms ease both;
}

.loading-ask-modal {
  width: min(100vw, 440px);
  height: 100%;
  max-height: 100vh;
  background: var(--theme-surface, #ffffff);
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--theme-border, #e2e8f0);
  box-shadow: -8px 0 32px var(--theme-shadow-soft, rgba(15, 23, 42, 0.1));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: history-drawer-slide 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.loading-ask-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--theme-border, #f1f5f9);
  background: var(--theme-surface, #ffffff);
  flex-shrink: 0;
}

.loading-ask-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-ask-modal-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--theme-ink, #0f172a);
}

.loading-ask-modal-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--theme-muted, #64748b);
}

.loading-ask-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--theme-surface-soft, #fafaf9);
  -webkit-overflow-scrolling: touch;
}

.ask-thread-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
}

.ask-thread-msg.is-user {
  align-self: flex-end;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
  color: var(--theme-ink, #0f172a);
}

.ask-thread-msg.is-assistant {
  align-self: flex-start;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-blue-border, #dbeafe);
  color: var(--theme-ink, #1e293b);
}

.ask-thread-msg-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--theme-copy, #475569);
  margin-bottom: 2px;
}

.ask-thread-msg-content {
  color: var(--theme-copy, #334155);
}

.ask-thread-msg-content p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ask-thread-msg-content .ask-rich-text {
  font-size: 13.5px;
  line-height: 1.6;
}

.ask-thread-error {
  color: var(--theme-danger-ink, #dc2626);
  font-size: 12.5px;
}

.loading-ask-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--theme-border, #f1f5f9);
  background: var(--theme-surface, #ffffff);
  flex-shrink: 0;
}

.loading-ask-modal-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #f8fafc);
}

.loading-ask-modal-form:focus-within {
  background: var(--theme-surface, #ffffff);
  border-color: var(--border-hover, #cbd5e1);
  box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(0, 0, 0, 0.06));
  outline: none;
}

.loading-ask-modal-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--theme-ink, #0f172a);
  outline: none;
  font-family: inherit;
}

.loading-ask-modal-input::placeholder {
  color: var(--theme-muted, #94a3b8);
  font-size: 13px;
}

.loading-ask-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: #0b1f3a;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 130ms ease;
}

.loading-ask-send-btn:hover {
  background: #132d52;
}

.loading-ask-send-btn:active {
  background: #08172c;
  transform: scale(0.95);
}

.loading-ask-send-btn svg {
  display: block;
  stroke: #ffffff;
  color: #ffffff;
}

.analysis-history-drag-handle {
  display: none;
  width: 36px;
  height: 4.5px;
  border-radius: 99px;
  background: var(--theme-surface-muted, #cbd5e1);
  margin: 10px auto 2px;
}

/* History Flyout Drawer */
.analysis-history-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.35));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  animation: history-overlay-fade 180ms ease both;
}

@keyframes history-overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.analysis-history-drawer {
  width: min(100vw, 440px);
  height: 100%;
  background: var(--theme-surface, #ffffff);
  box-shadow: -6px 0 28px var(--theme-shadow-soft, rgba(15, 23, 42, 0.1));
  display: flex;
  flex-direction: column;
  animation: history-drawer-slide 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes history-drawer-slide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes history-sheet-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.analysis-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--theme-border, #f1f5f9);
}

.analysis-history-title-group h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--theme-ink, #0f172a);
}

.analysis-history-title-group p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
}

.analysis-history-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: transparent;
  color: var(--theme-muted, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 130ms ease;
}

.analysis-history-close:hover {
  background: var(--theme-surface, #f8fafc);
  border-color: var(--theme-border, #cbd5e1);
  color: var(--theme-ink, #0f172a);
}

.analysis-history-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
}

.history-qa-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--theme-border, #e2e8f0);
}

.history-item-brief {
  background: var(--theme-surface-soft, #fafaf9);
  border-color: var(--theme-border, #e2e8f0);
}

.history-item-model {
  background: var(--theme-surface, #f8fbff);
  border-color: var(--theme-blue-border, #dbeafe);
}

.history-item-user {
  background: var(--theme-surface, #ffffff);
  border-color: var(--theme-border, #e2e8f0);
}

.history-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-item-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-item-icon.user-icon {
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-copy, #475569);
}

.history-item-icon.ai-icon {
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
}

.history-item-sender {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--theme-ink, #0f172a);
  flex: 1;
}

.history-item-tag {
  font-size: 9.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-muted, #64748b);
}

.history-item-tag.ai-tag {
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-blue-ink, #2563eb);
}

.history-item-content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--theme-copy, #334155);
  white-space: pre-wrap;
  word-break: break-word;
}

.history-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--theme-muted, #94a3b8);
  font-size: 13px;
}

.analysis-history-footer {
  padding: 13px 22px;
  border-top: 1px solid var(--theme-border, #f1f5f9);
  background: var(--theme-surface-soft, #fafaf9);
}

.history-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
}

.history-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  animation: live-ring 2s ease-in-out infinite;
}

@media (max-width: 640px) {
  .loading-desktop-actions {
    display: none !important;
  }

  .loading-card-actions {
    display: flex;
  }

  /* History Bottom Sheet */
  .analysis-history-overlay {
    align-items: flex-end;
    justify-content: center;
  }

  .analysis-history-drawer {
    width: 100vw;
    height: auto;
    max-height: 86dvh;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 36px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16));
    animation: history-sheet-slide-up 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .analysis-history-drag-handle {
    display: block;
  }

  .analysis-history-header {
    padding: 12px 18px 10px;
  }

  .analysis-history-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .history-item {
    padding: 11px 13px;
    border-radius: 10px;
  }

  .history-item-content p {
    font-size: 12.5px;
  }

  .analysis-history-footer {
    padding: 10px 18px;
  }

  /* Loading View Layout on Mobile (Optically Centered) */
  .workspace-centered:has(.loading-view) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    padding: calc(56px + env(safe-area-inset-top)) 16px calc(50px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
  }

  .workspace-centered .loading-view {
    margin: auto 0 !important;
    transform: translateY(-24px);
    width: 100% !important;
    max-width: 520px !important;
  }

  .loading-title {
    font-size: clamp(22px, 6vw, 28px);
    margin-bottom: 6px;
  }

  .loading-intro {
    font-size: 13.5px;
    margin-bottom: 20px;
    padding: 0 4px;
    line-height: 1.45;
  }

  .loading-activity {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .loading-activity-top {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .loading-activity-body {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .loading-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .loading-activity-title {
    font-size: 14px;
  }

  .loading-copy {
    font-size: 12.5px;
    line-height: 1.45;
  }

  .loading-timeline-wrap {
    margin: 18px 0 0;
  }

  .generation-steps {
    gap: 6px;
  }

  .generation-step-meta {
    gap: 4px;
  }

  .generation-step-mark {
    width: 15px;
    height: 15px;
    font-size: 9px;
    border-radius: 3px;
  }

  .generation-step-label {
    font-size: 10.5px;
  }

  .loading-ask-floating-wrap {
    bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 14px)) !important;
    right: 16px !important;
  }

  .loading-ask-floating-btn {
    height: 40px !important;
    padding: 0 14px 0 11px !important;
    font-size: 12px !important;
  }

  .loading-ask-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .loading-ask-modal {
    width: 100vw;
    height: 86dvh;
    max-height: 86dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    animation: history-sheet-slide-up 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .loading-ask-modal-header {
    padding: 12px 16px 10px;
  }

  .loading-ask-modal-body {
    padding: 14px 16px;
  }

  .loading-ask-modal-footer {
    padding: 10px 14px;
  }
}

@media (max-width: 440px) {
  .generation-steps:not(.is-assessment) li:not(.is-current):not(.is-complete) .generation-step-label {
    display: none;
  }
}

.loading-status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 14px;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid var(--theme-blue-border, rgba(37, 99, 235, 0.12));
}

.loading-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  animation: live-ring 2s ease-in-out infinite;
}

@keyframes live-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

.loading-eyebrow {
  margin: 0;
  color: var(--theme-blue-ink, #2563eb);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.loading-title {
  min-height: 0;
  margin: 0 0 8px;
  color: var(--theme-ink, #0f172a);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-align: center;
}

.loading-intro {
  max-width: 540px;
  margin: 0 auto 28px;
  color: var(--theme-muted, #64748b);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

/* Active Analysis Status Card */
.loading-activity {
  position: relative;
  overflow: hidden;
  padding: 20px 24px;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 4px 20px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05)), 0 1px 3px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.loading-activity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--theme-border, #f1f5f9);
}

.loading-activity-label {
  color: var(--theme-muted, #64748b);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading-activity-count {
  color: var(--theme-muted, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.loading-activity-body {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.loading-activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--theme-blue-surface, #eff6ff);
  border: 1px solid var(--theme-blue-border, #dbeafe);
  color: var(--theme-blue-ink, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loading-activity-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.loading-activity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-activity-title {
  color: var(--theme-ink, #0f172a);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.loading-processing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding-left: 2px;
}

.loading-processing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2563eb;
  animation: processing-dot 1.2s ease-in-out infinite;
}

.loading-processing-dots span:nth-child(1) { animation-delay: 0s; }
.loading-processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-processing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes processing-dot {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.loading-copy {
  min-height: 0;
  margin: 0;
  color: var(--theme-muted, #64748b);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
}

/* Horizontal Reasoning Timeline */
.loading-timeline-wrap {
  margin: 22px 0 0;
  width: 100%;
}

.generation-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loading-view.is-assessment .generation-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.generation-steps li {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.generation-step-rail {
  height: 3px;
  border-radius: 99px;
  background: var(--theme-surface-muted, #e2e8f0);
  transition: background 250ms ease;
}

.generation-steps li.is-complete .generation-step-rail {
  background: #16a34a;
}

.generation-steps li.is-current .generation-step-rail {
  background: #2563eb;
}

.generation-step-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.generation-step-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-muted, #94a3b8);
  flex-shrink: 0;
  transition: all 200ms ease;
}

.generation-steps li.is-complete .generation-step-mark {
  background: var(--theme-success-surface, #dcfce7);
  color: var(--theme-success-ink, #16a34a);
}

.generation-steps li.is-current .generation-step-mark {
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
}

.generation-step-label {
  overflow: hidden;
  color: var(--theme-muted, #64748b);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 200ms ease;
}

.generation-steps li.is-complete .generation-step-label {
  color: var(--theme-copy, #334155);
}

.generation-steps li.is-current .generation-step-label {
  color: var(--theme-ink, #0f172a);
  font-weight: 600;
}

.loading-reassurance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 0;
  color: var(--theme-muted, #94a3b8);
  font-size: 12.5px;
  text-align: center;
}

.loading-reassurance-icon {
  font-size: 11px;
  color: var(--theme-blue-ink, #60a5fa);
  flex-shrink: 0;
}

.clarification-view {
  width: min(100%, 800px);
  padding: 0;
}

.clarification-heading {
  margin-bottom: 22px;
}

.clarification-title {
  font-size: clamp(32px, 4vw, 42px);
}

.clarification-copy {
  margin-top: 10px;
  font-size: 14px;
}

.clarification-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.clarification-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--bg-soft);
}

.clarification-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.clarification-form {
  gap: 20px;
  margin-top: 34px;
}

.clarification-stage {
  min-height: 250px;
  animation: question-in 180ms ease-out both;
}

.clarification-stage .question-title {
  display: block;
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
}

.clarification-stage .question-reason {
  max-width: 660px;
  margin: 10px 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.clarification-stage .question-input {
  min-height: 120px;
  margin: 0;
  padding: 16px;
  resize: none;
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 15px;
  line-height: 1.6;
}

.question-example {
  margin: 9px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.clarification-stage .choice-grid {
  gap: 10px;
  margin: 0;
}

.clarification-stage .choice-pill span {
  min-height: 40px;
  padding: 10px 14px;
  border-color: var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
}

.clarification-stage .choice-pill span:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.clarification-stage .choice-pill input:checked + span {
  border-color: var(--theme-blue-border, rgba(99, 128, 255, 0.55));
  background: rgba(99, 128, 255, 0.13);
  color: var(--text-primary);
  box-shadow: none;
}

.clarification-context {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.clarification-context summary,
.timeline-details summary,
.assumptions-panel summary {
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.clarification-context-body {
  display: grid;
  gap: 10px;
  padding: 2px 0 14px;
}

.context-summary-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  font-size: 12px;
}

.context-summary-row strong {
  color: var(--text-tertiary);
  font-weight: 500;
}

.context-summary-row span {
  color: var(--text-secondary);
}

.clarification-actions {
  justify-content: space-between;
  padding-top: 0;
}

.clarification-action-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.clarification-skip {
  font-weight: 500;
}

.workspace-document {
  padding: 0 32px 190px;
}

/* ==========================================================================
   STRATEGY WORKSPACE & EDITORIAL / FAQ / ROADMAP DESIGN SYSTEM
   ========================================================================== */

.strategy-view {
  width: min(100%, 1160px);
  margin: 0 auto;
  animation: strategy-fade 280ms ease both;
}

.strategy-toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(var(--theme-surface-rgb, 248, 249, 251), 0.92);
  backdrop-filter: blur(16px);
}

.strategy-breadcrumb {
  max-width: 32%;
  overflow: hidden;
  padding: 6px 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 150ms ease;
}

.strategy-breadcrumb:hover {
  color: var(--text-primary);
}

/* Format Switcher Tabs */
.strategy-format-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-soft);
}

.format-tab {
  padding: 6px 14px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.format-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.format-tab.is-active {
  background: var(--bg-elevated);
  color: var(--theme-blue-ink, var(--accent));
  box-shadow: 0 1px 4px var(--theme-shadow-soft, rgba(0, 0, 0, 0.08));
}

.strategy-local-shell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.strategy-toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: none;
}

.strategy-toc a {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  transition: all 140ms ease;
}

.strategy-toc a:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.strategy-toc a.is-active {
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-weight: 600;
}

.strategy-document-canvas {
  min-width: 0;
  max-width: 860px;
}

/* Header & Executive Summary */
.strategy-overview {
  scroll-margin-top: 92px;
  padding: 4px 0 44px;
}

.strategy-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
}

.strategy-title {
  max-width: 840px;
  margin: 12px 0 20px;
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.14;
  color: var(--text-primary);
}

/* Context Chips */
.context-chips-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.03));
}

.context-chip strong {
  color: var(--text-primary);
  font-weight: 600;
}

.chip-icon {
  font-size: 13px;
}

/* Executive Summary Card */
.strategy-executive-card {
  position: relative;
  margin: 24px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.2));
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 110, 232, 0.05) 0%, rgba(var(--theme-surface-rgb, 255, 255, 255), 0.8) 100%);
  box-shadow: 0 4px 20px rgba(79, 110, 232, 0.06);
}

.exec-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.exec-badge {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exec-summary-text {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.68;
  font-weight: 450;
}

/* Work Section */
.strategy-work-section {
  scroll-margin-top: 92px;
  padding: 48px 0;
  border-top: 1px solid var(--border-subtle);
}

.strategy-work-section .section-heading {
  margin-bottom: 24px;
}

.section-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.strategy-work-section .section-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 26px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-primary);
}

.section-description {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* 01. Strategic Pillars */
.strategy-pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.strategy-pillar-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.03));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.strategy-pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--theme-shadow-soft, rgba(0, 0, 0, 0.06));
}

.pillar-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pillar-num {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pillar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.pillar-badge.priority-high {
  background: rgba(198, 79, 79, 0.12);
  color: var(--theme-danger-ink, #b83232);
}

.pillar-badge.priority-medium {
  background: rgba(168, 108, 24, 0.12);
  color: var(--theme-warning-ink, #945d0f);
}

.pillar-badge.priority-low {
  background: rgba(35, 133, 103, 0.12);
  color: var(--success);
}

.pillar-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text-primary);
}

.pillar-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

/* 02. Editorial Decision Sections */
.editorial-sections-list {
  display: grid;
  gap: 24px;
}

.editorial-section-card {
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 10px var(--theme-shadow-soft, rgba(0, 0, 0, 0.03));
}

.editorial-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.editorial-idx {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.editorial-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.editorial-card-body {
  display: grid;
  gap: 16px;
}

.editorial-decision-box {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
}

.decision-label {
  display: block;
  margin-bottom: 4px;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.decision-text {
  margin: 0;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.55;
}

.editorial-rationale-box {
  color: var(--text-secondary);
}

.rationale-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rationale-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-secondary);
}

.editorial-actions-box {
  margin-top: 4px;
}

.actions-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
}

.editorial-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.editorial-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.bullet-check {
  color: var(--success);
  font-weight: bold;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 03. Roadmap & Timeline */
.roadmap-timeline {
  display: grid;
  gap: 16px;
}

.roadmap-phase-card {
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.03));
}

.phase-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.phase-badge {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phase-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
}

.phase-action-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.phase-action-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.action-dot {
  color: var(--theme-blue-ink, var(--accent));
  font-weight: bold;
  flex-shrink: 0;
}

.phase-outcome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.phase-outcome strong {
  font-weight: 600;
}

/* 04. KPI Cards */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
}

.kpi-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.kpi-card-kicker {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.kpi-target-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  margin-bottom: 12px;
}

.kpi-target-label {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-target-value {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

.kpi-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

/* 05. Risk Cards */
.risk-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.risk-card {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
}

.risk-card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.risk-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.risk-badge.risk-high {
  background: rgba(198, 79, 79, 0.12);
  color: var(--theme-danger-ink, #b83232);
}

.risk-badge.risk-medium {
  background: rgba(168, 108, 24, 0.12);
  color: var(--theme-warning-ink, #945d0f);
}

.risk-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.35;
}

.risk-mitigation {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.risk-mitigation strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 06. Action Checklist */
.action-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.checklist-group-card {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
}

.checklist-group-title {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.checklist-items-list {
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.checklist-item input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.checklist-item:has(input:checked) .checklist-item-text {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.assumptions-panel {
  margin-top: 32px;
  margin-bottom: 48px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
}

.assumptions-panel summary {
  cursor: pointer;
  color: var(--theme-blue-ink, var(--accent));
  font-weight: 600;
  font-size: 13.5px;
  padding: 6px 0;
}

.assumptions-panel .decision-list {
  max-width: 760px;
  padding: 12px 0;
  margin: 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   FAQ VIEW STYLES
   ========================================================================== */
.strategy-faq-container {
  padding: 8px 0 48px;
}

.faq-intro-header {
  margin-bottom: 24px;
}

.faq-main-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.faq-main-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.faq-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.faq-search-input {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  outline: 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  width: min(320px, 100%);
  transition: border-color 150ms ease;
}

.faq-search-input:focus {
  border-color: var(--accent);
}

.faq-accordion {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.02));
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.faq-item[open] {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.25));
  box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-category-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.faq-question-text {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.35;
}

.faq-chevron {
  font-size: 20px;
  color: var(--text-tertiary);
  font-weight: 400;
  transform: rotate(90deg);
  transition: transform 180ms ease, color 150ms ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(-90deg);
  color: var(--theme-blue-ink, var(--accent));
}

.faq-body-wrap {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(var(--theme-surface-rgb, 248, 249, 251), 0.4);
}

.faq-body-content {
  padding-top: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.faq-lead-text {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 450;
}

.faq-info-callout {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  font-size: 13.5px;
  color: var(--text-primary);
}

.faq-priorities-list {
  display: grid;
  gap: 10px;
}

.faq-priority-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.faq-decision-entry {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.faq-entry-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.faq-entry-decision {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.faq-no-results {
  padding: 36px 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ==========================================================================
   Modern Refinement Command Bar (Floating Dock)
   ========================================================================== */

.refinement-dock {
  position: fixed;
  z-index: 40;
  bottom: 24px;
  left: calc(var(--rail-width) + (100vw - var(--rail-width)) / 2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 0;
  width: min(700px, calc(100vw - var(--rail-width) - 40px));
  padding: 6px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.08));
  border-radius: 16px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.94);
  box-shadow: 0 14px 34px -10px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16)), 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.035)), inset 0 1px 0 var(--theme-shadow-strong, rgba(255, 255, 255, 0.96));
  transform: translateX(-50%);
  transition: left 190ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

body.sidebar-open .refinement-dock {
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
}

.refinement-dock:focus-within {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.35));
  box-shadow: 0 24px 60px -10px rgba(79, 110, 232, 0.2), 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04)), inset 0 1px 0 var(--theme-shadow-strong, rgba(255, 255, 255, 1));
}

/* 1. Top Action Strip: Sleek Floating Pill Buttons */
.dock-actions-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dock-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 550;
  transition: all 140ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.dock-action-btn:hover:not(:disabled) {
  background: var(--theme-surface-soft, #f5f7fa);
  border-color: var(--theme-border, rgba(0, 0, 0, 0.06));
  color: var(--text-primary);
  box-shadow: 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  transform: translateY(-1px);
}

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

.dock-action-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.dock-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.dock-chevron-icon {
  width: 11px;
  height: 11px;
  margin-left: 1px;
  opacity: 0.6;
}

.dock-save-btn.is-saved {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--theme-success-border, rgba(34, 197, 94, 0.25));
  color: var(--theme-success-ink, #15803d);
  font-weight: 600;
}

.dock-save-btn.is-saved .dock-btn-icon {
  color: var(--theme-success-ink, #16a34a);
}

.dock-export-wrap {
  position: relative;
}

.dock-export-wrap .export-menu {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.08));
  border-radius: 14px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.96);
  box-shadow: 0 16px 40px var(--theme-shadow-soft, rgba(0, 0, 0, 0.12)), 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}

/* 2. Quick Suggestions (Chips with subtle glow - hidden by default, expands on click/focus) */
.refinement-dock .quick-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  overflow-x: auto;
  overflow-y: hidden;
  pointer-events: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  transition: max-height 220ms cubic-bezier(0.16, 1, 0.3, 1),
              margin-bottom 220ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 180ms ease,
              padding 180ms ease;
}

.refinement-dock:focus-within .quick-actions,
.refinement-dock.is-expanded .quick-actions {
  max-height: 48px;
  margin-bottom: 6px;
  padding: 2px 0;
  opacity: 1;
  pointer-events: auto;
}

.refinement-dock .quick-actions::-webkit-scrollbar {
  display: none;
}

.refinement-dock .quick-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 11px;
  flex: 0 0 auto;
  border-radius: 9999px;
  background: var(--theme-wash, rgba(0, 0, 0, 0.035));
  border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.05));
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 130ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.quick-action-icon {
  font-size: 11.5px;
  line-height: 1;
}

.refinement-dock .quick-action:hover:not(:disabled) {
  background: rgba(79, 110, 232, 0.08);
  color: var(--theme-blue-ink, var(--accent));
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.22));
  transform: translateY(-1px);
}

.refinement-dock .quick-action:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

/* 3. Refinement Input Form: Minimalist Glass Bar */
.refinement-dock .refinement-form {
  position: relative;
  margin: 0;
  min-width: 0;
  padding: 4px 5px 4px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--theme-surface-soft, #f6f7f9);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.refinement-dock .refinement-form:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.16));
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 2px 10px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  outline: none;
}

.refine-input-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
  opacity: 0.7;
}

.refinement-dock .refinement-input {
  min-height: 28px;
  max-height: 120px;
  padding: 4px 0;
  resize: none;
  background: transparent;
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.45;
  font-family: inherit;
  flex: 1;
}

.refinement-dock .refinement-input:focus,
.refinement-dock .refinement-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.refinement-dock .refinement-input::placeholder {
  color: var(--text-tertiary);
  opacity: 0.75;
}

.refinement-dock .refine-submit {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--theme-inverse-surface, #18181b);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: all 140ms ease;
}

.refinement-dock .refine-submit:disabled {
  background: var(--theme-wash, rgba(0, 0, 0, 0.06));
  color: var(--text-tertiary);
  opacity: 0.6;
  cursor: not-allowed;
}

.refinement-dock .refine-submit:hover:not(:disabled) {
  background: #132d52;
  box-shadow: 0 4px 12px rgba(11, 31, 58, 0.3);
  transform: scale(1.05);
}

.refinement-dock .refine-submit:active:not(:disabled) {
  background: #08172c;
  transform: scale(0.96);
}

.export-integration {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.export-integration small {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* Archive / Workspace Archive Redesign */
.archive-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.archive-header-copy {
  min-width: 0;
}

.archive-title {
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-primary);
  margin: 0;
}

.archive-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 8px 0 0;
  line-height: 1.5;
}

.archive-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px 0 13px;
  border-radius: 9px;
  font-weight: 580;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  background: #0b1f3a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 5px rgba(11, 31, 58, 0.3), 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.05));
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.archive-new-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.archive-new-btn:hover {
  background: #132d52;
  box-shadow: 0 4px 10px rgba(11, 31, 58, 0.4), 0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.06));
  transform: translateY(-0.5px);
}

.archive-new-btn:active {
  background: #08172c;
  transform: translateY(0) scale(0.985);
}

/* Archive Entrance Calm CTA Banner */
/* Archive Entrance Calm CTA Banner */
.archive-bg-cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 255, 0.94) 50%, rgba(240, 244, 255, 0.9) 100%);
  border: 1px solid rgba(79, 110, 232, 0.2);
  box-shadow: 
    0 10px 28px -6px rgba(79, 110, 232, 0.09),
    0 2px 8px -1px rgba(15, 23, 42, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease, box-shadow 180ms ease;
}

.archive-bg-cta::before {
  content: "";
  position: absolute;
  top: -36px;
  left: -24px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.archive-bg-cta::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 160px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 110, 232, 0.12) 0%, rgba(79, 110, 232, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.archive-bg-cta.is-dismissed {
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  pointer-events: none;
}

.archive-bg-cta-left {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.archive-bg-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f6ee8 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px -2px rgba(79, 110, 232, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.archive-bg-cta:hover .archive-bg-cta-icon {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: 0 8px 20px -2px rgba(79, 110, 232, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.archive-bg-cta-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.archive-bg-cta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2.5px 8.5px 2.5px 7px;
  border-radius: 999px;
  background: rgba(79, 110, 232, 0.1);
  color: #3b5bdb;
  border: 1px solid rgba(79, 110, 232, 0.22);
  margin-bottom: 5px;
  line-height: 1.35;
  width: fit-content;
}

.archive-bg-cta-tag-sparkle {
  display: inline-flex;
  align-items: center;
  color: #4f6ee8;
}

.archive-bg-cta-title {
  display: block;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 3px;
  letter-spacing: -0.015em;
}

.archive-bg-cta-desc {
  font-size: 12.8px;
  color: var(--text-secondary);
  line-height: 1.48;
  margin: 0;
  max-width: 680px;
}

.archive-bg-cta-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.archive-bg-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 12.8px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: #0b1f3a;
  color: #ffffff;
  border: 1px solid rgba(11, 31, 58, 0.15);
  box-shadow: 0 3px 10px -1px rgba(11, 31, 58, 0.22), 0 1px 2px rgba(11, 31, 58, 0.1);
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-bg-cta-btn:hover {
  background: #17325b;
  border-color: rgba(11, 31, 58, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px rgba(11, 31, 58, 0.32);
}

.archive-bg-cta-btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.18);
}

.archive-bg-cta-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform 160ms ease;
}

.archive-bg-cta-btn:hover .archive-bg-cta-arrow {
  transform: translateX(3px);
}

.archive-bg-cta-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.archive-bg-cta-dismiss:hover {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.06);
  transform: scale(1.05);
}

/* Dark mode theme support for archive cta */
:root[data-theme="dark"] .archive-bg-cta,
[data-theme="dark"] .archive-bg-cta {
  background: linear-gradient(135deg, rgba(22, 30, 46, 0.88) 0%, rgba(16, 24, 39, 0.92) 55%, rgba(28, 38, 64, 0.65) 100%);
  border: 1px solid rgba(99, 132, 255, 0.24);
  box-shadow: 
    0 12px 32px -6px rgba(0, 0, 0, 0.52),
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

:root[data-theme="dark"] .archive-bg-cta::before,
[data-theme="dark"] .archive-bg-cta::before {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.24) 0%, rgba(99, 102, 241, 0) 70%);
}

:root[data-theme="dark"] .archive-bg-cta::after,
[data-theme="dark"] .archive-bg-cta::after {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0) 70%);
}

:root[data-theme="dark"] .archive-bg-cta-icon,
[data-theme="dark"] .archive-bg-cta-icon {
  background: linear-gradient(135deg, #4361ee 0%, #4f46e5 100%);
  box-shadow: 0 6px 18px -2px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

:root[data-theme="dark"] .archive-bg-cta-tag,
[data-theme="dark"] .archive-bg-cta-tag {
  background: rgba(99, 132, 255, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.28);
}

:root[data-theme="dark"] .archive-bg-cta-btn,
[data-theme="dark"] .archive-bg-cta-btn {
  background: #172e54;
  color: #f8fafc;
  border: 1px solid rgba(147, 197, 253, 0.26);
  box-shadow: 0 3px 12px -1px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .archive-bg-cta-btn:hover,
[data-theme="dark"] .archive-bg-cta-btn:hover {
  background: #1f3d6e;
  border-color: rgba(147, 197, 253, 0.45);
  box-shadow: 0 6px 20px -2px rgba(23, 46, 84, 0.6);
}

:root[data-theme="dark"] .archive-bg-cta-dismiss:hover,
[data-theme="dark"] .archive-bg-cta-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 680px) {
  .archive-bg-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 16px;
    border-radius: 14px;
  }
  .archive-bg-cta-left {
    gap: 12px;
    align-items: flex-start;
  }
  .archive-bg-cta-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    margin-top: 2px;
  }
  .archive-bg-cta-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.06));
  }
  :root[data-theme="dark"] .archive-bg-cta-actions,
  [data-theme="dark"] .archive-bg-cta-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
  }
}

.archive-controls-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

.archive-search-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
}

.archive-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.archive-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.archive-search-input:focus {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.45));
  background: var(--bg-elevated);
  box-shadow: 0 0 0 2px rgba(79, 110, 232, 0.08);
}

.archive-search-input::placeholder {
  color: var(--text-tertiary);
}

/* Pinned Floating Archive Action Dock (Compact Search + New Button) */
.archive-bottom-dock {
  position: fixed;
  z-index: 35;
  bottom: 24px;
  left: calc(var(--rail-width) + (100vw - var(--rail-width)) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100vw - var(--rail-width) - 32px));
  height: 44px;
  padding: 5px 6px 5px 14px;
  border-radius: 999px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.92);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 32px -8px var(--theme-shadow-strong, rgba(15, 23, 42, 0.14)), 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: left 190ms ease, border-color 160ms ease, box-shadow 160ms ease;
  box-sizing: border-box;
}

body.sidebar-open .archive-bottom-dock {
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
}

.archive-bottom-dock:focus-within {
  border-color: var(--accent);
  box-shadow: 0 14px 36px -8px rgba(79, 110, 232, 0.22), 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.05));
}

.archive-dock-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 8px;
  height: 100%;
}

.archive-dock-search-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
  pointer-events: none;
}

.archive-dock-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

.archive-dock-search-input:focus {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.archive-dock-search-input::placeholder {
  color: var(--text-tertiary);
  font-size: 13px;
}

.archive-dock-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  flex-shrink: 0;
  margin: 0 2px;
}

.archive-dock-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 580;
  letter-spacing: -0.01em;
  background: #0b1f3a; /* Deep Navy Blue */
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 5px rgba(11, 31, 58, 0.3), 0 1px 2px rgba(11, 31, 58, 0.18);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.archive-dock-new-btn svg {
  flex-shrink: 0;
  stroke: #ffffff;
}

.archive-dock-new-btn:hover {
  background: #132d52; /* Lighter Navy Blue on hover */
  box-shadow: 0 4px 10px rgba(11, 31, 58, 0.4);
  transform: translateY(-0.5px);
}

.archive-dock-new-btn:active {
  background: #08172c;
  transform: scale(0.97);
}

@media (max-width: 800px) {
  .archive-bottom-dock,
  body.sidebar-open .archive-bottom-dock {
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    width: calc(100vw - 20px);
    max-width: 440px;
    height: 48px;
    padding: 4px 6px 4px 12px;
    gap: 6px;
    box-shadow: 0 10px 28px -6px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(0, 0, 0, 0.05);
  }

  .archive-dock-search-wrap {
    gap: 6px;
  }

  .archive-dock-search-icon {
    width: 13px;
    height: 13px;
  }

  .archive-dock-search-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  .archive-dock-search-input::placeholder {
    font-size: 13px;
    text-overflow: ellipsis;
  }

  .archive-dock-divider {
    height: 18px;
    margin: 0 1px;
  }

  .archive-dock-new-btn {
    height: 36px;
    padding: 0 12px 0 9px;
    font-size: 12px;
    font-weight: 590;
    gap: 5px;
  }

  .archive-dock-new-btn svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 390px) {
  .archive-bottom-dock,
  body.sidebar-open .archive-bottom-dock {
    width: calc(100vw - 12px);
    padding: 4px 5px 4px 10px;
    gap: 4px;
  }

  .archive-dock-new-btn {
    padding: 0 9px 0 7px;
    font-size: 11px;
    gap: 4px;
  }
}

/* Dark mode dock overrides */
:root[data-theme="dark"] .archive-bottom-dock,
html.dark .archive-bottom-dock {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .archive-dock-divider,
html.dark .archive-dock-divider {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .archive-dock-new-btn,
html.dark .archive-dock-new-btn {
  background: #172e54 !important; /* Elevated Navy Blue in Dark Mode */
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(23, 46, 84, 0.3);
}

:root[data-theme="dark"] .archive-dock-new-btn svg,
html.dark .archive-dock-new-btn svg {
  stroke: #ffffff !important;
}

:root[data-theme="dark"] .archive-dock-new-btn:hover,
html.dark .archive-dock-new-btn:hover {
  background: #1e3a6a !important;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
  margin-bottom: 6px;
}

.archive-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
}

.archive-tab {
  position: relative;
  padding: 8px 0 12px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: color 140ms ease;
}

.archive-tab:hover:not(.is-active) {
  color: var(--text-primary);
}

.archive-tab.is-active {
  color: var(--text-primary);
  font-weight: 600;
}

.archive-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
}

.archive-sort-wrap {
  position: relative;
  flex-shrink: 0;
}

.archive-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 450;
  cursor: pointer;
  transition: color 140ms ease;
}

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

.archive-sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 150px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--theme-shadow-soft, rgba(16, 24, 40, 0.08));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-sort-option {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.archive-sort-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.archive-sort-option.is-selected {
  background: var(--bg-soft);
  color: var(--text-primary);
  font-weight: 550;
}

.strategy-library {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strategy-library-row {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  border-bottom: 1px solid var(--theme-border, rgba(20, 27, 42, 0.05));
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background-color 140ms ease;
}

.strategy-library-row:hover,
.strategy-library-row:focus-visible {
  background: var(--theme-wash, rgba(20, 27, 42, 0.018));
}

.strategy-library-row:focus-visible {
  outline: 2px solid var(--theme-blue-border, rgba(79, 110, 232, 0.4));
  outline-offset: -2px;
}

.archive-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.archive-row-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.archive-chevron-icon {
  color: var(--text-tertiary);
  transition: transform 140ms ease, color 140ms ease;
  display: flex;
  align-items: center;
  margin-top: 2px;
  flex-shrink: 0;
}

.strategy-library-row:hover .archive-chevron-icon {
  transform: translateX(1.5px);
  color: var(--text-secondary);
}

.archive-row-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 4px 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.archive-row-meta-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.archive-row-date-ver {
  font-size: 12px;
  font-weight: 450;
  color: var(--text-tertiary);
}

.archive-row-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  white-space: nowrap;
}

.archive-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.archive-row-status.is-generating {
  color: var(--theme-blue-ink, var(--accent));
}

.archive-row-status.is-generating .archive-status-dot {
  animation: status-pulse 1.4s ease-in-out infinite;
}

.archive-row-status.is-error {
  color: var(--danger);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.archive-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  opacity: 0;
  transition: opacity 140ms ease;
}

.strategy-library-row:hover .archive-row-actions,
.archive-more-btn:focus-visible,
.archive-more-btn.is-active {
  opacity: 1;
}

.archive-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.archive-more-btn:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.archive-context-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  min-width: 170px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  box-shadow: 0 10px 30px var(--theme-shadow-soft, rgba(16, 24, 40, 0.1));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.archive-menu-item:hover {
  background: var(--bg-hover);
}

.archive-menu-item.is-destructive {
  color: var(--danger);
}

.archive-menu-item.is-destructive:hover {
  background: rgba(198, 79, 79, 0.08);
}

.archive-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 3px 0;
}

.archive-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
  border-top: 1px solid var(--border-subtle);
}

.archive-empty-title {
  font-size: 18px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.archive-empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.archive-no-results {
  padding: 48px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.archive-no-results h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.archive-no-results p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.archive-clear-filters-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--theme-blue-ink, var(--accent));
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.archive-clear-filters-btn:hover {
  background: var(--accent-soft);
}

/* Archive Modals */
.archive-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--theme-overlay, rgba(0, 0, 0, 0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: archive-fade-in 140ms ease;
}

@keyframes archive-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.archive-modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 48px var(--theme-shadow-soft, rgba(0, 0, 0, 0.14));
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: archive-modal-pop 140ms ease;
}

@keyframes archive-modal-pop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.archive-modal-title {
  font-size: 17px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0;
}

.archive-modal-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.archive-modal-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 140ms ease;
}

.archive-modal-input:focus {
  border-color: var(--accent);
}

.archive-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.archive-modal-cancel {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.archive-modal-cancel:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.archive-modal-confirm {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  background: #0b1f3a;
  border: 1px solid transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.archive-modal-confirm:hover {
  background: #132d52;
}

.archive-modal-confirm:active {
  background: #08172c;
}

.archive-modal-confirm.is-destructive {
  background: var(--danger);
}

.archive-modal-confirm.is-destructive:hover {
  background: #b53f3f;
}

/* Build / Ask modes in sidebar and rail */
body:not([data-is-home="true"]) .sidebar-mode-switch,
body:not([data-is-home="true"]) .rail-mode-toggle {
  display: none !important;
}

.workspace-ask {
  min-height: 100vh;
  padding: 0 28px;
  background: var(--bg-canvas);
}

.workspace-ask.is-empty,
.workspace-ask:has(.ask-shell.is-empty) {
  background:
    radial-gradient(ellipse 72% 56% at 50% 48%, rgba(var(--theme-blue-rgb, 186, 220, 255), 0.65) 0%, rgba(var(--theme-blue-rgb, 219, 234, 254), 0.42) 35%, rgba(var(--theme-blue-rgb, 239, 246, 255), 0.18) 58%, transparent 75%),
    radial-gradient(ellipse 46% 38% at 50% 45%, rgba(var(--theme-blue-rgb, 147, 197, 253), 0.4) 0%, transparent 60%),
    var(--bg-canvas);
}

.workspace-ask.has-messages,
.workspace-ask:has(.ask-shell.has-messages) {
  background: var(--bg-canvas);
}

.ask-shell {
  display: flex;
  width: min(100%, 900px);
  min-height: 100vh;
  margin: 0 auto;
  flex-direction: column;
  box-sizing: border-box;
}

.ask-shell.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 760px);
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
  transform: translateY(-44px);
}

.ask-thread {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 28px 0 12px;
}

.ask-shell.is-empty .ask-thread {
  display: block;
  width: 100%;
  max-width: 760px;
  min-height: 0;
  padding: 0;
}

.ask-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: center;
  animation: strategy-fade 260ms ease both;
}

.ask-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(30px, 3.4vw, 36px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.18;
  text-align: center;
}

.ask-title.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}

.ask-subtitle {
  display: none;
}

.ask-message {
  display: flex;
  align-items: flex-start;
  margin: 0 0 30px;
}

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

.ask-message-content {
  width: min(100%, 730px);
  max-width: 730px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.68;
}

.ask-message-user .ask-message-content {
  width: fit-content;
  max-width: min(78%, 620px);

  padding: 11px 16px;

  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.055));
  border-radius: 18px;

  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.78);
  color: var(--text-primary);

  box-shadow:
    0 1px 2px var(--theme-shadow-soft, rgba(16, 24, 40, 0.025)),
    0 6px 18px var(--theme-shadow-soft, rgba(16, 24, 40, 0.025));

  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.008em;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ask-message-context {
  display: block;
  max-width: 360px;
  margin-top: 8px;
  padding-top: 7px;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-rich-text {
  color: var(--text-primary);
}

.ask-rich-text > :first-child {
  margin-top: 0;
}

.ask-rich-text > :last-child {
  margin-bottom: 0;
}

.ask-rich-text h2,
.ask-rich-text h3,
.ask-rich-text h4 {
  margin: 28px 0 10px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.ask-rich-text h2 {
  font-size: 21px;
}

.ask-rich-text h3 {
  font-size: 17px;
}

.ask-rich-text h4 {
  font-size: 15px;
}

.ask-rich-text p {
  margin: 0 0 16px;
}

.ask-rich-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ask-rich-text code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.07);
  color: var(--theme-blue-ink, #dce3ff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.ask-rich-text ul,
.ask-rich-text ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 18px;
  padding-left: 22px;
}

.ask-rich-text li::marker {
  color: var(--text-tertiary);
}

.ask-code-block {
  margin: 18px 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--theme-inverse-surface, #111113);
}

.ask-code-block code {
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

.ask-table-wrap {
  max-width: 100%;
  margin: 20px 0;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.ask-table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.ask-table-wrap th,
.ask-table-wrap td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.ask-table-wrap th {
  color: var(--text-primary);
  font-weight: 600;
}

.ask-table-wrap td {
  color: var(--text-primary);
}

.ask-table-wrap tr:last-child td {
  border-bottom: 0;
}

/* 💫 High-Contrast & International Ask Response Actions */
.ask-message-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 2px 0;
  opacity: 1;
}

.ask-response-action {
  display: inline-flex;
  width: 32px;
  height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #475467;
  cursor: pointer;
  box-shadow: none;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 120ms ease;
  user-select: none;
  flex-shrink: 0;
}

[data-theme="dark"] .ask-response-action {
  color: #cbd5e1;
}

.ask-response-action:hover {
  background: rgba(15, 23, 42, 0.065);
  border-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

[data-theme="dark"] .ask-response-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.ask-response-action:active {
  background: rgba(15, 23, 42, 0.11);
  transform: scale(0.92);
}

[data-theme="dark"] .ask-response-action:active {
  background: rgba(255, 255, 255, 0.14);
}

.ask-response-action:focus-visible {
  outline: 2px solid var(--accent, #4f6ee8);
  outline-offset: 1px;
}

.ask-response-action.is-copied {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.22);
  color: #16a34a;
}

[data-theme="dark"] .ask-response-action.is-copied {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
  color: #4ade80;
}

.ask-response-action.is-copied svg {
  stroke: currentColor;
}

.ask-response-action.is-selected {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .ask-response-action.is-selected {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.3);
}

.ask-response-positive-btn.is-selected {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.24);
}

.ask-response-positive-btn.is-selected svg {
  fill: rgba(22, 163, 74, 0.18);
}

[data-theme="dark"] .ask-response-positive-btn.is-selected {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
}

[data-theme="dark"] .ask-response-positive-btn.is-selected svg {
  fill: rgba(74, 222, 128, 0.2);
}

.ask-response-negative-btn.is-selected {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.24);
}

.ask-response-negative-btn.is-selected svg {
  fill: rgba(220, 38, 38, 0.18);
}

[data-theme="dark"] .ask-response-negative-btn.is-selected {
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
}

[data-theme="dark"] .ask-response-negative-btn.is-selected svg {
  fill: rgba(248, 113, 113, 0.2);
}

.ask-response-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
  color: inherit;
  transition: transform 120ms ease, fill 120ms ease, stroke 120ms ease;
}

/* ⋯ Ask Response More Options Popover */
.ask-response-more-menu {
  position: relative;
  display: inline-flex;
}

.ask-response-more-btn {
  list-style: none;
}

.ask-response-more-btn::-webkit-details-marker {
  display: none;
}

.ask-response-more-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.ask-response-more-menu[open] .ask-response-more-btn {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

[data-theme="dark"] .ask-response-more-menu[open] .ask-response-more-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.ask-response-more-popover {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 6px);
  left: 0;
  right: auto;
  min-width: 175px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 5px;
  border-radius: 10px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.1));
  box-shadow: 0 10px 28px var(--theme-shadow-soft, rgba(15, 23, 42, 0.11)), 0 2px 6px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  animation: ask-response-popover-in 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
}

@keyframes ask-response-popover-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ask-response-more-menu:not([open]) .ask-response-more-popover {
  display: none;
}

.ask-response-model-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px 5px;
  font-size: 12px;
  line-height: 1.4;
}

.ask-response-model-label {
  color: var(--text-tertiary, #64748b);
  font-weight: 500;
}

.ask-response-model-name {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

.ask-response-popover-divider {
  height: 1px;
  background: var(--theme-wash, rgba(15, 23, 42, 0.07));
  margin: 3px 0;
}

.ask-response-popover-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #475569);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 120ms ease;
  font-family: inherit;
}

.ask-response-popover-item svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.ask-response-popover-item:hover {
  background: var(--bg-soft, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.ask-think-deeper-btn {
  color: var(--brand-primary, #2563eb);
  font-weight: 550;
}

.ask-think-deeper-btn svg {
  fill: currentColor;
  stroke: none;
}

.ask-think-deeper-btn:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  color: var(--theme-blue-ink, #1d4ed8) !important;
}

.ask-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0 1px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-secondary, rgba(29, 36, 50, 0.7));
  user-select: none;
  animation: ask-thinking-fade 200ms ease-out both;
}

.ask-thinking-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--accent, #4f6ee8);
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--accent-soft, rgba(79, 110, 232, 0.1));
}

.ask-thinking-sparkle {
  display: none;
}

.ask-thinking-label {
  color: var(--text-secondary, rgba(29, 36, 50, 0.7));
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ask-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 1px;
}

.ask-thinking-dots i {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--text-tertiary, rgba(40, 48, 64, 0.47));
  opacity: 0.35;
  animation: ask-thinking-wave 1.5s ease-in-out infinite;
}

.ask-thinking-dots i:nth-child(1) {
  animation-delay: 0s;
}

.ask-thinking-dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.ask-thinking-dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ask-thinking-fade {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ask-sparkle-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes ask-thinking-wave {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-2px); opacity: 1; }
}

.ask-message-assistant {
  opacity: 1;
}

.ask-message-assistant .ask-message-content {
  color: var(--text-primary);
  opacity: 1;
}

.ask-message-assistant .ask-rich-text,
.ask-message-assistant .ask-rich-text p,
.ask-message-assistant .ask-rich-text li,
.ask-message-assistant .ask-rich-text td {
  color: var(--text-primary);
  opacity: 1;
}

.ask-message-assistant.is-fresh:not(.is-streaming) .ask-rich-text {
  animation: ask-answer-in 180ms ease-out both;
}

.ask-thinking.is-searching .ask-thinking-icon {
  width: 15px;
  height: 15px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-left: 0;
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
}

.ask-thinking.is-searching .ask-searching-globe {
  width: 14px;
  height: 14px;
  display: block;
  animation: ask-globe-spin 3s linear infinite;
}

@keyframes ask-globe-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ask-grounding-container {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-secondary, rgba(243, 244, 246, 0.6));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.8));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}

.ask-grounding-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary, #6b7280);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ask-grounding-icon {
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  flex-shrink: 0;
}

.ask-grounding-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ask-grounding-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 6px;
  color: var(--text-primary, #111827);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 150ms ease;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-grounding-chip:hover {
  background: var(--accent-subtle, rgba(79, 110, 232, 0.08));
  border-color: var(--accent, #4f6ee8);
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
}

.ask-grounding-chip-domain {
  font-weight: 600;
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
}

.ask-grounding-chip-title {
  color: var(--text-secondary, #4b5563);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sources Slide-in Drawer (Desktop: Right, Mobile: Bottom-up) */
.ask-sources-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.45));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  animation: ask-sources-fade-in 180ms ease-out both;
}

@keyframes ask-sources-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ask-sources-slide-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes ask-sources-slide-bottom {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ask-sources-drawer {
  width: min(100vw, 440px);
  height: 100%;
  background: var(--theme-surface, #ffffff);
  box-shadow: -8px 0 32px var(--theme-shadow-soft, rgba(15, 23, 42, 0.14));
  display: flex;
  flex-direction: column;
  animation: ask-sources-slide-right 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

.ask-sources-drag-handle {
  display: none;
}

.ask-sources-drawer-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--theme-border, #f1f5f9);
  gap: 12px;
  flex-shrink: 0;
}

.ask-sources-drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ask-sources-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ask-sources-drawer-icon {
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ask-sources-drawer-icon svg {
  display: block;
}

.ask-sources-drawer-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--theme-ink, #0f172a);
}

.ask-sources-drawer-title-group p {
  margin: 0;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
  line-height: 1.4;
}

.ask-sources-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: transparent;
  color: var(--theme-muted, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 130ms ease;
  flex-shrink: 0;
}

.ask-sources-drawer-close:hover {
  background: var(--theme-surface, #f8fafc);
  border-color: var(--theme-border, #cbd5e1);
  color: var(--theme-ink, #0f172a);
}

.ask-sources-drawer-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.ask-sources-queries-box {
  background: var(--theme-surface, #f8fafc);
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-sources-queries-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-copy, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ask-sources-queries-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ask-sources-query-tag {
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #cbd5e1);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--theme-ink, #1e293b);
  font-weight: 500;
  line-height: 1.3;
}

.ask-sources-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 160ms ease;
}

.ask-source-card:hover {
  border-color: var(--accent, #4f6ee8);
  background: rgba(79, 110, 232, 0.03);
  box-shadow: 0 4px 14px -2px rgba(79, 110, 232, 0.09);
  transform: translateY(-1px);
}

.ask-source-card-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.ask-source-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ask-source-card-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--theme-ink, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-source-card-url {
  font-size: 11.5px;
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-source-card-icon {
  color: var(--theme-muted, #94a3b8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 140ms ease;
}

.ask-source-card:hover .ask-source-card-icon {
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
}

.ask-sources-empty {
  color: var(--theme-muted, #64748b);
  font-size: 13px;
  margin: 16px 0;
  text-align: center;
}

@media (max-width: 640px) {
  .ask-sources-drawer-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .ask-sources-drawer {
    width: 100vw;
    height: 85vh;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16));
    animation: ask-sources-slide-bottom 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .ask-sources-drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--theme-surface-muted, #cbd5e1);
    margin: 10px auto 2px;
    flex-shrink: 0;
  }

  .ask-sources-drawer-header {
    padding: 14px 18px;
  }

  .ask-sources-drawer-body {
    padding: 14px 18px 24px;
  }
}

.ask-answer-caret {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin: 0 0 0 5px;
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, var(--accent, #4f6ee8) 18%, var(--accent, #4f6ee8) 82%, transparent);
  box-shadow: 0 0 0 1px rgba(79, 110, 232, 0.025);
  vertical-align: -0.13em;
  opacity: 0.76;
}

.ask-answer-caret.is-streaming {
  animation: ask-caret 700ms ease-in-out infinite;
}

.ask-error {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--theme-danger-border, rgba(255, 120, 120, 0.16));
  border-radius: 10px;
  background: rgba(255, 90, 90, 0.045);
  color: var(--text-secondary);
  font-size: 12px;
}

.ask-error-body {
  display: grid;
  gap: 4px;
  flex: 1;
}

.ask-error strong {
  color: var(--text-primary);
}

.ask-error-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary, #888);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  line-height: 1;
  transition: color 150ms ease;
  flex-shrink: 0;
}

.ask-error-dismiss:hover {
  color: var(--text-primary);
}

.ask-composer-area {
  position: sticky;
  bottom: 0;
  width: min(100%, 760px);
  margin: auto auto 0;
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  background: transparent;
}

.ask-shell.has-messages .ask-composer-area {
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg-canvas) 20%);
}

.ask-shell.is-empty .ask-composer-area {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

.ask-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ask-suggestion {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.ask-suggestion:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ask-context-menu {
  position: relative;
  width: 40px;
  height: 40px;
  z-index: 5;
}

.ask-context-slot {
  position: relative;
  width: 40px;
  height: 40px;
  z-index: 5;
}

.ask-context-trigger {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  list-style: none;
  transition: background 150ms ease, color 150ms ease;
}

.ask-context-trigger::-webkit-details-marker {
  display: none;
}

.ask-context-trigger:hover,
.ask-context-menu[open] .ask-context-trigger {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ask-context-menu.has-selection .ask-context-trigger {
  background: rgba(99, 128, 255, 0.13);
  color: var(--theme-blue-ink, #cbd4ff);
}

.ask-context-menu.has-selection .ask-context-trigger::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--theme-border-strong, #202022);
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.ask-context-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-2px);
}

.ask-context-popover {
  position: absolute;
  z-index: 120;
  bottom: calc(100% + 14px);
  top: auto;
  left: -8px;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 40px));
  max-height: min(440px, calc(100dvh - 140px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 4px 18px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08)), 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  animation: menu-in 150ms ease both;
}

.ask-context-popover.is-downwards {
  top: calc(100% + 10px);
  bottom: auto;
}

.ask-context-menu:not([open]) .ask-context-popover,
.ask-model-selector-menu:not([open]) .ask-model-selector-popover,
.ask-response-more-menu:not([open]) .ask-response-more-popover {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.ask-context-title {
  padding: 7px 9px 9px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.ask-context-menu-heading { display: block; padding: 9px 10px 8px; color: var(--text-primary); font-size: 13px; font-weight: 650; }
.ask-context-menu-option { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 10px; background: transparent; color: var(--text-primary); text-align: left; }
.ask-context-menu-option:hover, .ask-context-menu-back:hover { background: var(--bg-hover); }
.ask-context-menu-option-copy { display: grid; gap: 3px; min-width: 0; }.ask-context-menu-option-copy strong { font-size: 13px; font-weight: 600; }.ask-context-menu-option-copy small { color: var(--text-tertiary); font-size: 11px; }
.ask-context-menu-option-main { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 auto; }
.ask-context-menu-option-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(79, 110, 232, 0.1); color: var(--theme-blue-ink, var(--accent)); flex-shrink: 0; }
.ask-context-menu-chevron { flex: 0 0 auto; color: var(--text-tertiary); font-size: 25px; font-weight: 300; line-height: 1; }
.ask-context-menu-divider { height: 1px; margin: 7px 2px; background: var(--border-subtle); }
.ask-context-menu-subheader { display: flex; align-items: center; gap: 3px; }.ask-context-menu-subheader .ask-context-menu-heading { padding-left: 3px; }
.ask-context-menu-back { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: transparent; color: var(--text-secondary); font-size: 25px; font-weight: 300; line-height: 1; }

@media (max-width: 767px) {
  .ask-context-popover { width: min(340px, calc(100vw - 28px)); max-height: min(390px, calc(100dvh - 150px)); border-radius: 16px; z-index: 120; }
  .ask-context-menu-option { min-height: 52px; padding: 10px 11px; }
  .ask-context-menu-option-copy strong { font-size: 13.5px; }
  .ask-context-menu-back { width: 36px; height: 36px; }
  .ask-context-list { max-height: min(36vh, 260px); }
  .ask-context-item { min-height: 50px; padding: 10px 11px; }
  .ask-context-item span { font-size: 13px; }
  .preset-prompt-list { max-height: min(36vh, 260px); }
  .preset-prompt-item { min-height: 54px; padding: 10px 11px; }
  .preset-prompt-item strong { font-size: 13px; }
}

.ask-context-list {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
}

.ask-context-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 9px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.ask-context-item:hover,
.ask-context-item.is-selected {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ask-context-item span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-context-item small {
  color: var(--text-tertiary);
  font-size: 10px;
}

.ask-context-item.is-selected small {
  color: var(--theme-blue-ink, #aebcff);
}

.preset-prompt-list {
  display: grid;
  gap: 2px;
  max-height: min(360px, calc(100vh - 180px));
  overflow-y: auto;
}

.preset-prompt-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.preset-prompt-item:hover { background: var(--bg-hover); }
.preset-prompt-item strong { font-size: 12px; font-weight: 650; }
.preset-prompt-item span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ask-context-empty {
  display: grid;
  gap: 5px;
  padding: 16px 9px;
  color: var(--text-secondary);
  font-size: 12px;
}

.ask-context-empty small {
  max-width: 250px;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.5;
}

.ask-context-clear,
.ask-context-archive {
  width: 100%;
  padding: 9px;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: left;
}

.ask-context-clear:hover,
.ask-context-archive:hover {
  color: var(--text-primary);
}

.ask-composer {
  display: flex;
  min-height: 58px;
  gap: 8px;
  align-items: flex-end;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 32px;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 10px 32px var(--theme-shadow-soft, rgba(20, 27, 42, 0.07)), 0 2px 6px var(--theme-shadow-soft, rgba(20, 27, 42, 0.03));
  transition: border-color 160ms ease, box-shadow 160ms ease;
  position: relative;
}

.ask-composer.is-dragover {
  border-color: var(--accent);
  background: rgba(79, 110, 232, 0.04);
  box-shadow: 0 0 0 3px rgba(79, 110, 232, 0.16), 0 12px 36px var(--theme-shadow-soft, rgba(31, 41, 55, 0.1));
}

.ask-composer-leading {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  z-index: 5;
}

.ask-composer-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.ask-pending-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 8px;
  border-radius: 12px;
  background: var(--bg-soft, #f4f6fa);
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  max-width: 100%;
  width: fit-content;
  animation: menu-in 150ms ease both;
  margin-bottom: 2px;
}

.ask-pending-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(79, 110, 232, 0.12);
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  flex-shrink: 0;
}

.ask-pending-file-icon.is-pdf {
  background: rgba(239, 68, 68, 0.12);
  color: var(--theme-danger-ink, #ef4444);
}

.ask-pending-file-icon.is-image {
  background: rgba(16, 185, 129, 0.12);
  color: var(--theme-success-ink, #10b981);
}

.ask-pending-file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 240px;
}

.ask-pending-file-name {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ask-pending-file-size {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.ask-pending-file-remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  border: 0;
  cursor: pointer;
  margin-left: 2px;
  transition: background 120ms ease, color 120ms ease;
  flex-shrink: 0;
}

.ask-pending-file-remove:hover {
  background: var(--theme-wash, rgba(0, 0, 0, 0.08));
  color: var(--text-primary);
}

.ask-message-attachment {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 12px 7px 9px;
  border-radius: 12px;
  background: var(--theme-wash, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.08));
  max-width: 100%;
  width: fit-content;
  box-sizing: border-box;
}

[data-theme="dark"] .ask-message-attachment {
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.ask-message-attachment-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(79, 110, 232, 0.12);
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  flex-shrink: 0;
}

.ask-message-attachment-icon.is-pdf {
  background: rgba(239, 68, 68, 0.14);
  color: var(--theme-danger-ink, #ef4444);
}

.ask-message-attachment-icon.is-image {
  background: rgba(16, 185, 129, 0.14);
  color: var(--theme-success-ink, #10b981);
}

.ask-message-attachment-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ask-message-attachment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  line-height: 1.35;
}

.ask-message-attachment-size {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
  line-height: 1.2;
}

.ask-file-type-icon {
  display: block;
}

.ask-composer:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
  box-shadow: 0 12px 36px var(--theme-shadow-soft, rgba(31, 41, 55, 0.09));
  outline: none;
}

.ask-composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 1px;
  flex-shrink: 0;
}

.ask-input {
  width: 100%;
  min-height: 38px;
  max-height: 160px;
  padding: 8px 0;
  overflow-y: auto;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.ask-input::placeholder {
  color: var(--text-tertiary);
}

.ask-submit {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #0b1f3a;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  transition: background 150ms ease, transform 120ms ease, opacity 150ms ease;
  flex-shrink: 0;
}

.ask-submit:hover:not(:disabled) {
  background: #132d52;
  transform: scale(1.02);
}

.ask-submit:active:not(:disabled) {
  background: #08172c;
  transform: scale(0.95);
}

.ask-submit:disabled {
  background: var(--bg-soft);
  color: var(--text-tertiary);
  opacity: 0.7;
}

.ask-submit.is-stop,
.strategy-ask-send.is-stop {
  cursor: pointer !important;
}

.ask-submit.is-stop:hover,
.strategy-ask-send.is-stop:hover {
  transform: scale(1.04);
}

.ask-submit.is-stop:active,
.strategy-ask-send.is-stop:active {
  transform: scale(0.95);
}

.ask-stop-icon {
  display: block;
  stroke: none !important;
  fill: #ffffff;
}

[data-theme="dark"] .ask-stop-icon,
html.dark .ask-stop-icon {
  stroke: none !important;
  fill: #0b0f17 !important;
}

.ask-model-selector-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ask-model-selector-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 150ms ease;
  border: 0;
  outline: none;
}

.ask-model-selector-trigger::-webkit-details-marker {
  display: none;
}

.ask-model-selector-trigger:hover,
.ask-model-selector-menu[open] .ask-model-selector-trigger {
  color: var(--text-primary);
}

.ask-model-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}

.ask-model-chevron-icon {
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 150ms ease;
}

.ask-model-selector-menu[open] .ask-model-chevron-icon {
  transform: rotate(180deg);
}

.ask-model-selector-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 3px;
  width: 190px;
  padding: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px var(--theme-shadow-soft, rgba(0, 0, 0, 0.12)), 0 2px 6px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  animation: menu-in 140ms ease both;
}

.ask-model-selector-menu:not([open]) .ask-model-selector-popover {
  display: none;
}

.ask-model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease;
}

.ask-model-option:hover {
  background: var(--bg-hover);
}

.ask-model-option.is-active {
  background: var(--accent-soft);
}

.ask-model-option-info {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ask-model-option-info strong {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-primary);
}

.ask-model-option-info small {
  font-size: 11px;
  color: var(--text-tertiary);
}

.ask-model-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-blue-ink, var(--accent));
  flex-shrink: 0;
}

.ask-model-popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 3px 0;
}

.ask-model-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  user-select: none;
  background: var(--theme-wash, rgba(0, 0, 0, 0.02));
}

.ask-model-toggle-info {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ask-model-toggle-info strong {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-primary);
}

.ask-model-toggle-info small {
  font-size: 11px;
  color: var(--text-tertiary);
}

.ask-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.ask-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ask-toggle-slider {
  position: absolute;
  inset: 0;
  background-color: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.ask-toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--theme-surface, #ffffff);
  border-radius: 50%;
  box-shadow: 0 1px 3px var(--theme-shadow-strong, rgba(0, 0, 0, 0.2));
  transition: transform 160ms ease;
}

.ask-toggle-switch input:checked + .ask-toggle-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.ask-toggle-switch input:checked + .ask-toggle-slider::before {
  transform: translateX(16px);
}

.ask-composer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 0;
  text-align: center;
}

.ask-disclaimer {
  margin: 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  user-select: none;
}

.ask-preset-prompt-cta {
  position: absolute;
  z-index: 60;
  top: calc(100% + 14px);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  background: var(--theme-inverse-surface, #181f2e);
  box-shadow: 0 4px 14px var(--theme-shadow-strong, rgba(0, 0, 0, 0.16));
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, color 150ms ease;
}

.ask-preset-prompt-cta::before {
  position: absolute;
  top: -6px;
  left: 15px;
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--theme-border-strong, #181f2e);
  border-left: 6px solid transparent;
  content: "";
}

.ask-preset-prompt-cta.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.ask-preset-prompt-cta:not(.is-hidden) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ask-preset-prompt-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ask-preset-prompt-cta:hover,
.ask-preset-prompt-cta:focus-visible {
  color: #ffffff;
  opacity: 0.88;
}

@media (prefers-reduced-motion: reduce) {
  .ask-preset-prompt-cta { transition: none; }
}

/* ⚡ Ask Model Selector & Popover (Minimalist & Premium Light Design) */
.ask-model-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.ask-model-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 17px;
  background: var(--bg-soft);
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.08));
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  transition: all 140ms ease;
  user-select: none;
  white-space: nowrap;
}

.ask-model-trigger::-webkit-details-marker {
  display: none;
}

.ask-model-trigger:hover {
  background: var(--theme-surface-muted, #e7eaef);
  border-color: var(--theme-border, rgba(20, 27, 42, 0.14));
}

.ask-model-menu[open] .ask-model-trigger {
  background: var(--theme-surface, #ffffff);
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(79, 110, 232, 0.12);
  color: var(--theme-blue-ink, var(--accent));
}

.ask-model-trigger-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ask-model-chevron {
  opacity: 0.6;
  transition: transform 160ms ease, opacity 140ms ease;
  margin-left: 1px;
}

.ask-model-menu[open] .ask-model-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.ask-model-popover {
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 10px);
  right: 0;
  display: grid;
  width: 290px;
  padding: 7px;
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.1));
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 18px 46px var(--theme-shadow-soft, rgba(15, 23, 42, 0.13)), 0 3px 10px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  animation: ask-model-popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ask-model-popover-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ask-model-menu:not([open]) .ask-model-popover {
  display: none;
}

.ask-model-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 7px;
  border-bottom: 1px solid var(--theme-border, rgba(20, 27, 42, 0.06));
  margin-bottom: 5px;
}

.ask-model-popover-title {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ask-model-popover-badge {
  font-size: 9.5px;
  color: var(--theme-blue-ink, var(--accent));
  font-weight: 550;
  background: rgba(79, 110, 232, 0.08);
  padding: 1.5px 6px;
  border-radius: 5px;
}

.ask-model-list {
  display: grid;
  gap: 4px;
}

.ask-model-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 130ms ease;
}

.ask-model-item:hover {
  background: var(--bg-soft);
  border-color: var(--theme-border, rgba(20, 27, 42, 0.06));
}

.ask-model-item.is-selected {
  background: rgba(79, 110, 232, 0.06);
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.22));
}

.ask-model-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ask-model-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ask-model-item.is-selected .ask-model-item-name {
  color: var(--theme-blue-ink, var(--accent));
}

.ask-model-item-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding-left: 0;
}

/* Intro & Message badges */
.ask-intro-model-badge {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 12px;
}

.ask-intro-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.09));
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(20, 27, 42, 0.04));
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 550;
}

.ask-message-model-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.06));
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 550;
  margin-right: auto;
}


@keyframes question-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes strategy-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes status-pulse {
  50% { opacity: 0.4; }
}

@keyframes live-ring {
  0% { opacity: 0.75; transform: scale(0.7); }
  70%, 100% { opacity: 0; transform: scale(1.75); }
}

@keyframes activity-scan {
  0% { opacity: 0; transform: translateX(-100%); }
  18% { opacity: 1; }
  72% { opacity: 0.65; }
  100% { opacity: 0; transform: translateX(300%); }
}

@keyframes ask-thinking-bars {
  0%, 100% { opacity: 0.45; transform: scaleY(0.62); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes ask-thinking-dot {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 0.9; transform: translateY(-2px); }
}

@keyframes ask-answer-in {
  from { opacity: 0.45; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ask-caret {
  0%, 100% { opacity: 0.26; }
  50% { opacity: 0.86; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 980px) {
  .priority-grid {
    grid-template-columns: 1fr;
  }

  .priority-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 16px;
  }

  .priority-top {
    grid-row: 1 / span 2;
    align-content: start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
  }

  .priority-card h3 {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(86vw, 290px);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 200ms ease, visibility 0s linear 200ms;
  }

  .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 200ms ease;
  }

  .sidebar-close {
    display: grid;
  }

  .mobile-overlay {
    position: fixed;
    z-index: 85;
    inset: 0;
    display: block;
    background: var(--theme-overlay, rgba(23, 32, 51, 0.28));
    backdrop-filter: blur(2px);
  }

  .mobile-overlay[hidden] {
    display: none;
  }

  .app-main {
    min-height: 100vh;
  }

  body.sidebar-open .app-main {
    margin-left: 0;
  }

  .workspace {
    min-height: 100vh;
  }

  .workspace-centered {
    min-height: 100vh;
    padding: clamp(96px, 17vh, 160px) 24px 56px;
  }

  .workspace-document {
    padding: 13px 18px 55px;
  }

  .workspace-list {
    padding: 36px 22px;
  }
}

@media (max-width: 767px) {
  .navigation-rail {
    display: none;
  }

  .sidebar {
    left: 0;
    transform: translateX(-105%);
  }

  .app-main,
  body.sidebar-open .app-main {
    margin-left: 0;
  }

  .workspace {
    min-height: calc(100vh - 61px);
  }

  .clarification-title {
    font-size: 30px;
  }

  .question-card {
    padding: 17px;
  }

  .question-reason {
    margin-left: 0;
  }

  .clarification-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .clarification-actions .primary-button {
    width: 100%;
  }

  .strategy-toolbar {
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar-back {
    display: none;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .strategy-header,
  .strategy-block,
  .refinement-panel {
    border-radius: 17px;
  }

  .strategy-header {
    padding: 28px 22px;
  }

  .strategy-title {
    font-size: 34px;
  }

  .strategy-lede {
    font-size: 15px;
  }

  .strategy-block,
  .refinement-panel {
    padding: 25px 20px;
  }

  .strategy-block {
    border-radius: 0;
  }

  .context-grid,
  .kpi-grid,
  .risk-row,
  .closeout-grid,
  .saved-grid {
    grid-template-columns: 1fr;
  }

  .context-item {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border);
  }

  .context-item:last-child {
    border-bottom: 0;
  }

  .strategy-section {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
  }

  .risk-row {
    gap: 15px;
  }

  .closeout-grid {
    gap: 30px;
  }

  .refinement-form {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .quick-actions {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-actions::-webkit-scrollbar {
    display: none;
  }

  .quick-action {
    flex: 0 0 auto;
  }

  .list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-heading .primary-button {
    width: 100%;
  }

  .saved-card {
    min-height: 220px;
  }

  .export-menu {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }
}

@media (max-width: 980px) {
  .strategy-local-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .strategy-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .strategy-breadcrumb {
    max-width: 100%;
    width: 100%;
    order: 1;
  }

  .strategy-format-tabs {
    order: 2;
  }

  .toolbar-actions {
    order: 3;
    margin-left: auto;
  }

  .strategy-toc {
    z-index: 10;
    top: 64px;
    display: flex;
    gap: 4px;
    margin: 0 -4px 20px;
    padding: 8px 4px;
    overflow-x: auto;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
  }

  .strategy-toc a {
    flex: 0 0 auto;
  }

  .strategy-overview,
  .strategy-work-section {
    scroll-margin-top: 120px;
  }

  .strategy-pillar-grid,
  .kpi-cards-grid,
  .risk-cards-grid,
  .action-checklist-grid {
    grid-template-columns: 1fr;
  }

  .strategies-view {
    padding: 32px 20px 60px;
  }
}

@media (max-width: 640px) {
  .clarification-stage {
    min-height: 300px;
  }

  .clarification-actions {
    align-items: center;
    flex-direction: row;
  }

  .clarification-action-right {
    gap: 10px;
  }

  .clarification-action-right .primary-button {
    width: auto;
  }

  .context-summary-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .workspace-document {
    padding: 0 16px 180px;
  }

  .strategy-toolbar {
    min-height: 54px;
    margin-bottom: 12px;
  }

  .strategy-breadcrumb {
    display: none;
  }

  .strategy-format-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .format-tab {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 11.5px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-actions .secondary-button,
  .toolbar-actions .primary-button {
    flex: 1;
    justify-content: center;
  }

  .strategy-toc {
    top: 61px;
    margin-bottom: 12px;
  }

  .strategy-overview {
    padding: 16px 0 36px;
  }

  .strategy-title {
    font-size: 26px;
  }

  .strategy-executive-card {
    padding: 18px 16px;
  }

  .exec-summary-text {
    font-size: 14.5px;
  }

  .faq-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .faq-summary {
    padding: 14px 14px;
  }

  .faq-question-text {
    font-size: 14px;
  }

  .strategy-work-section {
    padding: 36px 0;
  }

  .refinement-dock,
  body.sidebar-open .refinement-dock {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 50%;
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100vw - 16px);
    padding: 5px;
    border-radius: 15px;
  }

  .dock-actions-strip {
    gap: 2px;
    margin: 0;
  }

  .dock-action-btn {
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    gap: 0;
  }

  .dock-action-btn > span,
  .dock-action-btn .dock-chevron-icon {
    display: none;
  }

  .refinement-dock:focus-within .quick-actions,
  .refinement-dock.is-expanded .quick-actions {
    max-height: 44px;
    margin-bottom: 6px;
    padding: 2px 0;
  }

  .refinement-dock .quick-action {
    height: 25px;
    padding: 0 9px;
    font-size: 11px;
  }

  .strategies-view {
    padding: 24px 16px 96px;
  }

  .archive-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }

  .archive-title {
    font-size: 28px;
  }

  .archive-subtitle {
    font-size: 13.5px;
  }

  .archive-controls-section {
    gap: 12px;
    margin-bottom: 8px;
  }

  .archive-search-wrap {
    max-width: 100%;
    width: 100%;
  }

  .archive-toolbar {
    gap: 12px;
  }

  .archive-tabs {
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .archive-tab {
    font-size: 13px;
    padding: 6px 0 10px;
    white-space: nowrap;
  }

  .strategy-library-row {
    padding: 14px 8px;
  }

  .archive-row-actions {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .loading-title {
    font-size: 30px;
  }

  .loading-intro {
    margin-bottom: 24px;
  }

  .loading-activity {
    padding: 13px 14px 15px;
  }

  .loading-activity-body {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
  }

  .loading-activity-indicator {
    width: 34px;
    height: 34px;
  }

  .generation-step-label {
    display: none;
  }

  .generation-steps li {
    gap: 0;
  }
}

/* Light theme surface harmonization */
body {
  background: var(--bg-canvas);
}

::selection {
  background: rgba(79, 110, 232, 0.2);
  color: var(--text-primary);
}

.mode-option.is-active {
  background: var(--theme-wash, rgba(20, 27, 42, 0.075));
}

.brand-mark {
  border: 1px solid var(--border-subtle);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #111827);
}

.brand-copy small {
  color: var(--text-tertiary);
}

.icon-button:hover,
.mobile-new:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-overlay {
  background: var(--theme-wash, rgba(28, 36, 52, 0.22));
}

.mobile-header {
  border-bottom: none;
  background: transparent;
  color: var(--text-primary);
}

.workspace-centered {
  background: var(--bg-canvas);
}

.workspace-intake,
.workspace-centered:has(.intake-view) {
  background:
    radial-gradient(ellipse 72% 56% at 50% 48%, rgba(var(--theme-blue-rgb, 186, 220, 255), 0.65) 0%, rgba(var(--theme-blue-rgb, 219, 234, 254), 0.42) 35%, rgba(var(--theme-blue-rgb, 239, 246, 255), 0.18) 58%, transparent 75%),
    radial-gradient(ellipse 46% 38% at 50% 45%, rgba(var(--theme-blue-rgb, 147, 197, 253), 0.4) 0%, transparent 60%),
    var(--bg-canvas);
}

.composer-card,
.question-card,
.strategy-header,
.saved-card,
.refinement-panel {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.composer-card:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
  box-shadow: 0 18px 44px var(--theme-shadow-soft, rgba(31, 41, 55, 0.1));
  outline: none;
}

.composer-input,
.question-input,
.refinement-input,
.strategy-ask-input,
.ask-composer-input,
.library-search,
.ask-input {
  color: var(--text-primary);
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  background-color: transparent !important;
}

.composer-input:focus,
.composer-input:focus-visible,
.question-input:focus,
.question-input:focus-visible,
.refinement-input:focus,
.refinement-input:focus-visible,
.strategy-ask-input:focus,
.strategy-ask-input:focus-visible,
.ask-composer-input:focus,
.ask-composer-input:focus-visible,
.library-search:focus,
.library-search:focus-visible,
.ask-input:focus,
.ask-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.composer-input::placeholder,
.question-input::placeholder,
.refinement-input::placeholder,
.strategy-ask-input::placeholder,
.ask-composer-input::placeholder,
.library-search::placeholder,
.ask-input::placeholder {
  color: var(--text-tertiary);
}

.workspace-centered .composer-input::placeholder,
.examples-label,
.workspace-centered .example-chip {
  color: var(--text-tertiary);
}

.example-chip,
.quick-action,
.secondary-button,
.choice-pill span {
  color: var(--text-secondary);
}

.error-banner,
.ask-error {
  border-color: var(--theme-danger-border, rgba(198, 79, 79, 0.2));
  background: rgba(198, 79, 79, 0.06);
  color: var(--danger);
}

.loading-title,
.clarification-title,
.question-title {
  color: var(--text-primary);
}

.loading-copy,
.clarification-copy,
.question-reason,
.text-button {
  color: var(--text-secondary);
}

.loading-orbit {
  border-color: var(--border-hover);
  border-top-color: var(--accent);
}

.loading-activity {
  border-color: var(--border-subtle);
  background:
    linear-gradient(120deg, rgba(79, 110, 232, 0.075), transparent 44%),
    rgba(var(--theme-surface-rgb, 255, 255, 255), 0.82);
  box-shadow: 0 18px 46px var(--theme-shadow-soft, rgba(31, 41, 55, 0.075));
}

.generation-steps li {
  border-top-color: var(--theme-border, rgba(20, 27, 42, 0.1));
}

.generation-steps .is-complete {
  border-color: var(--theme-success-border, rgba(35, 133, 103, 0.42));
}

.generation-steps .is-current {
  border-color: var(--accent);
}

.question-number,
.clarification-stage .choice-pill input:checked + span {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.42));
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
}

.clarification-stage .question-input,
.question-input,
.choice-pill span {
  border-color: var(--border-subtle);
  background: var(--theme-surface, #ffffff);
}

.question-input:focus {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.16));
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  outline: none;
}

.strategy-toolbar {
  background: rgba(var(--theme-surface-rgb, 248, 249, 251), 0.9);
}

.change-note,
.strategy-toc a.is-active {
  color: var(--theme-blue-ink, #3e5dcc);
}

.priority-high {
  background: rgba(198, 79, 79, 0.09);
  color: var(--theme-danger-ink, #a63f3f);
}

.priority-medium {
  background: rgba(168, 108, 24, 0.09);
}

.refining-banner {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.2));
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.94);
  color: var(--theme-blue-ink, var(--accent));
}

.empty-state {
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.6);
}

.toast {
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.96);
  box-shadow: var(--shadow-lg);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-color: var(--border-subtle);
  background: var(--theme-surface-soft, #eef0f3);
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.mode-option.is-active {
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(31, 41, 55, 0.1)), 0 4px 14px var(--theme-shadow-soft, rgba(31, 41, 55, 0.055));
}

.ask-rich-text {
  color: var(--text-primary);
}

.ask-rich-text code {
  background: var(--theme-wash, rgba(20, 27, 42, 0.06));
  color: var(--theme-blue-ink, #354eae);
}

.ask-code-block {
  background: var(--theme-surface-soft, #f0f2f5);
}

.ask-code-block code {
  color: var(--theme-ink, #293247);
}

.ask-context-menu.has-selection .ask-context-trigger {
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
}

.ask-context-menu.has-selection .ask-context-trigger::after {
  border-color: #ffffff;
}

.export-menu {
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 12px 32px var(--theme-shadow-soft, rgba(15, 23, 42, 0.1));
}

.ask-context-popover {
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 4px 18px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08)), 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
}

.ask-context-item.is-selected small {
  color: var(--theme-blue-ink, var(--accent));
}

.ask-composer,
.workspace-intake .ask-composer:where(:not(.is-dragover)):focus-within {
  border-color: var(--border-subtle);
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 14px 38px var(--theme-shadow-soft, rgba(31, 41, 55, 0.11));
}

.ask-composer:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
  box-shadow: 0 16px 42px var(--theme-shadow-soft, rgba(31, 41, 55, 0.12));
  outline: none;
}

.ask-submit:disabled {
  background: var(--theme-wash, rgba(20, 27, 42, 0.08));
  color: var(--text-tertiary);
}

.ask-shell.has-messages .ask-composer-area {
  background: linear-gradient(to bottom, transparent, var(--bg-canvas) 18%);
}

::-webkit-scrollbar-thumb {
  background: var(--theme-wash, rgba(40, 48, 64, 0.18));
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-overlay, rgba(40, 48, 64, 0.28));
}

[data-theme="dark"] ::-webkit-scrollbar-track,
html.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb,
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

[data-theme="dark"],
html.dark {
  scrollbar-color: #334155 #0f172a;
}
/* ===== FIRST-PARTY AUTHENTICATION (MINIMAL / CALM / PRESTIGE) ===== */

.auth-root {
  min-height: 100vh;
  background: var(--theme-surface-soft, #fafaf9);
  color: var(--theme-ink, #09090b);
}

.auth-boot {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--theme-muted, #71717a);
  font-size: 13px;
}

.auth-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg-canvas, #f8f9fb);
  color: var(--text-primary, #09090b);
  overflow-x: hidden;
}

[data-theme="dark"] .auth-layout,
html.dark .auth-layout {
  background: #020617;
  color: #f1f5f9;
}

/* Ambient glow backdrop */
.auth-ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 15%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);
}

[data-theme="dark"] .auth-ambient-glow,
html.dark .auth-ambient-glow {
  background:
    radial-gradient(circle at 50% 20%, rgba(37, 99, 235, 0.12) 0%, rgba(2, 6, 23, 0) 70%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.07) 0%, transparent 60%);
}

/* Top bar with brand emblem & live theme/language controls */
.auth-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 24px 12px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--theme-ink, #09090b);
  transition: opacity 150ms ease;
}

.auth-brand:hover {
  opacity: 0.85;
}

.auth-brand-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-brand-logo {
  display: block;
  border-radius: 6px;
}

.auth-brand-info strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--theme-ink, #09090b);
}

[data-theme="dark"] .auth-brand-info strong,
html.dark .auth-brand-info strong {
  color: #f8fafc;
}

.auth-top-utils {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--theme-border, #e4e4e7);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-muted, #71717a);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 120ms ease;
}

.auth-util-btn:hover {
  border-color: var(--theme-border-strong, #cbd5e1);
  background: var(--theme-surface-soft, #f4f4f5);
  color: var(--theme-ink, #09090b);
}

.auth-util-btn:active {
  transform: scale(0.96);
}

[data-theme="dark"] .auth-util-btn,
html.dark .auth-util-btn {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
  color: #94a3b8;
}

[data-theme="dark"] .auth-util-btn:hover,
html.dark .auth-util-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(30, 41, 59, 0.8);
  color: #f1f5f9;
}

.auth-theme-toggle .theme-icon-sun {
  display: none;
}

.auth-theme-toggle .theme-icon-moon {
  display: block;
}

[data-theme="dark"] .auth-theme-toggle .theme-icon-sun,
html.dark .auth-theme-toggle .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .auth-theme-toggle .theme-icon-moon,
html.dark .auth-theme-toggle .theme-icon-moon {
  display: none;
}

.auth-lang-btn {
  width: auto;
  min-width: 36px;
  padding: 0 10px;
}

.auth-lang-badge {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* Centered Form Container & Glass Card */
.auth-panel {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px 20px 48px;
  background: transparent;
}

.auth-container {
  width: min(100%, 450px);
  margin: 0 auto;
  transition: width 200ms ease;
}

.auth-container.auth-container-wide,
.auth-container-wide {
  width: min(100%, 820px);
}

.auth-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(20, 27, 42, 0.08);
  border-radius: 20px;
  padding: clamp(28px, 4.5vh, 40px) clamp(22px, 4vw, 36px);
  box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .auth-card,
html.dark .auth-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

[data-theme="dark"] .auth-step-badge,
html.dark .auth-step-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.auth-header {
  margin-bottom: 22px;
}

.auth-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.03em;
  color: var(--theme-ink, #09090b);
  line-height: 1.25;
}

.auth-header p {
  margin: 0;
  color: var(--theme-muted, #71717a);
  font-size: 13.5px;
  line-height: 1.5;
}

[data-theme="dark"] .auth-header h1,
html.dark .auth-header h1 {
  color: #f8fafc;
}

[data-theme="dark"] .auth-header p,
html.dark .auth-header p {
  color: #94a3b8;
}

/* Legacy fallback classes preserved safely */
.auth-story { display: none; }
.auth-mobile-header { display: none; }

/* Form controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-field-label {
  color: var(--theme-ink, #18181b);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.auth-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.auth-username-field input {
  padding-left: 32px;
}

.auth-username-prefix {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: var(--theme-muted, #a1a1aa);
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--theme-border, #e4e4e7);
  border-radius: 11px;
  outline: none;
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #09090b);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-field.auth-username-field input {
  padding-left: 38px;
}

.auth-field input::placeholder {
  color: var(--theme-muted, #a1a1aa);
}

.auth-field input:focus {
  border-color: var(--theme-blue-border, #2563eb);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.08);
}

.auth-field.has-error input {
  border-color: var(--theme-danger-border, #ef4444);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .auth-field-label,
html.dark .auth-field-label {
  color: #e2e8f0;
}

[data-theme="dark"] .auth-field input,
html.dark .auth-field input {
  background: rgba(15, 23, 42, 0.65);
  border-color: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .auth-field input::placeholder,
html.dark .auth-field input::placeholder {
  color: #64748b;
}

[data-theme="dark"] .auth-field input:focus,
html.dark .auth-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.18);
}

.auth-field input[type="password"],
.auth-field input[type="text"]:has(+ .password-toggle:not([hidden])) {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--theme-muted, #71717a);
  cursor: pointer;
  border-radius: 7px;
  transform: translateY(-50%);
  transition: color 130ms ease, background 130ms ease;
}

.password-toggle:hover {
  color: var(--theme-ink, #18181b);
  background: var(--theme-surface-soft, #f4f4f5);
}

.auth-field-hint {
  min-height: 0;
  color: var(--theme-muted, #71717a);
  font-size: 11.5px;
}

.auth-field-hint.is-valid {
  color: var(--theme-success-ink, #16a34a);
  font-weight: 500;
}

.auth-field-hint.is-invalid {
  color: var(--theme-danger-ink, #ef4444);
  font-weight: 500;
}

.auth-form-helpers {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.auth-form-helpers a {
  font-size: 12.5px;
  color: var(--theme-blue-ink, #2563eb);
  font-weight: 500;
  text-decoration: none;
  transition: color 120ms ease;
}

.auth-form-helpers a:hover {
  text-decoration: underline;
  color: var(--theme-blue-ink, #1d4ed8);
}

.auth-submit {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: none;
  background: #0b1f3a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease, opacity 150ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: #132d52;
}

.auth-submit:active:not(:disabled) {
  background: #08172c;
  transform: scale(0.995);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 6px 0 2px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--theme-border, #e4e4e7);
}

.auth-divider span {
  padding: 0 12px;
  color: var(--theme-muted, #a1a1aa);
  font-size: 12px;
  font-weight: 450;
  white-space: nowrap;
}

.google-auth-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
}

.google-auth-button {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-switch {
  margin: 4px 0 0;
  color: var(--theme-muted, #71717a);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  color: var(--theme-blue-ink, #2563eb);
  font-weight: 550;
  text-decoration: none;
  transition: color 120ms ease;
}

.auth-switch a:hover {
  text-decoration: underline;
  color: var(--theme-blue-ink, #1d4ed8);
}

.auth-resend {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin: 8px 0 14px;
}

.auth-resend-button {
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--theme-border, #e4e4e7);
  border-radius: 8px;
  background: var(--theme-surface, #fff);
  color: var(--theme-copy, #3f3f46);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.auth-resend-button:hover:not(:disabled) {
  border-color: var(--theme-blue-border, #c7d2fe);
  background: var(--theme-surface, #f8faff);
  color: var(--theme-blue-ink, #1d4ed8);
}

.auth-resend-button:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-resend-button:disabled {
  border-color: var(--theme-border, #ececf0);
  background: var(--theme-surface, #fafafa);
  color: var(--theme-muted, #a1a1aa);
  cursor: default;
}

.auth-resend-hint {
  color: var(--theme-muted, #a1a1aa);
  font-size: 11px;
  line-height: 1.35;
}

.auth-guest-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.auth-guest-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--theme-muted, #71717a);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 130ms ease, background 130ms ease;
}

.auth-guest-link:hover {
  color: var(--theme-ink, #09090b);
  background: var(--theme-surface-soft, #f4f4f5);
}

[data-theme="dark"] .auth-guest-link,
html.dark .auth-guest-link {
  color: #94a3b8;
}

[data-theme="dark"] .auth-guest-link:hover,
html.dark .auth-guest-link:hover {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.7);
}

.auth-guest-link svg {
  transition: transform 130ms ease;
}

.auth-guest-link:hover svg {
  transform: translateX(2px);
}

.auth-terms {
  margin: 6px 0 0;
  color: var(--theme-muted, #a1a1aa);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.auth-legal-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--theme-blue-ink, #6366f1);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  display: inline;
}

.auth-legal-link:hover {
  color: var(--theme-blue-ink, #4f46e5);
}

.auth-error,
.settings-form-message {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--theme-danger-surface, #fef2f2);
  border: 1px solid var(--theme-danger-border, #fee2e2);
  color: var(--theme-danger-ink, #b91c1c);
  font-size: 12.5px;
  font-weight: 500;
}

.auth-success {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 8px 0;
}

.auth-success > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(35, 133, 103, 0.1);
  color: var(--success);
  font-weight: 700;
}

.auth-success h3,
.auth-success p { margin: 0; }
.auth-success p { color: var(--text-secondary); font-size: 13px; }

/* Onboarding Personalization Step (Step 2) */
.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.onboarding-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-ink, #09090b);
  letter-spacing: -0.01em;
}

[data-theme="dark"] .onboarding-label,
html.dark .onboarding-label {
  color: #f1f5f9;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.onboarding-grid-roles,
.onboarding-grid-goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 680px) {
  .onboarding-grid,
  .onboarding-grid-roles,
  .onboarding-grid-goals {
    grid-template-columns: 1fr;
  }
}

.onboarding-card {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}

.onboarding-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-card-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 80px;
  gap: 6px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1.5px solid var(--theme-border, #e4e4e7);
  background: var(--theme-surface, #ffffff);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.onboarding-card:hover .onboarding-card-inner {
  border-color: var(--theme-border-strong, #cbd5e1);
  background: var(--theme-surface-soft, #f8fafc);
  transform: translateY(-1px);
}

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

.onboarding-card-check {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--theme-border, #cbd5e1);
  flex-shrink: 0;
  transition: all 140ms ease;
}

.onboarding-card input:checked + .onboarding-card-inner {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 1.5px #2563eb, 0 4px 14px -2px rgba(37, 99, 235, 0.15);
}

.onboarding-card input:checked + .onboarding-card-inner .onboarding-card-check {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.onboarding-card-inner strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--theme-ink, #09090b);
}

.onboarding-card-inner small {
  font-size: 11.5px;
  color: var(--theme-muted, #71717a);
  line-height: 1.35;
}

[data-theme="dark"] .onboarding-card-inner,
html.dark .onboarding-card-inner {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="dark"] .onboarding-card-check,
html.dark .onboarding-card-check {
  border-color: #334155;
}

[data-theme="dark"] .onboarding-card:hover .onboarding-card-inner,
html.dark .onboarding-card:hover .onboarding-card-inner {
  border-color: #334155;
  background: rgba(30, 41, 59, 0.6);
}

[data-theme="dark"] .onboarding-card input:checked + .onboarding-card-inner,
html.dark .onboarding-card input:checked + .onboarding-card-inner {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.18);
  box-shadow: 0 0 0 1.5px #3b82f6, 0 0 22px -3px rgba(59, 130, 246, 0.28);
}

[data-theme="dark"] .onboarding-card input:checked + .onboarding-card-inner .onboarding-card-check,
html.dark .onboarding-card input:checked + .onboarding-card-inner .onboarding-card-check {
  border-color: #3b82f6;
  background: #3b82f6;
  box-shadow: inset 0 0 0 3px #0f172a;
}

[data-theme="dark"] .onboarding-card-inner strong,
html.dark .onboarding-card-inner strong {
  color: #f1f5f9;
}

[data-theme="dark"] .onboarding-card-inner small,
html.dark .onboarding-card-inner small {
  color: #94a3b8;
}

.onboarding-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.onboarding-actions .auth-submit,
.onboarding-actions .auth-skip-btn {
  height: 44px;
  min-width: 120px;
  padding: 0 22px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}

@media (max-width: 640px) {
  .onboarding-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }
  .onboarding-actions .auth-submit,
  .onboarding-actions .auth-skip-btn {
    width: 100%;
    height: 44px;
    font-size: 14px;
  }
}

.auth-skip-btn {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--theme-border, #e4e4e7);
  background: transparent;
  color: var(--theme-muted, #71717a);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  padding: 0 16px;
}

.auth-skip-btn:hover {
  background: var(--theme-surface-soft, #f4f4f5);
  color: var(--theme-ink, #09090b);
  border-color: var(--theme-border-strong, #cbd5e1);
}

[data-theme="dark"] .auth-skip-btn,
html.dark .auth-skip-btn {
  border-color: rgba(255, 255, 255, 0.09);
  color: #94a3b8;
}

[data-theme="dark"] .auth-skip-btn:hover,
html.dark .auth-skip-btn:hover {
  background: rgba(30, 41, 59, 0.7);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.18);
}

/* Step 3: Workspace Overview */
.onboarding-overview-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 10px 0 16px;
}

@media (max-width: 720px) {
  .onboarding-overview-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 8px 0 14px;
  }
  .onboarding-overview-card {
    padding: 16px 14px;
  }
  .onboarding-overview-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .onboarding-overview-icon svg {
    width: 18px;
    height: 18px;
  }
}

.onboarding-overview-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 18px;
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e4e4e7);
  box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.05);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.onboarding-overview-card:hover {
  transform: translateY(-2px);
  border-color: var(--theme-border-strong, #cbd5e1);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.onboarding-overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  margin-bottom: 4px;
}

.onboarding-overview-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--theme-ink, #09090b);
  letter-spacing: -0.01em;
}

.onboarding-overview-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.48;
  color: var(--theme-muted, #71717a);
}

.onboarding-overview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.onboarding-enter-btn {
  width: auto;
  min-width: 220px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .onboarding-overview-actions {
    justify-content: stretch;
  }
  .onboarding-enter-btn {
    width: 100%;
  }
}

[data-theme="dark"] .onboarding-overview-card,
html.dark .onboarding-overview-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .onboarding-overview-card:hover,
html.dark .onboarding-overview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .onboarding-overview-icon,
html.dark .onboarding-overview-icon {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .onboarding-overview-title,
html.dark .onboarding-overview-title {
  color: #f8fafc;
}

[data-theme="dark"] .onboarding-overview-desc,
html.dark .onboarding-overview-desc {
  color: #94a3b8;
}

/* Auth Footer */
.auth-footer {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 24px 28px;
  font-size: 12px;
  color: var(--theme-muted, #a1a1aa);
}

.auth-copyright {
  color: var(--theme-muted, #a1a1aa);
}

.auth-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--theme-muted, #a1a1aa);
}

.auth-footer-link {
  color: var(--theme-muted, #a1a1aa);
  text-decoration: none;
  transition: color 120ms ease;
}

.auth-footer-link:hover {
  color: var(--theme-ink, #09090b);
  text-decoration: underline;
}

[data-theme="dark"] .auth-footer-link:hover,
html.dark .auth-footer-link:hover {
  color: #f1f5f9;
}

/* Responsive adjustments for Auth & Onboarding flow */
@media (max-width: 680px) {
  .auth-top-bar {
    padding: 12px 16px;
  }
  .auth-panel {
    padding: 10px 14px 28px;
  }
  .auth-card {
    padding: 20px 16px 22px;
    border-radius: 16px;
  }
  .auth-header {
    margin-bottom: 16px;
  }
  .auth-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .auth-header p {
    font-size: 12.5px;
  }
  .auth-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 14px 16px 24px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 18px 12px 20px;
    border-radius: 14px;
  }
  .onboarding-card-inner {
    padding: 10px 12px;
    min-height: 64px;
  }
  .onboarding-card-inner strong {
    font-size: 12.5px;
  }
  .onboarding-card-inner small {
    font-size: 11px;
  }
}

/* Account and security settings */
.account-chevron { margin-left: auto; }

.workspace-settings {
  overflow-y: auto;
  display: block;
  padding: 0;
}

.settings-view {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.settings-top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 24px;
}

.settings-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 9999px;
  border: 1px solid var(--theme-border, #e2e8f0);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-copy, #475569);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.settings-back-btn:hover {
  background: #f8fafc;
  border-color: var(--theme-border-strong, #cbd5e1);
  color: var(--theme-ink, #0f172a);
  transform: translateX(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.settings-back-btn:active {
  transform: translateX(-1px) scale(0.98);
}

.settings-back-icon {
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.settings-back-btn:hover .settings-back-icon {
  transform: translateX(-2px);
}

[data-theme="dark"] .settings-back-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  box-shadow: none;
}

[data-theme="dark"] .settings-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

.settings-header {
  max-width: 680px;
}

.settings-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.settings-header h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
}

.settings-header p,
.settings-panel-intro {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

.settings-tabs {
  display: none !important;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 5px;
  border: 1px solid rgba(20, 27, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: inherit;
  flex-shrink: 0;
}

.settings-tab-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
}

.settings-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.settings-tab.is-active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.settings-panels {
  display: grid;
  gap: 20px;
}

.settings-panel {
  position: relative;
  overflow: visible;
  padding: 28px 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.settings-panel::before {
  display: none;
}

.settings-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.settings-panel-intro {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 20px;
}

/* Guest Sync Banner */
.guest-sync-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.guest-sync-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.guest-sync-badge,
.guest-sync-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.guest-sync-badge svg,
.guest-sync-icon svg {
  width: 20px;
  height: 20px;
}

.guest-sync-copy,
.guest-sync-text {
  flex: 1;
  min-width: 0;
}

.guest-sync-copy strong,
.guest-sync-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.guest-sync-copy p,
.guest-sync-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

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

.guest-sync-actions .primary-button,
.guest-sync-actions .secondary-button {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 550;
  border-radius: 8px;
  margin-top: 0;
}

.guest-account-panel { margin-top: 30px; }
.guest-account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* AI Account Summary Card (Powered by GPT-5.6 Luna) */
.ai-account-summary-card {
  display: block;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 20px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.04);
}

.ai-account-summary-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.08);
}

.ai-account-summary-card.is-disabled-state {
  border: 1px dashed var(--border-subtle, #cbd5e1);
  background: var(--bg-soft, #f8fafc);
  box-shadow: none;
}

.ai-account-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-summary-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-summary-sparkle-icon {
  color: #6366f1;
  flex-shrink: 0;
}

.ai-summary-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

.ai-summary-model-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.16) 100%);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.ai-summary-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: all 140ms ease;
}

.ai-summary-refresh-btn:hover:not([disabled]) {
  border-color: #6366f1;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.05);
}

.ai-summary-refresh-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.ai-summary-refresh-icon.is-spinning {
  animation: aiSummarySpin 1s linear infinite;
}

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

.ai-summary-content {
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.65;
  color: var(--text, #1e293b);
  margin: 0 0 14px 0;
}

.ai-summary-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-summary-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.08);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.ai-summary-footer-note {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  margin-top: 14px;
}

.ai-summary-disabled-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #475569);
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.ai-summary-enable-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
}

/* Skeleton loader */
.ai-summary-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.ai-summary-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: aiSummaryShimmer 1.5s infinite;
}

.ai-summary-skeleton-line.is-title {
  width: 75%;
}

.ai-summary-skeleton-line.is-short {
  width: 45%;
}

.ai-summary-skeleton-tags {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ai-summary-skeleton-tag {
  width: 70px;
  height: 24px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: aiSummaryShimmer 1.5s infinite;
}

@keyframes aiSummaryShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ai-summary-error-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.ai-summary-error-text {
  font-size: 0.84rem;
  color: #dc2626;
  margin: 0;
}

/* Account Profile Card (Collapsible Accordion with chevron) */
.account-profile-card {
  display: block;
  padding: 0;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.account-profile-card:hover {
  border-color: var(--theme-border, rgba(20, 27, 42, 0.18));
}

.account-profile-card[open] {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.28));
  box-shadow: 0 4px 20px var(--theme-shadow-soft, rgba(31, 41, 55, 0.04));
}

.account-profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--bg-soft);
  transition: background-color 140ms ease;
}

.account-profile-summary:hover {
  background: var(--bg-elevated);
}

.account-profile-summary::-webkit-details-marker {
  display: none;
}

.account-profile-card .experience-accordion-icon {
  margin-left: auto;
}

.account-profile-card[open] .experience-chevron {
  transform: rotate(180deg);
}

.account-profile-card[open] .experience-accordion-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.account-profile-body {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border-subtle);
  animation: experienceAccordionSlide 160ms ease-out;
}

.account-profile-body .account-settings-form {
  margin: 0;
  padding: 0;
}

.account-profile-body .guest-sync-banner {
  margin-bottom: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.account-profile-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 110, 232, 0.25);
}

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

.account-profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-profile-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.account-badge.is-verified {
  background: rgba(35, 133, 103, 0.12);
  color: var(--success);
  border: 1px solid rgba(35, 133, 103, 0.25);
}

.account-badge.is-guest {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.account-profile-role {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Visual Theme Picker Studio */
.settings-theme-studio {
  margin: 22px 0 16px;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
}

.settings-theme-studio.experience-accordion {
  padding: 0;
  margin: 0;
  background: var(--theme-surface, #ffffff);
}

.theme-studio-header strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.theme-studio-header p {
  margin: 3px 0 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-preview-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-preview-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.theme-preview-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.theme-preview-canvas {
  height: 72px;
  border-radius: 8px;
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.theme-preview-canvas.is-light {
  background: #f8fafc;
}

.theme-preview-canvas.is-dark {
  background: #0b0f17;
}

.preview-mock-rail {
  width: 16px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.2);
}

.preview-mock-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-mock-line {
  height: 7px;
  width: 55%;
  border-radius: 3px;
  background: rgba(100, 116, 139, 0.25);
}

.preview-mock-box {
  flex: 1;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.15);
}

.theme-card-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
}

.theme-card-caption strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.theme-card-dot.is-light { background: #f59e0b; }
.theme-card-dot.is-dark { background: #6366f1; }

.theme-card-radio {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  margin-left: auto;
  position: relative;
  transition: all 140ms ease;
}

.theme-preview-card.is-active .theme-card-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.theme-preview-card.is-active .theme-card-radio::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* Diagnostics and Storage Card */
.settings-diagnostic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  margin-top: 20px;
}

.diagnostic-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.diagnostic-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Security Health Card & Session Inspector */
.security-health-card {
  margin-bottom: 20px;
}

.security-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.security-badge-tile {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.security-badge-tile .tile-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.security-badge-tile strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.security-badge-tile p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.security-session-card {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.session-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-device-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

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

.session-device-info strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.session-device-info p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.session-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--success);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(35, 133, 103, 0.1);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(35, 133, 103, 0.3);
}

/* Legal Hero Banner */
.legal-hero-banner {
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.legal-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.legal-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-trust-pill {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.settings-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.account-settings-form {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-settings-form .settings-field:nth-child(3) { grid-column: 1 / -1; }
.account-settings-form .primary-button { grid-column: 1 / -1; }
.account-settings-form .settings-form-message { grid-column: 1 / -1; }

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field-label,
.settings-field > span {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Premium Universal Settings Inputs */
.settings-input,
.settings-field input,
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  outline: none;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.settings-input:hover,
.settings-field input:hover,
.settings-form input:hover {
  border-color: var(--border-hover);
}

.settings-input:focus,
.settings-field input:focus,
.settings-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-elevated);
}

.settings-input::placeholder,
.settings-field input::placeholder {
  color: var(--text-tertiary);
  font-size: 13px;
}

.settings-textarea {
  min-height: 96px;
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

.settings-select {
  height: 42px;
  padding: 0 12px;
  cursor: pointer;
  appearance: auto;
}

.settings-form .primary-button {
  justify-self: start;
  margin-top: 4px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
}

.settings-form-message {
  margin: 0;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 8px;
}
.settings-form-message.is-success {
  background: rgba(35, 133, 103, 0.09);
  color: var(--success);
  border: 1px solid rgba(35, 133, 103, 0.2);
}
.settings-form-message.is-error {
  background: rgba(198, 79, 79, 0.09);
  color: var(--danger);
  border: 1px solid rgba(198, 79, 79, 0.2);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.settings-toggle-copy strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.settings-toggle-copy p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.settings-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  background: var(--theme-surface-muted, #d4d4d8);
  border: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.settings-toggle.is-active { background: var(--accent); }
.settings-toggle:focus-visible { outline: 3px solid var(--theme-blue-border, rgba(79, 110, 232, 0.2)); outline-offset: 2px; }
.settings-toggle:disabled { cursor: wait; opacity: 0.65; }

.settings-toggle-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-surface, #fff);
  box-shadow: 0 1px 3px var(--theme-shadow-strong, rgba(31, 41, 55, 0.24));
  transition: transform 160ms ease;
}

.settings-toggle.is-active .settings-toggle-thumb { transform: translateX(18px); }

.settings-signout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.settings-signout strong { font-size: 13.5px; }
.settings-signout p { margin: 2px 0 0; color: var(--text-tertiary); font-size: 11.5px; }
.danger-button {
  padding: 9px 18px;
  border-radius: 9px;
  background: rgba(198, 79, 79, 0.08);
  color: var(--theme-danger-ink, #a23d3d);
  font-size: 12.5px;
  font-weight: 550;
  border: 1px solid var(--theme-danger-border, rgba(198, 79, 79, 0.18));
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 105px;
  text-align: center;
  transition: all 0.18s ease;
}
.danger-button:hover { background: rgba(198, 79, 79, 0.14); color: var(--theme-danger-ink, #8b2828); border-color: var(--theme-danger-border, rgba(198, 79, 79, 0.28)); }

.settings-danger-zone {
  border-top: 1px solid var(--theme-danger-border, rgba(220, 38, 38, 0.12));
  background: rgba(var(--theme-danger-rgb, 254, 242, 242), 0.4);
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--theme-danger-border, rgba(220, 38, 38, 0.15));
  margin-top: 22px;
}

.settings-danger-zone.is-pending-deletion {
  background: rgba(var(--theme-warning-rgb, 254, 249, 195), 0.45);
  border-color: var(--theme-warning-border, rgba(202, 138, 4, 0.25));
}

.danger-zone-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.text-danger { color: var(--theme-danger-ink, #dc2626); }
.text-warning { color: var(--theme-warning-ink, #b45309); }

.experience-restore-btn {
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #1e293b);
  border: 1px solid var(--theme-border, #cbd5e1);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 9px 18px;
}
.experience-restore-btn:hover {
  background: var(--theme-surface, #f8fafc);
  border-color: var(--theme-border-strong, #94a3b8);
}

/* Guest Experience Preview Card & Mode Options */
.experience-preview-card {
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.experience-preview-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.experience-preview-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.experience-preview-badge svg {
  width: 20px;
  height: 20px;
}

.experience-preview-header strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 3px;
}

.experience-preview-header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.experience-preview-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 16px;
}

.preview-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.preview-feature-bullet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(35, 133, 103, 0.12);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.experience-preview-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.experience-preview-cta .primary-button {
  height: 38px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
}

.experience-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.experience-mode-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  text-align: left;
  cursor: pointer;
  transition: all 140ms ease;
}

.experience-mode-option:hover {
  border-color: var(--border-hover);
  background: var(--bg-soft);
}

.experience-mode-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.experience-mode-option strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.experience-mode-option p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Settings Security Tab for Guests */
.settings-security-card {
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.security-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.security-badge svg {
  width: 20px;
  height: 20px;
}

.security-card-header strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 3px;
}

.security-card-header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.security-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-card-actions .primary-button,
.security-card-actions .secondary-button {
  height: 38px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 550;
  border-radius: 8px;
  margin-top: 0;
}

/* Settings Legal Tab */
.settings-legal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-legal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 140ms ease;
}

.settings-legal-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.settings-legal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.settings-legal-icon svg {
  width: 18px;
  height: 18px;
}

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

.settings-legal-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.settings-legal-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.settings-legal-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 140ms ease, color 140ms ease;
}

.settings-legal-card:hover .settings-legal-chevron {
  transform: translateX(2px);
  color: var(--text-primary);
}

.settings-legal-notice {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
}

.settings-legal-notice p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Delete Account Modal */
.delete-account-modal-card {
  max-width: 540px;
}

.delete-account-modal-body {
  padding: 22px 28px 24px;
}

.delete-account-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid var(--theme-danger-border, rgba(220, 38, 38, 0.15));
  margin-bottom: 20px;
}

.delete-callout-icon {
  font-size: 18px;
  line-height: 1.2;
}

.delete-callout-copy {
  font-size: 13px;
  color: var(--theme-danger-ink, #991b1b);
  line-height: 1.5;
}

.delete-rules-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.delete-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.delete-rule-bullet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-copy, #475569);
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.delete-rule-item div {
  flex: 1;
}

.delete-rule-item strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary, #0f172a);
  margin-bottom: 2px;
}

.delete-rule-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
}

.delete-modal-footer {
  gap: 12px;
}

.delete-confirm-btn {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid transparent;
  padding: 9px 18px;
  font-weight: 600;
}
.delete-confirm-btn:hover {
  background: #b91c1c;
  color: #ffffff;
}

/* ==========================================================================
   Experience Dashboard (Minimalist & Premium)
   ========================================================================== */

.settings-experience-panel {
  max-width: 820px;
}

.experience-settings-form,
.experience-cards-stack {
  max-width: 100%;
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.experience-category-section {
  display: grid;
  gap: 12px;
}

.experience-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 2px;
}

.experience-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft, rgba(79, 110, 232, 0.1));
  color: var(--accent, #4f6ee8);
  flex-shrink: 0;
}

.experience-category-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.experience-category-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.experience-category-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.experience-category-cards {
  display: grid;
  gap: 12px;
}

.experience-personalization-group {
  display: grid;
  gap: 28px;
}

.experience-personalization-group.is-collapsed {
  display: none !important;
}

.experience-hero-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--theme-surface, #f8faff);
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.16));
  margin: 0;
}

.experience-hero-left strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-ink, #1e293b);
  letter-spacing: -0.01em;
}

.experience-hero-left p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
  line-height: 1.45;
}

/* Collapsible Accordion Cards */
.experience-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--theme-surface, #ffffff);
  overflow: hidden;
  margin: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.experience-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 6px;
}

.experience-accordion:hover {
  border-color: var(--theme-border, rgba(20, 27, 42, 0.18));
}

.experience-accordion[open] {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.28));
  box-shadow: 0 4px 20px var(--theme-shadow-soft, rgba(31, 41, 55, 0.04));
}

.experience-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--theme-surface, #ffffff);
  transition: background-color 140ms ease;
}

.experience-accordion-summary:hover {
  background: var(--theme-surface, #fbfcfd);
}

.experience-accordion-summary::-webkit-details-marker {
  display: none;
}

.experience-accordion-left {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.experience-accordion-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.experience-accordion-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.experience-summary-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(79, 110, 232, 0.08);
  color: var(--theme-blue-ink, var(--accent));
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.16));
  letter-spacing: -0.01em;
}

.experience-accordion-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.experience-accordion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background-color 160ms ease, color 160ms ease;
}

.experience-chevron {
  width: 16px;
  height: 16px;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.experience-accordion[open] .experience-chevron {
  transform: rotate(180deg);
}

.experience-accordion[open] .experience-accordion-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.experience-accordion-content {
  padding: 16px 20px 22px;
  border-top: 1px solid var(--theme-border, rgba(20, 27, 42, 0.06));
  animation: experienceAccordionSlide 160ms ease-out;
}

@keyframes experienceAccordionSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.experience-grid-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

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

/* Tone Selector Grid (Minimalist & Sleek) */
.experience-tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.experience-tone-card {
  position: relative;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.1));
  background: var(--theme-surface, #ffffff);
  cursor: pointer;
  outline: none;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.experience-tone-card:hover {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.35));
  box-shadow: 0 4px 12px var(--theme-shadow-soft, rgba(31, 41, 55, 0.04));
  transform: translateY(-1px);
}

.experience-tone-card.is-selected {
  border-color: var(--accent);
  background: var(--theme-surface, #f8faff);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.tone-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tone-card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--theme-wash, rgba(20, 27, 42, 0.04));
  color: var(--text-primary);
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.experience-tone-card.is-selected .tone-card-icon-wrap {
  background: rgba(79, 110, 232, 0.12);
  color: var(--theme-blue-ink, var(--accent));
}

.tone-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
}

.tone-card-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--theme-border, rgba(20, 27, 42, 0.18));
  margin-left: auto;
  position: relative;
  transition: all 150ms ease;
}

.experience-tone-card.is-selected .tone-card-check {
  border-color: var(--accent);
  background: var(--accent);
}

.experience-tone-card.is-selected .tone-card-check::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-surface, #ffffff);
}

.tone-card-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Memory Hub — Quiet, editorial and purposefully compact. */
.experience-memory-wrapper {
  display: grid;
  gap: 12px;
}

.experience-memory-filters {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.08));
  border-radius: 10px;
  background: var(--theme-surface, #f8fafc);
  scrollbar-width: none;
}

.experience-memory-filters::-webkit-scrollbar {
  display: none;
}

.experience-memory-filters.is-collapsed,
.experience-memory-list.is-collapsed {
  display: none;
}

.memory-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--theme-muted, #64748b);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.memory-filter-btn:hover {
  color: var(--theme-copy, #334155);
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.72);
}

.memory-filter-btn.is-active {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.12));
  background: var(--theme-surface, #ffffff);
  color: var(--theme-blue-ink, var(--accent));
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
}

.memory-filter-count {
  min-width: 15px;
  color: var(--theme-muted, #94a3b8);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.memory-filter-btn.is-active .memory-filter-count {
  color: var(--theme-blue-ink, rgba(79, 110, 232, 0.74));
}

.experience-memory-list {
  display: grid;
  gap: 6px;
  max-height: 310px;
  overflow-y: auto;
  padding: 1px 2px 1px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

.experience-memory-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.09));
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 1px 1px var(--theme-shadow-soft, rgba(15, 23, 42, 0.015));
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.experience-memory-item:hover {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.24));
  box-shadow: 0 3px 10px var(--theme-shadow-soft, rgba(31, 41, 55, 0.045));
}

.memory-item-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.memory-category-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.015em;
  line-height: 1.1;
  flex-shrink: 0;
}

.tag-business { background: var(--theme-blue-surface, #eff6ff); color: var(--theme-blue-ink, #1d4ed8); }
.tag-audience { background: var(--theme-surface-soft, #fefce8); color: var(--theme-warning-ink, #854d0e); }
.tag-preference { background: var(--theme-surface, #faf5ff); color: var(--theme-purple-ink, #7e22ce); }
.tag-constraint { background: var(--theme-danger-surface, #fef2f2); color: var(--theme-danger-ink, #b91c1c); }
.tag-general { background: var(--theme-surface-soft, #f1f5f9); color: var(--theme-copy, #475569); }

.memory-text {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.42;
  word-break: break-word;
  padding-top: 1px;
}

.memory-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--theme-muted, #a3afc2);
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  opacity: 0.34;
  flex-shrink: 0;
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.experience-memory-item:hover .memory-delete-btn,
.memory-delete-btn:focus-visible {
  opacity: 1;
}

.memory-delete-btn:hover {
  color: var(--theme-danger-ink, #ef4444);
  background: rgba(239, 68, 68, 0.08);
  opacity: 1;
}

.experience-memory-composer {
  display: block;
  padding: 14px;
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.13));
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(var(--theme-surface-rgb, 247, 249, 255), 0.92), var(--theme-surface, #ffffff) 72%);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.experience-memory-composer.is-collapsed {
  display: none;
}

.experience-memory-composer.is-open {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.18));
  box-shadow: 0 6px 18px rgba(79, 110, 232, 0.045);
}

.experience-memory-composer-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 1px 11px;
}

.experience-memory-composer-heading-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.memory-composer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.2));
  border-radius: 9px;
  background: transparent;
  color: var(--theme-muted, #94a3b8);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.memory-composer-toggle:hover {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.38));
  background: rgba(79, 110, 232, 0.14);
  transform: translateY(-1px);
}

.experience-memory-composer.is-open .memory-composer-toggle {
  background: var(--theme-wash, rgba(20, 27, 42, 0.045));
  color: var(--theme-muted, #64748b);
}

.experience-memory-composer-title {
  color: var(--theme-copy, #334155);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.experience-memory-composer-hint {
  color: var(--theme-muted, #94a3b8);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: right;
}

.experience-add-memory-row {
  display: flex;
  gap: 9px;
  align-items: center;
}

.experience-add-memory-row .settings-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border-color: var(--theme-border, rgba(20, 27, 42, 0.11));
  border-radius: 10px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.88);
  box-shadow: 0 1px 1px var(--theme-shadow-soft, rgba(15, 23, 42, 0.018));
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.experience-add-memory-row .settings-input:hover {
  border-color: var(--theme-border, rgba(20, 27, 42, 0.2));
  background: var(--theme-surface, #ffffff);
}

.experience-add-memory-row .settings-input:focus {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.62));
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 0 0 3px rgba(79, 110, 232, 0.09), 0 3px 10px rgba(79, 110, 232, 0.045);
}

.experience-add-memory-row input.settings-input::placeholder {
  color: var(--theme-muted, #9aa9c2);
  font-size: 12.5px;
}

.experience-add-memory-row .settings-select {
  width: 156px;
  flex-shrink: 0;
}

.experience-add-btn {
  height: 40px;
  padding: 0 17px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 650;
  border-radius: 9px;
}

.experience-memory-action-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px;
}

.experience-memory-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.experience-memory-primary-actions .memory-add-action-btn,
.experience-memory-primary-actions .experience-import-inline-btn {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  margin-top: 0;
  border-radius: 9px;
  font-size: 13px;
  align-self: center;
}

.experience-memory-primary-actions .memory-add-action-btn:hover {
  transform: none;
}

.memory-add-action-btn {
  padding: 0 16px;
  box-shadow: 0 4px 12px rgba(49, 87, 213, 0.14);
}

.experience-memory-primary-actions .experience-import-inline-btn {
  padding: 0 16px;
}

.danger-text-button {
  background: none;
  border: none;
  color: var(--theme-muted, #94a3b8);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: none;
  transition: color 140ms ease;
}

.danger-text-button:hover {
  color: var(--theme-danger-ink, #dc2626);
  text-decoration: underline;
}

.experience-memory-empty {
  margin: 0;
  padding: 24px 16px;
  border: 1px dashed var(--theme-border, rgba(100, 116, 139, 0.22));
  border-radius: 12px;
  background: var(--theme-surface, #fbfcfd);
  font-size: 12.5px;
  color: var(--text-tertiary);
  text-align: center;
}

@media (max-width: 640px) {
  .experience-memory-wrapper {
    gap: 10px;
  }

  .experience-memory-filters {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .memory-filter-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding-inline: 9px;
  }

  .experience-memory-list {
    max-height: min(48vh, 360px);
    padding-right: 1px;
  }

  .experience-memory-item {
    gap: 8px;
    padding: 10px 8px 10px 9px;
  }

  .memory-item-content {
    display: grid;
    grid-template-columns: minmax(80px, 88px) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .memory-category-tag {
    min-width: 0;
    width: 100%;
  }

  .memory-text {
    font-size: 12.5px;
  }

  .experience-memory-composer-heading-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .experience-memory-composer-hint {
    text-align: left;
  }

  .experience-add-memory-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .experience-add-memory-row .settings-select {
    width: 100%;
  }

  .experience-add-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .memory-item-content {
    gap: 8px;
  }

  .experience-memory-action-area,
  .experience-memory-primary-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .experience-memory-primary-actions .primary-button,
  .experience-memory-primary-actions .secondary-button {
    width: 100%;
  }
}

.experience-save-btn {
  height: 44px;
  padding: 0 24px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  justify-self: start;
  margin-top: 10px;
}

/* ==========================================================================
   Import Memory — Compact
   ========================================================================== */

.import-memory-modal-card {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  border-radius: 18px;
  overflow: hidden;
}

.import-memory-modal-header {
  padding: 20px 22px 17px;
}

.import-memory-modal-header .legal-modal-title-group h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.import-memory-modal-header .legal-modal-title-group p {
  margin-top: 4px;
  max-width: 480px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.import-memory-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 22px;
  overflow-y: auto;
}

.import-step {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.import-step:last-child {
  border-bottom: 0;
}

.import-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 12px;
}

.import-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.import-step-heading strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.import-step-heading p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-tertiary);
}

/* Prompt */

.import-prompt-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 33px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-soft);
}

.import-prompt-preview {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-tertiary);
}

.import-copy-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
}

.import-copy-btn.is-copied {
  color: var(--theme-success-ink, #15803d);
}

/* Paste area */

.import-textarea {
  display: block;
  width: calc(100% - 33px);
  min-height: 112px;
  margin-left: 33px;
  padding: 11px 12px;
  resize: vertical;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

/* Preview */

.import-preview-container {
  margin-left: 33px;
}

.import-preview-empty {
  margin: 0;
  padding: 13px 14px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
  background: var(--bg-soft);
}

.import-warning-box,
.import-sensitive-alert {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.45;
}

.import-warning-box {
  border: 1px solid var(--theme-warning-border, #fde68a);
  background: var(--theme-surface-soft, #fffbeb);
  color: var(--theme-warning-ink, #92400e);
}

.import-warning-box strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.import-warning-box p {
  margin: 0;
}

.import-sensitive-alert {
  margin-bottom: 10px;
  border: 1px solid var(--theme-warning-border, #fed7aa);
  background: var(--theme-surface-soft, #fff7ed);
  color: var(--theme-danger-ink, #9a3412);
}

/* Review sections */

.import-review-section {
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.import-review-section:first-child {
  padding-top: 0;
}

.import-review-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.import-section-subtitle {
  display: block;
  margin-bottom: 9px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-secondary);
}

.import-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-soft);
  font-size: 11px;
}

.import-chip-label {
  color: var(--text-tertiary);
}

.import-chip-val {
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Memory list */

.import-memories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.import-memories-header .import-section-subtitle {
  margin-bottom: 0;
}

.import-hint-text {
  color: var(--text-tertiary);
  font-size: 10.5px;
}

.import-memories-list {
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}

.import-memory-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.import-memory-item-row:last-child {
  border-bottom: 0;
}

.import-memory-item-row:hover {
  background: var(--bg-soft);
}

.import-memory-checkbox {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.import-memory-text {
  min-width: 0;
  flex: 1;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

/* Import options */

.import-options-box {
  padding-top: 13px;
}

.import-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.import-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.import-mode-option:hover {
  background: var(--bg-soft);
}

.import-mode-option.is-selected {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.4));
  background: rgba(79, 110, 232, 0.04);
}

.import-mode-radio {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.import-mode-text {
  min-width: 0;
}

.import-mode-text strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
}

.import-mode-text p {
  margin: 3px 0 0;
  color: var(--text-tertiary);
  font-size: 10.5px;
  line-height: 1.4;
}

.import-recommended {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(79, 110, 232, 0.08);
  color: var(--theme-blue-ink, var(--accent));
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.import-auto-enable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
}

.import-auto-enable-check {
  width: 14px;
  height: 14px;
}

/* Footer */

.import-modal-footer {
  padding: 14px 22px;
  gap: 8px;
}

.import-modal-footer .secondary-button,
.import-modal-footer .primary-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12px;
}

/* Settings import row */

.experience-import-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
}

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

.experience-import-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-soft);
  box-shadow: none;
  color: var(--text-secondary);
}

.experience-import-text {
  min-width: 0;
}

.experience-import-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
}

.experience-import-text p {
  margin: 2px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
}

.experience-import-trigger-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
}

/* Mobile */

@media (max-width: 600px) {
  .import-memory-modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 15px;
  }

  .import-memory-modal-header {
    padding: 17px 16px 14px;
  }

  .import-memory-modal-body {
    padding: 0 16px;
  }

  .import-step {
    padding: 16px 0;
  }

  .import-prompt-box,
  .import-preview-container {
    margin-left: 0;
  }

  .import-textarea {
    width: 100%;
    margin-left: 0;
  }

  .import-mode-selector {
    grid-template-columns: 1fr;
  }

  .import-modal-footer {
    padding: 12px 16px;
  }

  .experience-import-banner {
    align-items: flex-start;
  }

  .experience-import-text p {
    max-width: 260px;
  }
}

.import-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--theme-surface, #ffffff);
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  cursor: pointer;
  transition: all 140ms ease;
}

.import-mode-option.is-selected {
  border-color: var(--primary, #4f6ee8);
  background: rgba(79, 110, 232, 0.04);
}

.import-mode-radio {
  margin-top: 3px;
  accent-color: var(--primary, #4f6ee8);
}

.import-mode-text strong {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.import-mode-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

.import-auto-enable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
}

.import-auto-enable-check {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  order: 2;
}

.import-confirm-btn {
  height: 40px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
}

.ask-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ask-personalization-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--theme-blue-ink, var(--accent));
  background: rgba(79, 110, 232, 0.09);
  border: 1px solid var(--theme-blue-border, rgba(79, 110, 232, 0.2));
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 140ms ease;
}

.ask-personalization-badge:hover {
  background: rgba(79, 110, 232, 0.16);
  border-color: var(--accent);
  transform: translateY(-0.5px);
}

@media (max-width: 860px) {
  .auth-panel { padding: 24px 16px 40px; align-items: center; }
  .auth-container { width: 100%; max-width: 440px; margin: 0 auto; }
  .workspace-settings { padding: 0; }
  .settings-view { padding: 20px 14px 40px; }
  .settings-top-nav { margin-bottom: 16px; }
  .settings-panel { padding: 20px 16px; border-radius: 14px; }
  .settings-tabs {
    width: auto;
    max-width: calc(100vw - 20px);
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding: 4px;
    gap: 2px;
  }
  .settings-tab {
    padding: 6px 11px;
    min-height: 34px;
    font-size: 11.5px;
    gap: 5px;
  }
  .guest-sync-banner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .guest-sync-actions { width: 100%; }
  .guest-sync-actions button { width: 100%; }
  .experience-mode-options { grid-template-columns: 1fr; }
  .experience-tone-grid { grid-template-columns: 1fr; }
  .security-badges-grid { grid-template-columns: 1fr; }
  .session-card-header { flex-wrap: wrap; gap: 10px; }
  .settings-legal-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .settings-legal-row .secondary-button { width: 100%; justify-content: center; }
  .settings-legal-contact-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .legal-contact-email-btn { width: 100%; justify-content: center; box-sizing: border-box; }
  .experience-hero-toggle { padding: 14px 16px; gap: 14px; }
  .experience-hero-left strong { font-size: 13.5px; }
  .experience-hero-left p { font-size: 11.5px; }
  .experience-category-section { gap: 10px; }
  .experience-category-header { gap: 9px; padding: 0 1px 2px; }
  .experience-category-icon { width: 26px; height: 26px; border-radius: 7px; }
  .experience-category-title { font-size: 14px; }
  .experience-category-desc { font-size: 11.5px; }
  .experience-personalization-group { gap: 20px; }
  .experience-settings-form,
  .experience-cards-stack { gap: 20px; margin-top: 18px; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 14px 12px 32px; }
  .auth-card { padding: 22px 16px 26px; border-radius: 16px; }
  .auth-header h1 { font-size: 21px; }
  .auth-top-bar { padding: 16px 16px 6px; }
  .auth-footer { padding: 12px 16px 24px; flex-direction: column; text-align: center; gap: 8px; }
  .settings-signout { align-items: flex-start; flex-direction: column; gap: 12px; }
  .settings-signout button { width: 100%; }
  .settings-header h1 { font-size: clamp(22px, 5.5vw, 26px); }
  .settings-tab { padding: 5px 9px; font-size: 11px; min-height: 32px; gap: 4px; }
  .account-profile-card { padding: 0; }
  .account-profile-summary { padding: 14px 16px; gap: 12px; }
  .account-profile-body { padding: 14px 16px 18px; }
  .account-profile-avatar { width: 40px; height: 40px; font-size: 15px; }
  .account-settings-form { grid-template-columns: 1fr; }
  .account-settings-form .settings-field:nth-child(3) { grid-column: auto; }
  .theme-cards-grid { grid-template-columns: 1fr; }
  .experience-hero-toggle { padding: 12px 14px; gap: 10px; }
  .experience-hero-left strong { font-size: 13px; }
  .experience-hero-left p { font-size: 11px; line-height: 1.4; }
  .experience-category-header { gap: 8px; }
  .experience-category-title { font-size: 13px; }
  .experience-category-desc { font-size: 11px; }
  .experience-category-icon { width: 24px; height: 24px; border-radius: 6px; }
  .experience-category-icon svg { width: 14px; height: 14px; }
  .experience-form-actions { width: 100%; }
  .experience-save-btn { width: 100%; justify-content: center; }
  .experience-accordion-summary { padding: 13px 14px; gap: 10px; }
  .experience-accordion-title-row { gap: 6px; flex-wrap: wrap; }
  .experience-accordion-content { padding: 14px 14px 18px; }
  .settings-security-card { padding: 18px 16px; }
  .security-card-actions { width: 100%; flex-direction: column; }
  .security-card-actions button { width: 100%; }
}

/* Helmer v3.5 release page — reuses workspace surfaces and controls. */

/* Native-feeling Build / Ask home layout. Desktop rules stay untouched. */
@media (max-width: 767px) {
  html,
  body,
  .app-shell,
  .app-main {
    max-width: 100%;
    overflow-x: clip;
  }

  html:has(.ask-shell.is-empty),
  body:has(.ask-shell.is-empty),
  .app-shell:has(.ask-shell.is-empty) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-main {
    position: relative;
    min-height: 100dvh;
  }

  .app-main:has(.ask-shell.is-empty) {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Keep the open drawer above the mobile header and all composer controls. */
  .sidebar {
    z-index: 90;
  }

  body.sidebar-open .ask-composer-area,
  body.sidebar-open .planner-composer-card,
  body.sidebar-open .refinement-dock {
    pointer-events: none;
  }

  .mobile-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 0;
    padding: 0;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
    transition: background 180ms ease;
  }

  .mobile-header-intake {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    height: calc(48px + env(safe-area-inset-top));
    min-height: calc(48px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-header .icon-button,
  .mobile-header-intake .icon-button,
  .mobile-header-intake .mobile-new {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.9);
    border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.08));
    box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(31, 41, 55, 0.04));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary, #0f172a);
    transition: all 140ms ease;
  }

  .mobile-header-intake #mobileMenuButton {
    grid-column: 1;
    justify-self: start;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .mobile-header-spacer {
    grid-column: 3;
    width: 44px;
    height: 42px;
  }

  .mobile-header-intake .mobile-new {
    grid-column: 3;
    justify-self: end;
    display: none;
    padding: 0;
  }

  .mobile-header-intake .mobile-new:not([hidden]) {
    display: flex;
  }

  .mobile-header-intake .mobile-new svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    display: block;
  }

  .mobile-header-intake .mobile-new:active,
  .mobile-header-intake .icon-button:active {
    transform: scale(0.96);
    background: var(--bg-hover, #f1f5f9);
  }

  .mobile-header-intake #mobileMenuButton span {
    font-size: 21px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform: translateY(-2.5px);
    margin: 0;
    padding: 0;
  }

  /* Chat bar - hidden by default on intake, shown ONLY when .is-chat-active */
  .mobile-header-chat {
    display: none;
    align-items: center;
    justify-content: space-between;
    height: calc(62px + env(safe-area-inset-top));
    min-height: calc(62px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
  }

  .mobile-header-chat > * {
    pointer-events: auto;
  }

  /* Left: Combined group for hamburger menu and model selector dropdown */
  .mobile-chat-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Circular dark pill buttons (Left Menu and Right New Chat) */
  .mobile-header .mobile-menu-pill-btn,
  .mobile-header #mobileChatMenuButton,
  .mobile-header .mobile-new-pill-btn,
  .mobile-header .mobile-header-chat #mobileNewButton {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    background: rgba(24, 24, 27, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 0;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }

  .mobile-header .mobile-menu-pill-btn:active,
  .mobile-header #mobileChatMenuButton:active,
  .mobile-header .mobile-new-pill-btn:active,
  .mobile-header .mobile-header-chat #mobileNewButton:active {
    transform: scale(0.93);
    background: rgba(39, 39, 42, 0.92);
  }

  .mobile-menu-icon {
    display: block;
    width: 20px;
    height: 20px;
    color: #ffffff;
    stroke: currentColor;
    stroke-width: 2.2;
  }

  .mobile-header-chat #mobileNewButton svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2;
    display: block;
  }

  /* Model Selector Pill Dropdown */
  .mobile-model-pill-btn,
  .mobile-header #mobileChatModelButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    min-height: 42px;
    padding: 0 14px;
    max-width: 180px;
    border-radius: 999px;
    background: rgba(24, 24, 27, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.12);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
  }

  .mobile-model-pill-btn:active,
  .mobile-header #mobileChatModelButton:active {
    transform: scale(0.96);
    background: rgba(39, 39, 42, 0.92);
  }

  .mobile-active-model-name {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .mobile-header .mobile-mode-chevron {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 2.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.8;
    transition: transform 180ms ease, opacity 140ms ease;
  }

  .mobile-model-pill-btn:hover .mobile-mode-chevron,
  .mobile-model-pill-btn:active .mobile-mode-chevron,
  .mobile-model-pill-btn.is-open .mobile-mode-chevron {
    opacity: 1;
  }

  .mobile-model-pill-btn.is-open .mobile-mode-chevron {
    transform: rotate(180deg);
  }

  /* Active Chat Isolation Rules */
  .mobile-header.is-chat-active {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.42) 55%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
  }

  .mobile-header.is-chat-active .mobile-header-intake {
    display: none !important;
  }

  .mobile-header.is-chat-active .mobile-header-chat {
    display: flex !important;
  }

  .mobile-mode-switch {
    display: none;
  }

  .mobile-mode-switch:not([hidden]) {
    display: flex;
    align-items: center;
    width: auto;
    min-width: 176px;
    max-width: 236px;
    height: 38px;
    padding: 3px;
    margin: 0 auto;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.08));
    box-shadow: none;
    justify-self: center;
  }

  .mobile-mode-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1 1 0;
    width: auto;
    height: 100%;
    min-width: 0;
    padding: 0 10px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }

  .mobile-mode-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    color: currentColor;
    opacity: 0.65;
    transition: transform 160ms ease, opacity 160ms ease;
    flex-shrink: 0;
  }

  #askModeButton:not(.is-active) .mobile-mode-chevron {
    display: none;
  }

  #askModeButton:hover .mobile-mode-chevron,
  #askModeButton.is-active .mobile-mode-chevron {
    opacity: 0.95;
  }

  .mobile-mode-model {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    background: rgba(99, 128, 255, 0.14);
    color: var(--theme-blue-ink, #6380ff);
    letter-spacing: 0.02em;
    line-height: 1.2;
    flex-shrink: 0;
  }

  [data-theme="dark"] .mobile-mode-model,
  html.dark .mobile-mode-model {
    background: rgba(99, 128, 255, 0.2);
    color: #818cf8;
  }

  .mobile-mode-option:hover {
    color: var(--text-primary, #0f172a);
  }

  .mobile-mode-option.is-active {
    background: var(--theme-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    font-weight: 600;
    box-shadow: 0 1px 4px var(--theme-shadow-soft, rgba(31, 41, 55, 0.12)), 0 2px 6px var(--theme-shadow-soft, rgba(31, 41, 55, 0.04));
  }

  .mobile-brand {
    display: none;
  }

  .mobile-brand strong {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.045em;
  }

  .workspace,
  .workspace-ask,
  .ask-shell {
    min-height: calc(100dvh - 60px - env(safe-area-inset-top));
  }

  .workspace-centered {
    display: flex;
    min-height: calc(100dvh - 60px - env(safe-area-inset-top));
    padding: 0 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--bg-canvas);
  }

  .workspace-intake,
  .workspace-centered:has(.intake-view),
  .workspace-ask.is-empty,
  .workspace-ask:has(.ask-shell.is-empty) {
    background: var(--bg-canvas);
  }

  .workspace-centered .intake-view {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - 74px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    flex-direction: column;
    animation-duration: 260ms;
  }

  .workspace-centered .intake-intro {
    position: relative;
    display: grid;
    order: 1;
    width: 100%;
    max-width: 440px;
    min-height: 180px;
    flex: 1 1 auto;
    place-items: center;
    margin: 0 auto;
    text-align: center;
    isolation: isolate;
  }

  .workspace-centered .product-eyebrow {
    display: none;
  }

  .workspace-centered .intake-title {
    max-width: 440px;
    margin-inline: auto;
    font-size: clamp(28px, 7.8vw, 34px);
    font-weight: 450;
    letter-spacing: -0.035em;
    line-height: 1.2;
    text-wrap: wrap;
  }

  .workspace-centered .intake-description {
    display: none;
  }

  .workspace-centered .examples,
  .ask-suggestions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-centered .examples {
    order: 2;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 16px 2px 0;
  }

  .workspace-centered .examples::-webkit-scrollbar,
  .ask-suggestions::-webkit-scrollbar {
    display: none;
  }

  .workspace-centered .examples-label {
    display: none;
  }

  .workspace-centered .example-chip,
  .ask-suggestion {
    height: 38px;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid var(--theme-border, rgba(20, 27, 42, 0.09));
    border-radius: 14px;
    background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.78);
    box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(31, 41, 55, 0.03));
    color: var(--theme-ink, rgba(48, 56, 70, 0.78));
    font-size: 12.5px;
    font-weight: 500;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .workspace-centered .example-chip:active,
  .ask-suggestion:active {
    background: var(--accent-soft);
    transform: scale(0.98);
  }

  .workspace-centered .composer-card {
    display: grid;
    order: 3;
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    grid-template-columns: 40px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 10px;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.09));
    box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04)), 0 1px 2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.02));
  }

  .workspace-centered .composer-card:focus-within {
    border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
    box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
    outline: none;
  }

  .workspace-centered .composer-input {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-height: 24px;
    max-height: 144px;
    padding: 10px 0;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.5;
    align-self: center;
  }

  .workspace-centered .composer-input::placeholder {
    color: var(--theme-copy, rgba(89, 97, 111, 0.68));
  }

  .workspace-centered .composer-footer {
    display: contents;
  }

  .workspace-centered .composer-tools {
    grid-column: 1;
    grid-row: 1;
  }

  .workspace-centered .composer-tool {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-self: center;
  }

  .workspace-centered .composer-tool svg {
    width: 20px;
    height: 20px;
  }

  .workspace-centered .composer-submit {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    grid-column: 3;
    grid-row: 1;
    justify-content: center;
    align-self: center;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
  }

  .workspace-centered .composer-submit .button-arrow {
    font-size: 21px;
  }

  .workspace-centered .composer-hint {
    display: none;
  }

  .workspace-ask {
    padding: 0 16px;
    background: var(--bg-canvas);
  }

  .workspace-ask.is-empty,
  .workspace-intake.is-empty,
  .workspace.is-empty,
  .workspace:has(.ask-shell.is-empty),
  .workspace-ask:has(.ask-shell.is-empty) {
    flex: 1 1 auto;
    height: calc(100dvh - 60px - env(safe-area-inset-top));
    max-height: calc(100dvh - 60px - env(safe-area-inset-top));
    min-height: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 16px max(10px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    background: var(--bg-canvas);
  }

  .workspace-ask.is-empty::before,
  .workspace-intake.is-empty::before,
  .workspace.is-empty:has(.ask-shell.is-empty)::before,
  .workspace:has(.ask-shell.is-empty)::before,
  .workspace-ask:has(.ask-shell.is-empty)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(ellipse 135% 80% at 50% 100%, rgba(var(--theme-blue-rgb, 186, 220, 255), 0.7) 0%, rgba(var(--theme-blue-rgb, 219, 234, 254), 0.44) 34%, rgba(var(--theme-blue-rgb, 239, 246, 255), 0.2) 58%, transparent 82%),
      radial-gradient(ellipse 80% 45% at 50% 100%, rgba(var(--theme-blue-rgb, 147, 197, 253), 0.42) 0%, transparent 64%);
    transform-origin: 50% 100%;
    animation: mobile-gradient-bloom 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes mobile-gradient-bloom {
    0% {
      opacity: 0;
      transform: scale(0.6) translateY(24px);
    }
    40% {
      opacity: 0.75;
    }
    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .workspace-ask.has-messages,
  .workspace-ask:has(.ask-shell.has-messages) {
    background: var(--bg-canvas);
  }

  .ask-shell {
    width: 100%;
    max-width: 100%;
  }

  .ask-shell.is-empty {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0 auto;
    padding: 0;
    transform: none;
    overflow: hidden;
    box-sizing: border-box;
  }

  .ask-thread,
  .ask-shell.is-empty .ask-thread {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .ask-shell.is-empty .ask-thread {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
  }

  .ask-intro {
    position: relative;
    max-width: 430px;
    isolation: isolate;
  }

  .ask-shell.is-empty .ask-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 8px;
    text-align: center;
    isolation: isolate;
    transform: none;
    animation: mobile-cta-enter 800ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms;
  }

  .ask-shell.is-empty.has-input .ask-intro,
  .ask-shell.is-empty:has(.ask-input:not(:placeholder-shown)) .ask-intro {
    animation: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96) translateY(-8px);
    pointer-events: none;
  }

  @keyframes mobile-cta-enter {
    0% {
      opacity: 0;
      transform: translateY(14px) scale(0.97);
    }
    60% {
      opacity: 0.9;
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .ask-title {
    max-width: 440px;
    margin-inline: auto;
    font-size: clamp(28px, 7.8vw, 34px);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-wrap: wrap;
  }

  .ask-shell.is-empty .ask-title {
    max-width: 440px;
    margin-inline: auto;
    font-size: clamp(26px, 7.5vw, 32px);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.22;
    text-wrap: wrap;
    text-align: center;
    margin: 0;
  }

  .ask-subtitle {
    display: none;
  }

  .ask-composer-area {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 calc(12px + env(safe-area-inset-bottom));
    background: transparent;
  }

  .ask-shell.is-empty .ask-composer-area {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .ask-shell.is-empty .ask-composer-meta {
    padding: 8px 4px 0;
  }

  .ask-shell.is-empty .ask-disclaimer {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-tertiary, rgba(89, 97, 111, 0.78));
    text-align: center;
    line-height: 1.35;
  }

  .ask-shell.has-messages .ask-composer-area {
    position: sticky;
    margin-top: auto;
    padding-top: 10px;
    background: linear-gradient(to bottom, transparent, var(--bg-canvas) 24%);
  }

  .ask-suggestions {
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 0 16px 2px 0;
  }

  .ask-composer {
    min-height: 62px;
    display: flex;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.09));
    box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04)), 0 1px 2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.02));
  }

  .ask-composer:focus-within,
  .workspace-intake .ask-composer:where(:not(.is-dragover)):focus-within {
    border-color: var(--border-hover, rgba(20, 27, 42, 0.14));
    box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
    outline: none;
  }

  .ask-context-menu,
  .ask-context-trigger,
  .ask-context-slot,
  .ask-attach-btn {
    width: 44px;
    height: 44px;
  }

  .ask-input {
    min-height: 48px;
    max-height: 144px;
    padding: 12px 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .ask-input::placeholder {
    color: var(--theme-copy, rgba(89, 97, 111, 0.68));
  }

  .ask-submit {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  /* Keep the shared Build/Ask + menu above the mobile composer. */
  .ask-context-popover,
  .ask-context-popover.is-downwards,
  .ask-shell.is-empty .ask-context-popover,
  .ask-shell.is-empty .ask-context-popover.is-downwards {
    top: auto !important;
    bottom: calc(100% + 12px) !important;
    left: 0;
    width: min(340px, calc(100vw - 32px));
    max-height: min(390px, calc(100dvh - 140px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 4px 18px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08)), 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
    z-index: 120;
  }

  .ask-preset-prompt-cta {
    top: auto;
    bottom: calc(100% + 12px);
    transform: translateY(3px);
  }

  .ask-preset-prompt-cta::before {
    top: auto;
    bottom: -6px;
    border-top: 6px solid var(--theme-border-strong, #181f2e);
    border-bottom: 0;
  }

  .ask-preset-prompt-cta:not(.is-hidden) {
    transform: translateY(0);
  }

  .ask-composer-meta span:last-child {
    display: none;
  }

  /* Mobile: Relocate model selector to header; hide in composer to expand input */
  .ask-composer .ask-model-selector-menu {
    display: none !important;
  }

  /* Prevent desktop <details> popover on mobile */
  .ask-context-menu > .ask-context-popover {
    display: none !important;
  }

  .ask-message {
    gap: 9px;
  }

  .ask-message-content {
    width: 100%;
    max-width: 100%;
    font-size: 15px;
  }

  .ask-message-user .ask-message-content {
    width: auto;
    max-width: 88%;
  }

  .ask-message-actions {
    opacity: 1;
  }

  .entry-notice {
    top: calc(70px + env(safe-area-inset-top));
    right: 14px;
    left: 14px;
    width: auto;
    font-size: 11.5px;
  }
}

@media (max-width: 430px) {
  .workspace-centered .intake-intro,
  .ask-thread,
  .ask-shell.is-empty .ask-thread {
    padding-top: 0;
    margin-top: 0;
  }

  .workspace-centered .intake-title,
  .ask-title {
    font-size: clamp(27px, 7.5vw, 32px);
    font-weight: 400;
  }
}

@media (max-width: 390px) {
  .mobile-header {
    padding: 0;
  }

  .mobile-header-intake {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .mobile-header-chat {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .mobile-model-pill-btn,
  .mobile-header #mobileChatModelButton {
    padding: 0 10px;
    max-width: 140px;
    font-size: 13px;
  }

  .workspace-centered,
  .workspace-ask {
    padding-right: 14px;
    padding-left: 14px;
  }

  .workspace-centered .intake-intro,
  .ask-thread,
  .ask-shell.is-empty .ask-thread {
    margin-top: 0;
  }

  .workspace-centered .intake-title,
  .ask-title {
    font-size: clamp(25px, 7vw, 30px);
    font-weight: 400;
  }

  .workspace-centered .intake-description,
  .ask-subtitle {
    font-size: 15px;
  }

  .workspace-centered .examples,
  .ask-suggestions {
    padding-right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PLANNER / PLANLAŞDIRILANLAR STYLES ===== */

.section-heading-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.add-to-planner-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(16, 24, 40, 0.04));
  white-space: nowrap;
}

.add-to-planner-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--theme-blue-ink, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 3px 8px var(--theme-shadow-soft, rgba(16, 24, 40, 0.08));
}

.add-to-planner-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.checklist-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 140ms ease;
}

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

.checklist-item .item-plan-btn {
  margin-left: auto;
  opacity: 0;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.checklist-item:hover .item-plan-btn {
  opacity: 1;
}

.checklist-item .item-plan-btn:hover {
  background: var(--accent-soft);
  color: var(--theme-blue-ink, var(--accent));
  border-color: transparent;
}

/* ===== PLANNER VIEW ===== */

.planner-view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 132px;
}

.planner-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.planner-header-text {
  flex: 1;
  min-width: 0;
}

.planner-header-text .section-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--theme-blue-ink, var(--accent, #2563eb));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.planner-header-text h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 34px);
  font-weight: 650;
  color: var(--theme-ink, #111827);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.planner-header-text p {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--theme-muted, #64748b);
  max-width: 540px;
}

.planner-composer-card {
  position: fixed;
  z-index: 30;
  left: calc(50% + var(--rail-width) / 2);
  bottom: 22px;
  width: min(760px, calc(100vw - var(--rail-width) - 64px));
  min-height: 56px;
  box-sizing: border-box;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.96);
  border: 1px solid var(--theme-border, #e5e7eb);
  border-radius: 16px;
  padding: 9px 10px 9px 16px;
  box-shadow: 0 8px 30px var(--theme-shadow-soft, rgba(15, 23, 42, 0.07)), 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
}

body.sidebar-open .planner-composer-card {
  left: calc(50% + var(--sidebar-width) / 2);
  width: min(760px, calc(100vw - var(--sidebar-width) - 64px));
}

.planner-composer-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--theme-ink, #0f172a);
  font-family: inherit;
  padding: 0;
}

.planner-composer-input::placeholder {
  color: var(--theme-muted, #94a3b8);
  font-weight: 400;
}

.planner-composer-bottom {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.planner-time-select-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--theme-muted, #64748b);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
  user-select: none;
}

.planner-time-select-pill:hover {
  background: var(--theme-surface-soft, #f3f4f6);
  color: var(--theme-ink, #111827);
}

.planner-cal-icon {
  color: var(--theme-muted, #64748b);
  flex-shrink: 0;
}

.planner-select-label {
  font-size: 12.5px;
  color: inherit;
  font-weight: 500;
}

.planner-chevron-icon {
  color: var(--theme-muted, #94a3b8);
  flex-shrink: 0;
  margin-left: 2px;
}

.planner-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.planner-submit-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #0b1f3a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: none;
  transition: background 140ms ease, transform 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.planner-submit-btn:hover {
  background: #132d52;
}

.planner-submit-btn:active {
  background: #08172c;
  transform: translateY(0);
}

.planner-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 28px;
  width: 100%;
}

.planner-search-bar {
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 12px;
  height: 44px;
  box-sizing: border-box;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03));
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.planner-search-bar:focus-within {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.16));
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05));
  outline: none;
}

.planner-search-icon {
  color: var(--theme-muted, #94a3b8);
  flex-shrink: 0;
}

.planner-search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--theme-ink, #0f172a);
  font-family: inherit;
  padding: 0;
}

.planner-search-input::placeholder {
  color: var(--theme-muted, #94a3b8);
}

.planner-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  border-bottom: 1px solid var(--theme-border, #eaedf3);
  padding-bottom: 0;
}

.planner-filter-pills {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: -1px;
}

.planner-filter-pill {
  position: relative;
  border: none;
  background: transparent;
  color: var(--theme-muted, #64748b);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 2px 10px;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.planner-filter-pill:hover {
  color: var(--theme-ink, #0f172a);
}

.planner-filter-pill.is-active {
  color: var(--theme-ink, #0f172a);
  font-weight: 600;
}

.planner-filter-pill.is-active::after {
  position: absolute;
  content: "";
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent, #4f6ee8);
}

/* Planner Tasks Container & Groups */
.planner-tasks-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.planner-group {
  margin-top: 34px;
}

.planner-group:first-child {
  margin-top: 0;
}

.planner-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding: 0 1px 2px;
  border-bottom: none;
}

.planner-group-header.is-collapsible {
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  padding: 0 1px 2px;
  margin-bottom: 12px;
  border-bottom: none;
}

.planner-group-header.is-collapsible.is-collapsed {
  border-bottom: 1px solid var(--theme-border, #e5e7eb);
  padding: 0 1px 9px;
  margin-bottom: 10px;
}

.planner-group-header.is-collapsible:hover .planner-group-name,
.planner-group-header.is-collapsible:focus-visible .planner-group-name {
  color: var(--theme-ink, #172033);
}

.planner-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.planner-group-chevron {
  margin-left: 8px;
  color: var(--theme-muted, #94a3b8);
  transition: transform 140ms ease;
}

.planner-group-header.is-collapsed .planner-group-chevron {
  transform: rotate(-90deg);
}

.planner-group-name {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-muted, #64748b);
  margin: 0;
}

.planner-group-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--theme-border, #e5e7eb);
  border-radius: 999px;
  background: var(--theme-surface, #f8fafc);
  color: var(--theme-muted, #64748b);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.planner-task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-task-card {
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #eaedf3);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03)), 0 4px 12px var(--theme-shadow-soft, rgba(15, 23, 42, 0.02));
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  position: relative;
  z-index: 1;
}

.planner-task-card:hover {
  border-color: var(--theme-border, #cbd5e1);
  box-shadow: 0 6px 20px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.07)), 0 2px 6px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03));
  transform: translateY(-1.5px);
  z-index: 2;
}

.planner-task-card.has-open-menu,
.planner-task-card:has(.planner-dropdown-menu) {
  z-index: 60 !important;
}

.planner-task-card.is-done {
  background: var(--theme-surface, #fbfcfe);
  border-color: var(--theme-border, #e5e7eb);
  opacity: 0.72;
}

.planner-task-card.is-done:hover {
  opacity: 0.92;
}

.planner-card-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.planner-check-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.planner-check-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.planner-custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.8px solid var(--theme-border, #cbd5e1);
  background: var(--theme-surface, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 140ms ease;
}

.planner-check-wrap:hover .planner-custom-checkbox {
  border-color: var(--accent, #4f6ee8);
}

.planner-check-wrap input[type="checkbox"]:checked + .planner-custom-checkbox {
  background: var(--accent, #4f6ee8);
  border-color: var(--accent, #4f6ee8);
}

.planner-check-wrap input[type="checkbox"]:checked + .planner-custom-checkbox::after {
  content: "";
  display: block;
  width: 5px;
  height: 9.5px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -1px);
}

.planner-task-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--theme-ink, #1e293b);
  letter-spacing: -0.01em;
  flex: 1;
  margin: 0;
  word-break: break-word;
}

.planner-task-card.is-done .planner-task-text {
  color: var(--theme-muted, #94a3b8);
  text-decoration: line-through;
}

.planner-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 10;
}

.planner-menu-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--theme-muted, #94a3b8);
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  flex-shrink: 0;
  opacity: 0.45;
  transition: color 130ms ease, background 130ms ease, opacity 130ms ease;
}

.planner-task-card:hover .planner-menu-btn,
.planner-menu-btn:focus-visible { opacity: 1; }

.planner-menu-btn:hover {
  color: var(--theme-ink, #0f172a);
  background: var(--theme-surface-soft, #f1f5f9);
}

.planner-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  z-index: 999;
  min-width: 190px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 30px -4px var(--theme-shadow-strong, rgba(16, 24, 40, 0.16)), 0 4px 12px var(--theme-shadow-soft, rgba(0, 0, 0, 0.06));
  padding: 5px;
  animation: planner-drop-fade 140ms ease-out;
}

@keyframes planner-drop-fade {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.planner-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--theme-copy, #334155);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: all 120ms ease;
}

.planner-dropdown-item:hover {
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-ink, #0f172a);
}

.planner-dropdown-item.is-danger {
  color: var(--theme-danger-ink, #ef4444);
}

.planner-dropdown-item.is-danger:hover {
  background: var(--theme-danger-surface, #fef2f2);
  color: var(--theme-danger-ink, #dc2626);
}

.planner-dropdown-item svg {
  flex-shrink: 0;
}

.planner-dropdown-source {
  align-items: flex-start;
  max-width: 260px;
  padding: 8px 10px;
}

.planner-dropdown-time {
  align-items: flex-start;
  max-width: 260px;
  padding: 8px 10px;
  cursor: default;
}

.planner-dropdown-time:hover {
  background: transparent;
  color: var(--theme-copy, #334155);
}

.planner-dropdown-source-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.planner-dropdown-source-copy small {
  color: var(--theme-muted, #64748b);
  font-size: 10px;
  font-weight: 500;
}

.planner-dropdown-source-copy strong {
  overflow: hidden;
  color: var(--theme-ink, #172033);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-empty-state {
  padding: 68px 16px;
  text-align: center;
}

.planner-empty-state h2 {
  margin: 0;
  color: var(--theme-ink, #172033);
  font-size: 15px;
  font-weight: 600;
}

.planner-empty-state p {
  margin: 7px 0 0;
  color: var(--theme-muted, #64748b);
  font-size: 13px;
}

@media (max-width: 767px) {
  .planner-view {
    padding: 24px 16px calc(120px + env(safe-area-inset-bottom));
  }

  .planner-header-row {
    margin-bottom: 18px;
  }

  .planner-header-text .section-kicker {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .planner-header-text h1 {
    font-size: 24px;
    letter-spacing: -0.025em;
  }

  .planner-header-text p {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.42;
    margin-top: 4px;
  }

  .planner-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  .planner-search-bar {
    height: 42px;
    flex-basis: 42px;
    border-radius: 11px;
    padding: 0 12px;
    gap: 8px;
  }

  .planner-search-input {
    font-size: 13.5px;
  }

  .planner-filter-pills {
    gap: 20px;
    width: 100%;
    padding-bottom: 0;
  }

  .planner-filter-pill {
    font-size: 13px;
    padding: 6px 2px 8px;
  }

  .planner-group {
    margin-top: 22px;
  }

  .planner-group-header {
    margin-bottom: 10px;
    padding: 0 1px 2px;
  }

  .planner-group-header.is-collapsible {
    padding: 0 1px 2px;
    margin-bottom: 10px;
    border-bottom: none;
  }

  .planner-group-header.is-collapsible.is-collapsed {
    padding: 0 1px 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--theme-border, #e5e7eb);
  }

  .planner-group-name {
    font-size: 10.5px;
  }

  .planner-group-badge {
    height: 18px;
    font-size: 10px;
    padding: 0 6px;
  }

  .planner-task-list {
    gap: 9px;
  }

  .planner-task-card {
    padding: 13px 14px 13px 12px;
    border-radius: 13px;
  }

  .planner-card-main {
    gap: 11px;
    align-items: flex-start;
  }

  .planner-check-wrap {
    margin-top: 1.5px;
  }

  .planner-custom-checkbox {
    width: 19px;
    height: 19px;
    border-radius: 5.5px;
  }

  .planner-task-text {
    font-size: 13.5px;
    line-height: 1.48;
  }

  .planner-menu-btn {
    width: 28px;
    height: 28px;
    opacity: 0.65;
  }

  .planner-dropdown-menu {
    min-width: 175px;
    max-width: calc(100vw - 32px);
  }

  .planner-composer-card {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
    padding: 7px 8px 7px 13px;
    min-height: 48px;
    border-radius: 14px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05)), 0 1px 2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.02));
  }

  .planner-composer-input {
    font-size: 13.5px;
  }

  .planner-select-label,
  .planner-chevron-icon {
    display: none;
  }

  .planner-time-select-pill {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 9px;
  }

  .planner-submit-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .planner-empty-state {
    padding: 44px 16px;
  }

  .checklist-item .item-plan-btn {
    opacity: 1;
  }
}

/* ===== LEGAL MODAL & SIDEBAR LINKS ===== */

/* Sidebar Legal */
.sidebar-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 4px 2px;
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  white-space: nowrap;
}

.sidebar-legal-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
  cursor: pointer;
  transition: color 140ms ease;
}

.sidebar-legal-link:hover {
  color: var(--text-secondary, #475569);
  text-decoration: underline;
}

.sidebar-legal-dot {
  opacity: 0.4;
  user-select: none;
}

/* Legal Modal Overlay */
.legal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.45));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInModal 180ms ease forwards;
}

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

.legal-modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 48px -10px var(--theme-shadow-strong, rgba(15, 23, 42, 0.18)), 0 0 0 1px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  overflow: hidden;
  animation: scaleUpModal 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUpModal {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.legal-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-elevated, #ffffff);
}

.legal-modal-title-group h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary, #0f172a);
}

.legal-modal-title-group p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}

.legal-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-soft, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.legal-modal-close:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-hover, #cbd5e1);
}

.legal-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary, #475569);
}

.legal-modal-body h3 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.legal-modal-body h3:first-child {
  margin-top: 0;
}

.legal-modal-body p {
  margin: 0 0 12px;
}

.legal-modal-body ul {
  margin: 0 0 14px 18px;
  padding: 0;
}

.legal-modal-body li {
  margin-bottom: 6px;
}

.personalization-consent-card {
  max-width: 540px;
}

.personalization-consent-body {
  padding-bottom: 20px;
}

.personalization-consent-body p {
  margin-bottom: 12px;
}

.personalization-consent-privacy-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--theme-blue-ink, var(--accent, #1d4ed8));
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.personalization-consent-privacy-link:hover {
  text-decoration: underline;
}

.personalization-consent-footer {
  gap: 10px;
}

.legal-highlight-box {
  padding: 14px 16px;
  margin: 16px 0;
  border-radius: 10px;
  background: var(--accent-soft, #eff6ff);
  border: 1px solid var(--theme-blue-border, rgba(37, 99, 235, 0.15));
  color: var(--text-primary, #1e3a8a);
  font-size: 13.5px;
  line-height: 1.55;
}

.legal-doc-note {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
}
.legal-doc-note strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
}
.legal-doc-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
}

.legal-doc-precedence {
  margin-top: 20px;
  padding: 13px 16px;
  border-radius: 9px;
  background: var(--bg-elevated, rgba(148, 163, 184, 0.08));
  border: 1px dashed var(--border-hover, #cbd5e1);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary, #64748b);
}
.legal-doc-precedence p {
  margin: 0;
}
.legal-doc-precedence strong {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

.legal-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 28px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-soft, #f8fafc);
}

/* ===== KEYBOARD SHORTCUTS ===== */

.keyboard-shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.45));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInModal 180ms ease forwards;
}

.keyboard-shortcuts-card {
  width: min(100%, 560px);
  overflow: hidden;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  background: var(--bg-elevated, #ffffff);
  box-shadow: 0 20px 48px -10px var(--theme-shadow-strong, rgba(15, 23, 42, 0.18)), 0 0 0 1px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  animation: scaleUpModal 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.keyboard-shortcuts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.keyboard-shortcuts-title-group h2 {
  margin: 0 0 4px;
  color: var(--text-primary, #0f172a);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.keyboard-shortcuts-title-group p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
}

.keyboard-shortcuts-close {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 140ms ease;
}

.keyboard-shortcuts-close:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-hover, #cbd5e1);
}

.keyboard-shortcuts-body {
  padding: 16px 28px 22px;
}

.keyboard-shortcuts-list {
  display: grid;
  gap: 2px;
}

.keyboard-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--theme-border, rgba(20, 27, 42, 0.06));
}

.keyboard-shortcut-row:last-child {
  border-bottom: 0;
}

.keyboard-shortcut-copy strong {
  color: var(--text-primary, #0f172a);
  font-size: 13px;
  font-weight: 600;
}

.keyboard-shortcut-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.shortcut-key {
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle, #dbe1ea);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-primary, #334155);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.keyboard-shortcut-or {
  color: var(--text-tertiary, #94a3b8);
  font-size: 11px;
}

.keyboard-shortcuts-hint {
  margin: 16px 0 0;
  color: var(--text-tertiary, #64748b);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .sidebar-legal #keyboardShortcutsBtn,
  .sidebar-legal #keyboardShortcutsBtn + .sidebar-legal-dot {
    display: none;
  }

  .keyboard-shortcuts-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .keyboard-shortcuts-header,
  .keyboard-shortcuts-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .keyboard-shortcut-row {
    gap: 10px;
  }

  .keyboard-shortcut-keys .shortcut-key:first-child,
  .keyboard-shortcut-keys .keyboard-shortcut-or {
    display: none;
  }
}

/* Settings Legal Tab */
.settings-legal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.settings-legal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-soft, #f8fafc);
}

.settings-legal-row strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary, #0f172a);
  margin-bottom: 2px;
}

.settings-legal-row p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary, #64748b);
}

/* Legal & Policy Direct Contact Card (Standalone card below panel) */
.settings-legal-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 22px 28px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-elevated, #ffffff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.settings-legal-contact-card:hover {
  border-color: var(--border-hover, rgba(20, 27, 42, 0.18));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.legal-contact-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(79, 110, 232, 0.08);
  color: var(--accent, #4f6ee8);
  flex-shrink: 0;
}

.legal-contact-text strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary, #0f172a);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.legal-contact-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
}

.legal-contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-subtle, #e2e8f0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 140ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.legal-contact-email-btn:hover {
  border-color: var(--accent, #4f6ee8);
  color: var(--accent, #4f6ee8);
  background: rgba(79, 110, 232, 0.04);
}

/* Legal Report Modal */
.legal-report-modal-card {
  max-width: 560px;
}

.legal-report-modal-body {
  padding: 20px 28px;
}

.legal-report-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid var(--theme-warning-border, rgba(245, 158, 11, 0.22));
  margin-bottom: 14px;
}

.legal-report-notice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-warning-ink, #d97706);
  flex-shrink: 0;
  margin-top: 1.5px;
}

.legal-report-notice-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
}

.legal-report-terms-link {
  display: inline;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  color: var(--theme-blue-ink, var(--accent, #2563eb));
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 120ms ease;
}

.legal-report-terms-link:hover {
  color: var(--theme-blue-ink, #1d4ed8);
  text-decoration: underline;
}

.legal-report-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-report-context-box {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 11px 14px;
}

.legal-report-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.legal-report-context-label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary, #64748b);
}

.legal-report-model-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-blue-ink, #2563eb);
  font-weight: 600;
  font-size: 11px;
}

.legal-report-context-preview {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 8px;
  border-left: 2px solid var(--border-subtle, #cbd5e1);
}

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

.legal-report-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.required-star {
  color: var(--theme-danger-ink, #ef4444);
  font-weight: 700;
}

.optional-tag {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-tertiary, #94a3b8);
  margin-left: 4px;
}

.legal-report-select,
.legal-report-input,
.legal-report-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary, #0f172a);
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  box-sizing: border-box;
}

.legal-report-select:focus,
.legal-report-input:focus,
.legal-report-textarea:focus {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.legal-report-textarea {
  resize: vertical;
  min-height: 85px;
  line-height: 1.5;
}

.legal-report-hint {
  font-size: 11.5px;
  color: var(--text-tertiary, #94a3b8);
  line-height: 1.4;
}

.legal-report-error {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--theme-danger-surface, #fef2f2);
  border: 1px solid var(--theme-danger-border, #fecaca);
  color: var(--theme-danger-ink, #b91c1c);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
}

.legal-report-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.legal-report-submit-btn {
  background: #dc2626 !important;
  border-color: var(--theme-danger-border, #dc2626) !important;
  color: #ffffff !important;
}

.legal-report-submit-btn:hover {
  background: #b91c1c !important;
  border-color: var(--theme-danger-border, #b91c1c) !important;
}

.legal-report-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ===== USAGE LIMITS PAGE STYLING (MINIMALIST & PREMIUM) ===== */

.workspace-limits {
  overflow-y: auto;
  display: block;
}

.limits-view {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 30px 24px 70px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 1. Header Row & Segmented Filter */
.limits-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.limits-header-text h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.limits-header-text p {
  margin: 0;
  font-size: 13px;
  color: var(--theme-muted, #64748b);
}

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

.limits-segmented-control {
  display: flex;
  gap: 2px;
  background: var(--theme-surface-soft, #f1f5f9);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.9));
}

.limits-segment-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--theme-muted, #64748b);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 130ms ease;
  white-space: nowrap;
}

.limits-segment-btn:hover {
  color: var(--theme-ink, #0f172a);
}

.limits-segment-btn.is-active {
  background: var(--theme-surface, #ffffff);
  color: var(--theme-ink, #0f172a);
  font-weight: 700;
  box-shadow: 0 1px 3px var(--theme-shadow-soft, rgba(0, 0, 0, 0.08));
}

.limits-mobile-select-wrap {
  display: none;
}

.limits-refresh-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--theme-muted, #64748b);
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.9));
  cursor: pointer;
  transition: all 140ms ease;
}

.limits-refresh-btn:hover {
  color: var(--theme-blue-ink, #2563eb);
  background: var(--theme-blue-surface, #eff6ff);
  border-color: var(--theme-blue-border, rgba(37, 99, 235, 0.25));
}

.limits-refresh-btn.is-loading svg {
  animation: limitsSpin 0.8s linear infinite;
}

@keyframes limitsSpin {
  100% {
    transform: rotate(360deg);
  }
}

/* 2. Hero Unlimited Banner (Minimalist Glass) */
.limits-hero-card {
  position: relative;
  border-radius: 14px;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(var(--theme-blue-rgb, 239, 246, 255), 0.9) 0%, rgba(var(--theme-surface-rgb, 248, 250, 252), 0.85) 50%, rgba(var(--theme-surface-rgb, 240, 253, 250), 0.85) 100%);
  border: 1px solid var(--theme-blue-border, rgba(191, 219, 254, 0.75));
  box-shadow: 0 4px 18px -4px rgba(59, 130, 246, 0.08);
  overflow: hidden;
}

.limits-hero-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 70%);
  filter: blur(16px);
  pointer-events: none;
}

.limits-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.limits-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--theme-success-border, rgba(16, 185, 129, 0.25));
  color: var(--theme-success-ink, #065f46);
  font-size: 11.5px;
  font-weight: 700;
}

.limits-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: limitsPulse 2s infinite;
}

@keyframes limitsPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.limits-badge-tier {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
  color: var(--theme-blue-ink, #2563eb);
}

.limits-hero-body h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.02em;
}

.limits-hero-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--theme-copy, #475569);
}

.limits-hero-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.limits-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.9);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
}

.limits-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.limits-chip-icon svg {
  width: 15px;
  height: 15px;
}

.limits-chip-content strong {
  display: block;
  font-size: 10.5px;
  color: var(--theme-muted, #64748b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.limits-chip-content span {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--theme-ink, #0f172a);
}

/* 3. Mode Cards Grid (Build & Ask) */
.limits-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.limits-mode-card {
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
  box-shadow: 0 1px 3px 0 var(--theme-shadow-soft, rgba(15, 23, 42, 0.03)), 0 4px 14px -2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.limits-mode-card:hover {
  border-color: var(--theme-border, rgba(203, 213, 225, 0.95));
  box-shadow: 0 4px 20px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08));
  transform: translateY(-2px);
}

.limits-mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.limits-mode-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.limits-mode-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.limits-mode-card:hover .limits-mode-icon-box {
  transform: scale(1.05);
}

.limits-mode-icon-box svg {
  width: 19px;
  height: 19px;
}

.build-icon-box {
  background: linear-gradient(135deg, var(--theme-blue-surface, #eff6ff) 0%, var(--theme-blue-surface, #dbeafe) 100%);
  color: var(--theme-blue-ink, #2563eb);
  border: 1px solid var(--theme-blue-border, rgba(191, 219, 254, 0.8));
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.ask-icon-box {
  background: linear-gradient(135deg, var(--theme-surface-soft, #f5f3ff) 0%, var(--theme-surface-soft, #ede9fe) 100%);
  color: var(--theme-purple-ink, #7c3aed);
  border: 1px solid var(--theme-blue-border, rgba(221, 214, 254, 0.8));
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
}

.limits-mode-title-wrap h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.01em;
}

.limits-mode-sub {
  display: block;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
  margin-top: 1px;
}

.limits-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

.tag-build {
  background: rgba(37, 99, 235, 0.07);
  color: var(--theme-blue-ink, #1d4ed8);
  border: 1px solid var(--theme-blue-border, rgba(37, 99, 235, 0.16));
}

.tag-ask {
  background: rgba(124, 58, 237, 0.07);
  color: var(--theme-purple-ink, #6d28d9);
  border: 1px solid var(--theme-purple-border, rgba(124, 58, 237, 0.16));
}

.limits-mode-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 2px 0;
}

.limits-mode-big-num {
  font-size: 34px;
  font-weight: 850;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.limits-mode-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-muted, #64748b);
}

.limits-mode-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.limits-meta-pill {
  font-size: 12px;
  color: var(--theme-copy, #475569);
  background: var(--theme-surface, #f8fafc);
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.9));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 120ms ease;
}

.limits-meta-pill:hover {
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-ink, #1e293b);
  border-color: var(--theme-border, #cbd5e1);
}

.limits-meta-pill strong {
  color: var(--theme-ink, #0f172a);
  font-weight: 750;
}

/* 4. Activity Timeline Chart Card */
.limits-chart-card {
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
  box-shadow: 0 1px 3px 0 var(--theme-shadow-soft, rgba(15, 23, 42, 0.03)), 0 4px 14px -2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.limits-chart-card:hover {
  border-color: var(--theme-border, rgba(203, 213, 225, 0.95));
  box-shadow: 0 4px 20px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08));
}

.limits-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.limits-chart-header h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 750;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.01em;
}

.limits-chart-header p {
  margin: 0;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
}

.limits-chart-legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--theme-copy, #475569);
  background: var(--theme-surface, #f8fafc);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.8));
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-build { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
.dot-ask { background: #8b5cf6; box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2); }

.limits-chart-body {
  padding-top: 10px;
}

.limits-chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  height: 130px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
  overflow-x: auto;
}

.limits-chart-bars-wrap.is-single-day {
  justify-content: center;
}

.limits-chart-col {
  position: relative;
  flex: 1;
  min-width: 10px;
  max-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}

.limits-col-bars-track {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  justify-content: center;
  margin-bottom: 6px;
  height: 95px;
}

.limits-col-bars-track.is-empty {
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
}

.limits-bar-empty {
  width: 4px;
  height: 3px;
  border-radius: 2px;
  background: var(--theme-surface-muted, #e2e8f0);
  transition: background 140ms ease, transform 120ms ease;
}

.limits-chart-col:hover .limits-bar-empty {
  background: var(--theme-border-strong, #94a3b8);
  transform: scale(1.3);
}

.limits-bar-segment {
  width: 6px;
  border-radius: 3px 3px 0 0;
  transition: height 200ms ease, transform 120ms ease;
}

.segment-build {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.segment-ask {
  background: linear-gradient(180deg, var(--theme-purple-surface, #a78bfa) 0%, #7c3aed 100%);
}

.limits-chart-col:hover .limits-bar-segment {
  transform: scaleY(1.06);
  filter: brightness(1.15);
}

.limits-col-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--theme-muted, #94a3b8);
  white-space: nowrap;
  text-align: center;
  height: 14px;
  line-height: 14px;
}

.limits-col-label.is-hidden-label {
  visibility: hidden;
  user-select: none;
}

.limits-chart-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--theme-inverse-surface, #0f172a);
  color: #ffffff;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 10;
  box-shadow: 0 6px 20px var(--theme-shadow-strong, rgba(0, 0, 0, 0.2));
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.limits-chart-tooltip strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  color: var(--theme-blue-ink, #93c5fd);
  font-weight: 700;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

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

.t-total {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  color: #ffffff;
}

.limits-chart-col:hover .limits-chart-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

.limits-chart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
  gap: 6px;
  min-height: 120px;
}

.limits-empty-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.limits-empty-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--theme-ink, #0f172a);
}

.limits-empty-hint {
  font-size: 12px;
  color: var(--theme-muted, #64748b);
  max-width: 380px;
  line-height: 1.5;
}

/* 5. Clean, Compact & Premium FAQ Section */
.limits-faq-card {
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
  box-shadow: 0 1px 3px 0 var(--theme-shadow-soft, rgba(15, 23, 42, 0.03)), 0 4px 14px -2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.limits-faq-card:hover {
  border-color: var(--theme-border, rgba(203, 213, 225, 0.95));
  box-shadow: 0 4px 20px -4px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08));
}

.limits-faq-card[open] {
  padding-bottom: 22px;
}

.limits-faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.limits-faq-header::-webkit-details-marker {
  display: none;
}

.limits-faq-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.limits-faq-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--theme-blue-surface, #eff6ff) 0%, var(--theme-blue-surface, #dbeafe) 100%);
  color: var(--theme-blue-ink, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--theme-blue-border, rgba(191, 219, 254, 0.8));
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.limits-faq-icon svg {
  width: 18px;
  height: 18px;
}

.limits-faq-title-wrap h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 750;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.01em;
  transition: color 140ms ease;
}

.limits-faq-header:hover .limits-faq-title-wrap h3 {
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-title-wrap p {
  margin: 0;
  font-size: 12px;
  color: var(--theme-muted, #64748b);
}

.limits-faq-main-toggle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--theme-surface, #f8fafc);
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-muted, #64748b);
  flex-shrink: 0;
  transition: all 180ms ease;
}

.limits-faq-header:hover .limits-faq-main-toggle {
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
  border-color: var(--theme-blue-border, rgba(191, 219, 254, 0.9));
}

.limits-faq-card[open] .limits-faq-main-toggle {
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
  border-color: var(--theme-blue-border, rgba(191, 219, 254, 0.9));
}

.limits-main-faq-chevron {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease;
}

.limits-faq-card[open] .limits-main-faq-chevron {
  transform: rotate(180deg);
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-border, rgba(226, 232, 240, 0.8));
}

.limits-faq-item {
  border-radius: 12px;
  border: 1px solid var(--theme-border, rgba(226, 232, 240, 0.85));
  background: var(--theme-surface, #f8fafc);
  transition: all 180ms ease;
  overflow: hidden;
}

.limits-faq-item:hover {
  background: var(--theme-surface, #ffffff);
  border-color: var(--theme-border, rgba(203, 213, 225, 0.95));
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03));
}

.limits-faq-item[open] {
  background: var(--theme-surface, #ffffff);
  border-color: var(--theme-blue-border, rgba(147, 197, 253, 0.9));
  box-shadow: 0 4px 16px -2px rgba(37, 99, 235, 0.08);
}

.limits-faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.limits-faq-summary::-webkit-details-marker {
  display: none;
}

.limits-faq-question {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--theme-ink, #0f172a);
  letter-spacing: -0.01em;
  transition: color 140ms ease;
}

.limits-faq-summary:hover .limits-faq-question {
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-item[open] .limits-faq-question {
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(var(--theme-surface-rgb, 241, 245, 249), 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 180ms ease;
}

.limits-faq-item:hover .limits-faq-icon-wrap {
  background: var(--theme-blue-surface, #eff6ff);
}

.limits-faq-item[open] .limits-faq-icon-wrap {
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-chevron {
  color: var(--theme-muted, #64748b);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease;
}

.limits-faq-item[open] .limits-faq-chevron {
  transform: rotate(180deg);
  color: var(--theme-blue-ink, #2563eb);
}

.limits-faq-content {
  padding: 0 16px 14px;
  border-top: 1px solid var(--theme-border, rgba(241, 245, 249, 0.9));
  margin-top: 2px;
}

.limits-faq-content p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--theme-copy, #475569);
}

.limits-faq-content strong {
  color: var(--theme-ink, #0f172a);
  font-weight: 600;
}

@media (max-width: 768px) {
  .workspace-limits {
    -webkit-overflow-scrolling: touch;
  }

  .limits-view {
    padding: 16px 14px 64px;
    gap: 14px;
    box-sizing: border-box;
  }

  .limits-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 2px;
  }

  .limits-header-text {
    width: 100%;
  }

  .limits-header-text h1 {
    font-size: 21px;
    margin-bottom: 3px;
    font-weight: 800;
  }

  .limits-header-text p {
    font-size: 12.5px;
    line-height: 1.45;
  }

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

  .limits-segmented-control {
    display: none !important;
  }

  .limits-mobile-select-wrap {
    display: flex;
    position: relative;
    flex: 1;
    max-width: 100%;
    align-items: center;
  }

  .limits-mobile-select {
    width: 100%;
    height: 38px;
    padding: 0 30px 0 12px;
    font-size: 13px;
    font-weight: 650;
    color: var(--theme-ink, #0f172a);
    background: var(--theme-surface, #ffffff);
    border: 1px solid var(--theme-border, rgba(203, 213, 225, 0.95));
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(0, 0, 0, 0.03));
    outline: none;
    transition: all 140ms ease;
  }

  .limits-mobile-select:focus {
    border-color: var(--theme-blue-border, #2563eb);
    background: var(--theme-surface, #ffffff);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  }

  .limits-select-chevron {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--theme-muted, #64748b);
    width: 14px;
    height: 14px;
  }

  .limits-refresh-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .limits-mode-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .limits-mode-card {
    padding: 16px 18px;
    border-radius: 14px;
    gap: 12px;
  }

  .limits-mode-title-wrap {
    gap: 10px;
  }

  .limits-mode-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .limits-mode-icon-box svg {
    width: 17px;
    height: 17px;
  }

  .limits-mode-title-wrap h4 {
    font-size: 14px;
  }

  .limits-mode-sub {
    font-size: 11.5px;
  }

  .limits-mode-big-num {
    font-size: 30px;
  }

  .limits-mode-unit {
    font-size: 12px;
  }

  .limits-mode-meta-pills {
    gap: 6px;
  }

  .limits-meta-pill {
    font-size: 11.5px;
    padding: 4px 9px;
  }

  .limits-chart-card {
    padding: 16px 18px;
    border-radius: 14px;
    gap: 12px;
  }

  .limits-chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .limits-chart-header h3 {
    font-size: 14.5px;
  }

  .limits-chart-header p {
    font-size: 11.5px;
  }

  .limits-chart-legend {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .legend-item {
    font-size: 11px;
    padding: 2.5px 8px;
  }

  .limits-chart-bars-wrap {
    height: 115px;
    gap: 2px;
    padding: 0 2px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .limits-chart-bars-wrap::-webkit-scrollbar {
    display: none;
  }

  .limits-col-bars-track {
    height: 85px;
  }

  .limits-chart-tooltip {
    max-width: 220px;
    font-size: 10.5px;
    padding: 6px 9px;
  }

  .limits-faq-card {
    padding: 16px 18px;
    border-radius: 14px;
    gap: 0;
  }

  .limits-faq-card[open] {
    padding-bottom: 18px;
  }

  .limits-faq-header {
    gap: 10px;
  }

  .limits-faq-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .limits-faq-icon svg {
    width: 16px;
    height: 16px;
  }

  .limits-faq-title-wrap h3 {
    font-size: 14px;
  }

  .limits-faq-title-wrap p {
    font-size: 11.5px;
  }

  .limits-faq-main-toggle {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .limits-faq-list {
    margin-top: 14px;
    padding-top: 14px;
    gap: 7px;
  }

  .limits-faq-item {
    border-radius: 10px;
  }

  .limits-faq-summary {
    padding: 11px 12px;
    gap: 10px;
  }

  .limits-faq-question {
    font-size: 13px;
  }

  .limits-faq-icon-wrap {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .limits-faq-content {
    padding: 0 12px 12px;
  }

  .limits-faq-content p {
    font-size: 12px;
    line-height: 1.55;
  }
}

@media (max-width: 480px) {
  .limits-view {
    padding: 12px 10px 60px;
    gap: 12px;
  }

  .limits-header-text h1 {
    font-size: 19px;
  }

  .limits-header-text p {
    font-size: 12px;
  }

  .limits-mode-card {
    padding: 14px 14px;
  }

  .limits-mode-big-num {
    font-size: 26px;
  }

  .limits-chart-card {
    padding: 14px 12px;
  }

  .limits-faq-card {
    padding: 14px 12px;
  }

  .limits-faq-card[open] {
    padding-bottom: 14px;
  }

  .limits-faq-summary {
    padding: 10px 10px;
  }

  .limits-faq-content {
    padding: 0 10px 10px;
  }
}

/* ==========================================================================
   Strategy workspace — contextual Helmer Ask
   ========================================================================== */

.strategy-ask-root {
  position: fixed;
  right: 28px;
  bottom: 26px;
  z-index: 1180;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.strategy-ask-launcher,
.strategy-ask-panel,
.strategy-ask-backdrop {
  pointer-events: auto;
}

.strategy-ask-backdrop {
  display: none;
  border: 0;
  background: transparent;
}

.strategy-ask-launcher {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 7px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.11));
  border-radius: 999px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.96);
  color: var(--theme-ink, #172033);
  box-shadow: 0 16px 38px var(--theme-shadow-soft, rgba(15, 23, 42, 0.13)), 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font: inherit;
  font-size: 13px;
  font-weight: 640;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  animation: strategy-ask-enter 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.strategy-ask-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--theme-blue-border, rgba(37, 99, 235, 0.26));
  box-shadow: 0 20px 44px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16)), 0 3px 10px rgba(37, 99, 235, 0.08);
}

.strategy-ask-root.is-open .strategy-ask-launcher {
  display: none;
}

/* A single focused action at a time: refinement owns the dock while open. */
.strategy-ask-root.is-refinement-open .strategy-ask-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
}

.strategy-ask-launcher-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--theme-blue-surface, #eff6ff), var(--theme-blue-surface, #e8f0ff));
  color: var(--theme-blue-ink, #2557d6);
}

.strategy-ask-launcher-icon > span {
  position: absolute;
  top: -2px;
  right: -1px;
  font-size: 10px;
}

.strategy-ask-panel {
  display: flex;
  width: min(400px, calc(100vw - 40px));
  height: min(680px, calc(100vh - 52px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.1));
  border-radius: 22px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.98);
  box-shadow: 0 28px 72px var(--theme-shadow-strong, rgba(15, 23, 42, 0.18)), 0 4px 16px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: strategy-ask-panel-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.strategy-ask-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px 13px 18px;
  border-bottom: 1px solid var(--theme-border, rgba(15, 23, 42, 0.07));
}

.strategy-ask-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.strategy-ask-heading strong {
  color: var(--theme-ink, #101828);
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.strategy-ask-context {
  overflow: hidden;
  color: var(--theme-muted, #667085);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-ask-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--theme-muted, #667085);
  cursor: pointer;
}

.strategy-ask-close:hover {
  background: var(--theme-surface-soft, #f2f4f7);
  color: var(--theme-ink, #101828);
}

.strategy-ask-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(180deg, var(--theme-surface, #fbfcfe) 0%, var(--theme-surface, #f8fafc) 100%);
  overscroll-behavior: contain;
}

.strategy-ask-welcome {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 9px 2px 12px;
}

.strategy-ask-orb {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  place-items: center;
  border: 1px solid var(--theme-blue-border, #dbe7ff);
  border-radius: 11px;
  background: var(--theme-blue-surface, #edf4ff);
  color: var(--theme-blue-ink, #2563eb);
}

.strategy-ask-welcome strong {
  color: var(--theme-ink, #172033);
  font-size: 14px;
  font-weight: 660;
}

.strategy-ask-welcome p {
  margin: 0;
  color: var(--theme-muted, #667085);
  font-size: 12.5px;
  line-height: 1.55;
}

.strategy-ask-suggestion {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--theme-border, #e4e9f0);
  border-radius: 12px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.9);
  color: var(--theme-copy, #344054);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.strategy-ask-suggestion:hover {
  transform: translateX(2px);
  border-color: var(--theme-blue-border, #c9d8f7);
  background: var(--theme-surface, #fff);
  color: var(--theme-blue-ink, #1d4ed8);
}

.strategy-ask-message.ask-message {
  display: flex;
  width: 100%;
  margin: 0;
}

.strategy-ask-message.ask-message-user {
  justify-content: flex-end;
}

.strategy-ask-message .ask-message-content {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid var(--theme-border, #e2e8f0);
  border-radius: 14px 14px 14px 5px;
  background: var(--theme-surface, #fff);
  color: var(--theme-ink, #27364a);
  font-size: 12.75px;
  line-height: 1.58;
  box-shadow: 0 1px 2px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03));
}

.strategy-ask-message.ask-message-user .ask-message-content {
  border-color: var(--theme-blue-border, #d7e3f8);
  border-radius: 14px 14px 5px 14px;
  background: var(--theme-blue-surface, #edf4ff);
  color: var(--theme-blue-ink, #19345f);
  white-space: pre-wrap;
}

.strategy-ask-message .ask-rich-text {
  font-size: inherit;
  line-height: inherit;
}

.strategy-ask-message .ask-rich-text h2,
.strategy-ask-message .ask-rich-text h3,
.strategy-ask-message .ask-rich-text h4 {
  font-size: 13.5px;
}

.strategy-ask-message .ask-table-wrap {
  max-width: 100%;
}

.strategy-ask-thinking {
  min-height: auto;
  padding: 0;
}

.strategy-ask-thinking-spark {
  color: var(--theme-blue-ink, #2563eb);
}

.strategy-ask-message-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--theme-border, #eef1f5);
}

.strategy-ask-action {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--theme-muted, #667085);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}

.strategy-ask-action:hover {
  background: var(--theme-surface-soft, #f2f4f7);
  color: var(--theme-copy, #344054);
}

.strategy-ask-action.is-copied {
  color: var(--theme-success-ink, #15803d);
}

.strategy-ask-error {
  padding: 10px 12px;
  border: 1px solid var(--theme-danger-border, #fecaca);
  border-radius: 11px;
  background: var(--theme-surface-soft, #fff7f7);
  color: var(--theme-danger-ink, #b42318);
  font-size: 12px;
  line-height: 1.45;
}

.strategy-ask-footer {
  display: grid;
  gap: 8px;
  padding: 10px 12px 11px;
  border-top: 1px solid var(--theme-border, rgba(15, 23, 42, 0.07));
  background: var(--theme-surface, #fff);
}

.strategy-ask-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--theme-border, #dfe5ec);
  border-radius: 14px;
  background: var(--theme-surface, #f8fafc);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.strategy-ask-composer:focus-within {
  border-color: var(--border-hover, #cbd5e1);
  background: var(--theme-surface, #fff);
  box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(0, 0, 0, 0.06));
  outline: none;
}

.strategy-ask-input {
  width: 100%;
  min-height: 34px;
  max-height: 110px;
  resize: none;
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  background: transparent;
  color: var(--theme-ink, #172033);
  font: inherit;
  font-size: 12.75px;
  line-height: 1.45;
}

.strategy-ask-input:focus,
.strategy-ask-input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.strategy-ask-input::placeholder {
  color: var(--theme-muted, #98a2b3);
}

.strategy-ask-send {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #1f5bd8;
  color: #fff;
  cursor: pointer;
}

.strategy-ask-send:hover:not(:disabled) {
  background: #174bb8;
}

.strategy-ask-send:disabled {
  background: var(--theme-surface-muted, #d0d5dd);
  cursor: default;
}

.strategy-ask-disclaimer {
  margin: 0;
  color: var(--theme-muted, #98a2b3);
  font-size: 9.5px;
  text-align: center;
}

@keyframes strategy-ask-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes strategy-ask-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
  .strategy-ask-root {
    right: 14px;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px);
  }

  .strategy-ask-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(80dvh, 760px);
    max-height: calc(100dvh - 82px);
    border-width: 1px 0 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -16px 48px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16));
    animation: strategy-ask-sheet-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .strategy-ask-panel::before {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--theme-surface-muted, #cbd5e1);
    content: "";
    transform: translateX(-50%);
  }

  .strategy-ask-root.is-open {
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .strategy-ask-root.is-open .strategy-ask-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: var(--theme-wash, rgba(15, 23, 42, 0.22));
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: strategy-ask-backdrop-in 180ms ease both;
  }

  .strategy-ask-header {
    min-height: 78px;
    padding: 28px 18px 12px;
  }

  .strategy-ask-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--theme-surface-soft, #f2f4f7);
  }

  .strategy-ask-body {
    padding: 16px 18px;
  }

  .strategy-ask-footer {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .strategy-ask-launcher {
    min-height: 46px;
    padding-right: 14px;
  }
}

@keyframes strategy-ask-sheet-in {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes strategy-ask-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Helmer v3.5 Release Announcement Toast Card
   ========================================================================== */

.v35-release-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  max-width: 440px;
  width: calc(100vw - 48px);
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.18),
              0 0 0 1px rgba(99, 102, 241, 0.12);
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

[data-theme="dark"] .v35-release-toast,
html.dark .v35-release-toast {
  background: #0f172a;
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(129, 140, 248, 0.2);
}

.v35-release-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.v35-release-toast.is-dismissing {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
}

.v35-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.v35-toast-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
  line-height: 1.35;
}

[data-theme="dark"] .v35-toast-title,
html.dark .v35-toast-title {
  color: #f8fafc;
}

.v35-toast-close {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-tertiary, #94a3b8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.v35-toast-close:hover {
  background: var(--bg-hover, rgba(15, 23, 42, 0.06));
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .v35-toast-close:hover,
html.dark .v35-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.v35-toast-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
  margin: 0 0 14px;
}

[data-theme="dark"] .v35-toast-body,
html.dark .v35-toast-body {
  color: #94a3b8;
}

.v35-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.v35-toast-dontshow-btn {
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-primary, #1e293b);
  border: 1px solid var(--border-subtle, #e2e8f0);
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.v35-toast-dontshow-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--border-hover, #cbd5e1);
}

[data-theme="dark"] .v35-toast-dontshow-btn,
html.dark .v35-toast-dontshow-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .v35-toast-dontshow-btn:hover,
html.dark .v35-toast-dontshow-btn:hover {
  background: #334155;
  color: #f8fafc;
}

.v35-toast-cta-btn {
  font-size: 12px;
  padding: 7px 15px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #4f6ee8 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(79, 110, 232, 0.3);
  transition: all 0.15s ease;
}

.v35-toast-cta-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(79, 110, 232, 0.4);
  transform: translateY(-1px);
}

/* Auto-dismiss progress bar */
.v35-toast-progress-wrap {
  margin-top: 12px;
  height: 3px;
  border-radius: 2px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

[data-theme="dark"] .v35-toast-progress-wrap,
html.dark .v35-toast-progress-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.v35-toast-progress-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #4f6ee8, #a855f7);
  transform-origin: left;
  transform: scaleX(1);
}

.v35-toast-progress-bar.is-running {
  animation: v35-progress-shrink linear forwards;
}

@keyframes v35-progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (max-width: 640px) {
  .v35-release-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .limits-view {
    padding: 14px 10px 60px;
  }

  .limits-segment-btn {
    font-size: 11px;
    padding: 4px 4px;
  }
}

/* Strategy refinement — compact, icon-triggered composer */
.refinement-dock {
  display: flex;
  width: auto;
  min-width: 0;
  padding: 5px;
  border-radius: 14px;
}

.refinement-dock .dock-actions-strip {
  gap: 2px;
}

.refinement-dock .dock-refine-toggle {
  width: 36px;
  justify-content: center;
  padding: 0;
  color: var(--theme-blue-ink, #3157d5);
}

.refinement-dock .dock-refine-toggle > span {
  display: none;
}

.refinement-dock .dock-refine-toggle:hover {
  background: rgba(49, 87, 213, 0.08);
  border-color: var(--theme-blue-border, rgba(49, 87, 213, 0.16));
}

.refinement-dock.is-expanded {
  border-color: var(--theme-blue-border, rgba(79, 110, 232, 0.24));
  box-shadow: 0 18px 46px -14px rgba(49, 87, 213, 0.24), 0 2px 7px var(--theme-shadow-soft, rgba(15, 23, 42, 0.06));
}

.refinement-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  display: grid;
  width: min(480px, calc(100vw - var(--rail-width) - 40px));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.1));
  border-radius: 16px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.97);
  box-shadow: 0 22px 58px var(--theme-shadow-strong, rgba(15, 23, 42, 0.16)), 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.05));
  transform: translateX(-50%);
  transform-origin: bottom center;
  animation: refinement-popover-in 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.refinement-popover .quick-actions,
.refinement-dock.is-expanded .quick-actions {
  display: flex;
  max-height: 42px;
  margin: 0;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
}

.refinement-popover .refinement-form {
  width: 100%;
  margin: 0;
}

@keyframes refinement-popover-in {
  from { opacity: 0; transform: translateX(-50%) translateY(7px) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@media (max-width: 700px) {
  .refinement-dock,
  body.sidebar-open .refinement-dock {
    left: 50%;
    width: auto;
  }

  .refinement-popover {
    width: calc(100vw - 24px);
  }
}

/* ==========================================================================
   Build Mode Model Dropdown Selector
   ========================================================================== */
.build-model-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.build-model-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: var(--theme-wash, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--theme-border, rgba(0, 0, 0, 0.07));
  border-radius: 8px;
  color: var(--text-primary, #1e293b);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.build-model-dropdown-trigger:hover,
.build-model-dropdown-trigger.is-open {
  background: var(--theme-wash, rgba(0, 0, 0, 0.07));
  border-color: var(--theme-border, rgba(0, 0, 0, 0.12));
}

.build-model-dropdown-label {
  letter-spacing: -0.01em;
}

.build-model-dropdown-arrow {
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.build-model-dropdown-trigger.is-open .build-model-dropdown-arrow {
  transform: rotate(180deg);
}

.build-model-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.1));
  border-radius: 12px;
  box-shadow: 0 12px 32px var(--theme-shadow-soft, rgba(15, 23, 42, 0.12)), 0 2px 6px var(--theme-shadow-soft, rgba(15, 23, 42, 0.04));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  animation: build-model-menu-in 0.15s ease-out;
}

@keyframes build-model-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.build-model-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.build-model-dropdown-item:hover {
  background: var(--theme-wash, rgba(0, 0, 0, 0.04));
}

.build-model-dropdown-item.is-selected {
  background: rgba(79, 110, 232, 0.08);
}

.build-model-item-left {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
}

.build-model-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--theme-wash, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #1e293b);
  flex-shrink: 0;
  margin-top: 1px;
}

.build-model-dropdown-item.is-selected .build-model-item-icon {
  background: var(--accent, #4f6ee8);
  color: #ffffff;
}

.build-model-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-model-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.build-model-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.build-model-item-subtitle {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  font-weight: 450;
}

.build-model-item-desc {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

.build-model-item-check {
  color: var(--theme-blue-ink, var(--accent, #4f6ee8));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 6px;
}

/* Refined strategy controls: quiet toolbar, segmented suggestions, spacious composer. */
.refinement-dock { padding: 4px; border: 1px solid var(--theme-border, rgba(15, 23, 42, .08)); border-radius: 14px; background: var(--theme-surface, #fbfcfd); box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(15, 23, 42, .06)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.refinement-dock:focus-within, .refinement-dock.is-expanded { border-color: var(--theme-border, rgba(15, 23, 42, .1)); box-shadow: 0 4px 14px var(--theme-shadow-soft, rgba(15, 23, 42, .06)); }
.refinement-dock .dock-actions-strip { gap: 3px; }
.refinement-dock .dock-action-btn { min-height: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--theme-copy, #526070); font-size: 14px; font-weight: 550; }
.refinement-dock .dock-action-btn:hover:not(:disabled) { border-color: transparent; background: var(--theme-surface-soft, #f0f2f4); box-shadow: none; color: var(--theme-ink, #172033); transform: none; }
.refinement-dock .dock-action-btn:focus-visible, .refinement-dock .quick-action:focus-visible, .refinement-dock .refine-submit:focus-visible { outline: 2px solid var(--theme-blue-border, rgba(49, 87, 213, .78)); outline-offset: 2px; }
.refinement-dock .dock-refine-toggle { width: 40px; justify-content: center; padding: 0; color: var(--theme-copy, #344154); }
.refinement-dock .dock-refine-toggle > span { display: none; }
.refinement-dock .dock-toolbar-separator { width: 1px; height: 18px; margin: 0 4px; background: var(--theme-surface-muted, #dfe3e8); }
.refinement-dock .dock-save-btn.is-saved { border: 0; background: transparent; color: var(--theme-success-ink, #16803d); font-weight: 550; opacity: 1; }
.refinement-dock .dock-save-btn.is-saved .dock-btn-icon { color: currentColor; }
.refinement-dock .dock-save-btn:disabled:not(.is-saved) { opacity: .45; }
.refinement-dock .dock-export-wrap .export-menu { border-radius: 14px; background: var(--theme-surface, #fff); box-shadow: 0 10px 28px var(--theme-shadow-soft, rgba(15, 23, 42, .12)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.refinement-popover { bottom: calc(100% + 12px); width: min(680px, calc(100vw - var(--rail-width) - 48px)); gap: 16px; padding: 18px; border: 1px solid var(--theme-border, #e3e6ea); border-radius: 22px; background: var(--theme-surface, #fff); box-shadow: 0 12px 32px var(--theme-shadow-soft, rgba(15, 23, 42, .09)); animation: refinement-popover-in 160ms cubic-bezier(.16, 1, .3, 1) both; backdrop-filter: none; -webkit-backdrop-filter: none; }
.refinement-popover .quick-actions, .refinement-dock.is-expanded .quick-actions { display: flex; min-width: 0; max-height: none; margin: 0; padding: 3px; overflow-x: auto; opacity: 1; pointer-events: auto; border-radius: 15px; background: var(--theme-surface-soft, #f5f6f7); }
.refinement-popover .quick-action { min-height: 40px; height: 40px; gap: 7px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--theme-copy, #4b5868); font-size: 14px; font-weight: 550; transform: none; }
.refinement-popover .quick-action + .quick-action { border-left: 1px solid var(--theme-border, #dfe3e8); border-radius: 0; }
.refinement-popover .quick-action:hover:not(:disabled) { border-color: transparent; border-radius: 9px; background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.72); color: var(--theme-ink, #172033); transform: none; }
.refinement-popover .quick-action--shorten .quick-action-icon { color: var(--theme-warning-ink, #c78a12); }
.refinement-popover .quick-action-icon { display: inline-flex; width: 16px; height: 16px; color: currentColor; }
.refinement-popover .quick-action-icon svg { width: 100%; height: 100%; }
.refinement-popover .refinement-form { display: flex; width: 100%; min-height: 52px; margin: 0; padding: 6px 8px; align-items: center; gap: 8px; border: 1px solid var(--theme-border, #e0e4e8); border-radius: 15px; background: var(--theme-surface, #fff); box-shadow: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
.refinement-popover .refinement-form:focus-within { border-color: var(--theme-border-strong, #cbd5e1); background: var(--theme-surface, #fff); box-shadow: 0 2px 10px var(--theme-shadow-soft, rgba(15, 23, 42, .06)); outline: none; }
.refinement-popover .refine-input-prefix { margin: 0 2px 0 4px; color: var(--theme-muted, #7b8794); opacity: 1; display: flex; align-items: center; justify-content: center; }
.refinement-popover .refinement-input { min-height: 28px; max-height: 120px; padding: 4px 0; color: var(--theme-ink, #1d2939); font-size: 14px; line-height: 1.45; border: 0 !important; outline: 0 !important; outline-offset: 0 !important; box-shadow: none !important; background: transparent; flex: 1; resize: none; }
.refinement-popover .refinement-input:focus, .refinement-popover .refinement-input:focus-visible { border: 0 !important; outline: 0 !important; outline-offset: 0 !important; box-shadow: none !important; }
.refinement-popover .refine-submit { width: 36px; height: 36px; margin: 0; border-radius: 10px; background: var(--theme-inverse-surface, #152238); color: #fff; box-shadow: none; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.refinement-popover .refine-submit:hover:not(:disabled) { background: var(--theme-inverse-surface, #0e1a2b); box-shadow: none; transform: none; }
.refinement-popover .refine-submit:disabled { background: var(--theme-surface-soft, #f0f2f4); color: var(--theme-muted, #9aa4b2); opacity: 1; }
@keyframes refinement-popover-in { from { opacity: 0; transform: translateX(-50%) translateY(6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@media (max-width: 700px) { .refinement-dock, body.sidebar-open .refinement-dock { left: 50%; max-width: calc(100vw - 16px); } .refinement-popover { width: calc(100vw - 24px); padding: 14px; gap: 14px; border-radius: 20px; } .refinement-popover .quick-action { padding: 0 14px; } }

/* Compact single-purpose refinement composer. */
.refinement-popover { gap: 0; padding: 14px; }

/* ==========================================================================
   Strategy document — premium editorial surface
   Navigation, TOC structure, anchors and scroll-spy remain unchanged.
   ========================================================================== */
.workspace-document {
  --strategy-paper: var(--theme-surface, #fafafa);
  --strategy-surface: var(--theme-surface, #fff);
  --strategy-ink: var(--theme-ink, #18181b);
  --strategy-copy: var(--theme-copy, #52525b);
  --strategy-muted: var(--theme-muted, #71717a);
  --strategy-border: var(--theme-border, #e4e4e7);
  background: var(--strategy-paper);
  padding-bottom: calc(156px + env(safe-area-inset-bottom));
}

.workspace-document .strategy-view {
  width: min(100%, 1168px);
}

.workspace-document .strategy-toolbar {
  background: color-mix(in srgb, var(--strategy-paper) 92%, transparent);
}

.workspace-document .strategy-local-shell {
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 48px;
}

.workspace-document .strategy-document-canvas {
  width: 100%;
  max-width: 960px;
  color: var(--strategy-ink);
}

.workspace-document .strategy-overview {
  padding: 24px 0 32px;
}

.workspace-document .strategy-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--strategy-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.workspace-document .strategy-meta .meta-divider {
  color: var(--theme-muted, #d4d4d8);
}

.workspace-document .reading-time-badge {
  color: inherit;
  font-size: inherit;
}

.workspace-document .strategy-title {
  max-width: 21ch;
  margin: 24px 0 34px;
  overflow-wrap: anywhere;
  color: var(--strategy-ink);
  font-size: clamp(2rem, 3.35vw, 3.35rem);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.workspace-document .strategy-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 36px;
  border-top: 1px solid var(--strategy-border);
  border-bottom: 1px solid var(--strategy-border);
}

.workspace-document .strategy-context-item {
  display: block;
  min-width: 0;
  padding: 18px 20px 19px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-document .strategy-context-item:nth-child(even) {
  padding-right: 0;
  padding-left: 24px;
  border-left: 1px solid var(--strategy-border);
}

.workspace-document .strategy-context-item:nth-child(n + 3) {
  border-top: 1px solid var(--strategy-border);
}

.workspace-document .strategy-context-label,
.workspace-document .strategy-context-value {
  margin: 0;
}

.workspace-document .strategy-context-label {
  margin-bottom: 6px;
  color: var(--strategy-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
  text-transform: uppercase;
}

.workspace-document .strategy-context-value {
  overflow-wrap: anywhere;
  color: var(--strategy-ink);
  font-size: 14.5px;
  font-weight: 540;
  line-height: 1.55;
}

.workspace-document .strategy-executive-card {
  margin: 0;
  padding: 23px 28px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--theme-surface-soft, #f5f7fc);
  box-shadow: none;
}

.workspace-document .exec-card-header {
  margin-bottom: 10px;
}

.workspace-document .exec-summary-text {
  max-width: 76ch;
  color: var(--strategy-ink);
  font-size: 16.5px;
  font-weight: 470;
  line-height: 1.68;
}

.workspace-document .strategy-work-section {
  padding: clamp(72px, 7vw, 92px) 0 0;
  border-top: 0;
}

.workspace-document .strategy-work-section + .strategy-work-section {
  margin-top: clamp(72px, 7vw, 92px);
  border-top: 1px solid var(--strategy-border);
}

.workspace-document .strategy-work-section .section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.workspace-document .strategy-work-section .section-heading h2 {
  color: var(--strategy-ink);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.18;
  text-wrap: balance;
}

.workspace-document .section-description {
  max-width: 72ch;
  margin-top: 9px;
  color: var(--strategy-copy);
  font-size: 15px;
  line-height: 1.62;
}

.workspace-document .strategy-pillar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.workspace-document .strategy-pillar-card {
  min-width: 0;
  padding: 20px 20px 22px;
  border: 1px solid var(--strategy-border);
  border-top: 2px solid var(--theme-border, #d4d4d8);
  border-radius: 14px;
  background: var(--strategy-surface);
  box-shadow: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.workspace-document .strategy-pillar-card.priority-high { border-top-color: var(--theme-danger-border, #c45858); }
.workspace-document .strategy-pillar-card.priority-medium { border-top-color: var(--theme-warning-border, #b5822e); }
.workspace-document .strategy-pillar-card.priority-low { border-top-color: var(--theme-success-border, #4e8b77); }

.workspace-document .strategy-pillar-card:hover {
  border-right-color: var(--theme-border, #d4d4d8);
  border-bottom-color: var(--theme-border, #d4d4d8);
  border-left-color: var(--theme-border, #d4d4d8);
  background: var(--theme-surface, #fefefe);
  box-shadow: none;
  transform: none;
}

.workspace-document .pillar-badge,
.workspace-document .risk-badge {
  border-radius: 5px;
}

.workspace-document .pillar-title {
  font-size: 16.5px;
  line-height: 1.4;
}

.workspace-document .pillar-desc {
  color: var(--strategy-copy);
  font-size: 14px;
  line-height: 1.64;
}

.workspace-document .editorial-sections-list {
  display: block;
}

.workspace-document .editorial-section-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-document .editorial-section-card + .editorial-section-card {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--strategy-border);
}

.workspace-document .editorial-card-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 25px;
  padding: 0;
  border: 0;
}

.workspace-document .editorial-idx {
  padding-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.workspace-document .editorial-title {
  overflow-wrap: anywhere;
  color: var(--strategy-ink);
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.workspace-document .editorial-card-body {
  gap: 28px;
  padding-left: 74px;
}

.workspace-document .editorial-decision-box {
  max-width: 78ch;
  padding: 17px 20px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--theme-surface-soft, #f4f4f5);
}

.workspace-document .decision-label,
.workspace-document .rationale-label,
.workspace-document .actions-label {
  margin-bottom: 8px;
  color: var(--strategy-muted);
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.workspace-document .decision-label { color: var(--theme-blue-ink, var(--accent)); }

.workspace-document .decision-text {
  color: var(--strategy-ink);
  font-size: 15.5px;
  font-weight: 580;
  line-height: 1.62;
}

.workspace-document .rationale-text {
  max-width: 78ch;
  color: var(--strategy-copy);
  font-size: 16px;
  line-height: 1.68;
}

.workspace-document .editorial-bullets {
  max-width: 78ch;
  padding-left: 1.25rem;
  list-style: disc;
  gap: 10px;
}

.workspace-document .editorial-bullets li {
  display: list-item;
  padding-left: 4px;
  color: var(--strategy-copy);
  font-size: 15px;
  line-height: 1.62;
}

.workspace-document .editorial-bullets li::marker {
  color: var(--theme-blue-ink, var(--accent));
  font-size: 0.72em;
}

.workspace-document .editorial-bullets .bullet-check {
  display: none;
}

.workspace-document .roadmap-timeline {
  position: relative;
  gap: 20px;
  padding-left: 38px;
}

.workspace-document .roadmap-timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 10px;
  width: 1px;
  background: var(--theme-surface-muted, #d4d4d8);
  content: "";
}

.workspace-document .roadmap-phase-card {
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--strategy-border);
  border-radius: 14px;
  background: var(--strategy-surface);
  box-shadow: none;
}

.workspace-document .roadmap-phase-card::before {
  position: absolute;
  top: 27px;
  left: -33px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--strategy-paper);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  content: "";
}

.workspace-document .phase-card-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.workspace-document .phase-badge {
  padding: 0;
  background: transparent;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-document .phase-title {
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.4;
}

.workspace-document .phase-action-list {
  gap: 9px;
  margin-bottom: 17px;
  padding-left: 18px;
  list-style: disc;
}

.workspace-document .phase-action-list li {
  display: list-item;
  color: var(--strategy-copy);
  font-size: 14.5px;
  line-height: 1.58;
}

.workspace-document .phase-action-list li::marker { color: var(--theme-muted, #a1a1aa); }
.workspace-document .phase-action-list .action-dot { display: none; }

.workspace-document .phase-outcome {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 8px;
  padding: 13px 0 0;
  border-top: 1px solid var(--strategy-border);
  border-radius: 0;
  background: transparent;
  color: var(--strategy-copy);
  font-size: 13.5px;
  line-height: 1.55;
}

.workspace-document .phase-outcome strong {
  color: var(--strategy-ink);
}

.workspace-document .outcome-icon { display: none; }

.workspace-document .kpi-cards-grid,
.workspace-document .risk-cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.workspace-document .kpi-card,
.workspace-document .risk-card {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--strategy-border);
  border-radius: 14px;
  background: var(--strategy-surface);
  box-shadow: none;
}

.workspace-document .kpi-card:hover {
  border-color: var(--theme-border, #d4d4d8);
  box-shadow: none;
  transform: none;
}

.workspace-document .kpi-card-header { margin-bottom: 15px; }

.workspace-document .kpi-name {
  color: var(--strategy-ink);
  font-size: 16.5px;
  line-height: 1.4;
}

.workspace-document .kpi-target-box {
  gap: 5px;
  margin: 0 0 13px;
  padding: 13px 0;
  border-width: 1px 0;
  border-style: solid;
  border-color: var(--strategy-border);
  border-radius: 0;
  background: transparent;
}

.workspace-document .kpi-target-value {
  color: var(--strategy-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.workspace-document .kpi-desc {
  color: var(--strategy-copy);
  font-size: 14px;
  line-height: 1.62;
}

.workspace-document .risk-card-top {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 13px;
}

.workspace-document .risk-title {
  overflow-wrap: anywhere;
  color: var(--strategy-ink);
  font-size: 16px;
  line-height: 1.45;
}

.workspace-document .risk-mitigation {
  padding-top: 13px;
  border-top: 1px solid var(--strategy-border);
  color: var(--strategy-copy);
  font-size: 14px;
  line-height: 1.62;
}

.workspace-document .section-heading-with-action {
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 36px;
}

.workspace-document .section-heading-with-action .section-heading { margin-bottom: 0; }

.workspace-document .add-to-planner-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--strategy-border);
  border-radius: 10px;
  background: var(--strategy-surface);
  color: var(--strategy-ink);
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}

.workspace-document .add-to-planner-btn:hover:not(:disabled) {
  border-color: var(--theme-border-strong, #c7c7cc);
  background: var(--theme-surface-soft, #f4f4f5);
}

.workspace-document .action-checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--strategy-border);
}

.workspace-document .checklist-group-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.23fr) minmax(0, 1fr);
  gap: 28px;
  padding: 26px 0;
  border: 0;
  border-bottom: 1px solid var(--strategy-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-document .checklist-group-title {
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.workspace-document .checklist-items-list { gap: 6px; }

.workspace-document .checklist-item {
  grid-template-columns: 44px minmax(0, 1fr) max-content;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  padding: 4px 0;
  border-radius: 9px;
  color: var(--strategy-copy);
  font-size: 14.5px;
  line-height: 1.58;
  transition: background-color 160ms ease;
}

.workspace-document .checklist-item:hover { background: var(--theme-surface-soft, #f4f4f5); }

.workspace-document .checklist-item input {
  width: 18px;
  height: 18px;
  margin: 0 13px;
}

.workspace-document .checklist-item-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-document .item-plan-btn {
  min-height: 36px;
  margin-right: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--theme-blue-ink, var(--accent));
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.workspace-document .item-plan-btn:hover:not(:disabled) { background: var(--accent-soft); }

.workspace-document .checklist-item:has(input:checked) {
  background: var(--theme-surface, #fafafa);
}

.workspace-document .checklist-item:has(input:checked) .checklist-item-text {
  color: var(--strategy-muted);
}

.workspace-document .assumptions-panel {
  margin: 88px 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--strategy-border);
  border-bottom: 1px solid var(--strategy-border);
}

.workspace-document .assumptions-panel summary {
  position: relative;
  padding: 20px 44px 20px 0;
  color: var(--strategy-ink);
  font-size: 14px;
  font-weight: 620;
  list-style: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.workspace-document .assumptions-panel summary::-webkit-details-marker { display: none; }

.workspace-document .assumptions-panel summary::after {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--strategy-muted);
  content: "⌄";
  font-size: 18px;
  transform: translateY(-55%) rotate(0deg);
  transition: transform 180ms ease;
}

.workspace-document .assumptions-panel[open] summary::after {
  transform: translateY(-45%) rotate(180deg);
}

.workspace-document .assumptions-panel summary:hover { color: var(--theme-blue-ink, var(--accent)); }

.workspace-document .assumptions-panel .decision-list {
  max-width: 76ch;
  padding: 4px 0 22px 22px;
  color: var(--strategy-copy);
  font-size: 15px;
  line-height: 1.68;
}

.workspace-document :is(button, a, input, textarea, summary):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
}

/* One related floating action system: utilities on the left, Ask on the right. */
.workspace-document .refinement-dock {
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: auto;
  max-width: calc(100vw - var(--rail-width) - 32px);
  padding: 5px;
  border: 1px solid var(--theme-border, rgba(24, 24, 27, 0.12));
  border-radius: 14px;
  background: rgba(var(--theme-surface-rgb, 255, 255, 255), 0.94);
  box-shadow: 0 8px 26px var(--theme-shadow-soft, rgba(24, 24, 27, 0.09));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.workspace-document .refinement-dock .dock-actions-strip { gap: 2px; }

.workspace-document .refinement-dock .dock-action-btn {
  min-height: 40px;
  height: 40px;
  color: var(--strategy-copy);
  font-size: 12.5px;
}

.workspace-document .refinement-dock .dock-refine-toggle { color: var(--strategy-copy); }

.workspace-document .refinement-dock .dock-ask-btn {
  gap: 8px;
  padding: 0 14px;
  background: #0b1f3a;
  color: #fff;
  font-weight: 680;
}

.workspace-document .refinement-dock .dock-ask-btn:hover:not(:disabled) {
  background: #132d52;
  color: #fff;
}

.workspace-document .refinement-dock .dock-ask-btn:active:not(:disabled) {
  background: #08172c;
}

.workspace-document .dock-ask-separator { margin-left: 3px; }

.workspace-document .strategy-view.is-ask-open .refinement-dock {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.workspace-document .strategy-ask-root:not(.is-open) { display: none; }

@media (max-width: 1120px) {
  .workspace-document .strategy-pillar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workspace-document .strategy-local-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .workspace-document .strategy-document-canvas { max-width: 960px; }
}

@media (max-width: 768px) {
  .workspace-document .strategy-title { max-width: 24ch; }

  .workspace-document .strategy-pillar-grid,
  .workspace-document .kpi-cards-grid,
  .workspace-document .risk-cards-grid {
    grid-template-columns: 1fr;
  }

  .workspace-document .editorial-card-body { padding-left: 0; }

  .workspace-document .section-heading-with-action {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-document .add-to-planner-btn { align-self: flex-start; }

  .workspace-document .checklist-group-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .workspace-document {
    padding-right: 16px;
    padding-bottom: calc(144px + env(safe-area-inset-bottom));
    padding-left: 16px;
  }

  .workspace-document .strategy-overview { padding-top: 14px; }

  .workspace-document .strategy-title {
    margin: 20px 0 28px;
    font-size: clamp(1.85rem, 9vw, 2.5rem);
    letter-spacing: -0.04em;
  }

  .workspace-document .strategy-context-grid { grid-template-columns: 1fr; }

  .workspace-document .strategy-context-item,
  .workspace-document .strategy-context-item:nth-child(even) {
    padding: 15px 0;
    border-left: 0;
  }

  .workspace-document .strategy-context-item + .strategy-context-item {
    border-top: 1px solid var(--strategy-border);
  }

  .workspace-document .strategy-executive-card { padding: 20px 18px; }
  .workspace-document .exec-summary-text { font-size: 15.5px; }

  .workspace-document .strategy-work-section,
  .workspace-document .strategy-work-section + .strategy-work-section {
    margin-top: 64px;
    padding-top: 64px;
  }

  .workspace-document .strategy-blog-container > .strategy-work-section:first-child {
    margin-top: 0;
  }

  .workspace-document .editorial-card-header {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .workspace-document .editorial-idx { padding-top: 0; }

  .workspace-document .editorial-section-card + .editorial-section-card {
    margin-top: 40px;
    padding-top: 40px;
  }

  .workspace-document .roadmap-timeline {
    padding-left: 24px;
  }

  .workspace-document .roadmap-timeline::before { left: 5px; }

  .workspace-document .roadmap-phase-card::before { left: -24px; }

  .workspace-document .phase-outcome {
    grid-template-columns: 1fr;
  }

  .workspace-document .checklist-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .workspace-document .item-plan-btn {
    grid-column: 2;
    justify-self: start;
    margin: 0;
  }

  .workspace-document .refinement-dock,
  body.sidebar-open .workspace-document .refinement-dock {
    bottom: calc(8px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
  }

  .workspace-document .refinement-dock .dock-export-btn > span,
  .workspace-document .refinement-dock .dock-export-btn .dock-chevron-icon,
  .workspace-document .refinement-dock .dock-save-btn > span {
    display: none;
  }

  .workspace-document .refinement-dock .dock-export-btn,
  .workspace-document .refinement-dock .dock-save-btn {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .workspace-document .refinement-dock .dock-ask-btn {
    min-width: 0;
    padding: 0 12px;
  }

  .workspace-document .refinement-dock .dock-ask-btn > span {
    overflow: hidden;
    max-width: 132px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-document .refinement-dock .dock-summary-btn > span {
    overflow: hidden;
    max-width: 90px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-document .dock-toolbar-separator:not(.dock-ask-separator):not(.dock-summary-separator) { display: none; }
}

@media (max-width: 380px) {
  .workspace-document .refinement-dock .dock-ask-btn > span { max-width: 104px; }
  .workspace-document .refinement-dock .dock-action-btn { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-document *,
  .workspace-document *::before,
  .workspace-document *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Existing inverse controls and switch thumbs keep their intended contrast. */
[data-theme="dark"] .skip-link,
html.dark .skip-link { color: var(--bg-canvas); }
[data-theme="dark"] .rail-toggle-thumb,
[data-theme="dark"] .settings-toggle-thumb,
html.dark .rail-toggle-thumb,
html.dark .settings-toggle-thumb { background: var(--text-primary); }
[data-theme="dark"] :focus-visible,
html.dark :focus-visible { outline-color: rgba(59, 130, 246, 0.7); }
[data-theme="dark"] .auth-story,
html.dark .auth-story { background: var(--bg-canvas); }
[data-theme="dark"] .auth-brand-statement h2,
html.dark .auth-brand-statement h2 { color: var(--text-primary); }
[data-theme="dark"] .auth-story-copyright,
html.dark .auth-story-copyright { color: var(--text-tertiary); }

/* Dark-only paint refinement. Composer geometry is shared by both themes. */
[data-theme="dark"] .workspace-intake,
[data-theme="dark"] .workspace-centered:has(.intake-view),
[data-theme="dark"] .workspace-ask.is-empty,
[data-theme="dark"] .workspace:has(.ask-shell.is-empty),
html.dark .workspace-intake,
html.dark .workspace-centered:has(.intake-view),
html.dark .workspace-ask.is-empty,
html.dark .workspace:has(.ask-shell.is-empty) {
  background:
    radial-gradient(ellipse 75% 55% at 50% 45%, rgba(30, 58, 138, 0.42) 0%, rgba(23, 37, 84, 0.55) 35%, rgba(15, 23, 42, 0.35) 60%, rgba(0, 0, 0, 0) 80%),
    var(--bg-canvas);
}

[data-theme="dark"] .workspace-document,
html.dark .workspace-document {
  background: var(--bg-canvas);
}

[data-theme="dark"] .workspace-document .strategy-toolbar,
html.dark .workspace-document .strategy-toolbar {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .auth-root,
html.dark .auth-root {
  background: var(--bg-canvas);
}

/* Premium Hero Typography in Dark Mode */
[data-theme="dark"] .ask-shell.is-empty .ask-title,
[data-theme="dark"] .workspace-intake .ask-title,
html.dark .ask-shell.is-empty .ask-title,
html.dark .workspace-intake .ask-title {
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 55%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Floating Input Composers (Ask & Build) in Slate Architecture */
[data-theme="dark"] .ask-composer,
[data-theme="dark"] .composer-card,
html.dark .ask-composer,
html.dark .composer-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  outline: none;
}

[data-theme="dark"] .ask-composer:hover,
[data-theme="dark"] .composer-card:hover,
html.dark .ask-composer:hover,
html.dark .composer-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .ask-composer:focus-within,
[data-theme="dark"] .composer-card:focus-within,
html.dark .ask-composer:focus-within,
html.dark .composer-card:focus-within {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.7);
  outline: none;
}

[data-theme="dark"] .ask-composer.is-dragover,
[data-theme="dark"] .composer-card.is-dragover,
html.dark .ask-composer.is-dragover,
html.dark .composer-card.is-dragover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.7);
}

/* Textarea and Input Placeholders in text-slate-500 */
[data-theme="dark"] .composer-input::placeholder,
[data-theme="dark"] .question-input::placeholder,
[data-theme="dark"] .refinement-input::placeholder,
[data-theme="dark"] .strategy-ask-input::placeholder,
[data-theme="dark"] .ask-composer-input::placeholder,
[data-theme="dark"] .library-search::placeholder,
[data-theme="dark"] .ask-input::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
html.dark .composer-input::placeholder,
html.dark .question-input::placeholder,
html.dark .refinement-input::placeholder,
html.dark .strategy-ask-input::placeholder,
html.dark .ask-composer-input::placeholder,
html.dark .library-search::placeholder,
html.dark .ask-input::placeholder,
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

/* Sidebar & Navigation in Dark Theme (Pure Black Matching Railbar) */
[data-theme="dark"] .sidebar,
html.dark .sidebar {
  background: #000000;
  border-right: 1px solid #1e293b;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .sidebar-mode-switch,
html.dark .sidebar-mode-switch {
  background: #141415;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-mode-option,
html.dark .sidebar-mode-option {
  color: #9ca3af;
}

[data-theme="dark"] .sidebar-mode-option:hover,
html.dark .sidebar-mode-option:hover {
  color: #f4f4f5;
}

[data-theme="dark"] .sidebar-mode-option.is-active,
html.dark .sidebar-mode-option.is-active {
  background: rgba(38, 38, 38, 0.85); /* bg-neutral-800/80 rounded-full text-white */
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .sidebar-mode-badge,
html.dark .sidebar-mode-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
}

[data-theme="dark"] .sidebar-mode-option.is-active .sidebar-mode-badge,
html.dark .sidebar-mode-option.is-active .sidebar-mode-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

[data-theme="dark"] .new-strategy-button,
html.dark .new-strategy-button {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #f1f5f9;
}

[data-theme="dark"] .new-strategy-button:hover,
html.dark .new-strategy-button:hover {
  background: rgba(38, 38, 38, 0.4); /* bg-neutral-800/40 */
  color: #ffffff;
}

[data-theme="dark"] .new-strategy-button .nav-svg,
html.dark .new-strategy-button .nav-svg {
  color: #94a3b8;
}

[data-theme="dark"] .new-strategy-button:hover .nav-svg,
html.dark .new-strategy-button:hover .nav-svg {
  color: #ffffff;
}

[data-theme="dark"] .nav-item,
html.dark .nav-item {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #94a3b8;
}

[data-theme="dark"] .nav-item:hover,
html.dark .nav-item:hover {
  background: rgba(38, 38, 38, 0.4); /* bg-neutral-800/40 */
  color: #ffffff;
}

[data-theme="dark"] .nav-item.is-active,
html.dark .nav-item.is-active {
  background: rgba(38, 38, 38, 0.6);
  color: #ffffff;
}

[data-theme="dark"] .nav-item .nav-svg,
html.dark .nav-item .nav-svg {
  color: #94a3b8;
  opacity: 0.9;
}

[data-theme="dark"] .nav-item:hover .nav-svg,
html.dark .nav-item:hover .nav-svg {
  color: #ffffff;
  opacity: 1;
}

[data-theme="dark"] .nav-item.is-active .nav-svg,
html.dark .nav-item.is-active .nav-svg {
  color: #ffffff;
  opacity: 1;
}

/* Sidebar Global Search Spotlight */
.sidebar-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(15vh, 120px);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  animation: fadeInModal 140ms ease-out;
}

.sidebar-search-card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(520px, 75vh);
  background: var(--theme-surface, #ffffff);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-search-header .nav-svg {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.sidebar-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
}

.sidebar-search-kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--theme-surface-soft, #f1f3f5);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
}

.sidebar-search-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 110ms ease;
  gap: 12px;
}

.sidebar-search-item:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}

.sidebar-search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  pointer-events: none;
}

.sidebar-search-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.sidebar-search-item-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.sidebar-search-item-type {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
  flex-shrink: 0;
  pointer-events: none;
}

.sidebar-search-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

[data-theme="dark"] .sidebar-search-card,
html.dark .sidebar-search-card {
  background: #141415;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .sidebar-search-header,
html.dark .sidebar-search-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-search-item:hover,
html.dark .sidebar-search-item:hover {
  background: rgba(38, 38, 38, 0.6);
}

[data-theme="dark"] .sidebar-search-kbd,
html.dark .sidebar-search-kbd {
  background: #262626;
  border-color: rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
}

[data-theme="dark"] .sidebar-search-item-type,
html.dark .sidebar-search-item-type {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.sidebar-search-handle {
  display: none;
}

.sidebar-search-close {
  display: none;
}

/* Mobile Search Bottom Sheet */
@media (max-width: 768px) {
  .sidebar-search-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.72);
  }

  .sidebar-search-card {
    width: 100%;
    max-width: 100%;
    min-height: 52vh;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUpSearchSheet 0.26s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }

  .sidebar-search-handle {
    display: block;
    width: 36px;
    height: 4.5px;
    border-radius: 9999px;
    background: var(--text-tertiary, #94a3b8);
    opacity: 0.45;
    margin: 10px auto 2px auto;
    flex-shrink: 0;
  }

  .sidebar-search-header {
    padding: 10px 16px 12px 16px;
  }

  .sidebar-search-input {
    font-size: 16px; /* Avoid iOS Safari auto-zoom */
  }

  .sidebar-search-kbd {
    display: none;
  }

  .sidebar-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s ease;
  }

  [data-theme="dark"] .sidebar-search-close,
  html.dark .sidebar-search-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
  }

  .sidebar-search-item {
    min-height: 44px;
    padding: 10px 14px;
  }
}

@keyframes slideUpSearchSheet {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

[data-theme="dark"] .mobile-header,
html.dark .mobile-header {
  border-bottom: none;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .mobile-header.is-chat-active,
html.dark .mobile-header.is-chat-active {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0) 100%);
  border-bottom: none;
  box-shadow: none;
}

[data-theme="dark"] .mobile-header-intake #mobileMenuButton,
html.dark .mobile-header-intake #mobileMenuButton,
[data-theme="dark"] .mobile-header-intake .icon-button,
html.dark .mobile-header-intake .icon-button,
[data-theme="dark"] .mobile-header .mobile-menu-pill-btn,
html.dark .mobile-header .mobile-menu-pill-btn,
[data-theme="dark"] .mobile-header #mobileChatMenuButton,
html.dark .mobile-header #mobileChatMenuButton,
[data-theme="dark"] .mobile-model-pill-btn,
html.dark .mobile-model-pill-btn,
[data-theme="dark"] .mobile-header #mobileChatModelButton,
html.dark .mobile-header #mobileChatModelButton,
[data-theme="dark"] .mobile-header .mobile-new-pill-btn,
html.dark .mobile-header .mobile-new-pill-btn,
[data-theme="dark"] .mobile-header #mobileNewButton,
html.dark .mobile-header #mobileNewButton,
[data-theme="dark"] .mobile-actions-pill,
html.dark .mobile-actions-pill {
  background: rgba(18, 18, 20, 0.88);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .mobile-mode-switch:not([hidden]),
html.dark .mobile-mode-switch:not([hidden]) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

[data-theme="dark"] .mobile-mode-option.is-active,
html.dark .mobile-mode-option.is-active {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sidebar-footer,
html.dark .sidebar-footer {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .sidebar-footer:hover,
html.dark .sidebar-footer:hover {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .recent-empty,
html.dark .recent-empty {
  background: rgba(30, 41, 59, 0.4);
  border-color: #1e293b;
  color: #64748b;
}

[data-theme="dark"] .recent-empty strong,
html.dark .recent-empty strong {
  color: #94a3b8;
}

[data-theme="dark"] .recent-item:hover,
html.dark .recent-item:hover {
  background: #1e293b;
}

[data-theme="dark"] .recent-item.is-active,
html.dark .recent-item.is-active {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .nav-count,
html.dark .nav-count {
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-item.is-active .nav-count,
html.dark .nav-item.is-active .nav-count {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: transparent;
}

[data-theme="dark"] .recent-delete-btn:hover,
html.dark .recent-delete-btn:hover {
  background: rgba(248, 113, 113, 0.16);
  color: #f87171;
}

[data-theme="dark"] .recent-icon-wrap,
html.dark .recent-icon-wrap {
  background: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .recent-item:hover .recent-icon-wrap,
html.dark .recent-item:hover .recent-icon-wrap {
  background: #334155;
  color: #f1f5f9;
}

/* Strategy View: 2x2 Context Grid, KPIs, and Risks */
[data-theme="dark"] .workspace-document .strategy-context-grid,
html.dark .workspace-document .strategy-context-grid {
  border-color: #1e293b;
}

[data-theme="dark"] .workspace-document .strategy-context-item:nth-child(even),
html.dark .workspace-document .strategy-context-item:nth-child(even) {
  border-left-color: #1e293b;
}

[data-theme="dark"] .workspace-document .strategy-context-item:nth-child(n + 3),
html.dark .workspace-document .strategy-context-item:nth-child(n + 3) {
  border-top-color: #1e293b;
}

[data-theme="dark"] .workspace-document .kpi-card,
[data-theme="dark"] .workspace-document .risk-card,
html.dark .workspace-document .kpi-card,
html.dark .workspace-document .risk-card {
  background: #0f172a;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .workspace-document .kpi-card:hover,
[data-theme="dark"] .workspace-document .risk-card:hover,
html.dark .workspace-document .kpi-card:hover,
html.dark .workspace-document .risk-card:hover {
  border-color: #334155;
}

/* TOC Menu */
[data-theme="dark"] .strategy-toc a,
html.dark .strategy-toc a {
  color: #94a3b8;
}

[data-theme="dark"] .strategy-toc a:hover,
html.dark .strategy-toc a:hover {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-toc a.is-active,
html.dark .strategy-toc a.is-active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Planner: Completed tasks with line-through text-slate-500 */
[data-theme="dark"] .planner-task-card.is-done .planner-task-text,
html.dark .planner-task-card.is-done .planner-task-text,
[data-theme="dark"] .checklist-item:has(input:checked) .checklist-item-text,
html.dark .checklist-item:has(input:checked) .checklist-item-text {
  text-decoration: line-through;
  color: #64748b !important;
}

[data-theme="dark"] .planner-task-card,
html.dark .planner-task-card {
  background: #0f172a;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .planner-task-card:hover,
html.dark .planner-task-card:hover {
  border-color: #334155;
}

/* Modals & Popovers */
[data-theme="dark"] .legal-modal-card,
[data-theme="dark"] .archive-modal-card,
[data-theme="dark"] .delete-account-modal-card,
[data-theme="dark"] .import-memory-modal-card,
[data-theme="dark"] .legal-report-modal-card,
[data-theme="dark"] .refinement-popover,
html.dark .legal-modal-card,
html.dark .archive-modal-card,
html.dark .delete-account-modal-card,
html.dark .import-memory-modal-card,
html.dark .legal-report-modal-card,
html.dark .refinement-popover {
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* Active Pills */
[data-theme="dark"] .choice-pill span,
html.dark .choice-pill span {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
}

[data-theme="dark"] .choice-pill input:checked + span,
html.dark .choice-pill input:checked + span {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #bfdbfe;
  box-shadow: inset 0 0 0 1px #3b82f6;
}

[data-theme="dark"] .choice-pill input:focus-visible + span,
html.dark .choice-pill input:focus-visible + span {
  outline: 2px solid rgba(59, 130, 246, 0.7);
  outline-offset: 2px;
}

/* Callouts */
[data-theme="dark"] .callout,
[data-theme="dark"] .faq-info-callout,
[data-theme="dark"] .strategy-callout,
html.dark .callout,
html.dark .faq-info-callout,
html.dark .strategy-callout {
  background: rgba(23, 37, 84, 0.4);
  border-left: 4px solid #3b82f6;
  color: #bfdbfe;
}

/* Status Badges (Ready / Completed) */
[data-theme="dark"] .status-badge,
[data-theme="dark"] .status-completed,
[data-theme="dark"] .status-ready,
html.dark .status-badge,
html.dark .status-completed,
html.dark .status-ready {
  background: rgba(6, 78, 59, 0.5);
  color: #34d399;
  border: 1px solid rgba(6, 95, 70, 0.6);
}

@media (max-width: 767px) {
  [data-theme="dark"] .workspace-intake,
  [data-theme="dark"] .workspace-centered:has(.intake-view),
  [data-theme="dark"] .workspace-ask.is-empty,
  [data-theme="dark"] .workspace:has(.ask-shell.is-empty),
  html.dark .workspace-intake,
  html.dark .workspace-centered:has(.intake-view),
  html.dark .workspace-ask.is-empty,
  html.dark .workspace:has(.ask-shell.is-empty) {
    background: var(--bg-canvas);
  }

  [data-theme="dark"] .workspace-ask.is-empty::before,
  [data-theme="dark"] .workspace-intake.is-empty::before,
  [data-theme="dark"] .workspace.is-empty:has(.ask-shell.is-empty)::before,
  [data-theme="dark"] .workspace:has(.ask-shell.is-empty)::before,
  [data-theme="dark"] .workspace-ask:has(.ask-shell.is-empty)::before,
  html.dark .workspace-ask.is-empty::before,
  html.dark .workspace-intake.is-empty::before,
  html.dark .workspace.is-empty:has(.ask-shell.is-empty)::before,
  html.dark .workspace:has(.ask-shell.is-empty)::before,
  html.dark .workspace-ask:has(.ask-shell.is-empty)::before {
    background:
      radial-gradient(ellipse 135% 80% at 50% 100%, rgba(30, 58, 138, 0.46) 0%, rgba(23, 37, 84, 0.52) 34%, rgba(15, 23, 42, 0.32) 60%, transparent 82%),
      radial-gradient(ellipse 80% 45% at 50% 100%, rgba(49, 75, 175, 0.35) 0%, transparent 64%);
  }
}

/* White Primary Action Buttons in Dark Theme */
[data-theme="dark"] .archive-new-btn,
[data-theme="dark"] .primary-button,
[data-theme="dark"] .composer-submit:not(:disabled),
[data-theme="dark"] .workspace-centered .composer-submit:not(:disabled),
[data-theme="dark"] .ask-submit:not(:disabled),
[data-theme="dark"] .refine-submit:not(:disabled),
[data-theme="dark"] .refinement-dock .refine-submit:not(:disabled),
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn:not(:disabled),
[data-theme="dark"] .loading-ask-send-btn:not(:disabled),
[data-theme="dark"] .archive-modal-confirm:not(.is-destructive):not(:disabled),
[data-theme="dark"] .auth-submit:not(:disabled),
[data-theme="dark"] .planner-submit-btn:not(:disabled),
[data-theme="dark"] .install-modal-btn:not(:disabled),
html.dark .archive-new-btn,
html.dark .primary-button,
html.dark .composer-submit:not(:disabled),
html.dark .workspace-centered .composer-submit:not(:disabled),
html.dark .ask-submit:not(:disabled),
html.dark .refine-submit:not(:disabled),
html.dark .refinement-dock .refine-submit:not(:disabled),
html.dark .workspace-document .refinement-dock .dock-ask-btn:not(:disabled),
html.dark .loading-ask-send-btn:not(:disabled),
html.dark .archive-modal-confirm:not(.is-destructive):not(:disabled),
html.dark .auth-submit:not(:disabled),
html.dark .planner-submit-btn:not(:disabled),
html.dark .install-modal-btn:not(:disabled) {
  background: #ffffff;
  color: #0b0f17;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .archive-new-btn svg,
[data-theme="dark"] .primary-button svg,
[data-theme="dark"] .composer-submit svg,
[data-theme="dark"] .workspace-centered .composer-submit svg,
[data-theme="dark"] .ask-submit svg,
[data-theme="dark"] .refine-submit svg,
[data-theme="dark"] .refinement-dock .refine-submit svg,
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn svg,
[data-theme="dark"] .loading-ask-send-btn svg,
[data-theme="dark"] .auth-submit svg,
[data-theme="dark"] .planner-submit-btn svg,
[data-theme="dark"] .install-modal-btn svg,
html.dark .archive-new-btn svg,
html.dark .primary-button svg,
html.dark .composer-submit svg,
html.dark .workspace-centered .composer-submit svg,
html.dark .ask-submit svg,
html.dark .refine-submit svg,
html.dark .refinement-dock .refine-submit svg,
html.dark .workspace-document .refinement-dock .dock-ask-btn svg,
html.dark .loading-ask-send-btn svg,
html.dark .auth-submit svg,
html.dark .planner-submit-btn svg,
html.dark .install-modal-btn svg {
  stroke: #0b0f17;
  color: #0b0f17;
}

[data-theme="dark"] .composer-submit .button-arrow,
[data-theme="dark"] .workspace-centered .composer-submit .button-arrow,
[data-theme="dark"] .ask-submit span,
html.dark .composer-submit .button-arrow,
html.dark .workspace-centered .composer-submit .button-arrow,
html.dark .ask-submit span {
  color: #0b0f17;
}

[data-theme="dark"] .archive-new-btn:hover:not(:disabled),
[data-theme="dark"] .primary-button:hover:not(:disabled),
[data-theme="dark"] .composer-submit:hover:not(:disabled),
[data-theme="dark"] .workspace-centered .composer-submit:hover:not(:disabled),
[data-theme="dark"] .ask-submit:hover:not(:disabled),
[data-theme="dark"] .refine-submit:hover:not(:disabled),
[data-theme="dark"] .refinement-dock .refine-submit:hover:not(:disabled),
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn:hover:not(:disabled),
[data-theme="dark"] .loading-ask-send-btn:hover:not(:disabled),
[data-theme="dark"] .archive-modal-confirm:not(.is-destructive):hover:not(:disabled),
[data-theme="dark"] .auth-submit:hover:not(:disabled),
[data-theme="dark"] .planner-submit-btn:hover:not(:disabled),
html.dark .archive-new-btn:hover:not(:disabled),
html.dark .primary-button:hover:not(:disabled),
html.dark .composer-submit:hover:not(:disabled),
html.dark .workspace-centered .composer-submit:hover:not(:disabled),
html.dark .ask-submit:hover:not(:disabled),
html.dark .refine-submit:hover:not(:disabled),
html.dark .refinement-dock .refine-submit:hover:not(:disabled),
html.dark .workspace-document .refinement-dock .dock-ask-btn:hover:not(:disabled),
html.dark .loading-ask-send-btn:hover:not(:disabled),
html.dark .archive-modal-confirm:not(.is-destructive):hover:not(:disabled),
html.dark .auth-submit:hover:not(:disabled),
html.dark .planner-submit-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0b0f17;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .archive-new-btn:active:not(:disabled),
[data-theme="dark"] .primary-button:active:not(:disabled),
[data-theme="dark"] .composer-submit:active:not(:disabled),
[data-theme="dark"] .workspace-centered .composer-submit:active:not(:disabled),
[data-theme="dark"] .ask-submit:active:not(:disabled),
[data-theme="dark"] .refine-submit:active:not(:disabled),
[data-theme="dark"] .refinement-dock .refine-submit:active:not(:disabled),
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn:active:not(:disabled),
[data-theme="dark"] .loading-ask-send-btn:active:not(:disabled),
[data-theme="dark"] .archive-modal-confirm:not(.is-destructive):active:not(:disabled),
[data-theme="dark"] .auth-submit:active:not(:disabled),
[data-theme="dark"] .planner-submit-btn:active:not(:disabled),
html.dark .archive-new-btn:active:not(:disabled),
html.dark .primary-button:active:not(:disabled),
html.dark .composer-submit:active:not(:disabled),
html.dark .workspace-centered .composer-submit:active:not(:disabled),
html.dark .ask-submit:active:not(:disabled),
html.dark .refine-submit:active:not(:disabled),
html.dark .refinement-dock .refine-submit:active:not(:disabled),
html.dark .workspace-document .refinement-dock .dock-ask-btn:active:not(:disabled),
html.dark .loading-ask-send-btn:active:not(:disabled),
html.dark .archive-modal-confirm:not(.is-destructive):active:not(:disabled),
html.dark .auth-submit:active:not(:disabled),
html.dark .planner-submit-btn:active:not(:disabled) {
  background: #e2e8f0;
  color: #0b0f17;
  transform: translateY(0) scale(0.985);
}

[data-theme="dark"] .archive-new-btn:disabled,
[data-theme="dark"] .primary-button:disabled,
[data-theme="dark"] .composer-submit:disabled,
[data-theme="dark"] .workspace-centered .composer-submit:disabled,
[data-theme="dark"] .ask-submit:disabled,
[data-theme="dark"] .refine-submit:disabled,
[data-theme="dark"] .refinement-dock .refine-submit:disabled,
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn:disabled,
[data-theme="dark"] .loading-ask-send-btn:disabled,
[data-theme="dark"] .archive-modal-confirm:disabled,
[data-theme="dark"] .auth-submit:disabled,
[data-theme="dark"] .planner-submit-btn:disabled,
html.dark .archive-new-btn:disabled,
html.dark .primary-button:disabled,
html.dark .composer-submit:disabled,
html.dark .workspace-centered .composer-submit:disabled,
html.dark .ask-submit:disabled,
html.dark .refine-submit:disabled,
html.dark .refinement-dock .refine-submit:disabled,
html.dark .workspace-document .refinement-dock .dock-ask-btn:disabled,
html.dark .loading-ask-send-btn:disabled,
html.dark .archive-modal-confirm:disabled,
html.dark .auth-submit:disabled,
html.dark .planner-submit-btn:disabled {
  background: #1e293b !important;
  color: #64748b !important;
  border-color: #334155 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 0.6;
}

[data-theme="dark"] .archive-new-btn:disabled svg,
[data-theme="dark"] .primary-button:disabled svg,
[data-theme="dark"] .composer-submit:disabled svg,
[data-theme="dark"] .workspace-centered .composer-submit:disabled svg,
[data-theme="dark"] .ask-submit:disabled svg,
[data-theme="dark"] .refine-submit:disabled svg,
[data-theme="dark"] .refinement-dock .refine-submit:disabled svg,
[data-theme="dark"] .workspace-document .refinement-dock .dock-ask-btn:disabled svg,
[data-theme="dark"] .loading-ask-send-btn:disabled svg,
[data-theme="dark"] .auth-submit:disabled svg,
[data-theme="dark"] .planner-submit-btn:disabled svg,
html.dark .archive-new-btn:disabled svg,
html.dark .primary-button:disabled svg,
html.dark .composer-submit:disabled svg,
html.dark .workspace-centered .composer-submit:disabled svg,
html.dark .ask-submit:disabled svg,
html.dark .refine-submit:disabled svg,
html.dark .refinement-dock .refine-submit:disabled svg,
html.dark .workspace-document .refinement-dock .dock-ask-btn:disabled svg,
html.dark .loading-ask-send-btn:disabled svg,
html.dark .auth-submit:disabled svg,
html.dark .planner-submit-btn:disabled svg {
  stroke: #64748b !important;
  color: #64748b !important;
}

[data-theme="dark"] .composer-submit:disabled .button-arrow,
[data-theme="dark"] .workspace-centered .composer-submit:disabled .button-arrow,
[data-theme="dark"] .ask-submit:disabled span,
html.dark .composer-submit:disabled .button-arrow,
html.dark .workspace-centered .composer-submit:disabled .button-arrow,
html.dark .ask-submit:disabled span {
  color: #64748b !important;
}

/* Mode switch & Toggle Controls in Dark Theme (High Contrast White) */
[data-theme="dark"] body[data-mode="ask"] .rail-toggle-track,
html.dark body[data-mode="ask"] .rail-toggle-track,
body[data-mode="ask"][data-theme="dark"] .rail-toggle-track {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] body[data-mode="ask"] .rail-toggle-thumb,
html.dark body[data-mode="ask"] .rail-toggle-thumb,
body[data-mode="ask"][data-theme="dark"] .rail-toggle-thumb {
  background: #0b0f17 !important;
}

[data-theme="dark"] .rail-mode-toggle.is-default-saved .rail-toggle-track,
html.dark .rail-mode-toggle.is-default-saved .rail-toggle-track {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
  border-color: #ffffff;
}

[data-theme="dark"] .settings-toggle.is-active,
html.dark .settings-toggle.is-active {
  background: #ffffff;
  border-color: #ffffff;
}

[data-theme="dark"] .settings-toggle.is-active .settings-toggle-thumb,
html.dark .settings-toggle.is-active .settings-toggle-thumb {
  background: #0b0f17 !important;
}

/* Rail Theme Toggle & Active Rail Navigation Item in Dark Mode */
[data-theme="dark"] .rail-theme-toggle,
html.dark .rail-theme-toggle,
[data-theme="dark"] .rail-lang-toggle,
html.dark .rail-lang-toggle {
  color: #f1f5f9;
}

[data-theme="dark"] .rail-theme-toggle:hover,
html.dark .rail-theme-toggle:hover,
[data-theme="dark"] .rail-lang-toggle:hover,
html.dark .rail-lang-toggle:hover {
  background: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .rail-lang-badge,
html.dark .rail-lang-badge {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .rail-button.is-active,
html.dark .rail-button.is-active {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Strategy Copilot in Dark Theme (Pure Black) */
[data-theme="dark"] .strategy-ask-panel,
html.dark .strategy-ask-panel {
  background: #000000;
  border: 1px solid #1e293b;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.85), 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .strategy-ask-header,
html.dark .strategy-ask-header {
  background: #000000;
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .strategy-ask-heading strong,
html.dark .strategy-ask-heading strong {
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-context,
html.dark .strategy-ask-context {
  color: #94a3b8;
}

[data-theme="dark"] .strategy-ask-close,
html.dark .strategy-ask-close {
  color: #94a3b8;
}

[data-theme="dark"] .strategy-ask-close:hover,
html.dark .strategy-ask-close:hover {
  background: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .strategy-ask-body,
html.dark .strategy-ask-body {
  background: #000000;
}

[data-theme="dark"] .strategy-ask-orb,
html.dark .strategy-ask-orb {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

[data-theme="dark"] .strategy-ask-welcome strong,
html.dark .strategy-ask-welcome strong {
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-welcome p,
html.dark .strategy-ask-welcome p {
  color: #94a3b8;
}

[data-theme="dark"] .strategy-ask-suggestion,
html.dark .strategy-ask-suggestion {
  background: #0f172a;
  border-color: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-suggestion:hover,
html.dark .strategy-ask-suggestion:hover {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
  transform: translateX(2px);
}

[data-theme="dark"] .strategy-ask-message .ask-message-content,
html.dark .strategy-ask-message .ask-message-content {
  background: #0f172a;
  border-color: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-message.ask-message-user .ask-message-content,
html.dark .strategy-ask-message.ask-message-user .ask-message-content {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

[data-theme="dark"] .strategy-ask-message .ask-rich-text,
html.dark .strategy-ask-message .ask-rich-text {
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-message-actions,
html.dark .strategy-ask-message-actions {
  border-top-color: #1e293b;
}

[data-theme="dark"] .strategy-ask-action,
html.dark .strategy-ask-action {
  color: #94a3b8;
}

[data-theme="dark"] .strategy-ask-action:hover,
html.dark .strategy-ask-action:hover {
  background: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .strategy-ask-footer,
html.dark .strategy-ask-footer {
  background: #000000;
  border-top: 1px solid #1e293b;
}

[data-theme="dark"] .strategy-ask-composer,
html.dark .strategy-ask-composer {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .strategy-ask-composer:focus-within,
html.dark .strategy-ask-composer:focus-within {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .strategy-ask-input,
html.dark .strategy-ask-input {
  color: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-send:not(:disabled),
html.dark .strategy-ask-send:not(:disabled) {
  background: #ffffff;
  color: #0b0f17;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .strategy-ask-send:not(:disabled) svg,
html.dark .strategy-ask-send:not(:disabled) svg {
  stroke: #0b0f17;
  color: #0b0f17;
}

[data-theme="dark"] .strategy-ask-send:hover:not(:disabled),
html.dark .strategy-ask-send:hover:not(:disabled) {
  background: #f1f5f9;
}

[data-theme="dark"] .strategy-ask-send:disabled,
html.dark .strategy-ask-send:disabled {
  background: #1e293b !important;
  color: #64748b !important;
}

[data-theme="dark"] .strategy-ask-send:disabled svg,
html.dark .strategy-ask-send:disabled svg {
  stroke: #64748b !important;
  color: #64748b !important;
}

[data-theme="dark"] .strategy-ask-disclaimer,
html.dark .strategy-ask-disclaimer {
  color: #64748b;
}

/* Strategic Marketing Copilot (Loading ask modal) in Dark Theme */
[data-theme="dark"] .loading-ask-modal,
html.dark .loading-ask-modal {
  background: #000000;
  border-left: 1px solid #1e293b;
}

[data-theme="dark"] .loading-ask-modal-header,
html.dark .loading-ask-modal-header {
  background: #000000;
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .loading-ask-modal-body,
html.dark .loading-ask-modal-body {
  background: #000000;
}

[data-theme="dark"] .loading-ask-modal-footer,
html.dark .loading-ask-modal-footer {
  background: #000000;
  border-top: 1px solid #1e293b;
}

[data-theme="dark"] .loading-ask-modal-form,
html.dark .loading-ask-modal-form {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .loading-ask-modal-form:focus-within,
html.dark .loading-ask-modal-form:focus-within {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .loading-ask-modal-input,
html.dark .loading-ask-modal-input {
  color: #f1f5f9;
}

/* ── Usage & Limits Page in Dark Mode (Pure Black Canvas / Obsidian Surface) ── */
[data-theme="dark"] .limits-view,
html.dark .limits-view {
  background: transparent;
}

[data-theme="dark"] .limits-header-text h1,
html.dark .limits-header-text h1 {
  color: #ffffff;
}

[data-theme="dark"] .limits-header-text p,
html.dark .limits-header-text p {
  color: #94a3b8;
}

[data-theme="dark"] .limits-segmented-control,
html.dark .limits-segmented-control {
  background: #090d16;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .limits-segment-btn,
html.dark .limits-segment-btn {
  color: #94a3b8;
}

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

[data-theme="dark"] .limits-segment-btn.is-active,
html.dark .limits-segment-btn.is-active {
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .limits-refresh-btn,
html.dark .limits-refresh-btn {
  background: #090d16;
  border: 1px solid #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .limits-refresh-btn:hover,
html.dark .limits-refresh-btn:hover {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

[data-theme="dark"] .limits-mobile-select,
html.dark .limits-mobile-select {
  background: #090d16;
  border: 1px solid #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .limits-mobile-select:focus,
html.dark .limits-mobile-select:focus {
  border-color: #334155;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .limits-select-chevron,
html.dark .limits-select-chevron {
  color: #94a3b8;
}

/* Mode Cards (Build & Ask) */
[data-theme="dark"] .limits-mode-card,
html.dark .limits-mode-card {
  background: #090d16;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .limits-mode-card:hover,
html.dark .limits-mode-card:hover {
  border-color: #334155;
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.85);
  transform: translateY(-2px);
}

[data-theme="dark"] .limits-mode-icon-box,
html.dark .limits-mode-icon-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

[data-theme="dark"] .build-icon-box,
html.dark .build-icon-box {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

[data-theme="dark"] .ask-icon-box,
html.dark .ask-icon-box {
  background: rgba(192, 132, 252, 0.08);
  border-color: rgba(192, 132, 252, 0.2);
  color: #c084fc;
}

[data-theme="dark"] .limits-mode-title-wrap h4,
html.dark .limits-mode-title-wrap h4 {
  color: #ffffff;
}

[data-theme="dark"] .limits-mode-sub,
html.dark .limits-mode-sub {
  color: #94a3b8;
}

[data-theme="dark"] .limits-tag,
html.dark .limits-tag {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
}

[data-theme="dark"] .tag-build,
html.dark .tag-build {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

[data-theme="dark"] .tag-ask,
html.dark .tag-ask {
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.22);
  color: #c084fc;
}

[data-theme="dark"] .limits-mode-big-num,
html.dark .limits-mode-big-num {
  color: #ffffff;
}

[data-theme="dark"] .limits-mode-unit,
html.dark .limits-mode-unit {
  color: #64748b;
}

[data-theme="dark"] .limits-meta-pill,
html.dark .limits-meta-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1e293b;
  color: #94a3b8;
  border-radius: 6px;
}

[data-theme="dark"] .limits-meta-pill:hover,
html.dark .limits-meta-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .limits-meta-pill strong,
html.dark .limits-meta-pill strong {
  color: #ffffff;
}

/* Activity Timeline Chart */
[data-theme="dark"] .limits-chart-card,
html.dark .limits-chart-card {
  background: #090d16;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .limits-chart-card:hover,
html.dark .limits-chart-card:hover {
  border-color: #334155;
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .limits-chart-header h3,
html.dark .limits-chart-header h3 {
  color: #ffffff;
}

[data-theme="dark"] .limits-chart-header p,
html.dark .limits-chart-header p {
  color: #94a3b8;
}

[data-theme="dark"] .legend-item,
html.dark .legend-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1e293b;
  color: #94a3b8;
  border-radius: 6px;
}

[data-theme="dark"] .dot-build,
html.dark .dot-build {
  background: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .dot-ask,
html.dark .dot-ask {
  background: #c084fc;
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25);
}

[data-theme="dark"] .limits-chart-bars-wrap,
html.dark .limits-chart-bars-wrap {
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .limits-bar-empty,
html.dark .limits-bar-empty {
  background: #1e293b;
}

[data-theme="dark"] .limits-chart-col:hover .limits-bar-empty,
html.dark .limits-chart-col:hover .limits-bar-empty {
  background: #475569;
  transform: scale(1.4);
}

[data-theme="dark"] .segment-build,
html.dark .segment-build {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .segment-ask,
html.dark .segment-ask {
  background: linear-gradient(180deg, #c084fc 0%, #7e22ce 100%);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

[data-theme="dark"] .limits-col-label,
html.dark .limits-col-label {
  color: #64748b;
}

[data-theme="dark"] .limits-chart-col:hover .limits-col-label,
html.dark .limits-chart-col:hover .limits-col-label {
  color: #f1f5f9;
}

[data-theme="dark"] .limits-chart-tooltip,
html.dark .limits-chart-tooltip {
  background: #0b0f17;
  border: 1px solid #334155;
  color: #f1f5f9;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .limits-chart-tooltip strong,
html.dark .limits-chart-tooltip strong {
  color: #ffffff;
}

[data-theme="dark"] .t-total,
html.dark .t-total {
  border-top-color: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .limits-empty-icon-wrap,
html.dark .limits-empty-icon-wrap {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .limits-empty-title,
html.dark .limits-empty-title {
  color: #f1f5f9;
}

[data-theme="dark"] .limits-empty-hint,
html.dark .limits-empty-hint {
  color: #64748b;
}

/* FAQ Card */
[data-theme="dark"] .limits-faq-card,
html.dark .limits-faq-card {
  background: #090d16;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .limits-faq-card:hover,
html.dark .limits-faq-card:hover {
  border-color: #334155;
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .limits-faq-icon,
html.dark .limits-faq-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  box-shadow: none;
}

[data-theme="dark"] .limits-faq-title-wrap h3,
html.dark .limits-faq-title-wrap h3 {
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-header:hover .limits-faq-title-wrap h3,
html.dark .limits-faq-header:hover .limits-faq-title-wrap h3 {
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-title-wrap p,
html.dark .limits-faq-title-wrap p {
  color: #94a3b8;
}

[data-theme="dark"] .limits-faq-main-toggle,
html.dark .limits-faq-main-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .limits-faq-header:hover .limits-faq-main-toggle,
html.dark .limits-faq-header:hover .limits-faq-main-toggle,
[data-theme="dark"] .limits-faq-card[open] .limits-faq-main-toggle,
html.dark .limits-faq-card[open] .limits-faq-main-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-card[open] .limits-main-faq-chevron,
html.dark .limits-faq-card[open] .limits-main-faq-chevron {
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-list,
html.dark .limits-faq-list {
  border-top: 1px solid #1e293b;
}

[data-theme="dark"] .limits-faq-item,
html.dark .limits-faq-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid #1e293b;
}

[data-theme="dark"] .limits-faq-item:hover,
html.dark .limits-faq-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: #334155;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .limits-faq-item[open],
html.dark .limits-faq-item[open] {
  background: rgba(255, 255, 255, 0.03);
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .limits-faq-question,
html.dark .limits-faq-question {
  color: #f1f5f9;
}

[data-theme="dark"] .limits-faq-summary:hover .limits-faq-question,
html.dark .limits-faq-summary:hover .limits-faq-question,
[data-theme="dark"] .limits-faq-item[open] .limits-faq-question,
html.dark .limits-faq-item[open] .limits-faq-question {
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-icon-wrap,
html.dark .limits-faq-icon-wrap {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}

[data-theme="dark"] .limits-faq-item:hover .limits-faq-icon-wrap,
html.dark .limits-faq-item:hover .limits-faq-icon-wrap,
[data-theme="dark"] .limits-faq-item[open] .limits-faq-icon-wrap,
html.dark .limits-faq-item[open] .limits-faq-icon-wrap {
  background: #1e293b;
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-chevron,
html.dark .limits-faq-chevron {
  color: #94a3b8;
}

[data-theme="dark"] .limits-faq-item[open] .limits-faq-chevron,
html.dark .limits-faq-item[open] .limits-faq-chevron {
  color: #ffffff;
}

[data-theme="dark"] .limits-faq-content,
html.dark .limits-faq-content {
  border-top: 1px solid #1e293b;
}

[data-theme="dark"] .limits-faq-content p,
html.dark .limits-faq-content p {
  color: #94a3b8;
}

[data-theme="dark"] .limits-faq-content strong,
html.dark .limits-faq-content strong {
  color: #ffffff;
}


/* ── Localization & Language Controls ────────────────────────────────────── */
.rail-lang-toggle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rail-lang-badge {
  font-size: 11px;
  font-weight: 700;
  color: currentColor;
}
.auth-lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 140ms ease;
}
.auth-lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-soft);
}
.auth-header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
/* ===== SETTINGS: INTERFACE LANGUAGE & THEME ROWS ===== */
.settings-lang-row,
.settings-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.settings-lang-info,
.settings-theme-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.settings-lang-label,
.settings-theme-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.settings-lang-hint,
.settings-theme-hint {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.settings-lang-dropdown,
.settings-theme-dropdown {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.settings-lang-trigger,
.settings-theme-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  padding: 0 12px 0 14px;
  min-width: 160px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.12));
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.settings-lang-trigger::-webkit-details-marker,
.settings-theme-trigger::-webkit-details-marker {
  display: none;
}

.settings-lang-trigger:hover,
.settings-theme-trigger:hover {
  border-color: var(--border-hover);
  background: var(--bg-soft);
}

.settings-lang-dropdown[open] .settings-lang-trigger,
.settings-theme-dropdown[open] .settings-theme-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.settings-lang-curr-name,
.settings-theme-curr-name {
  line-height: 1;
}

.settings-lang-chevron,
.settings-theme-chevron {
  color: var(--text-tertiary);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.settings-lang-dropdown[open] .settings-lang-chevron,
.settings-theme-dropdown[open] .settings-theme-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.settings-lang-menu,
.settings-theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: 240px;
  padding: 4px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.12));
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.03);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: settingsLangPop 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes settingsLangPop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-lang-option,
.settings-theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 120ms ease;
  user-select: none;
}

.settings-lang-option:hover,
.settings-theme-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.settings-lang-option.is-selected,
.settings-theme-option.is-selected {
  background: var(--bg-soft);
  color: var(--text-primary);
  font-weight: 600;
}

.settings-lang-opt-name,
.settings-theme-opt-name {
  line-height: 1.2;
}

.settings-lang-check,
.settings-theme-check {
  color: var(--accent, #4f6ee8);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .settings-lang-row,
  .settings-theme-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .settings-lang-dropdown,
  .settings-theme-dropdown {
    width: 100%;
  }
  .settings-lang-trigger,
  .settings-theme-trigger {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .settings-lang-menu,
  .settings-theme-menu {
    position: static;
    margin-top: 6px;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }
  .settings-lang-option,
  .settings-theme-option {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Settings Dark Mode Refinements */
[data-theme="dark"] .settings-panel,
html.dark .settings-panel {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .settings-tabs,
html.dark .settings-tabs {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .settings-tab.is-active,
html.dark .settings-tab.is-active {
  background: #f8fafc;
  color: #0b0f17;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .account-profile-card,
html.dark .account-profile-card,
[data-theme="dark"] .settings-theme-studio,
html.dark .settings-theme-studio,
[data-theme="dark"] .settings-diagnostic-card,
html.dark .settings-diagnostic-card,
[data-theme="dark"] .security-session-card,
html.dark .security-session-card,
[data-theme="dark"] .legal-hero-banner,
html.dark .legal-hero-banner,
[data-theme="dark"] .guest-sync-banner,
html.dark .guest-sync-banner,
[data-theme="dark"] .experience-preview-card,
html.dark .experience-preview-card,
[data-theme="dark"] .experience-hero-toggle,
html.dark .experience-hero-toggle,
[data-theme="dark"] .experience-accordion,
html.dark .experience-accordion,
[data-theme="dark"] .experience-accordion-summary,
html.dark .experience-accordion-summary,
[data-theme="dark"] .settings-security-card,
html.dark .settings-security-card,
[data-theme="dark"] .settings-legal-card,
html.dark .settings-legal-card,
[data-theme="dark"] .settings-legal-row,
html.dark .settings-legal-row,
[data-theme="dark"] .settings-legal-contact-card,
html.dark .settings-legal-contact-card,
[data-theme="dark"] .settings-legal-notice,
html.dark .settings-legal-notice {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .experience-category-icon,
html.dark .experience-category-icon {
  background: rgba(79, 110, 232, 0.18);
  color: #93c5fd;
}

[data-theme="dark"] .legal-contact-email-btn,
html.dark .legal-contact-email-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .legal-contact-email-btn:hover,
html.dark .legal-contact-email-btn:hover {
  background: #253348;
  border-color: #6366f1;
  color: #818cf8;
}

[data-theme="dark"] .theme-preview-card,
html.dark .theme-preview-card,
[data-theme="dark"] .security-badge-tile,
html.dark .security-badge-tile,
[data-theme="dark"] .session-device-icon,
html.dark .session-device-icon,
[data-theme="dark"] .legal-trust-pill,
html.dark .legal-trust-pill {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .settings-legal-card:hover,
html.dark .settings-legal-card:hover,
[data-theme="dark"] .settings-legal-row:hover,
html.dark .settings-legal-row:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: #475569;
}

[data-theme="dark"] .settings-legal-icon,
html.dark .settings-legal-icon {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .experience-mode-option,
html.dark .experience-mode-option {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .experience-mode-option:hover,
html.dark .experience-mode-option:hover {
  background: #1e293b;
  border-color: #475569;
}

[data-theme="dark"] .experience-mode-option.is-selected,
html.dark .experience-mode-option.is-selected {
  background: rgba(79, 110, 232, 0.18);
  border-color: #4f6ee8;
}

[data-theme="dark"] .settings-danger-zone,
html.dark .settings-danger-zone {
  background: rgba(252, 165, 165, 0.06);
  border-color: rgba(252, 165, 165, 0.18);
}

[data-theme="dark"] .settings-danger-zone.is-pending-deletion,
html.dark .settings-danger-zone.is-pending-deletion {
  background: rgba(252, 211, 77, 0.08);
  border-color: rgba(252, 211, 77, 0.24);
}

/* Dark Mode: AI Account Summary Card (Slate 950/900/800) */
[data-theme="dark"] .ai-account-summary-card,
html.dark .ai-account-summary-card {
  background: #0f172a;
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .ai-account-summary-card:hover,
html.dark .ai-account-summary-card:hover {
  border-color: rgba(99, 102, 241, 0.55);
}

[data-theme="dark"] .ai-account-summary-card.is-disabled-state,
html.dark .ai-account-summary-card.is-disabled-state {
  background: #0b1120;
  border-color: #334155;
}

[data-theme="dark"] .ai-summary-card-title,
html.dark .ai-summary-card-title {
  color: #f8fafc;
}

[data-theme="dark"] .ai-summary-model-badge,
html.dark .ai-summary-model-badge {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.45);
}

[data-theme="dark"] .ai-summary-refresh-btn,
html.dark .ai-summary-refresh-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .ai-summary-refresh-btn:hover:not([disabled]),
html.dark .ai-summary-refresh-btn:hover:not([disabled]) {
  background: #253348;
  border-color: #6366f1;
  color: #818cf8;
}

[data-theme="dark"] .ai-summary-content,
html.dark .ai-summary-content {
  color: #f1f5f9;
}

[data-theme="dark"] .ai-summary-tag,
html.dark .ai-summary-tag {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.38);
}

[data-theme="dark"] .ai-summary-footer-note,
html.dark .ai-summary-footer-note {
  color: #64748b;
}

[data-theme="dark"] .ai-summary-disabled-desc,
html.dark .ai-summary-disabled-desc {
  color: #94a3b8;
}

[data-theme="dark"] .ai-summary-skeleton-line,
html.dark .ai-summary-skeleton-line,
[data-theme="dark"] .ai-summary-skeleton-tag,
html.dark .ai-summary-skeleton-tag {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

[data-theme="dark"] .ai-summary-error-box,
html.dark .ai-summary-error-box {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .ai-summary-error-text,
html.dark .ai-summary-error-text {
  color: #f87171;
}

/* ===== PWA INSTALL NAVIGATION & MODAL ===== */

/* Desktop: hide install navigation buttons completely */
#installAppNav,
#railInstallAppButton {
  display: none !important;
}

/* Mobile: show install button in sidebar drawer when not already installed */
@media (max-width: 767px) {
  #installAppNav:not([hidden]) {
    display: flex !important;
  }
}

.install-app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.45));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInModal 180ms ease forwards;
}

.install-app-modal-overlay[hidden] {
  display: none !important;
}

.install-app-modal-card {
  width: min(100%, 500px);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 20px;
  background: var(--bg-elevated, #ffffff);
  box-shadow: 0 20px 48px -10px var(--theme-shadow-strong, rgba(15, 23, 42, 0.18)), 0 0 0 1px var(--theme-shadow-soft, rgba(0, 0, 0, 0.04));
  animation: scaleUpModal 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
}

.install-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.install-modal-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.install-modal-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent-soft, rgba(79, 110, 232, 0.1));
  color: var(--accent, #4f6ee8);
}

.install-modal-title-group h2 {
  margin: 0 0 4px;
  color: var(--text-primary, #0f172a);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.install-modal-title-group p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  line-height: 1.45;
}

.install-modal-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--bg-soft, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent, #4f6ee8);
}

.install-modal-close {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 14px;
}

.install-modal-close:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

.install-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.install-modal-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.install-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  transition: background 150ms ease;
}

.install-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent, #4f6ee8);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 1px;
}

.install-step-details {
  flex: 1;
  min-width: 0;
}

.install-step-title {
  margin: 0 0 3px;
  color: var(--text-primary, #0f172a);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.install-step-desc {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
}

.install-step-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #cbd5e1);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  vertical-align: middle;
}

.install-step-action-pill svg {
  width: 13px;
  height: 13px;
  color: currentColor;
  flex-shrink: 0;
}

.install-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.install-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #0b1f3a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.install-modal-btn:hover {
  background: #132d52;
}

.install-modal-btn:active {
  background: #08172c;
}

/* Dark Mode Overrides (Slate 950 / 900 / 800) */
html.dark .install-app-modal-card {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

html.dark .install-modal-header,
html.dark .install-modal-footer {
  border-color: #1e293b;
}

html.dark .install-modal-platform-badge {
  background: #1e293b;
  border-color: #334155;
  color: #818cf8;
}

html.dark .install-modal-close {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

html.dark .install-modal-close:hover {
  background: #334155;
  color: #f1f5f9;
}

html.dark .install-step-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.06);
}

html.dark .install-step-action-pill {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

@media (max-width: 640px) {
  .install-app-modal-card {
    border-radius: 16px;
  }
  .install-modal-header {
    padding: 18px 20px 16px;
  }
  .install-modal-body {
    padding: 18px 20px;
  }
  .install-modal-footer {
    padding: 14px 20px 18px;
  }
}

/* ── Mobile Action Bottom Sheet & Model Selector Sheet (Helmer Slate Dark Theme) ── */
.mobile-bottom-sheet-overlay,
.mobile-model-sheet-overlay,
.mobile-profile-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-bottom-sheet-overlay.is-open,
.mobile-model-sheet-overlay.is-open,
.mobile-profile-sheet-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-bottom-sheet-overlay.is-closing,
.mobile-model-sheet-overlay.is-closing,
.mobile-profile-sheet-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

.mobile-bottom-sheet-overlay[hidden],
.mobile-model-sheet-overlay[hidden],
.mobile-profile-sheet-overlay[hidden] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Sheet Card Container */
.mobile-action-sheet,
.mobile-model-sheet {
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 44px);
  background: #0B0F17;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.mobile-bottom-sheet-overlay.is-open .mobile-action-sheet,
.mobile-model-sheet-overlay.is-open .mobile-model-sheet,
.mobile-profile-sheet-overlay.is-open .mobile-action-sheet {
  transform: translateY(0);
}

.mobile-bottom-sheet-overlay.is-closing .mobile-action-sheet,
.mobile-model-sheet-overlay.is-closing .mobile-model-sheet,
.mobile-profile-sheet-overlay.is-closing .mobile-action-sheet {
  transform: translateY(100%);
}

[data-theme="light"] .mobile-action-sheet,
[data-theme="light"] .mobile-model-sheet,
html:not(.dark) .mobile-action-sheet,
html:not(.dark) .mobile-model-sheet {
  background: #FFFFFF;
  border-top: 1px solid rgba(20, 27, 42, 0.09);
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.14);
}

/* Drag Handle Area */
.mobile-sheet-drag-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0 6px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  flex-shrink: 0;
}

.mobile-sheet-drag-handle {
  width: 38px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 150ms ease;
}

[data-theme="light"] .mobile-sheet-drag-handle,
html:not(.dark) .mobile-sheet-drag-handle {
  background: rgba(15, 23, 42, 0.2);
}

/* Sheet Header */
.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 12px;
  flex-shrink: 0;
}

.mobile-sheet-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary, #F8FAFC);
  margin: 0;
  letter-spacing: -0.01em;
}

.mobile-sheet-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #94A3B8);
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease, color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-close-btn:hover,
.mobile-sheet-close-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #FFFFFF);
}

[data-theme="light"] .mobile-sheet-close-btn,
html:not(.dark) .mobile-sheet-close-btn {
  background: rgba(15, 23, 42, 0.05);
}

/* Scrollable Sheet Body */
.mobile-sheet-body {
  padding: 0 16px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(65vh, 480px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Quick Action Tiles (Files, Images/Camera) */
.mobile-sheet-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex-shrink: 0;
}

.mobile-sheet-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #F8FAFC);
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-tile:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .mobile-sheet-tile,
html:not(.dark) .mobile-sheet-tile {
  background: #F8FAFC;
  border: 1px solid rgba(20, 27, 42, 0.07);
}

[data-theme="light"] .mobile-sheet-tile:active,
html:not(.dark) .mobile-sheet-tile:active {
  background: #F1F5F9;
}

.mobile-sheet-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.mobile-sheet-tile.tile-files .mobile-sheet-tile-icon {
  background: rgba(79, 110, 232, 0.15);
  color: #6380ff;
}

.mobile-sheet-tile.tile-photos .mobile-sheet-tile-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.mobile-sheet-tile-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary, #F8FAFC);
}

.mobile-sheet-tile-desc {
  font-size: 11px;
  color: var(--text-tertiary, #94A3B8);
  margin-top: 2px;
  line-height: 1.2;
}

/* Context List */
.mobile-sheet-list {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

[data-theme="light"] .mobile-sheet-list,
html:not(.dark) .mobile-sheet-list {
  border: 1px solid rgba(20, 27, 42, 0.07);
  background: #FAFAFA;
}

.mobile-sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary, #F8FAFC);
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-row:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 54px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .mobile-sheet-row:not(:last-child)::after,
html:not(.dark) .mobile-sheet-row:not(:last-child)::after {
  background: rgba(20, 27, 42, 0.05);
}

.mobile-sheet-row:active {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .mobile-sheet-row:active,
html:not(.dark) .mobile-sheet-row:active {
  background: #F1F5F9;
}

.mobile-sheet-row-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-sheet-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #F8FAFC);
  flex-shrink: 0;
}

[data-theme="light"] .mobile-sheet-row-icon,
html:not(.dark) .mobile-sheet-row-icon {
  background: #EDE9FE;
  color: #4F46E5;
}

.mobile-sheet-row-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-sheet-row-copy strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #F8FAFC);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-sheet-row-copy small {
  font-size: 11.5px;
  color: var(--text-tertiary, #94A3B8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-sheet-row-trailing {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--text-tertiary, #94A3B8);
  font-size: 18px;
  padding-left: 8px;
}

/* Clear context button */
.mobile-sheet-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
  margin-top: 4px;
}

.mobile-sheet-clear-btn:active {
  background: rgba(239, 68, 68, 0.15);
}

/* Sub-pane header */
.mobile-sheet-sub-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 10px;
  flex-shrink: 0;
}

[data-theme="light"] .mobile-sheet-sub-nav,
html:not(.dark) .mobile-sheet-sub-nav {
  border-bottom: 1px solid rgba(20, 27, 42, 0.08);
}

.mobile-sheet-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #F8FAFC);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-back-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .mobile-sheet-back-btn,
html:not(.dark) .mobile-sheet-back-btn {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(20, 27, 42, 0.08);
  color: var(--text-primary, #0F172A);
}

[data-theme="light"] .mobile-sheet-back-btn:active,
html:not(.dark) .mobile-sheet-back-btn:active {
  background: rgba(15, 23, 42, 0.1);
}

.mobile-sheet-sub-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-primary, #F8FAFC);
}

[data-theme="light"] .mobile-sheet-sub-title,
html:not(.dark) .mobile-sheet-sub-title {
  color: var(--text-primary, #0F172A);
}

/* Sub-pane item list */
.mobile-sheet-sub-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 2px 1px 12px;
}

.mobile-sheet-sub-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 23, 28, 0.65);
  color: var(--text-primary, #F8FAFC);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, transform 120ms ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-sub-item:active {
  transform: scale(0.99);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-sheet-sub-item.is-selected {
  border-color: rgba(99, 128, 255, 0.55);
  background: rgba(99, 128, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(99, 128, 255, 0.25);
}

.mobile-sheet-sub-item strong,
.mobile-sheet-sub-item .mobile-sheet-sub-item-title {
  display: block;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary, #F8FAFC);
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.mobile-sheet-sub-item small,
.mobile-sheet-sub-item .mobile-sheet-sub-item-meta {
  display: block;
  width: 100%;
  font-size: 11.5px;
  font-weight: 450;
  line-height: 1.25;
  color: var(--text-tertiary, #94A3B8);
  text-align: left;
  margin-top: 1px;
  white-space: normal;
}

.mobile-sheet-sub-item.is-selected strong,
.mobile-sheet-sub-item.is-selected .mobile-sheet-sub-item-title {
  color: #FFFFFF;
}

.mobile-sheet-sub-item.is-selected small,
.mobile-sheet-sub-item.is-selected .mobile-sheet-sub-item-meta {
  color: var(--theme-blue-ink, #93C5FD);
  font-weight: 550;
}

[data-theme="light"] .mobile-sheet-sub-item,
html:not(.dark) .mobile-sheet-sub-item {
  background: #F8FAFC;
  border: 1px solid rgba(20, 27, 42, 0.08);
  color: var(--text-primary, #0F172A);
}

[data-theme="light"] .mobile-sheet-sub-item:active,
html:not(.dark) .mobile-sheet-sub-item:active {
  background: #F1F5F9;
}

[data-theme="light"] .mobile-sheet-sub-item.is-selected,
html:not(.dark) .mobile-sheet-sub-item.is-selected {
  border-color: rgba(79, 110, 232, 0.45);
  background: rgba(79, 110, 232, 0.08);
  box-shadow: 0 0 0 1px rgba(79, 110, 232, 0.15);
}

[data-theme="light"] .mobile-sheet-sub-item strong,
[data-theme="light"] .mobile-sheet-sub-item .mobile-sheet-sub-item-title,
html:not(.dark) .mobile-sheet-sub-item strong,
html:not(.dark) .mobile-sheet-sub-item .mobile-sheet-sub-item-title {
  color: var(--text-primary, #0F172A);
}

[data-theme="light"] .mobile-sheet-sub-item small,
[data-theme="light"] .mobile-sheet-sub-item .mobile-sheet-sub-item-meta,
html:not(.dark) .mobile-sheet-sub-item small,
html:not(.dark) .mobile-sheet-sub-item .mobile-sheet-sub-item-meta {
  color: var(--text-secondary, #64748B);
}

[data-theme="light"] .mobile-sheet-sub-item.is-selected small,
[data-theme="light"] .mobile-sheet-sub-item.is-selected .mobile-sheet-sub-item-meta,
html:not(.dark) .mobile-sheet-sub-item.is-selected small,
html:not(.dark) .mobile-sheet-sub-item.is-selected .mobile-sheet-sub-item-meta {
  color: #3730A3;
}

.mobile-sheet-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-tertiary, #94A3B8);
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .mobile-sheet-empty,
html:not(.dark) .mobile-sheet-empty {
  border-color: rgba(20, 27, 42, 0.08);
  background: #F8FAFC;
  color: var(--text-secondary, #64748B);
}

/* Footer Row: Personal Intelligence */
.mobile-sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 4px;
  flex-shrink: 0;
}

[data-theme="light"] .mobile-sheet-footer,
html:not(.dark) .mobile-sheet-footer {
  border-top: 1px solid rgba(20, 27, 42, 0.07);
}

.mobile-sheet-footer-leading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-sheet-footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 128, 255, 0.15);
  color: #6380ff;
  flex-shrink: 0;
}

.mobile-sheet-footer-copy {
  display: flex;
  flex-direction: column;
}

.mobile-sheet-footer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #F8FAFC);
}

.mobile-sheet-footer-status {
  font-size: 11px;
  color: var(--text-tertiary, #94A3B8);
}

/* Model Selector Sheet */
.mobile-model-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
}

.mobile-model-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary, #F8FAFC);
  cursor: pointer;
  text-align: left;
  transition: all 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-model-option-card.is-active {
  border-color: rgba(99, 128, 255, 0.45);
  background: rgba(99, 128, 255, 0.09);
}

.mobile-model-option-card:active {
  transform: scale(0.99);
}

[data-theme="light"] .mobile-model-option-card,
html:not(.dark) .mobile-model-option-card {
  background: #F8FAFC;
  border: 1px solid rgba(20, 27, 42, 0.07);
}

[data-theme="light"] .mobile-model-option-card.is-active,
html:not(.dark) .mobile-model-option-card.is-active {
  border-color: rgba(99, 128, 255, 0.5);
  background: rgba(99, 128, 255, 0.08);
}

.mobile-model-card-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-model-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #F8FAFC);
  flex-shrink: 0;
}

.mobile-model-option-card.is-active .mobile-model-card-icon {
  background: rgba(99, 128, 255, 0.2);
  color: #6380ff;
}

.mobile-model-card-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-model-card-copy strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary, #F8FAFC);
}

.mobile-model-card-copy small {
  font-size: 11.5px;
  color: var(--text-tertiary, #94A3B8);
}

.mobile-model-card-check {
  font-size: 16px;
  font-weight: 700;
  color: #6380ff;
  padding-left: 8px;
}

/* Thinking toggle row inside model sheet */
.mobile-model-thinking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 4px;
}

[data-theme="light"] .mobile-model-thinking-row,
html:not(.dark) .mobile-model-thinking-row {
  border-color: rgba(20, 27, 42, 0.1);
  background: #F8FAFC;
}

/* ── Responsive User Profile Menu (Desktop Popover vs Mobile Sheet) ── */

/* Desktop Floating Context Popover */
.profile-popover-menu {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px var(--theme-shadow-strong, rgba(0, 0, 0, 0.16)), 0 2px 8px var(--theme-shadow-soft, rgba(0, 0, 0, 0.06));
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 160ms cubic-bezier(0.16, 1, 0.3, 1), transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.profile-popover-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.profile-popover-menu[hidden] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Profile Menu Content & Structure */
.profile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
}

.mobile-profile-sheet .profile-menu-content {
  padding: 4px 14px 18px;
}

/* Header */
.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease;
  user-select: none;
}

.profile-menu-header:hover,
.profile-menu-header:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.profile-menu-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font-size: 12px;
}

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

.profile-menu-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-plan {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, color 140ms ease;
}

.profile-menu-header:hover .profile-menu-chevron {
  color: var(--text-secondary);
  transform: translateX(2px);
}

/* Subtle Divider */
.profile-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 4px;
}

/* Section Containers */
.profile-menu-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Menu Items */
.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 130ms ease, color 130ms ease;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.4;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

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

.profile-menu-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 130ms ease;
}

.profile-menu-item:hover .profile-menu-item-icon {
  color: var(--text-primary);
}

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

.profile-menu-item-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 130ms ease, color 130ms ease;
}

.profile-menu-item:hover .profile-menu-item-chevron {
  color: var(--text-secondary);
  transform: translateX(2px);
}

/* Logout / Danger Item */
.profile-menu-item.is-danger {
  color: var(--text-primary);
}

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

.profile-menu-item.is-danger:hover .profile-menu-item-icon,
.profile-menu-item.is-danger:hover .profile-menu-item-chevron {
  color: var(--danger, #ef4444);
}

/* Dark Theme Parity */
[data-theme="dark"] .profile-popover-menu,
html.dark .profile-popover-menu {
  background: #111726;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .profile-menu-header:hover,
html.dark .profile-menu-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .profile-menu-item:hover,
html.dark .profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .profile-menu-item.is-danger:hover,
html.dark .profile-menu-item.is-danger:hover {
  background: rgba(239, 68, 68, 0.14);
}

/* ==========================================================================
   Strategy Action Bar - "Xülasə" (Summary) Feature
   Desktop: Elegant Modal / Popover
   Mobile: Native Bottom Sheet
   ========================================================================== */

.refinement-dock .dock-summary-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--theme-copy, #526070);
  font-size: 14px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

.refinement-dock .dock-summary-btn:hover:not(:disabled) {
  background: var(--theme-surface-soft, #f0f2f4);
  color: var(--theme-ink, #172033);
}

.refinement-dock .dock-summary-btn .dock-btn-icon {
  width: 17px;
  height: 17px;
  color: currentColor;
  flex-shrink: 0;
}

/* Modal / Sheet Root */
.strategy-summary-root {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.strategy-summary-root.is-open {
  display: flex;
  pointer-events: auto;
}

.strategy-summary-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: strategy-summary-fade-in 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: pointer;
}

.strategy-summary-modal {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 32px));
  max-height: min(84vh, 780px);
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.12));
  border-radius: 22px;
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 28px 72px var(--theme-shadow-strong, rgba(15, 23, 42, 0.2)), 0 8px 24px var(--theme-shadow-soft, rgba(15, 23, 42, 0.08));
  overflow: hidden;
  animation: strategy-summary-scale-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.strategy-summary-grab-handle {
  display: none;
}

.strategy-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--theme-border, rgba(15, 23, 42, 0.08));
  background: var(--theme-surface, #ffffff);
  flex-shrink: 0;
}

.strategy-summary-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.strategy-summary-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--theme-blue-surface, #eff6ff);
  border: 1px solid var(--theme-blue-border, #dbeafe);
  color: var(--theme-blue-ink, #2563eb);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strategy-summary-kicker-spark {
  font-size: 10px;
  line-height: 1;
}

.strategy-summary-title {
  margin: 0;
  color: var(--theme-ink, #0f172a);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.strategy-summary-subtitle {
  margin: 0;
  color: var(--theme-muted, #64748b);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 480px;
}

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

.strategy-summary-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.1));
  border-radius: 10px;
  background: var(--theme-surface, #ffffff);
  color: var(--theme-copy, #475569);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all 140ms ease;
}

.strategy-summary-action-btn:hover {
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-ink, #0f172a);
  border-color: var(--theme-border-strong, #cbd5e1);
}

.strategy-summary-close-btn {
  width: 36px;
  padding: 0;
}

.strategy-summary-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, var(--theme-surface, #ffffff) 0%, var(--theme-surface-soft, #f8fafc) 100%);
  flex: 1;
}

/* Summary Cards */
.strategy-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.08));
  background: var(--theme-surface, #ffffff);
  box-shadow: 0 2px 8px var(--theme-shadow-soft, rgba(15, 23, 42, 0.03));
  transition: border-color 140ms ease;
}

.strategy-summary-card:hover {
  border-color: var(--theme-border-strong, rgba(15, 23, 42, 0.16));
}

.strategy-summary-card-heading {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--theme-ink, #0f172a);
  font-size: 13.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.strategy-summary-card-icon {
  font-size: 15px;
}

.strategy-summary-card-text {
  margin: 0;
  color: var(--theme-copy, #334155);
  font-size: 13.5px;
  line-height: 1.6;
}

.strategy-summary-moves-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.strategy-summary-move-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--theme-surface-soft, #f8fafc);
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.05));
}

.strategy-summary-move-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--theme-blue-surface, #eff6ff);
  color: var(--theme-blue-ink, #2563eb);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.strategy-summary-move-text {
  color: var(--theme-copy, #334155);
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
}

.strategy-summary-card--takeaway {
  border-color: var(--theme-blue-border, #bfdbfe);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.6) 0%, rgba(240, 249, 255, 0.4) 100%);
}

.strategy-summary-card--takeaway .strategy-summary-card-heading {
  color: var(--theme-blue-ink, #1d4ed8);
}

/* Skeleton Loading State */
.strategy-summary-skeleton {
  display: grid;
  gap: 16px;
}

.strategy-summary-skeleton-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--theme-surface-soft, #f1f5f9);
  color: var(--theme-muted, #64748b);
  font-size: 12.5px;
  font-weight: 500;
  width: fit-content;
}

.strategy-summary-skeleton-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-blue-ink, #3b82f6);
  animation: strategy-summary-pulse 1.4s ease-in-out infinite;
}

.strategy-summary-skeleton-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--theme-border, rgba(15, 23, 42, 0.06));
  background: var(--theme-surface, #ffffff);
}

.strategy-summary-skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--theme-surface-soft, #f1f5f9) 25%, var(--theme-surface-muted, #e2e8f0) 50%, var(--theme-surface-soft, #f1f5f9) 75%);
  background-size: 200% 100%;
  animation: strategy-summary-shimmer 1.8s infinite;
}

.strategy-summary-skeleton-title {
  width: 38%;
  height: 16px;
  margin-bottom: 2px;
}

.strategy-summary-skeleton-short {
  width: 65%;
}

/* Error Container */
.strategy-summary-error-container {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.strategy-summary-error-icon {
  font-size: 28px;
}

.strategy-summary-error-msg {
  margin: 0;
  color: var(--theme-danger-ink, #dc2626);
  font-size: 14px;
  line-height: 1.5;
  max-width: 420px;
}

/* Footer */
.strategy-summary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--theme-border, rgba(15, 23, 42, 0.08));
  background: var(--theme-surface, #ffffff);
  flex-shrink: 0;
}

.strategy-summary-footer-meta {
  color: var(--theme-muted, #94a3b8);
  font-size: 12px;
}

.strategy-summary-footer-close {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

/* Animations */
@keyframes strategy-summary-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes strategy-summary-scale-in {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes strategy-summary-sheet-in {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes strategy-summary-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes strategy-summary-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Mobile Native Bottom Sheet */
@media (max-width: 700px) {
  .workspace-document .dock-summary-separator {
    display: inline-block !important;
  }

  .strategy-summary-root {
    padding: 0;
    align-items: flex-end;
  }

  .strategy-summary-modal {
    width: 100%;
    max-width: 100%;
    height: min(85dvh, 760px);
    max-height: calc(100dvh - 50px);
    border-width: 1px 0 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.2);
    animation: strategy-summary-sheet-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .strategy-summary-grab-handle {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 2px;
    border-radius: 999px;
    background: var(--theme-surface-muted, #cbd5e1);
    flex-shrink: 0;
  }

  .strategy-summary-header {
    padding: 12px 18px 14px;
  }

  .strategy-summary-subtitle {
    max-width: 240px;
  }

  .strategy-summary-body {
    padding: 16px 18px;
    gap: 12px;
  }

  .strategy-summary-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }
}

/* Dark Mode Overrides */
[data-theme="dark"] .strategy-summary-modal,
html.dark .strategy-summary-modal {
  background: var(--theme-surface, #0f172a);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .strategy-summary-header,
html.dark .strategy-summary-header,
[data-theme="dark"] .strategy-summary-footer,
html.dark .strategy-summary-footer {
  background: var(--theme-surface, #0f172a);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .strategy-summary-body,
html.dark .strategy-summary-body {
  background: linear-gradient(180deg, #0f172a 0%, #090e17 100%);
}

[data-theme="dark"] .strategy-summary-card,
html.dark .strategy-summary-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .strategy-summary-card--takeaway,
html.dark .strategy-summary-card--takeaway {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.5) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .strategy-summary-move-item,
html.dark .strategy-summary-move-item {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .strategy-summary-title,
html.dark .strategy-summary-title,
[data-theme="dark"] .strategy-summary-card-heading,
html.dark .strategy-summary-card-heading {
  color: #f8fafc;
}

[data-theme="dark"] .strategy-summary-card-text,
html.dark .strategy-summary-card-text,
[data-theme="dark"] .strategy-summary-move-text,
html.dark .strategy-summary-move-text {
  color: #cbd5e1;
}

[data-theme="dark"] .strategy-summary-action-btn,
html.dark .strategy-summary-action-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

[data-theme="dark"] .strategy-summary-action-btn:hover,
html.dark .strategy-summary-action-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f8fafc;
}

[data-theme="dark"] .strategy-summary-skeleton-card,
html.dark .strategy-summary-skeleton-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .strategy-summary-skeleton-line,
html.dark .strategy-summary-skeleton-line {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
}

/* ===== SIDEBAR WHAT'S NEW BADGE ===== */

.whats-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  background: rgba(79, 110, 232, 0.09);
  color: var(--accent, #4f6ee8);
  border: 1px solid rgba(79, 110, 232, 0.2);
  transition: all 140ms ease;
  letter-spacing: 0.02em;
}

.nav-item:hover .whats-new-badge {
  background: rgba(79, 110, 232, 0.16);
  border-color: rgba(79, 110, 232, 0.35);
}

[data-theme="dark"] .whats-new-badge,
html.dark .whats-new-badge {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.25);
}

[data-theme="dark"] .nav-item:hover .whats-new-badge,
html.dark .nav-item:hover .whats-new-badge {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
}

/* ===== CHANGELOG / WHAT'S NEW MODAL & BOTTOM SHEET ===== */

.changelog-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--theme-overlay, rgba(15, 23, 42, 0.5));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.changelog-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.changelog-modal-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

.changelog-modal-overlay[hidden] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop Modal Card */
.changelog-modal-card {
  width: min(100%, 640px);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.09));
  background: var(--bg-elevated, #ffffff);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.changelog-modal-overlay.is-open .changelog-modal-card {
  transform: scale(1) translateY(0);
}

.changelog-modal-overlay.is-closing .changelog-modal-card {
  transform: scale(0.96) translateY(8px);
}

/* Mobile Bottom Sheet Layout & Responsive Dimension Adaptation */
@media (max-width: 767px) {
  .changelog-modal-overlay,
  .changelog-modal-overlay.is-mobile {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .changelog-modal-card,
  .changelog-sheet.mobile-action-sheet {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(88dvh, calc(100dvh - 36px)) !important;
    border-radius: 24px 24px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    margin: 0 !important;
    background: var(--bg-elevated, #ffffff);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(100%);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }

  .changelog-modal-overlay.is-open .changelog-modal-card,
  .changelog-modal-overlay.is-open .changelog-sheet.mobile-action-sheet,
  .changelog-modal-overlay.is-mobile.is-open .changelog-sheet.mobile-action-sheet {
    transform: translateY(0) !important;
  }

  .changelog-modal-overlay.is-closing .changelog-modal-card,
  .changelog-modal-overlay.is-closing .changelog-sheet.mobile-action-sheet,
  .changelog-modal-overlay.is-mobile.is-closing .changelog-sheet.mobile-action-sheet {
    transform: translateY(100%) !important;
  }

  /* Responsive Header Adaptation */
  .changelog-modal-header,
  .changelog-sheet-header {
    padding: 12px 16px !important;
    gap: 10px !important;
  }

  .changelog-header-left {
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .changelog-icon-badge {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .changelog-icon-badge svg {
    width: 18px !important;
    height: 18px !important;
  }

  .changelog-title-group {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .changelog-modal-title {
    font-size: 16px !important;
    margin: 0 0 2px !important;
    line-height: 1.25 !important;
  }

  .changelog-modal-subtitle {
    font-size: 12px !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    text-overflow: clip !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .changelog-modal-close {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
  }

  /* Responsive Body & Touch Scrolling */
  .changelog-modal-body,
  .changelog-sheet-body {
    padding: 14px 16px 18px !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
  }

  /* Responsive Timeline Adaptation */
  .changelog-timeline {
    gap: 18px !important;
  }

  .changelog-timeline-item {
    gap: 12px !important;
  }

  .changelog-timeline-marker {
    width: 16px !important;
    padding-top: 4px !important;
    flex-shrink: 0 !important;
  }

  .changelog-timeline-line {
    top: 18px !important;
    bottom: -18px !important;
    width: 2px !important;
  }

  .changelog-timeline-dot {
    width: 10px !important;
    height: 10px !important;
  }

  .changelog-timeline-item.is-current .changelog-timeline-dot,
  .changelog-timeline-item.is-upcoming .changelog-timeline-dot {
    width: 12px !important;
    height: 12px !important;
  }

  .changelog-dot-pulse {
    inset: -3.5px !important;
  }

  /* Responsive Content Cards */
  .changelog-timeline-content {
    padding: 12px 14px 14px !important;
    border-radius: 13px !important;
  }

  .changelog-item-header {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
  }

  .changelog-version-tag {
    font-size: 13px !important;
  }

  .changelog-status-pill {
    font-size: 10px !important;
    padding: 1.5px 7px !important;
  }

  .changelog-release-date {
    font-size: 11px !important;
    margin-left: auto !important;
  }

  .changelog-item-title {
    font-size: 13px !important;
    line-height: 1.35 !important;
    margin: 0 0 8px !important;
  }

  .changelog-feature-list {
    gap: 6px !important;
  }

  .changelog-feature-item {
    gap: 8px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .changelog-feature-bullet {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    margin-top: 1px !important;
  }

  .changelog-feature-bullet svg {
    width: 10px !important;
    height: 10px !important;
  }

  /* Responsive Footer Adaptation */
  /* Responsive Footer Adaptation */
  .changelog-modal-footer,
  .changelog-sheet-footer {
    padding: 12px 16px max(12px, env(safe-area-inset-bottom)) !important;
    gap: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .changelog-feedback-btn {
    width: 100% !important;
    flex: 1 1 100% !important;
    justify-content: center !important;
    padding: 11px 16px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
  }
}

/* Micro-screen optimization for phones <= 390px (e.g. iPhone SE) */
@media (max-width: 390px) {
  .changelog-modal-header,
  .changelog-sheet-header {
    padding: 10px 12px !important;
  }

  .changelog-modal-body,
  .changelog-sheet-body {
    padding: 12px 10px 14px !important;
  }

  .changelog-timeline-content {
    padding: 10px 10px 12px !important;
  }

  .changelog-modal-footer,
  .changelog-sheet-footer {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom)) !important;
  }

  .changelog-feedback-btn {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    min-height: 40px !important;
  }
}

/* Modal Header */
.changelog-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.08));
  flex-shrink: 0;
  background: var(--bg-elevated, #ffffff);
}

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

.changelog-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 110, 232, 0.1);
  color: var(--accent, #4f6ee8);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 110, 232, 0.12);
}

.changelog-title-group {
  min-width: 0;
}

.changelog-modal-title {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
}

.changelog-modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changelog-modal-close {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.09));
  border-radius: 8px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  font-size: 14px;
  transition: all 140ms ease;
}

.changelog-modal-close:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-hover, #cbd5e1);
}

/* Modal Body & Scrollbar */
.changelog-modal-body {
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover, #cbd5e1) transparent;
}

.changelog-modal-body::-webkit-scrollbar {
  width: 6px;
}

.changelog-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.changelog-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-hover, #cbd5e1);
  border-radius: 9999px;
}

/* Timeline Layout */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.changelog-timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
}

/* Track, Line & Dot */
.changelog-timeline-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  padding-top: 3px;
}

.changelog-timeline-line {
  position: absolute;
  top: 22px;
  bottom: -24px;
  width: 2px;
  background: var(--border-subtle, rgba(20, 27, 42, 0.1));
}

.changelog-timeline-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-hover, #cbd5e1);
  border: 2px solid var(--bg-elevated, #ffffff);
  box-shadow: 0 0 0 2px rgba(20, 27, 42, 0.08);
  z-index: 2;
  transition: all 200ms ease;
}

.changelog-timeline-item.is-current .changelog-timeline-dot {
  width: 14px;
  height: 14px;
  background: var(--accent, #4f6ee8);
  border: 2.5px solid var(--bg-elevated, #ffffff);
  box-shadow: 0 0 0 3px rgba(79, 110, 232, 0.25), 0 0 12px rgba(79, 110, 232, 0.35);
}

.changelog-timeline-item.is-upcoming .changelog-timeline-dot {
  width: 14px;
  height: 14px;
  background: #8b5cf6;
  border: 2.5px solid var(--bg-elevated, #ffffff);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), 0 0 14px rgba(139, 92, 246, 0.4);
}

.changelog-dot-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent, #4f6ee8);
  opacity: 0.6;
  animation: changelogPulse 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.changelog-dot-pulse.is-upcoming {
  border-color: #8b5cf6;
}

@keyframes changelogPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Timeline Content Card */
.changelog-timeline-content {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.07));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 180ms ease;
}

.changelog-timeline-item.is-current .changelog-timeline-content {
  background: rgba(79, 110, 232, 0.035);
  border-color: rgba(79, 110, 232, 0.22);
  box-shadow: 0 4px 18px rgba(79, 110, 232, 0.06);
}

.changelog-timeline-item.is-upcoming .changelog-timeline-content {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(79, 110, 232, 0.04));
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.changelog-item-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.changelog-version-tag {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary, #0f172a);
  font-variant-numeric: tabular-nums;
}

.changelog-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-hover, rgba(20, 27, 42, 0.06));
  color: var(--text-tertiary, #64748b);
  border: 1px solid rgba(20, 27, 42, 0.06);
}

.changelog-status-pill.is-current {
  background: rgba(79, 110, 232, 0.12);
  color: var(--accent, #4f6ee8);
  border-color: rgba(79, 110, 232, 0.28);
}

.changelog-status-pill.is-upcoming {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.3);
  font-weight: 700;
}

.changelog-release-date {
  font-size: 12px;
  color: var(--text-tertiary, #94a3b8);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.changelog-item-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-primary, #0f172a);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.changelog-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changelog-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #334155);
}

.changelog-feature-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-tertiary, #64748b);
  flex-shrink: 0;
  margin-top: 1.5px;
}

.changelog-feature-bullet.is-current {
  background: rgba(79, 110, 232, 0.12);
  color: var(--accent, #4f6ee8);
}

.changelog-feature-bullet.is-upcoming {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.changelog-feature-text {
  flex: 1;
  word-break: break-word;
}

/* Modal Footer */
.changelog-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.08));
  background: var(--bg-soft, #f8fafc);
  flex-shrink: 0;
}

.changelog-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle, rgba(20, 27, 42, 0.12));
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.changelog-feedback-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--accent, #4f6ee8);
  border-color: rgba(79, 110, 232, 0.35);
  box-shadow: 0 2px 8px rgba(79, 110, 232, 0.12);
}

/* ===== DARK MODE OVERRIDES FOR CHANGELOG ===== */

[data-theme="dark"] .changelog-modal-overlay,
html.dark .changelog-modal-overlay {
  background: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .changelog-modal-card,
html.dark .changelog-modal-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

@media (max-width: 767px) {
  [data-theme="dark"] .changelog-modal-overlay .changelog-modal-card,
  [data-theme="dark"] .changelog-modal-overlay .changelog-sheet.mobile-action-sheet,
  [data-theme="dark"] .changelog-modal-overlay.is-mobile .changelog-sheet.mobile-action-sheet,
  html.dark .changelog-modal-overlay .changelog-modal-card,
  html.dark .changelog-modal-overlay .changelog-sheet.mobile-action-sheet,
  html.dark .changelog-modal-overlay.is-mobile .changelog-sheet.mobile-action-sheet {
    background: #0B0F17 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.8) !important;
  }

  [data-theme="dark"] .changelog-sheet-header,
  html.dark .changelog-sheet-header {
    background: #0B0F17 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }

  [data-theme="dark"] .changelog-modal-footer,
  [data-theme="dark"] .changelog-sheet-footer,
  html.dark .changelog-modal-footer,
  html.dark .changelog-sheet-footer {
    background: #0B0F17 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  [data-theme="light"] .changelog-modal-overlay .changelog-modal-card,
  [data-theme="light"] .changelog-modal-overlay .changelog-sheet.mobile-action-sheet,
  html:not(.dark) .changelog-modal-overlay .changelog-modal-card,
  html:not(.dark) .changelog-modal-overlay .changelog-sheet.mobile-action-sheet {
    background: #FFFFFF !important;
    border-top: 1px solid rgba(20, 27, 42, 0.09) !important;
    box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.14) !important;
  }

  [data-theme="light"] .changelog-sheet-header,
  html:not(.dark) .changelog-sheet-header {
    background: #FFFFFF !important;
    border-color: rgba(20, 27, 42, 0.08) !important;
  }

  [data-theme="light"] .changelog-modal-footer,
  [data-theme="light"] .changelog-sheet-footer,
  html:not(.dark) .changelog-modal-footer,
  html:not(.dark) .changelog-sheet-footer {
    background: #F8FAFC !important;
    border-top: 1px solid rgba(20, 27, 42, 0.08) !important;
  }
}

[data-theme="dark"] .changelog-modal-header,
html.dark .changelog-modal-header {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .changelog-icon-badge,
html.dark .changelog-icon-badge {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .changelog-modal-title,
html.dark .changelog-modal-title {
  color: #f1f5f9;
}

[data-theme="dark"] .changelog-modal-subtitle,
html.dark .changelog-modal-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .changelog-modal-close,
html.dark .changelog-modal-close {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

[data-theme="dark"] .changelog-modal-close:hover,
html.dark .changelog-modal-close:hover {
  background: #334155;
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.15);
}

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

[data-theme="dark"] .changelog-timeline-dot,
html.dark .changelog-timeline-dot {
  background: #334155;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .changelog-timeline-item.is-current .changelog-timeline-dot,
html.dark .changelog-timeline-item.is-current .changelog-timeline-dot {
  background: #3b82f6;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 0 14px rgba(59, 130, 246, 0.5);
}

[data-theme="dark"] .changelog-timeline-item.is-upcoming .changelog-timeline-dot,
html.dark .changelog-timeline-item.is-upcoming .changelog-timeline-dot {
  background: #a855f7;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35), 0 0 16px rgba(168, 85, 247, 0.5);
}

[data-theme="dark"] .changelog-dot-pulse,
html.dark .changelog-dot-pulse {
  border-color: #60a5fa;
}

[data-theme="dark"] .changelog-dot-pulse.is-upcoming,
html.dark .changelog-dot-pulse.is-upcoming {
  border-color: #c084fc;
}

[data-theme="dark"] .changelog-timeline-content,
html.dark .changelog-timeline-content {
  background: #141d2e;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .changelog-timeline-item.is-current .changelog-timeline-content,
html.dark .changelog-timeline-item.is-current .changelog-timeline-content {
  background: rgba(59, 130, 246, 0.07);
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .changelog-timeline-item.is-upcoming .changelog-timeline-content,
html.dark .changelog-timeline-item.is-upcoming .changelog-timeline-content {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.06));
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.15);
}

[data-theme="dark"] .changelog-version-tag,
html.dark .changelog-version-tag {
  color: #f1f5f9;
}

[data-theme="dark"] .changelog-status-pill,
html.dark .changelog-status-pill {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .changelog-status-pill.is-current,
html.dark .changelog-status-pill.is-current {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .changelog-status-pill.is-upcoming,
html.dark .changelog-status-pill.is-upcoming {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.4);
}

[data-theme="dark"] .changelog-release-date,
html.dark .changelog-release-date {
  color: #64748b;
}

[data-theme="dark"] .changelog-item-title,
html.dark .changelog-item-title {
  color: #f1f5f9;
}

[data-theme="dark"] .changelog-feature-item,
html.dark .changelog-feature-item {
  color: #cbd5e1;
}

[data-theme="dark"] .changelog-feature-bullet,
html.dark .changelog-feature-bullet {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

[data-theme="dark"] .changelog-feature-bullet.is-current,
html.dark .changelog-feature-bullet.is-current {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .changelog-feature-bullet.is-upcoming,
html.dark .changelog-feature-bullet.is-upcoming {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

[data-theme="dark"] .changelog-modal-footer,
html.dark .changelog-modal-footer {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .changelog-feedback-btn,
html.dark .changelog-feedback-btn {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

[data-theme="dark"] .changelog-feedback-btn:hover,
html.dark .changelog-feedback-btn:hover {
  background: #334155;
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.4);
}

/* ==========================================================================
   Support Chat Bubble (Minimalist & Premium Floating Action)
   ========================================================================== */

.support-chat-widget {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 95;
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-chat-widget:hover {
  transform: translateY(-2px);
}

.support-chat-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 9999px;
  background: #0b1f3a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -4px rgba(11, 31, 58, 0.3), 0 4px 10px -2px rgba(11, 31, 58, 0.18);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.support-chat-widget:hover .support-chat-bubble {
  background: #132d52;
  box-shadow: 0 14px 32px -4px rgba(11, 31, 58, 0.38), 0 6px 14px -2px rgba(11, 31, 58, 0.22);
  transform: scale(1.04);
}

.support-chat-widget:active .support-chat-bubble {
  transform: scale(0.96);
}

.support-chat-icon {
  width: 22px;
  height: 22px;
  transition: transform 200ms ease;
}

.support-chat-widget:hover .support-chat-icon {
  transform: scale(1.05);
}

.support-chat-status-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

/* Tooltip speech bubble */
.support-chat-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 180ms;
}

/* Tail pointing toward bubble */
.support-chat-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.support-chat-widget:hover .support-chat-tooltip,
.support-chat-widget:focus-visible .support-chat-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* Dark Theme Support */
[data-theme="dark"] .support-chat-bubble,
html.dark .support-chat-bubble {
  background: #f8fafc;
  color: #0b0f17;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .support-chat-widget:hover .support-chat-bubble,
html.dark .support-chat-widget:hover .support-chat-bubble {
  background: #ffffff;
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.7), 0 4px 14px rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .support-chat-status-dot,
html.dark .support-chat-status-dot {
  border-color: #0f172a;
}

[data-theme="dark"] .support-chat-tooltip,
html.dark .support-chat-tooltip {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .support-chat-tooltip::after,
html.dark .support-chat-tooltip::after {
  background: rgba(15, 23, 42, 0.94);
  border-right-color: rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .support-chat-widget {
    right: 18px;
    bottom: 18px;
  }
  .support-chat-bubble {
    width: 46px;
    height: 46px;
  }
  .support-chat-icon {
    width: 20px;
    height: 20px;
  }
  .support-chat-tooltip {
    right: 0;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateY(6px);
    max-width: calc(100vw - 36px);
  }
  .support-chat-tooltip::after {
    top: auto;
    bottom: -5px;
    right: 18px;
    transform: rotate(45deg);
    border-top: none;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  [data-theme="dark"] .support-chat-tooltip::after,
  html.dark .support-chat-tooltip::after {
    border-right-color: rgba(255, 255, 255, 0.12);
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }
  .support-chat-widget:hover .support-chat-tooltip,
  .support-chat-widget:focus-visible .support-chat-tooltip {
    transform: translateY(0);
  }
}

/* When popover is open, suppress hover tooltip */
.support-chat-widget.is-popover-open .support-chat-tooltip {
  display: none !important;
}

/* Popover Card */
.support-chat-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 320px;
  max-width: calc(100vw - 36px);
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.04);
  animation: popoverFadeIn 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100;
}

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

.support-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-popover-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.support-popover-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.support-popover-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
}

.support-popover-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 140ms ease;
  margin-top: -2px;
  margin-right: -2px;
}

.support-popover-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary, #0f172a);
}

.support-popover-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Email Option Link */
.support-email-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(11, 31, 58, 0.04);
  border: 1px solid rgba(11, 31, 58, 0.08);
  color: var(--text-primary, #0f172a);
  text-decoration: none;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.support-email-option:hover {
  background: rgba(11, 31, 58, 0.08);
  border-color: rgba(11, 31, 58, 0.18);
  transform: translateY(-1px);
}

.support-email-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #0b1f3a;
  color: #ffffff;
}

.support-email-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.support-email-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.01em;
}

.support-email-address {
  font-size: 11.5px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.support-email-arrow {
  color: var(--text-secondary, #94a3b8);
  display: flex;
  align-items: center;
  transition: transform 140ms ease, color 140ms ease;
}

.support-email-option:hover .support-email-arrow {
  transform: translateX(2px);
  color: var(--text-primary, #0f172a);
}

/* Copy email button */
.support-copy-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 140ms ease;
}

.support-copy-email-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-primary, #0f172a);
  border-color: rgba(15, 23, 42, 0.25);
}

/* Dark Mode */
[data-theme="dark"] .support-chat-popover,
html.dark .support-chat-popover {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .support-popover-title,
html.dark .support-popover-title {
  color: #f8fafc;
}

[data-theme="dark"] .support-popover-subtitle,
html.dark .support-popover-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .support-popover-close,
html.dark .support-popover-close {
  color: #94a3b8;
}

[data-theme="dark"] .support-popover-close:hover,
html.dark .support-popover-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

[data-theme="dark"] .support-email-option,
html.dark .support-email-option {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

[data-theme="dark"] .support-email-option:hover,
html.dark .support-email-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .support-email-icon-wrap,
html.dark .support-email-icon-wrap {
  background: #ffffff;
  color: #0b0f17;
}

[data-theme="dark"] .support-email-label,
html.dark .support-email-label {
  color: #f8fafc;
}

[data-theme="dark"] .support-email-address,
html.dark .support-email-address {
  color: #94a3b8;
}

[data-theme="dark"] .support-copy-email-btn,
html.dark .support-copy-email-btn {
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

[data-theme="dark"] .support-copy-email-btn:hover,
html.dark .support-copy-email-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}





