:root {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;

  color: #172033;
  background: #f5f7fb;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f5f7fb;
}

body {
  min-height: 100vh;
  margin: 0;

  background:
    radial-gradient(
      circle at top right,
      rgba(78, 104, 255, 0.11),
      transparent 34rem
    ),
    #f5f7fb;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(100% - 32px, 780px);
  margin: 0 auto;

  padding:
    max(28px, env(safe-area-inset-top))
    0
    max(48px, env(safe-area-inset-bottom));
}

.hero {
  padding: 22px 4px 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.brand-mark {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  padding: 4px 8px;

  border-radius: 999px;

  background: #e8edff;
  color: #425ad8;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.hero h1 {
  max-width: 660px;
  margin: 0;

  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 620px;
  margin: 18px 0 0;

  color: #5c667a;

  font-size: 16px;
  line-height: 1.8;
}

.card {
  border: 1px solid rgba(32, 48, 82, 0.08);
  border-radius: 24px;

  background: rgba(255, 255, 255, 0.94);

  box-shadow:
    0 16px 50px rgba(26, 42, 77, 0.07);
}

.recorder-card {
  padding: 26px;
}

.section-heading,
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 18px;
}

.section-heading h2,
.results-header h2 {
  margin: 4px 0 0;

  font-size: 25px;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;

  color: #68748c;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.status-badge {
  flex: 0 0 auto;

  padding: 8px 12px;

  border-radius: 999px;

  background: #edf6ef;
  color: #26733c;

  font-size: 12px;
  font-weight: 700;
}

.status-badge.recording {
  background: #fff0f0;
  color: #bd3030;
}

.status-badge.processing {
  background: #eef1ff;
  color: #4058c8;
}

.prompt-box {
  margin-top: 24px;
  padding: 20px;

  border-radius: 18px;

  background: #f6f8fc;
}

.prompt-label {
  display: block;

  margin-bottom: 8px;

  color: #69758a;

  font-size: 11px;
  font-weight: 700;
}

.prompt-box p {
  margin: 0;

  font-size: 18px;
  line-height: 1.7;
}

.meter {
  margin: 24px 0;
}

.meter-track {
  overflow: hidden;

  height: 10px;

  border-radius: 999px;

  background: #e7ebf3;
}

.meter-bar {
  width: 0%;
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #5067ed,
      #7d70f6
    );

  transition: width 80ms linear;
}

.meter-meta {
  display: flex;
  justify-content: space-between;

  margin-top: 8px;

  color: #748096;

  font-size: 12px;
}

.primary-button {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-height: 62px;

  gap: 12px;

  border: 0;
  border-radius: 18px;

  background: #18213a;
  color: #ffffff;

  font-size: 17px;
  font-weight: 800;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.primary-button.recording {
  background: #a92c2c;
}

.record-dot {
  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: #ff5959;
}

.primary-button.recording .record-dot {
  background: #ffffff;

  animation:
    pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.38;
  }
}

.secondary-action {
  display: flex;
  justify-content: center;

  margin-top: 16px;
}

.file-button,
.text-button {
  border: 0;

  background: transparent;
  color: #5365ca;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
}

.file-button {
  padding: 8px 10px;
}

#wavInput {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);

  white-space: nowrap;
}

.message {
  margin: 18px 0 0;

  color: #68748a;

  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.message.error {
  color: #a73333;
}

.analyzing-card {
  display: flex;
  align-items: center;

  gap: 20px;

  margin-top: 20px;
  padding: 24px 26px;
}

.analyzing-card h2 {
  margin: 0 0 5px;

  font-size: 18px;
}

.analyzing-card p {
  margin: 0;

  color: #6d788d;

  font-size: 14px;
}

.spinner {
  flex: 0 0 auto;

  width: 34px;
  height: 34px;

  border: 4px solid #e5e9f5;
  border-top-color: #5368e8;
  border-radius: 50%;

  animation:
    spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results {
  margin-top: 34px;
}

.results-header {
  align-items: center;

  margin-bottom: 18px;
}

.current-card {
  padding: 24px;
}

.result-label {
  margin: 0;

  color: #657188;

  font-size: 13px;
  font-weight: 700;
}

.current-value-row {
  display: flex;
  align-items: baseline;

  gap: 8px;

  margin-top: 8px;
}

.big-value {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.unit {
  color: #737f94;

  font-size: 13px;
}

.result-note {
  margin: 8px 0 0;

  color: #768197;

  font-size: 12px;
  line-height: 1.6;
}

.horizon-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 14px;

  margin-top: 14px;
}

.horizon-card {
  padding: 20px;
}

.horizon-time {
  color: #68748a;

  font-size: 13px;
  font-weight: 700;
}

.horizon-status {
  min-height: 48px;

  margin-top: 13px;

  color: #29354d;

  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.z-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;

  gap: 10px;

  margin-top: 20px;
  padding-top: 13px;

  border-top: 1px solid #e8ebf2;

  color: #758096;

  font-size: 11px;
}

.z-row strong {
  color: #303c52;

  font-size: 16px;
}

.notice {
  margin-top: 18px;
  padding: 18px 20px;

  border: 1px solid #e1e6f2;
  border-radius: 18px;

  background: #f8f9fc;
  color: #5e697e;
}

.notice strong {
  color: #323d52;

  font-size: 13px;
}

.notice p {
  margin: 6px 0 0;

  font-size: 12px;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.primary-button:focus-visible,
.file-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(83, 101, 202, 0.3);
  outline-offset: 3px;
}

@media (max-width: 620px) {

  .shell {
    width: min(100% - 24px, 780px);
  }

  .hero {
    padding-top: 18px;
  }

  .recorder-card {
    padding: 20px;
  }

  .horizon-grid {
    grid-template-columns: 1fr;
  }

  .horizon-status {
    min-height: 0;
  }

  .primary-button {
    min-height: 58px;
  }

}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}
