:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --sidebar: #182129;
  --sidebar-2: #222d36;
  --ink: #18212b;
  --muted: #657280;
  --muted-2: #8a96a3;
  --line: #d9e1e8;
  --line-strong: #b8c4cf;
  --accent: #2878d8;
  --accent-soft: #e9f2ff;
  --green: #16805a;
  --green-soft: #e7f6ef;
  --amber: #9f6a05;
  --amber-soft: #fff4d8;
  --danger: #be3b2f;
  --danger-soft: #fdeceb;
  --shadow-sm: 0 1px 2px rgb(24 33 43 / 6%);
  --shadow: 0 14px 34px rgb(25 33 43 / 9%);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-width: clamp(220px, 15vw, 256px);
  --inspector-width: clamp(320px, 28vw, 520px);
  --memory-list-width: 300px;
  --view-padding: clamp(16px, 1.6vw, 24px);
}

* {
  box-sizing: border-box;
}

/* Refined scrollbars — unobtrusive, appear on the scroll surfaces only */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  background-color: var(--line-strong);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-2);
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

html {
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 36px;
  border: 1px solid #111923;
  border-radius: var(--radius);
  background: #111923;
  color: #fff;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 650;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
  white-space: nowrap;
}

button:hover {
  box-shadow: 0 1px 2px rgb(24 33 43 / 10%);
}

button.secondary,
button.icon {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

button.danger-button {
  color: var(--danger);
}

button.secondary:hover,
button.icon:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

button.secondary.interview-fresh {
  background: var(--green-soft);
  border-color: #bfe3d3;
  color: var(--green);
}

button.secondary.interview-fresh:hover {
  background: #dcf2e7;
  border-color: var(--green);
}

button.secondary.interview-stale {
  background: var(--danger-soft);
  border-color: #f0cbc7;
  color: var(--danger);
}

button.secondary.interview-stale:hover {
  background: #fbdfdc;
  border-color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

button[data-busy="true"] {
  cursor: wait;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(40 120 216 / 14%);
}

input {
  min-height: 38px;
  padding: 0 11px;
}

select {
  min-height: 38px;
  padding: 0 34px 0 11px;
}

textarea {
  min-height: 420px;
  resize: none;
  padding: 14px;
  line-height: 1.45;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
}

.shell.inspector-closed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 0;
}

.sidebar {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 22px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #f7fbff;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

.inspector {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  border-left: 1px solid var(--line);
  background: #f9fbfd;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.inspector.inspector-closed {
  border-left: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.inspector-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -20px -20px 0;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgb(249 251 253 / 94%);
  backdrop-filter: blur(10px);
}

.inspector-close {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgb(0 0 0 / 24%);
}

.brand h1 {
  max-width: 180px;
  font-size: 22px;
  line-height: 1.05;
  color: #fff;
}

.view-heading h2 {
  font-size: 28px;
  line-height: 1.05;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #9fb4c5;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.health-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-top: 5px;
  background: #70808e;
  box-shadow: 0 0 0 4px rgb(255 255 255 / 9%);
}

.health-dot.ok {
  background: #35d08b;
}

.health-dot.bad {
  background: #f05246;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  text-align: left;
  background: transparent;
  color: #d6e0e8;
  border-color: transparent;
  font-weight: 700;
}

.nav-item:hover {
  background: rgb(255 255 255 / 8%);
  transform: none;
}

.nav-item.active {
  background: #fff;
  color: #121a22;
  border-color: #fff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 18%);
}

.nav-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: #ff6b6b;
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: #e53e3e;
}

.nav-badge:empty,
.nav-badge.is-empty {
  display: none;
}

.mobile-mode-bar,
.mobile-dashboard-nav,
.mobile-more-head,
.mobile-more-links {
  display: none;
}

.mobile-more-sheet {
  --mobile-more-bottom: calc(76px + env(safe-area-inset-bottom));
}

.mobile-health-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #70808e;
}

.mobile-health-dot.ok {
  background: #2aa876;
}

.mobile-health-dot.bad {
  background: var(--danger);
}

.voice-box {
  display: grid;
  gap: 10px;
}

.voice-button {
  border-color: #e8f2fa;
  background: #e8f2fa;
  color: #121a22;
}

/* Sits directly above Talk in the sidebar; quiet twin of .voice-button. */
.chat-button {
  border-color: rgb(255 255 255 / 26%);
  background: transparent;
  color: #e8f2fa;
}

.chat-button:hover {
  border-color: rgb(255 255 255 / 45%);
}

.chat-button.active {
  border-color: #e8f2fa;
  background: #e8f2fa;
  color: #121a22;
}

.voice-box {
  align-self: end;
  border-top: 1px solid rgb(255 255 255 / 12%);
  padding-top: 16px;
}

.last-updated {
  min-height: 14px;
  margin-bottom: 2px;
  color: #7f909e;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.status-text {
  min-height: 38px;
  color: #b6c5d1;
  font-size: 13px;
  line-height: 1.35;
}

.voice-button.connected {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  container-type: inline-size;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 86%);
  backdrop-filter: blur(10px);
}

.command-wrap {
  position: relative;
  min-width: 0;
}

