:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #030303;
  color: #f8f8f8;
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #161616, #030303);
  padding: clamp(1.25rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.ghost-link {
  opacity: 0.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: opacity 0.2s ease;
}

.ghost-link:hover {
  opacity: 1;
}

.single-column {
  width: min(640px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  padding-bottom: 2rem;
}

.card {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.pulse-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #5c5c5c;
  animation: pulse 1.5s ease-in-out infinite;
  opacity: 0.6;
}

.pulse-dot.recording {
  background: #ff375f;
  opacity: 1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

.controls {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

button {
  font: inherit;
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  min-width: 160px;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: #f4f4f4;
  color: #050505;
}

button.ghost {
  background: rgba(255, 255, 255, 0.09);
  color: #f8f8f8;
}

.helper-text {
  margin-top: 0;
  opacity: 0.65;
  font-size: 0.9rem;
}

.helper-text.warning {
  margin-top: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 55, 95, 0.12);
  border: 1px solid rgba(255, 55, 95, 0.35);
  opacity: 1;
}

.hidden {
  display: none;
}

.results-card h2 {
  margin-top: 0;
}

.muted-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 0.35rem;
}

.transcript {
  line-height: 1.5;
  font-size: 1.1rem;
}

.summary-list {
  list-style: decimal-leading-zero;
  padding-left: 1rem;
  line-height: 1.6;
}

audio {
  width: 100%;
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sort-select {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
}

.notes-card {
  max-height: 70vh;
  overflow-y: auto;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.note-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.note-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.chip {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

details {
  margin-top: 1rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  outline: none;
}

.note-audio {
  margin-top: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

@media (max-width: 520px) {
  .controls {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  body {
    padding: 1.25rem;
  }

  .card {
    border-radius: 16px;
    padding: 1.35rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-header p {
    margin-bottom: 0;
  }
}

@media (max-width: 420px) {
  body {
    padding: 1rem;
  }

  .app-header h1 {
    font-size: 1.75rem;
  }

  .transcript {
    font-size: 1rem;
  }

  button {
    font-size: 0.95rem;
    min-height: 48px;
  }
}
