/* cc.css
 * Extracted from public/styles.css (Phase 0.3).
 * v1.0.42: loaded eagerly from index.html (was lazy-loaded — caused FOUC).
 */

:root {
  --cc-source-email:    #3b82f6;
  --cc-source-teams:    #6264A7;
  --cc-source-calendar: #2E7D4F;
  --cc-source-tasks:    #E07A00;
  --cc-source-financial: #C0392B;
  --cc-source-system:   #C0392B;
  --cc-source-approval: #E67E22;
  --cc-source-health:   #C0392B;
  --cc-source-briefing: #2E7D4F;
  --cc-source-ga4:      #4285F4;

  --cc-flag-danger:     #f43f5e;
  --cc-flag-warning:    #f97316;
  --cc-flag-caution:    #eab308;

  --cc-status-review:   #2ecc71;
  --cc-status-working:  var(--accent);
  --cc-status-commit:   #eab308;
}

#app.more-mode #chat,
#app.more-mode #input-wrapper,
#app.more-mode #scroll-bottom-btn,
#app.more-mode #command-view,
#app.more-mode #finance-view,
#app.more-mode #marketing-view {
  display: none !important;
}

#app.command-mode #more-view,
#app.command-mode #finance-view,
#app.command-mode #marketing-view {
  display: none !important;
}

#command-view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

#app.command-mode #command-view {
  display: flex;
}

#app.command-mode #header,
#app.command-mode #chat,
#app.command-mode #input-wrapper,
#app.command-mode #scroll-bottom-btn {
  display: none !important;
}

/* Phase-C stubs that don't do anything yet — hidden until the follow-up
   ships real filter/more/pin menus. Each onclick is just a console.log.
   See cc.js:271 (ccFilterMenuStub/ccMoreMenuStub) and
   index.html:231,234 (Pin coming soon / More coming soon).
   cc-filter-row chips dispatch cc:filter events that nothing listens for. */
#cc-filter-btn,
#cc-more-btn,
#cc-detail-pin,
#cc-detail-more,
#cc-filter-row {
  display: none !important;
}

#app.finance-mode #chat,
#app.finance-mode #input-wrapper,
#app.finance-mode #scroll-bottom-btn,
#app.finance-mode #command-view,
#app.finance-mode #more-view,
#app.finance-mode #marketing-view {
  display: none !important;
}

#app.marketing-mode #chat,
#app.marketing-mode #input-wrapper,
#app.marketing-mode #scroll-bottom-btn,
#app.marketing-mode #command-view,
#app.marketing-mode #more-view,
#app.marketing-mode #finance-view {
  display: none !important;
}

/* Phase C (v1.2.0 M3): #cc-pane-left wraps topbar + filter row + feed so
   the FAB can anchor inside it (not in #cc-feed) and the desktop split-pane
   layout can flex the left pane to take all space left of the detail. */
.cc-pane-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.cc-feed {
  position: relative;
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(to bottom, rgba(239, 68, 68, 0.025) 0%, transparent 28%);
  padding: 16px;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.cc-feed::-webkit-scrollbar { display: none; }

/* Phase C: M3 top app bar for the feed. Override the m3-topbar default
   surface-container-low with plain surface so the bar reads as part of the
   feed pane, matching mockup section 4. */
.cc-topbar.m3-topbar {
  background: var(--md-sys-color-surface);
  padding: 0 24px;
  gap: 8px;
  flex-shrink: 0;
}

.cc-topbar .m3-topbar__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--md-sys-color-on-surface);
}

.cc-count-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
}

.cc-count-chip[hidden] { display: none; }

/* Phase C: M3 filter chip row. Horizontally scrolls on narrow viewports.
   Stub controls: tapping toggles selection but no filtering wired yet. */
.cc-filter-row {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  overflow-x: auto;
  background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  scrollbar-width: none;
  flex-shrink: 0;
}

.cc-filter-row::-webkit-scrollbar { display: none; }

.cc-filter-row .m3-chip { flex-shrink: 0; }

@media (max-width: 600px) {
  .cc-topbar.m3-topbar { padding: 0 12px; }
  .cc-topbar .m3-topbar__title { font-size: 18px; }
  .cc-filter-row { padding: 8px 12px; gap: 6px; }
  .cc-feed { padding: 8px 12px 12px; }
}

.cc-group-header {
  position: sticky;
  top: -12px;
  z-index: 2;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  font-weight: var(--md-sys-typescale-label-small-weight);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 4px 6px;
  margin: 0 -12px;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 7px;
}

