:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #0c1434;
  background: #edf5fc;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 10px 12px 24px;
  background: radial-gradient(circle at top, #f8fcff, #edf5fc 65%);
}
button {
  font: inherit;
}
.page {
  max-width: 520px;
  margin: auto;
  padding: 20px 12px 26px;
  border: 1px solid #d4e2f4;
  border-radius: 28px;
  background: #fbfdff;
  box-shadow: 0 18px 42px #385c871c;
}
.header {
  text-align: center;
  margin: 0 0 20px;
}
.header h1 {
  font-size: clamp(32px, 8vw, 42px);
  letter-spacing: -0.04em;
  margin: 0;
  font-weight: 780;
}
.recorder {
  border: 1px solid #bdd9ff;
  border-radius: 14px;
  background: #f0f8ff;
  text-align: center;
  padding: 30px 16px 20px;
}
.mic {
  width: 132px;
  height: 132px;
  border: 10px solid #d8eaff;
  border-radius: 50%;
  background: linear-gradient(145deg, #3795ff, #1872ef);
  color: white;
  box-shadow:
    0 0 0 10px #e7f2ff,
    0 10px 20px #2384ed30;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}
.mic svg {
  width: 55px;
  height: 55px;
}
.mic:focus-visible,
.rating:focus-visible {
  outline: 3px solid #0d4ccb;
  outline-offset: 3px;
}
.mic:disabled {
  opacity: 0.65;
  cursor: wait;
}
.mic.recording {
  background: linear-gradient(145deg, #ff6476, #e5274a);
  border-color: #ffd4dc;
  box-shadow:
    0 0 0 10px #ffe7ec,
    0 0 0 18px #ffd9e180;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 10px #ffe7ec,
      0 0 0 24px #ffd9e130;
  }
}
.timer {
  height: 22px;
  margin-top: 12px;
  color: #e5274a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.instruction {
  margin: 2px 0 12px;
  color: #1265cf;
  font-size: 18px;
  font-weight: 550;
}
.note {
  margin: 0 auto;
  max-width: 360px;
  color: #5c73a8;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
}
.info {
  flex: none;
  border: 2px solid #7f98cb;
  color: #6d87bc;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  text-align: center;
  line-height: 17px;
  font-weight: 750;
}
.message {
  margin: 12px 0 0;
  color: #b52e46;
  font-size: 14px;
}
.results h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  margin: 23px 2px 14px;
}
.card {
  background: white;
  border: 1px solid #d3e3fa;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 5px 20px #214d8010;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}
.number {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dcecff;
  color: #1875ea;
  font-size: 22px;
  font-weight: 700;
}
.card:nth-child(2) .number {
  background: #eadfff;
  color: #7d31ed;
}
.card:nth-child(3) .number {
  background: #d9f8e7;
  color: #16a364;
}
.model {
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.1;
  flex: 1;
}
.status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #4b68a5;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.status-mark { display: inline-block; width: 12px; height: 12px; border: 2px solid #8aa0be; border-radius: 50%; }
.status.success .status-mark { border-color: #18b46d; background: #18b46d; }
.status.success .status-mark::after { content: ''; display: block; width: 3px; height: 6px; margin: 1px 0 0 3px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.status.error { color: #c23b4f; }
.status.error .status-mark { border-color: #c23b4f; position: relative; }
.status.error .status-mark::after { content: '!'; position: absolute; inset: -4px 0 0; color: #c23b4f; font-size: 12px; font-weight: 800; line-height: 12px; text-align: center; }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid #d8e9fa;
  border-top-color: #1678ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.transcript {
  margin: 14px 0 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid #dce5f2;
  border-radius: 10px;
  background: #f7f9fc;
  color: #3f4c6b;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transcript.empty {
  color: #8696ad;
}
.transcript.error {
  color: #ad3d4d;
}
.skeleton {
  display: grid;
  gap: 8px;
}
.skeleton i {
  display: block;
  height: 11px;
  border-radius: 8px;
  background: #e2e8f0;
}
.skeleton i:nth-child(2) {
  width: 78%;
}
.skeleton i:nth-child(3) {
  width: 46%;
}
.ratings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.rating {
  min-width: 0;
  border: 1.5px solid #cbd6e6;
  border-radius: 9px;
  background: #fff;
  color: #455679;
  padding: 10px 3px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rating:disabled {
  background: #ecf0f5;
  border-color: #ecf0f5;
  color: #a8b3c7;
  cursor: not-allowed;
}
.rating.selected {
  border-color: #1776f1;
  background: #e7f1ff;
  color: #0764df;
  box-shadow: 0 1px 5px #1875ef30;
}
@media (max-width: 370px) {
  .page {
    padding: 18px 8px;
  }
  .card {
    padding: 11px;
  }
  .model {
    font-size: 15px;
  }
  .status {
    font-size: 11px;
  }
  .rating {
    font-size: 11px;
    padding: 9px 0;
  }
  }
@media (prefers-reduced-motion: reduce) {
  .mic.recording,
  .spinner {
    animation: none;
  }
}
.header h1 a { color: #1265cf; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.header h1 a:hover { color: #084fa8; }
.header h1 a:focus-visible { outline: 3px solid #8ec2ff; outline-offset: 5px; border-radius: 6px; }

.status-primary { display: flex; align-items: center; gap: 5px; }
.status-note { padding: 3px 8px; border-radius: 999px; background: #eaf3ff; color: #5a78ad; font-size: 10px; }
.status-icon { width: 24px; height: 24px; object-fit: contain; }
.rating { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.rating-icon { width: 22px; height: 22px; object-fit: contain; }
.rating.selected .rating-icon { filter: brightness(0) saturate(100%) invert(39%) sepia(98%) saturate(2337%) hue-rotate(204deg) brightness(103%) contrast(101%); }

/* Compact phone layout: preserve the recording flow while keeping results visible. */
@media (max-width: 600px) {
  body { padding: 6px 8px 18px; }
  .page { padding: 16px 10px 22px; border-radius: 20px; }
  .header { margin-bottom: 12px; }
  .header h1 { font-size: 28px; line-height: 1.1; }
  .recorder { padding: 12px 10px; border-radius: 12px; }
  .mic {
    width: 64px;
    height: 64px;
    border-width: 5px;
    box-shadow: 0 0 0 5px #e7f2ff, 0 5px 10px #2384ed30;
  }
  .mic svg { width: 29px; height: 29px; }
  .mic.recording { box-shadow: 0 0 0 5px #ffe7ec, 0 0 0 10px #ffd9e180; }
  .timer { height: 18px; margin-top: 7px; font-size: 14px; }
  .instruction { margin: 2px 0 7px; font-size: 14px; line-height: 1.25; }
  .note { max-width: 290px; gap: 6px; font-size: 12px; line-height: 1.3; }
  .info { width: 17px; height: 17px; border-width: 1.5px; line-height: 14px; }
  .results h2 { margin: 17px 2px 10px; font-size: 24px; }
  .card { padding: 11px; margin-bottom: 9px; }
  .card-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 3px;
    min-height: 0;
  }
  .number { grid-row: span 2; width: 32px; height: 32px; font-size: 18px; }
  .model { min-width: 0; font-size: 15px; line-height: 1.15; }
  .status { grid-column: 2; justify-content: flex-start; font-size: 11px; text-align: left; white-space: normal; }
  .status-note { padding: 2px 6px; font-size: 9px; }
  .transcript { min-height: 52px; margin: 9px 0; padding: 10px; font-size: 14px; }
  .ratings { gap: 5px; }
  .rating { gap: 3px; padding: 8px 2px; font-size: 12px; }
  .rating-icon { width: 17px; height: 17px; }
}
