:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --surface-tint: #f7f7f7;
  --ink: #222222;
  --muted: #666666;
  --line: #e5e5e5;
  --primary: #1E2761;
  --primary-dark: #14204E;
  --primary-soft: #EAF0FA;
  --accent: #C8901C;
  --accent-soft: #fff9ee;
  --chart-bar: #5A6FB0;
  --warn: #8a5a12;
  --danger: #b42318;
  --nav: #14204e;
  --nav-muted: #c7cce0;
  --brand: #ff8a1f;
  --shadow: 0 18px 46px rgba(24, 24, 24, 0.1);
  --shadow-soft: 0 8px 24px rgba(24, 24, 24, 0.07);
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("/static/assets/fonts/barlow-condensed-700-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(30, 39, 97, 0.06) 0 22%, transparent 22% 100%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 46%, #eeeeee 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #ffffff;
}

.login-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(720px, 100%);
  padding: 38px 42px 36px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card::before {
  content: "AI SALES ROLEPLAY TRAINING";
  position: absolute;
  top: 18px;
  right: 34px;
  color: #9b9b9b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.login-card h1 {
  color: var(--ink);
  font-size: 38px;
  line-height: 1.18;
  white-space: nowrap;
}

.login-copy {
  color: var(--muted);
  line-height: 1.7;
}

.login-message {
  min-height: 1.5em;
  color: var(--muted);
  line-height: 1.5;
}

.login-message.error {
  color: var(--danger);
}

.app-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.top-bar,
.control-band,
.scenario-panel,
.scenario-request-panel,
.call-surface,
.dashboard-panel,
.team-panel,
.history-panel,
.message-area {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 24px 28px;
  backdrop-filter: blur(8px);
}

.top-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--primary);
}

.app-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.app-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.app-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(30, 39, 97, 0.18);
}

.app-tab:disabled,
.app-tab.disabled {
  background: #f1f1f1;
  color: #999;
  pointer-events: none;
}

.tab-panel {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  line-height: 1.35;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge,
.timer {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.status-badge.active {
  border-color: #c6ced4;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.status-badge.busy {
  position: relative;
  padding-left: 28px;
  animation: statusPulse 1.2s ease-in-out infinite;
}

.status-badge.busy::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(30, 39, 97, 0.28);
  transform: translateY(-50%);
  animation: statusDot 1.2s ease-out infinite;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 0;
  padding: 20px;
}

.usage-notice {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid #ead6ad;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #70440a;
  font-size: 13px;
  line-height: 1.65;
}

.usage-notice-title {
  margin: 0 0 4px;
  font-weight: 800;
}

.usage-notice-list {
  margin: 0;
  padding-left: 1.2em;
}

.usage-notice-list li + li {
  margin-top: 2px;
}

.usage-notice a {
  color: var(--primary-dark);
  font-weight: 800;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(24, 24, 24, 0.03);
}

select:focus,
input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 39, 97, 0.14);
  outline: none;
}

button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(30, 39, 97, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover:not(:disabled),
.text-button:hover:not(:disabled) {
  border-color: #c6ced4;
  background: var(--primary-soft);
}

.text-button {
  min-height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.session-stop {
  color: #b23a36;
  border-color: #e6b8b6;
}

.session-stop:hover:not(:disabled) {
  background: #fdecea;
  border-color: #d99b98;
}

.session-pause {
  color: var(--primary-dark);
  border-color: #aeb9dc;
}

.session-pause:hover:not(:disabled),
.session-pause.paused {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.pause-limit-hint {
  max-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.scenario-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 22px 24px;
  border-top: 4px solid var(--primary);
}

.scenario-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.pre-goals-card {
  display: grid;
  gap: 18px;
  margin-top: 14px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(20, 32, 78, 0.04);
}

.pre-goals-card::before {
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand, #ff8a1f);
  content: "";
}

.pre-goals-card[hidden] {
  display: none;
}

.pre-purpose h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.pre-purpose p {
  margin: 0;
  line-height: 1.7;
}

.pre-purpose:not([hidden]) + #preGoalsContent:not([hidden]) {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

#preGoalsContent:not([hidden]) {
  display: grid;
  gap: 18px;
}

.pause-availability-notice {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #cbd5ee;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 14px;
  font-weight: 700;
}

.pause-availability-notice[hidden],
.pause-state-banner[hidden] {
  display: none;
}

.pre-goals-heading {
  display: grid;
  gap: 4px;
}

.pre-goals-heading span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.pre-goals-heading h2 {
  font-size: 20px;
}

.pre-goals-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pre-goals-group {
  padding: 14px 16px;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
}

.pre-goals-group.caution {
  background: #fff5f4;
  border-left-color: var(--danger);
}

.pre-goals-group h3 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 15px;
}

.pre-goals-group.caution h3 {
  color: var(--danger);
}

.pre-goals-group ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.pre-goals-group li {
  line-height: 1.55;
}

.pre-goals-pass-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scenario-request-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  background: #fff;
}

.scenario-request-panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.scenario-request-panel h2::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 3px;
  background: var(--brand);
}

.scenario-request-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(30, 39, 97, 0.18);
}

.download-button:hover {
  background: var(--primary);
}

.call-surface {
  display: grid;
  gap: 20px;
  margin-top: 18px;
  scroll-margin-top: 112px;
  padding: 24px;
}

.meeting-stall-notice {
  margin: 14px 24px 0;
  padding: 12px 16px;
  border: 1px solid #d4a94e;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #fff8e6;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.6;
}

.meeting-stall-notice[hidden] {
  display: none;
}

.pause-state-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #cbd5ee;
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.result-panel {
  margin-top: 18px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.result-summary {
  color: var(--primary-dark);
  font-weight: 800;
}

.result-empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-tint);
}

.result-empty.evaluation-pending {
  padding: 0;
  border-style: solid;
  border-color: #c6ced4;
  color: var(--ink);
  background: var(--primary-soft);
}

.scoring-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.scoring-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #dbe1e5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: scoringSpin 0.9s linear infinite;
}

.scoring-copy {
  display: grid;
  gap: 4px;
  line-height: 1.6;
}

.scoring-copy strong {
  font-size: 16px;
}

.scoring-copy span,
.scoring-step {
  color: var(--muted);
  font-size: 13px;
}

.scoring-step {
  padding: 6px 10px;
  border: 1px solid #c6ced4;
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.scoring-progress {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe1e5;
}

.scoring-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scoringProgress 1.35s ease-in-out infinite;
}

.result-content {
  display: grid;
  gap: 18px;
}

.result-content > .score-overview,
.result-content > .score-detail-link {
  display: none;
}

.score-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.score-detail-link {
  justify-self: start;
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.score-detail-link::after {
  content: " ↓";
}

.score-detail-link:hover {
  color: var(--primary-dark);
}

.score-tile {
  padding: 18px;
  border: 1px solid #d6dde2;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--primary-soft));
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-tile strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 32px;
  line-height: 1.2;
}

.partial-notice {
  padding: 12px 14px;
  border: 1px solid #ead6ad;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #70440a;
  line-height: 1.6;
}

.transcription-quality-summary {
  position: relative;
  padding: 11px 14px 11px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.transcription-quality-summary::before {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand, #ff8a1f);
  content: "";
}

.retry-unscored-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #d6dde2;
  border-radius: 6px;
  background: var(--surface-tint);
}

.retry-unscored-area p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.result-section {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

#detailFeedbackSection {
  scroll-margin-top: 112px;
}

.result-section h3 {
  margin: 0;
  padding: 18px 24px 0;
  font-size: 18px;
}

.result-section h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.feedback-summary {
  line-height: 1.75;
  color: var(--ink);
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feedback-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink);
  line-height: 1.6;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0;
  overflow: hidden;
  margin: 14px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid #eceef4;
  background: #fff;
}

.metric-item:first-child {
  border-left: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  color: var(--nav);
  font: italic 700 30px/1.1 "Barlow Condensed", "Arial Narrow", sans-serif;
}

.metric-value small {
  margin-left: 3px;
  color: #4f5667;
  font: normal 700 14px "Segoe UI", "Yu Gothic UI", sans-serif;
}

.metric-target {
  color: #4f5667;
  font-size: 12px;
  font-style: normal;
}

.detail-groups {
  display: grid;
  gap: 0;
}

.feedback-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  overflow: hidden;
  margin: 14px 24px 6px;
  border-radius: 10px;
  color: #fff;
  background: var(--nav);
}

.feedback-score-slab {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 12px 34px 12px 20px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  color: #241b0c;
  background: var(--brand);
  animation: feedbackSlabIn 0.5s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.feedback-score-slab b {
  font: italic 700 54px/1 "Barlow Condensed", "Arial Narrow", sans-serif;
}

.feedback-score-slab span {
  font-weight: 700;
}

.feedback-score-slab em {
  align-self: center;
  margin-left: 10px;
  padding: 1px 8px;
  border-radius: 3px;
  color: #fff;
  background: #241b0c;
  font: normal 700 15px "Barlow Condensed", "Arial Narrow", sans-serif;
}

.feedback-head-body {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 20px 14px 14px;
}

.feedback-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--nav-muted);
  font-size: 12px;
}

.feedback-tally strong {
  margin-left: 4px;
  color: #fff;
  font: 700 16px "Barlow Condensed", "Arial Narrow", sans-serif;
}

.feedback-score-track {
  display: flex;
  gap: 3px;
  height: 10px;
}

.feedback-score-segment {
  flex-basis: 0;
  min-width: 2px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2px;
}

.feedback-score-segment.acquired {
  border-color: var(--brand);
  background: var(--brand);
  animation: feedbackSegmentIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(0.35s + var(--segment-index) * 70ms);
}