.cc-group-header::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cc-group-header.cc-group-urgent::before  { background: var(--error); box-shadow: 0 0 6px rgba(239,68,68,0.5); }

.cc-group-header.cc-group-normal::before  { background: var(--accent); }

.cc-group-header.cc-group-later::before   { background: var(--text-dim); }

.cc-group-header.cc-group--completed::before { background: var(--success); }

/* ──────────────────────────────────────────────────────────────────────
   Phase C (v1.2.0 M3) — CC card redesign.

   Source identity now lives in the avatar's outer ring (--cc-source-{source}
   token), not in a left-border stripe on the card. The card itself is a flat
   surface-container-high tile with M3 state-layer hover/press. .cc-card
   class is kept on every card so #cc-cards .cc-card selectors in app.js
   and ui.js continue to find them; .cccard is where all the new styling
   anchors.
   ────────────────────────────────────────────────────────────────────── */

.cc-card {
  /* Behavior + animation only. Visuals live on .cccard. */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cccard {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin: 0 0 8px;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-md);
  position: relative;
  isolation: isolate;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.cccard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

@media (hover: hover) {
  .cccard:hover::after { opacity: var(--md-sys-state-hover-opacity); }
}

.cccard:active::after { opacity: var(--md-sys-state-pressed-opacity); }

/* Selected (desktop split-pane: highlights the card whose detail is open). */
.cccard.cc-card-selected,
.cccard--selected {
  background: var(--md-sys-color-secondary-container);
}

.cccard.cc-card-selected .cccard__sender,
.cccard--selected .cccard__sender,
.cccard.cc-card-selected .cccard__subject,
.cccard--selected .cccard__subject {
  color: var(--md-sys-color-on-secondary-container);
}

.cccard.cc-card-selected .cccard__meta,
.cccard--selected .cccard__meta { color: rgba(219, 234, 254, 0.75); }

/* Avatar: 40dp disc inside a 44dp source-colored ring (2dp band). */
.cccard__avatar-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  padding: 2px;
  flex-shrink: 0;
}

.cccard__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cccard__avatar--glyph { color: rgba(255, 255, 255, 0.95); }
.cccard__avatar--glyph svg { width: 20px; height: 20px; }

.cccard__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cccard__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
  min-width: 0;
}

.cccard__sender {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cccard__meta {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.cccard__subject {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--md-sys-color-on-surface);
  margin: 2px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Andy draft reply preview: subtle tinted block, same surface that mockup
   section 4 card-1 and card-5 show. */
.cccard__andy {
  background: rgba(59, 130, 246, 0.12);
  color: var(--md-sys-color-secondary);
  padding: 8px 10px;
  border-radius: var(--md-sys-shape-corner-sm);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
}

.cccard__andy strong { color: #BFDBFE; font-weight: 600; }

.cccard__chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Mobile sizing: tighter padding + smaller text per mockup section 5. */
@media (max-width: 600px) {
  .cccard { padding: 12px; gap: 10px; margin-bottom: 6px; }
  .cccard__sender { font-size: 13px; }
  .cccard__subject { font-size: 13px; }
  .cccard__andy { font-size: 11px; padding: 7px 9px; }
}

/* Priority: low cards fade slightly; high/critical no longer get a stripe
   (source identity is in the avatar ring; priority signals through
   surface tone instead). */
.cccard.cc-priority-low .cccard__subject,
.cccard.cc-priority-low .cccard__sender { color: var(--md-sys-color-on-surface-variant); }

.cccard.cc-priority-high,
.cccard.cc-priority-critical {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 25%, var(--md-sys-color-surface-container-high));
}

.cc-stop-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.cc-stop-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--md-sys-color-error);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

@media (hover: hover) {
  .cc-stop-btn:hover::after { opacity: var(--md-sys-state-hover-opacity); }
}

.cc-stop-btn:active::after { opacity: var(--md-sys-state-pressed-opacity); }

.cc-stop-btn:active { transform: scale(0.92); }

@media (pointer: coarse) {
  .cc-stop-btn { width: 48px; height: 48px; }
}

/* Phase C: legacy .cc-card-active / .cc-card-detail / .cc-card.expanded
   rules removed. The new .cccard markup doesn't render -active/-detail
   children, and inline expand was never wired in cc.js. */

.cc-detail-content {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cc-andy-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.cc-andy-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  font-family: inherit;
  outline: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  resize: none;
}

.cc-andy-input:focus {
  border-color: var(--border-focus);
}

.cc-andy-input::placeholder {
  color: var(--text-dim);
}

.cc-andy-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--duration-fast);
}

