:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --blue: #3b82f6;
  --blue-deep: #1d4ed8;
  --green: #22c55e;
  --red: #ff4d4f;
  --card: #ffffff;
  --light: #f4f7fb;
  --dock: 7.6rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #dfe7f2;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button:focus-visible,
.mic-launch:focus-visible .mic-orb {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--light);
  position: relative;
}

main,
#view-home,
#view-prepare,
#session-live-panel:not([hidden]),
#session-done-panel:not([hidden]) {
  min-height: 100dvh;
}

#view-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-height: 100dvh;
  text-align: center;
  color: #fff;
  padding: max(0.85rem, env(safe-area-inset-top)) 1.5rem max(1.15rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 42%, rgba(59, 130, 246, 0.28), transparent 28%),
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 80% 62%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 12% 46%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 38%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.5px),
    radial-gradient(circle at 46% 14%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 64% 78%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.5px),
    radial-gradient(circle at 50% 88%, rgba(37, 99, 235, 0.35), transparent 42%),
    linear-gradient(180deg, #070b14 0%, #10182c 55%, #0b1222 100%);
}

.home-center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2dvh, 22px);
  width: min(100%, 22rem);
  min-height: 0;
}

.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 0;
}

.home-mark {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
}

#app-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.intro-line {
  max-width: 16rem;
  margin-top: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: clamp(1.05rem, 2.6dvh, 1.25rem);
  line-height: 1.55;
}

.mic-launch {
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.mic-orb {
  display: grid;
  place-items: center;
  width: min(46vw, 22dvh, 12.5rem);
  height: min(46vw, 22dvh, 12.5rem);
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 50% 42%, #7dd3fc 0%, #3b82f6 46%, #1d4ed8 100%);
  box-shadow:
    0 0 0 14px rgba(59, 130, 246, 0.16),
    0 0 48px rgba(59, 130, 246, 0.55);
}

.mic-label {
  font-size: 1.05rem;
  font-weight: 650;
}

.home-foot {
  margin-top: 2.6rem;
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.84rem;
  line-height: 1.45;
}

.hint {
  max-width: 18rem;
  margin-top: 1rem;
  color: #fecaca;
  font-size: 0.95rem;
}

.hint.is-success {
  color: #bbf7d0;
}

.history-link,
.history-back,
.history-open {
  font: inherit;
}

.history-link {
  align-self: center;
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: max(18px, env(safe-area-inset-bottom));
  min-height: 2.75rem;
  padding: 0.45rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7ff;
  font-size: 0.98rem;
  text-decoration: none;
}

.history-screen,
.transcript-editor-panel,
.editor-replace,
.editor-actions,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #fff;
}

.history-open {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.history-name {
  font-weight: 650;
}

.history-date {
  color: #64748b;
  font-size: 0.9rem;
}

.history-screen {
  min-height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1.5rem;
  background: #f8fbff;
  color: #172033;
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li,
.editor-replace,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.editor-sentence,
#editor-full,
.editor-replace input,
#save-conversation-name {
  width: 100%;
  font: inherit;
  line-height: 1.45;
}

.done-note,
.report-tools-bar {
  margin: 0.4rem 0 0.8rem;
}

#view-prepare {
  display: flex;
  flex-direction: column;
  background: var(--light);
}

#session-live-panel:not([hidden]) {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(191, 219, 254, 0.55), transparent 58%),
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

#session-live-panel.has-comment {
  background:
    radial-gradient(ellipse at 50% 28%, rgba(191, 219, 254, 0.45), transparent 52%),
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

.listen-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  padding: max(0.85rem, env(safe-area-inset-top)) 1.1rem max(0.75rem, env(safe-area-inset-bottom));
  text-align: center;
}

#recording-status[data-state="recording"],
#recording-status[data-state="stopping"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(11rem, 46%) auto minmax(4.6rem, 1fr);
  row-gap: clamp(12px, 1.6dvh, 18px);
  align-content: stretch;
  align-items: stretch;
  justify-items: center;
  height: 100%;
  padding: max(0.55rem, env(safe-area-inset-top)) 0 max(0.7rem, env(safe-area-inset-bottom));
}

