:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090d14;
  color: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(39, 106, 147, 0.24), transparent 30rem),
    linear-gradient(135deg, #090d14 0%, #10151d 55%, #11120f 100%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 13, 20, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.5rem;
  background: #36c2a6;
  color: #06120f;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
p,
li,
span {
  color: #aeb8c8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
}

.nav-links a,
.link-button {
  min-height: 2.5rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #c9d3df;
  cursor: pointer;
  white-space: nowrap;
}

.nav-links a.active,
.nav-links a:hover,
.link-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem);
}

.stack,
.practice-layout {
  display: grid;
  gap: 1rem;
}

.dashboard-hero,
.auth-page,
.practice-header {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.dashboard-hero {
  min-height: 18rem;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background:
    linear-gradient(135deg, rgba(54, 194, 166, 0.16), rgba(255, 255, 255, 0.03)),
    #101722;
}

.dashboard-hero h1,
.auth-copy h1,
.section-heading h1,
.practice-header h1 {
  max-width: 48rem;
  margin: 0.35rem 0;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-hero p,
.auth-copy p {
  max-width: 42rem;
  font-size: 1.08rem;
}

.auth-page {
  min-height: calc(100vh - 7rem);
}

.auth-card,
.content-section,
.interview-card,
.recorder-panel,
.suggestion-panel,
.tool-panel,
.state-card,
.timer-panel,
.metric {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(16, 22, 31, 0.88);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.auth-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: #dce5ef;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  background: #0b1119;
  color: #ffffff;
  outline: 0;
}

input:focus {
  border-color: #36c2a6;
  box-shadow: 0 0 0 3px rgba(54, 194, 166, 0.14);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 0.5rem;
  background: #080d13;
}

.segmented-control button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.38rem;
  background: transparent;
  color: #aeb8c8;
  cursor: pointer;
}

.segmented-control button.active {
  background: #1d2938;
  color: #ffffff;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

.primary-button {
  background: #36c2a6;
  color: #06120f;
}

.secondary-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: #151e2b;
  color: #eef4fb;
}

.danger-button {
  background: #ff6b6b;
  color: #210707;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.full-width,
.hero-action {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.big-actions > * {
  flex: 1 1 10rem;
}

.summary-grid,
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.metric {
  padding: 1rem;
}

.metric span,
.eyebrow {
  display: block;
  color: #81ddce;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
}

.content-section {
  padding: 1rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2,
.suggestion-panel h2,
.tool-panel h3,
.recorder-panel h3,
.info-list h3,
.answer-item h3 {
  margin: 0;
}

.tips-grid article {
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: #0c131c;
}

.history-list,
.answer-list {
  display: grid;
  gap: 0.75rem;
}

.history-item,
.answer-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  background: #0c131c;
}

.history-item:hover {
  border-color: rgba(54, 194, 166, 0.5);
}

.history-item div {
  display: grid;
  gap: 0.25rem;
}

.interview-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.interview-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.question-meta span {
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #0b1119;
  color: #cbd6e3;
  font-size: 0.82rem;
}

.tool-panel,
.timer-panel,
.recorder-panel,
.suggestion-panel {
  padding: 1rem;
}

.tool-panel {
  display: grid;
  gap: 0.75rem;
}

.timer-panel {
  display: grid;
  gap: 0.75rem;
}

.timer-panel strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 2.3rem;
}

.progress-track {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: #070b11;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #36c2a6, #f3c969);
  transition: width 250ms ease;
}

.recorder-panel {
  display: grid;
  gap: 1rem;
}

.recorder-panel > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-dot {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #59677a;
}

.status-dot.live {
  background: #ff6b6b;
  box-shadow: 0 0 0 0.45rem rgba(255, 107, 107, 0.14);
}

.audio-preview,
.answer-item audio {
  width: 100%;
}

.suggestion-panel {
  display: grid;
  gap: 1rem;
}

.muted-panel {
  background: rgba(16, 22, 31, 0.52);
}

.sample-answer {
  padding: 1rem;
  border-left: 4px solid #36c2a6;
  border-radius: 0.35rem;
  background: #0b1119;
  color: #edf7f5;
}

.info-list ul {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
}

.info-list li + li {
  margin-top: 0.45rem;
}

.practice-header {
  grid-template-columns: 1fr auto;
}

.bottom-actions {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 0.25rem;
  background: linear-gradient(180deg, transparent, #090d14 35%);
}

.center-state,
.state-card {
  padding: 1rem;
  color: #c8d2df;
}

.center-state {
  min-height: 45vh;
  display: grid;
  place-items: center;
}

.error-text,
.warning-text {
  margin: 0;
  padding: 0.8rem;
  border-radius: 0.45rem;
}

.error-text {
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
}

.warning-text {
  border: 1px solid rgba(243, 201, 105, 0.4);
  background: rgba(243, 201, 105, 0.12);
  color: #ffe6a8;
}

@media (min-width: 760px) {
  .auth-page,
  .dashboard-hero {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .auth-card {
    padding: 1.25rem;
  }

  .hero-action {
    justify-self: end;
    width: auto;
    min-width: 14rem;
  }

  .tool-panel {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .history-item,
  .answer-item {
    grid-template-columns: 1fr minmax(14rem, 20rem);
    align-items: center;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    padding-bottom: 0.15rem;
  }

  .brand small {
    display: none;
  }

  .practice-header {
    grid-template-columns: 1fr;
  }

  .practice-header .secondary-button {
    width: 100%;
  }
}