.feedback-track-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--nav-muted);
  font-size: 11px;
}

.feedback-track-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 1em;
}

.feedback-track-legend > span,
.feedback-track-total {
  white-space: nowrap;
}

.feedback-groups {
  display: grid;
  gap: 18px;
  padding: 6px 24px 22px;
}

.detail-group {
  display: grid;
  gap: 0;
}

.detail-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--line);
}

.detail-group-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.detail-group-header small {
  color: #777d8e;
  font-size: 12px;
}

.detail-list {
  display: grid;
}

.detail-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid #f0f1f5;
  background: #fff;
}

.detail-item:nth-child(even) {
  background: #fafbfe;
}

.detail-item.got,
.detail-item.guard {
  animation: feedbackRowIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(0.5s + var(--detail-index) * 70ms);
}

.detail-chip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 2px solid #c4cad8;
  border-radius: 7px;
  color: #fff;
  background: #fff;
  font-size: 17px;
  font-weight: 900;
}

.detail-item.got .detail-chip,
.detail-item.guard .detail-chip {
  border-color: var(--nav);
  background: var(--nav);
  animation: feedbackTick 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(0.6s + var(--detail-index) * 70ms);
}

.detail-item.bad .detail-chip {
  border-color: var(--danger);
  background: var(--danger);
}

.detail-item.unscored .detail-chip {
  color: #777d8e;
  background: #f3f4f7;
}

.detail-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-status {
  color: #777d8e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.detail-item.got .detail-status,
.detail-item.guard .detail-status {
  color: var(--nav);
}

.detail-item.bad .detail-status {
  color: var(--danger);
}

.detail-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.detail-item.open .detail-label,
.detail-item.unscored .detail-label {
  color: #4f5667;
}

.detail-evidence {
  color: #4f5667;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-line;
}

.detail-evidence-prefix {
  margin-right: 0.8em;
  color: #777d8e;
  font-size: 11px;
  font-weight: 800;
}

.detail-evidence-prefix.hint {
  color: var(--brand);
}

.detail-points {
  display: grid;
  justify-items: end;
  text-align: right;
}

.detail-points strong {
  color: var(--nav);
  font: italic 700 26px/1.1 "Barlow Condensed", "Arial Narrow", sans-serif;
}

.detail-item.open .detail-points strong,
.detail-item.unscored .detail-points strong {
  color: #777d8e;
  opacity: 0.55;
}

.detail-item.guard .detail-points strong {
  font-size: 20px;
}

.detail-item.bad .detail-points strong {
  color: var(--danger);
}

.detail-points small {
  color: #777d8e;
  font-size: 11px;
  white-space: nowrap;
}

@keyframes feedbackSlabIn {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
}

@keyframes feedbackSegmentIn {
  from { opacity: 0; transform: scaleX(0.1); transform-origin: left; }
}

@keyframes feedbackRowIn {
  from { opacity: 0; translate: 24px 0; }
}

@keyframes feedbackTick {
  from { opacity: 0; transform: scale(0.5); }
}

@media (max-width: 640px) {
  .result-section h3 {
    padding: 16px 16px 0;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 16px 18px;
  }

  .metric-item:nth-child(3) {
    border-left: 0;
  }

  .metric-item:nth-child(n + 3) {
    border-top: 1px solid #eceef4;
  }

  .feedback-head {
    grid-template-columns: 1fr;
    margin: 12px 16px 4px;
  }

  .feedback-score-slab {
    clip-path: none;
  }

  .feedback-track-note {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .feedback-track-legend {
    display: grid;
    gap: 2px;
  }

  .feedback-groups {
    padding: 4px 16px 18px;
  }

  .detail-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .detail-points {
    grid-column: 2;
    grid-auto-flow: column;
    align-items: baseline;
    justify-items: start;
    justify-content: start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-score-slab,
  .feedback-score-segment.acquired,
  .detail-item.got,
  .detail-item.guard,
  .detail-item.got .detail-chip,
  .detail-item.guard .detail-chip {
    animation: none;
  }
}

.history-panel {
  margin-top: 18px;
  padding: 22px 24px;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px;
}

.history-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ranking-entry {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.sr-only {
  position: absolute !important;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ranking-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background: #11172f;
}

.ranking-overlay[hidden] {
  display: none;
}

.app-shell.ranking-background-blurred {
  pointer-events: none;
}

.app-shell.ranking-background-blurred > * {
  filter: blur(8px) brightness(0.72);
}

.ranking-nav-overlay {
  background: rgba(10, 15, 42, 0.52);
}

.ranking-nav-overlay .ranking-scene {
  background: transparent !important;
  filter: none;
  transform: none;
}

.ranking-nav-overlay .ranking-scene::after {
  background: transparent;
}

.ranking-scene {
  position: absolute;
  inset: -22px;
  background-color: #151d49;
  background-position: center 28%;
  background-size: cover;
  filter: blur(12px) brightness(0.36) saturate(0.78);
  transform: scale(1.04);
}

.ranking-scene::after {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 42, 0.38);
  content: "";
}

.ranking-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(16, 25, 66, 0.88);
  box-shadow: 0 26px 70px rgba(3, 7, 25, 0.5);
  color: #fff;
  backdrop-filter: blur(10px);
}

.ranking-panel-scroll {
  max-height: inherit;
  overflow: auto;
}

.ranking-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}

.ranking-overlay-close::before {
  content: "×";
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(20, 32, 78, 0.96);
  box-shadow: 0 6px 14px rgba(3, 7, 25, 0.28);
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.ranking-overlay-close:hover::before {
  background: #1e2761;
}

.ranking-overlay-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(200, 144, 28, 0.9);
}

.ranking-content {
  display: block;
}

.ranking-board {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.ranking-board.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.ranking-board-heading {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  align-items: stretch;
  min-height: 112px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.ranking-ribbon {
  display: grid;
  place-items: center;
  padding: 14px 30px 14px 20px;
  clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%);
  background: var(--brand, #ff8a1f);
  color: #151a32;
  font: italic 700 44px/1 "Barlow Condensed", sans-serif;
  animation: rankingRibbonIn 0.55s 0.18s both;
}

.ranking-ribbon:not(.is-pending) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranking-ribbon.is-arriving {
  animation: rankingRibbonIn 0.5s cubic-bezier(.2, .8, .2, 1) backwards;
}

.ranking-ribbon.is-pending {
  font-family: inherit;
  font-size: 23px;
  font-style: normal;
  letter-spacing: 0;
  animation: rankingRibbonIn 0.55s 0.18s both, rankingPending 1.8s 0.8s ease-in-out infinite;
}

.ranking-rank-number {
  font-size: 56px;
  line-height: 0.8;
}

.ranking-rank-unit {
  align-self: end;
  margin: 0 0 4px 3px;
  font: 800 18px/1 sans-serif;
}

.ranking-heading-text {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 15px 28px 15px 16px;
}

.ranking-count,
.ranking-score-line {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.ranking-score-value {
  font: italic 800 22px/1 "Barlow Condensed", sans-serif;
}

.ranking-rank-badge {
  display: inline-grid;
  min-width: 24px;
  min-height: 20px;
  place-items: center;
  margin-left: 3px;
  padding: 0 6px;
  border-radius: 3px;
  background: #fff;
  color: #17204f;
  font-size: 12px;
  line-height: 1;
}

.ranking-scenario-name {
  overflow: hidden;
  margin: 0;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-score-line {
  min-height: 20px;
  color: #fff;
  font-weight: 800;
}

.ranking-board.is-delayed .ranking-score-line::after {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  content: "混雑時は1分ほどかかることがあります";
  font-size: 11px;
  font-weight: 500;
}

.ranking-columns,
.ranking-person-row {
  display: grid;
  grid-template-columns: 72px 44px minmax(180px, 1fr) 82px 86px;
  align-items: center;
}

.ranking-columns {
  min-width: 650px;
  height: 34px;
  padding: 0 22px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 800;
}

.ranking-viewport {
  position: relative;
  min-width: 650px;
  overflow: hidden;
}

.ranking-board.is-scrollable .ranking-viewport {
  max-height: min(58vh, 580px);
  overflow-y: auto;
}

.ranking-fixed-layer,
.ranking-people-layer {
  position: absolute;
  inset: 0;
}

.ranking-fixed-slot {
  position: absolute;
  inset: 0 0 auto;
  height: 58px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.55s ease;
}

.ranking-fixed-slot.is-even {
  background: rgba(255, 255, 255, 0.035);
}

.ranking-medal {
  position: absolute;
  top: 9px;
  left: 34px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 40px;
  color: rgba(255, 255, 255, 0.82);
  font: italic 700 25px/1 "Barlow Condensed", sans-serif;
}

.ranking-medal.rank-1 { color: #f4cb58; }
.ranking-medal.rank-2 { color: #d7dce6; }
.ranking-medal.rank-3 { color: #c98b60; }

.ranking-medal svg {
  position: absolute;
  inset: 0;
  width: 46px;
  height: 40px;
}

.ranking-medal em {
  position: relative;
  z-index: 1;
  font: inherit;
}

.ranking-person-row {
  position: absolute;
  top: 3px;
  right: 16px;
  left: 82px;
  z-index: 2;
  grid-template-columns: 44px minmax(180px, 1fr) 82px 86px;
  height: 52px;
  padding: 0 16px 0 8px;
  border-left: 3px solid transparent;
  border-radius: 5px;
  color: #fff;
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition:
    transform 1.15s cubic-bezier(.65, .05, .25, 1),
    translate 0.38s ease,
    opacity 0.38s ease,
    scale 0.18s ease,
    box-shadow 0.25s ease;
  will-change: transform, translate, scale;
}

.ranking-person-row.is-entering {
  opacity: 0;
}

.ranking-person-row.is-first-entering {
  opacity: 0;
  translate: 90px 0;
  transition:
    transform 1.15s cubic-bezier(.65, .05, .25, 1),
    translate 0.8s cubic-bezier(.16, 1, .3, 1),
    opacity 0.8s cubic-bezier(.16, 1, .3, 1),
    scale 0.18s ease,
    box-shadow 0.25s ease;
}

.ranking-person-row.is-exiting {
  opacity: 0;
}

.ranking-person-row.is-current {
  border-left-color: var(--brand, #ff8a1f);
  background: #fff;
  color: #17204f;
  box-shadow: 0 8px 22px rgba(4, 8, 28, 0.22);
}

.ranking-person-row.is-lifted {
  z-index: 5;
  scale: 1.025;
  box-shadow: 0 14px 34px rgba(4, 8, 28, 0.42);
}

.ranking-person-row.is-landed {
  animation: rankingLanding 0.72s ease;
}

.ranking-person-row.is-score-flash {
  animation: rankingScoreFlash 0.72s ease;
}

.ranking-initial {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.ranking-person-row.is-current .ranking-initial {
  border-color: #cad1e7;
  background: #eef1fa;
}

.ranking-identity {
  display: grid;
  min-width: 0;
  padding: 0 10px;
}

.ranking-person-name {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-team-name {
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  opacity: 0.62;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-delta,
.ranking-total {
  text-align: right;
  font: italic 700 21px/1 "Barlow Condensed", sans-serif;
}

.ranking-delta.is-positive { color: #6fe3a0; }
.ranking-person-row.is-current .ranking-delta.is-positive { color: #138a4a; }
.ranking-delta.is-negative { color: #ffaaa3; }
.ranking-delta.is-muted { color: #77809b; }
.ranking-total { font-size: 27px; }

.ranking-ethics-note {
  margin: 13px 22px 16px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  text-align: center;
}

.ranking-actions,
.ranking-modal-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 20px;
}

.ranking-modal-tools {
  justify-content: space-between;
  padding: 18px 76px 4px 22px;
}

.ranking-modal-tools .field {
  display: grid;
  grid-template-columns: auto minmax(240px, 420px);
  align-items: center;
  gap: 10px;
  width: min(560px, 100%);
  color: rgba(255, 255, 255, 0.78);
}

.ranking-modal-tools select {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.96);
}

.ranking-close-button,
.ranking-detail-button {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  cursor: pointer;
}

.ranking-detail-button {
  border-color: var(--brand, #ff8a1f);
  background: var(--brand, #ff8a1f);
  color: #151a32;
}

.ranking-detail-button:disabled {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}

.ranking-loading,
.ranking-empty {
  padding: 52px 24px;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.ranking-partial-notice {
  margin: 0 22px 16px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 211, 110, 0.35);
  border-radius: 6px;
  color: #ffe1a0;
  font-size: 12px;
  text-align: center;
}

.ranking-fixed-slot.is-shimmering::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 49%, transparent 63%);
  content: "";
  animation: rankingShimmer 0.9s ease both;
}

@keyframes rankingRibbonIn {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
}

@keyframes rankingPending {
  50% { opacity: 0.58; }
}

@keyframes rankingLanding {
  0%, 100% { box-shadow: 0 8px 22px rgba(4, 8, 28, 0.22); }
  42% { box-shadow: 0 0 0 3px rgba(255, 138, 31, 0.8), 0 12px 30px rgba(4, 8, 28, 0.34); }
}

@keyframes rankingScoreFlash {
  0%, 100% { box-shadow: 0 8px 22px rgba(4, 8, 28, 0.22); }
  45% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.82), 0 12px 30px rgba(4, 8, 28, 0.34); }
}

@keyframes rankingShimmer {
  from { translate: -100% 0; }
  to { translate: 100% 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 25, 25, 0.42);
  z-index: 50;
}

.modal-card {
  display: grid;
  gap: 14px;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ranking-content {
  display: grid;
  gap: 12px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-tint);
}

.ranking-rank {
  color: var(--primary-dark);
  font-weight: 900;
}

.ranking-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-score {
  color: var(--primary-dark);
}

.ranking-self,
.ranking-empty {
  padding: 12px 14px;
  border: 1px solid #d6dde2;
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--ink);
  line-height: 1.6;
}

.dashboard-panel,
.team-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dashboard-content {
  display: grid;
  gap: 16px;
}

.dashboard-heading {
  display: grid;
  gap: 4px;
}

.dashboard-heading h3,
.dashboard-section h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 18px;
}

.dashboard-heading p {
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.dashboard-card {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
}

.dashboard-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-card-value {
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.2;
}

.dashboard-card-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  gap: 6px;
}

.dashboard-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-section h4 {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.score-trend-chart {
  position: relative;
  min-height: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-tint);
}

.score-trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 680 / 260;
}

.score-trend-chart line {
  stroke: #d4d9dd;
  stroke-width: 1;
}

.score-trend-chart polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.score-trend-chart circle {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 3;
}

.score-trend-chart .chart-grid-line {
  stroke: #dce2e9;
}

.score-trend-chart .chart-x-tick {
  stroke: #98a2b3;
}

.score-trend-chart .chart-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.score-trend-chart .chart-point-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}

.score-trend-chart .chart-point {
  pointer-events: none;
  transition: r 120ms ease, fill 120ms ease;
}

.score-trend-chart .chart-point.active {
  r: 8px;
  fill: var(--primary);
}

.score-chart-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 39, 97, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 32, 78, 0.18);
  color: var(--ink);
  pointer-events: none;
  transform: scale(1);
  transform-origin: bottom center;
  animation: chartTooltipIn 120ms ease-out;
}

.score-chart-tooltip[hidden] {
  display: none;
}

.score-chart-tooltip span {
  color: var(--muted);
  font-size: 12px;
}

.score-chart-tooltip strong {
  color: var(--primary-dark);
  font-size: 15px;
}

@keyframes chartTooltipIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .score-chart-tooltip { animation: none; }
  .score-trend-chart .chart-point { transition: none; }
}

.rate-list {
  display: grid;
  gap: 10px;
}

.rate-row {
  display: grid;
  gap: 5px;
}

.rate-row-header,
.compact-row,
.session-row,
.team-row {
  display: grid;
  align-items: center;
  gap: 12px;
}

.rate-row-header {
  grid-template-columns: 1fr auto;
  color: var(--ink);
}

.rate-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary-soft);
}

.rate-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-bar);
}

.rate-row.danger .rate-track span {
  background: var(--danger);
}

.rate-row small {
  color: var(--muted);
  font-size: 12px;
}

.compact-list,
.session-list,
.team-table {
  display: grid;
  gap: 8px;
}

.compact-row,
.session-row,
.team-row {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--ink);
  text-align: left;
}

