/* Simple-mode CSS — extracted from app.css to shrink its merge-conflict
   surface against main (see CLAUDE.md's git-conflict-reduction note).
   Every rule here is scoped to body.ccc-simple-mode or a #simple-prefixed /
   .simple- prefixed selector; nothing here affects Advanced mode, with one
   deliberate exception: the [data-simple-only] filter on the shared Actions
   menu (below), which hides Simple-only rows when Advanced mode is showing
   that same menu. Loaded unconditionally from index.html (cheap: it's dead
   weight, not dead code, when Simple mode is off — same reasoning as any
   other CSS file). */

body.ccc-mobile-redesign.ccc-simple-mode .mobile-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 4px;
  min-height: 48px;
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-nav-btn.is-active {
  color: var(--green);
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-nav-icon { font-size: 18px; line-height: 1; }
body.ccc-mobile-redesign.ccc-simple-mode .mobile-nav-label { font-size: 10.5px; font-weight: 600; }

/* ---- Simple mode: session Actions menu ----
   The menu chrome itself (button, dropdown, item styling) is shared with
   Advanced mode now — see app.css's narrow-viewport block. This file only
   hides the rows that have no meaning outside Simple mode (rename/move/
   change-model/technical-details); Stop and the font-size rows stay visible
   in every mode's copy of the SAME menu. */
body:not(.ccc-simple-mode) .mobile-actions-item[data-simple-only] {
  display: none;
}

/* ---- Simple mode: composer simplification ----
   Only the message field, mic (voice), and Send stay. Terminal-oriented
   controls (Esc-to-cancel, Codex steer, context-compact, phone-mode
   Submit+, the raw keyboard-shortcut hint row) hide — still fully present
   and working in Advanced mode, this only affects Simple + mobile chrome. */
body.ccc-mobile-redesign.ccc-simple-mode #convEscBtn,
body.ccc-mobile-redesign.ccc-simple-mode #convSteerBtn,
body.ccc-mobile-redesign.ccc-simple-mode #convCompactBtn,
body.ccc-mobile-redesign.ccc-simple-mode #convSubmitPlusBtn,
body.ccc-mobile-redesign.ccc-simple-mode #convTtsRateControl,
body.ccc-mobile-redesign.ccc-simple-mode #convInputHint {
  display: none !important;
}
/* Bottom nav: icon-only, bigger glyphs, no English label required to read. */
body.ccc-mobile-redesign.ccc-simple-mode .mobile-nav-icon { font-size: 24px; }
/* Status line: icon shape + color + motion carry meaning; the word itself
   is screen-reader-only so a non-reading user never needs it, and someone
   using VoiceOver/TalkBack still gets the plain word. */