#recording-status[data-state="recording"] .listen-request,
#recording-status[data-state="stopping"] .listen-request {
  display: none;
}

.listen-request {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.listen-wave,
.comment-frame,
.listen-foot {
  display: none;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

#recording-status[data-state="recording"] .listen-wave,
#recording-status[data-state="stopping"] .listen-wave {
  display: grid;
  align-items: end;
  justify-items: center;
  width: 100%;
  height: 100%;
}

.listen-foot {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 92%;
  margin-inline: auto;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#recording-status[data-state="recording"] .listen-foot,
#recording-status[data-state="stopping"] .listen-foot,
#recording-status[data-state="error"] .listen-foot {
  display: flex;
  align-self: end;
  height: auto;
  min-height: 4.6rem;
  box-sizing: border-box;
}

.brand {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

#recording-status[data-state="recording"] .brand,
#recording-status[data-state="stopping"] .brand,
#recording-status[data-state="recording"] .listen-status,
#recording-status[data-state="stopping"] .listen-status {
  display: none;
}

#session-live-panel.has-comment .listen-core {
  justify-content: flex-start;
  padding-top: 0.15rem;
}

#session-live-panel.has-comment .companion-line {
  display: none;
}

.listen-status-block {
  display: none;
  margin-top: 0.85rem;
}

#recording-status[data-state="recording"] .listen-status-block,
#recording-status[data-state="stopping"] .listen-status-block,
#recording-status[data-state="error"] .listen-status-block,
#recording-status[data-state="idle"] .listen-status-block {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.listen-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#recording-status[data-state="recording"] .listen-status::before,
#recording-status[data-state="stopping"] .listen-status::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.recording-timer {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.35rem, 4.2vw, 1.75rem);
  font-weight: 680;
  letter-spacing: -0.03em;
}

.listen-core {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1.15rem;
}

.permit-orb {
  display: none;
  place-items: center;
  width: 7.5rem;
  height: 7.5rem;
  margin-top: 2.2rem;
  border-radius: 50%;
  color: var(--blue-deep);
  background: #fff;
  box-shadow:
    0 0 0 12px rgba(59, 130, 246, 0.08),
    0 12px 30px rgba(37, 99, 235, 0.12);
}

#recording-status[data-state="requesting"] .permit-orb {
  display: grid;
  margin-top: auto;
}

#recording-status[data-state="requesting"] #recording-detail {
  margin-bottom: auto;
}

#recording-status[data-state="recording"] .listen-core,
#recording-status[data-state="stopping"] .listen-core {
  display: flex;
}

#recording-status[data-state="requesting"] .listen-status-block {
  display: grid;
  margin-top: 1.35rem;
}

#recording-status[data-state="requesting"] #recording-label {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-transform: none;
}

#recording-status[data-state="requesting"] #recording-label::before {
  display: none;
}

#recording-detail {
  display: none;
  margin-top: 0.45rem;
}

#recording-status[data-state="requesting"] #recording-detail,
#recording-status[data-state="error"] #recording-detail,
#recording-status[data-state="idle"] #recording-detail {
  display: block;
}

