* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

@font-face {
  font-family: "M-1m Code";
  src: url("/card-templates/todo-item-live/assets/mplus-1m-regular-sub.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "M-1m Code";
  src: url("/card-templates/todo-item-live/assets/mplus-1m-bold-sub.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("/card-templates/todo-item-live/assets/ibm-plex-sans-condensed-400.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("/card-templates/todo-item-live/assets/ibm-plex-sans-condensed-600.ttf")
    format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("/card-templates/todo-item-live/assets/ibm-plex-sans-condensed-700.ttf")
    format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --card-font: "Iosevka", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --theme-font-title: "IBM Plex Sans Condensed", "SF Pro Display", "Arial Narrow", sans-serif;
  --theme-font-mono: "M-1m Code", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --theme-root-bg: radial-gradient(circle at center, #f7d9bf 0%, #f2caa8 100%);
  --theme-agent-bg: #ffffff;
  --theme-agent-text-bg:
    radial-gradient(circle at top, rgba(245, 228, 210, 0.54), transparent 34%),
    linear-gradient(180deg, #fcf7f1 0%, #f6efe7 100%);
  --theme-feed-bg: #e7ddd0;
  --theme-panel-bg: rgba(247, 239, 230, 0.9);
  --theme-panel-bg-strong: rgba(250, 244, 237, 0.98);
  --theme-panel-bg-soft: rgba(255, 255, 255, 0.94);
  --theme-border: rgba(141, 104, 75, 0.18);
  --theme-border-strong: rgba(120, 84, 52, 0.22);
  --theme-text: #2f2118;
  --theme-text-soft: #5f4634;
  --theme-text-muted: #8b654b;
  --theme-accent: #b56c3d;
  --theme-accent-strong: #99532a;
  --theme-accent-soft: rgba(255, 200, 140, 0.2);
  --theme-accent-contrast: #ffffff;
  --theme-overlay: rgba(0, 0, 0, 0.42);
  --theme-shadow: 0 8px 18px rgba(48, 28, 18, 0.1);
  --theme-shadow-strong: 0 18px 36px rgba(48, 28, 18, 0.18);
  --theme-status-muted: #6b7280;
  --theme-status-live: #047857;
  --theme-status-warning: #b45309;
  --theme-status-danger: #b91c1c;
  --theme-card-neutral-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --theme-card-neutral-border: #dbe4ee;
  --theme-card-neutral-text: #111827;
  --theme-card-neutral-muted: #64748b;
  --theme-card-neutral-subtle: #475569;
  --theme-card-warm-bg: linear-gradient(180deg, #fffdfb 0%, #f7f1ea 100%);
  --theme-card-warm-border: rgba(168, 120, 86, 0.18);
  --theme-card-warm-text: #23150d;
  --theme-card-warm-muted: #78543b;
  --theme-card-success-bg: linear-gradient(
    180deg,
    rgba(234, 244, 229, 0.98),
    rgba(218, 232, 212, 0.98)
  );
  --theme-card-success-border: rgba(96, 126, 90, 0.18);
  --theme-card-success-text: #2f442a;
  --theme-card-success-muted: rgba(52, 82, 45, 0.76);
  --theme-task-bg:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(145deg, rgba(253, 245, 235, 0.98), rgba(242, 227, 211, 0.97));
  --theme-task-border: rgba(87, 65, 50, 0.14);
  --theme-task-text: #2f241e;
  --theme-task-muted: #7e6659;
  --theme-task-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 18px 36px rgba(79, 56, 43, 0.12);
  --theme-task-pattern: rgba(122, 97, 78, 0.035);
  --theme-list-bg:
    radial-gradient(circle at top right, rgba(255, 252, 233, 0.68), transparent 34%),
    linear-gradient(145deg, rgba(244, 226, 187, 0.98), rgba(226, 198, 145, 0.97));
  --theme-list-text: #4d392d;
  --theme-list-muted: rgba(77, 57, 45, 0.72);
  --theme-list-border: rgba(92, 70, 55, 0.18);
  --theme-list-shadow: inset 0 1px 0 rgba(255, 250, 224, 0.62);
  --feed-surface: var(--theme-feed-bg);
  --card-surface: linear-gradient(180deg, #b56c3d 0%, #8f4f27 100%);
  --card-border: rgba(255, 220, 188, 0.24);
  --card-shadow: 0 10px 28px rgba(68, 34, 15, 0.22);
  --card-text: rgba(255, 245, 235, 0.9);
  --card-muted: rgba(255, 233, 214, 0.72);
  --helper-card-surface: linear-gradient(180deg, #d9b1b8 0%, #c78d9a 100%);
  --helper-card-border: rgba(111, 46, 63, 0.18);
  --helper-card-shadow: 0 10px 28px rgba(92, 42, 57, 0.16);
  --helper-card-text: rgba(63, 23, 35, 0.94);
  --helper-card-muted: rgba(87, 43, 56, 0.72);
}

html {
  font: -apple-system-body;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--theme-root-bg);
  touch-action: manipulation;
}

#app {
  width: 100%;
  height: 100%;
}

#swipe-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  touch-action: pan-y;
}

#swipe-track {
  width: 200%;
  height: 100%;
  display: flex;
  transform: translateX(0);
  transition: transform 0.28s ease;
  will-change: transform;
}

#swipe-track.feed-active {
  transform: translateX(-50%);
}

.workspace-panel {
  position: relative;
  width: 50%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.workspace-agent {
  background: var(--theme-agent-bg);
}

.workspace-agent.text-mode {
  background: var(--theme-agent-text-bg);
}

.workspace-feed {
  background: var(--theme-agent-bg);
}

/* --- Log panel --- */
#log {
  position: absolute;
  bottom: 5vh;
  left: 5vw;
  right: 5vw;
  width: auto;
  max-height: 22vh;
  color: var(--theme-text);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--theme-panel-bg);
  transition:
    color 0.3s,
    background 0.3s,
    box-shadow 0.3s;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
}
#log-scroll,
#log-collapsed {
  max-height: 22vh;
  overflow-y: auto;
  padding: 12px 14px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 200, 140, 0.25) transparent;
  -webkit-mask-image: linear-gradient(to top, black 55%, transparent 100%);
  mask-image: linear-gradient(to top, black 55%, transparent 100%);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  outline: none;
}
#log-collapsed {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
#log-scroll:focus-visible,
#log-collapsed:focus-visible {
  outline: 2px solid var(--theme-accent-soft);
  outline-offset: -2px;
}
#log-scroll::-webkit-scrollbar,
#log-collapsed::-webkit-scrollbar {
  width: 4px;
}
#log-scroll::-webkit-scrollbar-thumb,
#log-collapsed::-webkit-scrollbar-thumb {
  background: rgba(255, 200, 140, 0.25);
  border-radius: 2px;
}
#log:not(.expanded):hover {
  color: rgba(30, 20, 10, 0.85);
  background: rgba(0, 0, 0, 0.06);
}
#log:not(.expanded):hover #log-scroll,
#log:not(.expanded):hover #log-collapsed {
  -webkit-mask-image: none;
  mask-image: none;
}
#log * {
  user-select: text;
  -webkit-user-select: text;
}
#log-inner {
  display: flex;
  flex-direction: column;
}
.line {
  display: block;
  margin-bottom: 4px;
}
.line.user {
  color: var(--theme-text);
}
.line.system {
  color: var(--theme-text-soft);
}
.line.tool {
  color: var(--theme-accent-strong);
}
.line.wisper {
  color: var(--theme-text-muted);
}
#log:not(.expanded):hover .line.user {
  color: rgba(20, 10, 0, 1);
}
#log:not(.expanded):hover .line.system {
  color: rgba(120, 80, 40, 0.85);
}
#log:not(.expanded):hover .line.tool {
  color: rgba(176, 96, 32, 0.92);
}
#log:not(.expanded):hover .line.wisper {
  color: rgba(120, 80, 40, 0.75);
}
#log.expanded {
  top: 5vh;
  bottom: 5vh;
  left: 5vw;
  right: 5vw;
  width: auto;
  max-height: none;
  border-radius: 20px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-strong);
  color: var(--theme-text);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    4px 4px 0px rgba(0, 0, 0, 0.2);
  cursor: default;
}
.workspace-agent.text-mode #log {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  max-height: none;
  overflow-x: hidden;
  border-radius: 0;
  background: var(--theme-agent-bg);
  color: var(--theme-text);
  box-shadow: none;
  cursor: default;
}
.workspace-agent.text-mode #log.expanded {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: none;
  border-radius: 0;
  background: var(--theme-agent-bg);
  box-shadow: none;
}
.workspace-agent.text-mode #chat-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: calc(5vh + 72px) 0 18px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 121, 82, 0.2) transparent;
}
.workspace-agent.text-mode #chat-empty {
  min-height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 6px 8vh;
}
.workspace-agent.text-mode #chat-empty-eyebrow {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-accent);
}
.workspace-agent.text-mode #chat-empty-title {
  margin: 0;
  min-width: 0;
  font-family: "IBM Plex Sans Condensed", "SF Pro Display", system-ui, sans-serif;
  font-size: 2.4rem;
  line-height: 0.94;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  color: var(--theme-text);
}
.workspace-agent.text-mode #chat-empty-copy {
  margin: 0;
  min-width: 0;
  max-width: 28rem;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
  color: var(--theme-text-muted);
}
.workspace-agent.text-mode #chat-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding-bottom: 8px;
}
.workspace-agent.text-mode .chat-row {
  display: flex;
  min-width: 0;
}
.workspace-agent.text-mode .chat-row.user {
  justify-content: flex-end;
  padding: 0 16px;
}
.workspace-agent.text-mode .chat-row.assistant,
.workspace-agent.text-mode .chat-row.system,
.workspace-agent.text-mode .chat-row.tool {
  justify-content: flex-start;
}
.workspace-agent.text-mode .chat-row.system,
.workspace-agent.text-mode .chat-row.tool {
  padding: 0 16px;
}
.workspace-agent.text-mode .chat-bubble {
  max-width: min(44rem, 82%);
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.3;
}
.workspace-agent.text-mode .chat-bubble.user {
  background: linear-gradient(180deg, var(--theme-accent) 0%, var(--theme-accent-strong) 100%);
  color: var(--theme-accent-contrast);
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 20px rgba(135, 77, 41, 0.18);
}
.chat-context-inline {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8em;
  letter-spacing: 0.01em;
  opacity: 0.9;
}
.workspace-agent.text-mode .chat-bubble.assistant {
  width: 100%;
  max-width: none;
  background: var(--theme-panel-bg-strong);
  color: var(--theme-text);
  border: 1px solid var(--theme-border-strong);
  border-left: none;
  border-right: none;
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(87, 52, 28, 0.1);
}
.workspace-agent.text-mode .chat-bubble.system,
.workspace-agent.text-mode .chat-bubble.tool {
  max-width: min(34rem, 100%);
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
}
.workspace-agent.text-mode .chat-bubble.system {
  color: var(--theme-text-muted);
}
.workspace-agent.text-mode .chat-bubble.tool {
  color: var(--theme-accent-strong);
}
#log.expanded #log-scroll {
  flex: 1;
  max-height: none;
  padding: 14px 14px 10px;
  -webkit-mask-image: none;
  mask-image: none;
}
#log.expanded .line.user {
  color: rgba(24, 14, 6, 0.96);
}
#log.expanded .line.system {
  color: rgba(112, 72, 36, 0.78);
}
#log.expanded .line.tool {
  color: rgba(160, 86, 28, 0.88);
}
#log.expanded .line.wisper {
  color: rgba(112, 72, 36, 0.72);
}
#log-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--theme-border);
  background: var(--theme-panel-bg);
  border-radius: 0 0 20px 20px;
}
.workspace-agent.text-mode #log-compose {
  gap: 12px;
  border-top: 1px solid var(--theme-border);
  background: linear-gradient(180deg, var(--theme-panel-bg) 0%, var(--theme-feed-bg) 100%);
  border-radius: 0;
  padding: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 -10px 24px rgba(92, 58, 34, 0.08);
}
.workspace-agent.text-mode #log.expanded #log-scroll {
  padding: calc(5vh + 70px) 18px 14px;
}
.workspace-agent.text-mode.has-card-context #log.expanded #log-scroll {
  padding: calc(5vh + 70px) 18px 14px;
}
#log-compose-toolbar {
  display: flex;
  justify-content: flex-end;
}
#log-compose-field {
  position: relative;
}
#log-compose-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  padding: 10px 16px 0;
  color: var(--theme-text-soft);
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
#log-compose-status[data-tone="thinking"] {
  color: var(--theme-accent);
}
#log-compose-status[data-tone="tool"] {
  color: var(--theme-accent-strong);
}
#log-compose-status[data-tone="replying"] {
  color: var(--theme-text);
}
#log-compose-status-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.log-compose-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.24;
  animation: log-compose-status-pulse 1.1s ease-in-out infinite;
}
.log-compose-status-dot:nth-child(2) {
  animation-delay: 0.16s;
}
.log-compose-status-dot:nth-child(3) {
  animation-delay: 0.32s;
}
#log-compose-status-label {
  flex: 0 0 auto;
}
#log-compose-status-detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.78;
}
.workspace-agent.text-mode #log-compose-status {
  padding: 10px 16px 0;
  font-size: 0.68rem;
}
.workspace-agent.text-mode #log-compose-status[data-tone="waiting"] {
  color: var(--theme-text-muted);
}
.workspace-agent.text-mode #log-compose-status[data-tone="thinking"] {
  color: var(--theme-accent);
}
.workspace-agent.text-mode #log-compose-status[data-tone="tool"] {
  color: var(--theme-accent-strong);
}
.workspace-agent.text-mode #log-compose-status[data-tone="replying"] {
  color: var(--theme-text);
}
#log-compose-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
}
#log-compose-context-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--theme-text-soft);
  padding: 0;
  margin: 0;
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.15;
  cursor: pointer;
  text-align: left;
}
#log-compose-context-chip:disabled {
  opacity: 0.5;
  cursor: default;
}
#log-compose-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
#log-compose-input {
  width: 100%;
  min-height: 80px;
  max-height: 26vh;
  padding: 0 64px 0 0;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text);
  caret-color: var(--theme-text);
  -webkit-text-fill-color: var(--theme-text);
  appearance: none;
  -webkit-appearance: none;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  overflow-y: auto;
  touch-action: pan-y;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 200, 140, 0.2) transparent;
}
#log-compose-input::-webkit-scrollbar {
  width: 4px;
}
#log-compose-input::-webkit-scrollbar-thumb {
  background: rgba(255, 200, 140, 0.2);
  border-radius: 2px;
}
#log-compose-input::placeholder {
  color: color-mix(in srgb, var(--theme-text-muted) 62%, transparent);
}
#log-compose-input:disabled {
  opacity: 0.45;
}
#log-close-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 245, 235, 0.08);
  color: rgba(255, 245, 235, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#log-close-btn:hover {
  background: rgba(255, 245, 235, 0.15);
  color: rgba(255, 245, 235, 0.9);
}
#log-close-btn:active {
  transform: scale(0.92);
}
#log-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--theme-overlay);
  transition:
    background 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#log-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(73, 42, 20, 0.12);
  transition:
    background 0.15s,
    transform 0.1s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.workspace-agent.text-mode #log-compose-input {
  min-height: 64px;
  max-height: 22vh;
  padding: 0 76px 0 16px;
  border-radius: 0;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.34;
  box-shadow: none;
}
.workspace-agent.text-mode #log-compose-actions {
  right: 16px;
  bottom: 16px;
}
.workspace-agent.text-mode #log-send-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.workspace-agent.text-mode #log-voice-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.workspace-agent.text-mode #log-compose-input {
  border-color: rgba(120, 84, 52, 0.22);
  background: rgba(255, 252, 248, 0.98);
}

