/* Murphy Command Center — integrated operator shell (Workspace 01).
   Reuses design tokens from murphy-shell.css; no new brand colours. */

.murphy-main { width: 100%; max-width: none; padding: 0; }

.cc-banner {
  margin: .75rem clamp(.75rem, 2vw, 1.5rem) 0;
  padding: .55rem .9rem;
  border: 1px solid var(--murphy-warning);
  border-radius: 8px;
  background: rgb(227 179 65 / 8%);
  color: var(--murphy-text);
  font-size: .8rem;
}

.cc-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr) 19rem;
  gap: .75rem;
  padding: .75rem clamp(.75rem, 2vw, 1.5rem);
  min-height: calc(100vh - 4rem - 2.6rem - 8rem);
  position: relative;
}

.cc-panel {
  background: var(--murphy-panel);
  border: 1px solid var(--murphy-border);
  border-radius: var(--murphy-radius);
  padding: .7rem .8rem;
  margin-bottom: .75rem;
}
.cc-panel__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.cc-panel__head h2, .cc-sub h3 { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--murphy-muted); }

.cc-chip {
  font: 600 .62rem/1 var(--murphy-mono);
  padding: .28rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--murphy-border);
  color: var(--murphy-muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-chip--ok { color: var(--murphy-accent); border-color: rgb(0 212 170 / 45%); }
.cc-chip--gated { color: var(--murphy-warning); border-color: rgb(227 179 65 / 55%); }
.cc-chip--bad { color: var(--murphy-danger); border-color: rgb(248 81 73 / 55%); }
.cc-chip--live { color: var(--murphy-info); border-color: rgb(88 166 255 / 55%); }

.cc-mini {
  font: 600 .7rem/1 var(--murphy-sans);
  padding: .35rem .6rem;
  border-radius: 7px;
  border: 1px solid var(--murphy-border);
  background: var(--murphy-panel-raised);
  color: var(--murphy-text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.cc-mini:hover { border-color: var(--murphy-accent); }
.cc-mini--link { margin-top: .5rem; }

/* Left rail */
.cc-rail { min-width: 0; }
.cc-ws { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; max-height: 44vh; overflow: auto; }
.cc-ws__item {
  display: grid; grid-template-columns: 1.5rem 1fr auto; gap: .35rem; align-items: center;
  padding: .32rem .4rem; border-radius: 6px; cursor: pointer; font-size: .76rem;
}
.cc-ws__item:hover, .cc-ws__item:focus { background: var(--murphy-panel-raised); outline: none; }
.cc-ws__item.is-active { background: rgb(0 212 170 / 10%); }
.cc-ws__num { font-family: var(--murphy-mono); color: var(--murphy-muted); font-size: .68rem; }
.cc-ws__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-status { font: 700 .55rem/1 var(--murphy-mono); padding: .22rem .35rem; border-radius: 4px; letter-spacing: .02em; }
.cc-status--verified_live { background: rgb(0 212 170 / 18%); color: var(--murphy-accent); }
.cc-status--verified_working_not_live { background: rgb(88 166 255 / 18%); color: var(--murphy-info); }
.cc-status--partial { background: rgb(227 179 65 / 18%); color: var(--murphy-warning); }
.cc-status--broken, .cc-status--blocked { background: rgb(248 81 73 / 18%); color: var(--murphy-danger); }
.cc-status--legacy, .cc-status--duplicate, .cc-status--hold { background: rgb(139 148 158 / 18%); color: var(--murphy-muted); }
.cc-status--candidate, .cc-status--target { background: rgb(139 148 158 / 10%); color: var(--murphy-muted); border: 1px dashed var(--murphy-border); }

.cc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .76rem; }
.cc-list li { padding: .3rem .4rem; border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-list li:hover { background: var(--murphy-panel-raised); }
.cc-list li.is-active { background: rgb(0 212 170 / 10%); }
.cc-list--files li small { display: block; color: var(--murphy-muted); font-size: .65rem; }
.cc-empty { color: var(--murphy-muted); font-size: .74rem; }

/* Center */
.cc-center { display: flex; flex-direction: column; min-width: 0; gap: .6rem; }
.cc-center__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 0 .2rem; }
.cc-center__head h1 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.5rem); }
.cc-kicker { margin: 0 0 .2rem; font: 700 .62rem/1 var(--murphy-mono); letter-spacing: .14em; color: var(--murphy-accent); }
.cc-center__truth { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

.cc-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: .6rem; flex: 1; min-height: 0; }
.cc-conversation, .cc-feed {
  background: var(--murphy-panel); border: 1px solid var(--murphy-border); border-radius: var(--murphy-radius);
  display: flex; flex-direction: column; min-height: 22rem; max-height: 58vh;
}
.cc-sub { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--murphy-border); }
.cc-thread, .cc-feed__list { list-style: none; margin: 0; padding: .7rem .8rem; overflow: auto; flex: 1; display: grid; gap: .55rem; align-content: start; }