.compact-row {
  grid-template-columns: 1fr auto;
}

.compact-row:disabled {
  cursor: default;
  opacity: 1;
}

.session-row {
  grid-template-columns: minmax(220px, 1fr) 150px auto;
}

.session-row:hover,
.team-row:hover:not(.team-row-header) {
  border-color: #c6ced4;
  background: #fff;
}

.session-row-title,
.team-row span:first-child {
  font-weight: 800;
}

.session-row-meta {
  color: var(--muted);
}

.session-row-score {
  color: var(--primary-dark);
}

.team-row {
  grid-template-columns: minmax(140px, 1.5fr) 90px 64px 64px 118px 72px 72px 112px;
}

.team-summary-grid {
  grid-template-columns: repeat(6, minmax(125px, 1fr));
}

.team-count-muted { color: var(--muted); }
.team-count-achieved { color: var(--primary-dark); font-weight: 800; }

.team-row-header {
  min-height: 36px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: default;
}

.team-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-group + .team-group {
  margin-top: 12px;
}

.team-group-heading {
  padding: 14px 16px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.team-group .team-table {
  padding: 10px;
}

@media (max-width: 900px) {
  .team-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .team-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-row-header { display: none; }
  .team-row:not(.team-row-header) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
  }
  .team-row:not(.team-row-header) > span {
    display: grid;
    gap: 2px;
    min-width: 0;
  }
  .team-row:not(.team-row-header) > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }
  .team-row:not(.team-row-header) > span:first-child { grid-column: 1 / -1; }
}

.dashboard-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-tint);
  line-height: 1.7;
}

