:root {
  --bg: #0a0a0a; --panel: #111; --panel2: #1a1a1a; --border: #222;
  --border-strong: #3a3a3a;
  --text: #ddd; --muted: #888;
  --accent: #a04040; --accent-hover: #b85050;  /* matches main app dark theme */
  --danger: #f55;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { background: var(--bg); color: var(--text);
       font-family: -apple-system, "PingFang SC", sans-serif; font-size: 14px;
       -webkit-tap-highlight-color: transparent;
       /* Real viewport height: JS sets --app-vh from window.innerHeight (most
          reliable in PWA standalone mode where vh/dvh/svh report inconsistently
          across iOS Safari, Android Chrome, Samsung Internet, etc). Fallback
          chain ends in 100dvh for the few seconds before cc.js runs. */
       height: 100vh;
       height: 100dvh;
       height: var(--app-vh, 100dvh);
       padding-top: env(safe-area-inset-top);
       padding-bottom: env(safe-area-inset-bottom);
       overflow: hidden; }

#cc-root { display: grid;
  grid-template-columns: 240px 1fr 320px;
  grid-template-rows: minmax(0, 1fr);  /* constrain row so flex children shrink */
  height: 100%; }  /* fills body's content box (after safe-area padding) */
#cc-root.files-collapsed { grid-template-columns: 240px 1fr 0; }

aside, main { border-right: 1px solid var(--border); overflow: hidden; }
aside:last-child { border-right: none; }
aside header, #cc-conv-header { padding: 10px 12px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

#cc-workspaces { display: flex; flex-direction: column; }
#cc-ws-search, #cc-file-search {
  margin: 6px; padding: 6px 10px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
  font-family: inherit;
}
#cc-ws-search:focus, #cc-file-search:focus {
  outline: none; border-color: var(--accent);
}
#cc-ws-search::placeholder, #cc-file-search::placeholder { color: var(--muted); }
#cc-file-search { font-family: monospace; font-size: 12px; }
#cc-workspaces ul { list-style: none; padding: 6px; flex: 1; overflow-y: auto; min-height: 0; }
#cc-workspaces li { display: flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 6px; color: var(--text); margin-bottom: 2px; }
#cc-workspaces li:hover { background: var(--panel2); }
#cc-workspaces li.active { background: var(--panel2); color: #fff; }
#cc-workspaces li.system { font-weight: 600; }
#cc-workspaces li .cc-ws-body { flex: 1; min-width: 0; cursor: pointer; padding: 4px 6px; }
#cc-workspaces li .meta { font-size: 11px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cc-workspaces li .cc-ws-del { background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px 6px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.5; transition: opacity 0.15s, color 0.15s, background 0.15s; }
#cc-workspaces li .cc-ws-del svg { display: block; }
#cc-workspaces li:hover .cc-ws-del { opacity: 1; }
#cc-workspaces li .cc-ws-del:hover { color: var(--danger); background: var(--panel); }
#cc-recycle-btn { margin: 6px; background: var(--panel); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px;
  cursor: pointer; font-size: 12px; text-align: left; }
#cc-recycle-btn:hover { color: var(--text); border-color: var(--text); }

#cc-recycle-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 40; display: none; align-items: center; justify-content: center; padding: 20px; }
#cc-recycle-modal.show { display: flex; }
.cc-modal-panel { background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; width: 100%; max-width: 520px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden; }
.cc-modal-panel > header { padding: 12px 16px; background: var(--panel);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  color: var(--text); text-transform: none; letter-spacing: 0; font-size: 14px; }
.cc-modal-panel > header span { flex: 1; }
.cc-modal-panel > header button { background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 16px; padding: 4px 8px; }
.cc-modal-note { padding: 12px 16px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border); }
#cc-recycle-body { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.cc-recycle-empty { padding: 24px; text-align: center; color: var(--muted); }
.cc-recycle-row { display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 6px; }
.cc-recycle-row:hover { background: var(--panel2); }
.cc-recycle-info { flex: 1; min-width: 0; }
.cc-recycle-name { color: var(--text); font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cc-recycle-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cc-recycle-restore { background: var(--accent); color: #fff; border: none;
  border-radius: 4px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.cc-recycle-restore:hover { background: var(--accent-hover); }
#cc-new-ws { margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }
#cc-upload-btn { margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); padding: 4px 10px; border-radius: 4px; cursor: pointer;
  font-size: 11px; letter-spacing: 1px; }
#cc-upload-btn:hover { color: var(--text); border-color: var(--text); }

#cc-conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#cc-conv-header { gap: 12px; }
#cc-conv-title { flex: 1; color: var(--text); text-transform: none; font-size: 14px; letter-spacing: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Model picker — compact button + popover. Was a native <select> until
   the header got too crowded on mobile; now occupies the same footprint
   as the other icon buttons but opens a custom menu on click. */
#cc-model-wrap { position: relative; }
#cc-model-btn { background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); padding: 4px 8px; border-radius: 4px;
  cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 140px; }
