:root {
  color-scheme: light;
  --canvas: #eef3fb;
  --ink: #10131a;
  --ink-soft: rgba(16, 19, 26, 0.62);
  --muted: rgba(16, 19, 26, 0.48);
  --glass: rgba(255, 255, 255, 0.54);
  --glass-bright: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --stroke: rgba(255, 255, 255, 0.66);
  --hairline: rgba(27, 38, 66, 0.08);
  --red: #ff3b30;
  --red-deep: #c91d16;
  --blue: #0a84ff;
  --green: #34c759;
  --shadow: 0 30px 90px rgba(37, 47, 74, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 4%, rgba(109, 167, 255, 0.55), transparent 25rem),
    radial-gradient(circle at 92% 12%, rgba(255, 147, 172, 0.42), transparent 25rem),
    radial-gradient(circle at 55% 86%, rgba(135, 228, 197, 0.35), transparent 24rem),
    linear-gradient(150deg, #fbfcff 0%, var(--canvas) 46%, #e2ebf7 100%);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Avenir Next, Trebuchet MS, "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 74%);
}

body::after {
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.75) 1px, transparent 1px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}

button {
  border: 0;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-a {
  top: 12vh;
  right: -92px;
  width: 230px;
  height: 230px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(10, 132, 255, 0.2));
}

.ambient-b {
  bottom: 9vh;
  left: -72px;
  width: 190px;
  height: 190px;
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.22), rgba(255, 255, 255, 0.8));
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 148px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(142deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.42) 42%, rgba(255, 255, 255, 0.62)),
    var(--glass);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(30px) saturate(1.7);
  -webkit-backdrop-filter: blur(30px) saturate(1.7);
}

.glass-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(116deg, rgba(255, 255, 255, 0.7), transparent 24%, rgba(255, 255, 255, 0.34) 52%, transparent 70%);
  opacity: 0.55;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 176px;
  overflow: visible;
  padding: 26px 22px;
  border-radius: 38px;
}

.hero-copy,
.top-actions,
.status-row,
.section-heading,
.recording-main,
.delete-button,
.empty-state > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 430px;
  font-size: clamp(2.35rem, 9vw, 4rem);
  line-height: 0.94;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 800;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(52, 199, 89, 0.9);
}

.top-actions {
  position: relative;
  display: flex;
  gap: 10px;
  padding-top: 3px;
}

.icon-button,
.ghost-button,
.delete-button {
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 12px 30px rgba(39, 53, 86, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.icon-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 18px;
  opacity: 0.72;
}

.icon-button.is-busy {
  opacity: 1;
  animation: pulse-busy 880ms ease-in-out infinite alternate;
}

.more-menu {
  position: absolute;
  top: 60px;
  right: 0;
  z-index: 4;
  min-width: 176px;
  padding: 8px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.more-menu.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.more-menu button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
  font-size: 0.9rem;
  font-weight: 850;
  text-align: left;
}

.more-menu button:active {
  transform: scale(0.98);
}

.app-version-label {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 5px;
  padding: 9px 13px 6px;
  border-top: 1px solid rgba(16, 19, 26, 0.06);
  color: rgba(16, 19, 26, 0.62);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.icon-button svg,
.delete-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

.recorder-surface {
  display: grid;
  gap: 22px;
  margin: 18px 0 28px;
  padding: 21px;
  border-radius: 34px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-label {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.status-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#timer {
  min-width: 104px;
  text-align: right;
  font-size: 2.55rem;
  line-height: 1;
  letter-spacing: -0.07em;
}

.level-meter {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 48px;
  gap: 5px;
  padding: 0 2px;
}

.level-meter span {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(16, 19, 26, 0.14)),
    rgba(16, 19, 26, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform-origin: center;
  transition: height 90ms linear, opacity 90ms linear, background 180ms ease;
}

.is-recording .level-meter span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 59, 48, 0.96)),
    var(--red);
  box-shadow: 0 6px 18px rgba(255, 59, 48, 0.24);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 5px 14px;
}

h2 {
  margin-top: 4px;
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 850;
}

.ghost-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.search-summary {
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 9px;
  padding: 24px;
  border-radius: 30px;
}

.empty-state.is-hidden {
  display: none;
}

.empty-state p {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.empty-state span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 680;
  line-height: 1.55;
}

.recordings-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recording-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 17px;
  border-radius: 30px;
  animation: card-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.recording-card h3 {
  overflow: hidden;
  font-size: 1.38rem;
  line-height: 1.08;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.06em;
}

