.m-header {
  display: none;
}

.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 10px 28px rgba(11, 138, 127, 0.4);
  transition: transform 0.12s, background 0.15s;
}

.fab:active {
  transform: scale(0.94);
}

.fab svg {
  width: 30px;
  height: 30px;
}

.fab[data-state='recording'] {
  background: #e5484d;
  box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.5);
  animation: ring 1.4s ease-out infinite;
}

.fab[data-state='processing'],
.fab[data-state='starting'] {
  animation: pulse 0.9s ease-in-out infinite;
}

@keyframes ring {
  to {
    box-shadow: 0 0 0 22px rgba(229, 72, 77, 0);
  }
}

.rec-pill {
  position: fixed;
  right: 28px;
  bottom: 108px;
  z-index: 30;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}

.rec-pill.show {
  opacity: 1;
  transform: none;
}

.modal-root.as-sheet {
  align-items: end;
  justify-items: stretch;
}

.sheet {
  width: min(640px, 100%);
  justify-self: center;
  max-height: 75vh;
  overflow: auto;
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -10px 40px rgba(30, 40, 60, 0.25);
  animation: rise 0.2s ease-out;
}

.sheet-grip {
  width: 42px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #d9dce1;
}

.sheet h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.sheet-text {
  margin: 10px 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f5f6f7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15.5px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sheet-actions .btn {
  flex: 1 1 120px;
  height: 46px;
}

@media (prefers-reduced-motion: reduce) {
  .fab,
  .rec-pill,
  .sheet {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
    font-size: 15px;
  }

  .app {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .main {
    overflow: visible;
  }

  .drag,
  .brand,
  .status {
    display: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    flex-direction: row;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(251, 251, 252, 0.96);
  }

  .nav {
    flex-direction: row;
    width: 100%;
    gap: 0;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 11px;
    text-align: center;
    background: transparent !important;
  }

  .nav-item svg {
    width: 52px;
    height: 30px;
    padding: 5px 15px;
    border-radius: 999px;
  }

  .nav-item[aria-current='page'] svg {
    background: var(--accent-soft);
  }

  .m-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(16px + env(safe-area-inset-top)) 18px 4px;
  }

  .m-header .logo {
    width: 34px;
    height: 34px;
  }

  .m-header .name {
    font-weight: 800;
    font-size: 19px;
  }

  .page {
    padding: 10px 16px 190px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .wave {
    width: 100%;
    height: 54px;
  }

  .grid-4,
  .grid-eq {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .card {
    padding: 18px;
  }

  .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
  }

  .stat-value {
    font-size: 22px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    flex: none;
  }

  .segmented {
    display: flex;
  }

  .segmented button {
    flex: 1;
  }

  .select {
    width: 100%;
  }

  .setting {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .setting .control {
    justify-content: flex-start;
  }

  .setting .input {
    width: 100%;
  }

  .form-row {
    flex-wrap: wrap;
  }

  .form-row .input {
    flex-basis: 100%;
  }

  .form-row .btn {
    flex: 1;
  }

  .badge-row {
    grid-template-columns: 1fr;
  }

  .row-entry {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .entry {
    padding: 16px;
  }

  .entry header {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .entry .meta {
    order: 1;
    flex-basis: 100%;
  }

  .table th {
    font-size: 11px;
    padding: 0 6px 8px;
  }

  .table td {
    padding: 8px 6px;
  }

  .table .arrow {
    width: 26px;
  }

  .table .end {
    width: 52px;
  }

  .fab {
    left: 50%;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
  }

  .fab:active {
    transform: translateX(-50%) scale(0.94);
  }

  .rec-pill {
    left: 50%;
    right: auto;
    bottom: calc(162px + env(safe-area-inset-bottom));
    transform: translate(-50%, 6px);
    white-space: nowrap;
  }

  .rec-pill.show {
    transform: translate(-50%, 0);
  }

  .toasts {
    bottom: calc(170px + env(safe-area-inset-bottom));
  }
}
