:root {
  --bg: #07111f;
  --bg-soft: #0f1f35;
  --panel: rgba(12, 24, 42, 0.92);
  --panel-alt: rgba(17, 33, 58, 0.9);
  --line: rgba(124, 200, 255, 0.16);
  --text: #edf5ff;
  --muted: #9cb7d6;
  --cyan: #66d7ff;
  --cyan-soft: rgba(102, 215, 255, 0.14);
  --amber: #f4b45f;
  --amber-soft: rgba(244, 180, 95, 0.14);
  --red: #ff7b72;
  --green: #39d98a;
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(102, 215, 255, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(244, 180, 95, 0.16), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #0b1628 100%);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(102, 215, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 215, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.cc-shell {
  position: relative;
  z-index: 1;
  width: min(100vw, 430px);
  margin: 0 auto;
  padding: 18px 14px calc(28px + env(safe-area-inset-bottom));
}

.cc-shell-hub {
  min-height: 100vh;
  justify-content: center;
}

.cc-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.cc-kicker,
.cc-card-eyebrow,
.cc-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-topbar h1,
.cc-hero h1,
.cc-hero h2,
.cc-entry-card h2,
.cc-panel-head h2,
.cc-thread-card h3,
.cc-action-card h3 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  line-height: 1.05;
}

.cc-topbar h1 {
  font-size: 30px;
}

.cc-inline-link {
  color: var(--cyan);
  font-weight: 700;
}

.cc-hero,
.cc-panel,
.cc-entry-card,
.cc-overview-card,
.cc-line-card,
.cc-gap-card,
.cc-trend-card,
.cc-benchmark-card,
.cc-table-card,
.cc-roster-card,
.cc-kb-card,
.cc-thread-card,
.cc-action-card {
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), rgba(7, 17, 31, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.cc-hero,
.cc-panel {
  padding: 20px;
}

.cc-hero h1 {
  font-size: 38px;
}

.cc-hero-title-long {
  max-width: 9.5em;
  font-size: 46px;
  letter-spacing: -0.04em;
}

.cc-hero h2 {
  font-size: 28px;
}

.cc-lead {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.cc-hero-tight {
  margin-bottom: 14px;
}

.cc-chip-row,
.cc-button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-runtime-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.cc-runtime-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(102, 215, 255, 0.45);
  animation: cc-pulse 1.5s infinite;
}

.cc-runtime-status[data-tone="ready"]::before {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(57, 217, 138, 0.35);
}

.cc-runtime-status[data-tone="warn"]::before {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(244, 180, 95, 0.35);
}

.cc-chip,
.cc-source-chip,
.cc-quick-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.cc-card-stack,
.cc-stat-grid,
.cc-roster,
.cc-brief-grid {
  display: grid;
  gap: 12px;
}

.cc-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.cc-overview-card,
.cc-line-card,
.cc-gap-card,
.cc-trend-card,
.cc-benchmark-card,
.cc-table-card,
.cc-brief-card,
.cc-roster-card,
.cc-kb-card,
.cc-thread-card,
.cc-action-card,
.cc-entry-card {
  padding: 16px;
}

.cc-overview-card strong,
.cc-line-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.cc-overview-card p,
.cc-line-card p,
.cc-gap-card p,
.cc-trend-card p,
.cc-benchmark-card p,
.cc-table-card p,
.cc-brief-card p,
.cc-roster-card p,
.cc-kb-card p,
.cc-thread-card p,
.cc-action-card p,
.cc-entry-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.cc-reveal-item {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 0.45s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.45s ease;
}

.cc-reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.cc-line-head,
.cc-gap-head,
.cc-benchmark-head,
.cc-thread-head,
.cc-action-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.cc-tag {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 12px;
}

.cc-tag-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.cc-tag-danger {
  background: rgba(255, 123, 114, 0.12);
  color: var(--red);
}

.cc-thread-card.is-streaming {
  border-color: rgba(102, 215, 255, 0.34);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(102, 215, 255, 0.14);
}

.cc-line-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.cc-brief-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cc-brief-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 24, 42, 0.96), rgba(7, 17, 31, 0.98));
}