@keyframes log-compose-status-pulse {
  0%,
  80%,
  100% {
    opacity: 0.22;
    transform: translateY(0);
  }
  40% {
    opacity: 0.9;
    transform: translateY(-1px);
  }
}

#log-send-btn:hover:not(:disabled) {
  background: rgba(210, 120, 60, 0.95);
}
#log-voice-btn:hover:not(:disabled) {
  background: rgba(255, 248, 241, 1);
  color: rgba(147, 84, 44, 0.98);
}
#log-send-btn:active:not(:disabled) {
  transform: scale(0.92);
}
#log-voice-btn:active:not(:disabled) {
  transform: scale(0.92);
}
#log-send-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
#log-voice-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* --- Voice status --- */
#voiceStatus {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.08);
  color: #111111;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 99px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
#voiceStatus.visible {
  opacity: 1;
}

/* --- Agent indicator --- */
.agentIndicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.agentIndicator.visible {
  opacity: 1;
}
.agentViz {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    4px 4px 0 rgba(0, 0, 0, 0.15);
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}
.agentViz canvas {
  /* biome-ignore lint/complexity/noImportantStyles: Three.js sets inline width/height that must be overridden */
  width: 100% !important;
  /* biome-ignore lint/complexity/noImportantStyles: Three.js sets inline width/height that must be overridden */
  height: 100% !important;
  display: block;
  pointer-events: auto;
  touch-action: none;
}
.agentIndicator.idle {
  color: #6b3a28;
}
.agentIndicator.listening {
  color: #d4553f;
}
.agentIndicator.thinking {
  color: #a0522d;
}
.agentIndicator.speaking {
  color: #8b4513;
}

