:root {
  --bg: #f4f2ec;
  --ink: #151716;
  --muted: #66706b;
  --panel: #fffdf8;
  --line: rgba(21, 23, 22, 0.14);
  --green: #146c5c;
  --green-dark: #0b463d;
  --coral: #d95c43;
  --gold: #b9852c;
  --blue: #2f6f94;
  --shadow: 0 24px 70px rgba(31, 39, 35, 0.14);
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 23, 22, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 22, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #f7f5ef 0%, #ece9df 52%, #f6efe7 100%);
  background-size: 56px 56px, 56px 56px, auto;
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.stage {
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: stretch;
}

.stage__main,
.panel,
.transcript,
.events {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.stage__main {
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 58px);
  display: grid;
  align-content: center;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.stage__main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(20, 108, 92, 0.14), transparent 42%),
    linear-gradient(320deg, rgba(217, 92, 67, 0.12), transparent 46%);
  pointer-events: none;
}

.stage__main > * {
  position: relative;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(3.4rem, 9vw, 8rem);
  line-height: 0.9;
}

h2 {
  font-size: 1.05rem;
}

.orb {
  width: min(100%, 560px);
  aspect-ratio: 2 / 1;
  border-radius: var(--radius);
  border: 1px solid rgba(20, 108, 92, 0.2);
  background:
    linear-gradient(90deg, rgba(20, 108, 92, 0.12), rgba(47, 111, 148, 0.1)),
    #fffaf1;
  overflow: hidden;
}

#meter {
  width: 100%;
  height: 100%;
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 780;
  cursor: pointer;
}

.button--primary {
  background: var(--green);
  color: white;
  border-color: var(--green-dark);
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.voice-control {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  max-width: 720px;
}

.voice-control label {
  width: 100%;
  color: var(--muted);
  font-weight: 800;
}

.voice-control select {
  min-height: 46px;
  min-width: min(100%, 300px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 720;
}

.text-send {
  display: grid;
  gap: 8px;
  max-width: 720px;
  color: var(--muted);
  font-weight: 700;
}

.text-send input {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 0 14px;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.panel {
  border-radius: var(--radius);
  padding: 20px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel__head span {
  color: var(--green);
  font-weight: 800;
}

.lead-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.lead-grid div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(21, 23, 22, 0.08);
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-top: 20px;
}

.transcript,
.events {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  border-radius: var(--radius);
  padding: 16px;
}

.line {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(20, 108, 92, 0.07);
  margin-bottom: 10px;
}

.line--client {
  background: rgba(47, 111, 148, 0.08);
}

.line--agent {
  background: rgba(20, 108, 92, 0.08);
}

.line span,
.event span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.line p,
.event p {
  margin: 0;
  line-height: 1.45;
}

.event {
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  background: rgba(185, 133, 44, 0.08);
  margin-bottom: 10px;
}

@media (max-width: 880px) {
  .stage,
  .workspace {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .stage__main,
  .panel,
  .transcript,
  .events {
    padding: 14px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .button {
    flex: 1 1 140px;
  }
}