.cc-andy-send:active {
  background: var(--accent-hover);
  transform: scale(0.95);
}

.cc-confirm {
  background: var(--accent-subtle);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
}

.cc-confirm-label {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.cc-confirm-body {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.cc-confirm-actions {
  display: flex;
  gap: 8px;
}

.cc-confirm-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-height: 40px;
  transition: all var(--duration-fast);
}

.cc-confirm-send {
  background: var(--accent);
  color: #fff;
}

.cc-confirm-send:active { background: var(--accent-hover); }

.cc-confirm-cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.cc-card.cc-actioned {
  background: rgba(92, 184, 122, 0.06);
  border-color: rgba(92, 184, 122, 0.2);
  opacity: 0.7;
}

.cc-card.cc-snoozed {
  opacity: 0.5;
}

.cc-card.cc-pending-action {
  background: var(--accent-subtle);
  border-color: rgba(59, 130, 246, 0.2);
}

.cc-card-enter {
  animation: ccCardIn 0.25s var(--md-sys-motion-easing-legacy) both;
}

.cc-card-exit {
  animation: ccCardOut 0.2s var(--md-sys-motion-easing-legacy) forwards;
  pointer-events: none;
}

.cc-snooze-menu {
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
  min-width: 140px;
}

.cc-snooze-option {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.cc-snooze-option::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.cc-snooze-option:active::after { opacity: var(--md-sys-state-pressed-opacity); }

.cc-snooze-option + .cc-snooze-option { border-top: 1px solid var(--border); }

.cc-status-badge {
  font-size: 0.72em;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cc-status-badge--review {
  background: color-mix(in srgb, var(--cc-status-review) 15%, transparent);
  color: var(--cc-status-review);
}

.cc-status-badge--working {
  background: color-mix(in srgb, var(--cc-status-working) 12%, transparent);
  color: var(--cc-status-working);
}

.cc-status-badge--commit {
  background: color-mix(in srgb, var(--cc-status-commit) 15%, transparent);
  color: var(--cc-status-commit);
}

.cc-commitments {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cc-status-commit) 6%, transparent);
  border-left: 3px solid var(--cc-status-commit);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-commitment {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88em;
}

.cc-commitment-text { flex: 1; color: var(--text); }

.cc-commitment-backstop {
  font-size: 0.85em;
  color: var(--cc-status-commit);
  cursor: help;
}

.cc-commitment-done {
  padding: 3px 10px;
  font-size: 0.82em;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.cc-commitment-done:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.cc-mini-spinner {
  width: 10px; height: 10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.cc-unread-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

.cc-thread-count {
  font-size: 0.75em;
  color: var(--text-muted);
}

/* Phase C: working/status border-left stripes dropped. The status pill in
   .cccard__chips carries the signal now. */
.cc-card-completed { opacity: 0.55; }

.cc-card-completed:active { opacity: 0.8; }

.cc-completed-section { margin-top: 12px; }

.cc-group-header--completed {
  cursor: pointer;
  list-style: none;
  color: var(--text-muted);
}

.cc-group-header--completed::marker { display: none; }

.cc-group-header--completed::-webkit-details-marker { display: none; }

.cc-day-label {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  color: var(--text-muted);
  padding: 8px 12px 2px;
  text-transform: uppercase;
}

.cc-done-icon {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  margin-right: 4px;
  font-weight: 600;
}

.cc-done-complete { color: var(--cc-status-review); }

.cc-done-dismissed { color: var(--text-muted); opacity: 0.6; }

.cc-badge--review { background: var(--cc-status-review) !important; }

.cc-context-strip {
  flex-shrink: 0;
}

.cc-provenance-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cc-provenance-bar:active {
  background: rgba(22, 27, 36, 0.9);
}

.cc-provenance-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.cc-provenance-icon svg {
  width: 20px;
  height: 20px;
}

.cc-provenance-type {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}

.cc-provenance-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.cc-provenance-name {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.cc-provenance-time {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-dim);
  flex-shrink: 0;
}

.cc-provenance-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);
}

.cc-provenance-chevron.expanded {
  transform: rotate(180deg);
}

.cc-context-expanded {
  opacity: 0;
  overflow-y: auto;
  background: var(--bg);
  padding: 0 16px;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard), padding var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);
  scrollbar-width: thin;
}

.cc-context-expanded.open {
  opacity: 1;
  padding: 12px 16px;
}

.cc-ctx-msg {
  margin-bottom: 10px;
}

.cc-ctx-msg:last-child {
  margin-bottom: 0;
}