.listen-note {
  max-width: 16rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.listen-note:empty {
  display: none;
}

.field-error {
  color: #b91c1c;
}

.level-meter {
  width: min(72vw, 36dvh);
  height: min(72vw, 36dvh);
  max-width: 96%;
  max-height: 96%;
  color: #2563eb;
  overflow: visible;
  --wave-energy: 0;
}

.wave-ring,
.wave-glow,
.wave-core {
  transform-origin: 140px 140px;
  transform-box: view-box;
}

.wave-ring {
  fill: none;
  stroke-linecap: round;
  animation: wave-breathe 4.2s ease-in-out infinite;
}

.wave-ring-outer {
  stroke: rgba(147, 197, 253, 0.72);
  stroke-width: 22;
  filter: blur(1.6px);
  animation-duration: 4.8s;
}

.wave-ring-mid {
  stroke: rgba(96, 165, 250, 0.5);
  stroke-width: 16;
  filter: blur(1.1px);
  animation-duration: 3.7s;
  animation-delay: -1.3s;
}

.wave-ring-inner {
  stroke: rgba(37, 99, 235, 0.38);
  stroke-width: 12;
  filter: blur(0.6px);
  animation-duration: 3.1s;
  animation-delay: -0.6s;
}

.level-meter[data-energy="live"] .wave-ring {
  animation: none;
}

.level-meter[data-energy="live"] .wave-ring-outer {
  stroke: rgba(96, 165, 250, calc(0.28 + var(--wave-energy) * 0.45));
  transform: scale(calc(0.98 + var(--wave-energy) * 0.1));
}

.level-meter[data-energy="live"] .wave-ring-mid {
  stroke: rgba(59, 130, 246, calc(0.32 + var(--wave-energy) * 0.4));
  transform: scale(calc(0.99 + var(--wave-energy) * 0.07));
}

.level-meter[data-energy="live"] .wave-ring-inner {
  stroke: rgba(37, 99, 235, calc(0.3 + var(--wave-energy) * 0.45));
  transform: scale(calc(1 + var(--wave-energy) * 0.045));
}

.wave-glow {
  fill: rgba(191, 219, 254, 0.55);
  filter: blur(1.4px);
  animation: wave-breathe 3.4s ease-in-out infinite;
}

.level-meter[data-energy="live"] .wave-glow {
  animation: none;
  fill: rgba(147, 197, 253, calc(0.28 + var(--wave-energy) * 0.4));
  transform: scale(calc(1 + var(--wave-energy) * 0.16));
}

.wave-core {
  fill: #bfdbfe;
}

.wave-bar {
  fill: rgba(37, 99, 235, 0.78);
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.42);
}

.level-meter[data-energy="live"] .wave-bar:nth-child(6) { transform: scaleY(calc(0.4 + var(--wave-energy) * 0.7)); }
.level-meter[data-energy="live"] .wave-bar:nth-child(7) { transform: scaleY(calc(0.55 + var(--wave-energy) * 0.9)); }
.level-meter[data-energy="live"] .wave-bar:nth-child(8) { transform: scaleY(calc(0.7 + var(--wave-energy) * 1.1)); }
.level-meter[data-energy="live"] .wave-bar:nth-child(9) { transform: scaleY(calc(0.55 + var(--wave-energy) * 0.9)); }
.level-meter[data-energy="live"] .wave-bar:nth-child(10) { transform: scaleY(calc(0.4 + var(--wave-energy) * 0.7)); }

.level-meter[data-energy="live"] .wave-core {
  fill: #60a5fa;
  transform: scale(calc(1 + var(--wave-energy) * 0.08));
}

@keyframes wave-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50% { opacity: 0.9; transform: scale(1.025); }
}

