/* Claude Code client view styles — scoped to body.claude-mode */

/* ── Terminal output override ── */
body.claude-mode .terminal-output,
body.codex-mode .terminal-output {
  white-space: normal;
  word-break: break-word;
  padding: 10px 14px;
}


/* ── Scrollable container for wide content (code/diff/tool-result) ── */
.cc-scrollable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.cc-scrollable::-webkit-scrollbar { height: 4px; }
.cc-scrollable::-webkit-scrollbar-track { background: transparent; }
.cc-scrollable::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* ────────────────────────────────────── */
/* Prompt block                           */
/* ────────────────────────────────────── */
body.claude-mode .cc-prompt,
body.codex-mode .cc-prompt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px 6px;
  margin: 4px -14px 0;
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  flex-wrap: wrap;
}



body.claude-mode .cc-prompt-marker,
body.codex-mode .cc-prompt-marker {
  color: var(--green);
  font-weight: 700;
  font-size: 1.05em;
  flex-shrink: 0;
}

body.claude-mode .cc-prompt-text,
body.codex-mode .cc-prompt-text {
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

body.claude-mode .cc-prompt-cont,
body.codex-mode .cc-prompt-cont {
  width: 100%;
  padding-left: 1.8em;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ────────────────────────────────────── */
/* Tool-use block                         */
/* ────────────────────────────────────── */
body.claude-mode .cc-tool-use,
body.codex-mode .cc-tool-use {
  margin: 3px 0;
}

body.claude-mode .cc-tool-header,
body.codex-mode .cc-tool-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  overflow: hidden;
}

body.claude-mode .cc-tool-icon,
body.codex-mode .cc-tool-icon {
  color: var(--blue);
  flex-shrink: 0;
}

body.claude-mode .cc-tool-name,
body.codex-mode .cc-tool-name {
  color: var(--blue);
  font-weight: 600;
  flex-shrink: 0;
}

body.claude-mode .cc-tool-args,
body.codex-mode .cc-tool-args {
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

body.claude-mode .cc-tool-body,
body.codex-mode .cc-tool-body {
  padding-left: 1.5em;
  margin-top: 1px;
}

body.claude-mode .cc-tool-body .cc-line,
body.codex-mode .cc-tool-body .cc-line {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* ────────────────────────────────────── */
/* Tool-result block                      */
/* ────────────────────────────────────── */
body.claude-mode .cc-tool-result,
body.codex-mode .cc-tool-result {
  border-left: 2px solid var(--blue);
  margin: 4px 0;
  padding-left: 8px;
  opacity: 0.85;
}

body.claude-mode .cc-tool-result .cc-scrollable pre,
body.codex-mode .cc-tool-result .cc-scrollable pre {
  margin: 0;
  padding: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
  font-size: 0.88em;
  line-height: 1.5;
}

/* ────────────────────────────────────── */
/* Thinking block                         */
/* ────────────────────────────────────── */
body.claude-mode .cc-thinking,
body.codex-mode .cc-thinking {
  color: var(--purple);
  font-style: italic;
  opacity: 0.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 2px 0;
  font-size: 0.9em;
}

/* ────────────────────────────────────── */
/* Response / Text blocks                 */
/* ────────────────────────────────────── */
body.claude-mode .cc-response .cc-line,
body.claude-mode .cc-text .cc-line,
body.codex-mode .cc-response .cc-line,
body.codex-mode .cc-text .cc-line {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

/* ────────────────────────────────────── */
/* Code block                             */
/* ────────────────────────────────────── */
body.claude-mode .cc-code,
body.codex-mode .cc-code {
  margin: 6px 0;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

body.claude-mode .cc-code-content,
body.codex-mode .cc-code-content {
  margin: 0;
  padding: 10px 14px;
  white-space: pre;
  word-break: normal;
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--text-primary);
}

/* ────────────────────────────────────── */
/* Table block                            */
/* ────────────────────────────────────── */
body.claude-mode .cc-table-wrap,
body.codex-mode .cc-table-wrap {
  margin: 6px 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

body.claude-mode .cc-table,
body.codex-mode .cc-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.82em;
  line-height: 1.45;
}

body.claude-mode .cc-table th,
body.claude-mode .cc-table td,
body.codex-mode .cc-table th,
body.codex-mode .cc-table td {
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  text-align: left;
}

body.claude-mode .cc-table thead th,
body.codex-mode .cc-table thead th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

body.claude-mode .cc-table tbody td,
body.codex-mode .cc-table tbody td {
  color: var(--text-secondary);
  background: var(--bg-primary);
}

body.claude-mode .cc-table tbody tr:nth-child(even) td,
body.codex-mode .cc-table tbody tr:nth-child(even) td {
  background: var(--bg-tertiary);
}

/* ────────────────────────────────────── */
/* Diff block                             */
/* ────────────────────────────────────── */
body.claude-mode .cc-diff,
body.codex-mode .cc-diff {
  margin: 4px 0;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

body.claude-mode .cc-diff-content,
body.codex-mode .cc-diff-content {
  padding: 6px 10px;
  font-size: 0.88em;
  line-height: 1.5;
}

body.claude-mode .cc-diff-line,
body.codex-mode .cc-diff-line {
  display: block;
  white-space: pre;
  word-break: normal;
}

body.claude-mode .cc-diff-line.cc-added,
body.codex-mode .cc-diff-line.cc-added {
  color: var(--green);
  background: rgba(52, 211, 153, 0.18);
}

body.claude-mode .cc-diff-line.cc-removed,
body.codex-mode .cc-diff-line.cc-removed {
  color: var(--red);
  background: rgba(248, 113, 113, 0.18);
}

body.claude-mode .cc-diff-line.cc-hunk,
body.codex-mode .cc-diff-line.cc-hunk {
  color: var(--cyan);
  opacity: 0.75;
}

/* ────────────────────────────────────── */
/* Selection options                      */
/* ────────────────────────────────────── */
body.claude-mode .cc-selection-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

body.claude-mode .cc-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  text-align: left;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

body.claude-mode .cc-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

body.claude-mode .cc-option:active {
  background: var(--accent-soft);
  transform: scale(0.99);
}

body.claude-mode .cc-option-index {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85em;
  min-width: 1.4em;
  flex-shrink: 0;
}

body.claude-mode .cc-option-label {
  flex: 1;
}

/* ────────────────────────────────────── */
/* Empty spacer                           */
/* ────────────────────────────────────── */
body.claude-mode .cc-empty,
body.codex-mode .cc-empty {
  height: 0.5em;
}

/* ────────────────────────────────────── */
/* Status bar                             */
/* ────────────────────────────────────── */
.cc-status-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-secondary);
  z-index: 10;
  font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
}

.cc-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.72em;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition-fast);
}
.cc-mode-pill:active { opacity: 0.7; }

.cc-mode-plan   { background: rgba(251, 191, 36, 0.18); color: var(--yellow); }
.cc-mode-ask    { background: rgba(52, 211, 153, 0.18); color: var(--green); }
.cc-mode-bypass { background: rgba(248, 113, 113, 0.18); color: var(--red); }
.cc-mode-accept { background: rgba(96, 165, 250, 0.18); color: var(--blue); }

.cc-status-model {
  color: var(--accent);
  font-weight: 600;
}

.cc-status-branch {
  color: var(--text-dimmed);
}

.cc-context-bar {
  flex: 1;
  max-width: 80px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.cc-context-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.cc-context-fill.cc-ctx-mid { background: var(--yellow); }
.cc-context-fill.cc-ctx-low { background: var(--red); }

.cc-status-stats {
  color: var(--text-dimmed);
  margin-left: auto;
}

/* ────────────────────────────────────── */
/* Action bar (Claude keyboard row)       */
/* ────────────────────────────────────── */
.cc-action-bar {
  display: flex;
  gap: 5px;
  padding: 4px 0 0;
}

.cc-action-btn {
  flex: 1;
  height: 36px;
  border: 1px solid var(--key-border);
  border-bottom: 2px solid var(--key-depth);
  border-radius: var(--radius-xs);
  background: var(--key-bg);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 4px;
  -webkit-user-select: none;
  user-select: none;
  transition: background var(--transition-fast), transform 80ms;
}

.cc-action-btn:active {
  background: var(--key-active-bg);
  border-bottom-width: 1px;
  transform: translateY(1px);
}

.cc-action-icon { font-size: 0.9em; line-height: 1; }
.cc-action-label { font-size: 0.6rem; color: var(--text-dimmed); line-height: 1; }

.cc-action-stop .cc-action-icon { color: var(--red); }

/* Landscape adjustment */
@media (max-height: 500px) {
  .cc-action-btn { height: 30px; }
}

/* ────────────────────────────────────── */
/* Copy button                            */
/* ────────────────────────────────────── */
.cc-copy-wrap { position: relative; }
.cc-copy-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
  border-radius: 4px;
  background: var(--bg-secondary, #1a1a2e);
  color: var(--text-dimmed, #888);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  line-height: 1;
}
.cc-copy-btn:hover { background: var(--bg-tertiary, #252540); }
.cc-copy-btn.copied { color: var(--green, #98c379); }
@media (hover: hover) {
  .cc-copy-wrap:hover .cc-copy-btn { opacity: 1; }
}
@media (hover: none) {
  .cc-copy-btn { opacity: 0.6; }
}

/* ────────────────────────────────────── */
/* Collapsible tool results               */
/* ────────────────────────────────────── */
.cc-tool-result.cc-collapsible .cc-scrollable {
  max-height: 12em;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.cc-tool-result.cc-collapsible.cc-expanded .cc-scrollable {
  max-height: none;
}
.cc-collapse-toggle {
  display: block;
  width: 100%;
  padding: 4px 8px;
  border: none;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
  border-radius: 0 0 6px 6px;
  background: var(--bg-tertiary, #1a1a2e);
  color: var(--text-dimmed, #888);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s, background 0.15s;
}
.cc-collapse-toggle:hover {
  color: var(--text-secondary, #ccc);
  background: var(--bg-secondary, #252540);
}

/* ────────────────────────────────────── */
/* Collapsible tool-use body              */
/* ────────────────────────────────────── */
.cc-tool-use.cc-collapsible .cc-tool-body {
  max-height: 7.5em;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.cc-tool-use.cc-collapsible.cc-expanded .cc-tool-body {
  max-height: none;
}

/* ────────────────────────────────────── */
/* Thinking block pulse animation         */
/* ────────────────────────────────────── */
body.claude-mode .cc-thinking,
body.codex-mode .cc-thinking {
  animation: cc-thinking-pulse 2s ease-in-out infinite;
}
@keyframes cc-thinking-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* ────────────────────────────────────── */
/* Prompt turn boundaries                 */
/* ────────────────────────────────────── */
body.claude-mode .cc-prompt ~ .cc-prompt,
body.codex-mode .cc-prompt ~ .cc-prompt {
  margin-top: 16px;
  padding-top: 10px;
}

/* ────────────────────────────────────── */
/* Selection option UX                    */
/* ────────────────────────────────────── */
body.claude-mode .cc-option.cc-option-focused {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cc-option-hint {
  margin-left: auto;
  font-size: 0.72em;
  color: var(--text-dimmed);
  flex-shrink: 0;
}