.cc-ctx-msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.cc-ctx-msg-sender {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  color: var(--text-secondary);
}

.cc-ctx-msg-time {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  color: var(--text-dim);
}

.cc-ctx-msg-body {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cc-ctx-thread .cc-ctx-msg-body {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: pre-line;
}

.cc-ctx-email-subject {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cc-ctx-email-sender {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-dim);
  margin-bottom: 6px;
}

.cc-ctx-email-body {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-ctx-kv {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.cc-ctx-kv-label {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  width: 50px;
  flex-shrink: 0;
}

.cc-ctx-kv-value {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-secondary);
}

.cc-turns {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cc-turn {
  padding-bottom: 20px;
  margin-bottom: 0;
}

.cc-turn + .cc-turn {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 20px;
}

.cc-turn-instruction {
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}

.cc-turn-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.cc-turn-label-you {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 700;
  color: var(--accent);
}

.cc-turn-label-andy {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 700;
  color: var(--text-muted);
}

.cc-turn-time {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-dim);
  margin-left: auto;
}

.cc-turn-instruction-text {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.cc-turn-response {
  padding: 12px 0 0 6px;
}

.cc-turn-response-text {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  font-weight: 400;
  color: var(--text-secondary);
  word-break: break-word;
}

.cc-turn-response-text .cc-md {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.cc-turn-response-wrap {
  position: relative;
  overflow: hidden;
}

.cc-turn-response-wrap.collapsed {
  max-height: 4.8em; /* ~3 lines at 1.6 line-height */
}

.cc-turn-response-wrap.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.cc-turn-expand {
  background: none;
  border: none;
  color: var(--accent);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.cc-turn-expand:active {
  opacity: 0.7;
}

.cc-thread-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.cc-thread-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}

.cc-thread-file:active { opacity: 0.7; }

.cc-thread-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--accent);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}

.cc-progress-log {
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  opacity: 0.5;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-secondary);
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.cc-progress-step-latest {
  opacity: 1;
  color: var(--accent);
}

.cc-progress-icon {
  width: 16px;
  flex-shrink: 0;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-progress-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}

.cc-progress-ts {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Phase C: single-row M3 ButtonGroup -- Dismiss (text) | Snooze (outlined) |
   Complete (tonal, flex:1 when shown). Complete toggles via display: none
   so non-complete cards still get a three-up row, complete cards collapse
   to text + outlined. */
.cc-detail-button-group {
  display: flex;
  gap: 8px;
  padding: 0 0 10px;
  align-items: center;
}

.cc-detail-button-group .m3-btn--text,
.cc-detail-button-group .m3-btn--outlined { flex-shrink: 0; }

.cc-detail-complete-btn.m3-btn { flex: 1; min-width: 0; }

.cc-andy-attach {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.cc-andy-attach:active { background: var(--bg-tertiary); }

.cc-detail-attached {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 12px 0;
}

.cc-attached-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-secondary);
}

.cc-attached-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: 1;
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  padding: 0 2px;
}

.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  margin-top: 8px;
  padding-bottom: 2px;
}

/* M3 chip (assist). 8px radius per M3 chip spec (not pill). */
.cc-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-sm);
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--md-sys-typescale-font-family);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line);
  font-weight: var(--md-sys-typescale-label-large-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
}

.cc-chip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  pointer-events: none;
  z-index: -1;
}

@media (hover: hover) {
  .cc-chip:hover::after { opacity: var(--md-sys-state-hover-opacity); }
}

.cc-chip:active::after { opacity: var(--md-sys-state-pressed-opacity); }

@media (max-width: 480px), (pointer: coarse) {
  .cc-chip { min-height: 44px; padding: 10px 16px; }
}

.cc-skeleton .cc-skeleton-card {
  background: var(--md-sys-color-surface-container);
  border: none;
  border-radius: var(--md-sys-shape-corner-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.cc-skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: var(--md-sys-color-surface-container-high);
  animation: skeletonPulse 1.5s ease-in-out infinite;
  margin-bottom: 8px;
}

.cc-skeleton-line:nth-child(1) { width: 40%; height: 10px; }

.cc-skeleton-line:nth-child(2) { width: 75%; height: 14px; }

.cc-skeleton-line:nth-child(3) { width: 90%; }

.cc-skeleton-line:nth-child(4) { width: 60%; }

.cc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
}

/* Center the empty state vertically only when it's the sole content of the
   feed (no Done section below). When .cc-completed-section exists, the
   empty state collapses to its content height so Done stays visible. */