.cc-brief-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.36;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.cc-brief-card-consensus {
  border-color: rgba(57, 217, 138, 0.18);
}

.cc-brief-card-tension {
  border-color: rgba(244, 180, 95, 0.2);
}

.cc-brief-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.cc-brief-list li + li {
  margin-top: 8px;
}

.cc-line-stat {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.cc-bar-track,
.cc-benchmark-track {
  position: relative;
  margin-top: 14px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cc-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), #7ce7ff);
}

.cc-bar-fill[data-tone="warning"] {
  background: linear-gradient(90deg, var(--amber), #ffd38d);
}

.cc-bar-fill[data-tone="danger"] {
  background: linear-gradient(90deg, var(--red), #ff968f);
}

.cc-bar-target {
  position: absolute;
  top: -4px;
  height: 24px;
  width: 2px;
  background: rgba(255, 255, 255, 0.86);
}

.cc-trend-svg {
  width: 100%;
  height: 110px;
  margin-top: 12px;
}

.cc-axis-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.cc-benchmark-dot {
  position: absolute;
  top: -4px;
  width: 24px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid #07111f;
}

.cc-benchmark-dot.mean {
  background: var(--amber);
}

.cc-benchmark-dot.actual {
  background: var(--cyan);
}

.cc-benchmark-dot.best {
  background: var(--green);
}

.cc-label {
  display: block;
  margin-bottom: 10px;
}

.cc-textarea {
  width: 100%;
  min-height: 118px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.7;
  resize: vertical;
}

.cc-primary-button,
.cc-secondary-button,
.cc-ghost-button {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
}

.cc-primary-button {
  background: linear-gradient(135deg, #1fa6d5, #60d8ff);
  color: #04111f;
  font-weight: 800;
}

.cc-primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  filter: saturate(0.8);
}

.cc-secondary-button {
  background: linear-gradient(135deg, #f0a54a, #ffd08a);
  color: #1b1410;
  font-weight: 800;
}

.cc-ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.cc-panel {
  margin-top: 14px;
}

.cc-panel-head h2 {
  font-size: 24px;
}

.cc-panel-head-stack {
  align-items: flex-start;
}

.cc-hub-panel {
  margin-top: 14px;
}

.cc-robot-mark {
  display: grid;
  place-items: center;
  min-width: 56px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(102, 215, 255, 0.22);
  background: radial-gradient(circle at 30% 30%, rgba(102, 215, 255, 0.24), rgba(102, 215, 255, 0.08));
  box-shadow: inset 0 0 24px rgba(102, 215, 255, 0.08);
}

.cc-robot-mark svg,
.cc-robot-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cc-hub-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.cc-hub-agent-card {
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 19, 35, 0.96), rgba(7, 17, 31, 0.98));
  box-shadow: inset 0 0 0 1px rgba(102, 215, 255, 0.03);
}

.cc-hub-agent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cc-robot-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(102, 215, 255, 0.08);
  border: 1px solid rgba(102, 215, 255, 0.14);
}

.cc-hub-agent-card strong {
  display: block;
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.34;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.cc-roster {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cc-roster-card strong,
.cc-thread-card strong,
.cc-action-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.cc-source-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cc-source-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cc-source-chip {
  color: var(--cyan);
}

.cc-kb-card a,
.cc-thread-card a {
  color: var(--cyan);
}

.cc-thread-card.is-streaming p::after {
  content: "";
  display: inline-block;
  width: 0.56ch;
  height: 1.05em;
  margin-left: 0.14ch;
  vertical-align: -0.16em;
  background: var(--cyan);
  animation: cc-caret 0.95s step-end infinite;
}

.cc-entry-card {
  display: block;
  background: linear-gradient(180deg, var(--panel-alt), rgba(10, 18, 32, 0.98));
}

.cc-entry-card-accent {
  border-color: rgba(244, 180, 95, 0.24);
}

.cc-entry-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--cyan);
  font-weight: 800;
}

.cc-table-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.cc-table-card th,
.cc-table-card td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

@keyframes cc-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 215, 255, 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(102, 215, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(102, 215, 255, 0);
  }
}

@keyframes cc-caret {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}
