/* "ask claude" kitchen console (console.js). All selectors are .rc-* scoped; colors come from style.css tokens. */
.rc {
  --rc-bg: var(--panel, #0f1511); --rc-bg2: var(--panel2, #131b16); --rc-line: var(--line, #22342a);
  --rc-fg: var(--fg, #c8e6cf); --rc-dim: var(--dim, #6f8f78); --rc-green: var(--green, #53e88b);
  --rc-amber: var(--amber, #ffb547); --rc-cyan: var(--cyan, #5fd7ff); --rc-red: var(--red, #ff6b6b);
  --rc-mag: var(--magenta, #d78cff);
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: min(560px, calc(100vw - 32px)); height: min(700px, calc(100vh - 32px)); height: min(700px, calc(100dvh - 32px));
  display: flex; flex-direction: column; min-width: 0;
  background: var(--rc-bg); color: var(--rc-fg); font: 13px/1.5 var(--mono, ui-monospace, Menlo, monospace);
  border: 1px solid var(--rc-amber); box-shadow: 0 0 0 1px rgba(255,181,71,.15), 0 12px 40px rgba(0,0,0,.6);
}
.rc[hidden] { display: none; }
.rc *, .rc *::before, .rc *::after { box-sizing: border-box; }
.rc button { font: inherit; cursor: pointer; }
.rc-g { color: var(--rc-green); }
.rc-c { color: var(--rc-cyan); }
.rc-dim { color: var(--rc-dim); }

.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--rc-bg2); border-bottom: 1px solid var(--rc-line); flex: none; }
.rc-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-actions { display: flex; gap: 2px; flex: none; }
.rc-x { background: none; border: 0; color: var(--rc-dim); padding: 0 5px; }
.rc-x:hover, .rc-x.on { color: var(--rc-amber); }

.rc-gen { flex: none; max-height: 30%; overflow: auto; padding: 6px 12px; border-bottom: 1px solid var(--rc-line); font-size: 12px; background: #0b100d; }
.rc-gen ul { list-style: none; margin: 4px 0 0; padding: 0; }
.rc-gen li { overflow-wrap: anywhere; }
.rc-gen li button { background: none; border: 0; color: var(--rc-cyan); padding: 1px 0; text-align: left; }
.rc-gen li .rc-del { color: var(--rc-dim); padding: 1px 4px; }
.rc-gen li .rc-del:hover { color: var(--rc-red); }
.rc-sync { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--rc-line); display: grid; gap: 4px; overflow-wrap: anywhere; }
.rc-sync code { color: var(--rc-amber); user-select: all; }
.rc-sync button { background: none; border: 0; color: var(--rc-amber); padding: 0; flex: none; white-space: nowrap; }
.rc-sync button:hover { text-decoration: underline; }
.rc-sync .rc-bad { color: var(--rc-red); opacity: .75; }
.rc-syncin { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rc .rc-syncin input { flex: 1 1 auto; padding: 0 6px; font-size: 12px; border-style: dashed; }

.rc-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 12px; background: #070a08;
  overflow-wrap: anywhere; word-break: break-word; }
.rc-log > * + * { margin-top: 8px; }
.rc-u { color: var(--rc-fg); background: var(--rc-bg2); border-left: 2px solid var(--rc-green); padding: 4px 8px; white-space: pre-wrap; }
.rc-uctx { color: var(--rc-dim); font-size: 11px; margin-top: 2px; white-space: normal; }
.rc-uctx span { color: var(--rc-mag); margin-right: 6px; }
.rc-a { color: var(--rc-fg); }
.rc-a p { margin: 0 0 6px; }
.rc-a ul, .rc-a ol { margin: 0 0 6px; padding-left: 1.4em; }
.rc-a li { margin: 1px 0; }
.rc-a ul { list-style: none; padding-left: 1.2em; }
.rc-a ul li::before { content: "- "; color: var(--rc-dim); margin-left: -1.2em; }
.rc-a b { color: var(--rc-green); font-weight: 600; }
.rc-a code { color: var(--rc-amber); }
.rc-a a { color: var(--rc-cyan); text-decoration: underline dotted; text-underline-offset: 2px; overflow-wrap: anywhere; }
.rc-a a:hover, .rc-a a:focus-visible { color: var(--rc-amber); text-decoration-style: solid; }
.rc-t { color: var(--rc-cyan); opacity: .7; font-size: 12px; }
.rc-log > .rc-t + .rc-t { margin-top: 1px; }
.rc-r { color: var(--rc-mag); }
.rc-r b { color: var(--rc-fg); }
.rc-r button, .rc-e button { background: none; border: 0; color: var(--rc-amber); padding: 0; }
.rc-r button:hover, .rc-e button:hover { text-decoration: underline; }
.rc-r button.rc-q { color: var(--rc-dim); }
.rc-r button.rc-q:hover { color: var(--rc-amber); }
.rc-r button.rc-q:disabled { cursor: progress; text-decoration: none; }
.rc-queued { color: var(--rc-green); }
.rc-e { color: var(--rc-red); }
.rc-note { font-size: 12px; }
.rc-spin::after { content: "█"; margin-left: 4px; animation: rc-blink 1s steps(1) infinite; color: var(--rc-green); }
.rc-cursor > :last-child::after, .rc-cursor:empty::after { content: "█"; animation: rc-blink 1s steps(1) infinite; color: var(--rc-green); }
@keyframes rc-blink { 50% { opacity: 0; } }

.rc-welcome { display: grid; gap: 10px; }
.rc-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-ideas button { background: none; border: 1px dashed var(--rc-line); color: var(--rc-dim); padding: 1px 7px; font-size: 12px; text-align: left; max-width: 100%; }
.rc-ideas button:hover { color: var(--rc-amber); border-color: var(--rc-amber); }

.rc-form { flex: none; display: grid; gap: 7px; padding: 8px 10px 10px; border-top: 1px solid var(--rc-line); min-width: 0; }
.rc input[type=text], .rc textarea {
  width: 100%; min-width: 0; background: var(--rc-bg2); color: var(--rc-fg); border: 1px solid var(--rc-line);
  font: inherit; padding: 5px 8px; border-radius: 2px; }
.rc input:focus, .rc textarea:focus, .rc button:focus-visible { outline: 1px solid var(--rc-green); outline-offset: 1px; }
.rc textarea { resize: vertical; min-height: 44px; max-height: 30vh; display: block; }

.rc-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; min-width: 0; }
.rc-chips { display: contents; }
.rc-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; border: 1px solid var(--rc-cyan); color: var(--rc-cyan); padding: 0 0 0 6px; }
.rc-chip.gen { border-color: var(--rc-mag); color: var(--rc-mag); }
.rc-ct { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; max-width: 22ch; }
.rc-chip button { background: none; border: 0; color: inherit; padding: 0 5px; }
.rc-chip button:hover { color: var(--rc-red); }
.rc-add { background: none; border: 1px dashed var(--rc-line); color: var(--rc-dim); padding: 0 6px; }
.rc-add:hover:not(:disabled) { color: var(--rc-amber); border-color: var(--rc-amber); }
.rc-add:disabled { opacity: .4; cursor: default; }
.rc-look { position: relative; flex: 1 1 9em; min-width: 8em; }
.rc .rc-look input { padding: 0 6px; font-size: 12px; border-style: dashed; }
.rc-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 2px); z-index: 2; list-style: none; margin: 0; padding: 3px 0;
  background: var(--rc-bg2); border: 1px solid var(--rc-amber); max-height: 220px; overflow-y: auto; min-width: min(20em, 80vw); }