#cc-feed:not(:has(.cc-completed-section)) .cc-empty {
  height: 100%;
}

.cc-empty::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(92, 184, 122, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.cc-empty-icon {
  margin-bottom: 16px;
  opacity: 0.9;
}

.cc-empty-title {
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line);
  letter-spacing: var(--md-sys-typescale-headline-small-tracking);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.cc-empty-subtitle {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text-muted);
}

/* Phase C: empty-state action chips ("Pull from inbox", "Check Teams").
   STUB buttons — no behavior yet, just suggestion affordances. */
.cc-empty-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.cc-pull-indicator {
  text-align: center;
  padding: 12px;
  color: var(--text-dim);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  display: none;
}

.cc-pull-indicator.active {
  display: block;
}

.cc-pull-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: activitySpin 0.8s linear infinite;
  margin: 0 auto 6px;
}

/* v1.2.3: mobile/tablet (<1280px) -- detail view is full-screen (top:0
   bottom:0) covering the cards underneath. Was a 78vh bottom-sheet through
   v1.2.2 which left a 22vh dead gap at the top. Slide-up transition kept.
   The drag handle is hidden everywhere now. The desktop ≥1280px rules
   below override flex/positioning to make it a persistent split-pane. */
#cc-detail-view {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 15;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform var(--md-sys-motion-duration-medium2, 300ms) var(--md-sys-motion-easing-emphasized-decel, cubic-bezier(0.05, 0.7, 0.1, 1));
}

#cc-detail-view .m3-bottom-sheet__handle { display: none; }

#cc-detail-view.open {
  display: flex;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  #cc-detail-view { transition: none; }
}

.cc-detail-empty { display: none; }

/* Phase C: detail header uses .m3-topbar primitive sizing.
   Composition: back icon-btn + avatar disc + name/meta stack + trailing
   stop/pin/more icon-btns. The avatar + name + meta combo mirrors the
   mockup section 4 detail-head. */
.cc-detail-header.m3-topbar {
  flex-shrink: 0;
  gap: 12px;
  padding: 0 12px;
}

.cc-detail-head-avatar.m3-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
  background: var(--md-sys-color-surface-container);
  color: #FFFFFF;
}

.cc-detail-head-info {
  flex: 1;
  min-width: 0;
}

