/* ============================================================
   Morphos AI — Butterfly Image Studio
   Dark, clinical, premium — for macro butterfly photography
   ============================================================ */

:root {
  /* Accent — gradient blue→violet by default; override-able via tweaks */
  --accent-1: #60a5fa;
  --accent-2: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.35);
  --accent-soft: rgba(167, 139, 250, 0.12);

  /* Surfaces */
  --bg-0: #07080b;
  --bg-1: #0b0d12;
  --bg-2: #11141b;
  --bg-3: #161a23;
  --bg-4: #1d2230;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);

  /* Text */
  --t-1: #f4f5f8;
  --t-2: #c2c6d0;
  --t-3: #8b909c;
  --t-4: #5c606b;
  --t-5: #393c45;

  /* Misc */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --radius-xl: 26px;

  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }

body {
  background: var(--bg-0);
  color: var(--t-1);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; }

/* ====================== APP SHELL ====================== */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(96, 165, 250, 0.05), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(167, 139, 250, 0.05), transparent 60%),
    var(--bg-0);
}

.main {
  display: grid;
  grid-template-rows: 56px 1fr;
  min-width: 0;
  border-left: 1px solid var(--line);
}

/* ====================== SIDEBAR ====================== */

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  height: 100vh;
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px 18px;
  border-bottom: 1px solid var(--line);
}
.sb-brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #0a0001;
  box-shadow:
    0 0 0 1px rgba(122, 13, 18, 0.4),
    0 0 18px -4px rgba(163, 22, 33, 0.5),
    inset 0 1px 0 rgba(163, 22, 33, 0.25);
  overflow: hidden;
}
.sb-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sb-brand-name em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--t-3);
  margin-left: 4px;
}

.sb-new {
  margin: 14px 12px 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--t-1);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}
.sb-new:hover { background: var(--bg-3); border-color: rgba(255,255,255,0.18); }
.sb-new svg { color: var(--t-2); }

.sb-section {
  padding: 14px 18px 6px 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-4);
}

.sb-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px 8px;
}
.sb-list::-webkit-scrollbar { width: 6px; }
.sb-list::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }

.sb-item {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--t-2);
  font-size: 13px;
  line-height: 1.35;
  transition: background .15s ease, color .15s ease;
  border: 1px solid transparent;
}
.sb-item:hover { background: var(--bg-2); color: var(--t-1); }
.sb-item.is-active {
  background: var(--bg-2);
  border-color: var(--line-strong);
  color: var(--t-1);
}
.sb-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-item-meta {
  font-size: 11px;
  color: var(--t-4);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.sb-item.is-active .sb-item-meta { color: var(--t-3); }

.sb-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3144, #11141b);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--t-2);
}
.sb-foot-name { font-size: 13px; color: var(--t-2); }
.sb-foot-plan { font-size: 11px; color: var(--t-4); font-family: var(--font-mono); }

/* ====================== TOPBAR ====================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.7);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 5;
}

.tb-left { display: flex; align-items: center; gap: 14px; }
.tb-model {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 8px;
  border-radius: 8px;
  transition: background .15s ease;
}
.tb-model:hover { background: var(--bg-2); }
.tb-model-name {
  font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
}
.tb-model-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--t-3);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.tb-model svg { color: var(--t-3); }

.tb-right { display: flex; align-items: center; gap: 6px; }
.tb-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--t-2);
  border: 1px solid var(--line);
  background: var(--bg-1);
  transition: background .15s, border-color .15s, color .15s;
}
.tb-pill:hover { background: var(--bg-2); color: var(--t-1); }
.tb-pill.is-on {
  color: var(--t-1);
  border-color: var(--line-strong);
  background: var(--bg-3);
}
.tb-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-glow);
}
.tb-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--t-3);
  transition: background .15s, color .15s;
}
.tb-icon-btn:hover { background: var(--bg-2); color: var(--t-1); }

.tb-divider {
  width: 1px; height: 18px; background: var(--line); margin: 0 4px;
}

/* ====================== CHAT VIEWPORT ====================== */

.chat {
  position: relative;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }

.chat-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 32px 180px 32px;
  display: flex;
  flex-direction: column;
  gap: var(--msg-gap, 16px);
}

/* User prompt bubble — large for video capture */
.user-prompt {
  align-self: flex-end;
  max-width: 78%;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  border-bottom-right-radius: 6px;
  padding: var(--user-pad, 14px 20px);
  font-size: var(--user-font, 17px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--t-1);
  font-weight: 400;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.user-prompt .meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--t-4);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.user-prompt .meta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--t-4);
}