.cc-msg { padding: .6rem .75rem; border-radius: 10px; font-size: .86rem; line-height: 1.45; max-width: 92%; cursor: pointer; }
.cc-msg p { margin: 0; white-space: pre-wrap; }
.cc-msg--user { background: rgb(88 166 255 / 12%); border: 1px solid rgb(88 166 255 / 30%); justify-self: end; }
.cc-msg--murphy { background: var(--murphy-panel-raised); border: 1px solid var(--murphy-border); }
.cc-msg--system { background: transparent; border: 1px dashed var(--murphy-border); color: var(--murphy-muted); font-size: .76rem; max-width: 100%; }
.cc-msg--error { border-color: var(--murphy-danger); color: var(--murphy-danger); }
.cc-msg__meta { display: block; margin-top: .35rem; font: 500 .62rem/1 var(--murphy-mono); color: var(--murphy-muted); }
.cc-msg--pending { opacity: .6; }
/* SN-C9: pivot-hub DRAFT bubble (job running) -> FINAL replaces it in place */
.cc-msg--draft { border-left: 3px solid #d9a441; }
.cc-msg--draft .cc-msg__meta::after { content: ' · swarm running…'; animation: cc-blink 1.2s steps(1) infinite; }
.cc-msg--final { border-left: 3px solid #3cb371; }
.cc-msg--pending p::after { content: ' ▍'; animation: cc-blink 1s steps(1) infinite; }
@keyframes cc-blink { 50% { opacity: 0; } }

.cc-feed__item { display: grid; grid-template-columns: auto 1fr; gap: .5rem; align-items: start; font-size: .76rem; padding: .35rem .45rem; border-radius: 6px; cursor: pointer; }
.cc-feed__item:hover { background: var(--murphy-panel-raised); }
.cc-feed__item.is-new { animation: cc-fade .6s ease-out; }
@keyframes cc-fade { from { background: rgb(0 212 170 / 20%); } to { background: transparent; } }
.cc-feed__dot { width: .55rem; height: .55rem; border-radius: 50%; margin-top: .3rem; background: var(--murphy-muted); }
.cc-feed__dot--agent_run { background: var(--murphy-accent); }
.cc-feed__dot--heartbeat { background: var(--murphy-info); }
.cc-feed__dot--chat { background: var(--murphy-warning); }
.cc-feed__dot--hitl_request { background: var(--murphy-danger); }
.cc-feed__text { margin: 0; }
.cc-feed__text small { display: block; color: var(--murphy-muted); font: 500 .62rem/1.3 var(--murphy-mono); margin-top: .15rem; }

.cc-composer {
  position: sticky; bottom: 2.7rem; z-index: 5;
  background: var(--murphy-panel); border: 1px solid var(--murphy-border); border-radius: var(--murphy-radius);
  padding: .55rem .7rem; display: grid; gap: .4rem; box-shadow: var(--murphy-shadow);
}
.cc-composer textarea {
  width: 100%; resize: vertical; min-height: 2.6rem; background: var(--murphy-bg); color: var(--murphy-text);
  border: 1px solid var(--murphy-border); border-radius: 8px; padding: .55rem .7rem; font: 500 .9rem/1.4 var(--murphy-sans);
}
.cc-composer textarea:focus { border-color: var(--murphy-accent); outline: none; }
.cc-composer__row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cc-composer__hint { font: 500 .66rem/1 var(--murphy-mono); color: var(--murphy-muted); }
.cc-send { background: var(--murphy-accent); color: #04110d; border: 0; border-radius: 8px; padding: .5rem 1.1rem; font-weight: 800; cursor: pointer; }
.cc-send[disabled] { opacity: .5; cursor: progress; }

/* Right side */
.cc-side { min-width: 0; }
.cc-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.cc-agent { display: grid; grid-template-columns: .6rem 1fr auto; gap: .5rem; align-items: center; padding: .38rem .45rem; border-radius: 7px; cursor: pointer; font-size: .76rem; }
.cc-agent:hover { background: var(--murphy-panel-raised); }
.cc-agent__pulse { width: .55rem; height: .55rem; border-radius: 50%; background: var(--murphy-muted); }
.cc-agent.is-live .cc-agent__pulse { background: var(--murphy-accent); box-shadow: 0 0 0 0 rgb(0 212 170 / 60%); animation: cc-pulse 1.6s ease-out infinite; }
@keyframes cc-pulse { to { box-shadow: 0 0 0 .5rem rgb(0 212 170 / 0%); } }
.cc-agent__name b { display: block; }
.cc-agent__name small { color: var(--murphy-muted); font-size: .64rem; }
.cc-agent__count { font: 600 .64rem/1 var(--murphy-mono); color: var(--murphy-muted); }

.cc-kv { display: grid; gap: .25rem; font-size: .76rem; }
.cc-kv .row { display: flex; justify-content: space-between; gap: .5rem; padding: .18rem 0; border-bottom: 1px dotted var(--murphy-border); }
.cc-kv .row b { color: var(--murphy-muted); font-weight: 600; }
.cc-kv .row i { font-style: normal; font-family: var(--murphy-mono); font-size: .7rem; }

.cc-forge-form { display: grid; grid-template-columns: 1fr auto; gap: .35rem; margin: .5rem 0; }
.cc-forge-form input { background: var(--murphy-bg); color: var(--murphy-text); border: 1px solid var(--murphy-border); border-radius: 7px; padding: .38rem .5rem; font-size: .76rem; }

/* Inspector drawer */
.cc-inspector {
  position: fixed; right: 0; top: 4rem; bottom: 2.7rem; width: min(30rem, 92vw); z-index: 90;
  background: var(--murphy-panel-raised); border-left: 1px solid var(--murphy-border);
  box-shadow: var(--murphy-shadow); padding: .8rem .9rem; overflow: auto;
}
.cc-inspector[hidden] { display: none; }
.cc-inspector__meta { font: 500 .66rem/1.4 var(--murphy-mono); color: var(--murphy-muted); margin: 0 0 .5rem; }
.cc-inspector__body { font: 500 .72rem/1.45 var(--murphy-mono); white-space: pre-wrap; word-break: break-word; background: var(--murphy-bg); padding: .7rem; border-radius: 8px; border: 1px solid var(--murphy-border); margin: 0; }

/* Bottom metrics */
.cc-metrics {
  position: sticky; bottom: 0; z-index: 80;
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
  padding: .45rem clamp(.75rem, 2vw, 1.5rem); border-top: 1px solid var(--murphy-border);
  background: rgb(13 17 23 / 94%); backdrop-filter: blur(14px); font-size: .7rem;
}
.cc-metric b { color: var(--murphy-muted); font-weight: 600; margin-right: .35rem; }
.cc-metric i { font-style: normal; font-family: var(--murphy-mono); color: var(--murphy-text); }
.cc-metric--src { margin-left: auto; color: var(--murphy-muted); font-family: var(--murphy-mono); font-size: .6rem; }
.cc-metric.is-ok i { color: var(--murphy-accent); }
.cc-metric.is-bad i { color: var(--murphy-danger); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Gear/eye activity states driven by JS (extends murphy-eye-clockwork.css) */
.murphy-eye--clockwork[data-murphy-activity="thinking"] .murphy-eye__gear { animation: cc-spin 1.4s linear infinite; opacity: 1; }
.murphy-eye--clockwork[data-murphy-activity="error"] .murphy-eye__outline { stroke: var(--murphy-danger); }
.murphy-eye--clockwork.is-blink .murphy-eye__gaze { transform: scaleY(.1) !important; transition: transform 90ms ease-in; }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .murphy-eye--clockwork[data-murphy-activity="thinking"] .murphy-eye__gear { animation: none; } }

/* Responsive */
@media (max-width: 1180px) {
  .cc-shell { grid-template-columns: 13rem minmax(0, 1fr); }
  .cc-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
  .cc-side .cc-panel { margin-bottom: 0; }
}
@media (max-width: 820px) {
  .cc-shell { grid-template-columns: 1fr; }
  .cc-rail { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
  .cc-rail .cc-panel { margin-bottom: 0; }
  .cc-rail [data-cc-panel="workspaces"] { grid-column: 1 / -1; }
  .cc-columns { grid-template-columns: 1fr; }
  .cc-conversation, .cc-feed { max-height: none; min-height: 16rem; }
  .cc-center__head { flex-direction: column; align-items: flex-start; }
  .cc-metric--src { display: none; }
}