.rc-menu li { padding: 2px 8px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-menu li.sel, .rc-menu li[data-i]:hover { background: var(--rc-green); color: var(--bg, #0a0e0b); }
.rc-menu li.sel .rc-dim, .rc-menu li[data-i]:hover .rc-dim { color: inherit; }
.rc-menu li.none { cursor: default; }

.rc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rc-line); font-size: 12px; max-width: 100%; }
.rc-seg button { background: transparent; color: var(--rc-dim); border: 0; padding: 2px 8px; }
.rc-seg button + button { border-left: 1px solid var(--rc-line); }
.rc-seg button.on { color: var(--bg, #0a0e0b); background: var(--rc-green); }
.rc-chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 12px; }
.rc-chk input { accent-color: var(--rc-green); margin: 0; }

.rc-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.rc-go { background: transparent; color: var(--rc-amber); border: 1px solid var(--rc-amber); padding: 6px 12px; white-space: nowrap; }
.rc-go:hover { background: var(--rc-amber); color: var(--bg, #0a0e0b); }
.rc-go.busy { color: var(--rc-red); border-color: var(--rc-red); }
.rc-go.busy:hover { background: var(--rc-red); color: var(--bg, #0a0e0b); }
.rc.offline .rc-go { opacity: .45; }

@media (max-width: 700px) {
  .rc { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100vw; height: 88vh; height: 88dvh;
    border-left: 0; border-right: 0; border-bottom: 0; }
  .rc-log { padding: 8px 10px; }
  .rc-form { padding: 7px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .rc textarea, .rc input[type=text] { font-size: 16px; } /* no iOS focus zoom */
  .rc .rc-look input, .rc .rc-syncin input { font-size: 16px; }
  .rc-seg button { padding: 2px 6px; }
}
@media print { #console-root { display: none !important; } }