/* AI text reply bubble — Lorem ipsum with typewriter caret */
.ai-text {
  align-self: flex-start;
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-text-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--t-3);
}
.ai-text-head .ai-head-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.ai-text-name { color: var(--t-2); }
.ai-text-body {
  align-self: flex-start;
  max-width: 100%;
  font-size: var(--ai-font, 16px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--t-1);
  font-weight: 400;
  text-wrap: pretty;
  animation: ai-text-fade-in 280ms ease-out both;
  background: linear-gradient(180deg, #2a1014, #170809);
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: var(--radius-l);
  border-bottom-left-radius: 6px;
  padding: 16px 22px;
  box-shadow:
    0 0 28px -10px rgba(239, 68, 68, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
@keyframes ai-text-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.ai-text-status {
  margin-left: 4px;
  color: var(--t-4);
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.ai-text-thinking {
  display: inline-flex;
  gap: 6px;
  padding: 6px 2px;
  align-items: center;
}
.ai-text-thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.35;
  animation: ai-thinking-bounce 1.1s ease-in-out infinite;
}
.ai-text-thinking span:nth-child(2) { animation-delay: 0.15s; }
.ai-text-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-thinking-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0) scale(0.85); }
  40%           { opacity: 1;   transform: translateY(-3px) scale(1); }
}
.ai-text-caret {
  display: inline-block;
  width: 9px;
  height: 1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent-2);
  animation: caret-blink 1s steps(1) infinite;
  transform: translateY(2px);
}
@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* AI output card */
.ai-card {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.ai-head-left { display: flex; align-items: center; gap: 12px; }
.ai-head-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: #0a0001;
  display: grid; place-items: center;
  box-shadow:
    0 0 0 1px rgba(122, 13, 18, 0.4),
    0 0 18px -4px rgba(163, 22, 33, 0.55),
    inset 0 1px 0 rgba(163, 22, 33, 0.3);
  overflow: hidden;
  position: relative;
}
.ai-head-mark.is-pulsing::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 11px;
  border: 1px solid #a31621;
  opacity: 0;
  animation: pulse-ring 1.6s ease-out infinite;
}
@keyframes pulse-ring {
  0% { opacity: .6; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.25); }
}
.ai-head-title { font-size: 13px; font-weight: 500; }
.ai-head-sub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--t-4);
  margin-top: 1px;
}
.ai-head-sub .live-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  margin-right: 6px;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.ai-head-right {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-3);
}
.ai-head-spec {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.ai-head-spec .k { color: var(--t-4); }
.ai-head-spec .v { color: var(--t-1); }

/* Image canvas */
.canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 380px;
  margin: 0 auto;
  background: #04050a;
  overflow: hidden;
}

.canvas-frame-marks {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 6;
}
.canvas-frame-marks .corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(255,255,255,0.25);
  border-style: solid;
  border-width: 0;
}
.canvas-frame-marks .tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.canvas-frame-marks .tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.canvas-frame-marks .bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.canvas-frame-marks .br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }

.canvas-readout {
  position: absolute;
  left: 16px; bottom: 14px;
  display: flex; gap: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 6;
  pointer-events: none;
}
.canvas-readout .seed { color: rgba(255,255,255,0.4); }
.canvas-readout em {
  font-style: normal;
  color: rgba(255,255,255,0.85);
}

.canvas-readout-r {
  position: absolute;
  right: 16px; bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 6;
  pointer-events: none;
}

/* Progress bar (under canvas head) */
.progress-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 10px var(--accent-glow);
  border-radius: 2px;
  transition: width 0.18s linear;
}
.progress-fill.is-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--t-1);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.progress-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-3);
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-status .arrow { color: var(--accent-2); }

/* Action row */
.action-row {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--t-1);
  transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:hover { background: var(--bg-3); border-color: rgba(255,255,255,0.18); }
.btn:active { transform: translateY(1px); }
.btn.is-danger { color: #fca5a5; border-color: rgba(252,165,165,0.18); }
.btn.is-danger:hover { background: rgba(252,165,165,0.06); border-color: rgba(252,165,165,0.3); }
.btn.is-ghost { background: transparent; border-color: transparent; color: var(--t-3); }
.btn.is-ghost:hover { background: var(--bg-2); color: var(--t-1); }
.btn.is-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: transparent;
  color: #0a0a0c;
  font-weight: 600;
  box-shadow: 0 0 24px -4px var(--accent-glow);
}
.btn.is-primary:hover {
  filter: brightness(1.08);
}
.btn .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--t-3);
  margin-left: 4px;
}

.action-spacer { flex: 1; }

/* ====================== INPUT BAR ====================== */

