/* ===== Colours and fonts (from the Claude Design file) ===== */
:root {
  --bg: #F2F5FF;
  --ink: #18224A;
  --muted: #5A6390;
  --blue: #2B44E0;
  --blue-soft: #E3E8FF;
  --blue-ring: #C9D2FF;
  --yellow: #FFD84D;
  --yellow-soft: #FFE68A;
  --coral: #FF8A6B;
  --red: #FF5C39;
  --red-ring: #FFD0C2;
  --white: #FFFFFF;
  --shadow: 0 4px 16px rgba(24, 34, 74, 0.07);
  --display: 'Fredoka', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #DCE3FF;
  font-family: var(--body);
  color: var(--ink);
}

button, select, input { font-family: inherit; }
[hidden] { display: none !important; }

/* The app is a phone-sized column, centred on bigger screens */
.app {
  position: relative;
  max-width: 440px;
  min-height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 500px) {
  .app { height: min(900px, calc(100dvh - 48px)); min-height: 0; margin-top: 24px; border-radius: 36px; box-shadow: 0 20px 60px rgba(24, 34, 74, 0.18); }
}

.blob { position: absolute; border-radius: 50%; pointer-events: none; }
.blob-yellow { width: 260px; height: 260px; background: var(--yellow); top: -120px; right: -90px; }
.blob-coral { width: 140px; height: 140px; background: var(--coral); top: 40px; right: -60px; opacity: 0.85; }

.view {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 12px;
}

/* ===== Header ===== */
.top { display: flex; align-items: center; justify-content: space-between; padding: 28px 24px 8px; }
.top-page { align-items: flex-end; padding-top: 40px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 40px; height: 40px; border-radius: 14px; background: var(--blue); display: flex; align-items: center; justify-content: center; }
.logo-text { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.5px; }
.page-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 32px; }

/* ===== Language switch ===== */
.lang-switch {
  margin: 16px 24px 0;
  background: var(--white);
  border-radius: 999px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}
.lang { flex: 1; text-align: center; padding: 10px 0; border-radius: 999px; font-weight: 800; font-size: 15px; }
.lang-from { background: var(--yellow-soft); }
.lang-to { background: var(--blue-soft); }
.swap {
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}
.swap:hover { transform: rotate(180deg); }
.swap:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Cards ===== */
.cards { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px 0; }
.card { background: var(--white); border-radius: 24px; padding: 18px 20px; box-shadow: var(--shadow); }
.card-said { background: var(--blue); color: var(--white); box-shadow: none; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.label-light { color: #DCE2FF; }
.heard-text { margin: 8px 0 0; font-size: 18px; line-height: 1.45; color: #3A4470; min-height: 52px; }
.heard-text .interim { color: #7C84AA; }
.said-text { margin: 6px 0 0; font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.3; min-height: 62px; }
.said-text.placeholder, .heard-text.placeholder { opacity: 0.75; }

.round-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.round-btn.yellow { background: var(--yellow); }
.round-btn.blue { background: var(--blue); }
.round-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Microphone ===== */
.mic-area { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0 12px; }
.mic {
  width: 104px; height: 104px;
  border-radius: 50%;
  border: 8px solid var(--blue-ring);
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(43, 68, 224, 0.35);
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.mic:active { transform: scale(0.95); }
.mic.listening { background: var(--red); border-color: var(--red-ring); box-shadow: 0 10px 28px rgba(255, 92, 57, 0.4); animation: pulse 1.6s infinite; }
.mic:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 57, 0.45); }
  50% { box-shadow: 0 0 0 18px rgba(255, 92, 57, 0); }
}
.status { font-weight: 800; font-size: 16px; text-align: center; padding: 0 24px; }
.status.error { color: #B8321A; }

.bars { display: flex; align-items: center; gap: 5px; height: 28px; visibility: hidden; }
.bars.on { visibility: visible; }
.bars span { width: 6px; height: 12px; border-radius: 3px; background: var(--coral); animation: bar 0.9s ease-in-out infinite; }
.bars span:nth-child(2) { animation-delay: 0.15s; }
.bars span:nth-child(3) { animation-delay: 0.3s; }
.bars span:nth-child(4) { animation-delay: 0.45s; }
.bars span:nth-child(5) { animation-delay: 0.6s; }
@keyframes bar { 0%, 100% { height: 10px; } 50% { height: 28px; } }

/* ===== History ===== */
.pill-btn {
  height: 44px; padding: 0 16px;
  border: 2px solid var(--blue-ring);
  background: var(--white);
  border-radius: 999px;
  font-weight: 800; font-size: 14px;
  color: var(--blue);
  cursor: pointer;
}
.history-list { list-style: none; margin: 0; padding: 8px 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.history-item { background: var(--white); border-radius: 22px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); }
.history-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.history-meta { display: flex; align-items: center; gap: 8px; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--yellow-soft); }
.time { font-size: 12px; font-weight: 700; color: var(--muted); }
.history-from { font-size: 14px; color: var(--muted); }
.history-to { font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.3; }
.empty { margin: 24px; text-align: center; color: var(--muted); font-weight: 700; }

/* ===== Settings ===== */
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 6px; }
.select {
  height: 48px; width: 100%;
  border-radius: 14px;
  border: 2px solid var(--blue-ring);
  background: var(--bg);
  padding: 0 12px;
  font-size: 16px; font-weight: 700;
  color: var(--ink);
}
.speed-value { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--blue); }
input[type="range"] { width: 100%; accent-color: var(--blue); height: 28px; }
.speed-scale { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); }
.toggles { padding: 6px 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-size: 16px; font-weight: 700; cursor: pointer; }
.toggle-row input { width: 24px; height: 24px; accent-color: var(--blue); flex-shrink: 0; }
.divider { height: 1px; background: var(--blue-soft); }
.big-btn {
  height: 52px; border: none; border-radius: 999px;
  background: var(--yellow);
  font-size: 16px; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
}

/* ===== Bottom navigation ===== */
.nav {
  position: relative;
  display: flex; justify-content: space-around;
  background: var(--white);
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 16px rgba(24, 34, 74, 0.06);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 80px; padding: 8px 0;
  border: none; background: none; border-radius: 16px;
  color: var(--muted);
  font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 800; }

button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