@media (max-height: 640px) {
  .level-meter {
    width: min(68vw, 38dvh);
    height: min(68vw, 38dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave-ring,
  .wave-glow {
    animation: none;
  }
}

.companion-line {
  max-width: 18rem;
  margin: 0;
  padding: 0;
  color: #64748b;
  font-size: clamp(0.78rem, 2.4vw, 0.9rem);
  line-height: 1.35;
  background: transparent;
  box-shadow: none;
}

.companion-line:empty {
  display: none;
}

.companion-line.is-leaving {
  opacity: 0;
}

.retry-recording {
  max-width: 16rem;
}

.comment-frame {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 92%;
  height: auto;
  max-height: min(28dvh, 11rem);
  margin: 0;
  padding: clamp(16px, 2dvh, 20px);
  overflow: auto;
  border-radius: clamp(16px, 3vw, 22px);
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

#recording-status[data-state="recording"] .comment-frame,
#recording-status[data-state="stopping"] .comment-frame {
  display: block;
  align-self: start;
  width: 92%;
  height: auto;
  max-height: min(28dvh, 11rem);
}

.comment-body {
  font-size: clamp(17px, 4.6vw, 19px);
  line-height: 1.55;
}

.comment-body:empty {
  min-height: 1.5em;
}

.listen-dock {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 0.2rem 1.15rem max(0.75rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.listen-dock > * {
  pointer-events: auto;
}

.cancel-request,
.stop-wrap {
  display: none;
}

#recording-status[data-state="requesting"] ~ .listen-dock .cancel-request {
  display: inline-flex;
}

#recording-status[data-state="recording"] ~ .listen-dock,
#recording-status[data-state="stopping"] ~ .listen-dock {
  display: none;
}

.cancel-request {
  align-items: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
}

.stop-wrap {
  flex-direction: column;
  align-items: center;
}

.end-session {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(56px, 14vw, 64px);
  height: clamp(56px, 14vw, 64px);
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ff7a7a, var(--red) 62%);
  box-shadow: 0 12px 28px rgba(255, 77, 79, 0.35);
}

.stop-square {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 3px;
  background: #fff;
}

#session-live-panel:has(#comment-chip:not([hidden])) {
  --dock: 13.2rem;
}

.comment-chip {
  position: relative;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 13.4rem;
  min-height: 3.15rem;
  margin-bottom: 0.15rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.chip-avatar {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: #fff;
}

.chip-text {
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
}

.chip-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.05rem;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.comment-card:not(.comment-frame) {
  position: absolute;
  z-index: 4;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(var(--dock) + 0.35rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-height: min(42dvh, 22rem);
  padding: 0.85rem 2.5rem 0.8rem 0.95rem;
  overflow: auto;
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.96);
  text-align: left;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.comment-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: #e8eef6;
  color: #334155;
  font-size: 1.2rem;
  line-height: 1;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}

.comment-avatar svg {
  width: 2.3rem;
  height: 2.3rem;
}

.comment-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.comment-body {
  width: 100%;
  color: #334155;
  font-size: clamp(17px, 4.6vw, 19px);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.comment-disclaimer,
.comment-countdown {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.comment-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}

#session-done-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fbff, #eef3f9);
}

.done-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.done-check {
  display: grid;
  place-items: center;
  width: 5.4rem;
  height: 5.4rem;
  margin-bottom: 0.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #4ade80, #16a34a);
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.28);
}

#done-title {
  max-width: 16rem;
  font-size: 1.7rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.done-lead {
  max-width: 16rem;
  color: var(--muted);
}

.done-actions {
  display: grid;
  gap: 0.7rem;
  width: min(100%, 18rem);
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3.15rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 700;
}

.button-primary {
  background: #1e293b;
  color: #fff;
}

.button-secondary {
  background: #fff;
  color: var(--ink);
  border-color: rgba(15, 23, 42, 0.1);
}

.report-panel {
  display: grid;
  gap: 0.85rem;
  padding: max(0.8rem, env(safe-area-inset-top)) 1rem 2rem;
}

.report-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-back {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.report-title {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.report-meta,
.field-help,
.overview-lead,
.overview-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.report-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.05);
}

