/* ==============================
   整備アシストAI - style.css
   ============================== */

/* ---------- リセット ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ---------- CSS変数 ---------- */
:root {
  /* ブランドカラー */
  --navy-900: #0A1930;
  --navy-800: #0F2244;
  --navy-700: #152C5C;
  --navy-600: #1E3E7E;
  --blue-500: #1E5FD6;
  --blue-400: #3B7FEA;
  --blue-300: #6BA3FF;
  --cyan-400: #4DB8E8;
  
  /* ニュートラル */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F4F9;
  --gray-200: #E4E9F0;
  --gray-300: #D0D7E2;
  --gray-400: #98A2B3;
  --gray-500: #667085;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1D2939;
  --gray-900: #101828;
  
  /* セマンティック */
  --success: #0E9F6E;
  --success-bg: #E6F6EF;
  --danger: #DC2626;
  --warning: #E87722;
  --warning-bg: #FFF3E6;
  
  /* 影 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.08), 0 4px 8px rgba(16, 24, 40, 0.04);
  --shadow-xl: 0 24px 48px rgba(16, 24, 40, 0.10), 0 8px 16px rgba(16, 24, 40, 0.06);
  --shadow-navy: 0 12px 32px rgba(10, 25, 48, 0.18), 0 4px 8px rgba(10, 25, 48, 0.08);
  --shadow-blue: 0 8px 24px rgba(30, 95, 214, 0.25);
  
  /* 角丸 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  
  /* トランジション */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- ベース ---------- */
body {
  font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-weight: 400;
  color: var(--gray-900);
  background:
    radial-gradient(1200px 600px at 50% -200px, #E8EEFA 0%, transparent 60%),
    linear-gradient(180deg, #F5F7FB 0%, #EEF2F9 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(228, 233, 240, 0.8);
}

.icon-btn {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: var(--gray-100); transform: scale(0.94); }

.notify-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6B6B, #DC2626);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(220, 38, 38, 0.5);
}

.header-title { flex: 1; min-width: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(30, 95, 214, 0.25));
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-400) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(30, 95, 214, 0.3);
}

.subcopy {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--gray-500);
  letter-spacing: 0;
  line-height: 1.3;
  margin-top: 2px;
}

/* ---------- メイン ---------- */
.app-main {
  padding: 20px 16px 0;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- 車両カード ---------- */
.vehicle-card {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFE 100%);
  border: 1px solid rgba(228, 233, 240, 0.8);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
  animation: fadeUp 0.6s var(--ease) both;
}

.vehicle-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-500);
  background: linear-gradient(135deg, rgba(30, 95, 214, 0.08), rgba(107, 163, 255, 0.08));
  border: 1px solid rgba(30, 95, 214, 0.15);
  border-radius: 999px;
}

.chip svg { color: var(--blue-500); animation: pulse 2s infinite; }

.time {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: 0.02em;
}

.vehicle-thumb {
  position: relative;
  margin: 14px 16px 0;
  height: 160px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse at 50% 80%, rgba(30, 95, 214, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #F4F7FC 0%, #E8EEF9 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(228, 233, 240, 0.6);
  box-shadow: inset 0 2px 8px rgba(10, 25, 48, 0.04);
}

.car-illust {
  width: 90%;
  height: 90%;
  filter: drop-shadow(0 8px 16px rgba(10, 25, 48, 0.15));
}

/* 実写の車両写真用 */
.car-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  display: block;
  filter: contrast(1.02) saturate(1.05);
}

.thumb-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 40%);
  pointer-events: none;
}

.vehicle-info {
  padding: 16px 18px 20px;
}

.customer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gray-200);
}

.customer-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(10, 25, 48, 0.2);
}

.customer-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.customer-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 1px;
}

.vehicle-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

.spec dt {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.spec dd {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.spec dd .unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-left: 2px;
}

/* ---------- セクションラベル ---------- */
.section-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.step-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-500);
  letter-spacing: 0.12em;
  padding: 3px 9px;
  background: rgba(30, 95, 214, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(30, 95, 214, 0.15);
}

.section-label h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  flex: 1;
}

.label-hint {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 400;
}

/* ---------- 音声入力 ---------- */
.voice-section { margin-bottom: 28px; }

.voice-panel {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 60%, #1a3a6e 100%);
  border-radius: var(--r-xl);
  padding: 28px 20px 22px;
  overflow: hidden;
  box-shadow: var(--shadow-navy);
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}