#agent-card-context {
  position: absolute;
  top: calc(5vh + 68px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  width: min(300px, calc(100% - 14vw));
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(231, 221, 210, 0.94);
  background: rgba(255, 255, 255, 0.94);
  color: #2f2118;
  box-shadow:
    0 8px 18px rgba(48, 28, 18, 0.1),
    0 2px 6px rgba(48, 28, 18, 0.06);
  pointer-events: auto;
}
.workspace-agent.text-mode #agent-card-context {
  display: none;
}
.agent-card-context-label {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a06d4d;
}
.agent-card-context-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.agent-card-context-main {
  min-width: 0;
  flex: 1;
}
.agent-card-context-title {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 700;
  color: #2f2118;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-context-meta {
  margin-top: 2px;
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 600;
  color: #8b654b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-agent.text-mode .agent-card-context-title,
.workspace-agent.text-mode .agent-card-context-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.agent-card-context-note {
  margin-top: 6px;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.76rem;
  line-height: 1.2;
  color: rgba(52, 82, 45, 0.82);
}
.agent-card-context-clear {
  flex-shrink: 0;
  border: 1px solid #e3d6ca;
  background: rgba(248, 242, 235, 0.92);
  color: #5f4634;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}
.agent-card-context-clear:hover {
  background: rgba(234, 223, 211, 0.96);
  border-color: #cfb9a7;
  color: #3f2b1d;
  transform: translateY(-1px);
}
.agent-card-context-clear:active {
  transform: translateY(1px);
}

/* --- Controls --- */
#controls {
  position: absolute;
  top: calc(5vh + 18px);
  left: calc(5vw + 18px);
  right: calc(5vw + 18px);
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.control-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}
.control-icon-btn {
  pointer-events: auto;
  border: 1px solid #e7ddd2;
  background: rgba(255, 255, 255, 0.96);
  color: #3f2b1d;
  border-radius: 999px;
  padding: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(48, 28, 18, 0.12),
    0 2px 8px rgba(48, 28, 18, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}
.control-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(48, 28, 18, 0.16),
    0 4px 12px rgba(48, 28, 18, 0.1);
}
.control-icon-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 6px 12px rgba(48, 28, 18, 0.12),
    0 2px 6px rgba(48, 28, 18, 0.08);
}
.control-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.control-mode-btn {
  pointer-events: auto;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(48, 28, 18, 0.12),
    0 2px 8px rgba(48, 28, 18, 0.08);
  transition:
    transform 0.18s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}
