/* AudioRec PWA — Mobile-first */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Lexend, sans-serif;
  background: #0c1117;
  color: #e8eef5;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
input, textarea { user-select: text; -webkit-user-select: text; }

#app { height: 100%; display: flex; flex-direction: column; }
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 24px 20px;
  overflow-y: auto;
}
.screen.active { display: flex; }

/* --- Login --- */
.brand {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 30vh;
  text-align: center;
}
.brand-sub {
  font-size: 14px;
  color: #8a96a8;
  text-align: center;
  margin-bottom: 32px;
}
#form-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
}
#pin-input {
  font-size: 28px;
  text-align: center;
  letter-spacing: 8px;
  padding: 16px;
  border-radius: 14px;
  background: #1a232f;
  border: 1px solid #2a3848;
  color: #e8eef5;
}
#form-login button {
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  border-radius: 14px;
  background: #4a8eff;
  color: #fff;
  border: 0;
}
.error {
  color: #ff6b6b;
  text-align: center;
  font-size: 14px;
  margin-top: 8px;
}

/* --- Recorder --- */
.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.rec-title { font-size: 20px; font-weight: 600; }
.btn-icon {
  background: transparent;
  border: 0;
  color: #8a96a8;
  font-size: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
}

.meta-row { margin-bottom: 12px; }
.meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta > span {
  font-size: 12px;
  color: #8a96a8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.meta input, .meta select, .meta textarea {
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1a232f;
  border: 1px solid #2a3848;
  color: #e8eef5;
  width: 100%;
  font-family: inherit;
}
.meta select { appearance: none; }

/* --- Record button --- */
.record-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
  min-height: 280px;
}
.timer {
  font-size: 48px;
  font-weight: 200;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.rec-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ff3b30;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.btn-record {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 4px solid #2a3848;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.btn-record:active { transform: scale(0.96); }
.btn-record-inner {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #ff3b30;
  transition: all 0.2s ease;
}
.btn-record.recording .btn-record-inner {
  width: 48px; height: 48px;
  border-radius: 12px;
}
.rec-state {
  font-size: 13px;
  color: #8a96a8;
  letter-spacing: 0.4px;
}

/* --- Actions --- */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.action-row button {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  padding: 14px;
  border-radius: 12px;
  background: #1a232f;
  color: #e8eef5;
  border: 1px solid #2a3848;
}
.action-row button.primary {
  background: #4a8eff;
  color: #fff;
  border-color: #4a8eff;
}

/* --- Upload-Status --- */
.upload-status {
  margin-top: 16px;
  padding: 14px;
  background: #1a232f;
  border-radius: 12px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.progress {
  height: 6px;
  background: #2a3848;
  border-radius: 3px;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: #4a8eff;
  transition: width 0.3s ease;
}
.pipeline-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #ffb3b3;
  line-height: 1.4;
}

/* --- Transcript --- */
.transcript-card {
  margin-top: 16px;
  padding: 16px;
  background: #1a232f;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.transcript-title {
  font-size: 14px;
  font-weight: 600;
}
#transcript-area, #note-area {
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
}