.voice-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 400px at 50% -100px, rgba(107, 163, 255, 0.2) 0%, transparent 60%),
    radial-gradient(400px 200px at 100% 100%, rgba(77, 184, 232, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.voice-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.mic-container {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(107, 163, 255, 0.35);
  opacity: 0;
}

.voice-panel.recording .ring.r1 { animation: ring 2s ease-out infinite 0s; }
.voice-panel.recording .ring.r2 { animation: ring 2s ease-out infinite 0.6s; }
.voice-panel.recording .ring.r3 { animation: ring 2s ease-out infinite 1.2s; }

@keyframes ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.mic-btn {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--blue-400) 0%, var(--blue-500) 60%, #1548B0 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(107, 163, 255, 0.12),
    0 10px 28px rgba(30, 95, 214, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  transition: all 0.25s var(--ease);
  z-index: 2;
}

.mic-btn svg { width: 36px; height: 36px; stroke-width: 2.2; }

.mic-btn:active { transform: scale(0.94); }

.voice-panel.recording .mic-btn {
  background: linear-gradient(145deg, #FF6B6B 0%, #DC2626 60%, #991B1B 100%);
  box-shadow:
    0 0 0 6px rgba(255, 107, 107, 0.15),
    0 10px 28px rgba(220, 38, 38, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* 波形 */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.waveform span {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--blue-300), var(--cyan-400));
  opacity: 0.3;
  transition: all 0.2s var(--ease);
}

.voice-panel.recording .waveform span {
  animation: wave 1.2s ease-in-out infinite;
  opacity: 0.85;
}

.voice-panel.recording .waveform span:nth-child(1)  { animation-delay: 0.00s; }
.voice-panel.recording .waveform span:nth-child(2)  { animation-delay: 0.06s; }
.voice-panel.recording .waveform span:nth-child(3)  { animation-delay: 0.12s; }
.voice-panel.recording .waveform span:nth-child(4)  { animation-delay: 0.18s; }
.voice-panel.recording .waveform span:nth-child(5)  { animation-delay: 0.24s; }
.voice-panel.recording .waveform span:nth-child(6)  { animation-delay: 0.30s; }
.voice-panel.recording .waveform span:nth-child(7)  { animation-delay: 0.36s; }
.voice-panel.recording .waveform span:nth-child(8)  { animation-delay: 0.42s; }
.voice-panel.recording .waveform span:nth-child(9)  { animation-delay: 0.48s; }
.voice-panel.recording .waveform span:nth-child(10) { animation-delay: 0.54s; }
.voice-panel.recording .waveform span:nth-child(11) { animation-delay: 0.60s; }
.voice-panel.recording .waveform span:nth-child(12) { animation-delay: 0.54s; }
.voice-panel.recording .waveform span:nth-child(13) { animation-delay: 0.48s; }
.voice-panel.recording .waveform span:nth-child(14) { animation-delay: 0.42s; }
.voice-panel.recording .waveform span:nth-child(15) { animation-delay: 0.36s; }
.voice-panel.recording .waveform span:nth-child(16) { animation-delay: 0.30s; }
.voice-panel.recording .waveform span:nth-child(17) { animation-delay: 0.24s; }
.voice-panel.recording .waveform span:nth-child(18) { animation-delay: 0.18s; }
.voice-panel.recording .waveform span:nth-child(19) { animation-delay: 0.12s; }
.voice-panel.recording .waveform span:nth-child(20) { animation-delay: 0.06s; }

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 28px; }
}

.voice-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s var(--ease);
}