.report-tab {
  min-height: 3.15rem;
  padding: 0.55rem 0.45rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

.report-tab[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.overview-card h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.overview-icon {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  flex: none;
}

.overview-icon-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.overview-icon-green {
  background: #dcfce7;
  color: #15803d;
}

.overview-icon-amber {
  background: #ffedd5;
  color: #c2410c;
}

.overview-icon-violet {
  background: #ede9fe;
  color: #6d28d9;
}

.overview-lead {
  margin-bottom: 0.35rem;
}

.report-overview-body,
.report-export {
  display: grid;
  gap: 0.75rem;
}

.report-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stream-row {
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr);
  column-gap: 0.4rem;
  align-items: start;
  padding: 0.34rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.stream-time {
  margin: 0;
  padding-top: 0.22rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.stream-body {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.stream-line {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.stream-kicker {
  margin: 0;
  color: #6d28d9;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.stream-comment .stream-body {
  margin: 0.15rem 0;
  padding-left: 0.55rem;
  border-left: 2px solid rgba(109, 40, 217, 0.45);
}

.stream-comment .stream-line {
  font-size: 0.95rem;
  line-height: 1.45;
}

.stream-gap {
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.stream-muted {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.stream-flag {
  margin: 0.05rem 0 0;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.stream-source summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.stream-source .stream-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.stream-body .button {
  width: auto;
  min-height: 2.75rem;
  margin-top: 0.2rem;
  padding-inline: 0.95rem;
}

.report-catchup {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.report-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.report-speech {
  background: #fff;
}

.report-clean {
  background: #f3f8ff;
  border: 1px solid rgba(29, 78, 216, 0.12);
  box-shadow: none;
}

.report-comment {
  background: #f6f3ff;
  border: 1px solid rgba(109, 40, 217, 0.14);
  box-shadow: none;
}

.report-gap {
  background: transparent;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  box-shadow: none;
}

.report-kicker,
.report-layer-label,
.overview-sub {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.report-clean .report-kicker {
  color: #1d4ed8;
}

.report-comment .report-kicker {
  color: #6d28d9;
}

.report-unit {
  font-size: 1.02rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.report-note,
.report-empty {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.report-empty {
  padding: 0.4rem 0.1rem 0.2rem;
}

.report-layer {
  display: grid;
  gap: 0.3rem;
}

.report-layer-edit {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.report-tools {
  margin-top: 0.15rem;
}

.report-tools summary {
  min-height: 2.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 2.4rem;
  cursor: pointer;
}

.report-hypothesis {
  background: #fffaf5;
  border: 1px solid rgba(194, 65, 12, 0.16);
  box-shadow: none;
}

.report-leftover {
  background: #f8fafc;
  box-shadow: none;
}

.report-leftover .report-unit,
.report-comment .report-unit {
  color: var(--ink);
}

.overview-list {
  display: grid;
  gap: 0.4rem;
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
}

.overview-list li {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.report-export {
  margin-top: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.overview-card,
.transcript-item,
.transcript-note {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.transcript-note {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.transcript-sentence {
  margin: 0;
}

.overview-card h3,
.transcript-label {
  font-size: 0.95rem;
  font-weight: 750;
}

.transcript-panel,
.session-record,
.session-record-body,
.transcript-list,
.transcript-actions {
  display: grid;
  gap: 0.65rem;
}

.transcript-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.transcript-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.transcript-text,
.transcript-revision,
.transcript-suggestion {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.transcript-editor {
  width: 100%;
  min-height: 6.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  resize: vertical;
}

.mic-status {
  max-width: 18rem;
  font-size: 0.92rem;
}

.noscript {
  width: min(100%, 28rem);
  margin: 1rem auto;
  padding-inline: 1rem;
  color: #b91c1c;
}

@media (max-height: 640px) {
  .mic-orb {
    width: min(42vw, 24dvh, 9.5rem);
    height: min(42vw, 24dvh, 9.5rem);
  }

  #recording-status[data-state="recording"],
  #recording-status[data-state="stopping"] {
    row-gap: 10px;
  }

  .comment-frame {
    padding: 16px;
  }
}

@media (min-width: 520px) {
  body {
    display: grid;
    place-items: center;
  }

  .stage {
    height: min(920px, 100dvh);
    min-height: 0;
    overflow: auto;
    border-radius: 36px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  }

  main,
  #view-home,
  #view-prepare,
  #session-live-panel:not([hidden]),
  #session-done-panel:not([hidden]) {
    min-height: 100%;
    height: 100%;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .companion-line,
  .comment-card,
  .mic-orb {
    transition: none;
    animation: none;
  }
}
