:root {
  color-scheme: light;
  --paper: #f7f4ea;
  --ink: #18231f;
  --muted: #61706b;
  --line: #d8d2c3;
  --board: #fffdf7;
  --green: #2f6f5e;
  --green-dark: #204d42;
  --red: #9c3429;
  --amber: #b7791f;
  --blue: #2e5f91;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button {
  border: 0;
  font: inherit;
}

.tablet-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
  width: 100vw;
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.68);
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 750;
}

.status-light {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
}

.status[data-status="connecting"] .status-light {
  background: var(--amber);
}

.status[data-status="listening"] .status-light {
  background: var(--green);
}

.status[data-status="speaking"] .status-light {
  background: var(--blue);
}

.status[data-status="paused"] .status-light {
  background: var(--amber);
}

.status[data-status="error"] .status-light {
  background: var(--red);
}

.board {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 360px;
  padding: 34px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--board);
}

.board-type {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board h2 {
  margin: 0 0 26px;
  font-size: 3.8rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.board pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  color: var(--ink);
  font: 700 2.35rem/1.32 ui-sans-serif, system-ui, sans-serif;
}

.caption {
  min-height: 82px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.caption p {
  margin: 0;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.control {
  min-height: 78px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--line);
  font-size: 1.55rem;
  font-weight: 850;
  touch-action: manipulation;
}

.control:disabled {
  opacity: 0.42;
}

.control.primary {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.control.danger {
  color: var(--red);
}

.control:not(:disabled):active {
  transform: translateY(1px);
}

#remoteAudio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 760px) {
  .tablet-shell {
    padding: 16px;
    gap: 12px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .status {
    min-height: 38px;
    font-size: 0.92rem;
  }

  .board {
    min-height: 300px;
    padding: 22px;
  }

  .board h2 {
    font-size: 2.7rem;
  }

  .board pre {
    font-size: 1.75rem;
  }

  .caption p {
    font-size: 1.12rem;
  }

  .control {
    min-height: 62px;
    font-size: 1.12rem;
  }
}
