:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #60636a;
  --line: #dedede;
  --soft: #f4f4f4;
  --panel: #ffffff;
  --brand: #d71920;
  --brand-strong: #9e1117;
  --brand-line: #efc3c6;
  --danger: #b4232a;
  --focus: #ffc400;
}

* {
  box-sizing: border-box;
}

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

.login-card {
  width: min(100%, 460px);
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.login-card h1 { font-size: 32px; }
.login-card > p { line-height: 1.5; }
#login-status { min-height: 24px; color: var(--ink); font-weight: 600; }
#login-status.login-error { color: var(--danger); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--soft);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: 100vh;
}

.setup-panel,
.practice-panel {
  padding: 32px;
}

.setup-panel {
  background: linear-gradient(180deg, #151515 0%, #222222 100%);
  border-right: 1px solid #2b2b2b;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: #fff;
}

.practice-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.15rem;
}

.title-row {
  display: grid;
  gap: 12px;
}

.beta-badge {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form {
  display: grid;
  gap: 18px;
}

.skill-practice-mode #setup-form fieldset,
.skill-practice-mode #objection-wrap,
.skill-practice-mode #start-button {
  display: none;
}

.app-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.app-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.setup-panel .app-tabs button {
  border-color: #3a3a3a;
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.key-setup {
  display: grid;
  gap: 10px;
  border: 1px solid #e6c98f;
  border-radius: 8px;
  padding: 14px;
  background: #fff8e8;
}

.key-setup h2 {
  font-size: 1rem;
}

.key-setup p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.small-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  font-weight: 800;
}

.check-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--ink);
  font-weight: 700;
}

.check-list input {
  width: auto;
  min-height: auto;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.setup-panel label,
.setup-panel fieldset,
.setup-panel legend {
  color: #e6e6e6;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  padding: 0 0 8px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented label {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.setup-panel .segmented label {
  border-color: #f1f1f1;
  background: #fff;
  color: #141414;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  border-color: var(--brand);
  background: #fff0f1;
  color: var(--brand-strong);
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.danger {
  border-color: #e3c6c6;
  color: var(--danger);
}

.hidden {
  display: none;
}

.status-row,
.transcript-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.status-row {
  margin-bottom: 0;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 30px;
}

.meta:empty {
  display: none;
}

.meta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.skill-practice-banner {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff2f3;
  overflow: hidden;
}

.skill-practice-banner.hidden {
  display: none;
}

.skill-practice-banner p {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-practice-banner h2 {
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.transcript-shell,
.report-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.transcript-shell {
  min-height: 300px;
}

.transcript-head span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.transcript-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.transcript-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.85rem;
}

.transcript {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.transcript.expanded {
  max-height: none;
  overflow: visible;
}

.transcript li {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: #f8faf8;
  border: 1px solid #edf0ec;
}

.transcript strong {
  font-size: 0.82rem;
  color: var(--brand-strong);
}

.transcript p {
  margin: 0;
  line-height: 1.45;
}

.report-content {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.quick-report {
  display: grid;
  gap: 14px;
}

.quick-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-report article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.quick-report article p {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-report article h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}

.try-this {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--brand-line);
  padding-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.try-this strong {
  color: var(--ink);
}

.report-placeholder {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-error {
  color: var(--danger);
  font-weight: 800;
}

.report-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff2f3;
}

.report-score span {
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-score strong {
  color: var(--brand-strong);
  font-size: 1.55rem;
  line-height: 1;
}

.report-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.report-section + .report-section {
  border-top: 1px solid var(--brand-line);
  padding-top: 18px;
}

.report-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 900;
  border-bottom: 1px solid var(--brand-line);
  padding-bottom: 8px;
}

.report-section ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
}

.report-section li {
  line-height: 1.55;
}

.report-section li::marker {
  color: var(--brand);
}

.report-section li strong {
  color: var(--brand-strong);
}

.full-report-action {
  display: flex;
  justify-content: flex-start;
}

.full-report-toggle {
  width: auto;
  min-height: 34px;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 7px 10px;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: left;
}

.full-report-toggle::after {
  content: " +";
}

.full-report-toggle[aria-expanded="true"]::after {
  content: " -";
}

.full-report-content {
  display: grid;
  gap: 16px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.full-report-content[hidden] {
  display: none;
}

.dashboard-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.score-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.dashboard-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.dashboard-details {
  display: block;
}

.dashboard-details summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.dashboard-details summary::-webkit-details-marker {
  display: none;
}

.dashboard-details summary::after {
  content: "Collapse";
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.dashboard-details:not([open]) summary::after {
  content: "Expand";
}

.dashboard-details summary span {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
}

.dashboard-details summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.dashboard-details[open] .recent-sessions {
  margin-top: 14px;
}

.tracking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tracking-grid h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.tracking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracking-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  border-bottom: 1px solid #edf0ec;
  padding-bottom: 8px;
}

.tracking-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tracking-list span {
  color: var(--muted);
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tracking-list strong {
  color: var(--ink);
  white-space: nowrap;
}

.coaching-opportunities {
  gap: 12px;
}

.coaching-opportunities li {
  grid-template-columns: 1fr;
  gap: 6px;
}

.coaching-opportunities span {
  color: var(--ink);
  line-height: 1.45;
}

.coaching-opportunities strong {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.coaching-opportunity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.practice-skill-button {
  min-height: 30px;
  border-color: var(--brand-line);
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--brand-strong);
  font-size: 0.8rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.progress-grid div {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.progress-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-grid strong {
  font-size: 1.4rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid #edf0ec;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  line-height: 1.4;
}

.recent-sessions {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-sessions li {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #edf0ec;
  padding-bottom: 10px;
}

.recent-sessions li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recent-sessions span,
.empty-state {
  color: var(--muted);
}

.recent-session-detail {
  display: grid;
  gap: 12px;
}

.recent-session-detail summary {
  display: grid;
  gap: 4px;
  cursor: pointer;
  list-style: none;
}

.recent-session-detail summary::-webkit-details-marker {
  display: none;
}

.recent-session-detail summary strong::after {
  content: "  View";
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
}

.recent-session-detail[open] summary strong::after {
  content: "  Hide";
}

.recent-session-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.recent-session-links a {
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 900;
  text-decoration: none;
}

.saved-call-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
}

.saved-call-block h3 {
  margin: 0;
  font-size: 0.95rem;
}

.saved-call-block pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font: inherit;
  line-height: 1.45;
}

.saved-transcript {
  max-height: 360px;
  overflow: auto;
  margin: 0;
}

.saved-report-block {
  background: #fff;
}

.saved-report-content {
  margin-top: 0;
}

.saved-report-content .report-score {
  background: #fff2f3;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .setup-panel,
  .practice-panel {
    padding: 22px;
  }

  .dashboard-grid,
  .tracking-grid,
  .quick-report-grid,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-details summary {
    display: grid;
  }

  .dashboard-details summary small {
    margin-left: 0;
  }
}
