:root {
  color-scheme: light;
  --ink: #142331;
  --muted: #687785;
  --paper: #f9fbfd;
  --wash: #eef3f8;
  --line: #ced9e3;
  --blue: #3157d5;
  --blue-dark: #2445b5;
  --coral: #ff6b5f;
  --mint: #2a9d78;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wash);
  color: var(--ink);
  font-family: "Segoe UI Variable", Aptos, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.topbar {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 780; letter-spacing: .04em; }
.brand-mark { width: 30px; height: 25px; display: flex; align-items: center; gap: 3px; }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: var(--blue); }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 24px; background: var(--coral); }
.brand-mark i:nth-child(3) { height: 17px; }
.brand-mark i:nth-child(4) { height: 7px; }
.stage { color: var(--muted); font-size: .9rem; }

main { padding: 70px 0 76px; }
.intro { display: grid; grid-template-columns: 1.15fr .85fr; gap: 70px; align-items: end; margin-bottom: 58px; }
h1 { margin: 0; max-width: 760px; font-size: clamp(3.2rem, 7vw, 6.8rem); line-height: .92; letter-spacing: -.065em; font-weight: 720; }
.intro-copy p { max-width: 620px; margin: 28px 0 0; color: var(--muted); font-size: 1.16rem; line-height: 1.6; }

.signal { height: 132px; display: flex; align-items: center; justify-content: flex-end; gap: clamp(5px, .8vw, 11px); padding-bottom: 8px; }
.signal span { width: 8px; height: var(--h); min-height: 8px; border-radius: 8px; background: var(--blue); opacity: .86; }
.signal span:nth-child(5n+2) { background: var(--coral); }

.workspace { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: clamp(24px, 5vw, 54px); box-shadow: 0 24px 60px rgba(49, 74, 99, .09); }
.workspace-head, .result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.workspace h2, .result h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.workspace-head p { margin: 7px 0 0; color: var(--muted); }
.privacy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; white-space: nowrap; }
.privacy span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(42,157,120,.12); }

form { margin-top: 42px; }
fieldset { padding: 0; border: 0; margin: 0 0 26px; }
legend { margin-bottom: 12px; font-weight: 650; }
.languages { display: flex; flex-wrap: wrap; gap: 8px; }
.languages input { position: absolute; opacity: 0; pointer-events: none; }
.languages span { display: block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.languages input:checked + span { background: var(--ink); border-color: var(--ink); color: white; }
.languages input:focus-visible + span { outline: 3px solid rgba(49,87,213,.28); outline-offset: 2px; }

.dropzone { min-height: 220px; border: 2px dashed #aebdca; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; background: #f5f8fb; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: #f0f4ff; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 17px; border-radius: 50%; background: var(--blue); color: white; font-size: 1.8rem; font-weight: 300; }
.dropzone strong { font-size: 1.12rem; }
.dropzone > span:last-child { margin-top: 6px; color: var(--muted); font-size: .93rem; }

button { width: 100%; margin-top: 18px; padding: 16px 24px; border: 0; border-radius: 12px; background: var(--blue); color: white; font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: var(--blue-dark); }
button:focus-visible { outline: 3px solid rgba(49,87,213,.3); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }

.status { margin-top: 28px; padding: 20px; display: flex; align-items: center; gap: 16px; border-left: 4px solid var(--blue); background: #f0f4ff; }
.status.error { border-color: var(--coral); background: #fff2f0; }
.status p { margin: 4px 0 0; color: var(--muted); }
.spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 3px solid #bfcaed; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.error .spinner { display: none; }

.result { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 38px; }
.analysis-panel { margin-bottom: 44px; padding: clamp(24px, 4vw, 38px); border-radius: 18px; background: var(--ink); color: white; }
.analysis-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.analysis-title > div > span, .arc > span { color: #aebdca; font-size: .84rem; }
.analysis-title h2 { margin-top: 5px; color: white; }
.analysis-panel > p { max-width: 760px; margin: 24px 0; color: #d9e2e9; font-size: 1.03rem; line-height: 1.6; }
.analysis-panel small { display: block; margin-top: 24px; color: #98a9b8; line-height: 1.5; }
.voice-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 26px 0; }
.voice-metrics > div { padding: 14px; border: 1px solid #405363; border-radius: 12px; background: #1a2d3c; }
.voice-metrics span { display: block; min-height: 2.4em; color: #aebdca; font-size: .75rem; line-height: 1.2; }
.voice-metrics strong { display: block; margin-top: 8px; font-size: 1.45rem; }
.tension { display: flex; align-items: center; gap: 10px; }
.tension strong { color: var(--coral); font-size: 2.5rem; line-height: 1; }
.tension span { color: #aebdca; font-size: .75rem; line-height: 1.3; }
.arc { padding-top: 18px; border-top: 1px solid #354757; }
.arc p { margin: 5px 0 0; line-height: 1.5; }
.result-head span { color: var(--muted); font-size: .9rem; }
.utterances { margin-top: 28px; display: grid; gap: 18px; }
.utterance { display: grid; grid-template-columns: 96px 1fr; gap: 20px; }
.speaker { color: var(--blue); font-size: .88rem; font-weight: 700; }
.speaker time { display: block; margin-top: 4px; color: var(--muted); font-weight: 450; }
.utterance p { margin: 0; line-height: 1.62; }
.utterance-body { min-width: 0; }
.utterance-body p { margin: 0; }
.emotion-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.emotion { display: inline-flex; padding: 4px 9px; border-radius: 99px; background: #e8edff; color: var(--blue-dark); font-size: .78rem; font-weight: 700; }
.emotion.anger, .emotion.disgust { background: #ffe8e5; color: #b53e35; }
.emotion.joy { background: #e3f6ee; color: #177756; }
.emotion.sadness, .emotion.fear { background: #ece9fa; color: #6652a8; }
.emotion.tension, .emotion.uncertainty { background: #fff1d9; color: #92600d; }
.reason { color: var(--muted); font-size: .82rem; }
.voice-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.voice-tag { padding: 3px 8px; border-radius: 6px; background: #edf1f4; color: #526575; font-size: .73rem; font-weight: 650; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 38px; color: var(--muted); font-size: .86rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; } }
@media (max-width: 760px) {
  .topbar, main, footer { width: min(100% - 26px, 1180px); }
  main { padding-top: 42px; }
  .intro { grid-template-columns: 1fr; gap: 28px; margin-bottom: 38px; }
  .signal { justify-content: flex-start; height: 72px; }
  .workspace-head, .result-head { flex-direction: column; }
  .privacy { white-space: normal; }
  .utterance { grid-template-columns: 74px 1fr; gap: 12px; }
  .analysis-title { flex-direction: column; }
  .voice-metrics { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; }
}