.cc-detail-head-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-detail-head-meta,
.cc-detail-source {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-detail-actions-top {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.cc-detail-back.m3-icon-btn { flex-shrink: 0; }

/* Stop button: special-case the destructive color but keep m3-icon-btn shape. */
.cc-detail-stop-btn.m3-icon-btn {
  color: var(--md-sys-color-error);
  background: color-mix(in srgb, var(--md-sys-color-error) 14%, transparent);
}

.cc-detail-stop-btn[disabled] { opacity: 0.5; cursor: default; }

.cc-detail-stop-btn .cc-detail-stop-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid color-mix(in srgb, var(--md-sys-color-error) 35%, transparent);
  border-top-color: var(--md-sys-color-error);
  border-radius: 50%;
  animation: ccDetailStopSpin 0.7s linear infinite;
}

.cc-financial-amount {
  font-size: var(--md-sys-typescale-headline-medium-size);
  line-height: var(--md-sys-typescale-headline-medium-line);
  letter-spacing: var(--md-sys-typescale-headline-medium-tracking);
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 8px;
}

.cc-financial-amount--negative { color: var(--error, #ef4444); }

.cc-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.cc-detail-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  padding: 24px;
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
}

.cc-detail-sender {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.cc-detail-sender-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.cc-detail-sender-info {
  flex: 1;
  min-width: 0;
}

.cc-detail-sender-name {
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
  font-weight: 600;
  color: var(--text);
}

.cc-detail-sender-meta {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-muted);
  margin-top: 1px;
}

.cc-detail-title {
  font-size: var(--md-sys-typescale-title-large-size);
  line-height: var(--md-sys-typescale-title-large-line);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Phase C: Andy summary keeps its quiet supporting-text role -- left-border
   tinted stripe so it reads as Andy's analysis of the source content (not
   a call-to-action). The primary-container "draft reply" block below is
   the action surface. */
.cc-detail-summary {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  color: var(--md-sys-color-on-surface-variant);
  margin: 8px 0 14px;
  padding: 8px 12px;
  border-left: 2px solid var(--md-sys-color-secondary);
  background: rgba(38, 147, 209, 0.06);
  border-radius: 0 var(--md-sys-shape-corner-sm) var(--md-sys-shape-corner-sm) 0;
}

.cc-detail-full-content {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-source-detail {
  /* Lets long source content (tall emails, full Teams threads) push the
     thread section below it instead of being capped to a fixed height. */
  display: block;
}

.cc-source-detail:empty { display: none; }

.cc-thread-section {
  /* Visual separator between the source detail and the conversation
     thread when the card has both. The :empty rule hides the rule when
     the card has no thread yet (fresh email card → no separator line
     dangling at the bottom). */
  display: block;
}

.cc-thread-section:empty { display: none; }

.cc-source-detail:not(:empty) + .cc-thread-section:not(:empty) {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.cc-email-html-frame {
  display: block;
  width: 100%;
  min-height: 60vh;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
  margin: 8px 0 12px;
}

.cc-manual-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}

.cc-manual-priority {
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
}

.cc-manual-date {
  color: var(--text-muted);
}

.cc-manual-body {
  padding-left: 12px;
  border-left: 2px solid var(--border, rgba(255, 255, 255, 0.06));
  margin-top: 4px;
}

.cc-md {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text-secondary);
  word-break: break-word;
}

.cc-md p {
  margin: 0 0 12px 0;
}

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

.cc-md ul, .cc-md ol {
  margin: 8px 0 12px 0;
  padding-left: 20px;
}

.cc-md ul {
  list-style: none;
}

.cc-md ul li {
  position: relative;
}

.cc-md ul li::before {
  content: "\00B7";
  position: absolute;
  left: -14px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
}

.cc-md li {
  margin-bottom: 6px;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.cc-md li:last-child {
  margin-bottom: 0;
}

.cc-md strong {
  font-weight: 600;
  color: var(--text);
}

.cc-md code {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
}

.cc-md a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.cc-md h1, .cc-md h2, .cc-md h3, .cc-md h4 {
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px 0;
  line-height: 1.3;
}

.cc-md h1 { font-size: 1.25em; }

.cc-md h2 { font-size: 1.15em; }

.cc-md h3 { font-size: 1.05em; }

.cc-md h4 { font-size: 1em; }

.cc-md h1:first-child, .cc-md h2:first-child, .cc-md h3:first-child, .cc-md h4:first-child {
  margin-top: 0;
}

.cc-md pre {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cc-md pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  white-space: pre;
}

.cc-md blockquote {
  border-left: 3px solid var(--accent-muted, rgba(255,255,255,0.15));
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-muted);
  font-style: italic;
}

.cc-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px 0;
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
}

.cc-md th, .cc-md td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.cc-md th {
  font-weight: 600;
  color: var(--text);
}

.cc-md hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 12px 0;
}

.cc-md em {
  font-style: italic;
}

.cc-md--compact {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  color: var(--text-muted);
}

.cc-md--compact p {
  margin: 0 0 6px 0;
}

.cc-md--compact ul, .cc-md--compact ol {
  margin: 4px 0 6px 0;
  padding-left: 14px;
}

.cc-md--compact li {
  margin-bottom: 3px;
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
}

.cc-md--compact strong {
  color: var(--text-secondary);
}

.cc-md--compact code {
  font-size: 0.87em;
}

.cc-detail-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cc-detail-msg {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.cc-detail-msg-from {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cc-detail-msg-text {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-detail-msg-time {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-dim);
  margin-top: 4px;
}

.cc-msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.cc-msg-att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-tertiary, rgba(0,0,0,0.05));
  border-radius: var(--radius-sm);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text);
  text-decoration: none;
  width: fit-content;
}

.cc-msg-att-file a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.cc-msg-att-icon {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  flex-shrink: 0;
}

.cc-msg-att-name {
  word-break: break-all;
}