/* Visually hidden, not display:none — VoiceOver/TalkBack still announce
   the real word even though a non-reading user never needs to see it. */
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-word,
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-detail {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line { gap: 8px; }
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  line-height: 1;
}
/* Distinct SILHOUETTE per state, not just color, so colorblind users and
   grayscale displays still tell states apart (WCAG: don't rely on color
   alone). !important + the .is-X chain repeated on both the dot and its
   ::before is needed to outrank the plain-color-fill rules above (an
   earlier, less-specific pass that predates the icon-first version). */
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-working .mobile-status-dot,
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-idle .mobile-status-dot,
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-stuck .mobile-status-dot,
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-offline .mobile-status-dot {
  background: transparent !important;
  opacity: 1 !important;
}
/* Working keeps its pulsing ring (motion, the third signal channel
   alongside icon shape and color) — just around a transparent-centered
   glyph instead of a solid-filled dot now. */
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-working .mobile-status-dot {
  animation: mobileStatusPulse 1.8s ease-in-out infinite;
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-working .mobile-status-dot::before { content: '▶'; color: var(--green); }
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-idle .mobile-status-dot::before { content: '⏳'; color: #d29922; }
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-stuck .mobile-status-dot::before { content: '⚠'; color: #d29922; }
body.ccc-mobile-redesign.ccc-simple-mode .mobile-status-line.is-offline .mobile-status-dot::before { content: '○'; color: var(--text-muted); }
/* Toggles: icon-only. Text stays for screen readers via aria-label +
   .mobile-sr-only span, not removed from the accessibility tree. */
body.ccc-mobile-redesign.ccc-simple-mode button.mobile-details-toggle,
body.ccc-mobile-redesign.ccc-simple-mode button.mobile-actions-btn {
  font-size: 16px;
  min-width: 44px;
  justify-content: center;
  padding: 6px 10px;
}
body.ccc-mobile-redesign.ccc-simple-mode .mobile-simple-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 14px;
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-logo { width: 24px; height: 24px; flex-shrink: 0; }
body.ccc-mobile-redesign.ccc-simple-mode .msh-wordmark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
body.ccc-mobile-redesign.ccc-simple-mode .msh-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: none; background: transparent; color: var(--text);
  border-radius: 10px; cursor: pointer;
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-btn:active { background: var(--surface-2, var(--surface)); }
body.ccc-mobile-redesign.ccc-simple-mode .msh-btn[aria-expanded="true"] { background: var(--surface-2, var(--surface)); }
body.ccc-mobile-redesign.ccc-simple-mode .msh-search-bar {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
}
body.ccc-mobile-redesign.ccc-simple-mode .msh-search-bar[hidden] { display: none; }
body.ccc-mobile-redesign.ccc-simple-mode .msh-search-bar .search-wrap { display: flex; width: 100%; }
body.ccc-mobile-redesign.ccc-simple-mode .msh-search-bar .conv-search-input {
  width: 100%; min-height: 40px; font-size: 15px;
}

/* --- Collapse the competing chrome (one nav = the bottom nav) --- */
body.ccc-mobile-redesign.ccc-simple-mode .sidebar-header,
body.ccc-mobile-redesign.ccc-simple-mode .new-session-panel,
body.ccc-mobile-redesign.ccc-simple-mode #cccThroughputStrip,
body.ccc-mobile-redesign.ccc-simple-mode .fleet-health-strip,
body.ccc-mobile-redesign.ccc-simple-mode .conv-tab-bar,
body.ccc-mobile-redesign.ccc-simple-mode .conv-inprogress-toolbar,
body.ccc-mobile-redesign.ccc-simple-mode .conv-archived-tools,
body.ccc-mobile-redesign.ccc-simple-mode .conv-gap-separator,
body.ccc-mobile-redesign.ccc-simple-mode #pwaInstallBanner,
body.ccc-mobile-redesign.ccc-simple-mode #pollerWrap {
  display: none !important;
}

/* --- Feed cards: breathing room, one status glyph in the left gutter --- */
body.ccc-mobile-redesign.ccc-simple-mode .conv-item {
  position: relative;
  padding: 15px 14px 15px 50px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
}
/* Context-fill color spine — the numeric "24%" badge is hidden in Simple
   mode, so each chat's fill level shows as a colored left edge instead,
   reusing the original pct-badge palette exactly (low=accent, mid=#FBCA04,
   high=--red). Painted with an inset shadow so it needs no extra layout
   space and doesn't fight the card's own border-left (active state). */
body.ccc-mobile-redesign.ccc-simple-mode .conv-item.ctx-low {
  box-shadow: inset 5px 0 0 0 var(--accent);
}
body.ccc-mobile-redesign.ccc-simple-mode .conv-item.ctx-mid {
  box-shadow: inset 5px 0 0 0 #FBCA04;
}
body.ccc-mobile-redesign.ccc-simple-mode .conv-item.ctx-high {
  box-shadow: inset 5px 0 0 0 var(--red);
}
body.ccc-mobile-redesign.ccc-simple-mode .conv-title {
  font-size: 15.5px;
  line-height: 1.35;
}
/* Status glyph sits in the left gutter, aligned with the title's first
   line — a single dominant "is this OK" signal per card, feed-style. */
body.ccc-mobile-redesign.ccc-simple-mode .conv-item > .mobile-status-line {
  position: absolute;
  left: 12px;
  top: 15px;
  margin: 0;
}
/* Tiny engine glyph, $$$ cost tier, and the boxed Details toggle are all
   technical noise in a feed. Metadata now lives in the session view's
   Actions -> Technical details, so the card face stays clean. */
body.ccc-mobile-redesign.ccc-simple-mode .conv-session-icon,
body.ccc-mobile-redesign.ccc-simple-mode .session-tier-cost,
body.ccc-mobile-redesign.ccc-simple-mode .conv-item .mobile-details-toggle,
body.ccc-mobile-redesign.ccc-simple-mode .conv-item .mobile-details-panel {
  display: none !important;
}

/* =========================================================================
   SIMPLE HOME — Simple-UI redesign, iteration 1
   The landing surface in Simple mode (body.ccc-simple-mode +
   body.ccc-simple-home-open, toggled by _syncSimpleHomeVisibility() in
   app.js). Plain-language cards, large text, one decision per card, ≥56px
   touch targets. Advanced mode is untouched: every rule is gated on
   body.ccc-simple-mode, and the conv-split/toolbar hides only apply while
   the home screen itself is open.
   #simpleHome lives inside .sidebar: at the ≤1200px mobile breakpoint
   .main is position:fixed and translated off-canvas until
   body.mobile-show-main, so anything in .main is unreachable on the home
   screen. The sidebar is the always-visible layer (and hosts the slim
   header), so home open = sidebar shows #simpleHome in place of its
   usual list chrome.
   ========================================================================= */

#simpleHome { display: none; }

/* Every visibility rule here is gated on ccc-mobile-redesign: Simple Home
   is a mobile-breakpoint surface. A stored ccc-ui-mode=simple at desktop
   width must fall back to the normal dashboard, not a squished home. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-home-open #simpleHome {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 96px; /* bottom padding clears the mobile bottom nav */
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-home-open #convSplit,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-home-open #convToolbar {
  display: none !important;
}
/* While home is open, the sidebar's only visible content is the slim
   header + the home screen — the tab bar, conversation list, and other
   dashboard chrome reappear when home closes (Tasks/Automations nav). */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-home-open .sidebar > :not(.mobile-simple-header):not(#simpleHome) {
  display: none !important;
}

body.ccc-simple-mode #simpleHome > .simple-card,
body.ccc-simple-mode #simpleHome .simple-section {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Composer card --- */
body.ccc-simple-mode .simple-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
body.ccc-simple-mode .simple-composer-card .simple-h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
body.ccc-simple-mode .simple-composer-input {
  width: 100%;
  min-height: 84px;
  font-size: 17px;
  line-height: 1.45;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg, var(--surface));
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}
body.ccc-simple-mode .simple-composer-input:focus {
  outline: none;
  border-color: var(--accent);
}
body.ccc-simple-mode .simple-chip-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 8px;
}
body.ccc-simple-mode .simple-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.ccc-simple-mode .simple-folder-select {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  font-family: inherit;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg, var(--surface));
  color: var(--text);
  box-sizing: border-box;
}
body.ccc-simple-mode .simple-folder-select:focus {
  outline: none;
  border-color: var(--accent);
}
body.ccc-simple-mode .simple-folder-select:disabled {
  opacity: 0.6;
}
body.ccc-simple-mode .simple-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 8px 14px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
body.ccc-simple-mode .simple-chip .simple-chip-name { font-weight: 650; }
body.ccc-simple-mode .simple-chip .simple-chip-sub {
  font-size: 13px;
  color: var(--text-muted);
}
body.ccc-simple-mode .simple-chip.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
body.ccc-simple-mode .simple-chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
/* Mic + Start sit in one row: mic is a fixed-size circle, Start fills the
   rest so it stays the dominant, unmissable action. */
