:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f8;
  color: #15252f;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #173f5f;
}

.skip-link:focus {
  top: 1rem;
}

.app-header,
.app-shell,
footer {
  width: min(100% - 2rem, 48rem);
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

h2 {
  line-height: 1.25;
}

.eyebrow,
.step-label {
  margin-bottom: 0.25rem;
  color: #486472;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  flex: none;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: #d9f2e5;
  color: #174e35;
  font-size: 0.85rem;
  font-weight: 700;
}

.status[data-online="false"] {
  background: #fff0c7;
  color: #684d00;
}

.app-shell {
  display: grid;
  gap: 1rem;
  flex: 1;
}

.intro,
.conversation-placeholder,
.session-panel,
.offline-note {
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid #d5dfe3;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.25rem 1.5rem rgb(21 37 47 / 7%);
}

.intro {
  color: #fff;
  border-color: #173f5f;
  background: #173f5f;
}

.session-panel {
  grid-column: 1 / -1;
}

.session-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.pilot-access {
  display: grid;
  gap: 0.55rem;
  margin-block: 1rem;
  padding: 0.85rem;
  border: 1px solid #c7d4da;
  border-radius: 0.75rem;
  background: #f5f8f9;
}

.pilot-access input {
  min-height: 3rem;
  border: 1px solid #8499a3;
  border-radius: 0.55rem;
  padding-inline: 0.7rem;
  font: inherit;
}

.compact-button {
  width: auto;
  min-width: 7rem;
  margin-top: 0;
}

.turn-list {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.turn-card {
  padding: 1rem;
  border: 1px solid #c7d4da;
  border-radius: 0.85rem;
}

.turn-card h3 {
  margin-block: 0 0.75rem;
}

.result-block {
  margin-top: 0.85rem;
  padding: 0.8rem;
  border-left: 0.3rem solid #5d7784;
  background: #f5f8f9;
}

.translation-block {
  border-left-color: #256a8a;
}

.fact-block {
  border-left-color: #d79500;
}

.warning-block {
  border-left-color: #b44132;
}

.confirmation-block {
  border-left-color: #31845c;
}

.result-block h4,
.result-block p {
  margin-bottom: 0.35rem;
}

.invalidated-result {
  color: #684d00;
  font-weight: 700;
}

.intro p,
.conversation-placeholder p,
.offline-note p {
  line-height: 1.6;
}

button {
  width: 100%;
  min-height: 3.25rem;
  border: 0;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 700;
}

button:disabled {
  background: #dce3e6;
  color: #586970;
  cursor: not-allowed;
}

button:not(:disabled) {
  background: #173f5f;
  color: #fff;
  cursor: pointer;
}

button:not(:disabled):hover {
  background: #0f3049;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0.2rem solid #d79500;
  outline-offset: 0.15rem;
}

.session-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid #c7d4da;
  border-radius: 0.75rem;
}

.session-settings legend,
.session-settings label {
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem;
  border: 1px solid #82949d;
  border-radius: 0.6rem;
  background: #fff;
  color: inherit;
  font: inherit;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.compare-block {
  border-left-color: #7054a5;
}

.reference-label {
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.secondary-button {
  margin-top: 0.65rem;
  border: 0.12rem solid #173f5f;
  background: #fff !important;
  color: #173f5f !important;
}

.recording-state {
  display: grid;
  gap: 0.2rem;
  margin-block: 1rem;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: #edf3f5;
}

.recording-state[data-state="RECORDING"] {
  background: #ffe5e2;
  color: #7a1f17;
}

.recording-state[data-state="PROCESSING"] {
  background: #e6eef8;
  color: #173f5f;
}

.recording-state[data-state="RECOVERABLE_ERROR"] {
  background: #fff0c7;
  color: #684d00;
}

.recording-state span {
  line-height: 1.45;
}

.transcript-boundary {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #d5dfe3;
}

.transcript-boundary p {
  margin-block: 0.35rem 0.65rem;
  color: #52646d;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #9cabb2;
  border-radius: 0.65rem;
  padding: 0.75rem;
  color: inherit;
  font: inherit;
  line-height: 1.5;
}

.supporting-text {
  margin: 0.75rem 0 0;
  color: #52646d;
  font-size: 0.9rem;
}

.offline-note {
  border-left: 0.35rem solid #d79500;
}

footer {
  padding-block: 1.5rem;
  color: #52646d;
  text-align: center;
}

@media (min-width: 40rem) {
  .app-shell {
    grid-template-columns: 1fr 1fr;
  }

  .intro {
    grid-column: 1 / -1;
  }

  .session-settings {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
