:root {
  --accent: #5b8def;
  --accent-dim: #3d5a8c;
  --surface: #0f1218;
  --card: #1c2230;
  --border: #2a3448;
  --text: #e8eaef;
  --muted: #8b939e;
  --record-idle: #2a3142;
  --record-active: #c94c4c;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.rail {
  width: 300px;
  flex-shrink: 0;
  padding: 1.75rem 1.5rem;
  background: var(--card);
  border-right: 1px solid var(--border);
}

.brand {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.record-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem auto 0;
  padding: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  border-radius: 1rem;
  transition: background 0.15s ease;
}

.record-btn:hover {
  background: rgba(91, 141, 239, 0.08);
}

.record-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.record-btn__circle {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: var(--record-idle);
  border: 2px solid var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.record-btn__icon {
  width: 2.25rem;
  height: 2.25rem;
  opacity: 0.9;
}

.record-btn.is-recording .record-btn__circle {
  background: var(--record-active);
  border-color: var(--accent);
}

.record-btn.is-recording .record-btn__icon {
  color: #fff;
}

.record-btn__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.status {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.status.is-busy {
  color: var(--accent);
}

.status.is-recording {
  color: var(--record-active);
}

.playback {
  margin-top: 1rem;
  width: 100%;
}

.btn-play {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--accent-dim);
  background: rgba(91, 141, 239, 0.12);
  color: var(--accent);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn-play:hover:not(:disabled) {
  background: rgba(91, 141, 239, 0.2);
  border-color: var(--accent);
}

.btn-play:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.playback audio {
  display: none;
}

.hint {
  margin: 1.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #5c6570;
}

.main {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 52rem;
}

.card--results {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
}

.sentence h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.sentence__line {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.sentence__meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.manual-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #12161f;
}

.manual-panel__label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.manual-panel__textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  resize: vertical;
  min-height: 4.5rem;
}

.manual-panel__textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.manual-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.markdown-body p {
  margin: 0 0 0.75rem;
}

.results-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.results-summary pre {
  background: #12161f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow: auto;
  font-size: 0.78rem;
  max-height: 20rem;
}

.results-summary .err {
  color: var(--record-active);
}

.muted-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.verdict-panel {
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.verdict-panel--hire {
  border-color: #2d6a4f;
  background: rgba(45, 106, 79, 0.2);
}

.verdict-panel--borderline {
  border-color: #b08900;
  background: rgba(176, 137, 0, 0.12);
}

.verdict-panel--reject {
  border-color: #9b2c2c;
  background: rgba(155, 44, 44, 0.15);
}

.verdict-panel__rating {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.verdict-panel__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.verdict-panel__roles {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.overall-score {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.overall-score span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.35rem;
}

.score-grid {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.75rem;
  background: #12161f;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: start;
}

@media (min-width: 540px) {
  .score-row {
    grid-template-columns: 11rem 5rem 1fr;
  }
}

.score-row__label {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.score-row__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

.score-row__status {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  grid-column: 1 / -1;
}

@media (min-width: 540px) {
  .score-row__status {
    grid-column: auto;
    text-align: right;
  }
}

.score-row__reason {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.report-block {
  margin-bottom: 1.15rem;
}

.report-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.report-block p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.report-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.report-list li {
  margin-bottom: 0.35rem;
}

.accent-box {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #12161f;
  font-size: 0.86rem;
  line-height: 1.45;
}

.accent-box strong {
  color: var(--text);
}

.raw-details {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.raw-details__summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.raw-details__summary::-webkit-details-marker {
  display: none;
}

.raw-details__summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.raw-details[open] .raw-details__summary::before {
  transform: rotate(90deg);
}

.raw-details .raw-json {
  margin-top: 0.65rem;
}

.accent-picker {
  margin: 1.25rem 0 0;
  padding: 0;
  border: none;
}

.accent-picker__legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, inherit);
  margin-bottom: 0.5rem;
  padding: 0;
}

.accent-picker__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.accent-picker__label {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--muted, inherit);
}

.accent-picker__label input {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(91, 141, 239, 0.1);
}

.raw-json {
  width: 100%;
  margin-top: 0.35rem;
  flex: 1;
  min-height: 10rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #12161f;
  color: var(--text);
  resize: vertical;
}



.word-report {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.word-report__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.word-report__legend {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.word-report__note {
  margin-top: 0.5rem;
}

.muted-inline {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.word-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.word-pill {
  min-width: 5.5rem;
  max-width: 14rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #12161f;
}

.word-pill--green {
  border-color: #2d6a4f;
  background: rgba(45, 106, 79, 0.2);
}

.word-pill--yellow {
  border-color: #b08900;
  background: rgba(176, 137, 0, 0.12);
}

.word-pill--red {
  border-color: #9b2c2c;
  background: rgba(155, 44, 44, 0.15);
}

.word-pill--tiny {
  display: inline-block;
  min-width: auto;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  max-width: none;
}

.word-pill__text {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.word-pill__score {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.word-pill__issues {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.word-pill__feedback {
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text);
}

.word-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.word-summary-card {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #12161f;
  font-size: 0.8rem;
}

.word-summary-card strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 0.15rem;
}

.word-summary-card__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.word-summary-card--green {
  border-color: #2d6a4f;
}

.word-summary-card--yellow {
  border-color: #b08900;
}

.word-summary-card--red {
  border-color: #9b2c2c;
}

.word-final {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.45;
}

.word-final strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.word-final--good {
  border-color: #2d6a4f;
  background: rgba(45, 106, 79, 0.15);
}

.word-final--avg {
  border-color: var(--accent-dim);
  background: rgba(91, 141, 239, 0.08);
}

.word-final--poor {
  border-color: #9b2c2c;
  background: rgba(155, 44, 44, 0.12);
}

.word-final p {
  margin: 0;
}

@media (max-width: 720px) {
  .layout {
    flex-direction: column;
  }

  .rail {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