body.ccc-simple-mode .simple-composer-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}
body.ccc-simple-mode .simple-mic-btn {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
body.ccc-simple-mode .simple-mic-btn svg { width: 22px; height: 22px; display: block; }
body.ccc-simple-mode .simple-mic-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
body.ccc-simple-mode .simple-mic-btn:active { transform: translateY(1px); }
body.ccc-simple-mode .simple-mic-btn.recording {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
  animation: ccc-mic-pulse 1.5s infinite;
}
body.ccc-simple-mode .simple-mic-btn:disabled { opacity: 0.5; cursor: not-allowed; }
body.ccc-simple-mode .simple-start-btn {
  display: block;
  flex: 1 1 auto;
  width: auto;
  min-height: 56px;
  margin-top: 0;
  font-size: 19px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
body.ccc-simple-mode .simple-start-btn:disabled { opacity: 0.6; cursor: default; }
/* R3: one-time "get help now" for a helper queue's waiting jobs. */
body.ccc-simple-mode .simple-automation-help-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  text-align: center;
  font-weight: 700;
}
body.ccc-simple-mode .simple-automation-help-btn:disabled { opacity: 0.6; cursor: default; }
body.ccc-simple-mode .simple-toast {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--green, #2ea043) 14%, var(--surface));
  border: 1px solid var(--green, #2ea043);
  color: var(--text);
}
body.ccc-simple-mode .simple-toast.is-error {
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border-color: var(--red);
}
body.ccc-simple-mode .simple-toast[hidden] { display: none; }

/* --- Home sections: reorderable + collapsible --- */
body.ccc-simple-mode .simple-section { margin-top: 22px; }
body.ccc-simple-mode .simple-section-head {
  display: flex;
  align-items: center;
  gap: 4px;
}
body.ccc-simple-mode .simple-section-drag {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  border-radius: 8px;
}
body.ccc-simple-mode .simple-section-drag:hover { background: var(--surface-2); color: var(--text); }
body.ccc-simple-mode .simple-section-toggle {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 2px;
  cursor: pointer;
  text-align: left;
}
body.ccc-simple-mode .simple-section .simple-h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
body.ccc-simple-mode .simple-section-chevron {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: transform 0.15s;
}
body.ccc-simple-mode .simple-section-body {
  margin-top: 10px;
}
/* Collapsed: only the heading row shows. */
body.ccc-simple-mode .simple-section-collapsed .simple-section-body { display: none; }
body.ccc-simple-mode .simple-section-collapsed .simple-section-chevron { transform: rotate(-90deg); }
/* Dragging: lift the section above its siblings while it follows the pointer
   (transform applied inline by _wireSimpleSectionDrag() in app.js). */
body.ccc-simple-mode .simple-section-dragging {
  position: relative;
  z-index: 5;
  opacity: 0.92;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  border-radius: 12px;
  background: var(--surface);
}
body.ccc-simple-mode .simple-empty {
  font-size: 15px;
  color: var(--text-muted);
  padding: 14px 4px;
}
body.ccc-simple-mode .simple-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-muted);
  padding: 14px 4px;
}
body.ccc-simple-mode .simple-loading-detail {
  font-size: 13px;
  margin-top: 2px;
}
body.ccc-simple-mode .simple-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent, var(--green));
  animation: ccc-spin 0.8s linear infinite;
}