.team-member-dashboard {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Dashboard v2: mirrors the agreed progress-card mock without changing the meeting shell. */
.dashboard-v2 { --dash-navy: #1a2150; --dash-orange: #ff8a1f; --dash-hair: #eceff5; --up: #138a4a; --down: #b42318; display: grid; gap: 16px; max-width: 1120px; margin: 0 auto; }
.dashboard-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.dashboard-v2-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.dashboard-v2-heading h2 { margin: 0; color: var(--ink); font-size: 24px; }
.dashboard-v2-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-picker, .dashboard-v2-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.dashboard-current { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.dashboard-face { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; flex: none; border-radius: 50%; background: var(--dash-hair); color: var(--muted); font-weight: 800; }
.dashboard-face.big { width: 56px; height: 56px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--dash-orange); }
.dashboard-face img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-current-text { display: grid; min-width: 0; gap: 2px; }
.dashboard-current-text > small { color: var(--dash-orange); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.dashboard-current-title { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.dashboard-current-title b { flex: none; color: var(--dash-navy); font: italic 700 30px/1 "Barlow Condensed", Bahnschrift, "Arial Narrow", sans-serif; }
.dashboard-current-title span { overflow: hidden; color: var(--ink); font-size: 19px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-current-meta { color: var(--muted); font-size: 12px; }
.dashboard-switch, .dashboard-chip, .dashboard-primary-cta { border-radius: 999px; font-weight: 800; }
.dashboard-switch { padding: 9px 18px; border: 2px solid var(--dash-navy); background: #fff; color: var(--dash-navy); white-space: nowrap; }
.dashboard-switch[aria-expanded="true"] { background-color: #1a2150 !important; color: #fff !important; opacity: 1; }
.dashboard-recent-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--dash-hair); color: var(--muted); font-size: 12px; }
.dashboard-recent-chips > div { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; }
.dashboard-chip b { color: var(--dash-navy); font: italic 700 16px "Barlow Condensed", Bahnschrift, sans-serif; }
.dashboard-chip.active { border-color: var(--dash-navy); background: #eef1f8; }
.dashboard-picker-panel { display: grid; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--dash-hair); }
.dashboard-picker-panel[hidden] { display: none; }
.dashboard-picker-head { display: flex; align-items: center; gap: 12px; }
.dashboard-picker-head input { flex: 1; min-width: 220px; }
.dashboard-picker-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dashboard-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.dashboard-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; }
.dashboard-option:hover { border-color: #b9c0d6; background: #f8f9fc; }
.dashboard-option.active { padding: 9px 11px; border: 2px solid var(--dash-navy); }
.dashboard-option > span:last-child { display: grid; min-width: 0; gap: 2px; }
.dashboard-option strong { display: flex; min-width: 0; gap: 6px; font-size: 13px; }
.dashboard-option strong b { flex: none; color: var(--dash-navy); font: italic 700 16px "Barlow Condensed", Bahnschrift, sans-serif; }
.dashboard-option strong span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-option small { color: var(--muted); font-size: 11px; }
.dashboard-option.unpracticed strong { color: var(--muted); }
.dashboard-v2-card > h3 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 16px; }
.dashboard-v2-card > h3 > span { display: inline-flex; align-items: center; }
.dashboard-v2-card > h3 small { color: var(--muted); font-size: 12px; font-weight: 500; }
.dashboard-scope { display: inline-flex; align-items: center; min-height: 20px; margin-right: 7px; padding: 1px 9px; border-radius: 999px; background: #e8ebf5; color: var(--dash-navy); font-size: 11px; font-weight: 800; }
.dashboard-scope.all { background: var(--dash-hair); color: var(--muted); }
.dashboard-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; }
.dashboard-score-ring { position: relative; width: 168px; height: 168px; }
.dashboard-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dashboard-score-ring .bg { fill: none; stroke: var(--dash-hair); stroke-width: 14; }
.dashboard-score-ring .arc { fill: none; stroke-width: 14; stroke-linecap: round; stroke-dasharray: var(--ring-length); stroke-dashoffset: var(--ring-length); animation: dashboardRingIn 1.3s .2s cubic-bezier(.2, .8, .2, 1) forwards; }
.dashboard-score-ring .tick { stroke: #fff; stroke-width: 3; }
.dashboard-score-ring .center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; }
.dashboard-score-ring small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.dashboard-score-ring b { color: var(--dash-navy); font: italic 700 52px/.95 "Barlow Condensed", Bahnschrift, sans-serif; }
.dashboard-score-ring span { color: var(--ink); font-size: 13px; font-weight: 800; }
.dashboard-score-ring.unpracticed .arc { display: none; }
@keyframes dashboardRingIn { to { stroke-dashoffset: var(--ring-offset); } }
.dashboard-next-goal { display: grid; justify-items: start; gap: 8px; }
.dashboard-goal-kicker { display: flex; align-items: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.dashboard-next-goal h3 { margin: 0; font-size: 24px; }
.dashboard-next-goal h3 em { color: var(--dash-orange); font: normal italic 700 46px/1 "Barlow Condensed", Bahnschrift, sans-serif; }
.dashboard-next-goal p { margin: 0; color: var(--muted); font-size: 13px; }
.dashboard-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-pills > span, .dashboard-pills > button:not(.dashboard-primary-cta) { display: inline-flex; align-items: baseline; gap: 5px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; }
.dashboard-pills b { color: var(--dash-navy); font: italic 700 18px "Barlow Condensed", sans-serif; }
.dashboard-pills > button:not(.dashboard-primary-cta) { border-color: var(--dash-orange); color: var(--dash-orange); font-weight: 800; }
.dashboard-primary-cta { justify-self: end; padding: 10px 20px; border: 0; background: var(--dash-navy); color: #fff; }
.dashboard-trend-chart { display: block; width: 100%; height: auto; overflow: visible; }
.dashboard-band-label { fill: var(--muted); font: 700 13px "Barlow Condensed", sans-serif; }
.dashboard-chart-grid { stroke: #dde1ea; stroke-width: 1; }
.dashboard-chart-axis { fill: var(--muted); font-size: 11px; }
.dashboard-chart-line { fill: none; stroke: var(--dash-navy); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-chart-dot { fill: #fff; stroke: var(--dash-navy); stroke-width: 2.5; }
.dashboard-chart-dot.best { fill: var(--dash-orange); stroke: var(--dash-orange); }
.dashboard-chart-callout rect { fill: var(--dash-navy); }
.dashboard-chart-callout text { fill: #fff; font-size: 12px; font-weight: 800; }
.dashboard-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-item-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--dash-hair); }
.dashboard-item-row:last-child { border-bottom: 0; }
.dashboard-check { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #c4cad8; border-radius: 6px; color: #fff; }
.dashboard-item-card:not(.target) .dashboard-check { border-color: var(--dash-navy); background: var(--dash-navy); }
.dashboard-item-row > div { display: grid; gap: 3px; min-width: 0; }
.dashboard-item-row b { font-size: 14px; line-height: 1.45; }
.dashboard-item-row small { color: var(--muted); font-size: 12px; }
.dashboard-item-row i { height: 4px; overflow: hidden; border-radius: 999px; background: var(--dash-hair); }
.dashboard-item-row i span { display: block; height: 100%; border-radius: inherit; background: var(--dash-navy); }
.dashboard-item-card.target .dashboard-item-row i span { background: var(--dash-orange); }
.dashboard-item-row > strong { color: var(--dash-navy); font: italic 700 22px "Barlow Condensed", sans-serif; }
.dashboard-complete { padding: 22px 0; color: var(--up); font-weight: 800; text-align: center; }
.dashboard-item-card > .dashboard-primary-cta { display: block; margin: 12px 0 0 auto; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.dashboard-metric { display: grid; gap: 3px; min-width: 0; padding: 14px 16px; border-left: 1px solid var(--dash-hair); }
.dashboard-metric:first-child { border-left: 0; }
.dashboard-metric > span { color: var(--muted); font-size: 12px; }
.dashboard-metric > b { color: var(--dash-navy); font: italic 700 30px/1.1 "Barlow Condensed", sans-serif; }
.dashboard-metric em { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; font-style: normal; }
.dashboard-metric em strong.up { color: var(--up); }
.dashboard-metric em strong.down { color: var(--down); }
.dashboard-metric em strong.neutral { color: var(--muted); }
.dashboard-divider { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 800; }
.dashboard-divider::before, .dashboard-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dashboard-week-card { width: 100%; }
.dashboard-week-inner { width: min(520px, 100%); }
.dashboard-week-head { display: flex; justify-content: space-between; align-items: baseline; }
.dashboard-week-head > span { display: flex; align-items: center; font-weight: 800; }
.dashboard-week-head > b { color: var(--dash-navy); font: italic 700 30px "Barlow Condensed", sans-serif; }
.dashboard-week-head > b small { margin-left: 2px; color: var(--muted); font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif; font-size: 13px; font-style: normal; font-weight: 700; }
.dashboard-week { display: grid; grid-template-columns: repeat(7, 42px); gap: 8px; margin-top: 12px; }
.dashboard-day { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.dashboard-day i { display: grid; place-items: center; width: 30px; height: 30px; border: 2px dashed var(--line); border-radius: 50%; font-style: normal; }
.dashboard-day.done i { border: 0; background: var(--dash-navy); color: #fff; }
.dashboard-day.today { color: var(--dash-orange); font-weight: 800; }
.dashboard-day.today i { box-shadow: 0 0 0 3px #fff3e8, 0 0 0 4px var(--dash-orange); }
.dashboard-week-goal { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-week-goal b { color: var(--up); }
.dashboard-badges { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.dashboard-badge { display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 12px; text-align: center; }
.dashboard-badge.new { background: #fff3e8; }
.dashboard-badge-emblem { display: block; width: 64px; height: 64px; }
.dashboard-badge > b { font-size: 13px; line-height: 1.35; }
.dashboard-badge.locked > b { color: var(--muted); }
.dashboard-badge > small { color: var(--muted); font-size: 11px; }
.dashboard-badge.new > small { color: var(--dash-orange); font-weight: 800; }
.dashboard-session-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 42px; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--dash-hair); background: #fff; color: var(--ink); text-align: left; }
.dashboard-session-row:nth-child(even) { background: #f8f9fc; }
.dashboard-session-row:hover { background: #eef1f8; }
.dashboard-session-row > span:nth-child(2) { display: grid; min-width: 0; }
.dashboard-session-row > span:nth-child(2) b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-session-row > span:nth-child(2) small { color: var(--muted); font-size: 12px; }
.dashboard-rank { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--dash-navy); border-radius: 50%; color: var(--dash-navy); font: italic 700 18px "Barlow Condensed", sans-serif; }
.dashboard-rank.A, .dashboard-rank.S { border-color: var(--dash-orange); color: var(--dash-orange); }
.dashboard-session-row > strong { color: var(--dash-navy); font: italic 700 22px "Barlow Condensed", sans-serif; }
.dashboard-session-row > em { color: var(--muted); font: normal 700 14px "Barlow Condensed", sans-serif; text-align: right; }
.dashboard-session-row > em.up { color: var(--up); }

@media (max-width: 760px) {
  .dashboard-picker, .dashboard-v2-card { padding: 16px; }
  .dashboard-current { grid-template-columns: auto minmax(0, 1fr); }
  .dashboard-switch { grid-column: 1 / -1; }
  .dashboard-current-title span { white-space: normal; }
  .dashboard-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .dashboard-next-goal { justify-items: center; }
  .dashboard-pills { justify-content: center; }
  .dashboard-duo { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metric:nth-child(3) { border-left: 0; }
  .dashboard-metric:nth-child(n+3) { border-top: 1px solid var(--dash-hair); }
  .dashboard-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .dashboard-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-session-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .dashboard-session-row > em { grid-column: 3; }
}

.badge-award-backdrop { --dash-navy: #1a2150; --dash-orange: #ff8a1f; position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: rgba(20, 26, 51, .55); animation: badgeBackdropIn .25s ease-out; }
.badge-award-backdrop[hidden] { display: none; }
.badge-award-dialog { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px 24px 20px; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(20, 26, 51, .35); text-align: center; animation: badgeDialogIn .4s cubic-bezier(.2, .9, .3, 1.1); }
.badge-award-kicker { color: #ff8a1f; font: italic 700 13px "Barlow Condensed", Bahnschrift, sans-serif; letter-spacing: .18em; }
.badge-award-dialog h2 { margin: 2px 0 18px; font-size: 20px; }
.badge-award-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.badge-award-item { display: grid; width: 160px; justify-items: center; gap: 6px; }
.badge-award-medal { position: relative; width: 96px; height: 96px; }
.badge-award-medal .dashboard-badge-emblem { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge-award-medal .before { animation: badgeAwardOut .35s calc(.45s + var(--badge-delay)) ease-in forwards; }
.badge-award-medal .after { opacity: 0; transform: scale(.5); animation: badgeAwardIn .55s calc(.6s + var(--badge-delay)) cubic-bezier(.3, 1.6, .5, 1) forwards; }
.badge-award-burst { position: absolute; inset: -10px; border: 3px solid #ff8a1f; border-radius: 50%; opacity: 0; animation: badgeAwardBurst .7s calc(.75s + var(--badge-delay)) ease-out forwards; }
.badge-award-item b { font-size: 14px; line-height: 1.4; }
.badge-award-item small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.badge-award-count { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.badge-award-actions { display: grid; gap: 6px; margin-top: 16px; }
.badge-award-actions .primary-button { border-radius: 999px; }
.badge-award-actions #badgeAwardDashboardButton { min-height: auto; padding: 8px; border: 0; background: none; box-shadow: none; color: var(--muted); font-weight: 500; }
@keyframes badgeBackdropIn { from { opacity: 0; } }
@keyframes badgeDialogIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes badgeAwardOut { to { opacity: 0; transform: scale(.85); } }
@keyframes badgeAwardIn { to { opacity: 1; transform: scale(1); } }
@keyframes badgeAwardBurst { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .dashboard-score-ring .arc { animation: none; stroke-dashoffset: var(--ring-offset); }
  .badge-award-backdrop, .badge-award-dialog { animation: none; }
  .badge-award-medal .before { display: none; }
  .badge-award-medal .after { opacity: 1; transform: none; animation: none; }
  .badge-award-burst { display: none; }
}
@media (max-width: 520px) { .badge-award-list { display: grid; } }

.evaluation-json {
  overflow: auto;
  max-height: 360px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #e5e7eb;
  font: 13px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.participant {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.participant-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.participant.customer {
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  min-height: 276px;
}

#customerAvatar {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
}

.avatar-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 200ms ease;
}

.admin-avatar-preview {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
}

.admin-avatar-field { align-self: start; }

@media (max-width: 600px) {
  .participant.customer { grid-template-columns: minmax(0, 1fr); }
  #customerAvatar { max-width: 240px; }
}

.live-caption {
  margin-top: 8px;
  min-height: 52px;
  font-size: 22px;
  line-height: 1.45;
}

.meter-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.meter {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e3eef1;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 80ms linear;
}

.barge-in-label.active {
  color: var(--warn);
}

.log-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.transcript-accuracy-notice {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.transcript-log {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 160px;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-tint);
}

.transcript-item {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: min(78%, 720px);
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.transcript-item.transcript-customer {
  justify-self: start;
  border-color: rgba(185, 28, 28, 0.18);
  background: #fff;
}

.transcript-item.transcript-user {
  justify-self: end;
  border-color: rgba(120, 113, 108, 0.28);
  background: #f8f5f1;
}

.transcript-speaker {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.transcript-quality-warning {
  margin: 2px 0 0;
  color: #8a5a12;
  font-size: 12px;
  line-height: 1.5;
}

.customer-foreign-script-mask {
  color: var(--muted);
  opacity: 0.76;
}

#meetingCaption .customer-foreign-script-mask {
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.customer-foreign-script-warning {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.message-area {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
}

.message-area.visible {
  display: block;
}

.message-area.error {
  border-color: #fecaca;
  background: #fff5f5;
  color: var(--danger);
}

.admin-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(380px, calc(100vw - 40px));
  padding: 12px 14px 12px 16px;
  border: 1px solid #b7dec9;
  border-radius: 8px;
  background: #f1fbf5;
  box-shadow: 0 12px 32px rgba(20, 32, 78, 0.18);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast[hidden],
.admin-notice-dialog-backdrop[hidden] {
  display: none;
}

.admin-notice-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.admin-notice-close:hover,
.admin-notice-close:focus-visible {
  background: rgba(30, 39, 97, 0.08);
}

.admin-notice-dialog-open {
  overflow: hidden;
}

.admin-notice-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 22, 54, 0.42);
}

.admin-notice-dialog {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(14, 22, 54, 0.3);
}

.admin-notice-dialog h2 {
  margin: 0;
  color: var(--danger);
  font-size: 18px;
}

.admin-notice-dialog p {
  margin: 0;
  line-height: 1.75;
}

.admin-error-details {
  min-height: 0;
  max-height: min(52vh, 420px);
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-notice-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-notice-dialog-actions .primary-button {
  min-width: 112px;
}

@media (max-width: 640px) {
  .admin-toast {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .admin-notice-dialog-backdrop {
    padding: 16px;
  }
}

@keyframes scoringSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scoringProgress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(240%);
  }
}

@keyframes statusPulse {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(0.96);
  }
}

@keyframes statusDot {
  0% {
    box-shadow: 0 0 0 0 rgba(30, 39, 97, 0.28);
    opacity: 1;
  }

  100% {
    box-shadow: 0 0 0 8px rgba(30, 39, 97, 0);
    opacity: 0.72;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 10px;
  }

  .top-bar,
  .control-band {
    grid-template-columns: 1fr;
  }

  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-band {
    display: grid;
  }

  .session-meta {
    width: 100%;
    justify-content: space-between;
  }

  .participant {
    grid-template-columns: 1fr;
  }

  .score-overview,
  .feedback-grid,
  .history-controls,
  .scenario-request-panel,
  .pre-goals-groups {
    grid-template-columns: 1fr;
  }

  .live-caption {
    font-size: 18px;
  }

  .login-card h1 {
    white-space: normal;
  }
}


.admin-shell {
  padding-bottom: 64px;
}

.admin-shell button {
  white-space: nowrap;
}

.admin-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.system-admin-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 18px 0 0;
  padding: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.system-admin-tab {
  /* Switch the connected tab surface immediately, without intermediate colors. */
  transition: none;
  box-sizing: border-box;
  margin-bottom: -1px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  border-radius: 8px 8px 0 0;
  background: #f1f3f6;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.system-admin-tab.active {
  border-bottom-color: var(--panel);
  background: var(--panel);
  color: var(--primary-dark);
  font-weight: 900;
}

.system-admin-panel[hidden] {
  display: none !important;
}

#scenarioAdminPanel > .admin-panel,
.admin-panel.system-admin-panel {
  box-sizing: border-box;
  margin-top: 0;
  border-top-left-radius: 0;
}

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-panel-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-list-actions {
  align-items: center;
  align-self: center;
}

.admin-list-actions .compact-field {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.admin-list-actions .compact-field select {
  min-width: 130px;
}

.scenario-import-panel {
  display: grid;
  gap: 16px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.scenario-import-panel[hidden] {
  display: none;
}

.scenario-import-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scenario-import-heading h3,
.scenario-import-heading p {
  margin: 0;
}

.scenario-import-heading p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.scenario-import-steps {
  margin: 0;
  padding-left: 1.5em;
  color: var(--ink);
  line-height: 1.8;
}

.scenario-import-controls {
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr);
  align-items: end;
  gap: 10px 14px;
}

.excel-template-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.scenario-import-file-label {
  display: grid;
  gap: 6px;
}

.scenario-import-file-name {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.scenario-import-actions {
  justify-content: flex-end;
}

.scenario-import-result {
  display: none;
  padding: 12px 14px;
  border: 1px solid #c7d7c1;
  border-radius: 8px;
  background: #f4faf1;
  color: #2f5f24;
  line-height: 1.6;
}

.scenario-import-result.visible {
  display: block;
}

.scenario-import-result.error {
  border-color: #f1b8bd;
  background: #fff4f5;
  color: var(--danger);
}

.scenario-import-error-heading {
  margin: 0 0 10px;
  font-weight: 800;
}

.scenario-import-error-table-wrap {
  overflow-x: auto;
}

.scenario-import-error-table {
  min-width: 720px;
  background: #fff;
  color: var(--ink);
}

.admin-actions,
.scenario-request-actions,
.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  background: var(--surface-tint);
  font-size: 12px;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-title,
.admin-id {
  display: block;
}

.admin-id {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-number {
  white-space: nowrap;
  font-weight: 800;
}

.admin-scenario-list {
  max-width: 100%;
  overflow-x: auto;
}

.admin-users-list {
  max-width: 100%;
  overflow-x: auto;
}

.admin-users-list .user-admin-table {
  min-width: 1450px;
  table-layout: fixed;
}

.user-admin-table th:nth-child(1) { width: 170px; }
.user-admin-table th:nth-child(2) { width: 220px; }
.user-admin-table th:nth-child(3) { width: 160px; }
.user-admin-table th:nth-child(4) { width: 210px; }
.user-admin-table th:nth-child(5) { width: 170px; }
.user-admin-table th:nth-child(6) { width: 92px; }
.user-admin-table th:nth-child(7) { width: 118px; }
.user-admin-table th:nth-child(8) { width: 78px; }
.user-admin-table th:nth-child(9) { width: 202px; }

.user-admin-table .user-role-select {
  min-width: 138px;
}

.user-admin-table .admin-row-actions {
  flex-wrap: nowrap;
  min-width: 180px;
  white-space: nowrap;
}

.admin-scenario-list .admin-table {
  min-width: 1220px;
  table-layout: fixed;
}

.admin-scenario-list .scenario-col-number { width: 62px; }
.admin-scenario-list .scenario-col-title { width: 260px; }
.admin-scenario-list .scenario-col-customer { width: 160px; }
.admin-scenario-list .scenario-col-phase { width: 110px; }
.admin-scenario-list .scenario-col-status { width: 90px; }
.admin-scenario-list .scenario-col-updated { width: 140px; }
.admin-scenario-list .scenario-col-actions { width: 398px; }

.admin-scenario-list .scenario-title-cell .admin-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}

.admin-scenario-list .admin-customer {
  min-width: 150px;
}

.admin-customer-name,
.admin-customer-title {
  display: inline-block;
  white-space: nowrap;
}

.admin-customer-title {
  margin-left: .45em;
}

.admin-scenario-list .admin-status-cell {
  min-width: 82px;
  text-align: center;
}

.admin-scenario-list .admin-status {
  white-space: nowrap;
}

.admin-scenario-list .admin-phase {
  white-space: nowrap;
}

.admin-scenario-list .admin-actions-cell {
  vertical-align: middle;
}

.admin-scenario-list .admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
  min-width: 0;
  white-space: nowrap;
}

.admin-scenario-list .admin-row-actions .danger-link {
  margin-left: 8px;
}

.team-practice-settings-list {
  max-width: 100%;
  overflow-x: auto;
}

.team-practice-settings-table {
  min-width: 780px;
}

.team-practice-settings-table th:nth-child(1) { width: 190px; }
.team-practice-settings-table th:nth-child(2) { width: 220px; }
.team-practice-settings-table th:nth-child(3) { width: 190px; }
.team-practice-settings-table th:nth-child(4) { width: 130px; }
.team-practice-settings-table th:nth-child(5) { width: 80px; }

.team-settings-manager-name {
  display: block;
}

.team-settings-goal {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.team-settings-goal input {
  width: 76px;
}

.system-admin-panel,
.admin-list-panel,
.admin-users-list,
.admin-scenario-list,
.team-practice-settings-list {
  min-width: 0;
}

@media (max-width: 767px) {
  .responsive-admin-table,
  .responsive-admin-table tbody,
  .responsive-admin-table tr,
  .responsive-admin-table td {
    display: block;
    width: 100%;
  }

  .responsive-admin-table {
    min-width: 0 !important;
    border: 0;
    overflow: visible;
  }

  .responsive-admin-table thead,
  .responsive-admin-table colgroup {
    display: none;
  }

  .responsive-admin-table tr {
    margin-bottom: 14px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .responsive-admin-table td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .responsive-admin-table td:last-child {
    border-bottom: 0;
  }

  .responsive-admin-table td::before {
    content: attr(data-label);
    align-self: start;
    padding-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .responsive-admin-table td[hidden] {
    display: none !important;
  }

  .admin-scenario-list .scenario-title-cell .admin-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .admin-scenario-list .admin-status-cell {
    min-width: 0;
    text-align: left;
  }

  .admin-scenario-list .admin-row-actions,
  .user-admin-table .admin-row-actions {
    justify-content: flex-start;
    white-space: normal;
  }

  .team-practice-settings-list,
  .admin-users-list,
  .admin-scenario-list {
    overflow-x: visible;
  }

  .license-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .license-details dd {
    margin: 0 0 12px;
  }
}

.demo-scenario-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.demo-scenario-selected {
  color: var(--primary);
  font-weight: 700;
}

.demo-scenario-unavailable {
  color: var(--danger);
  font-weight: 700;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-draft {
  background: #f3f4f6;
  color: var(--primary-dark);
}

.status-archived {
  background: #eeeeee;
  color: var(--muted);
}

.password-state-required {
  background: #FDECEA;
  color: var(--danger);
}

.password-state-ready {
  background: #eeeeee;
  color: var(--muted);
}

.danger-link {
  color: var(--danger);
}

.admin-row-actions .danger-link,
.user-admin-table .danger-link,
.evaluation-card .danger-link,
.concern-card .danger-link,
.objection-card .danger-link {
  min-height: 42px;
}

.secondary-download {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--line);
}


.admin-editor-panel label,
.admin-create-user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-editor-panel input:not([type="checkbox"]):not([type="radio"]),
.admin-editor-panel textarea,
.admin-editor-panel select,
.admin-create-user-form input:not([type="checkbox"]):not([type="radio"]),
.admin-create-user-form select,
.user-admin-table select,
.user-admin-table input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  border: 1px solid #d8dee4;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font-weight: 500;
}

input[type="checkbox"],
input[type="radio"] {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--primary);
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-editor-panel textarea {
  resize: vertical;
  line-height: 1.6;
}

.admin-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  row-gap: 4px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0 8px;
}

.admin-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  border-radius: 8px 8px 0 0;
  background: #f5f6f8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.active {
  margin-bottom: -1px;
  border-bottom-color: var(--panel);
  background: var(--panel);
  color: var(--primary-dark);
  font-weight: 900;
}

.admin-tab-panel {
  display: none;
  gap: 14px;
}

.admin-tab-panel.active {
  display: grid;
}

.admin-editor-form {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.admin-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid.scoring-row {
  grid-template-columns: 160px minmax(240px, 1fr) 150px 100px 100px 100px auto;
  align-items: end;
}

.admin-grid.user-create-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.admin-grid.user-create-grid > label {
  flex: 1 1 180px;
  min-width: 160px;
}

.admin-grid.user-create-grid > label:nth-of-type(2) {
  flex-basis: 220px;
}

.admin-grid.user-create-grid > label:nth-of-type(3),
.admin-grid.user-create-grid > label:nth-of-type(5) {
  flex-basis: 180px;
}

.admin-grid.user-create-grid > label:nth-of-type(4) {
  flex-basis: 150px;
}

.admin-grid.user-create-grid > #createUserButton {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: auto;
  white-space: nowrap;
}

.admin-create-user-form {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.user-admin-table td:first-child {
  min-width: 160px;
}

.user-admin-table .user-name-input {
  min-width: 140px;
  width: 100%;
}

.manager-team-name-cell {
  min-width: 160px;
}

.manager-team-order-cell {
  min-width: 84px;
}

.manager-team-field-inactive input:disabled {
  border-color: transparent;
  background: transparent;
  color: transparent;
  box-shadow: none;
}

.manager-team-field-inactive input:disabled::placeholder {
  color: transparent;
  opacity: 0;
}

.user-admin-table .unsaved-row td {
  background: #fffaf0;
}

.unsaved-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid #e5c878;
  border-radius: 999px;
  background: #fff8df;
  color: #725714;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.unsaved-badge[hidden] {
  display: none;
}

.admin-settings-block {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.admin-settings-block h3,
.admin-settings-block p {
  margin: 0;
}

.admin-settings-block-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.account-import-divider {
  height: 1px;
  margin: 6px 0 2px;
  background: var(--line);
}

.account-import-panel {
  display: grid;
  gap: 14px;
}

.account-import-panel h4,
.account-import-panel p {
  margin: 0;
}

.account-import-panel h4 {
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 16px;
}

.account-import-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.account-import-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-import-controls .primary-button,
.account-import-controls .secondary-button {
  width: auto;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 13px;
}

.account-import-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.account-import-file-button:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.5;
}

.account-import-file-button input {
  display: none;
}

.account-import-file-name {
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-import-result,
.account-import-complete {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-import-result[hidden],
.account-import-complete[hidden] {
  display: none;
}

.account-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.account-import-summary > span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  color: var(--ink);
}

.account-import-summary > span strong {
  color: var(--muted);
  font-size: 12px;
}

.account-import-valid-count {
  color: #176b32 !important;
}

.account-import-error-count,
.account-import-global-error,
.account-import-correction,
.account-import-row-error td:last-child {
  color: var(--danger) !important;
  font-weight: 800;
}

.account-import-global-error {
  flex-basis: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  background: #fff1f2;
}

.account-import-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.account-import-table {
  min-width: 900px;
}

.account-import-table th:first-child,
.account-import-table td:first-child {
  width: 72px;
  text-align: center;
}

.account-import-row-error td {
  background: #fff8f8;
}

.account-import-result > .primary-button {
  width: max-content;
  max-width: 100%;
}

.account-import-complete {
  border-color: #b7dec9;
  background: #f1fbf5;
}

.account-import-complete > strong {
  color: #176b32;
}

.account-import-download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.account-import-download-row .primary-button {
  width: auto;
  flex: 0 0 auto;
}

.account-import-download-row p {
  flex: 1 1 360px;
  font-size: 12px;
}

.admin-settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.admin-settings-actions .secondary-button {
  width: auto;
}

.sample-team-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
}

.sample-team-manager-field {
  display: grid;
  gap: 6px;
  width: min(100%, 480px);
}

.sample-team-manager-field select {
  width: 100%;
  max-width: 480px;
}

.sample-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #c8a64b;
  border-radius: 999px;
  background: #fff8df;
  color: #725714;
  font-size: 11px;
  font-weight: 800;
}

.sample-session-notice {
  margin: 12px;
  padding: 12px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--muted);
}

.user-admin-message {
  margin: 0 0 14px;
  font-weight: 800;
  transition: opacity 0.5s ease;
}

.user-admin-message.success {
  border-color: #86c995;
  background: #edf9f0;
  color: #176b32;
}

.user-admin-message.fading {
  opacity: 0;
}

.admin-stack,
.evaluation-editor-list {
  display: grid;
  gap: 12px;
}

.admin-edit-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.score-config-bar {
  display: grid;
  grid-template-columns: 1fr repeat(5, 110px);
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.score-config-bar strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.method-field[hidden],
.eval-positive-score[hidden],
.eval-ng-score[hidden],
.eval-rule-count-wrap[hidden] {
  display: none !important;
}

.fixed-rule-note {
  align-self: end;
}

.publish-gate-list {
  display: grid;
  gap: 8px;
}

.publish-gate-ok,
.publish-gate-warning,
.publish-gate-error {
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
}

.publish-gate-ok {
  border: 1px solid #c7d7c1;
  background: #f4faf1;
  color: #2f5f24;
}

.publish-gate-warning {
  border: 1px solid #ead6ad;
  background: var(--accent-soft);
  color: var(--warn);
}

.publish-gate-error {
  border: 1px solid #f1b8bd;
  background: #fff4f5;
  color: var(--danger);
}

@media (max-width: 960px) {
  .admin-grid.two,
  .admin-grid.scoring-row,
  .score-config-bar {
    grid-template-columns: 1fr;
  }

  .scenario-import-controls {
    grid-template-columns: 1fr;
  }

  .scenario-import-file-name {
    grid-column: auto;
  }
}

.positive-total-box {
  display: grid;
  gap: 4px;
}

.score-total-notice {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}
/* License status does not change the existing session controls. */
.license-demo-badge { display: inline-block; padding: 3px 9px; border: 1px solid var(--accent); border-radius: 4px; color: var(--primary); background: #fff8e6; font-size: 13px; font-weight: 700; white-space: nowrap; }
.license-demo-badge[hidden] { display: none; }
.license-details { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 20px; }
.license-details dt { font-weight: 700; }
.license-details dd { margin: 0; overflow-wrap: anywhere; }
.license-notice { padding: 12px; background: #fff8e6; border-left: 4px solid var(--accent); }
.license-actions { display: flex; gap: 12px; margin-top: 12px; }
.license-error { color: var(--danger); }
[data-system-panel="license"] label { display: block; margin: 16px 0 8px; font-weight: 700; }

@media (max-width: 760px) {
  .ranking-overlay {
    align-items: end;
    padding: 10px;
  }

  .ranking-panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 10px;
  }

  .ranking-board-heading {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 98px;
  }

  .ranking-ribbon {
    padding-right: 22px;
    font-size: 35px;
  }

  .ranking-ribbon.is-pending {
    font-size: 18px;
  }

  .ranking-heading-text {
    padding: 12px 14px 12px 8px;
  }

  .ranking-scenario-name {
    font-size: 16px;
  }

  .ranking-count,
  .ranking-score-line {
    font-size: 11px;
  }

  .ranking-columns,
  .ranking-viewport {
    min-width: 0;
  }

  .ranking-columns {
    grid-template-columns: 54px 34px minmax(108px, 1fr) 56px 62px;
    padding: 0 8px;
    font-size: 9px;
  }

  .ranking-person-row {
    right: 5px;
    left: 54px;
    grid-template-columns: 34px minmax(108px, 1fr) 56px 62px;
    padding: 0 6px 0 3px;
  }

  .ranking-medal {
    left: 9px;
  }

  .ranking-person-name {
    font-size: 12px;
  }

  .ranking-delta {
    font-size: 17px;
  }

  .ranking-total {
    font-size: 22px;
  }

  .ranking-ethics-note {
    margin-inline: 10px;
  }

  .ranking-actions,
  .ranking-modal-tools {
    padding-inline: 12px;
    flex-wrap: wrap;
  }

  .ranking-modal-tools .field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ranking-modal-tools {
    padding-right: 64px;
  }

  .pre-goals-card,
  .meeting-join-card .pre-goals-card {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-board,
  .ranking-ribbon,
  .ranking-ribbon.is-pending,
  .ranking-person-row,
  .ranking-person-row.is-landed,
  .ranking-fixed-slot.is-shimmering::after {
    animation: none !important;
    transition: none !important;
  }
}
#licenseKeyInput { display: block; width: 100%; min-height: 96px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; overflow-wrap: anywhere; resize: vertical; }
#licenseKeyInput:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Team activity board */
.team-panel {
  padding: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.team-panel .dashboard-content {
  width: min(1160px, 100%);
  margin: 0 auto;
  gap: 16px;
}

.team-page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.team-page-heading h2,
.team-page-heading p,
.team-current-card h3,
.team-current-card p,
.team-board h3,
.team-board-note {
  margin: 0;
}

.team-page-heading h2 { font-size: 24px; }
.team-page-heading p { color: var(--muted); font-size: 13px; }

.team-current-card,
.team-summary-strip,
.team-board {
  border: 1px solid #dde1ea;
  border-radius: 14px;
  background: #fff;
}

.team-current-card {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
}

.team-current-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.team-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand);
  font-size: 18px;
  font-weight: 800;
}

.team-mark.all {
  background: var(--brand);
  color: #141a33;
  font-size: 13px;
}

.team-current-main > div:nth-child(2) { min-width: 0; }
.team-current-main > div:nth-child(2) > small {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
.team-current-main h3 { font-size: 20px; line-height: 1.3; }
.team-current-main p { color: #8b92a6; font-size: 12px; }

.team-current-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.team-current-actions .text-button,
.team-switch-button {
  width: auto;
  min-height: 0;
  white-space: nowrap;
  border-radius: 999px;
  cursor: pointer;
  font: 700 13px inherit;
}

.team-current-actions .text-button {
  padding: 9px 14px;
  border: 1px solid #dde1ea;
  color: #5d6478;
  background: #fff;
}

.team-switch-button {
  padding: 8px 18px;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: #fff;
}

.team-switch-button[aria-expanded="true"] { color: #fff; background: var(--primary); }
.team-current-actions button:focus-visible,
.team-quick button:focus-visible,
.team-picker-card:focus-visible,
.team-member-row:focus-visible,
.team-overview-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.team-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #eceff5;
  color: #8b92a6;
  font-size: 12px;
}

.team-quick button {
  width: auto;
  min-height: 0;
  padding: 4px 12px;
  border: 1px solid #dde1ea;
  border-radius: 999px;
  color: #1d2233;
  background: #fff;
  cursor: pointer;
  font: 500 13px inherit;
}

.team-picker-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #eceff5;
}

.team-picker-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.team-picker-search input { flex: 1; min-width: 200px; }
.team-picker-search span { color: #8b92a6; font-size: 12px; }
.team-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding: 2px;
}

.team-picker-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid #dde1ea;
  border-radius: 10px;
  color: #1d2233;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.team-picker-card:hover { border-color: #b9c0d6; background: #f8f9fc; }
.team-picker-card.active { padding: 9px 11px; border: 2px solid var(--primary); }
.team-picker-card b,
.team-picker-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-picker-card b { font-size: 14px; }
.team-picker-card small { color: #8b92a6; font-size: 11px; }
.team-picker-card > span { display: flex; justify-content: space-between; color: #5d6478; font-size: 11px; }
.team-picker-card strong { color: var(--primary); font-size: 17px; }
.team-picker-card.low strong { color: #8b92a6; }

.team-progress-track {
  display: flex !important;
  width: 100%;
  height: 8px;
  overflow: hidden;
  gap: 2px;
  border-radius: 4px;
  background: #eceff5;
}
.team-progress-track i { display: block; height: 100%; }
.team-progress-track .achieved { background: var(--brand); }
.team-progress-track .training { background: var(--primary); }
.team-progress-track .waiting { background: #eceff5; }

.team-summary-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  padding: 18px 22px;
}

.team-summary-strip > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid #eceff5;
}
.team-summary-strip > div:first-child { padding-left: 0; border-left: 0; }
.team-summary-progress p,
.team-summary-number > span { color: #8b92a6; font-size: 12px; letter-spacing: .04em; }
.team-summary-progress > div { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #5d6478; font-size: 12px; }
.team-summary-progress > div span { white-space: nowrap; }
.team-summary-progress .achieved { color: #a96400; }
.team-summary-progress .training { color: var(--primary); }
.team-summary-progress .waiting { color: #8b92a6; }
.team-summary-number > b {
  color: var(--primary);
  font-family: "Barlow Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 34px;
  font-style: italic;
  line-height: 1;
}
.team-summary-number > b small { margin-left: 2px; color: #5d6478; font: 700 14px inherit; font-style: normal; }
.team-summary-number > em { color: #5d6478; font-size: 12px; font-style: normal; }
.team-summary-number > em strong { display: block; color: #1d2233; font-size: 15px; line-height: 1.4; }

.team-board { padding: 16px 22px 8px; }
.team-board > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.team-board h3 { font-size: 16px; }
.team-board h3 small { margin-left: 8px; color: #8b92a6; font-size: 12px; font-weight: 500; }
.team-board > header > span { color: #8b92a6; font-size: 12px; }
.team-member-columns,
.team-member-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.25fr) minmax(190px, 1.3fr) 104px 74px minmax(190px, 1fr) 28px;
  align-items: center;
  gap: 14px;
}
.team-overview-columns,
.team-overview-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(200px, 1.4fr) 84px 84px minmax(190px, .9fr) 28px;
  align-items: center;
  gap: 14px;
}
.team-member-columns,
.team-overview-columns {
  padding: 8px;
  border-bottom: 1px solid #dde1ea;
  color: #8b92a6;
  font-size: 11px;
  letter-spacing: .04em;
}
.team-member-row,
.team-overview-row {
  width: 100%;
  min-height: 0;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid #eceff5;
  border-radius: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.team-member-row:nth-child(even),
.team-overview-row:nth-child(even) { background: #f8f9fc; }
.team-member-row:hover,
.team-overview-row:hover { background: #eef1f8; }

.team-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.team-person > i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}
.team-person > span { min-width: 0; }
.team-person b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; line-height: 1.3; }
.team-person small { display: block; color: #8b92a6; font-size: 12px; }
.team-person small.stale { color: #9a5b16; }

.team-week-cell { display: grid; gap: 5px; }
.team-day-dots,
.team-day-labels { display: grid; grid-template-columns: repeat(7, 18px); gap: 5px; }
.team-day-dots i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px dashed #cfd4e0;
  border-radius: 50%;
  color: #fff;
  font: italic 700 11px "Barlow Condensed", "Bahnschrift", sans-serif;
}
.team-day-dots i.on { border: 0; background: var(--primary); }
.team-day-dots i.achieved { color: #141a33; background: var(--brand); }
.team-day-dots i.today { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand); }
.team-day-dots i.future { border-color: #eceff5; }
.team-day-labels { margin-top: -2px; color: #8b92a6; font-size: 10px; text-align: center; }
.team-week-count { display: flex; align-items: center; gap: 8px; color: #5d6478; font-size: 12px; }
.team-week-count b { color: var(--primary); font-size: 18px; }
.team-pill { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.team-pill.achieved { color: #141a33; background: var(--brand); }
.team-pill.remaining { color: #5d6478; background: #eceff5; }

.team-weeks-cell { display: grid; gap: 3px; }
.team-week-bars { display: grid; grid-template-columns: repeat(4, 16px); align-items: end; gap: 6px; height: 40px; }
.team-week-bars i { display: block; width: 16px; min-height: 3px; border-radius: 3px 3px 1px 1px; background: #c9cfe0; }
.team-week-bars i.current { background: var(--primary); }
.team-weeks-cell small { color: #8b92a6; font-size: 10px; white-space: nowrap; }
.team-month-cell,
.team-overview-count { text-align: right; }
.team-month-cell b,
.team-overview-count b { display: block; color: #1d2233; font-size: 20px; line-height: 1.1; }
.team-month-cell small,
.team-month-cell em,
.team-overview-count small,
.team-overview-count em { display: block; color: #8b92a6; font-size: 11px; font-style: normal; }

.team-score-cell { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; }
.team-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
  font: italic 700 17px "Barlow Condensed", "Bahnschrift", sans-serif;
}
.team-rank.A,
.team-rank.S { border-color: var(--brand); color: var(--brand); }
.team-score-top { display: flex; align-items: baseline; gap: 8px; }
.team-score-top > b,
.team-overview-score > b { color: var(--primary); font-size: 22px; line-height: 1; }
.team-score-top small,
.team-overview-score small { margin-left: 1px; color: #5d6478; font-size: 12px; }
.team-trend { font: italic 700 13px "Barlow Condensed", "Bahnschrift", sans-serif; }
.team-trend.up { color: #138a4a; }
.team-trend.down { color: #b42318; }
.team-trend.flat { color: #8b92a6; }
.team-last { color: #8b92a6; font-size: 12px; }

.team-spark { display: block; width: 150px; height: 44px; overflow: visible; margin-top: 2px; }
.team-spark-area { fill: var(--primary-soft); }
.team-spark-base { stroke: #8b92a6; stroke-width: 1; stroke-dasharray: 3 3; }
.team-spark-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.team-spark-start { fill: #fff; stroke: #8b92a6; stroke-width: 1.5; }
.team-spark-end { fill: var(--brand); }
.team-spark text { fill: #8b92a6; font: italic 700 13px "Barlow Condensed", "Bahnschrift", sans-serif; }
.team-spark text.team-spark-latest { fill: var(--brand); }
.team-row-chevron { color: #8b92a6; font-size: 20px; text-align: center; }

.team-overview-name { min-width: 0; }
.team-overview-name b,
.team-overview-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-overview-name b { font-size: 15px; line-height: 1.3; }
.team-overview-name small { color: #8b92a6; font-size: 12px; }
.team-overview-ratio { display: grid; gap: 6px; }
.team-overview-ratio > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #5d6478; font-size: 12px; }
.team-overview-ratio b { color: var(--primary); font-size: 18px; }
.team-overview-ratio b small { color: #5d6478; font-size: 12px; }
.team-overview-ratio em { color: #5d6478; font-size: 11px; font-style: normal; }
.team-overview-ratio.low b { color: #8b92a6; }
.team-overview-score { min-width: 0; }
.team-board-note { padding: 10px 0 0; color: #8b92a6; font-size: 12px; }

.team-week-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 26, 51, .5);
}
.team-week-modal[hidden] { display: none; }
.team-week-dialog {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 22px 22px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 26, 51, .3);
}
.team-week-dialog h2,
.team-week-dialog p { margin: 0; }
.team-week-dialog h2 { font-size: 18px; }
.team-week-team { margin-top: -8px !important; color: #5d6478; font-size: 13px; }
.team-week-dialog label { display: grid; gap: 6px; font-size: 13px; font-weight: 800; }
.team-week-goal-input { display: flex; align-items: center; gap: 8px; color: #5d6478; font-weight: 500; }
.team-week-goal-input input { width: 84px; }
.team-week-help { padding: 10px 12px; border-radius: 8px; color: #5d6478; background: #f8f9fc; font-size: 12px; line-height: 1.7; }
.team-week-message { min-height: 1.4em; color: #138a4a; font-size: 12px; font-weight: 700; }
.team-week-message.error { color: var(--danger); }
.team-week-actions { display: flex; justify-content: flex-end; gap: 8px; }
.team-week-actions button { width: auto; }

@media (max-width: 1100px) {
  .team-member-columns,
  .team-overview-columns { display: none; }
  .team-member-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "person month" "week weeks" "score score";
    gap: 10px 14px;
    padding: 14px 8px;
  }
  .team-person { grid-area: person; }
  .team-week-cell { grid-area: week; }
  .team-weeks-cell { grid-area: weeks; justify-self: end; }
  .team-month-cell { grid-area: month; }
  .team-score-cell { grid-area: score; }
  .team-member-row .team-row-chevron { display: none; }
  .team-overview-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name week month" "ratio ratio ratio" "score score score";
    gap: 10px 14px;
  }
  .team-overview-name { grid-area: name; }
  .team-overview-ratio { grid-area: ratio; }
  .team-overview-count:nth-of-type(3) { grid-area: week; }
  .team-overview-count:nth-of-type(4) { grid-area: month; }
  .team-overview-score { grid-area: score; }
  .team-overview-row .team-row-chevron { display: none; }
}

@media (max-width: 960px) {
  .team-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .team-summary-strip > div:first-child { grid-column: 1 / -1; padding: 0 0 14px; border-bottom: 1px solid #eceff5; }
  .team-summary-strip > div:nth-child(2) { padding-left: 0; border-left: 0; }
}

@media (max-width: 760px) {
  .team-panel { padding: 16px 12px 24px; }
  .team-current-main { grid-template-columns: auto minmax(0, 1fr); }
  .team-current-actions { grid-column: 1 / -1; justify-content: stretch; }
  .team-current-actions button { flex: 1; }
  .team-board { padding: 12px 14px 4px; }
  .team-member-row,
  .team-overview-row { margin-bottom: 10px; padding: 14px; border: 1px solid #e5e8ef; border-radius: 10px; background: #fff; }
  .team-member-row:nth-child(even),
  .team-overview-row:nth-child(even) { background: #f8f9fc; }
}

@media (max-width: 520px) {
  .team-current-card { padding: 14px 16px; }
  .team-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .team-summary-strip > div { padding: 0 12px; }
  .team-summary-strip > div:nth-child(4) { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid #eceff5; border-left: 0; }
  .team-member-row { grid-template-columns: 1fr auto; }
  .team-day-dots,
  .team-day-labels { grid-template-columns: repeat(7, minmax(16px, 18px)); gap: 4px; }
  .team-score-cell { grid-template-columns: 34px minmax(0, 1fr); }
  .team-spark { max-width: 100%; }
  .team-overview-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name week" "ratio ratio" "month month" "score score"; }
}

@media (prefers-reduced-motion: reduce) {
  .team-progress-track i { animation: none; }
}
