:root {
  color-scheme: light;
  --ink: #192026;
  --muted: #66727f;
  --line: #d9e1e7;
  --panel: #ffffff;
  --surface: #f4f7f8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d9f2ee;
  --warning: #9a5b00;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(24, 35, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 360px;
  min-height: 100vh;
}

.sidebar,
.coach-panel {
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  padding: 24px;
}

.coach-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.4rem;
}

.control-group {
  margin-top: 24px;
}

.control-group.compact {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #34424e;
  font-size: 0.9rem;
  font-weight: 800;
}

.scenario-list {
  display: grid;
  gap: 8px;
}

.scenario-card {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.scenario-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.scenario-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.scenario-card span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

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

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-grid strong,
.stat-grid span {
  display: block;
}

.stat-grid strong {
  font-size: 1.35rem;
}

.stat-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button,
.send-button {
  border-radius: 8px;
  font-weight: 850;
}

.primary-button,
.send-button {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.secondary-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  white-space: nowrap;
}

.primary-button:hover,
.send-button:hover {
  background: var(--accent-strong);
}

.briefing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.brief-card {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.brief-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.brief-card p {
  margin-bottom: 0;
  line-height: 1.4;
}

.chat-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.message {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.message.customer {
  align-self: flex-start;
  background: #eef4f7;
}

.message.trainee {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.message.system {
  align-self: center;
  max-width: 92%;
  background: #fff8e8;
  color: var(--warning);
  border: 1px solid #f0d9a6;
}

.message small {
  display: block;
  margin-bottom: 4px;
  opacity: 0.76;
  font-weight: 800;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.composer textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.send-button {
  width: 48px;
  height: 48px;
  align-self: end;
  font-size: 1.1rem;
}

.coach-header {
  margin-bottom: 18px;
}

.empty-feedback,
.feedback {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  color: var(--muted);
  line-height: 1.45;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--score), #e5ecef 0);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
}

.metric {
  margin: 12px 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.bar {
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf0;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.feedback h3 {
  margin: 20px 0 8px;
  font-size: 0.95rem;
}

.feedback ul {
  margin: 0;
  padding-left: 18px;
}

.feedback li {
  margin: 7px 0;
}

.better-response {
  margin: 10px 0 0;
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.hidden {
  display: none;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 280px 1fr;
  }

  .coach-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar,
  .workspace,
  .coach-panel {
    padding: 18px;
  }

  .briefing {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    align-items: stretch;
  }

  .message {
    max-width: 92%;
  }
}