.cc-email-attachments {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.cc-email-att-header {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cc-email-att-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  color: var(--text);
  text-decoration: none;
}

.cc-email-att-size {
  margin-left: auto;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: var(--text-dim);
  flex-shrink: 0;
}

.cc-detail-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.cc-detail-event-row:last-child {
  border-bottom: none;
}

.cc-detail-event-label {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  font-weight: 600;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.cc-detail-event-value {
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  color: var(--text);
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.cc-detail-footer {
  flex-shrink: 0;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
}

.cc-detail-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 8px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.cc-detail-chips::-webkit-scrollbar { display: none; }

.cc-detail-chips:empty {
  display: none;
  margin-bottom: 0;
}

.cc-detail-andy-bar {
  display: flex;
  gap: 8px;
}

#app.command-mode #input-wrapper,
#app.more-mode #input-wrapper,
#app.finance-mode #input-wrapper,
#app.marketing-mode #input-wrapper {
  display: none !important;
}

@media (min-width: 1024px) {
  /* Phase C: cards stack vertically (no multi-column grid). Mockup section
     4 shows full-width card rows in the feed column. */
  #cc-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 960px;
    margin: 0 auto;
  }

  .cc-feed { padding: 16px 24px 80px; }
}

@media (min-width: 1024px) {
  .tab-bar-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
  }

  .tab-bar-item.active:hover {
    color: var(--accent);
  }

  .cc-snooze-option:hover::after {
    opacity: var(--md-sys-state-hover-opacity);
  }

  .cc-snooze-option {
    padding: 8px 16px;
    min-height: 36px;
  }

  .tab-bar-item {
    min-height: 48px;
    padding: 8px 0 6px;
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 1024px) {
  .tool-launcher-card:hover {
    transform: none;
  }
}

@media (min-width: 1280px) {
  /* Split-pane layout: left pane (topbar + filter + feed + FAB) flexes,
     detail pane is a fixed 520dp column on the right. */
  #app.command-mode #command-view {
    flex-direction: row;
  }

  /* FAB sits inside .cc-pane-left, so the v1.1.3 right-offset fix that
     used to push it past the detail pane is no longer needed. */
  .cc-pane-left { flex: 1; }

  /* Drop the grid centered max-width so cards use the full feed pane. */
  #cc-cards { max-width: none; margin: 0; }

  /* Detail pane: persistent flex item, no slide animation, no shadow.
     Override the mobile bottom-sheet transform so the pane sits where it
     belongs in the row flex. Hide the drag handle on desktop. */
  #cc-detail-view {
    position: relative;
    flex: 0 0 520px;
    width: 520px;
    height: auto;
    max-height: none;
    display: flex !important;
    animation: none !important;
    transform: none !important;
    transition: none;
    box-shadow: none;
    background: var(--md-sys-color-surface-container-low);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  /* Empty state */
  .cc-detail-empty {
    display: none;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    gap: 10px;
    margin: 24px;
    color: var(--md-sys-color-on-surface-variant);
  }
  .cc-detail-empty svg {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.4;
    margin-bottom: 4px;
  }
  .cc-detail-empty-title {
    font-size: var(--md-sys-typescale-body-large-size);
    line-height: var(--md-sys-typescale-body-large-line);
    letter-spacing: var(--md-sys-typescale-body-large-tracking);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
  }
  .cc-detail-empty-sub {
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: var(--md-sys-typescale-body-small-line);
    letter-spacing: var(--md-sys-typescale-body-small-tracking);
    color: var(--md-sys-color-on-surface-variant);
    max-width: 320px;
  }

  /* Toggle empty vs content based on .open */
  #cc-detail-view:not(.open) > .cc-detail-empty {
    display: flex;
  }
  #cc-detail-view:not(.open) > .cc-detail-header,
  #cc-detail-view:not(.open) > .cc-context-strip,
  #cc-detail-view:not(.open) > .cc-detail-body,
  #cc-detail-view:not(.open) > .cc-detail-footer {
    display: none !important;
  }
  #cc-detail-view.open > .cc-detail-empty {
    display: none;
  }

  /* Hide the back button on desktop split-pane (no view to go back to) */
  #cc-detail-view.open .cc-detail-back {
    display: none;
  }
}

.cc-snooze-option.ctx-menu-danger {
  color: var(--error);
}

.cc-snooze-option.ctx-menu-danger::after {
  background: var(--md-sys-color-error);
}

.cc-card.cc-card-keynav {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Phase 1: detail flag chip row ──
   Mirrors Android TeamsThreadFlagsRow. Pill chips above the source detail
   when a card has needsApproval / hasFailure / hasCommitments flags. */
.cc-detail-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 0;
}
.cc-flag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  font-weight: 600;
}
.cc-flag-chip--danger  { background: color-mix(in srgb, var(--cc-flag-danger) 14%, transparent);  color: var(--cc-flag-danger); }
.cc-flag-chip--warning { background: color-mix(in srgb, var(--cc-flag-warning) 14%, transparent); color: var(--cc-flag-warning); }
.cc-flag-chip--caution { background: color-mix(in srgb, var(--cc-flag-caution) 14%, transparent); color: var(--cc-flag-caution); }

/* Phase C: FAB stack anchors inside .cc-pane-left so split-pane layout
   keeps it on the left of the detail pane without a manual right offset.
   The Phase-1 stacked Ask Andy FAB was retired 2026-05-23 (single create
   FAB only). .cc-fab-create defers to .m3-fab--small for sizing/color. */
