:root {
  /* Record button scales with the viewport but is capped so the recorder
     bar never exceeds ~25% of the screen height on mobile. */
  --record-size: min(150px, 17vh);
}

body {
  background-color: #f5f6f8;
  -webkit-tap-highlight-color: transparent;
}

/* Dark theme surfaces for our custom (non-Bootstrap) elements. */
[data-bs-theme="dark"] body {
  background-color: #15181b;
}

[data-bs-theme="dark"] .recorder-bar {
  background: #1d2125;
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* ----------------------------------------------------------------- shell */
/* Full-height app layout: navbar + recorder stay put, only the list scrolls,
   so the record button is always visible. dvh handles mobile browser chrome. */
.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-shell .navbar {
  flex: 0 0 auto;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.recorder-bar {
  flex: 0 0 auto;
  max-height: 25vh;
  max-height: 25dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  /* Pinned to the bottom of the shell: separator sits on top. */
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.scroll-area {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Tight side margins on mobile to use the available width. */
  padding: 0.5rem;
  padding-bottom: 2rem;
}

/* Roomier gutters on larger screens, content centred. */
@media (min-width: 768px) {
  .scroll-area {
    padding: 1.25rem;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ---------------------------------------------------------- record button */
.record-btn {
  width: var(--record-size);
  height: var(--record-size);
  border-radius: 50%;
  border: none;
  background: var(--bs-primary);
  color: #fff;
  font-size: calc(var(--record-size) * 0.42);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
  transition: transform 0.08s ease, background-color 0.2s ease;
  touch-action: none; /* prevent scroll / long-press menu while holding */
  user-select: none;
  flex: 0 0 auto;
}

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

.record-btn.recording {
  background: var(--bs-danger);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.55);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.record-hint {
  font-size: 0.75rem;
  line-height: 1.15;
}

/* On short screens drop the hint so the button stays within budget. */
@media (max-height: 560px) {
  .record-hint {
    display: none;
  }
}

/* -------------------------------------------------------------- clip list */
.clip-item {
  padding: 0.6rem;
}

.clip-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.clip-text.placeholder {
  color: var(--bs-secondary);
  font-style: italic;
}

/* Touch-friendly action buttons, all on one row. */
.clip-actions .btn {
  min-height: 44px;
  white-space: nowrap;
  font-size: 0.8rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.clip-actions .btn i {
  margin-right: 0.1rem;
}

/* Play is the prominent control: it grows to fill the row and holds the
   pause+stop controls when active. The e-mail buttons stay compact (sized to
   their labels) and delete is a fixed icon button. */
.play-slot {
  flex: 1 1 auto;
}

.send-slot {
  flex: 0 0 auto;
}

.delete-slot {
  flex: 0 0 2.5rem;
}

.play-slot.playing .act-play {
  display: none;
}

.play-slot.playing .active-controls {
  display: flex !important;
}

/* ------------------------------------------------------------------ toast */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: rgba(33, 37, 41, 0.95);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  max-width: 90vw;
  z-index: 1080;
}

.toast-box.show {
  opacity: 1;
}