.input-dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 32px 26px 32px;
  background: linear-gradient(180deg, transparent, rgba(7, 8, 11, 0.85) 30%, var(--bg-0) 80%);
  pointer-events: none;
  z-index: 4;
}
.input-shell {
  pointer-events: auto;
  max-width: 920px;
  margin: 0 auto;
}

.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 18px 60px -20px rgba(0,0,0,0.6),
    0 0 0 1px transparent;
  transition: border-color .2s, box-shadow .2s;
}
.input-bar:focus-within {
  /* focus glow removed */
}
.input-field:focus,
.input-field:focus-visible {
  outline: 0;
  box-shadow: none;
}

.input-attach {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--t-3);
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.input-attach:hover { background: var(--bg-3); color: var(--t-1); }

.input-field {
  flex: 1;
  min-height: 36px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.45;
  color: var(--t-1);
  letter-spacing: -0.01em;
  padding: 6px 4px;
  resize: none;
  word-wrap: break-word;
}
.input-field::placeholder { color: var(--t-4); }
.input-field:empty::before {
  content: attr(data-placeholder);
  color: var(--t-4);
  pointer-events: none;
}
.input-field::-webkit-scrollbar { width: 4px; }
.input-field::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

.input-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.input-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #0a0a0c;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  flex-shrink: 0;
  box-shadow: 0 4px 18px -4px var(--accent-glow);
  transition: filter .15s, transform .08s;
}
.input-send:hover { filter: brightness(1.08); }
.input-send:active { transform: translateY(1px); }
.input-send.is-disabled {
  background: var(--bg-3);
  color: var(--t-4);
  box-shadow: none;
  cursor: not-allowed;
}

.input-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-4);
}
.input-meta-l { display: flex; align-items: center; gap: 16px; }
.input-meta-l span { display: flex; align-items: center; gap: 6px; }
.input-meta-l span svg { color: var(--t-4); }
.input-meta-r { display: flex; align-items: center; gap: 6px; }
.input-meta-r .kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--t-3);
}

/* ====================== EMPTY STATE ====================== */

.empty-state {
  text-align: center;
  padding: 80px 20px 40px 20px;
  color: var(--t-3);
}
.empty-state h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--t-1);
  margin: 18px 0 10px 0;
  line-height: 1.05;
}
.empty-state p {
  font-size: 14px;
  color: var(--t-3);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}
.empty-mark {
  display: inline-flex;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: #0a0001;
  align-items: center; justify-content: center;
  box-shadow:
    0 0 0 1px rgba(122, 13, 18, 0.4),
    0 0 40px -6px rgba(163, 22, 33, 0.55),
    inset 0 1px 0 rgba(163, 22, 33, 0.3);
  overflow: hidden;
}

/* ====================== RESPONSIVE ====================== */

@media (max-width: 640px) {
  .chat-inner { padding: 24px 18px 200px 18px; }
  .user-prompt { font-size: 18px; padding: 18px 20px; max-width: 92%; }
  .input-dock { padding: 18px; }
  .input-field { font-size: 16px; }
}


/* ===== Light palette overrides ===== */
.is-light body,
html.is-light body {
  background: var(--bg-0);
  color: var(--t-1);
}
html.is-light .empty-state h1 { color: var(--t-1); }
html.is-light .empty-state p { color: var(--t-3); }

html.is-light .user-prompt {
  background: linear-gradient(180deg, #ffffff, var(--bg-1));
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}

html.is-light .ai-card {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-1) 100%);
}

html.is-light .input-shell,
html.is-light .input-bar {
  background: #ffffff;
  border-color: var(--line-strong);
}
html.is-light .input-field { color: var(--t-1); }

/* Send button stays dark on the accent — invert on dark accents */
html.is-light .input-send { color: #fafafa; }
html.is-light .input-send.is-disabled { color: var(--t-4); background: var(--bg-3); }

html.is-light .btn,
html.is-light .tb-pill,
html.is-light .tb-icon-btn,
html.is-light .tb-model {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--t-1);
}

html.is-light .sidebar { background: var(--bg-1); }
html.is-light .sb-item { color: var(--t-2); }
html.is-light .sb-item.is-active { background: var(--bg-3); color: var(--t-1); }
html.is-light .sb-foot { background: var(--bg-2); }
html.is-light .sb-new {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--t-1);
}

html.is-light .canvas-readout,
html.is-light .canvas-readout-r {
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}


/* ====================== EDITABLE INLINE TEXT ====================== */
.editable {
  cursor: text;
  border-radius: 4px;
  outline: none;
  transition: background-color 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.editable:hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.editable:focus {
  background: color-mix(in oklab, var(--accent-2) 14%, transparent);
  box-shadow: inset 0 0 0 1px var(--accent-2);
}
.editable:empty::before {
  content: "…";
  color: var(--t-4);
}
