:root {
  color-scheme: dark;
  --ink: #eef9f7;
  --muted: #8ca7a5;
  --panel: rgba(11, 29, 31, 0.88);
  --panel-strong: #10292b;
  --line: rgba(142, 184, 180, 0.19);
  --cyan: #63eee1;
  --lime: #b8f35a;
  --coral: #ff775f;
  --amber: #ffcf70;
  --bg: #071315;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% -10%, rgba(34, 157, 149, 0.22), transparent 31rem),
    radial-gradient(circle at 91% 22%, rgba(159, 229, 83, 0.09), transparent 28rem),
    linear-gradient(155deg, #061012 0%, #071617 49%, #050d0f 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.skip-link { position: fixed; left: 12px; top: -48px; z-index: 99; background: var(--cyan); color: #062022; padding: 10px 14px; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.topbar { max-width: 1500px; margin: 0 auto; padding: 26px 34px 18px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand-lockup, .topbar-actions, .call-meta, .risk-heading, .section-heading, .draft-actions, .boundary-row { display: flex; align-items: center; }
.brand-lockup { gap: 13px; }
.brand-mark { width: 40px; height: 40px; border: 1px solid rgba(99,238,225,.5); border-radius: 12px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 10px 8px; box-shadow: inset 0 0 20px rgba(99,238,225,.08); }
.brand-mark span { display: block; width: 4px; border-radius: 5px; background: var(--cyan); animation: bars 1.5s ease-in-out infinite; }
.brand-mark span:nth-child(1) { height: 11px; animation-delay: -.3s; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 15px; animation-delay: -.7s; }
@keyframes bars { 50% { transform: scaleY(.55); opacity: .55; } }
.eyebrow, .panel-label, .boundary-label, .risk-heading p, .section-heading p, .pause-request p, .tool-grid span, .metric-strip p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 1px 0 0; font-size: 21px; letter-spacing: .18em; }
.topbar-actions { gap: 10px; }
.synthetic-badge, .webmcp-status, .tool-count { border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: #b8cfcd; font-size: 11px; background: rgba(12,34,36,.55); }
.synthetic-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.webmcp-status.ready { color: var(--lime); border-color: rgba(184,243,90,.35); }
.workspace { max-width: 1500px; margin: 0 auto; padding: 12px 34px 80px; }
.hero-panel { min-height: 286px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .6fr); align-items: end; gap: 60px; padding: 42px 44px; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; position: relative; background: linear-gradient(112deg, rgba(15,49,51,.9), rgba(8,24,26,.83)); box-shadow: 0 32px 70px rgba(0,0,0,.28); }
.hero-panel::after { content: ""; position: absolute; width: 430px; height: 430px; right: -100px; top: -200px; border: 1px solid rgba(99,238,225,.16); border-radius: 50%; box-shadow: 0 0 0 55px rgba(99,238,225,.025), 0 0 0 110px rgba(99,238,225,.015); }
.kicker { color: var(--lime); font-size: 12px; text-transform: uppercase; letter-spacing: .17em; font-weight: 800; }
.hero-panel h2 { font-size: clamp(35px, 4.5vw, 68px); line-height: .98; letter-spacing: -.045em; margin: 15px 0 22px; max-width: 920px; }
.hero-panel h2 span { color: transparent; -webkit-text-stroke: 1px rgba(238,249,247,.7); }
.hero-copy { max-width: 700px; color: #adc5c2; line-height: 1.65; margin: 0; font-size: 15px; }
.boundary-card { position: relative; z-index: 1; padding: 24px; border: 1px solid rgba(99,238,225,.2); border-radius: 16px; background: rgba(4,17,19,.62); backdrop-filter: blur(10px); }
.boundary-label { color: var(--cyan); margin-bottom: 15px; }
.boundary-row { gap: 10px; margin-top: 11px; color: #c4d7d5; font-size: 13px; }
.boundary-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; font-weight: 900; }
.boundary-icon.safe { color: var(--lime); background: rgba(184,243,90,.1); }
.boundary-icon.stop { color: var(--coral); background: rgba(255,119,95,.1); }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,23,25,.74); overflow: hidden; }
.metric-strip article { padding: 18px 22px; position: relative; border-right: 1px solid var(--line); }
.metric-strip article:last-child { border-right: 0; }
.metric-strip strong { display: inline-block; margin-top: 7px; font-size: 18px; letter-spacing: .03em; }
.metric-strip small { margin-left: 8px; color: var(--muted); }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-left: 9px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 4px rgba(184,243,90,.08), 0 0 12px var(--lime); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.16); overflow: hidden; }
.panel-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel h3, .tool-deck h3 { margin: 5px 0 0; font-size: 20px; }
.quiet-button, .text-button, .primary-button, .danger-button { border: 0; border-radius: 8px; }
.quiet-button { background: rgba(255,255,255,.055); color: #bcd0ce; padding: 8px 11px; }
.quiet-button:hover { background: rgba(255,255,255,.09); }
.call-meta { padding: 18px 22px; gap: 12px; border-bottom: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--cyan), #218980); color: #04201f; font-size: 12px; font-weight: 900; }
.call-meta div:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.call-meta span { color: var(--muted); font-size: 11px; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--cyan); }
.transcript { min-height: 460px; max-height: 520px; padding: 20px 22px; overflow: auto; }
.utterance { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(142,184,180,.09); }
.utterance:last-child { border-bottom: 0; }
.speaker { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding-top: 3px; }
.utterance p { margin: 0; color: #d8e9e6; line-height: 1.55; font-size: 14px; }
.utterance.flagged p { border-left: 2px solid var(--amber); padding-left: 12px; }
.translation { display: block; margin-top: 5px; color: #7fa5a1; font-size: 12px; }
.waveform { height: 54px; padding: 0 22px; display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); }
.waveform span { width: 3px; border-radius: 4px; height: 10px; background: var(--cyan); opacity: .5; animation: wave 1.1s ease-in-out infinite; }
.waveform span:nth-child(3n) { height: 24px; animation-delay: -.3s; }
.waveform span:nth-child(2n) { height: 17px; animation-delay: -.6s; }
@keyframes wave { 50% { transform: scaleY(.5); opacity: .25; } }
.waveform p { margin-left: auto; font-size: 9px; color: #5d7d7a; letter-spacing: .16em; }
.agent-panel { padding-bottom: 16px; }
.tool-count { color: var(--cyan); }
.risk-card, .draft-card, .activity-card { margin: 16px 16px 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(6,20,22,.64); padding: 16px; }
.risk-card { border-color: rgba(255,207,112,.3); background: linear-gradient(125deg, rgba(78,54,18,.21), rgba(8,24,26,.74)); }
.risk-heading { gap: 11px; }
.risk-orb { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #2d2007; background: var(--amber); font-weight: 900; box-shadow: 0 0 18px rgba(255,207,112,.18); }
.risk-card h4, .draft-card h4, .activity-card h4 { margin: 4px 0 0; font-size: 14px; }
.risk-card > p { color: #adbfbd; font-size: 12px; line-height: 1.55; }
.text-button { padding: 0; color: var(--amber); background: transparent; font-size: 11px; }
.section-heading { justify-content: space-between; margin-bottom: 12px; }
.section-heading > span, #draft-status { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
textarea { width: 100%; min-height: 92px; resize: vertical; border: 1px solid rgba(142,184,180,.23); border-radius: 9px; padding: 12px; color: var(--ink); background: rgba(3,14,16,.7); line-height: 1.5; }
textarea::placeholder { color: #55726f; }
.draft-actions { justify-content: space-between; gap: 12px; margin-top: 10px; }
.draft-actions span { color: var(--muted); font-size: 10px; }
.primary-button, .danger-button { padding: 9px 12px; font-size: 11px; font-weight: 800; }
.primary-button { color: #06201f; background: var(--cyan); }
.primary-button:disabled { opacity: .3; cursor: not-allowed; }
.danger-button { color: #2d0b06; background: var(--coral); }
.pause-request { margin: 16px 16px 0; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(255,119,95,.4); border-radius: 12px; background: rgba(100,34,24,.25); }
.pause-request[hidden] { display: none; }
.pause-request strong, .pause-request span { display: block; }
.pause-request strong { margin-top: 4px; font-size: 13px; }
.pause-request span { margin-top: 3px; color: #d3a8a1; font-size: 11px; }
.pause-request > div:last-child { display: flex; gap: 8px; }
.activity-log { list-style: none; margin: 0; padding: 0; max-height: 165px; overflow: auto; }
.activity-log li { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(142,184,180,.08); font-size: 11px; }
.activity-log li:last-child { border-bottom: 0; }
.activity-log time { color: var(--cyan); font-variant-numeric: tabular-nums; }
.activity-log span { color: #9bb2af; }
.tool-deck { margin-top: 18px; padding: 28px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 32px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8,24,26,.72); }
.tool-deck-intro > p:last-child { color: var(--muted); max-width: 440px; line-height: 1.55; font-size: 13px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-grid article { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: rgba(4,16,18,.46); }
.tool-grid span { color: var(--lime); }
.tool-grid h4 { margin: 9px 0 5px; font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: #d7f1ed; }
.tool-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.native-inspector { margin-top: 18px; padding: 24px 28px; display: grid; grid-template-columns: .72fr 1.28fr; gap: 28px; border: 1px solid rgba(99,238,225,.28); border-radius: 18px; background: linear-gradient(120deg, rgba(9,39,41,.82), rgba(5,17,19,.78)); }
.native-inspector[hidden] { display: none; }
.native-inspector h3 { margin: 5px 0 8px; }
.native-inspector > div > p:last-child { color: var(--muted); line-height: 1.5; font-size: 12px; }
.native-inspector code { color: var(--cyan); }
.inspector-controls { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.inspector-controls button { padding: 9px 11px; border: 1px solid rgba(99,238,225,.24); border-radius: 8px; background: rgba(99,238,225,.07); color: var(--cyan); font-size: 11px; }
.inspector-controls button:hover { background: rgba(99,238,225,.13); }
#native-output { width: 100%; min-height: 122px; grid-column: 2; margin: -56px 0 0; padding: 13px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #030e10; color: #9dc7c2; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
footer { max-width: 1500px; margin: -42px auto 0; padding: 0 34px 28px; display: flex; justify-content: space-between; gap: 20px; color: #698582; font-size: 10px; }
footer a { color: var(--cyan); text-decoration: none; }

@media (max-width: 980px) {
  .hero-panel, .dashboard-grid, .tool-deck, .native-inspector { grid-template-columns: 1fr; }
  .hero-panel { gap: 28px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article:nth-child(2) { border-right: 0; }
  .metric-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .topbar, .workspace { padding-left: 16px; padding-right: 16px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-direction: column; align-items: flex-end; }
  .synthetic-badge { display: none; }
  .hero-panel { padding: 30px 22px; min-height: auto; }
  .metric-strip { grid-template-columns: 1fr; }
  .metric-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-strip article:last-child { border-bottom: 0; }
  .panel-header { align-items: flex-start; }
  .transcript { min-height: 420px; }
  .utterance { grid-template-columns: 70px 1fr; }
  .draft-actions, .pause-request, footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .tool-grid { grid-template-columns: 1fr; }
  #native-output { grid-column: 1; margin: 0; }
  footer { margin-top: -50px; padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