.control-mode-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(48, 28, 18, 0.16),
    0 4px 12px rgba(48, 28, 18, 0.1);
}
.control-mode-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 6px 12px rgba(48, 28, 18, 0.12),
    0 2px 6px rgba(48, 28, 18, 0.08);
}

/* --- Session drawer --- */
#session-drawer-root {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: auto;
}

#session-drawer-edge {
  position: absolute;
  inset: 0 auto 0 0;
  width: 22px;
  z-index: 24;
  pointer-events: auto;
  touch-action: pan-y;
  background: transparent;
}

#session-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: color-mix(in srgb, var(--theme-overlay) 64%, transparent);
  cursor: pointer;
}

#session-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(21rem, calc(100vw - 28px));
  padding: calc(5vh + 18px) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--theme-panel-bg-strong);
  box-shadow: 18px 0 40px rgba(43, 26, 16, 0.16);
  touch-action: pan-y;
}

#session-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 14px;
  min-width: 0;
}

#session-drawer-header > div {
  flex: 1;
  min-width: 0;
}

#session-drawer-eyebrow {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--theme-accent);
}

#session-drawer-title {
  margin: 4px 0 0;
  font-family: "IBM Plex Sans Condensed", "SF Pro Display", system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--theme-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

#session-drawer-close,
#session-drawer-new {
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text);
}

#session-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#session-drawer-close svg {
  width: 18px;
  height: 18px;
}

#session-drawer-new {
  margin: 0 0 14px;
  padding: 11px 16px;
  width: 100%;
  border-radius: 0;
  border-left: none;
  border-right: none;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

#session-drawer-theme {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
}

#session-drawer-theme-label {
  font-family: var(--theme-font-mono);
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-text-muted);
}

#session-drawer-theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-drawer-theme-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text-soft);
  padding: 8px 10px;
  font-family: var(--theme-font-title);
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.session-drawer-theme-option.active {
  border-color: var(--theme-border-strong);
  background: color-mix(in srgb, var(--theme-feed-bg) 72%, var(--theme-panel-bg-soft));
  color: var(--theme-text);
}

.session-drawer-theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
  flex-shrink: 0;
}

#session-drawer-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.session-drawer-item {
  width: 100%;
  padding: 10px 16px 9px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 88%, transparent);
  border-left: none;
  border-right: none;
  border-top: none;
  background: color-mix(in srgb, var(--theme-panel-bg-soft) 94%, transparent);
  color: var(--theme-text);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.session-drawer-item.active {
  background: color-mix(in srgb, var(--theme-feed-bg) 74%, var(--theme-panel-bg-soft));
  border-color: var(--theme-border-strong);
}