.cc-fab-stack {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 10;
}

/* ── Phase 1: pull-to-refresh ──
   Anchored indicator at the top of #cc-feed. Hidden by default, slides in
   as the user pulls down. Spinner overlaps the chevron once pull exceeds
   the trigger threshold. */
.cc-ptr-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.cc-ptr-indicator.cc-ptr-active { opacity: 1; }
.cc-ptr-indicator.cc-ptr-ready { color: var(--accent); }
.cc-ptr-indicator svg { width: 22px; height: 22px; transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard); }
.cc-ptr-indicator.cc-ptr-ready svg { transform: rotate(180deg); }
.cc-ptr-indicator.cc-ptr-refreshing svg { animation: ccPtrSpin 0.8s linear infinite; }
@keyframes ccPtrSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Phase 1: swipe-to-dismiss/snooze ──
   Each card row sits in a positioning container that exposes red dismiss
   on the left and amber snooze on the right as the row translates X. */
.cc-card {
  touch-action: pan-y;
  transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-legacy);
}
.cc-card.cc-card-swiping { transition: none; }
.cc-card.cc-card-dismiss-exit { transform: translateX(-100%) !important; opacity: 0; }
.cc-card.cc-card-snooze-exit  { transform: translateX( 100%) !important; opacity: 0; }
.cc-card-swipe-bg {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.cc-card-swipe-bg--dismiss { left: 0;  right: auto; background: linear-gradient(90deg, #ef4444, #ef4444cc); }
.cc-card-swipe-bg--snooze  { right: 0; left: auto;  background: linear-gradient(270deg, #f59e0b, #f59e0bcc); justify-content: flex-end; }
.cc-card-swipe-wrap { position: relative; overflow: hidden; }
.cc-card-swipe-wrap.cc-card-swipe-active .cc-card-swipe-bg { opacity: 1; }

/* v1.4.7 swipe affordance via box-shadow on the card itself.
   No DOM mutation, no shell wrap. The card translates as before; a
   colored bar attaches to the LEADING edge (the side the card is
   moving toward) via box-shadow with a negative/positive X offset.
   Past the commit threshold the bar grows and adds a glow.
   data-swipe-dir is set by _ccBindSwipe during pointermove, cleared
   in finish(). */
.cc-card[data-swipe-dir="dismiss"] {
  /* swipe-left = dismiss. Bar on the LEFT edge (negative x offset)
     where the card is heading. */
  box-shadow: -10px 0 0 0 #dc2626;
}
.cc-card[data-swipe-dir="dismiss"][data-swipe-commit="1"] {
  box-shadow: -16px 0 0 0 #dc2626, 0 0 24px rgba(220, 38, 38, 0.45);
}
.cc-card[data-swipe-dir="snooze"] {
  /* swipe-right = snooze. Bar on the RIGHT edge (positive x offset). */
  box-shadow: 10px 0 0 0 #f59e0b;
}
.cc-card[data-swipe-dir="snooze"][data-swipe-commit="1"] {
  box-shadow: 16px 0 0 0 #f59e0b, 0 0 24px rgba(245, 158, 11, 0.45);
}

/* ── Phase 2: recently-closed undo strip ──
   Sits between the toolbar and the card feed. Holds up to 3 dismissed
   cards with Undo buttons. Auto-clears after 30s. */
.cc-recently-closed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 12px 0;
}
.cc-rc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  color: var(--text-muted);
  animation: ccRcSlideIn 0.2s ease-out;
}
@keyframes ccRcSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cc-rc-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}
.cc-rc-undo {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.cc-rc-undo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--md-sys-color-primary);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
@media (hover: hover) {
  .cc-rc-undo:hover::after { opacity: var(--md-sys-state-hover-opacity); }
}
.cc-rc-undo:active::after { opacity: var(--md-sys-state-pressed-opacity); }
.cc-rc-undo:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Phase 2: inline AskAndy bar above feed ──
   Quick affordance to talk to Andy without opening a specific card.
   Sits below the toolbar, above the recently-closed strip. */
.cc-inline-ask {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 12px 0;
  background: var(--bg-elevated, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
}
.cc-inline-ask-input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  color: var(--text);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  font-family: inherit;
  resize: none;
  min-height: 38px;
  max-height: 100px;
}
.cc-inline-ask-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cc-inline-ask-send {
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 8px);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  font-weight: var(--md-sys-typescale-label-medium-weight);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  cursor: pointer;
  min-height: 38px;
}
.cc-inline-ask-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

