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

:root {
  color-scheme: light;
  
  /* Palette: Slate / Zinc inspired (Clean, Corporate, Neutral) */
  --bg: #fdfdfd;
  --bg-subtle: #f8fafc;
  
  --ink: #0f172a;       /* Slate 900 */
  --ink-secondary: #334155; /* Slate 700 */
  --muted: #64748b;     /* Slate 500 */
  --border-light: #e2e8f0; /* Slate 200 */
  --border-hover: #cbd5e1; /* Slate 300 */
  
  /* Accent: Restrained, sophisticated slate-blue/grey */
  --accent: #0f172a;    /* Using dark slate/almost black for primary actions */
  --accent-hover: #334155;
  --accent-soft: #f1f5f9; /* Slate 100 */
  --accent-fg: #ffffff;

  --panel: #ffffff;
  --panel-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.05), 0 2px 8px -2px rgba(0, 0, 0, 0.02);
  
  /* Semantic Colors */
  --success: #15803d;     /* Green 700 - darker, more professional */
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  
  --warning: #b45309;     /* Amber 700 */
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --error: #b91c1c;       /* Red 700 */
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  
  --focus-ring: 0 0 0 2px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  overflow: auto;
}

/* Sidebar Navigation */
.sidebar {
  width: 72px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 24px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.sidebar__header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__logo {
  width: 40px;
  height: 40px;
  background: var(--accent-fg);
  color: var(--ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0 12px;
}

.sidebar__tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar__tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.sidebar__tab--active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent-fg);
}

.sidebar__icon {
  width: 24px;
  height: 24px;
}

.sidebar__label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Subtle Backdrop */
.backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: -2;
}

/* App Layout */
.app-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: auto;
}

/* Warehouse Analyzer Header */
.warehouse-analyzer {
  background: var(--panel);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.analyzer__content {
  flex: 1;
}

.analyzer__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.analyzer__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.analyzer__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.analyzer-panel {
  padding: 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  flex: 1;
}

.analyzer-panel .vision-uploader {
  margin: 0;
  background: #fff;
}

/* Main Content Split Layout */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 550px 1fr;
  gap: 0;
  overflow: auto;
}

.right-panel {
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--bg-subtle);
}

/* Chat Panel (Left) */
.chat-panel {
  background: var(--panel);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-content {
  display: none;
}

.tab-content.is-active {
  display: flex !important;
}

.chat-panel__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.chat-panel__header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
}

.chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card:hover {
  border-color: var(--ink-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project-card--new {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--muted);
}

.project-card--new:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.project-card__icon {
  width: 32px;
  height: 32px;
}

.project-card__thumbnail {
  width: 100%;
  height: 100px;
  background: var(--bg-subtle);
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.project-card__info h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.project-card__date {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* Settings */
.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

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

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

.settings-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.settings-row input[type="number"],
.settings-row select {
  width: auto;
  min-width: 120px;
}

/* Layout Panel (Right) */
.layout-panel {
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.layout-panel__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layout-panel__header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
}

.layout-panel__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.layout-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.summary-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.summary-card__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

/* Forms & Inputs - Clean, crisp lines */
select,
input[type="number"],
input[type="text"],
textarea {
  appearance: none;
  background-color: #fff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  width: 100%;
  height: 200px;
  resize: none;
}

input[type="file"] {
  font-size: 12px;
  color: var(--ink-secondary);
}

select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink-secondary);
  box-shadow: var(--focus-ring);
}

.tuning-textarea {
  min-height: 160px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: var(--bg-subtle);
}

input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-hover);
  border-radius: 3px;
  background: #fff;
  position: relative;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Buttons - Solid, minimal */