#cc-model-btn:hover { border-color: var(--text); }
#cc-model-btn svg { flex-shrink: 0; opacity: 0.7; }
#cc-model-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
#cc-model-popover { position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 140px; padding: 4px; z-index: 40;
  display: flex; flex-direction: column; gap: 1px; }
#cc-model-popover[hidden] { display: none; }
#cc-model-popover [data-model] {
  background: none; border: none; color: var(--text);
  text-align: left; padding: 8px 12px; border-radius: 4px;
  font-size: 13px; cursor: pointer; white-space: nowrap; }
#cc-model-popover [data-model]:hover { background: var(--panel2); }
#cc-model-popover [data-model].active { color: var(--accent); }
#cc-model-popover [data-model].active::before {
  content: "● "; font-size: 9px; opacity: 0.8; }
/* Single-row meter strip pinned above the input bar:
   [CTX | bar | %]   [5h | bar | %]   [7d | bar | %]
   CTX  = context window (per-workspace, updated from CC stream)
   5h   = Max 5-hour rolling usage  (account-level, polled from Anthropic)
   7d   = Max 7-day usage           (same poll)
   Each segment gets .warn (>=70%) / .danger (>=90%) on the row class. */
#cc-meters { display: flex; flex-direction: row; gap: 16px;
  padding: 4px 12px; font-size: 11px; color: var(--muted);
  background: var(--panel); border-top: 1px solid var(--border); }
.cc-meter-row { flex: 1 1 0; display: flex; align-items: center; gap: 6px;
  min-width: 0; }