/* --- Needs-you cards --- */
/* Swipe wrapper: "Not now" sits behind the card at a fixed width, revealed
   by dragging the card left (_wireSimpleNyaSwipe in app.js). overflow:hidden
   clips the card when it's translated, so give the wrapper its own
   margin-bottom instead of relying on the (now-clipped) card's. */
body.ccc-simple-mode .simple-nya-swipe {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 14px;
}
body.ccc-simple-mode .simple-nya-swipe .simple-nya-card {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  touch-action: pan-y;
  transition: transform 0.18s ease;
  will-change: transform;
}
body.ccc-simple-mode .simple-nya-dismiss-btn {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 76px;
  border: none;
  background: var(--danger, #d33);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
body.ccc-simple-mode .simple-nya-card.is-answered { opacity: 0.65; }
body.ccc-simple-mode .simple-nya-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
body.ccc-simple-mode .simple-nya-need {
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--text);
  margin: 6px 0 10px;
  white-space: pre-wrap;
}
body.ccc-simple-mode .simple-nya-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
body.ccc-simple-mode .simple-nya-answer-row {
  display: flex;
  gap: 8px;
}
body.ccc-simple-mode .simple-nya-answer-input {
  flex: 1 1 auto;
  min-height: 52px;
  min-width: 0;
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg, var(--surface));
  color: var(--text);
}
body.ccc-simple-mode .simple-nya-answer-input:focus {
  outline: none;
  border-color: var(--accent);
}
body.ccc-simple-mode .simple-nya-send {
  flex: 0 0 auto;
  min-height: 52px;
  min-width: 84px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
body.ccc-simple-mode .simple-nya-done {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--green, #2ea043);
}
body.ccc-simple-mode .simple-nya-error {
  margin-top: 8px;
  font-size: 14px;
  color: var(--red);
}

/* --- Working / Finished task cards --- */
body.ccc-simple-mode button.simple-task-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  min-height: 56px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
body.ccc-simple-mode .simple-task-card .simple-card-name,
body.ccc-simple-mode .simple-nya-card .simple-card-name {
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.35;
  /* Long unbroken names (kebab-case branch/task slugs with no spaces) had no
     overflow handling here and just got clipped mid-word by the card's own
     bounds, with no ellipsis to show anything was cut. Clamp to 2 lines with
     a proper ellipsis instead. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
/* Engine icon sits inline before the task name (same icon set as the Simple
   conversation header — sessionEngineIconHtml). */
body.ccc-simple-mode .simple-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
body.ccc-simple-mode .simple-card-title-row .simple-card-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.ccc-simple-mode .simple-card-title-row .conv-pane-cat-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 18px;
}
body.ccc-simple-mode .simple-card-title-row .conv-pane-cat-icon svg {
  width: 15px;
  height: 15px;
}
body.ccc-simple-mode .simple-status-line { font-size: 15px; color: var(--text); }
body.ccc-simple-mode .simple-memory-line { font-size: 14px; color: var(--text-muted); }
body.ccc-simple-mode .simple-task-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
/* Running now vs. finished-and-unseen: a plain left-edge color bar, not just
   text, so it reads at a glance while scanning. A seen/finished card gets
   neither (plain border like any other card). */
body.ccc-simple-mode .simple-task-card.is-running {
  border-left: 4px solid var(--accent);
  padding-left: 15px;
}
body.ccc-simple-mode .simple-task-card.is-unseen-finished {
  border-left: 4px solid var(--warning, #d29922);
  padding-left: 15px;
}
/* Word badge next to the name — the color bar alone wasn't a clear enough
   signal on its own (user feedback: "one is blue, another has a yellow
   tint" with no way to tell what either meant). */
body.ccc-simple-mode .simple-card-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
body.ccc-simple-mode .simple-card-badge-running {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
body.ccc-simple-mode .simple-card-badge-unseen {
  color: var(--warning, #d29922);
  background: color-mix(in srgb, var(--warning, #d29922) 18%, transparent);
}
/* Copy-reference icon on each task card — icon only, never the raw id.
   margin-left: auto pushes it to the row's right edge whether or not a
   badge precedes it — a badge's own auto margin already carries this
   button along, so the rule is a no-op (not a conflict) when both are
   present. */
body.ccc-simple-mode .simple-card-copy-ref-btn {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}
body.ccc-simple-mode .simple-card-copy-ref-btn:hover,
body.ccc-simple-mode .simple-card-copy-ref-btn:focus-visible {
  color: var(--text);
  background: var(--surface-2, var(--surface));
}
body.ccc-simple-mode .simple-see-all {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 4px auto 0;
  min-height: 52px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}

/* --- Conversation view additions (Simple mode) ---
   Back is the shared #mobileBackBtn (app.css) now — Simple mode doesn't
   style its own copy, it just points the same arrow at _simpleShowHome(). */
#simpleUsageLine { display: none; }
body.ccc-simple-mode #simpleUsageLine.has-data {
  display: block;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   SIMPLE UI — depth 2 (conversation) + depth 3 (history / automations /
   settings) screens. Iteration 2 of the Simple-UI redesign: every screen
   reachable within 3 taps of home must itself be simple, so opening a
   conversation shows a plain chat surface (body.ccc-simple-conv-open,
   toggled by _syncSimpleHomeVisibility() in app.js) and the depth-3 screens
   (body.ccc-simple-screen-open) replace the advanced sidebar lists, queue
   board, and settings modal. Advanced mode is untouched: every rule is
   gated on body.ccc-mobile-redesign.ccc-simple-mode + one of those classes.
   ========================================================================== */

/* --- Depth-3 screens (same sidebar layer as #simpleHome) --- */
.simple-screen { display: none; }
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-screen-open .simple-screen:not([hidden]) {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 96px; /* bottom padding clears the mobile bottom nav */
}
/* While a depth-3 screen is open, the sidebar's only visible content is the
   slim header + that screen, and the conversation pane stays hidden — same
   pattern as ccc-simple-home-open above. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-screen-open .sidebar > :not(.mobile-simple-header):not(.simple-screen) {
  display: none !important;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-screen-open #convSplit,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-screen-open #convToolbar {
  display: none !important;
}

body.ccc-simple-mode .simple-screen > * {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
body.ccc-simple-mode .simple-screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
body.ccc-simple-mode .simple-screen-head .simple-h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
body.ccc-simple-mode .simple-back-btn {
  min-height: 48px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
body.ccc-simple-mode .simple-screen-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin: -6px 0 14px;
}
body.ccc-simple-mode .simple-search-input {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg, var(--surface));
  color: var(--text);
  box-sizing: border-box;
}
body.ccc-simple-mode .simple-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
body.ccc-simple-mode .simple-h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 10px;
  color: var(--text);
}
body.ccc-simple-mode .simple-queue-item { margin-bottom: 10px; }
body.ccc-simple-mode .simple-settings-row { margin-bottom: 14px; }
body.ccc-simple-mode .simple-settings-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
body.ccc-simple-mode .simple-settings-desc {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* --- Depth-2 conversation view: simple chat surface --- */
/* The conversation title span only exists for this view. */
.simple-conv-title { display: none; }
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .simple-conv-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* In the simple conversation view the toolbar is just: back, the plain
   title, the technical-details toggle, and the shared Actions menu. Every
   advanced control (topbar buttons, breadcrumb, session id, font steppers,
   more menu, overflow, replay/launch/live badges) is hidden. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convToolbar {
  gap: 8px;
  row-gap: 6px;
  padding: 6px 10px;
  flex-wrap: wrap;
}
/* .toolbar's base rule (app.css) sets overflow:hidden to clip long chip
   rows — but the Actions dropdown is position:absolute and pops out BELOW
   the toolbar's own box, so that same overflow:hidden clipped the open
   menu to fully invisible (found while shooting docs screenshots — the
   dropdown never rendered even though its own computed rect was fine).
   Only lift the clip while the menu is actually open. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convToolbar:has(.mobile-actions-menu:not([hidden])) {
  overflow: visible;
}
/* Back + title claim the first row; the Actions menu wraps to a second row
   rather than overflowing off the right edge of a narrow phone — confirmed
   cut off at 390px wide before this fix. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .simple-conv-title {
  flex-basis: 0;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convToolbar > :not(#mobileBackBtn):not(#simpleConvTitle):not(.mobile-actions-wrap):not(.mobile-view-seg) {
  display: none !important;
}
/* Advanced pane chrome: pane header (proc pills, verbose/replay/annotate
   actions), presentation toolbar, status rail, goal strip, and the input
   context strip (folder pickers, worktree toggle, workspace/usage rows). */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conv-pane-header,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conv-presentation-toolbar,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #statusRail,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #statusRailRestoreBtn,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convInputContext,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convInputHint,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conv-goal-strip,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open [data-role="conv-f2-rail"],
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open [data-role="conv-f2-panel"] {
  display: none !important;
}
/* Transcript noise: tool-call groups (already collapsed summaries), system
   events, model/effort meta lines, per-turn cost. User + assistant bubbles
   stay. All of this is the "technical strip" content: hidden by default,
   revealed only via the Actions menu's "Open technical details" row for
   THIS open conversation (body.ccc-simple-tech-open, set/cleared per
   session id by _simpleSyncTechStrip() in app.js — see
   _simpleOnConversationOpen). Token/context usage and the agent/model name
   shown in #simpleConvTitle are NOT technical and are never gated by this
   class. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open:not(.ccc-simple-tech-open) .conversations-view .tool-call-group,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open:not(.ccc-simple-tech-open) .conversations-view .event.system,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open:not(.ccc-simple-tech-open) .conversations-view .event-model-meta,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open:not(.ccc-simple-tech-open) .conversations-view .codex-ambient-context,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open:not(.ccc-simple-tech-open) .conversations-view .event.result .stats .simple-tech-cost {
  display: none !important;
}
/* Stop, text-size, and technical-details now live as rows in the shared
   Actions menu (app.css) — no standalone buttons/styling here. */
/* Plain chat bubbles: worker on the left, you on the right. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event.user_text,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event.assistant {
  max-width: 88%;
  border-left: none;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 16px;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event.user_text {
  margin-left: auto;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event.assistant {
  margin-right: auto;
  background: var(--surface);
  border: 1px solid var(--border);
}
/* Give the "sending…" cancel a real thumb target instead of the desktop
   22px circle, and keep it clear of the bubble's rounded corner padding. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event.user_text.pending .pending-send-cancel {
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 15px;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conversations-view .event .label {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
/* Simple composer: big textarea + a labeled Send button; the engine/model/
   effort selectors and Esc/steer/compact/Submit+ buttons are advanced-only.
   TTS (read aloud) and mic (speak instead of type) stay — both are
   grandma-friendly. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convInputBar {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .conv-input-selectors,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convEscBtn,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convSteerBtn,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convCompactBtn,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convSubmitPlusBtn,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convTtsRateControl {
  display: none !important;
}
/* A message sent while the agent is still busy on a prior turn shows in a
   queued-steer tray with Cancel/Steer actions — both advanced concepts. Keep
   the queued message itself visible (so "did my message send?" still has an
   answer) but drop the two jargon buttons; the message auto-delivers once
   the agent is free either way. */
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .queued-steer-tray .cancel-queued-message,
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open .queued-steer-tray .send-queued-steer {
  display: none !important;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convInput {
  min-height: 56px;
  font-size: 17px;
  line-height: 1.45;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convInput:focus {
  border-color: var(--accent);
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convSendBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 84px;
  min-height: 48px;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
body.ccc-mobile-redesign.ccc-simple-mode.ccc-simple-conv-open #convSendBtn .send-btn-label {
  display: inline;
}
