:root {
  color-scheme: light;
  --bg: #f2eee8;
  --surface: #ffffff;
  --surface-soft: #f8f5f0;
  --border: #d9d1c7;
  --text: #242629;
  --muted: #6d737a;
  --accent: #f97316;
  --accent-strong: #c2410c;
  --accent-soft: #fed7aa;
  --graphite: #2f3439;
  --graphite-soft: #f0efed;
  --blue: #3f454b;
  --blue-soft: #f0efed;
  --gold: #ea580c;
  --gold-soft: #fff7ed;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --warning: #c2410c;
  --ok: #166534;
  --ok-soft: #f0fdf4;
  --ink: #1f2428;
  --shadow: 0 16px 36px rgba(31, 36, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fffaf4 0, var(--bg) 320px),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 250, 244, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  color: var(--graphite);
  padding: 6px 12px;
}

.nav a:hover {
  background: var(--surface-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

.nav-logout {
  margin: 0;
}

.nav-logout button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--graphite);
  padding: 6px 12px;
  box-shadow: none;
}

.nav-logout button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.12), transparent 42%),
    linear-gradient(180deg, #fffaf4 0, var(--bg) 100%);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-card h1 {
  font-size: 34px;
}

.auth-card p {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.auth-form .field {
  margin-bottom: 0;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  min-height: 48px;
  border-radius: 8px;
}

.auth-form button {
  min-height: 48px;
  margin-top: 2px;
  width: 100%;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 30px auto 64px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(217, 209, 199, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.page-head p,
.empty,
small,
.prompt-summary span,
.role-grid span,
.report-summary span,
.muted-line {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: #fff7ed;
  color: var(--accent-strong);
  padding: 3px 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.report-grid {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  margin-bottom: 18px;
}

.panel,
.notice,
.prompt-summary {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
}

.prompt-summary {
  min-width: 260px;
}

.prompt-summary strong,
.prompt-summary small {
  display: block;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field span {
  font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(249, 115, 22, 0.16);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  padding: 10px 15px;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  padding: 10px 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

.button-link:hover {
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

button.secondary:hover,
.button-link.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button.danger,
.button-link.danger {
  border-color: #fecdca;
  color: var(--danger);
}

button.danger:hover,
.button-link.danger:hover {
  border-color: var(--danger);
  background: #fef3f2;
  color: var(--danger);
}

.button-link.secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

em,
.form-errors {
  color: var(--danger);
  font-style: normal;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message,
.notice {
  border-radius: 8px;
  padding: 13px 15px;
}

.message-success {
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: var(--ok);
}

.message-error,
.notice.error {
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: var(--danger);
}

.notice.warning {
  margin-bottom: 16px;
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: var(--warning);
}

.notice p {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.table-actions {
  width: 1%;
  white-space: nowrap;
}

.table-actions form {
  display: flex;
  justify-content: flex-end;
}

.icon-danger {
  min-height: 34px;
  border: 1px solid #fecdca;
  background: #fff;
  color: var(--danger);
  padding: 6px 10px;
  box-shadow: none;
}

.icon-danger:hover {
  background: #fef3f2;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef2f6;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.status-completed,
.status-ready {
  background: #fff7ed;
  color: var(--accent-strong);
}

.status-active {
  background: #f3f4f6;
  color: var(--graphite);
}

.status-failed {
  background: #fef3f2;
  color: var(--danger);
}

.status-transcribing,
.status-analyzing,
.status-generating {
  background: #fff7ed;
  color: var(--warning);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-actions {
  display: grid;
  width: min(380px, 100%);
  gap: 12px;
  justify-items: stretch;
  flex: 0 0 min(380px, 100%);
}

.page-actions .status {
  justify-self: end;
}

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

.action-grid form {
  margin: 0;
}

.action-grid button,
.action-grid .button-link {
  width: 100%;
  min-height: 48px;
}

.action-wide {
  grid-column: 1 / -1;
}

.compact-actions {
  width: min(320px, 100%);
  flex-basis: min(320px, 100%);
}

.compact-panel {
  margin-bottom: 18px;
}

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

.training-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 6px 12px;
  color: var(--graphite);
  font-weight: 650;
}

.training-links a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
}

.role-grid,
.report-summary,
.columns {
  display: grid;
  gap: 16px;
}

.analysis-overview {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.role-card {
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
  overflow-wrap: anywhere;
}

.role-card-seller {
  border-color: #fdba74;
  background: #fff7ed;
}

.role-card-buyer {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.role-grid strong,
.report-summary strong {
  display: block;
  margin-top: 2px;
}

.role-card small {
  display: block;
  margin: 2px 0 10px;
  color: var(--muted);
}

.report-summary,
.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 16px;
}

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

.metric-card,
.insight-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.metric-card strong {
  overflow-wrap: anywhere;
}

.feedback-reason {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  padding: 14px 16px;
  margin: 14px 0 18px;
}

.feedback-reason span {
  display: block;
  margin-bottom: 5px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.feedback-reason p {
  margin: 0;
  overflow-wrap: anywhere;
}

.metric-card-stage {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.metric-card-verdict {
  border-color: #fecaca;
  background: #fef2f2;
}

.metric-card-score {
  border-color: #fdba74;
  background: #fff7ed;
}

.metric-card-quality,
.metric-card-next {
  border-color: #fed7aa;
  background: #fff7ed;
}

.metric-card-outcome p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.metric-card-outcome-bought {
  border-color: #86efac;
  background: #f0fdf4;
}

.metric-card-outcome-bought strong {
  color: #166534;
}

.metric-card-outcome-not_bought {
  border-color: #fecaca;
  background: #fef2f2;
}

.metric-card-outcome-not_bought strong {
  color: #b91c1c;
}

.metric-card-outcome-incomplete {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.metric-card-outcome-incomplete strong {
  color: var(--graphite);
}

.insight-card {
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--border);
}

.insight-card h3 {
  font-size: 16px;
}

.insight-need {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.insight-need::before {
  background: var(--blue);
}

.insight-strength {
  border-color: #fdba74;
  background: #fff7ed;
}

.insight-strength::before {
  background: var(--accent);
}

.insight-risk {
  border-color: #fecaca;
  background: #fef2f2;
}

.insight-risk::before {
  background: var(--danger);
}

.insight-missed {
  border-color: #fed7aa;
  background: #fff7ed;
}

.insight-missed::before {
  background: var(--gold);
}

.insight-objection {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.insight-objection::before {
  background: var(--graphite);
}

.insight-recommendation {
  border-color: #fdba74;
  background: #fff7ed;
}

.insight-recommendation::before {
  background: var(--accent);
}

.rule-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
  counter-reset: rule;
}

.rule-list li {
  position: relative;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px 10px 48px;
  counter-increment: rule;
}

.rule-list li::before {
  content: counter(rule);
  position: absolute;
  left: 12px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.lead {
  max-width: 900px;
  color: var(--graphite);
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
}

li + li {
  margin-top: 6px;
}

.transcript {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  border-radius: 8px;
  background: var(--ink);
  color: #f2f4f7;
  padding: 16px;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.trainer-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.trainer-brief {
  position: sticky;
  top: 84px;
}

.brief-block + .brief-block {
  margin-top: 16px;
}

.section-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-title-line h2 {
  margin-bottom: 12px;
}

.difficulty-card {
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.difficulty-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.difficulty-card p {
  margin: 0;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: normal;
}

.brief-block span,
.chat-message span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.brief-situation,
.brief-buyer,
.brief-goal,
.brief-criteria {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.brief-situation {
  border-color: #fdba74;
  background: #fff7ed;
}

.brief-buyer {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.brief-goal {
  border-color: #fdba74;
  background: #fff7ed;
}

.brief-criteria {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.brief-block p {
  margin-bottom: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--graphite);
  padding: 5px 10px;
  font-size: 13px;
}

.trainer-chat {
  min-height: 560px;
}

.trainer-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trainer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.trainer-actions form {
  margin: 0;
}

.trainer-actions button {
  min-height: 44px;
}

.dialogue-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
}

.dialogue-limits span,
.dialogue-finished-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--accent-strong);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.dialogue-finished-note {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px 14px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 4px;
  margin: 0 0 14px;
}

.mode-switch-button {
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--graphite);
  padding: 6px 14px;
  box-shadow: none;
}

.mode-switch-button:hover,
.mode-switch-button.is-active {
  background: var(--ink);
  color: #fff;
}

.mode-panel {
  display: none;
}

.mode-panel.is-active {
  display: block;
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f5f0;
  padding: 16px;
}

.chat-message {
  width: min(82%, 680px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.05);
}

.chat-message p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.chat-message-seller {
  align-self: flex-end;
  border-color: #fdba74;
  background: #fff7ed;
}

.chat-message-buyer {
  align-self: flex-start;
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
  align-items: end;
}

.chat-form textarea {
  resize: vertical;
}

.voice-trainer {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 16px;
}

.voice-stage {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.voice-stage h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.voice-orb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid #fdba74;
  border-radius: 50%;
  background: #fff7ed;
}

.voice-orb span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 10px rgba(249, 115, 22, 0.14);
}

.voice-orb[data-voice-state="listening"] {
  border-color: #fdba74;
  background: #fff7ed;
}

.voice-orb[data-voice-state="listening"] span {
  background: var(--accent);
  box-shadow: 0 0 0 14px rgba(249, 115, 22, 0.18);
}

.voice-orb[data-voice-state="thinking"] {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.voice-orb[data-voice-state="thinking"] span {
  background: var(--graphite);
}

.voice-orb[data-voice-state="error"] {
  border-color: #fecaca;
  background: #fef2f2;
}

.voice-orb[data-voice-state="error"] span {
  background: var(--danger);
}

.voice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.voice-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--graphite);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
}

.voice-settings {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  max-width: 520px;
}

.voice-settings label {
  color: var(--graphite);
  font-size: 13px;
  font-weight: 750;
}

.voice-settings select {
  min-height: 44px;
  border-color: #fdba74;
  background: #fff;
  font-weight: 650;
}

.voice-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.voice-controls form {
  margin: 0;
}

.voice-controls button {
  width: 100%;
  min-height: 50px;
}

.voice-start-button,
.voice-talk-button {
  grid-column: span 2;
}

.voice-talk-button {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fff;
  touch-action: none;
  user-select: none;
}

.voice-talk-button:hover:not(:disabled),
.voice-talk-button.is-recording {
  background: var(--accent-strong);
}

.voice-talk-button.is-recording {
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.voice-finish-form {
  grid-column: span 2;
}

.voice-status {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--graphite);
  padding: 10px 12px;
}

.voice-trainer[data-voice-state="error"] .voice-status {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

.voice-log {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  margin-top: 14px;
}

.voice-log-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.voice-log-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.voice-log-item p {
  margin-bottom: 0;
}

.voice-log-seller {
  border-color: #fdba74;
  background: #fff7ed;
}

.voice-log-buyer {
  border-color: #c4c8ce;
  background: #f3f4f6;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 36, 40, 0.58);
  backdrop-filter: blur(7px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-card {
  width: min(420px, 100%);
  border: 1px solid rgba(253, 186, 116, 0.6);
  border-radius: 12px;
  background: #fffaf4;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
  padding: 28px;
  text-align: center;
}

.loading-card strong {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 22px;
}

.loading-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.loading-pulse {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.34);
  animation: loading-pulse 1.35s ease-out infinite;
}

.loading-pulse::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #fff7ed;
}

html.is-loading,
html.is-loading body {
  overflow: hidden;
}

@keyframes loading-pulse {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.36);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 22px rgba(249, 115, 22, 0);
  }

  100% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

@media (max-width: 760px) {
  .topbar,
  .page-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
    flex-basis: auto;
  }

  .page-actions .status {
    justify-self: start;
  }

  .grid,
  .report-grid,
  .trainer-layout,
  .role-grid,
  .report-summary,
  .columns,
  .insight-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .trainer-brief {
    position: static;
  }

  .trainer-chat-head,
  .chat-form {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .mode-switch,
  .voice-stage,
  .voice-controls {
    grid-template-columns: 1fr;
  }

  .voice-start-button,
  .voice-talk-button,
  .voice-finish-form {
    grid-column: auto;
  }

  .chat-message {
    width: 100%;
  }

  .prompt-summary {
    min-width: 0;
  }
}

/* ============================================================
   Тренажёр по продукту: списки, таблицы, материалы, оценка
   ============================================================ */
.trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.trainer-product-card form { margin-top: 12px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted, #6b7280);
  margin: 8px 0 6px;
}
.difficulty-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.difficulty-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(120, 120, 140, 0.3);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.difficulty-option input { accent-color: #16a34a; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(120, 120, 140, 0.16);
  vertical-align: top;
}
.data-table th {
  font-weight: 600;
  color: var(--muted, #6b7280);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.scoring-table td:nth-child(2) { white-space: nowrap; font-weight: 600; }
.criteria-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.criteria-list li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.crit-mark {
  flex: 0 0 18px; height: 18px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff;
}
.crit-ok .crit-mark { background: #16a34a; }
.crit-bad .crit-mark { background: #dc2626; }
.crit-unknown .crit-mark { background: #a1a1aa; }
.crit-ok { opacity: .72; }
.crit-body { display: block; }
.crit-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; background: rgba(220, 38, 38, .12);
  color: #b91c1c; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.crit-reason { display: block; margin-top: 2px; font-size: 12.5px; color: #6b7280; }

.scoring-warning {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, .1);
  color: #92400e;
  font-size: 13.5px;
  line-height: 1.5;
}
.tight-list { margin: 0; padding-left: 18px; }
.tight-list li { margin-bottom: 4px; }

.training-list { list-style: none; padding: 0; margin: 0 0 12px; }
.training-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(120, 120, 140, 0.14);
}

.row-actions { display: flex; gap: 8px; }
.row-actions form { margin: 0; }
.row-actions button { padding: 6px 10px; font-size: 13px; }

.material-checklist {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.error-text { color: #dc2626; }

.status-pending { background: rgba(148, 163, 184, 0.18); color: #475569; }
.status-extracting { background: rgba(59, 130, 246, 0.16); color: #1d4ed8; }

/* ============================================================
   Полировка тренажёра: кнопки, уровни, настройка, оценка
   ============================================================ */

/* Первичная кнопка (submit в новых формах) */
.btn-primary {
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 11px 20px;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.28);
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-strong); }
button.secondary { background: #fff; color: var(--graphite); }
button.secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
button.danger { border-color: var(--danger-soft); color: var(--danger); background: #fff; }
button.danger:hover { background: var(--danger-soft); }

.product-block { margin-bottom: 20px; }
.product-desc { margin-top: -4px; }

/* --- Выбор уровня сложности (карточки-радио) --- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}
.level-card { position: relative; cursor: pointer; display: block; }
.level-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.level-card-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.level-card:hover .level-card-inner { border-color: var(--accent-soft); }
.level-card input:checked + .level-card-inner {
  border-color: var(--accent);
  background: #fff7ed;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.16);
}
.level-card input:focus-visible + .level-card-inner { outline: 2px solid var(--accent); outline-offset: 2px; }
.level-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.level-head strong { font-size: 16px; }
.level-tagline { font-size: 12.5px; font-weight: 700; color: var(--accent-strong); }
.level-who { font-size: 13px; color: var(--muted); line-height: 1.45; }
.level-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.level-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--graphite);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
}

/* --- Прогресс готовности материалов --- */
.setup-progress-panel { margin-bottom: 18px; }
.setup-progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.progress-track { height: 10px; border-radius: 999px; background: var(--graphite-soft); overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .3s; }

/* --- Слоты настройки материалов --- */
.setup-slots { display: flex; flex-direction: column; gap: 14px; }
.setup-slot { transition: border-color .15s; }
.setup-slot.slot-done { border-color: rgba(22, 101, 52, 0.35); }
.slot-top { display: flex; align-items: center; gap: 12px; }
.slot-num {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--graphite-soft);
  color: var(--graphite);
  font-weight: 800;
  font-size: 14px;
}
.slot-num-done { background: var(--ok-soft); color: var(--ok); }
.slot-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.slot-title strong { font-size: 15.5px; }
.slot-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--graphite-soft); border-radius: 999px; padding: 2px 8px; }
.slot-badge.required { color: var(--accent-strong); background: #fff7ed; }
.slot-items { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.slot-items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.slot-item-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.slot-upload { margin-top: 12px; }
.slot-upload summary { cursor: pointer; font-weight: 650; color: var(--accent-strong); font-size: 14px; padding: 4px 0; }
.upload-inline { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-width: 520px; }
.upload-inline input[type="text"], .upload-inline textarea, .upload-inline input[type="file"] { width: 100%; }
.setup-hint { margin-top: 14px; }

/* --- Бейджи и гейдж балла --- */
.score-badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 3px 11px; font-weight: 750; font-size: 13px; }
.score-good { background: var(--ok-soft); color: var(--ok); }
.score-mid { background: #fff7ed; color: var(--accent-strong); }
.score-low { background: #fef3c7; color: #92400e; }
.score-bad { background: var(--danger-soft); color: var(--danger); }
.score-none { background: var(--graphite-soft); color: var(--muted); }

.feedback-panel .feedback-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 8px 0 20px; }
.score-gauge {
  --gauge: var(--accent);
  flex: none;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge) calc(var(--pct) * 3.6deg), var(--graphite-soft) 0);
  display: grid; place-items: center;
}
.score-gauge.score-good { --gauge: #16a34a; }
.score-gauge.score-mid { --gauge: var(--accent); }
.score-gauge.score-low { --gauge: #d97706; }
.score-gauge.score-bad { --gauge: var(--danger); }
.score-gauge-inner { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.score-gauge-inner strong { font-size: 30px; line-height: 1; }
.score-gauge-inner span { font-size: 12px; color: var(--muted); }
.feedback-hero-text { flex: 1; min-width: 260px; }
.feedback-hero-text h3 { margin: 8px 0; }
.outcome-pill { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 13px; }
.outcome-bought { background: var(--ok-soft); color: var(--ok); }
.outcome-not_bought { background: var(--danger-soft); color: var(--danger); }
.outcome-incomplete { background: var(--graphite-soft); color: var(--muted); }

/* ════════════════════════════════════════════════════════════
   TRAINER AI — фирменная тема
   Градиент «закат»: янтарь → коралл → фуксия.
   Уровни сложности кодируются цветом: изумруд / янтарь / роза.
   ════════════════════════════════════════════════════════════ */
:root{
  --g-1:#f59e0b;           /* янтарь */
  --g-2:#f97316;           /* оранжевый */
  --g-3:#ef4444;           /* коралл  */
  --g-4:#db2777;           /* фуксия  */
  --indigo:#6366f1;
  --indigo-soft:#eef2ff;
  --emerald:#10b981;
  --emerald-soft:#ecfdf5;
  --rose:#f43f5e;
  --rose-soft:#fff1f2;
  --amber:#f59e0b;
  --amber-soft:#fffbeb;
  --brand-grad:linear-gradient(135deg,var(--g-1) 0%,var(--g-2) 38%,var(--g-3) 72%,var(--g-4) 100%);
  --brand-grad-soft:linear-gradient(135deg,#fff7ed 0%,#fff1f2 55%,#fdf4ff 100%);
}

/* ---------- Фон и шапка ---------- */
body{
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(219,39,119,.10), transparent 60%),
    radial-gradient(760px 420px at 4% -6%, rgba(245,158,11,.16), transparent 60%),
    linear-gradient(180deg,#fffaf4 0,var(--bg) 340px), var(--bg);
}
.topbar{background:rgba(255,251,246,.86);border-bottom:1px solid rgba(217,209,199,.7);}
.topbar::after{
  content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;
  background:var(--brand-grad);opacity:.9;
}
.topbar{position:sticky;}

/* Логотип-градиент */
.brand-mark{
  background:var(--brand-grad);
  box-shadow:0 6px 16px rgba(239,68,68,.32);
  letter-spacing:-.5px;
}
.brand span:last-child{
  background:linear-gradient(135deg,#1f2428 30%,#c2410c 120%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}

/* ---------- Заголовок страницы ---------- */
.page-head{
  position:relative;overflow:hidden;
  background:var(--brand-grad-soft);
  border-color:rgba(249,115,22,.22);
}
.page-head::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:var(--brand-grad);
}
.page-head h1{
  background:linear-gradient(120deg,#1b1f23 20%,#c2410c 78%,#be185d 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.eyebrow{
  border-color:transparent;color:#fff;
  background:var(--brand-grad);
  box-shadow:0 4px 12px rgba(239,68,68,.22);
}

/* ---------- Кнопки ---------- */
.btn-primary,.button-link{
  background:var(--brand-grad);border:none;
  box-shadow:0 8px 20px rgba(239,68,68,.26);
}
.btn-primary:hover,.button-link:hover{filter:brightness(1.06);box-shadow:0 10px 26px rgba(239,68,68,.34);}
.button-link.secondary{
  background:#fff;color:var(--graphite);border:1px solid var(--border);box-shadow:none;
}
.button-link.secondary:hover{border-color:var(--g-2);color:var(--accent-strong);filter:none;}

/* ---------- Карточки уровней: цвет по сложности ---------- */
.level-card:nth-child(1) .level-card-inner{background:var(--emerald-soft);}
.level-card:nth-child(1) .level-tagline{color:#047857;}
.level-card:nth-child(1) input:checked + .level-card-inner{
  border-color:var(--emerald);box-shadow:0 10px 24px rgba(16,185,129,.22);}

.level-card:nth-child(2) .level-card-inner{background:var(--amber-soft);}
.level-card:nth-child(2) .level-tagline{color:#b45309;}
.level-card:nth-child(2) input:checked + .level-card-inner{
  border-color:var(--amber);box-shadow:0 10px 24px rgba(245,158,11,.24);}

.level-card:nth-child(3) .level-card-inner{background:var(--rose-soft);}
.level-card:nth-child(3) .level-tagline{color:#be123c;}
.level-card:nth-child(3) input:checked + .level-card-inner{
  border-color:var(--rose);box-shadow:0 10px 24px rgba(244,63,94,.22);}

.level-card:nth-child(n+4) .level-card-inner{background:var(--indigo-soft);}
.level-card:nth-child(n+4) .level-tagline{color:#4338ca;}
.level-card:nth-child(n+4) input:checked + .level-card-inner{
  border-color:var(--indigo);box-shadow:0 10px 24px rgba(99,102,241,.22);}

.level-card-inner{border-width:2px;}
.level-chip{background:rgba(255,255,255,.75);backdrop-filter:blur(2px);}

/* ---------- Панели ---------- */
.panel{transition:box-shadow .18s,transform .18s;}
.product-block{position:relative;overflow:hidden;}
.product-block::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--brand-grad);
}

/* Слоты настройки: градиентная нумерация */
.slot-num{background:var(--brand-grad);color:#fff;box-shadow:0 4px 10px rgba(239,68,68,.24);}
.slot-num-done{background:linear-gradient(135deg,#34d399,#059669);box-shadow:0 4px 10px rgba(16,185,129,.3);}
.setup-slot.slot-done{border-color:rgba(16,185,129,.4);background:linear-gradient(180deg,#f6fefb 0,#fff 60%);}
.progress-fill{background:var(--brand-grad);}

/* ---------- Диалог ---------- */
.chat-message-seller{border-color:rgba(249,115,22,.35);
  background:linear-gradient(135deg,#fff7ed,#fff1f2);}
.chat-message-buyer{background:linear-gradient(135deg,#f8fafc,#eef2ff);
  border-color:rgba(99,102,241,.22);}

/* ---------- Оценка ---------- */
.feedback-panel{position:relative;overflow:hidden;}
.feedback-panel::before{
  content:"";position:absolute;left:0;right:0;top:0;height:4px;background:var(--brand-grad);
}
.score-gauge{filter:drop-shadow(0 8px 18px rgba(0,0,0,.10));}

/* ---------- Статусы и бейджи ---------- */
.status-ready,.status-completed{background:var(--emerald-soft);color:#047857;}
.status-active{background:var(--amber-soft);color:#b45309;}
.status-failed{background:var(--rose-soft);color:#be123c;}
.pill-accent,.slot-badge.required{background:var(--brand-grad);color:#fff;border:none;}

/* ---------- Таблицы ---------- */
.data-table thead th{
  background:linear-gradient(180deg,#fdf6f0,#f8f5f0);
  border-bottom:2px solid rgba(249,115,22,.22);
}
.data-table tbody tr:hover{background:rgba(255,247,237,.6);}

/* ---------- Вход ---------- */
.auth-body{
  background:
    radial-gradient(820px 460px at 78% 8%, rgba(219,39,119,.16), transparent 62%),
    radial-gradient(700px 420px at 12% 88%, rgba(245,158,11,.20), transparent 62%),
    linear-gradient(160deg,#fffaf4,#f7f2ec);
}
.auth-card{position:relative;overflow:hidden;box-shadow:0 24px 60px rgba(31,36,40,.14);}
.auth-card::before{
  content:"";position:absolute;left:0;right:0;top:0;height:4px;background:var(--brand-grad);
}
.auth-form button{
  background:var(--brand-grad);border:none;color:#fff;
  box-shadow:0 8px 20px rgba(239,68,68,.26);
}
.auth-form button:hover{filter:brightness(1.06);}

/* Бейдж направления в шапке (копия приложения для подразделения). */
.instance-badge{
  display:inline-flex;align-items:center;margin-left:10px;padding:3px 10px;border-radius:999px;
  font-size:12px;font-weight:700;letter-spacing:.02em;color:#c2410c;background:#fff7ed;
  border:1px solid rgba(249,115,22,.35);white-space:nowrap;
}
.nav-switch{font-size:13px;color:#6d737a;}
.auth-switch{margin:4px 0 0;font-size:13px;}
.auth-switch a{color:#6d737a;text-decoration:none;}
.auth-switch a:hover{color:#c2410c;}

/* Портрет клиента ММБ: выбор при старте и карточка в тренировке. */
.portrait-picker{margin:14px 0 16px;border:1px solid var(--line,#e2dbd1);border-radius:12px;padding:10px 14px;background:#fffdfa;}
.portrait-picker summary{cursor:pointer;font-weight:600;font-size:14px;}
.portrait-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:12px;}
.portrait-grid .field span{display:block;font-size:12px;color:#6d737a;margin-bottom:4px;}
.portrait-grid select{width:100%;}
.difficulty-card .portrait-line{margin:4px 0 0;font-size:12.5px;color:#4b5057;line-height:1.45;}

/* Отчёт по ФТ-4.3: сильные стороны, пробелы, план, критические ошибки, ограничители. */
.outcome-next_step{background:#eff6ff;color:#1d4ed8;border-color:rgba(29,78,216,.25);}
.feedback-caps,.feedback-critical{border-radius:12px;padding:12px 16px;margin:14px 0;}
.feedback-caps{background:#fff7ed;border:1px solid rgba(249,115,22,.3);}
.feedback-critical{background:#fee4e2;border:1px solid rgba(180,35,24,.3);}
.feedback-caps>span,.feedback-critical>span{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px;}
.feedback-caps>span{color:#c2410c;}.feedback-critical>span{color:#b42318;}
.feedback-caps ul,.feedback-critical ul{margin:0;padding-left:18px;}
.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:18px 0;}
.summary-card{border:1px solid var(--line,#e2dbd1);border-radius:14px;padding:14px 16px;background:#fff;}
.summary-card h3{margin:0 0 8px;font-size:15px;}
.summary-card ul,.summary-card ol{margin:0;padding-left:18px;font-size:13.5px;line-height:1.5;}
.summary-ok{border-top:4px solid #16a34a;}.summary-bad{border-top:4px solid #ef4444;}.summary-plan{border-top:4px solid #f97316;}
.summary-card .next-step{margin:10px 0 0;font-size:13.5px;background:#fff7ed;border-radius:8px;padding:8px 10px;}
.criteria-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:6px 0 10px;}
.crit-pill{display:inline-flex;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;}
.crit-pill-ok{background:#f0fdf4;color:#166534;}.crit-pill-bad{background:#fee4e2;color:#b42318;}

/* Прогресс сотрудника (ФТ-8) и команда (ФТ-3.2). */
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:0 0 18px;}
.stat-tile{background:#fff;border:1px solid var(--line,#e2dbd1);border-radius:14px;padding:12px 16px;}
.stat-tile span{display:block;font-size:11.5px;color:#6d737a;text-transform:uppercase;letter-spacing:.05em;}
.stat-tile strong{display:block;font-size:26px;font-weight:800;letter-spacing:-.5px;margin-top:2px;}
.stat-tile small{display:block;font-size:11.5px;color:#6d737a;}
.stat-trend-up strong{color:#166534;}.stat-trend-down strong{color:#b42318;}
.score-timeline{display:flex;align-items:flex-end;gap:8px;height:96px;margin:6px 0 18px;padding:0 4px;}
.score-bar{position:relative;flex:1;max-width:48px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;text-decoration:none;}
.score-bar-fill{display:block;width:100%;border-radius:6px 6px 2px 2px;background:#f97316;min-height:3px;transition:opacity .15s;}
.score-bar-good .score-bar-fill{background:#16a34a;}.score-bar-mid .score-bar-fill{background:#f59e0b;}.score-bar-low .score-bar-fill{background:#ef4444;}
.score-bar:hover .score-bar-fill{opacity:.8;}
.score-bar-label{position:absolute;top:-18px;left:0;right:0;text-align:center;font-size:11px;color:#6d737a;}
.skills-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:6px 0 14px;}
.skills-card{border:1px solid var(--line,#e2dbd1);border-radius:14px;padding:14px 16px;background:#fff;}
.skills-card h3{margin:0 0 8px;font-size:15px;}
.skills-card ul{margin:0;padding-left:18px;font-size:13px;line-height:1.5;}
.skills-ok{border-top:4px solid #16a34a;}.skills-bad{border-top:4px solid #ef4444;}.skills-repeat{border-top:4px solid #f97316;}
.block-rates{display:grid;gap:8px;margin-top:6px;}
.block-rate{display:grid;grid-template-columns:minmax(160px,1fr) 2fr auto;gap:10px;align-items:center;font-size:12.5px;}
.block-rate-bar{height:8px;background:#f1ece4;border-radius:999px;overflow:hidden;}
.block-rate-bar span{display:block;height:100%;background:linear-gradient(90deg,#f59e0b,#ef4444);border-radius:999px;}
.block-rate-value{color:#6d737a;white-space:nowrap;}
.trend{font-weight:700;}.trend-up{color:#166534;}.trend-down{color:#b42318;}.trend-flat{color:#6d737a;}
.chip{display:inline-flex;padding:2px 8px;border-radius:999px;font-size:11.5px;font-weight:700;margin:2px 4px 2px 0;}
.chip-bad{background:#fee4e2;color:#b42318;}.chip-repeat{background:#fff7ed;color:#c2410c;}
.notice.info{background:#eff6ff;border-color:rgba(29,78,216,.25);}
.score-bar-bad .score-bar-fill{background:#b42318;}

/* Правки дизайн-ревью: столбики прогресса, активный пункт меню. */
.score-timeline{height:auto;align-items:flex-end;gap:10px;margin:4px 0 20px;}
.score-bar{height:120px;max-width:40px;justify-content:flex-end;align-items:center;}
.score-bar-label{position:static;font-size:11.5px;font-weight:700;color:#4b5057;margin-bottom:4px;}
.score-bar-fill{width:100%;}
.score-bar-date{font-size:10.5px;color:#9a9ea4;margin-top:4px;white-space:nowrap;}
.nav a.is-active{color:#c2410c;font-weight:700;position:relative;}
.nav a.is-active::after{content:"";position:absolute;left:8px;right:8px;bottom:-6px;height:2px;border-radius:2px;background:linear-gradient(90deg,#f59e0b,#ef4444);}

/* Фоновая очередь: индикатор ожидания на странице тренировки. */
.busy-note{display:flex;gap:12px;align-items:center;margin:0 0 14px;padding:12px 16px;border-radius:12px;background:#fff7ed;border:1px solid rgba(249,115,22,.3);}
.busy-note p{margin:2px 0 0;font-size:12.5px;color:#6d737a;}
.busy-dot{flex:none;width:12px;height:12px;border-radius:50%;background:#f97316;box-shadow:0 0 0 0 rgba(249,115,22,.5);animation:busy-pulse 1.4s infinite;}
@keyframes busy-pulse{0%{box-shadow:0 0 0 0 rgba(249,115,22,.5)}70%{box-shadow:0 0 0 10px rgba(249,115,22,0)}100%{box-shadow:0 0 0 0 rgba(249,115,22,0)}}