.command-input {
  min-height: 42px;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgb(24 33 43 / 4%);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(460px, calc(100vh - 130px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 6px;
}

.search-result {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}

.search-result:hover,
.search-result.highlighted {
  border-color: var(--line);
  background: var(--surface-subtle);
  box-shadow: none;
}

.search-result-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-kind {
  min-width: 88px;
  color: #4f5e6d;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.search-empty {
  padding: 12px;
}

.top-actions {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.top-actions button {
  min-width: 0;
}

.view {
  display: none;
  min-height: 0;
  height: 100%;
  padding: var(--view-padding);
  overflow: auto;
  overscroll-behavior: contain;
}

.view-checklists {
  overflow: auto;
}

.view-chat {
  overflow: hidden;
}

.view-chat.active-view {
  display: flex;
  flex-direction: column;
}

.view-chat .view-heading {
  flex: none;
  width: 100%;
  max-width: 880px;
  margin: 0 auto 14px;
}

#chatPanelRoot {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-panel-toolbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(42px, auto);
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0 2px 12px;
}

.chat-panel-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.chat-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 42px;
}

.chat-history-toggle,
.chat-exit,
.chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.chat-history-toggle {
  justify-self: start;
}

.chat-new {
  display: none;
  min-height: 38px;
  padding: 0 14px;
}

.chat-panel.history-open .chat-new {
  display: inline-flex;
  align-items: center;
}

.chat-panel.history-open .chat-exit {
  display: none;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}

.chat-bubble {
  max-width: 78%;
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.chat-bubble.chat-user {
  align-self: flex-end;
  background: var(--sidebar);
  color: #fff;
  white-space: pre-wrap;
}

.chat-bubble.chat-assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.chat-bubble.chat-assistant > :first-child {
  margin-top: 0;
}

.chat-bubble.chat-assistant > :last-child {
  margin-bottom: 0;
}

.chat-bubble.chat-assistant pre {
  overflow-x: auto;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.chat-bubble.chat-error {
  align-self: flex-start;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.chat-tool-chip {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 10px;
}

.chat-tool-chip.failed {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.chat-activity {
  align-self: flex-start;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 4px;
  animation: chat-activity-pulse 1.6s ease-in-out infinite;
}

@keyframes chat-activity-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.chat-placeholder {
  margin: auto;
  max-width: 320px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chat-panel.history-open .chat-messages {
  display: none;
}

.chat-panel.history-open .chat-input-row {
  display: none;
}

.chat-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 12px;
}

.chat-history.hidden {
  display: none;
}

.chat-history-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

.chat-history-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.chat-history-item.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chat-history-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.chat-history-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.chat-input {
  min-height: 42px;
  max-height: 160px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
}

.chat-send {
  min-height: 42px;
  width: 42px;
  min-width: 42px;
  font-size: 20px;
}

.chat-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.active-view {
  display: block;
  animation: view-in 200ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.view-heading.compact {
  align-items: flex-start;
}

.board {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  container-type: inline-size;
}

.column {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.column-title {
  position: sticky;
  top: 72px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: #46515d;
  padding: 7px 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.column-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column.is-drop-target {
  border-radius: var(--radius);
  background: rgb(40 120 216 / 7%);
  outline: 2px dashed rgb(40 120 216 / 45%);
  outline-offset: 4px;
}

/* Count badge on section headers */
.column-title .chip {
  flex-shrink: 0;
  min-width: 22px;
  min-height: 20px;
  justify-content: center;
  border-color: var(--line-strong);
  background: var(--surface);
  color: #46515d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
}

.item-list,
.column-list,
.file-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.commitment-card,
.review-card,
.goal-card,
.activity-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(24 33 43 / 5%);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.empty-card {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  padding: 10px 12px;
}

.commitment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.commitment-card.is-dragging,
.container-task-row.is-dragging {
  opacity: 0.72;
  touch-action: none;
  box-shadow: var(--shadow);
  transform: scale(0.99);
}

/* A commitment-bearing tile/row being dragged onto another to merge them. */
.commitment-card.is-merge-target,
.container-task-row.is-merge-target {
  border-color: var(--accent);
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  background: #f3f7ff;
}

.container-task-row.is-merge-target {
  border-radius: calc(var(--radius) - 2px);
}

.commitment-card:hover,
.review-card:hover,
.goal-card:hover,
.activity-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.commitment-card.selected,
.review-card.selected,
.goal-card.selected,
.file-button.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 0 3px rgb(40 120 216 / 10%), var(--shadow);
}

.card-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.commitment-title {
  min-width: 0;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 730;
  line-height: 1.25;
}

.commitment-title:focus {
  box-shadow: none;
}

.container-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.container-title {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.container-status {
  min-width: 0;
  margin: 0;
  color: #46515d;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.container-next {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 690;
  overflow-wrap: anywhere;
}

.container-next span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.container-task-list {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.container-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.container-task-title {
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.container-task-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-action {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.container-task-inspector-list {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.container-task-inspector {
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.title-area {
  display: block;
  min-height: 20px;
  resize: none;
  overflow: hidden;
  background: transparent;
}

.card-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.primary-actions {
  justify-content: flex-end;
}

.primary-actions button {
  min-width: 0;
}

/* Quieter card actions: ghost buttons that let the title lead.
   Default to subdued; full contrast on hover/focus or when the card is hovered. */
.commitment-card .primary-actions button,
.container-task-actions button,
.goal-side button {
  min-height: 30px;
  padding: 0 11px;
  border-color: transparent;
  background: var(--surface-subtle);
  color: #46515d;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: none;
}

.commitment-card .primary-actions .check-action,
.container-task-actions .check-action {
  min-width: 34px;
  padding: 0 10px;
  font-size: 15px;
}

.commitment-card:hover .primary-actions button,
.container-task-row:hover .container-task-actions button {
  border-color: var(--line);
}

.commitment-card .primary-actions button:hover,
.container-task-actions button:hover,
.goal-side button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

/* "Done" reads as the affirmative action across cards */
.commitment-card button.affirm:hover,
.container-task-actions button.affirm:hover,
.goal-side button.primary:hover {
  border-color: #abd9c6;
  background: var(--green-soft);
  color: var(--green);
}

.goal-side button.primary {
  background: #eef4ec;
  color: #2c6b4f;
}

.date-control {
  position: relative;
  display: inline-flex;
}

.date-pill {
  min-height: 24px;
  border-color: transparent;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #205f9f;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.date-pill:hover {
  border-color: #b7d5f7;
  background: #ddecff;
  transform: none;
}

.sr-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.attention-chip {
  border-color: #e2bd56;
  background: var(--amber-soft);
  color: var(--amber);
}

.ok-chip {
  border-color: #abd9c6;
  background: var(--green-soft);
  color: var(--green);
}

.due-chip {
  border-color: #b8d1eb;
  background: var(--accent-soft);
  color: #205f9f;
}

.goals-board {
  display: grid;
  gap: 18px;
}

.goals-category {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.goals-list {
  min-width: 0;
  display: grid;
  gap: 10px;
}

/* Completed/abandoned goals: a quiet "Done" group pinned to the bottom. */
.goals-category-done {
  margin-top: 6px;
  opacity: 0.62;
}

.goals-category-done .goal-card {
  background: var(--surface-subtle);
}

/* Strikethrough only for permanently-finished goals; a habit that's just done
   for today stays legible (it returns tomorrow). */
.goals-category-done .goal-terminal .goal-title {
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.goals-category-done .goal-period-done .goal-title::before {
  content: "✓ ";
  color: var(--green);
  font-weight: 800;
}

.goal-card {
  display: grid;
  gap: 10px;
}

/* Compact main row, aligned with the Today commitment cards */
.goal-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.goal-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Caret that folds the detail view open, sitting just left of the title */
.goal-caret {
  flex: none;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: #9aa6b2;
  cursor: pointer;
}

.goal-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}

.goal-caret:hover {
  color: #46515d;
}

.goal-card.expanded .goal-caret::before {
  transform: rotate(90deg);
}

.goal-title {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 730;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Counter and any attention badge, grouped to the right of the title */
.goal-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.goal-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.goal-streak-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.goal-side {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.goal-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.goal-title-block {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.goal-title-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.goal-why {
  max-width: 78ch;
  color: #46515d;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.goal-badges {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 300px;
}

.goal-progress {
  display: grid;
  gap: 5px;
}

.goal-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

.goal-progress-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2878d8, #16805a);
}

.goal-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.goal-subsection {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.goal-subsection h4 {
  margin: 0;
  color: #2d3742;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-milestones {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.goal-milestone {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: #263442;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.goal-milestone input {
  width: 16px;
  min-height: 16px;
  margin: 1px 0 0;
}

.goal-list {
  margin: 0;
  padding-left: 18px;
  color: #46515d;
  font-size: 13px;
  line-height: 1.4;
}

.goal-list li {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.goal-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.goal-log-input {
  min-height: 40px;
  max-height: 120px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.35;
}

/* Compact counter indicator with a leading status dot, not a full-width fill */
.goal-counter {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 10px;
  background: var(--surface-subtle);
  color: #46515d;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.goal-counter::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.goal-counter.met {
  border-color: #abd9c6;
  background-color: var(--green-soft);
  color: var(--green);
}

.goal-counter.over {
  border-color: #e7aaa4;
  background-color: var(--danger-soft);
  color: var(--danger);
}

.goal-counter.under {
  border-color: #e2bd56;
  background-color: var(--amber-soft);
  color: var(--amber);
}

.goal-steps {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  color: #46515d;
  font-size: 13px;
  line-height: 1.4;
}

.goal-steps li {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.goal-steps li.tracked {
  font-weight: 600;
  color: #263442;
}

.goal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-history {
  display: flex;
  gap: 4px;
  align-items: center;
}

.goal-history .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #e7edf2;
  cursor: help;
}

.goal-history .dot.met {
  background-color: #16805a;
}

.goal-history .dot.miss {
  background-color: #c85c5c;
}

.goal-streak-row {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: #46515d;
}

.goal-why-risk {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #fff3cd;
  color: #856404;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* The detail fold is hidden until the caret expands the card */
.goal-plan-body {
  display: none;
  gap: 12px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.goal-card.expanded > .goal-plan-body {
  display: grid;
}

.goal-plan-section {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.goal-plan-section h4 {
  margin: 0;
  color: #2d3742;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-group-title {
  min-height: 24px;
  margin-bottom: 2px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-group-title:first-child {
  margin-top: 0;
}

/* Rival-set header carries a full phenomenon sentence, not a short label —
   let it wrap in sentence case and mark it with an accent rule. */
.review-rival-title {
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  color: var(--text);
  border-left: 2px solid var(--accent, #6b7cff);
  padding-left: 8px;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.review-badge--add {
  background: #c0f0e3;
  color: #165a4d;
}

.review-badge--merge {
  background: #e5cff7;
  color: #6a42a8;
}

.review-badge--done {
  background: #c6ddf4;
  color: #205f9f;
}

.review-badge--conflict {
  background: #ffd88c;
  color: #7a5907;
}

.review-badge--fact {
  background: #e5e7eb;
  color: #4b5563;
}

.review-badge--default {
  background: #e5e7eb;
  color: #4b5563;
}

.review-badge--todo {
  background: #fde2c8;
  color: #8a4b08;
}

.review-badge--dest {
  background: #e3edfd;
  color: #2456a6;
  font-weight: 600;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px;
  letter-spacing: 0.01em;
}

.review-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.review-note-input {
  width: 100%;
  min-height: 30px;
  resize: none;
  border: 1px dashed #c4cad4;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.92em;
  background: #fbfcfe;
}

.review-note-input:focus {
  border-style: solid;
  border-color: var(--accent);
  outline: none;
  background: #fff;
}

.review-note-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
}

.review-card {
  display: grid;
  gap: 12px;
}

/* Manual pair merge: drag one card onto another to combine them. */
.review-card.merge-dragging {
  opacity: 0.72;
  touch-action: none;
  box-shadow: var(--shadow);
  transform: scale(0.99);
}

.review-card.merge-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -1px;
  border-radius: var(--radius);
  background: #f3f7ff;
}

.merge-dialog {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.merge-originals {
  display: grid;
  gap: 6px;
}

.merge-original {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  background: #fafbfd;
}

.merge-original-text {
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

.merge-arrow {
  text-align: center;
  color: #8a93a3;
  line-height: 0.6;
}

.merge-draft-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  font-size: 0.92em;
}

.merge-spinner {
  color: #5f6368;
  font-size: 0.95em;
  padding: 10px 2px;
}

.merge-spinner::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: -1px;
  border: 2px solid #c4cad4;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: merge-spin 0.8s linear infinite;
}

@keyframes merge-spin {
  to { transform: rotate(360deg); }
}

.merge-title-input {
  width: 100%;
  resize: none;
}

.merge-rationale {
  font-size: 0.9em;
}

.review-receipt {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid #a7d7c2;
  border-radius: var(--radius);
  background: var(--green-soft);
  padding: 12px;
}

.review-receipt.bad {
  border-color: #e7aaa4;
  background: #fff1ef;
}

.review-receipt-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.review-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.review-title {
  min-height: 22px;
}

.review-subtitle {
  overflow-wrap: anywhere;
}

.review-meta {
  min-height: 26px;
}

.review-actions {
  justify-content: flex-start;
}

.review-card.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-radius: var(--radius);
}

.insights-list {
  min-width: 0;
}

.insights-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.insights-queue,
.insight-proposal-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(24 33 43 / 5%);
}

.insights-queue {
  position: sticky;
  top: var(--view-padding);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.insights-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 6px;
}

.insights-queue-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insights-queue-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.insight-queue-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-subtle);
  padding: 10px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  white-space: normal;
}

.insight-queue-card:hover,
.insight-queue-card.selected {
  border-color: var(--accent);
  background: #f3f8ff;
}

.insight-queue-title,
.insight-queue-subtitle,
.insight-queue-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.insights-queue-head .chip {
  flex-shrink: 0;
  min-width: 22px;
  min-height: 20px;
  justify-content: center;
  border-color: var(--line-strong);
  background: var(--surface);
  color: #46515d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.insight-queue-title {
  font-size: 13px;
  line-height: 1.25;
}

.insight-queue-subtitle {
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insight-queue-meta {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.insight-proposal-panel {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 2.2vw, 28px);
}

.insight-holistic-summary {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.insight-holistic-summary h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.insight-summary-claim {
  max-width: 860px;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

.insight-summary-why {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.insight-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.insight-metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight-primary-actions {
  justify-content: flex-start;
  gap: 8px;
}

.insight-editor,
.insight-evidence,
.insight-metadata,
.insight-alternatives {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.insight-editor h3,
.insight-evidence h3,
.insight-metadata h3,
.insight-alternatives h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.insight-title-input,
.insight-claim-input,
.insight-why-input {
  width: 100%;
  min-width: 0;
}

.insight-title-input {
  min-height: 44px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.insight-title-input:focus,
.insight-claim-input:focus,
.insight-why-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(40 120 216 / 14%);
}

.insight-section-heading {
  display: grid;
  gap: 2px;
}

.insight-alternative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.insight-alternative {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-subtle);
  padding: 10px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.insight-alternative.selected {
  border-color: var(--accent);
  background: #f3f8ff;
}

.insight-alternative-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.insight-alternative-claim {
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insight-list-block {
  display: grid;
  gap: 6px;
}

.insight-list-block strong {
  font-size: 13px;
}

.insight-metadata .detail-block {
  margin: 0;
}

@media (max-width: 980px) {
  .insights-workspace {
    grid-template-columns: 1fr;
  }

  .insights-queue {
    position: static;
  }

  .insights-queue-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .insight-queue-card {
    flex: 0 0 min(70vw, 320px);
    scroll-snap-align: start;
  }

  .insight-holistic-summary h2 {
    font-size: 30px;
  }

  .insight-summary-claim {
    font-size: 16px;
  }
}

.memory-layout.active-view {
  position: relative;
  display: grid;
  grid-template-columns: var(--memory-list-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.memory-list,
.memory-list .file-list,
.memory-folder {
  min-width: 0;
}

.memory-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.memory-list .file-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.file-button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}

.file-button:hover {
  background: var(--surface-subtle);
  transform: none;
}

.memory-folder {
  display: grid;
  gap: 4px;
}

.memory-folder + .memory-folder {
  margin-top: 8px;
}

.memory-folder-title {
  margin: 0;
  color: #4b5967;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.memory-recent {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.memory-folder-header-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.memory-folder-header-row .memory-folder-header {
  /* Size to content so the Index pill sits right after the name/count
     instead of being pushed to the far edge of the row. */
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
}

.folder-index-button {
  flex-shrink: 0;
  padding: 1px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: #66727f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
}

.folder-index-button:hover {
  background: var(--line);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.folder-index-button.active {
  background: var(--ink);
  color: var(--paper, #fff);
}

.memory-folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: #4b5967;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.memory-folder-header:hover {
  background: var(--surface-subtle);
  transform: none;
  box-shadow: none;
}

.folder-chevron {
  display: inline-block;
  width: 14px;
  font-size: 11px;
  transition: transform 0.12s ease;
}

.folder-chevron.collapsed {
  transform: rotate(-90deg);
}

.folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  flex-shrink: 0;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: #66727f;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.memory-folder-body {
  display: grid;
  gap: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  margin-left: 12px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: stretch;
}

.file-row .file-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-row .file-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .file-title.file-index {
  font-weight: 700;
}

.file-folder {
  flex-shrink: 0;
  color: #8a96a3;
  font-size: 11px;
}

.file-time {
  flex-shrink: 0;
  color: #8a96a3;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.file-menu-button {
  width: 28px;
  min-width: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #8a96a3;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
}

.file-row:hover .file-menu-button,
.file-menu-button:focus-visible {
  opacity: 1;
}

.file-menu-button:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 32, 0.45);
  backdrop-filter: blur(4px);
}

.app-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-dialog-title {
  margin: 0;
  font-size: 16px;
}

.app-dialog-body {
  margin: 0;
  color: var(--muted, var(--ink));
  font-size: 13px;
}

.app-dialog-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 14px;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.memory-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  min-width: 180px;
  max-height: 50vh;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.memory-menu-item {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  border-radius: var(--radius-sm);
}

.memory-menu-item:hover {
  background: var(--surface-subtle);
  transform: none;
  box-shadow: none;
}

.memory-menu-item.danger {
  color: var(--danger);
}

.memory-list-controls {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.memory-list-controls button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 40;
  width: 7px;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}

.col-resizer:hover,
.col-resizer.dragging {
  background: linear-gradient(90deg, transparent 2px, var(--accent) 3px, var(--accent) 4px, transparent 5px);
}

body.col-resizing {
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.shell.inspector-closed > .col-resizer-right {
  display: none;
}

.editor-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 6px 8px 6px 12px;
}

.path-label {
  color: #3c4752;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.memory-rendered {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px 28px;
  color: #18212b;
  font-size: 15px;
  line-height: 1.62;
}

#memoryEditor {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.memory-rendered h1,
.memory-rendered h2,
.memory-rendered h3,
.memory-rendered h4 {
  margin: 24px 0 10px;
  color: #111923;
  line-height: 1.22;
}

.memory-rendered h1:first-child,
.memory-rendered h2:first-child,
.memory-rendered h3:first-child {
  margin-top: 0;
}

.memory-rendered h1 {
  font-size: 27px;
  letter-spacing: 0;
}

.memory-rendered h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  font-size: 20px;
  letter-spacing: 0;
}

.memory-rendered h3,
.memory-rendered h4 {
  font-size: 16px;
}

.memory-rendered p,
.memory-rendered ul,
.memory-rendered ol,
.memory-rendered pre,
.memory-rendered blockquote,
.memory-rendered table {
  margin: 0 0 14px;
}

.memory-rendered p {
  max-width: 78ch;
}

.memory-rendered ul {
  padding-left: 22px;
}

.memory-rendered ol {
  padding-left: 24px;
}

.memory-rendered li {
  max-width: 86ch;
  margin: 0 0 9px;
  padding-left: 2px;
}

.memory-rendered li:last-child {
  margin-bottom: 0;
}

.memory-rendered strong {
  color: #101820;
  font-weight: 780;
}

.memory-rendered em {
  color: #253241;
}

.memory-rendered code {
  border-radius: 4px;
  background: #eef3f7;
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.memory-rendered pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f8fa;
  padding: 12px;
}

.memory-rendered pre code {
  background: transparent;
  padding: 0;
}

.memory-rendered a {
  color: var(--accent);
  font-weight: 650;
  text-decoration-color: rgb(40 120 216 / 35%);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.memory-rendered a:hover {
  text-decoration-color: currentColor;
}

.memory-rendered .wiki-link {
  color: #256f73;
  text-decoration-color: rgb(37 111 115 / 34%);
}

.memory-rendered blockquote {
  border-left: 3px solid var(--line-strong);
  padding-left: 13px;
  color: #46515d;
}

.memory-rendered table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.memory-rendered th,
.memory-rendered td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.memory-rendered th {
  background: var(--surface-subtle);
  color: #2d3742;
  font-weight: 760;
}

.memory-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  margin: 0 6px 1px 0;
  border: 1px solid #c7d1db;
  border-radius: 999px;
  background: #eef3f7;
  padding: 0 7px;
  color: #46515d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: middle;
}

.memory-badge-paper,
.memory-badge-forthcoming,
.memory-badge-proceedings {
  border-color: #b8d1eb;
  background: #eaf4ff;
  color: #205f9f;
}

.memory-badge-software,
.memory-badge-source,
.memory-badge-public-profile {
  border-color: #b9dccf;
  background: #e9f7f1;
  color: #18705a;
}

.memory-badge-status,
.memory-badge-validated,
.memory-badge-planned {
  border-color: #dec66d;
  background: #fff6dc;
  color: #7b5908;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.activity-card {
  position: relative;
  padding-left: 14px;
}

/* Status accent stripe down the left edge, keyed to tone */
.activity-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--line-strong);
}

.activity-card.tone-ok::before {
  background: var(--green);
}

.activity-card.tone-warn::before {
  background: #d9962a;
}

.activity-card.tone-bad::before {
  background: var(--danger);
}

.activity-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.activity-card h3 {
  margin: 0;
  font-size: 14px;
}

.activity-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.activity-card.tone-ok .activity-dot {
  background: var(--green);
}

.activity-card.tone-warn .activity-dot {
  background: #d9962a;
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.activity-card.tone-bad .activity-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.activity-card.tone-bad {
  border-color: #ecc4bf;
}

.activity-card.tone-warn {
  border-color: #e6cf8e;
}

.costs-workspace.active-view {
  display: block;
}

.costs-panel {
  display: grid;
  gap: 14px;
  max-width: 1180px;
}

.costs-heading {
  align-items: end;
}

.cost-range-control {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cost-range-control button {
  min-width: 48px;
}

.cost-range-control button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

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

.cost-metric,
.cost-section {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
}

.cost-metric {
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cost-metric p,
.cost-metric span {
  margin: 0;
  font-size: 12px;
}

.cost-metric strong {
  font-size: 24px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.cost-section {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.cost-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.cost-section-head h3,
.cost-section-head p {
  margin: 0;
}

.cost-provider-grid,
.cost-call-list {
  display: grid;
  gap: 6px;
}

.cost-provider-row,
.cost-call-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.cost-provider-head {
  color: var(--muted);
  font-size: 12px;
  border-top: 0;
  padding-top: 0;
}

.cost-table-wrap {
  overflow-x: auto;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.cost-table th,
.cost-table td {
  text-align: left;
  padding: 9px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.cost-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cost-table td:first-child {
  display: grid;
  gap: 2px;
}

.cost-tool {
  display: block;
  font-size: 12px;
}

.cost-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-call-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cost-call-row {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.cost-call-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inspector-body {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.inspector-body > h2 {
  min-width: 0;
  margin-bottom: 2px;
  font-size: 24px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.detail-block {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.detail-block h3 {
  margin: 0 0 7px;
  color: #2d3742;
  font-size: 13px;
}

.detail-block a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.detail-block p {
  overflow-wrap: anywhere;
}

.semantic-merge-editor {
  display: grid;
  gap: 10px;
}

.semantic-diff {
  display: grid;
  gap: 10px;
}

.semantic-diff details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.semantic-diff summary {
  cursor: pointer;
  padding: 8px 10px;
  color: #2d3742;
  font-size: 13px;
  font-weight: 750;
}

.diff-lines {
  max-height: min(42vh, 420px);
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.diff-line {
  min-width: max-content;
  margin: 0;
  border-left: 3px solid transparent;
  padding: 2px 8px;
  color: #1f2933;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.diff-line.add {
  border-left-color: #2d9b69;
  background: #eaf8f1;
}

.diff-line.remove {
  border-left-color: #d65a4d;
  background: #fff0ee;
}

.proposal-form,
.contradiction-editor {
  display: grid;
  gap: 10px;
}

.proposal-field {
  display: grid;
  gap: 5px;
}

.proposal-label {
  color: #2d3742;
  font-size: 12px;
  font-weight: 760;
}

.proposal-title-input {
  min-height: 70px;
  resize: vertical;
}

.memory-fact-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 10px;
}

.memory-fact-row h4 {
  margin: 0;
  color: #2d3742;
  font-size: 12px;
  font-weight: 760;
}

.proposal-textarea {
  min-height: 260px;
  max-height: min(46vh, 520px);
  overflow: auto;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.proposal-textarea.compact {
  min-height: 100px;
}

.inspector-actions {
  justify-content: flex-start;
}

.inspector-section-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.inspector-section-subtitle {
  margin: 0 0 10px;
  color: #2d3742;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.inspector-section-notice {
  padding: 10px 12px;
  border: 1px solid var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #6b4a03;
  font-size: 13px;
  line-height: 1.45;
}

.inspector-unchanged-count {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.merge-diff-section {
  display: grid;
  gap: 8px;
}

.merge-diff-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.4;
}

.merge-diff-table tr {
  border-bottom: 1px solid var(--line);
}

.merge-diff-table tr:last-child {
  border-bottom: none;
}

.merge-diff-table td {
  padding: 8px 10px;
  vertical-align: top;
  word-break: break-word;
}

.diff-field {
  font-weight: 650;
  color: #2d3742;
  width: 20%;
  min-width: 80px;
}

.diff-before {
  width: 40%;
  color: var(--muted);
  background: #fff0ee;
}

.diff-struck {
  text-decoration: line-through;
}

.diff-after {
  width: 40%;
  color: var(--green);
  background: #e7f6ef;
  font-weight: 600;
}

.proposal-preview-heading {
  margin-top: 2px;
}

.proposal-preview {
  max-height: min(42vh, 460px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.proposal-path-button {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  min-height: 32px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.source-snippet {
  margin: 0;
  border-left: 3px solid var(--line-strong);
  padding: 8px 10px;
  background: var(--surface);
  color: #344150;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.contradiction-option {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 10px;
}

.path-text {
  overflow-wrap: anywhere;
  margin-bottom: 6px;
  font-size: 12px;
}

.note-block {
  display: grid;
  gap: 8px;
}

.note-textarea {
  min-height: 300px;
  max-height: 48vh;
  border-color: var(--line);
  background: #fff;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.note-status-select,
.inspector-select {
  min-height: 32px;
  font-size: 13px;
}

.inspector-control-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.note-status {
  min-height: 18px;
}

.note-add {
  display: grid;
  gap: 8px;
}

.note-add-input {
  min-height: 52px;
  border-color: var(--line);
  background: #fff;
  resize: vertical;
  font-size: 13px;
  line-height: 1.4;
}

.note-add-status {
  min-height: 18px;
}

.panel {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: min(560px, calc(100vw - 36px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.auth-panel label,
.panel h2 {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-row,
.confirmation-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.confirmation {
  background: var(--amber-soft);
  border-color: #e2bd56;
}

.hidden {
  display: none;
}

@media (max-width: 1280px) {
  :root {
    --sidebar-width: clamp(208px, 19vw, 244px);
    --inspector-width: clamp(300px, 28vw, 360px);
    --view-padding: 20px;
  }

  .shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
  }

  .shell.inspector-closed {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 0;
  }

  .view {
    padding: 20px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .column-title {
    position: static;
  }
}

@media (max-width: 1080px) {
  .commitment-card {
    grid-template-columns: 1fr;
  }

  .container-task-row {
    grid-template-columns: 1fr;
  }

  .container-task-actions {
    justify-content: flex-start;
  }

  .primary-actions {
    justify-content: flex-start;
  }
}

@container (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commitment-card,
  .container-task-row {
    grid-template-columns: 1fr;
  }

  .primary-actions,
  .container-task-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .col-resizer {
    display: none;
  }

  .shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .inspector {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: block;
    width: 100%;
    max-height: 82vh;
    max-height: 82dvh;
    height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 44px rgb(24 33 43 / 18%);
    padding: 16px;
    transform: translateY(0);
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .inspector.inspector-closed {
    display: block;
    padding: 16px;
    border-top: 1px solid var(--line);
    opacity: 0;
    pointer-events: none;
    transform: translateY(104%);
  }

  .inspector-header {
    margin: -16px -16px 0;
    padding: 14px 16px 10px;
  }

  .inspector-body {
    max-height: calc(82dvh - 64px);
    overflow: auto;
  }
}

@media (max-width: 760px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .shell.inspector-closed {
    grid-template-columns: 1fr;
  }

  .mobile-mode-bar {
    grid-column: 1;
    grid-row: 1;
    display: block;
    padding: calc(6px + env(safe-area-inset-top)) 12px 8px;
    border-bottom: 1px solid var(--line);
    background: rgb(251 252 253 / 92%);
    backdrop-filter: blur(16px);
    z-index: 35;
  }

  .mobile-mode-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-subtle);
  }

  .mobile-mode-button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 820;
    box-shadow: none;
  }

  .mobile-mode-button.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 3px 12px rgb(24 33 43 / 12%);
  }

  .mobile-health-dot {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(24 33 43 / 5%);
  }

  .mobile-health-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-health-dot.ok {
    color: #2aa876;
  }

  .mobile-health-dot.bad {
    color: var(--danger);
  }

  .mobile-health-dot.unknown {
    color: #70808e;
  }

  .workspace {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .sidebar {
    display: none;
  }

  .mobile-dashboard-nav,
  .inspector,
  .auth-panel,
  .confirmation {
    grid-column: 1;
  }

  .shell.mobile-mode-voice .workspace,
  .shell.mobile-mode-voice .mobile-dashboard-nav {
    display: none;
  }

  .shell.mobile-mode-voice .sidebar {
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
    background: linear-gradient(180deg, #101820, #18232b);
  }

  .shell.mobile-mode-voice .sidebar .brand,
  .shell.mobile-mode-voice .sidebar .nav {
    display: none;
  }

  .shell.mobile-mode-voice .voice-box {
    min-height: 0;
    align-self: stretch;
    display: grid;
    place-content: center;
    gap: 16px;
    border-top: 0;
    padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
    text-align: center;
  }

  .shell.mobile-mode-voice .last-updated {
    display: none;
  }

  .shell.mobile-mode-voice .status-text {
    min-height: 42px;
    color: #9cafb9;
    font-size: 13px;
  }

  /* Chat is a top-bar mode now, so the voice screen no longer needs its own
     chat button. */
  .shell.mobile-mode-voice .chat-button {
    display: none;
  }

  .shell.mobile-mode-voice .voice-button {
    justify-self: center;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    font-size: 22px;
    box-shadow: 0 0 0 26px rgb(237 245 247 / 6%), 0 0 0 58px rgb(237 245 247 / 4%);
  }

  .mobile-more-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: var(--mobile-more-bottom);
    top: auto;
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: min(76vh, 620px);
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px 18px 16px 16px;
    background: rgb(251 252 253 / 96%);
    box-shadow: 0 -18px 44px rgb(24 33 43 / 18%);
    transform: translateY(calc(100% + 120px));
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .shell.mobile-more-open .mobile-more-sheet {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-more-head h2 {
    margin: 0;
    font-size: 16px;
  }

  .mobile-more-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .search-results {
    position: static;
    max-height: 260px;
    margin-top: 8px;
  }

  .search-result {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .search-result-kind {
    min-width: 0;
    text-align: left;
  }

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

  .top-actions button:last-child {
    grid-column: 1 / -1;
  }

  .top-actions button,
  .review-actions button,
  .primary-actions button {
    min-height: 34px;
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
  }

  .view {
    height: 100%;
    overflow: auto;
    padding: 10px 12px calc(92px + env(safe-area-inset-bottom));
  }

  .view-heading {
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
  }

  .view-heading h2 {
    font-size: 24px;
  }

  .insights-workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .insights-queue {
    position: static;
    padding: 8px;
  }

  .insights-queue-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .insight-queue-card {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
  }

  .insight-proposal-panel {
    padding: 14px;
    gap: 14px;
  }

  .insight-holistic-summary h2 {
    font-size: 25px;
  }

  .insight-summary-claim {
    font-size: 16px;
  }

  .insight-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .insight-primary-actions button {
    width: 100%;
  }

  .insight-title-input {
    font-size: 19px;
  }

  .insight-alternative-grid {
    grid-template-columns: 1fr;
  }

  .commitment-card,
  .review-card {
    padding: 10px 12px;
    gap: 8px;
  }

  .goal-card,
  .activity-card {
    padding: 10px 12px;
  }

  .commitment-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .commitment-card .card-main {
    gap: 0;
  }

  .commitment-card .card-main > .card-actions,
  .commitment-card > .primary-actions .move-bucket-action,
  .commitment-card > .primary-actions .note-action,
  .container-task-actions .move-bucket-action,
  .container-task-actions .note-action,
  .review-card .review-badge-row,
  .review-meta {
    display: none;
  }

  /* Overdue/Upcoming cards still surface their due date on the compact card. */
  .commitment-card.has-due .card-main > .card-actions {
    display: flex;
    margin-top: 4px;
  }

  .commitment-card.has-due .card-main > .card-actions .chip {
    display: none;
  }

  .commitment-card > .primary-actions {
    display: flex;
    width: auto;
    gap: 4px;
    justify-content: flex-end;
  }

  .review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .review-main {
    gap: 6px;
  }

  .goal-card-top,
  .goal-card-header,
  .goal-card-grid,
  .goal-log-row {
    grid-template-columns: 1fr;
  }

  .goal-card-top {
    align-items: stretch;
  }

  .goal-side {
    justify-content: flex-start;
  }

  .goal-badges {
    justify-content: flex-start;
    max-width: none;
  }

  .commitment-title {
    font-size: 14px;
    line-height: 1.27;
  }

  .date-pill,
  .chip {
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }

  .container-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .container-card .card-main {
    gap: 7px;
  }

  .container-title {
    max-height: 2.45em;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.22;
  }

  .container-status {
    display: none;
  }

  .container-next {
    display: none;
  }

  .container-task-list {
    gap: 5px;
    padding-top: 0;
  }

  .container-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
  }

  .container-task-title {
    max-height: 2.6em;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.3;
  }

  .container-task-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .container-task-actions .date-control {
    display: none;
  }

  .memory-layout.active-view {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .memory-list,
  .editor-pane {
    overflow: visible;
  }

  .memory-list .file-list {
    overflow: visible;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

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

  .cost-section-head {
    display: grid;
    gap: 4px;
  }

  .cost-provider-row {
    grid-template-columns: minmax(0, 1fr) 84px 84px;
  }

  .cost-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
  }

  .cost-table th,
  .cost-table td {
    padding: 8px 4px;
  }

  .cost-table th:nth-child(1),
  .cost-table td:nth-child(1) {
    width: 32%;
  }

  .cost-table th:nth-child(2),
  .cost-table td:nth-child(2) {
    width: 21%;
  }

  .cost-table th:nth-child(3),
  .cost-table td:nth-child(3),
  .cost-table th:nth-child(5),
  .cost-table td:nth-child(5) {
    width: 18%;
  }

  .cost-table th:nth-child(4),
  .cost-table td:nth-child(4) {
    width: 11%;
  }

  .cost-table .cost-number {
    white-space: normal;
  }

  .cost-call-row {
    grid-template-columns: 1fr;
  }

  .mobile-dashboard-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgb(251 252 253 / 94%);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    padding: 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: none;
    transition: color 120ms ease, background 120ms ease;
  }

  .mobile-nav-item.active {
    background: rgb(40 120 216 / 11%);
    color: var(--accent);
    font-weight: 820;
  }

  .mobile-nav-dot {
    position: absolute;
    top: 7px;
    right: calc(50% - 22px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c84840;
  }
}

@media (max-width: 440px) {
  .mobile-mode-bar {
    padding-inline: 10px;
  }

  .mobile-mode-button {
    font-size: 12px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .view {
    padding-inline: 10px;
  }
}

/* Pomodoro view — minimalist focus column */
.pomodoro-focus {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: clamp(8px, 3vh, 36px) 8px 48px;
}

.pomodoro-ring-wrap {
  position: relative;
  width: 216px;
  height: 216px;
}

.pomodoro-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pomodoro-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 4;
}

.pomodoro-ring-progress {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 900ms linear;
}

.pomodoro-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pomodoro-time {
  font-size: 46px;
  font-weight: 250;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.pomodoro-time.overtime {
  color: var(--danger);
}

.pomodoro-time-hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted-2);
}

.pomodoro-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.pomodoro-pane.hidden {
  display: none;
}

.pomodoro-intent {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 2px;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 140ms ease;
}

.pomodoro-intent:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.pomodoro-intent::placeholder {
  color: var(--muted-2);
}

.pomodoro-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pomodoro-goal {
  position: relative;
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: center;
}

.pomodoro-goal-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 0;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  text-align: center;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.pomodoro-goal-trigger:hover:not(.static),
.pomodoro-goal-trigger.open {
  color: var(--ink);
  background: var(--surface-subtle);
  border-color: var(--line);
  box-shadow: none;
}

.pomodoro-goal-trigger.static {
  cursor: default;
  font-weight: 500;
  color: var(--muted);
}

.pomodoro-goal-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-width: 0;
  max-width: 300px;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.pomodoro-goal-chevron {
  flex: none;
  font-size: 9px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.pomodoro-goal-trigger.open .pomodoro-goal-chevron {
  transform: rotate(180deg);
}

.pomodoro-goal-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 260px;
  width: max-content;
  max-width: min(560px, 90vw);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transform-origin: top center;
  animation: pomodoro-goal-menu-in 130ms ease;
}

@keyframes pomodoro-goal-menu-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.pomodoro-goal-menu.hidden {
  display: none;
}

.pomodoro-goal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.pomodoro-goal-option-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.pomodoro-goal-option-check {
  flex: none;
  width: 14px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
}

.pomodoro-goal-option:hover {
  background: var(--surface-subtle);
  box-shadow: none;
}

.pomodoro-goal-option.selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.pomodoro-goal-option.selected:hover {
  background: var(--accent-soft);
}

button.pomodoro-start {
  border-radius: 999px;
  min-height: 42px;
  padding: 0 34px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.pomodoro-start-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pomodoro-screen-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
  transition: color 140ms ease;
}

.pomodoro-screen-toggle:hover {
  color: var(--ink);
}

.pomodoro-screen-check {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  flex: none;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  min-height: 0;
  display: inline-grid;
  place-content: center;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.pomodoro-screen-check::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -1px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 130ms ease;
}

.pomodoro-screen-check:hover {
  border-color: var(--muted);
}

.pomodoro-screen-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.pomodoro-screen-check:checked:hover {
  border-color: var(--accent);
}

.pomodoro-screen-check:checked::after {
  transform: rotate(45deg) scale(1);
}

.pomodoro-screen-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pomodoro-focus .ghost-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 550;
  min-height: 32px;
  padding: 0 10px;
}

.pomodoro-focus .ghost-button:hover {
  color: var(--danger);
  box-shadow: none;
  background: transparent;
}

.pomodoro-statement {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
  text-align: center;
  color: var(--ink);
}

.pomodoro-statement.muted {
  color: var(--muted);
  font-weight: 450;
}

.pomodoro-assess {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 12px 14px;
  min-height: 60px;
  resize: none;
  color: var(--ink);
  transition: border-color 140ms ease;
}

.pomodoro-assess:focus {
  outline: none;
  border-color: var(--line-strong);
}

.pomodoro-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.pomodoro-segments button.segment {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  text-transform: capitalize;
  min-height: 38px;
}

.pomodoro-segments button.segment + button.segment {
  border-left: 1px solid var(--line);
}

.pomodoro-segments button.segment-deep:hover {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}

.pomodoro-segments button.segment-shallow:hover {
  background: var(--amber-soft);
  color: var(--amber);
  box-shadow: none;
}

.pomodoro-segments button.segment-derailed:hover {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}

.pomodoro-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.pomodoro-dots {
  display: flex;
  gap: 8px;
}

.pomodoro-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  transition: background 200ms ease, border-color 200ms ease;
}

.pomodoro-dot.filled {
  background: var(--ink);
  border-color: var(--ink);
}

.pomodoro-dots-label {
  margin: 0;
  font-size: 12px;
}

.pomodoro-section {
  width: 100%;
  max-width: 480px;
}

.pomodoro-section.hidden {
  display: none;
}

.pomodoro-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted-2);
}

.pomodoro-list {
  display: flex;
  flex-direction: column;
}

.pomodoro-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.pomodoro-list .pomodoro-row:last-child {
  border-bottom: 0;
}

.pomodoro-marker {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  align-self: center;
}

.pomodoro-marker.done {
  background: var(--line-strong);
}

.pomodoro-row-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

.pomodoro-row-note {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  text-align: right;
}

.pomodoro-focus .pomodoro-row-action {
  font-size: 12.5px;
  min-height: 26px;
  color: var(--muted);
}

.pomodoro-focus .pomodoro-row-action:hover {
  color: var(--accent);
}

.pomodoro-empty {
  margin: 4px 0 0;
  font-size: 13px;
}

.pomodoro-plan-row-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.pomodoro-plan-input {
  flex: 1;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
  font-size: 13.5px;
  color: var(--ink);
}

.pomodoro-plan-input:focus {
  outline: none;
  border-bottom-color: var(--line-strong);
}

.pomodoro-plan-input::placeholder {
  color: var(--muted-2);
}

.pomodoro-focus .pomodoro-plan-add {
  font-size: 20px;
  font-weight: 400;
  min-height: 28px;
  padding: 0 8px;
}

.pomodoro-focus .pomodoro-plan-add:hover {
  color: var(--accent);
}

.pomodoro-flag {
  flex: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 999px;
  padding: 2px 8px;
  align-self: center;
}

.pomodoro-flag.flag-deep {
  background: var(--green-soft);
  color: var(--green);
}

.pomodoro-flag.flag-shallow {
  background: var(--amber-soft);
  color: var(--amber);
}

.pomodoro-flag.flag-derailed {
  background: var(--danger-soft);
  color: var(--danger);
}

.strike {
  text-decoration: line-through;
}

/* Fullscreen painting */
.pomodoro-focus .pomodoro-painting-button {
  font-size: 12.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
}

.pomodoro-focus .pomodoro-painting-button:hover {
  color: var(--ink);
}

.painting-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 600ms ease;
}

.painting-overlay.visible {
  opacity: 1;
}

.painting-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms ease;
}

.painting-image.shown {
  opacity: 1;
}

.painting-caption {
  position: absolute;
  left: 20px;
  bottom: 16px;
  color: rgb(255 255 255 / 72%);
  font-size: 13px;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.painting-caption.fade {
  animation: painting-caption-fade 5s ease forwards;
}

@keyframes painting-caption-fade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

.painting-close {
  position: absolute;
  top: 14px;
  right: 18px;
  min-height: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: rgb(255 255 255 / 75%);
  font-size: 20px;
  line-height: 1;
}

.painting-close:hover {
  background: rgb(255 255 255 / 22%);
  color: #fff;
  box-shadow: none;
}