.cc-meter-label { flex: 0 0 auto; text-transform: uppercase;
  letter-spacing: 0.5px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.cc-meter-bar { flex: 1 1 auto; min-width: 20px; height: 4px;
  background: var(--panel2); border-radius: 2px; overflow: hidden; }
.cc-meter-fill { height: 100%; width: 0; background: var(--accent);
  transition: width 0.3s, background 0.3s; }
.cc-meter-text { flex: 0 0 auto; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.cc-meter-row.warn .cc-meter-fill { background: #d4a000; }
.cc-meter-row.danger .cc-meter-fill { background: var(--danger); }
.cc-meter-row.warn .cc-meter-text { color: #d4a000; }
.cc-meter-row.danger .cc-meter-text { color: var(--danger); }

#cc-new-session,
#cc-toggle-files, #cc-toggle-ws, #cc-back { background: none; border: 1px solid var(--border);
  color: var(--muted); padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 14px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; }
#cc-back:hover,
#cc-new-session:hover, #cc-toggle-files:hover,
#cc-toggle-ws:hover { color: var(--text); border-color: var(--text); }
#cc-toggle-ws { display: none; }  /* desktop hides hamburger; mobile breakpoint shows it */

#cc-messages { flex: 1 1 0; overflow-y: auto; padding: 16px; min-width: 0; min-height: 0;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cc-msg { margin-bottom: 12px; word-wrap: break-word; }
.cc-msg.user { background: var(--panel2); padding: 10px 12px; border-radius: 8px;
  white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--border-strong); }
.cc-msg.assistant { line-height: 1.6; position: relative; }
.cc-msg.assistant.streaming { white-space: pre-wrap; }  /* preserve newlines mid-stream */

/* Per-bubble footer row: [timestamp] [copy button]. Appended to every
   user + assistant text bubble. Dim-but-visible by default so the user
   doesn't have to guess whether there's a copy affordance. */
.cc-msg-footer { display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; margin-top: 6px;
  opacity: 0.75; transition: opacity 0.15s; }
.cc-msg.assistant:hover .cc-msg-footer,
.cc-msg.user:hover .cc-msg-footer { opacity: 0.95; }
.cc-msg-time { font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: 0.3px;
  user-select: none; }
.cc-msg-copy {
  background: none; border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; padding: 3px 5px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; transition: color 0.15s, background 0.15s, border-color 0.15s; }
#cc-new-session svg, #cc-toggle-files svg, .cc-msg-copy svg { display: block; }
.cc-msg-copy:hover { color: var(--text); background: var(--panel2);
  border-color: var(--text); }
.cc-msg-copy.copied { color: #6c6; border-color: #6c6; }

/* Markdown elements inside assistant bubbles. Compact spacing — these blocks
   live inside chat, not a full document. */
.cc-msg.assistant h1, .cc-msg.assistant h2, .cc-msg.assistant h3,
.cc-msg.assistant h4, .cc-msg.assistant h5, .cc-msg.assistant h6 {
  margin: 14px 0 6px; line-height: 1.3; font-weight: 700; color: #fff;
}
.cc-msg.assistant h1 { font-size: 18px; }
.cc-msg.assistant h2 { font-size: 16px; }
.cc-msg.assistant h3 { font-size: 15px; }
.cc-msg.assistant h4, .cc-msg.assistant h5, .cc-msg.assistant h6 { font-size: 14px; }
.cc-msg.assistant p { margin: 6px 0; }
.cc-msg.assistant ul, .cc-msg.assistant ol { margin: 6px 0; padding-left: 22px; }
.cc-msg.assistant li { margin: 2px 0; }
.cc-msg.assistant li > p { margin: 0; }
.cc-msg.assistant strong { color: #fff; font-weight: 700; }
.cc-msg.assistant em { color: var(--text); }
.cc-msg.assistant code { background: var(--panel2); color: #f8c; padding: 1px 5px;
  border-radius: 3px; font-size: 12.5px; font-family: monospace; }
.cc-msg.assistant pre { background: #0c0c0c; border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; margin: 8px 0; overflow-x: auto; }
.cc-msg.assistant pre code { background: transparent; color: inherit; padding: 0;
  font-size: 12px; }
.cc-msg.assistant blockquote { border-left: 3px solid var(--border);
  padding: 2px 10px; margin: 6px 0; color: var(--muted); }
.cc-msg.assistant a { color: var(--accent); text-decoration: none; }
.cc-msg.assistant a:hover { text-decoration: underline; }
.cc-msg.assistant hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.cc-msg.assistant table { border-collapse: collapse; margin: 8px 0; font-size: 13px;
  display: block; overflow-x: auto; max-width: 100%; }
.cc-msg.assistant th, .cc-msg.assistant td {
  border: 1px solid var(--border); padding: 6px 10px; text-align: left;
}
.cc-msg.assistant th { background: var(--panel); color: #fff; font-weight: 700; }
.cc-msg.tool_use { background: #0d2818; padding: 8px 10px; border-radius: 4px;
  border-left: 2px solid var(--accent); font-family: monospace; font-size: 12px;
  margin-bottom: 6px; overflow-x: auto; }
.cc-msg.tool_result { font-family: monospace; font-size: 12px; color: var(--muted);
  padding: 8px 10px; border-left: 2px solid var(--border); margin-bottom: 6px;
  overflow-x: auto; white-space: pre-wrap; }
.cc-msg.error { color: var(--danger); padding: 8px 12px; border: 1px solid var(--danger);
  border-radius: 4px; }

#cc-input-bar { border-top: 1px solid var(--border); padding: 10px;
  display: flex; gap: 8px; align-items: flex-end; }
/* safe-area-inset-bottom is now handled at <body>, not duplicated here */
#cc-attach-btn { background: var(--panel2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 12px;
  cursor: pointer; font-size: 18px; }
#cc-attach-btn:hover { color: var(--text); border-color: var(--text); }
#cc-input { flex: 1; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px; resize: none; font-size: 16px; }
#cc-send { background: var(--accent); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, opacity 0.2s; }
#cc-send:hover:not(:disabled) { background: var(--accent-hover); }
#cc-send:disabled { opacity: 0.4; cursor: not-allowed; }
/* Running state: gray; click to stop the current turn (handled in JS). */
#cc-send.aborting { background: var(--muted); }
#cc-send.aborting:hover { background: #aaa; }

#cc-files.collapsed { display: none; }

/* Drop-zone highlight: applied to #cc-files when a file is dragged over
   anywhere inside the FILES panel (header, search, tree, preview, blank
   space). pointer-events on children stay normal — we just paint a
   border + an overlay hint via ::after. */
/* Flex column so `#cc-file-tree` below gets a bounded height — without it,
   `overflow-y: auto` has nothing to scroll inside, content overflows the
   aside, and the outer `aside { overflow: hidden }` silently clips it.
   Desktop mouse-wheel reports "no scroll target" in that state. */
#cc-files { position: relative; display: flex; flex-direction: column; }
#cc-files.dragover { outline: 2px dashed var(--accent); outline-offset: -8px; }
#cc-files.dragover::after {
  content: "拖入即上传到当前目录";
  position: absolute; inset: 8px; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); color: var(--text);
  font-size: 13px; border-radius: 4px;
}
#cc-file-tree { padding: 8px; font-family: monospace; font-size: 12px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* `flex: 1` so the tree fills the aside; `min-height: 0` so flex can
     actually shrink below the children's intrinsic height (required for
     overflow-y to engage inside a flex column). */
  flex: 1 1 auto; min-height: 0; }