.voice-panel.recording .status-dot {
  background: #FF6B6B;
  box-shadow: 0 0 12px #FF6B6B;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink { 50% { opacity: 0.4; } }

.status-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.transcript {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  min-height: 70px;
  backdrop-filter: blur(10px);
  z-index: 1;
}

.transcript-placeholder {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.6;
  padding: 8px 0;
}

.transcript p:not(.transcript-placeholder) {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13.5px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.transcript .typed-char {
  opacity: 0;
  animation: fadeIn 0.1s var(--ease) forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

/* ---------- フロー全体 ---------- */
.generation-section { margin-bottom: 24px; }

.flow-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* カード */
.flow-card {
  position: relative;
  animation: fadeUp 0.6s var(--ease) both;
}

.flow-card:nth-child(1) { animation-delay: 0.15s; }
.flow-card:nth-child(2) { animation-delay: 0.25s; }
.flow-card:nth-child(3) { animation-delay: 0.35s; }
.flow-card:nth-child(4) { animation-delay: 0.45s; }

/* 接続ライン */
.flow-connector {
  position: absolute;
  left: 36px;
  bottom: -14px;
  width: 2px;
  height: 14px;
  background: linear-gradient(180deg, var(--gray-300), var(--gray-200));
  border-radius: 2px;
  opacity: 0.6;
  z-index: 0;
}

.flow-card.completed .flow-connector {
  background: linear-gradient(180deg, var(--blue-500), var(--blue-300));
  opacity: 1;
  box-shadow: 0 0 8px rgba(30, 95, 214, 0.3);
}

.card-inner {
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.35s var(--ease);
  z-index: 1;
}

.flow-card.active .card-inner {
  border-color: rgba(30, 95, 214, 0.3);
  box-shadow: 0 0 0 3px rgba(30, 95, 214, 0.08), var(--shadow-lg);
  transform: translateY(-1px);
}

.flow-card.completed .card-inner {
  border-color: rgba(14, 159, 110, 0.25);
  background: linear-gradient(180deg, #fff 0%, #fafefc 100%);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s var(--ease);
}

.card-icon svg { width: 20px; height: 20px; }

.icon-record {
  background: linear-gradient(135deg, #1E5FD6, #3B7FEA);
  box-shadow: 0 4px 12px rgba(30, 95, 214, 0.3);
}
.icon-share {
  background: linear-gradient(135deg, #0F2244, #1E3E7E);
  box-shadow: 0 4px 12px rgba(15, 34, 68, 0.3);
}
.icon-explain {
  background: linear-gradient(135deg, #4DB8E8, #2E86C1);
  box-shadow: 0 4px 12px rgba(77, 184, 232, 0.3);
}
.icon-propose {
  background: linear-gradient(135deg, #E87722, #F59E0B);
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.3);
}

.card-meta {
  flex: 1;
  min-width: 0;
}

.card-num {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-meta h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 1px;
}

.status-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.3s var(--ease);
}

.status-badge.pending {
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.status-badge.processing {
  color: var(--blue-500);
  background: rgba(30, 95, 214, 0.08);
  border: 1px solid rgba(30, 95, 214, 0.2);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.completed {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(14, 159, 110, 0.2);
}

.status-badge.waiting {
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid rgba(232, 119, 34, 0.2);
}

.card-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.card-content {
  background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--gray-700);
  min-height: 66px;
  transition: all 0.3s var(--ease);
}

.flow-card.completed .card-content {
  background: linear-gradient(180deg, #fff 0%, #fafefc 100%);
  border-color: rgba(14, 159, 110, 0.15);
}

.card-content .result-title {
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 6px;
  font-size: 12.5px;
  letter-spacing: 0;
}

.card-content ul {
  list-style: none;
  padding: 0;
}

.card-content ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--gray-700);
}

.card-content ul li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 9px;
  width: 4px;
  height: 4px;
  background: var(--blue-500);
  border-radius: 50%;
}

.card-content .warning-line {
  color: var(--warning);
  font-weight: 500;
}

/* スケルトン */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 3px 0;
}

.skeleton span {
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-100) 50%, var(--gray-200) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.4s infinite;
}

.skeleton span:nth-child(1) { width: 85%; }
.skeleton span:nth-child(2) { width: 70%; }
.skeleton span:nth-child(3) { width: 55%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* アクションボタン */
.card-actions {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-ghost:not(:disabled):active {
  background: var(--gray-100);
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-400) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 95, 214, 0.25);
}

.btn-primary:not(:disabled):active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(30, 95, 214, 0.3);
}

/* ---------- 下部アクション ---------- */
.final-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  margin: 24px 0 16px;
  padding: 14px;
  background: #fff;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.6s var(--ease) 0.5s both;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.action-btn.secondary {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.action-btn.tertiary {
  background: #fff;
  color: var(--navy-800);
  border: 1px solid var(--gray-200);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(10, 25, 48, 0.3);
}

.action-btn:active { transform: scale(0.96); }

.action-btn.primary:active {
  box-shadow: 0 3px 8px rgba(10, 25, 48, 0.35);
}

.bottom-space { height: 80px; }

/* ---------- ボトムナビ ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(228, 233, 240, 0.8);
  box-shadow: 0 -4px 20px rgba(16, 24, 40, 0.04);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.2s var(--ease);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-item.active {
  color: var(--blue-500);
}

.nav-item.active svg {
  stroke-width: 2;
  filter: drop-shadow(0 2px 4px rgba(30, 95, 214, 0.3));
}

.nav-item:active { transform: scale(0.92); }

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 80px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(10, 25, 48, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 200;
  max-width: 90%;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast svg { color: #4ADE80; flex-shrink: 0; }

/* ---------- アニメーション ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------- レスポンシブ微調整 ---------- */
@media (min-width: 420px) {
  .brand-text h1 { font-size: 17px; }
  .subcopy { font-size: 11.5px; }
  .customer-name { font-size: 17px; }
  .card-meta h3 { font-size: 15.5px; }
}

@media (max-width: 360px) {
  .app-main { padding: 16px 12px 0; }
  .vehicle-specs { gap: 10px 12px; }
  .mic-container { width: 96px; height: 96px; }
  .mic-btn { width: 76px; height: 76px; }
  .mic-btn svg { width: 32px; height: 32px; }
  .final-actions { grid-template-columns: 1fr 1fr; }
  .action-btn.primary { grid-column: 1 / -1; }
}
