:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --ink: #19201d;
  --muted: #66716c;
  --line: #d8ddd3;
  --panel: #ffffff;
  --accent: #146c5f;
  --accent-strong: #0d5147;
  --coral: #d85b3f;
  --gold: #d99b24;
  --green-soft: #dceee6;
  --shadow: 0 20px 60px rgba(25, 32, 29, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(216, 91, 63, 0.13), transparent 26vw),
    radial-gradient(circle at 16% 20%, rgba(20, 108, 95, 0.14), transparent 34vw),
    linear-gradient(180deg, rgba(20, 108, 95, 0.08), transparent 420px),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(216, 221, 211, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  box-shadow: 0 12px 36px rgba(25, 32, 29, 0.08);
  backdrop-filter: blur(10px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(16, 23, 19, 0.15);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.main-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
}

.main-nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
}

.quota-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-area {
  display: flex;
  justify-content: flex-end;
  min-width: 260px;
}

.google-button,
.user-menu {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(25, 32, 29, 0.08);
  font-weight: 800;
}

.google-button.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.google-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #4285f4;
  font-weight: 900;
}

.user-menu img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--green-soft);
}

.user-menu span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(360px, 1.16fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 96px);
}

.intro {
  padding: 24px 0;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.summary {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.answer {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px 12px;
  color: #39423e;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-visual,
.result-visual {
  margin: 26px 0 0;
  overflow: hidden;
  border: 1px solid rgba(216, 221, 211, 0.9);
  border-radius: 8px;
  background: #eef3f1;
  box-shadow: 0 20px 50px rgba(25, 32, 29, 0.14);
}

.hero-visual img,
.result-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.detector-panel,
.result-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detector-panel {
  padding: 18px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f2;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.source-pane {
  display: none;
}

.source-pane.is-active {
  display: block;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 214px;
  border: 2px dashed #b7c3ba;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(216, 91, 63, 0.1), transparent 34%),
    #fbfcfa;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--coral);
  background-color: #fff8f3;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 900;
}

.drop-title {
  margin-top: 12px;
  font-size: 1.15rem;
  font-weight: 900;
}

.drop-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.recorder {
  display: flex;
  min-height: 214px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.record-button {
  display: inline-flex;
  min-width: 142px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--coral);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.record-button.is-recording {
  background: #9f291b;
}

.record-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.record-time {
  min-width: 56px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.file-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.file-row strong,
.file-row span {
  display: block;
  overflow-wrap: anywhere;
}

.file-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.waveform {
  width: 100%;
  height: 132px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101713;
}

.control-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.control-row label {
  color: var(--muted);
  font-weight: 800;
}

.seconds-control {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--accent);
}

output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.primary-button:disabled {
  background: #aeb8b1;
  cursor: not-allowed;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.is-error {
  color: #b83222;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.18fr) minmax(280px, 0.82fr);
  gap: 24px;
  margin-top: 32px;
}

.result-visual {
  grid-column: 1 / -1;
  margin-top: 0;
}

.result-panel,
.detail-panel {
  padding: 22px;
}

.result-kicker {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-heading h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.score-meter {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--coral));
}

.score-fill {
  width: 50%;
  height: 100%;
  border-right: 4px solid #ffffff;
  background: rgba(255, 255, 255, 0.42);
}

.score-row {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
}

.score-row strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a,
.share-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.footer-links,
.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.share-links {
  width: 100%;
  margin-top: 2px;
}

.share-label {
  color: var(--muted);
  font-weight: 800;
}

.share-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 7px 10px;
}

.share-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: currentColor;
}

.share-link:hover {
  border-color: var(--accent);
  background: #ffffff;
}

.content-section {
  padding: 48px 0 8px;
}

.content-section h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0;
}

.content-section h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.content-section p,
.content-section li {
  color: var(--muted);
  line-height: 1.7;
}

.content-grid,
.related-grid,
.faq-grid {
  display: grid;
  gap: 16px;
}

.content-grid {
  grid-template-columns: repeat(3, 1fr);
}

.related-grid {
  grid-template-columns: repeat(5, 1fr);
}

.faq-grid {
  grid-template-columns: repeat(2, 1fr);
}

.info-card,
.related-card,
.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 18px;
}

.related-card {
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.related-card strong {
  display: block;
  margin-bottom: 8px;
}

.related-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.legal-page {
  max-width: 840px;
  min-height: auto;
  margin: 0 auto;
  padding: 24px 0 60px;
}

.legal-page h1 {
  font-size: clamp(2.5rem, 8vw, 4.8rem);
}

.legal-page h2 {
  margin-top: 28px;
  font-size: 1.35rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-page a {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 20px 0 32px;
  }

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

  .main-nav {
    justify-content: flex-start;
  }

  .auth-area,
  .google-button,
  .user-menu {
    width: 100%;
  }

  .quota-chip {
    width: 100%;
    text-align: center;
  }

  .google-button,
  .user-menu {
    justify-content: center;
  }

  .tool-grid,
  .result-grid,
  .content-grid,
  .related-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    min-height: auto;
    gap: 18px;
  }

  .intro {
    padding: 8px 0 0;
  }

  h1 {
    font-size: clamp(2.7rem, 15vw, 4.6rem);
  }

  .summary {
    font-size: 1rem;
  }

  .control-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