.cc-file { padding: 6px 8px; cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-file:hover { background: var(--panel2); }
.cc-file.changed::after { content: " ●"; color: var(--accent); flex: 0 0 auto; }
.cc-file-name { flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-file-dl, .cc-file-del { flex: 0 0 auto; display: inline-flex;
  align-items: center; justify-content: center; padding: 3px 5px;
  border-radius: 4px; color: var(--muted); text-decoration: none;
  background: none; border: none; cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s; }
.cc-file-dl svg, .cc-file-del svg { display: block; }
.cc-file:hover .cc-file-dl, .cc-file:hover .cc-file-del { opacity: 0.7; }
.cc-file-dl:hover { opacity: 1; color: var(--text); background: var(--panel); }
.cc-file-del:hover { opacity: 1; color: var(--danger); background: var(--panel); }
.cc-file-empty { padding: 12px 8px; color: var(--muted); font-style: italic; text-align: center; }
.cc-file-crumb { padding: 4px 8px 8px; color: var(--muted); font-size: 11px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px;
  word-break: break-all; }
.cc-crumb-seg { cursor: pointer; }
.cc-crumb-seg:hover { color: var(--text); text-decoration: underline; }
#cc-file-preview { padding: 8px; overflow: auto; max-height: 60vh; }

#cc-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 20;
  display: none; }
#cc-mask.show { display: block; }

/* Toast — anchored to the top-right corner of the viewport. Two levels:
   .warn (yellow, context nearing window limit) and .danger (red, usage
   quota hit). Auto-dismiss after a few seconds OR click ✕. */
#cc-toast {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  max-width: 380px; min-width: 240px;
  padding: 10px 12px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; line-height: 1.4;
  display: flex; align-items: flex-start; gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
#cc-toast:not(.hidden) { transform: translateY(0); opacity: 1; pointer-events: auto; }
#cc-toast.warn { border-color: #d4a000; }
#cc-toast.warn .cc-toast-icon::before { content: "⚠"; color: #d4a000; }
#cc-toast.danger { border-color: var(--danger); }
#cc-toast.danger .cc-toast-icon::before { content: "⛔"; color: var(--danger); }
.cc-toast-icon { flex: 0 0 auto; font-size: 16px; line-height: 1; }
.cc-toast-body { flex: 1 1 auto; word-break: break-word; }
.cc-toast-close {
  flex: 0 0 auto; background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1;
}
.cc-toast-close:hover { color: var(--text); }

@media (max-width: 768px) {
  #cc-toast { left: 12px; right: 12px; max-width: none; top: 12px; }
}

/* Mobile breakpoint — folding drawer pattern */
@media (max-width: 768px) {
  #cc-root { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  #cc-root.files-collapsed { grid-template-columns: 1fr; }

  #cc-toggle-ws { display: inline-block; }

  /* Workspaces drawer — slides in from left */
  #cc-workspaces {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 80vw; max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.22s ease-out;
    z-index: 30; background: var(--bg);
    border-right: 1px solid var(--border);
  }
  #cc-workspaces.open { transform: translateX(0); }

  /* Files drawer — slides in from right */
  #cc-files {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 85vw; max-width: 360px;
    transform: translateX(100%);
    transition: transform 0.22s ease-out;
    z-index: 30; background: var(--bg);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
  }
  #cc-files.collapsed { display: flex; }  /* override desktop hide */
  #cc-files.open { transform: translateX(0); }

  /* Conversation always takes full width on mobile */
  #cc-conversation { grid-column: 1; min-height: 0; }

  /* Touch-friendly sizing */
  #cc-conv-header { padding: 12px; gap: 8px; }
  #cc-toggle-ws, #cc-toggle-files, #cc-new-ws, #cc-back, #cc-new-session {
    min-width: 38px; min-height: 38px; padding: 6px 10px; font-size: 16px;
  }
  #cc-model-btn { min-height: 38px; padding: 6px 10px; font-size: 13px;
    max-width: 110px; }
  /* Phone screens don't have room for back arrow + hamburger + title +
     model + new-session + toggle-files all on one row. Hide the back link —
     the OS-back gesture covers "leave /cc.html" and the workspace drawer
     covers intra-app navigation. */
  #cc-back { display: none; }
  /* Mobile: no hover state — footer stays at the same visible opacity. */
  .cc-msg-footer { opacity: 0.8; }
  .cc-msg-copy { min-height: 32px; padding: 6px 10px; }
  /* Mobile: keep the bar but smaller padding/text. */
  #cc-meters { padding: 3px 10px; font-size: 10px; gap: 8px; }
  .cc-meter-row { gap: 4px; }
  .cc-meter-bar { min-width: 12px; }
  #cc-upload-btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
  #cc-workspaces li .cc-ws-body { padding: 8px; min-height: 44px; }
  #cc-workspaces li .cc-ws-del { opacity: 1; min-width: 44px; min-height: 44px; font-size: 18px; }
  #cc-ws-search, #cc-file-search { font-size: 16px; min-height: 38px; }
  #cc-input { font-size: 16px; min-height: 44px; }
  #cc-send { width: 44px; height: 44px; }
  #cc-attach-btn { min-width: 44px; min-height: 44px; font-size: 20px; }
  .cc-file { padding: 10px 8px; }
  /* Mobile: no hover, keep download/delete buttons visible (dim) + bigger tap target. */
  .cc-file-dl, .cc-file-del {
    opacity: 0.6; padding: 6px 8px; min-width: 32px; min-height: 32px;
  }
  #cc-messages { padding: 12px; }
}

/* Code-block copy button (per-block, in addition to bubble-level copy in footer) */
.cc-code-wrapper {
  position: relative;
  margin: 8px 0;
}
.cc-code-wrapper pre {
  margin: 0;
}
.cc-code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 1;
}
.cc-code-wrapper:hover .cc-code-copy { opacity: 1; }
.cc-code-copy:hover { background: var(--accent); color: white; border-color: var(--accent); }

@media (hover: none) {
  /* Mobile (no hover): keep copy button visible (dim) + bigger tap target */
  .cc-code-copy {
    opacity: 0.6;
    padding: 6px 10px;
    min-height: 28px;
  }
}
