/* ============================================================
   VOA 監査ボイスメモ - スタイル
   iOS Safari / PWA 想定
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f5f7;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ===== 画面切替 ===== */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: block; }

/* ===== トップバー ===== */
.topbar {
  background: #1a1a1a;
  color: #fff;
  padding: 16px 16px env(safe-area-inset-top, 0) 16px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.topbar-session {
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.session-meta-line {
  font-size: 14px;
  font-weight: 600;
}
.session-id-line {
  font-size: 11px;
  opacity: 0.6;
  font-family: ui-monospace, "SF Mono", monospace;
  margin-top: 2px;
}

/* ===== 警告バー ===== */
.warning-bar {
  background: #fff4e0;
  color: #b85c00;
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
  border-bottom: 1px solid #ffe4b8;
}

/* ===== バナー ===== */
.banner {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.banner-warn {
  background: #fff8d0;
  border-bottom: 1px solid #f0e090;
  color: #5a4a00;
}
.banner span { flex: 1; }
.banner button {
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.banner .link-btn {
  background: transparent;
  color: #5a4a00;
  text-decoration: underline;
  padding: 4px 6px;
}
.hidden { display: none !important; }

/* ===== コンテンツ ===== */
.content {
  padding: 16px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  max-width: 600px;
  margin: 0 auto;
}
.content h2 {
  font-size: 16px;
  margin: 8px 0 16px;
  font-weight: 600;
}
.note { color: #666; font-size: 13px; margin: 16px 0; }
.small { font-size: 12px; }

/* ===== フォーム ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
input[type="text"],
select {
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border: 1px solid #d0d0d4;
  border-radius: 8px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.radio-group {
  display: flex;
  gap: 8px;
}
.radio-group label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #d0d0d4;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.radio-group input[type="radio"] {
  margin-right: 6px;
}
.radio-group label:has(input:checked) {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ===== ボタン ===== */
.btn-primary {
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-block {
  display: block;
  width: 100%;
  margin-top: 24px;
}

/* ===== 大項目リスト ===== */
.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.item-card {
  background: #fff;
  border: 1px solid #e2e2e6;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.item-title {
  font-size: 16px;
  font-weight: 600;
}
.item-status {
  font-size: 12px;
  color: #666;
  font-family: ui-monospace, "SF Mono", monospace;
}
.item-status.recording { color: #d00; font-weight: 600; }
.item-status.uploading { color: #b85c00; }
.item-status.transcribing { color: #0066cc; }
.item-status.done { color: #008000; font-weight: 600; }
.item-status.error { color: #d00; }

.item-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.item-controls button {
  flex: 1;
  min-width: 80px;
  padding: 10px;
  border: 1px solid #d0d0d4;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.item-controls button.primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.item-controls button.recording-active {
  background: #d00;
  color: #fff;
  border-color: #d00;
  animation: pulse 1.2s infinite;
}
.item-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.item-controls button:not(:disabled):hover {
  background: #f0f0f4;
}
.item-controls button:not(:disabled):active {
  background: #e0e0e4;
  transform: scale(0.97);
}
.item-controls button.primary:not(:disabled):hover {
  background: #333;
}
.item-controls button.primary:not(:disabled):active {
  background: #444;
}
.item-controls button.playing {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}
.item-controls button.playing:not(:disabled):hover {
  background: #0055aa;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.item-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  font-family: ui-monospace, "SF Mono", monospace;
}

/* ===== トースト ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  max-width: calc(100% - 32px);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.hidden { display: none; }

/* ===== Complete画面 ===== */
#complete-summary {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
#complete-summary .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f4;
  font-size: 14px;
}
#complete-summary .summary-row:last-child { border-bottom: none; }
#complete-summary .status-done { color: #008000; }
#complete-summary .status-pending { color: #b85c00; }
#complete-summary .status-error { color: #d00; }