.recording-meta,
.recording-upload,
.recording-asr,
.recording-transcript {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.recording-upload,
.recording-asr {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.recording-upload.is-hidden {
  display: none;
}

.recording-upload.is-success,
.recording-asr.is-success {
  color: rgba(15, 122, 62, 0.84);
}

.recording-upload.is-error,
.recording-asr.is-error {
  color: rgba(201, 29, 22, 0.86);
  cursor: pointer;
}

.recording-upload a {
  color: inherit;
  text-decoration: none;
}

.recording-transcript {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  cursor: pointer;
}

.recording-transcript:hover {
  color: var(--ink);
}

audio {
  width: 100%;
  height: 38px;
  margin-top: 12px;
  accent-color: var(--red);
}

.delete-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 18px;
  color: rgba(16, 19, 26, 0.58);
}

.recorder-dock {
  position: fixed;
  right: 0;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  padding: max(58px, env(safe-area-inset-top)) 16px 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.transcript-overlay {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.transcript-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.transcript-scrim {
  position: absolute;
  inset: 0;
  background: rgba(223, 231, 243, 0.48);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
}

.transcript-panel {
  width: min(100%, 680px);
  max-height: min(78vh, 760px);
  padding: 18px;
  border-radius: 34px;
  transform: translateY(12px) scale(0.98);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.transcript-overlay.is-open .transcript-panel {
  transform: translateY(0) scale(1);
}

.transcript-head,
.transcript-full-text {
  position: relative;
  z-index: 1;
}

.transcript-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 3px 14px;
}

.transcript-head h2 {
  margin-top: 5px;
  font-size: 1.55rem;
}

.transcript-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.transcript-full-text {
  max-height: calc(min(78vh, 760px) - 112px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.68;
  white-space: pre-wrap;
}

.search-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.search-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.78), transparent 32rem),
    rgba(223, 231, 243, 0.42);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.search-panel {
  width: min(100%, 680px);
  padding: 18px;
  border-radius: 34px;
  transform: translateY(-16px) scale(0.98);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-overlay.is-open .search-panel {
  transform: translateY(0) scale(1);
}

.search-head,
.search-input-shell,
.search-controls,
.search-panel-status,
.search-results {
  position: relative;
  z-index: 1;
}

.search-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 3px 15px;
}

.search-head h2 {
  margin-top: 5px;
  font-size: 1.55rem;
}

.search-close-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.search-close-button span,
.search-close-button span::after {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: rgba(16, 19, 26, 0.68);
  content: "";
}

.search-close-button span {
  transform: rotate(45deg);
}

.search-close-button span::after {
  transform: rotate(90deg);
}

.search-input-shell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 42px rgba(37, 47, 74, 0.1);
}

.search-input-shell svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: rgba(16, 19, 26, 0.58);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.search-input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 850;
}

.search-input-shell input::placeholder {
  color: rgba(16, 19, 26, 0.38);
}

.search-submit-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.34)),
    rgba(10, 132, 255, 0.16);
  box-shadow:
    0 10px 24px rgba(37, 47, 74, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, background 160ms ease;
}

.search-submit-button:active {
  transform: scale(0.95);
}

.search-submit-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.search-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  margin-top: 13px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.smart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.smart-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.smart-track {
  display: grid;
  width: 44px;
  height: 26px;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(16, 19, 26, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: background 180ms ease;
}

.smart-track span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 14px rgba(39, 53, 86, 0.16);
  transition: transform 180ms ease;
}

.smart-toggle input:checked + .smart-track {
  background: rgba(10, 132, 255, 0.72);
}

.smart-toggle input:checked + .smart-track span {
  transform: translateX(18px);
}

.search-panel-status {
  margin-top: 14px;
  padding: 0 3px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.45;
}

.search-results {
  display: grid;
  max-height: min(42vh, 360px);
  gap: 9px;
  margin: 15px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.search-result-item button,
.search-result-empty {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.search-result-item button {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  color: inherit;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease;
}

.search-result-item button:active {
  transform: scale(0.99);
}

.search-result-item button:hover {
  background: rgba(255, 255, 255, 0.52);
}

.search-result-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 930;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result-meta {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.search-result-empty {
  padding: 15px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 780;
  text-align: center;
}

.record-button {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 999px;
  pointer-events: auto;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.88), transparent 17%),
    linear-gradient(145deg, #ff7a70 0%, var(--red) 58%, var(--red-deep) 100%);
  box-shadow:
    0 22px 52px rgba(255, 59, 48, 0.42),
    inset 0 2px 3px rgba(255, 255, 255, 0.72),
    inset 0 -14px 28px rgba(112, 4, 1, 0.22);
  transition: transform 180ms ease, border-radius 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.record-button:active {
  transform: scale(0.95);
}

.record-core {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: border-radius 180ms ease, transform 180ms ease, background 180ms ease;
}

.is-recording .record-button {
  border-radius: 28px;
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.2), transparent 18%),
    linear-gradient(145deg, #1b202a, #050608);
  box-shadow:
    0 22px 55px rgba(16, 19, 26, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.22);
}

.is-recording .record-core {
  border-radius: 9px;
  transform: scale(0.86);
  background: var(--red);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse-busy {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(0.94);
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 28px;
  }
}

@media (max-width: 420px) {
  .hero {
    min-height: 164px;
    padding: 23px 19px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
    border-radius: 17px;
  }

  #timer {
    min-width: 88px;
    font-size: 2.15rem;
  }

  .status-hint {
    max-width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
