* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  padding: 30px 0 20px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #888;
  font-size: 14px;
  margin-top: 6px;
}

/* Language Selector */
.lang-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: 10px;
}

.lang-btn {
  padding: 8px 16px;
  border: 1px solid #333;
  border-radius: 20px;
  background: #1a1a1a;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: #555;
  color: #ccc;
}

.lang-btn.active {
  border-color: #6366f1;
  background: #1e1e3a;
  color: #a5b4fc;
  font-weight: 600;
}

/* Recorder */
.recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0;
}

.record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #333;
  background: #1a1a1a;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.record-btn:hover {
  border-color: #ef4444;
  background: #1f1f1f;
}

.record-btn.recording {
  border-color: #ef4444;
  background: #2a1515;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

.record-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef4444;
  transition: all 0.2s;
}

.record-btn.recording .record-icon {
  border-radius: 4px;
  width: 20px;
  height: 20px;
}

.record-label {
  font-size: 11px;
  color: #888;
}

.timer {
  font-size: 24px;
  font-weight: 600;
  color: #ef4444;
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
}

.waveform {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

/* Current Memo */
.current-memo {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.current-memo h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #ccc;
}

#transcriptText {
  width: 100%;
  min-height: 120px;
  max-height: 250px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  overflow-y: auto;
}

#transcriptText:focus {
  outline: none;
  border-color: #555;
}

.memo-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: #6366f1;
  color: #fff;
}

.btn-primary:hover {
  background: #5558e6;
}

.btn-primary:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

.btn-save {
  background: #22c55e;
  color: #fff;
}

.btn-save:hover {
  background: #1db954;
}

.btn-discard {
  background: #333;
  color: #aaa;
  margin-left: auto;
}

.btn-discard:hover {
  background: #444;
  color: #fff;
}

/* Translation */
.translation-section {
  margin-top: 16px;
  padding: 14px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.translation-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: #f59e0b;
  margin-bottom: 8px;
}

.translation-text {
  font-size: 14px;
  line-height: 1.7;
  color: #ccc;
  white-space: pre-wrap;
}

.translation-text.loading {
  color: #888;
  font-style: italic;
}

.btn-translate {
  background: #f59e0b;
  color: #000;
}

.btn-translate:hover {
  background: #eab308;
}

.btn-translate.active {
  background: #92400e;
  color: #fbbf24;
}

.btn-translate.active:hover {
  background: #78350f;
}

.btn-translate:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* Summary */
.summary-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
}

.summary-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 8px;
}

.summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: #ccc;
  white-space: pre-wrap;
}

.summary-text.loading {
  color: #888;
  font-style: italic;
}

/* Memo List */
.memo-list {
  margin-top: 8px;
}

.memo-list h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.memo-count {
  background: #2a2a2a;
  color: #888;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.memo-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  color: #555;
  padding: 40px 0;
  font-size: 14px;
}

/* Memo Card */
.memo-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.15s;
}

.memo-card:hover {
  border-color: #3a3a3a;
}

.memo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.memo-date {
  font-size: 12px;
  color: #666;
}

.memo-delete {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 4px;
}

.memo-delete:hover {
  color: #ef4444;
  background: #2a1515;
}

.memo-transcript {
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 8px;
  white-space: pre-wrap;
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.memo-transcript.expanded {
  max-height: none;
}

.memo-expand {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  margin-bottom: 8px;
}

.memo-summary {
  background: #111;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.memo-summary-label {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.memo-summary-text {
  font-size: 13px;
  line-height: 1.6;
  color: #aaa;
  white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 480px) {
  .app { padding: 12px; }
  header h1 { font-size: 24px; }
  .memo-actions { flex-wrap: wrap; }
  .btn-discard { margin-left: 0; }
}