.session-drawer-item[aria-disabled="true"],
#session-drawer-new:disabled {
  opacity: 0.55;
  cursor: default;
}

.session-drawer-item-title {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.02;
  font-weight: 700;
}

.session-drawer-item-preview {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.18;
  color: var(--theme-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.session-drawer-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.48rem;
  line-height: 1.12;
  letter-spacing: 0.04em;
  color: var(--theme-text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.session-drawer-item-meta span {
  white-space: nowrap;
}

.session-drawer-item-meta.compact {
  font-size: 0.42rem;
  letter-spacing: 0.02em;
}

#session-action-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: color-mix(in srgb, var(--theme-overlay) 58%, transparent);
  z-index: 30;
}

#session-action-sheet {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  background: var(--theme-panel-bg-strong);
  border: 1px solid var(--theme-border);
  box-shadow: 0 18px 40px rgba(43, 26, 16, 0.2);
  z-index: 31;
}

#session-action-title {
  padding: 12px 16px 10px;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.04;
  font-weight: 700;
  color: var(--theme-text);
  border-bottom: 1px solid var(--theme-border);
}

.session-action-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-top: 1px solid var(--theme-border);
  background: transparent;
  color: var(--theme-text);
  text-align: left;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.session-action-btn.destructive {
  color: var(--theme-status-danger);
}

.session-action-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.control-mode-btn-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.control-mode-btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.control-mode-btn.active {
  border-color: var(--theme-accent-strong);
  background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-strong));
  color: var(--theme-accent-contrast);
}
@media (max-width: 720px) {
  #agent-card-context {
    top: calc(5vh + 62px);
    width: min(280px, calc(100% - 12vw));
    padding: 7px 9px;
  }
  #controls {
    top: calc(5vh + 12px);
    left: calc(5vw + 12px);
    right: calc(5vw + 12px);
  }
}

/* --- Card feed --- */
.card-feed-shell {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#card-feed {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--theme-accent-soft) transparent;
  background: var(--feed-surface);
  box-shadow: inset 0 1px 0 rgba(86, 53, 31, 0.12);
}
#card-feed::-webkit-scrollbar {
  width: 4px;
}
#card-feed::-webkit-scrollbar-track {
  background: transparent;
}
#card-feed::-webkit-scrollbar-thumb {
  background: var(--theme-accent-soft);
  border-radius: 2px;
}
.card-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-group-title {
  padding: 0 16px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-text-soft);
}
.card-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  pointer-events: auto;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--card-shadow);
  animation: card-in 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  position: relative;
  max-width: 100%;
  flex-shrink: 0;
}
.card.kind-text {
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 0;
  padding: 0;
  box-shadow: var(--card-shadow);
}
.card.helper-card,
.card.kind-text.helper-card {
  background: var(--helper-card-surface);
  border-color: var(--helper-card-border);
  box-shadow: var(--helper-card-shadow);
}
.card.is-hidden-live {
  display: none;
}
.card.dismissing {
  animation: card-out 0.18s ease-in both;
}
.card.state-resolved,
.card.state-superseded,
.card.state-stale {
  opacity: 0.84;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes card-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px 0;
}
.card-header.floating {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  padding: 0;
}
.card.kind-text .card-header.floating {
  top: 0;
  right: 12px;
}
.card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.card-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-title {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: color-mix(in srgb, var(--card-text) 92%, white);
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card-state {
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-state {
  background: color-mix(in srgb, var(--card-text) 12%, transparent);
  color: var(--card-muted);
}
.card-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.card-menu-trigger {
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--card-text) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-text) 8%, transparent);
  color: color-mix(in srgb, var(--card-text) 72%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.card.kind-text .card-menu-trigger {
  border-color: color-mix(in srgb, var(--card-text) 18%, transparent);
  background: color-mix(in srgb, var(--card-text) 12%, transparent);
  color: color-mix(in srgb, var(--card-text) 82%, white);
  box-shadow: 0 4px 12px rgba(59, 31, 15, 0.18);
}
.card.helper-card .card-menu-trigger,
.card.kind-text.helper-card .card-menu-trigger {
  border-color: rgba(109, 58, 74, 0.18);
  background: rgba(255, 247, 249, 0.42);
  color: rgba(87, 35, 52, 0.9);
  box-shadow: 0 4px 12px rgba(92, 42, 57, 0.12);
}
.card-menu-trigger svg {
  width: 14px;
  height: 14px;
  display: block;
}
.card-menu-trigger:hover,
.card-menu-trigger.open {
  color: rgba(255, 247, 239, 0.96);
  background: rgba(255, 223, 198, 0.16);
  border-color: rgba(255, 223, 198, 0.36);
}
.card.kind-text .card-menu-trigger:hover,
.card.kind-text .card-menu-trigger.open {
  color: rgba(255, 247, 239, 0.96);
  background: rgba(255, 223, 198, 0.18);
  border-color: rgba(255, 223, 198, 0.36);
}
.card.helper-card .card-menu-trigger:hover,
.card.helper-card .card-menu-trigger.open,
.card.kind-text.helper-card .card-menu-trigger:hover,
.card.kind-text.helper-card .card-menu-trigger.open {
  color: rgba(73, 24, 40, 0.96);
  background: rgba(255, 245, 248, 0.62);
  border-color: rgba(109, 58, 74, 0.28);
}
.card-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-surface) 88%, rgba(40, 24, 14, 0.82));
  border: 1px solid color-mix(in srgb, var(--card-text) 18%, transparent);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.42),
    0 4px 10px rgba(0, 0, 0, 0.24);
  z-index: 5;
}
.card-menu-item {
  border: none;
  background: transparent;
  color: var(--card-text);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.675rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.card-menu-item:hover {
  background: rgba(255, 223, 198, 0.12);
}
.card-menu-item.danger {
  color: rgba(255, 177, 161, 0.92);
}
.card-menu-item.danger:hover {
  background: rgba(255, 128, 96, 0.12);
}
.card-body,
.card-question,
.card-response,
.card-footer {
  font-family: var(--card-font);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--card-text);
  white-space: normal;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}
