/* Shared palette: each surface follows the selected appearance. */
:root {
  --canvas: #f6f7fa;
  --white: #fff;
  --surface-soft: #f1f4f9;
  --surface-accent: #edf2fc;
  --ink: #243044;
  --muted: #5e6c82;
  --line: #dfe5ee;
  --blue: #2a4088;
  --action: #2a4088;
  --on-action: #fff;
  --sky-top: #e8cfae;
  --sky-bottom: #fae9cf;
  --sand-far: #d7b18a;
  --sand-middle: #c8976b;
  --sand-near: #b88054;
  --rock-light: #aa795b;
  --rock-dark: #72513e;
  color-scheme: light;
}
:root[data-theme=beige] {
  --canvas: #f4eddf;
  --white: #fffbf3;
  --surface-soft: #f1e8d9;
  --surface-accent: #ebe0cd;
  --ink: #3e362d;
  --muted: #736250;
  --line: #ded1bc;
  --blue: #71522e;
  --action: #71522e;
  --sky-top: #dfb78e;
  --sky-bottom: #f4d9ac;
  --sand-far: #cda077;
  --sand-middle: #b9865e;
  --sand-near: #9f6c4a;
}
:root[data-theme=navy] {
  --canvas: #0e192d;
  --white: #17263f;
  --surface-soft: #1e314e;
  --surface-accent: #263c60;
  --ink: #edf2fc;
  --muted: #b6c4db;
  --line: #354966;
  --blue: #b4c9ff;
  --action: #aac2ff;
  --on-action: #10203b;
  --shadow: 0 5px 20px #060d1c30;
  --sky-top: #182b4b;
  --sky-bottom: #836773;
  --sand-far: #6a6075;
  --sand-middle: #615365;
  --sand-near: #473c50;
  --rock-light: #776576;
  --rock-dark: #352e45;
  color-scheme: dark;
}
body { background: var(--canvas); color: var(--ink); }
.topbar, case-overview, chat-panel, case-list, .composer-area, .case-row,
.filters button[aria-pressed=true], dialog, .skip {
  background: var(--white);
}
.secondary, .demo-tag, .profile, .count, .chat-icon,
.search-field, .filters, .attachment,
.camera-button {
  background: var(--surface-soft); color: var(--blue); border-color: var(--line);
}
.icon-button:hover, .chat-context, .message-bubble { background: var(--surface-soft); }
.overview-scroll .proposal, .message-bubble.decision-bubble, .case-row.active {
  background: var(--surface-accent); border-color: var(--line);
}
.primary, .send-button, .message.user .message-bubble {
  background: var(--action); color: var(--on-action); border-color: var(--action);
}
.proposal h4 { color: var(--ink) !important; }
.proposal > p { color: var(--muted) !important; }
.proposal small, .chat-context, .composer, .message-meta span, .list-footer,
.overview-scroll section > p, .overview-scroll li, .proposal small, .approval strong,
.message-bubble, .message-meta strong, .composer textarea, .search-field input,
.case-row > strong { color: var(--ink); }
.eyebrow, .case-label, .section-number, .approval small, .approval-icon,
.panel-heading h2 svg, .icon-button, .small-label, .chat-context, .private-hint,
.conversation-start, .message-meta, .message-meta span, .demo-response, .typing,
.attach-button, .character-count, .composer-note, .attachment-note, .attachment button,
.viewer-header,
.filters button, .case-row-meta, .case-arrow, .list-footer, .empty-state,
.workspace-footer, .model-loading { color: var(--muted); }
.composer textarea::placeholder, .search-field input::placeholder { color: var(--muted); opacity: 1; }
.conversation-start span { background: var(--line); }
.composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--surface-accent); }
.scenery-control input { accent-color: var(--action); }
:root[data-theme=navy] .amber { color: #ffe0a0; background: #493a24; }
:root[data-theme=navy] .blue { color: #c0d5ff; background: #293e63; }
:root[data-theme=navy] .green { color: #b0e8ce; background: #21483d; }
/* Keep the supplied grey logo legible without recoloring its artwork. */
:root[data-theme=navy] .brand img { background: #fff; border-radius: 7px; padding: 5px; }
.appearance-controls {
  border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 16px; min-width: 0;
}
.theme-control, .scenery-control {
  display: inline-flex; align-items: center; gap: 7px; font-size: var(--type-detail); font-weight: var(--weight-semibold); color: var(--ink); cursor: pointer;
}
.theme-control select {
  min-width: 122px; max-width: 100%; padding: 8px 26px 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-soft); color: var(--ink);
}
select:focus-visible { outline: 3px solid #7496ed; outline-offset: 3px; }
.scenery-control input { width: 16px; height: 16px; margin: 0; }
yoda-viewer { background: var(--white); border-color: var(--line); }
.landscape { background: var(--surface-soft); }
@media(max-width:1100px) {
  .topbar { height: auto; min-height: 86px; padding-block: 14px; gap: 16px; flex-wrap: wrap; }
  .topbar-right { flex-wrap: wrap; gap: 12px; }
}
@media(max-width:720px) {
  .topbar { padding: 12px 17px; gap: 12px; }
  .topbar-right { width: 100%; }
  .appearance-controls { flex: 1; }
  .demo-tag { display: none; }
  .theme-control select { min-width: 115px; }
}
