:root {
  color-scheme: light;
  --bg: #eef3f7;
  --ink: #17202a;
  --muted: #64717f;
  --line: #d7e0e8;
  --panel: #ffffff;
  --panel-strong: #f8fbfd;
  --accent: #006f7f;
  --accent-dark: #034c58;
  --good: #0a7a4b;
  --warn: #ad5c00;
  --danger: #b3261e;
  --shadow: 0 18px 45px rgba(26, 44, 56, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Segoe UI",
    "Noto Sans KR",
    system-ui,
    sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(238, 243, 247, 0.92)),
    var(--bg);
  color: var(--ink);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf3f5;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status.live {
  color: #fff;
  background: var(--good);
}

.status.ended {
  color: #fff;
  background: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 390px;
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.phone-panel,
.main-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.phone-panel {
  padding: 18px;
}

.phone-screen {
  min-height: 154px;
  padding: 22px;
  border-radius: 8px;
  background: #12242b;
  color: #e8fbff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

.screen-label {
  margin: 0;
  color: #80dce9;
  font-size: 12px;
  font-weight: 800;
}

.phone-screen strong {
  font-size: 27px;
  line-height: 1.15;
}

.phone-screen span {
  color: #b9d5dc;
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 10px;
  margin: 16px 0;
}

.call-button,
.ghost-button,
.toggle-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.call-button {
  color: #fff;
  background: var(--accent);
}

.call-button:hover,
.toggle-button:hover {
  background: var(--accent-dark);
}

.ghost-button,
.toggle-button {
  color: var(--accent-dark);
  background: #e7f2f4;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.keypad button {
  aspect-ratio: 1 / 0.78;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.keypad button:hover {
  border-color: var(--accent);
  background: #e5f5f7;
}

.keypad strong {
  font-size: 24px;
  line-height: 1;
}

.keypad span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.main-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.panel-header.compact {
  padding: 20px 20px 12px;
  align-items: center;
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.prompt-box {
  margin: 22px 0 16px;
  padding: 18px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #f3fafb;
}

.prompt-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prompt-box p {
  margin: 8px 0 0;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.42;
  font-weight: 800;
}

.prompt-box small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metrics div {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.flow-step {
  min-height: 138px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--accent);
  background: #e7f2f4;
  font-size: 12px;
  font-weight: 900;
}

.flow-step p {
  margin: 18px 0 0;
  font-weight: 800;
  line-height: 1.35;
}

.flow-step.active {
  border-color: var(--accent);
  background: #eaf8fa;
}

.flow-step.done {
  border-color: #9dcfc8;
  background: #f0faf6;
}

.side-panel {
  display: flex;
  min-height: 560px;
  flex-direction: column;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: #edf3f5;
  font-size: 22px;
  line-height: 1;
}

.event-log {
  display: flex;
  flex: 1;
  flex-direction: column-reverse;
  gap: 10px;
  margin: 0;
  padding: 8px 20px 20px;
  overflow: auto;
  list-style: none;
}

.event-log li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.event-log time {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.event-log code {
  color: var(--accent-dark);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 320px 1fr;
  }

  .side-panel {
    grid-column: 1 / -1;
    min-height: 320px;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-actions {
    justify-content: stretch;
  }

  .voice-actions button {
    flex: 1;
  }

  .status-cluster {
    justify-content: flex-start;
  }

  .workspace,
  .metrics,
  .flow {
    grid-template-columns: 1fr;
  }

  .primary-actions {
    grid-template-columns: 1fr;
  }

  .flow-step {
    min-height: 94px;
  }
}