.card.kind-text .card-body {
  color: inherit;
}
.card.kind-text .card-body > [data-nanobot-card-root] {
  display: block;
  background: transparent;
  color: inherit;
}
.card.kind-text .card-body > [data-nanobot-card-root] > :not(script) {
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}
.card.inbox-review-card,
.card.kind-text.inbox-review-card {
  background-color: transparent;
  background-image: var(--theme-card-success-bg);
  border-color: var(--theme-card-success-border);
  box-shadow:
    0 12px 26px rgba(42, 61, 35, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.inbox-review-card .card-header {
  padding: 12px 14px 0;
}
.inbox-review-card .card-title {
  color: var(--theme-card-success-text);
}
.inbox-review-card .card-state {
  background: color-mix(in srgb, var(--theme-card-success-text) 10%, transparent);
  color: var(--theme-card-success-muted);
}
.inbox-review-card__body {
  display: grid;
  gap: 10px;
  padding: 10px 14px 14px;
  color: var(--theme-card-success-text);
}
.inbox-review-card__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.88rem;
  line-height: 1.12;
  color: rgba(47, 68, 42, 0.84);
}
.inbox-review-card__score {
  flex-shrink: 0;
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(70, 96, 62, 0.76);
}
.inbox-review-card__error {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.2;
  color: #973d26;
}
.inbox-review-card__item {
  display: grid;
  gap: 6px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(97, 126, 91, 0.14);
}
.inbox-review-card__item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inbox-review-card__item-kind,
.inbox-review-card__item-updated {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.56rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(77, 102, 69, 0.76);
}
.inbox-review-card__item-updated.is-active {
  color: rgba(44, 89, 36, 0.92);
}
.inbox-review-card__item-title {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1.04;
  font-weight: 700;
  color: #24371f;
}
.inbox-review-card__item-preview {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.88rem;
  line-height: 1.18;
  color: rgba(56, 78, 49, 0.82);
}
.inbox-review-card__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.inbox-review-card__tags::-webkit-scrollbar {
  display: none;
}
.inbox-review-card__tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(88, 126, 74, 0.1);
  color: rgba(47, 74, 40, 0.88);
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  line-height: 1;
}
.inbox-review-card__actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}
.inbox-review-card__action {
  border: 1px solid rgba(96, 126, 90, 0.16);
  background: rgba(249, 253, 246, 0.9);
  color: #2f442a;
  padding: 8px 10px;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
}
.inbox-review-card__action.ghost {
  background: transparent;
  color: rgba(56, 78, 49, 0.82);
}
.inbox-review-card__action:disabled {
  opacity: 0.55;
  cursor: default;
}
#inbox-quick-add-btn {
  position: absolute;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 7;
  pointer-events: auto;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--theme-overlay);
  transition:
    background 0.15s,
    transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#inbox-quick-add-btn:hover:not(:disabled) {
  background: var(--theme-accent-strong);
}
#inbox-quick-add-btn:active:not(:disabled) {
  transform: scale(0.92);
}
#inbox-quick-add-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: auto;
  border: 0;
  background: color-mix(in srgb, var(--theme-overlay) 48%, transparent);
}
#inbox-quick-add-sheet {
  position: absolute;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  z-index: 9;
  pointer-events: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--theme-panel-bg-strong);
  border: 1px solid var(--theme-border);
  box-shadow: 0 18px 40px rgba(43, 26, 16, 0.2);
}
.inbox-quick-add-sheet__title {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1;
  font-weight: 700;
  color: var(--theme-text);
}
.inbox-quick-add-sheet__input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text);
  padding: 10px 12px;
  resize: none;
  outline: none;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.96rem;
  line-height: 1.22;
}
.inbox-quick-add-sheet__error {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.18;
  color: var(--theme-status-danger);
}
.inbox-quick-add-sheet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.inbox-quick-add-sheet__btn {
  border: 1px solid var(--theme-border);
  background: var(--theme-panel-bg);
  color: var(--theme-text);
  padding: 9px 12px;
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.inbox-quick-add-sheet__btn.primary {
  background: linear-gradient(180deg, var(--theme-accent), var(--theme-accent-strong));
  border-color: color-mix(in srgb, var(--theme-accent-strong) 64%, transparent);
  color: var(--theme-accent-contrast);
}
.inbox-quick-add-sheet__btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.task-card-ui {
  --task-accent: #58706f;
  --task-accent-soft: rgba(88, 112, 111, 0.12);
  --task-ink: var(--theme-task-text);
  --task-muted: var(--theme-task-muted);
  --task-surface: var(--theme-panel-bg-soft);
  --task-border: var(--theme-task-border);
  --task-button-ink: #214240;
  position: relative;
  overflow: visible;
  border-radius: 0;
  border: 1px solid var(--task-border);
  background: var(--theme-task-bg);
  color: var(--task-ink);
  font-family: "M-1m Code", var(--card-font);
  box-shadow: var(--theme-task-shadow);
}
.task-card-ui::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    var(--theme-task-pattern) 0,
    var(--theme-task-pattern) 2px,
    transparent 2px,
    transparent 10px
  );
  pointer-events: none;
  opacity: 0.55;
}
.task-card-ui__inner {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 15px 44px 13px 14px;
}
.task-card-ui__topline {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.task-card-ui__lane-wrap {
  position: relative;
  min-width: 0;
}
.task-card-ui__lane-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.task-card-ui__lane-button:disabled {
  cursor: default;
  opacity: 0.6;
}
.task-card-ui__lane {
  min-width: 0;
  font-size: 0.64rem;
  line-height: 1.1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--task-muted);
  font-weight: 700;
  white-space: nowrap;
}
.task-card-ui__lane-caret {
  flex: 0 0 auto;
  font-size: 0.66rem;
  line-height: 1;
  color: var(--task-muted);
  transform: translateY(-1px);
  transition: transform 0.18s ease;
}
.task-card-ui__lane-caret.open {
  transform: translateY(-1px) rotate(180deg);
}
.task-card-ui__lane-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 248, 239, 0.96);
  box-shadow:
    0 10px 24px rgba(79, 56, 43, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.task-card-ui__lane-menu-item {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 248, 239, 0.78);
  color: var(--task-button-ink);
  font:
    700 0.7rem / 1 "M-1m Code",
    var(--card-font);
  cursor: pointer;
  text-align: left;
}
.task-card-ui__lane-menu-item:disabled {
  cursor: default;
  opacity: 0.6;
}
.task-card-ui__status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--task-muted);
}
.task-card-ui__status.is-error {
  color: var(--theme-status-danger);
}
.task-card-ui__text-button {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.task-card-ui__text-button:disabled {
  cursor: default;
}
.task-card-ui__title {
  font-family: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  font-size: 0.96rem;
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.008em;
  color: var(--task-ink);
  text-wrap: balance;
  word-break: break-word;
}
.task-card-ui__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.task-card-ui__tags::-webkit-scrollbar {
  display: none;
}
.task-card-ui__tag {
  appearance: none;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--task-accent-soft);
  color: var(--task-button-ink);
  font-family: "M-1m Code", var(--card-font);
  font-size: 0.71rem;
  line-height: 1;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.035);
  white-space: nowrap;
  cursor: default;
}
.task-card-ui__tag:disabled {
  cursor: default;
  opacity: 0.6;
}
.task-card-ui__tag.is-holding {
  background: rgba(165, 95, 75, 0.18);
  color: var(--theme-status-danger);
}
.task-card-ui__tag--action {
  border-style: dashed;
  background: rgba(255, 248, 239, 0.74);
  cursor: pointer;
}
.task-card-ui__body {
  font-family: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  font-size: 0.86rem;
  line-height: 1.34;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--theme-text-soft);
  opacity: 0.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-card-ui__body.is-placeholder {
  opacity: 0.62;
  font-style: italic;
}
.task-card-ui__body-markdown {
  display: block;
}
.task-card-ui__body-markdown-inner {
  display: block;
}
.task-card-ui__md-line {
  display: block;
}
.task-card-ui__md-line + .task-card-ui__md-line {
  margin-top: 0.06rem;
}
.task-card-ui__md-line--heading {
  font-weight: 700;
  color: var(--theme-text);
}
.task-card-ui__md-line--quote {
  padding-left: 0.55rem;
  border-left: 2px solid rgba(95, 120, 132, 0.3);
}
.task-card-ui__md-prefix {
  color: var(--task-muted);
}
.task-card-ui__md-break {
  display: block;
  height: 0.18rem;
}
.task-card-ui__body-markdown code {
  font-family: "M-1m Code", var(--card-font);
  font-size: 0.78em;
}
.task-card-ui__body-markdown a {
  color: inherit;
}
.task-card-ui__editor {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: inherit;
  border-radius: 0;
  box-shadow: none;
}
.task-card-ui__editor::placeholder {
  color: color-mix(in srgb, var(--theme-text-muted) 68%, transparent);
  opacity: 1;
  font-style: italic;
}
.task-card-ui__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: 100%;
}
.task-card-ui__chip {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #4c3b30;
  font-family: "M-1m Code", var(--card-font);
  font-size: 0.63rem;
  line-height: 1;
  font-weight: 700;
}
.list-total-card-ui {
  display: grid;
  gap: 10px;
  padding: 15px 44px 13px 14px;
  background: var(--theme-list-bg);
  box-shadow: var(--theme-list-shadow);
  color: var(--theme-list-text);
}
.list-total-card-ui__labels,
.list-total-card-ui__row,
.list-total-card-ui__total {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.list-total-card-ui__labels {
  color: var(--theme-list-muted);
  font:
    700 0.62rem / 1 "M-1m Code",
    var(--card-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.list-total-card-ui__rows {
  display: grid;
  gap: 6px;
}
.list-total-card-ui__input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-list-border) 82%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--theme-list-text);
  padding: 5px 0 4px;
  outline: none;
  box-shadow: none;
}
.list-total-card-ui__input:focus {
  border-bottom-color: var(--theme-list-border);
}
.list-total-card-ui__input::placeholder {
  color: color-mix(in srgb, var(--theme-list-muted) 74%, transparent);
}
.list-total-card-ui__value {
  font:
    700 0.84rem / 1 "M-1m Code",
    var(--card-font);
  text-align: right;
}
.list-total-card-ui__name {
  font-family: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  font-size: 0.92rem;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.008em;
}
.list-total-card-ui__status {
  min-height: 0.9rem;
  color: color-mix(in srgb, var(--theme-list-muted) 76%, transparent);
  font:
    700 0.62rem / 1 "M-1m Code",
    var(--card-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.list-total-card-ui__status.is-error {
  color: var(--theme-status-danger);
}
.list-total-card-ui__total {
  padding-top: 10px;
  border-top: 1px solid var(--theme-list-border);
  color: var(--theme-text);
}
.list-total-card-ui__total-label {
  font:
    700 0.66rem / 1 "M-1m Code",
    var(--card-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.list-total-card-ui__total-value {
  font:
    700 0.98rem / 1 "M-1m Code",
    var(--card-font);
  text-align: right;
}
.card-question {
  color: rgba(255, 245, 235, 0.95);
}
.card-response,
.card-footer {
  color: var(--card-muted);
}
.card-body p {
  margin: 0 0 6px;
}
.card-body p:last-child {
  margin-bottom: 0;
}
.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--card-text) 96%, white);
  margin: 8px 0 4px;
}
.card-body ul,
.card-body ol {
  margin: 4px 0 6px;
  padding-left: 18px;
}
.card-body li {
  margin-bottom: 2px;
}
.card-body code {
  background: color-mix(in srgb, var(--card-text) 10%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.6875rem;
}
.card-body pre {
  background: color-mix(in srgb, var(--card-text) 18%, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  margin: 6px 0;
}
.card-body pre code {
  background: none;
  padding: 0;
  font-size: 0.6875rem;
}
.card-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.6875rem;
  margin: 6px 0;
}
.card-body th,
.card-body td {
  border: 1px solid color-mix(in srgb, var(--card-text) 18%, transparent);
  padding: 4px 8px;
  text-align: left;
}
.card-body th {
  background: color-mix(in srgb, var(--card-text) 10%, transparent);
  color: color-mix(in srgb, var(--card-text) 94%, white);
  font-weight: 600;
}
.card-body a {
  color: color-mix(in srgb, var(--card-text) 90%, white);
  text-decoration: underline;
}
.card-body blockquote {
  border-left: 3px solid color-mix(in srgb, var(--card-text) 26%, transparent);
  margin: 6px 0;
  padding-left: 10px;
  color: color-mix(in srgb, var(--card-text) 60%, transparent);
}
.card-body hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--card-text) 16%, transparent);
  margin: 8px 0;
}
.card-body img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.card-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.card-choice-btn {
  background: color-mix(in srgb, var(--card-text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-text) 24%, transparent);
  border-radius: 8px;
  color: var(--card-text);
  font-family: var(--card-font);
  font-size: 0.75rem;
  padding: 6px 14px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  flex: 1 1 auto;
  text-align: center;
}
.card-choice-btn:hover {
  background: rgba(255, 223, 198, 0.22);
  border-color: rgba(255, 223, 198, 0.56);
}
.card-choice-btn:active {
  background: rgba(255, 223, 198, 0.32);
}
.card-choice-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- Workbench overlay --- */
#workbench-overlay-root {
  position: absolute;
  top: calc(5vh + 78px);
  right: 16px;
  z-index: 19;
  width: min(24rem, calc(100% - 24px));
  pointer-events: auto;
}