.button {
  background: var(--ink);
  color: var(--accent-fg);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.button:hover:not(:disabled) {
  background: var(--ink-secondary);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button--ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.button--ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
  color: var(--ink);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Panel Body & Structure */
.panel__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel__footer {
  padding: 0 24px 24px;
}

.panel--input .panel__header,
.panel--input .panel__footer,
.panel--input #status,
.panel--input .generator,
.panel--input #inputJson {
  display: none;
}

.panel--input .panel__body {
  align-items: center;
  padding-top: 32px;
}

/* Generator & Controls */
.generator {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 20px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.generator__row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.generator label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.generator__note {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.generator__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

/* Status & Indicators */
.status {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  border-radius: 4px;
  padding: 10px 14px;
  border-left: 3px solid var(--muted);
}

.status--success {
  background: var(--success-bg);
  border-left-color: var(--success);
  color: #14532d;
}

.status--error {
  background: var(--error-bg);
  border-left-color: var(--error);
  color: #7f1d1d;
}

.status--warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
  color: #78350f;
}

.status--loading {
  background: var(--bg-subtle);
  border-left-color: var(--ink-secondary);
  color: var(--ink);
}

.status--small {
  font-size: 12px;
  padding: 8px 12px;
}

.floorplan-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floorplan-details__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.floorplan-details__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floorplan-details__list li {
  margin: 4px 0;
  line-height: 1.35;
}

.floorplan-details__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.floorplan-details__zoom {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.floorplan-details__zoom canvas {
  width: 120px;
  height: 120px;
  display: block;
}

.floorplan-details__prompt {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.floorplan-details__select {
  min-width: 160px;
}

/* Floorplan upload */
.vision-uploader {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 20px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vision-uploader__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vision-uploader__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.vision-uploader__preview {
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: #fff;
  padding: 6px;
}

.vision-uploader__stage {
  position: relative;
  width: 100%;
}

#floorplanCanvas {
  width: 100%;
  height: 800px;
  display: block;
  cursor: default;
  touch-action: none;
}

#floorplanCanvas.is-panning {
  cursor: grabbing;
}

#floorplanOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

.floorplan-prompt {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  max-width: min(420px, 90%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.floorplan-prompt.is-visible {
  display: flex;
}

.floorplan-prompt__title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.floorplan-prompt__text {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.floorplan-prompt__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.floorplan-prompt__options button {
  background: #fff;
  color: #0f172a;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.floorplan-prompt__options button:hover {
  background: #e2e8f0;
}

.floorplan-prompt__counter {
  font-size: 12px;
  opacity: 0.7;
}

/* Hidden config elements */
.hidden-config {
  display: none;
}

/* LLM / Agents Area */
.llm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.llm__modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.llm__modes [aria-pressed="true"] {
  background: var(--ink-secondary);
  border-color: var(--ink-secondary);
  color: #fff;
}

.viewer {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px;
  position: relative;
  flex-shrink: 0;
}

/* Canvas needs to overlay grid nicely */
#layoutCanvas {
  width: 100%;
  height: 800px;
  display: block;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
  background: #fdfdfd;
}

#layoutCanvas.is-draggable {
  cursor: grab;
}

#layoutCanvas.is-dragging {
  cursor: grabbing;
}

.placement-prompt {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(320px, 90%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.placement-prompt.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.placement-prompt__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.placement-prompt__text {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 10px;
}

.placement-prompt__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.placement-prompt__item {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

.placement-prompt__actions {
  display: flex;
  justify-content: flex-end;
}

.placement-editor {
  position: absolute;
  right: 24px;
  top: 24px;
  width: min(340px, 92%);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.14);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.placement-editor.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.placement-editor__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.placement-editor__text {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 12px;
}

.placement-editor__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.placement-editor__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--muted);
}

.placement-editor__item {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
}

.placement-editor__item--selected {
  border-color: var(--ink-secondary);
  color: var(--ink);
  background: rgba(15, 23, 42, 0.08);
}

/* Metrics - Clean Cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  display: none;
}

.metrics__block {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  border: 1px solid var(--border-light);
}

.metrics__block h3 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.metrics__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-subtle);
  margin-bottom: 8px;
}

.metrics__row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.metrics__row span {
  font-size: 13px;
  color: var(--muted);
}

.metrics__row strong {
  color: var(--ink);
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px; /* Tighter gap */
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.tab.active {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: var(--border-light);
  font-weight: 600;
}

/* LLM Chat bubbles - clean */
.llm__agent,
.llm__chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.llm[data-mode="agent"] .llm__chat {
  display: none;
}

.llm[data-mode="chat"] .llm__agent {
  display: none;
}

.llm__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.llm__suggestion {
  border: 1px solid var(--border-light);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
  color: var(--ink-secondary);
  transition: all 0.15s ease;
}

.llm__suggestion:hover {
  border-color: var(--ink-secondary);
  color: var(--ink);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.llm__chat-log {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px;
  background: var(--bg-subtle);
  flex: 0 0 auto;
  height: 677px;
  max-height: 677px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.llm__bubble {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
}

.llm__bubble h1,
.llm__bubble h2,
.llm__bubble h3,
.llm__bubble h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.llm__bubble p {
  margin: 0 0 8px;
}

.llm__bubble p:last-child {
  margin-bottom: 0;
}

.llm__bubble ul,
.llm__bubble ol {
  margin: 0 0 8px 18px;
  padding: 0;
}

.llm__bubble li {
  margin-bottom: 4px;
}

.llm__bubble code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 4px;
  border-radius: 4px;
}

.llm__bubble pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow-x: auto;
}

.llm__bubble pre code {
  border: none;
  background: transparent;
  padding: 0;
}

.llm__bubble--user {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid var(--border-light);
}

.llm__bubble--assistant {
  align-self: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border-light);
}

.llm__bubble--system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
  border: none;
}

.llm__chat-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.llm__input {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  resize: vertical;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.llm__input:focus {
  outline: none;
  border-color: var(--ink-secondary);
  box-shadow: var(--focus-ring);
}

.llm__progress {
  margin-top: 12px;
  border-radius: 6px;
  border: 1px dashed var(--border-light);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-subtle);
  display: none;
}

.llm__progress.is-visible {
  display: block;
}

.llm__todo {
  margin-top: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  display: none;
}

.llm__todo.is-visible {
  display: block;
}

.llm__todo-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

.llm__todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.llm__todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.llm__todo-item.is-done {
  color: var(--muted);
  text-decoration: line-through;
}

.llm__todo-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--border-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0; /* Hide check text */
}

.llm__todo-item.is-done .llm__todo-check {
  border-color: var(--success);
  background: var(--success);
}

/* Animations - Subtle */
@keyframes status-ellipsis {
  to { width: 1.1em; }
}

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .chat-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  
  .sidebar {
    width: 100%;
    flex-direction: row;
    padding: 8px 16px;
    height: auto;
  }
  
  .sidebar__header {
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0;
    padding-right: 16px;
  }
  
  .sidebar__nav {
    flex-direction: row;
    padding: 0;
  }
  
  body {
    flex-direction: column;
  }
}

/* Utility Helpers */
.hidden { display: none !important; }
