:root {
  --bg: #0a0a1a;
  --card: #16213e;
  --card-hover: #1e2a4a;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --indigo: #4f46e5;
  --red: #ef4444;
  --red-dark: #dc2626;
  --yellow: #fbbf24;
  --green: #10b981;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

/* ── 共通 ── */
.view {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
  max-width: 480px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* ── ホーム画面 ── */
.app-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.moon {
  color: var(--yellow);
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
}

.date-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  width: 100%;
}

.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.date-text {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--purple-light);
}

.btn-text {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-text:hover {
  color: var(--text);
  border-color: var(--purple-light);
}

.date-note {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.date-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.btn-record {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  border: none;
  font-size: 2.2rem;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.45), 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.12s, box-shadow 0.12s;
  user-select: none;
}
.btn-record:active {
  transform: scale(0.93);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.btn-summary {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 2rem;
  color: var(--purple-light);
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-summary:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--purple-light);
}

/* ── 録音中画面 ── */
.recording-label {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.timer {
  font-size: 4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 0 30px rgba(167, 139, 250, 0.4);
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 500;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.btn-stop {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--red);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-stop:active {
  transform: scale(0.93);
}

.stop-square {
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 4px;
}

/* ── 選択画面 ── */
.choice-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.5));
}

.choice-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.choice-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-choice {
  width: 100%;
  padding: 1rem;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-choice:active {
  transform: scale(0.98);
}
.btn-choice:hover {
  background: var(--card-hover);
}

.btn-choice-primary {
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  border-color: transparent;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.35);
}
.btn-choice-primary:hover {
  background: linear-gradient(135deg, #8b47ff, #5b52f0);
}

/* ── 処理中画面 ── */
.spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-text {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ── 結果画面 ── */
.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.badge {
  border-radius: 2rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-date {
  background: rgba(167, 139, 250, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-duration {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-ai {
  background: rgba(79, 70, 229, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.result-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  width: 100%;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--purple-light);
}

.analysis-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.analysis-item {
  border-left: 2px solid rgba(124, 58, 237, 0.4);
  padding-left: 0.875rem;
}

.analysis-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.result-content {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
}

.sage-card {
  background: var(--card-hover);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.sage-card:last-child {
  margin-bottom: 0;
}
.sage-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 0.5rem;
}
.sage-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.actions-list {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.actions-list li {
  font-size: 0.92rem;
  line-height: 1.6;
  padding-left: 0.25rem;
}

.btn-new-recording {
  width: 100%;
  padding: 1rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
  transition: transform 0.12s, opacity 0.15s;
}
.btn-new-recording:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ── 文字起こし確認画面 ── */
.transcription-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
}

/* ── スクロール対応（結果画面） ── */
#view-results {
  justify-content: flex-start;
  padding-top: 2rem;
  padding-bottom: 3rem;
}