.workspace-agent.text-mode #workbench-overlay-root {
  top: auto;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
  width: min(22rem, calc(100% - 24px));
}

#workbench-overlay {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 32rem);
  padding: 12px 12px 10px;
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  background: var(--theme-panel-bg-strong);
  color: var(--theme-text);
  box-shadow:
    0 18px 36px rgba(72, 42, 24, 0.18),
    0 4px 12px rgba(72, 42, 24, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.workspace-agent.text-mode #workbench-overlay {
  max-height: min(44vh, 26rem);
  background: var(--theme-panel-bg-strong);
}

#workbench-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#workbench-overlay-eyebrow {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-accent);
}

#workbench-overlay-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.workbench-overlay-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-panel-bg-soft);
  color: var(--theme-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

.workbench-overlay-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.workbench-overlay-icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 1);
}

.workbench-overlay-icon-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.workbench-overlay-icon-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

#workbench-overlay-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

#workbench-overlay-tabs::-webkit-scrollbar {
  display: none;
}

.workbench-overlay-tab {
  flex: 0 0 auto;
  max-width: 12rem;
  padding: 6px 10px;
  border: 1px solid rgba(173, 134, 98, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.74);
  color: rgba(92, 58, 36, 0.82);
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.workbench-overlay-tab.active {
  background: rgba(232, 213, 195, 0.94);
  color: #382217;
  border-color: rgba(149, 109, 76, 0.24);
}

#workbench-overlay-title {
  font-family: "IBM Plex Sans Condensed", "SF Pro Display", system-ui, sans-serif;
  font-size: 1.18rem;
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #23140c;
}

#workbench-overlay-blurb {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.16;
  color: rgba(92, 58, 36, 0.76);
}

#workbench-overlay-body {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 121, 82, 0.16) transparent;
}

#workbench-overlay-body .card-body {
  padding: 0;
  background: transparent;
  color: inherit;
}

#workbench-overlay-body .card-body > :first-child {
  margin-top: 0;
}

#workbench-overlay-body .card-body > :last-child {
  margin-bottom: 0;
}

.workbench-overlay-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workbench-overlay-question-copy,
.workbench-overlay-question-prompt {
  font-family: "IBM Plex Sans Condensed", "SF Pro Text", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: pre-wrap;
  color: #24140b;
}

.workbench-overlay-question-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workbench-overlay-question-choice {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(233, 221, 211, 0.92);
  color: #573828;
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  line-height: 1;
}

#workbench-overlay-footer {
  display: flex;
  align-items: center;
  min-height: 16px;
}

.workbench-overlay-status {
  font-family: "M-1m Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  line-height: 1.15;
  color: rgba(118, 76, 50, 0.74);
}

.workbench-overlay-status.error {
  color: rgba(147, 57, 44, 0.88);
}
