:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #f5f7fa;
  background: #0b0d10;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #0b0d10; }
body { min-height: 100dvh; }
button, input { font: inherit; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow { color: #7f8b99; font-size: 11px; letter-spacing: .16em; font-weight: 700; }
h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.03em; }

.badge { padding: 7px 10px; border-radius: 999px; font-size: 12px; background: #1a1f26; color: #aab4c0; white-space: nowrap; }
.badge.live { color: #d8ffe7; background: #163224; }
.badge.error { color: #ffd9d9; background: #3a1b1b; }

.meeting-card, .transcript-panel {
  border: 1px solid #232a33;
  background: #101419;
  border-radius: 18px;
}

.meeting-card { padding: 14px; }
.field-label { display: block; font-size: 12px; color: #7f8b99; margin-bottom: 7px; }
.title-input {
  width: 100%; border: 0; outline: 0; border-radius: 12px; padding: 12px 13px;
  background: #171c22; color: #f5f7fa; font-size: 16px;
}
.title-input::placeholder { color: #66717e; }

.status-row { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; }
.recording-state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #aab4c0; }
.record-dot { width: 9px; height: 9px; border-radius: 50%; background: #4b5562; }
.record-dot.live { background: #ef4444; box-shadow: 0 0 0 5px rgba(239,68,68,.11); }
.record-dot.paused { background: #eab308; }
.timer { font-variant-numeric: tabular-nums; font-weight: 650; color: #e8edf3; }

.transcript-panel {
  flex: 1;
  min-height: 45dvh;
  max-height: 64dvh;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.empty-state { min-height: 34dvh; display: grid; place-content: center; text-align: center; gap: 8px; color: #717d89; }
.empty-state strong { color: #aab4c0; font-size: 16px; }
.empty-state span { font-size: 13px; }
.transcript-list { display: flex; flex-direction: column; gap: 14px; }
.transcript-item { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: start; }
.transcript-time { color: #6f7b87; font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.transcript-text { color: #f2f5f8; font-size: 18px; line-height: 1.65; word-break: break-word; }
.partial-line { margin: 14px 0 0 72px; color: #98a3ae; font-size: 18px; line-height: 1.65; opacity: .85; }
.hidden { display: none !important; }

.controls { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; }
.btn { border: 0; border-radius: 14px; min-height: 50px; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .38; cursor: default; }
.btn.primary { background: #f4f6f8; color: #0c1117; }
.btn.secondary { background: #20262e; color: #f2f5f8; }
.btn.danger { background: #3b2022; color: #ffd9dc; }

.secondary-controls { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.link-btn { border: 0; background: transparent; color: #8fa1b3; padding: 6px; font-size: 13px; }
.link-btn:disabled { opacity: .35; }
.footer-note { text-align: center; color: #596572; font-size: 11px; line-height: 1.5; padding: 2px 8px 0; }

.mic-meter { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mic-meter.hidden { display: none; }
.mic-meter-label { color: #8fa1b3; font-size: 12px; white-space: nowrap; }
.mic-meter-track { flex: 1; height: 8px; border-radius: 4px; background: #1a2027; overflow: hidden; }
.mic-meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #34d399, #22d3ee); border-radius: 4px; transition: width .1s ease; }
.diag-info { margin-top: 6px; color: #596572; font-size: 11px; font-family: ui-monospace, monospace; min-height: 14px; }

@media (max-width: 430px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 22px; }
  .transcript-text, .partial-line { font-size: 17px; }
  .transcript-item { grid-template-columns: 52px 1fr; gap: 8px; }
  .partial-line { margin-left: 60px; }
  .controls { grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
}
