:root {
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #172033;
  --muted: #657085;
  --line: #dfe4ec;
  --line-strong: #c9d1de;
  --blue: #3157d5;
  --blue-dark: #2445b1;
  --blue-soft: #edf2ff;
  --purple: #7655c8;
  --purple-soft: #f3efff;
  --teal: #167d77;
  --teal-soft: #e9f7f5;
  --danger: #ba3b45;
  --danger-soft: #fff0f1;
  --success: #18734b;
  --shadow: 0 18px 50px rgba(25, 36, 61, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 84% 4%, rgba(49, 87, 213, 0.08), transparent 30rem),
    var(--canvas);
  color: var(--ink);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(201, 209, 222, 0.8);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: end;
  gap: 3px;
  height: 22px;
}

.brand-mark i {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: var(--blue);
}

.brand-mark i:nth-child(1) {
  height: 11px;
}

.brand-mark i:nth-child(2) {
  height: 22px;
}

.brand-mark i:nth-child(3) {
  height: 16px;
}

.brand-mark i:nth-child(4) {
  height: 8px;
}

.model-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.12);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.workspace-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 72px;
  align-items: end;
  padding: 72px 8px 52px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.71rem;
  font-weight: 780;
  letter-spacing: 0.15em;
}

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

h1 {
  max-width: 660px;
  margin-bottom: 20px;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.intro-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.proof-list {
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.proof-list div {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.proof-list dt {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 760;
}

.proof-list dd {
  margin: 0;
  color: #3d485e;
  font-size: 0.92rem;
  font-weight: 620;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 28px;
}

.section-heading,
.result-header,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading > p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
}

.drop-zone {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border: 1.5px dashed #aab8da;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #f9fbff, #f1f5ff);
  text-align: center;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
  border-color: var(--blue);
  outline: none;
  background: var(--blue-soft);
}

.drop-zone.is-dragging {
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 1.45rem;
  font-weight: 400;
}

.drop-zone strong {
  margin-bottom: 5px;
  font-size: 1.08rem;
}

.drop-zone > span:not(.upload-icon) {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.82rem;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 720;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible,
.sample-button:focus-visible,
.evidence-button:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.25);
  outline-offset: 2px;
}

.button-primary {
  background: var(--blue);
  color: white;
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.sample-column {
  min-width: 0;
  padding: 4px 0;
}

.sample-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.sample-heading h3 {
  font-size: 0.98rem;
}

.sample-heading span {
  color: var(--muted);
  font-size: 0.76rem;
}

.sample-list {
  display: grid;
  gap: 10px;
}

.sample-button {
  width: 100%;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.sample-button:hover:not(:disabled) {
  border-color: #9aace2;
  box-shadow: 0 8px 24px rgba(49, 87, 213, 0.08);
  transform: translateY(-1px);
}

.sample-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sample-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sample-topline strong {
  font-size: 0.94rem;
}

.sample-duration {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 730;
}

.sample-button p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sample-source {
  display: block;
  overflow: hidden;
  color: #7a8497;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-skeleton {
  height: 111px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #f0f2f6, #fafbfc, #f0f2f6);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.status-panel,
.error-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.status-panel[hidden],
.error-panel[hidden],
.result-panel[hidden] {
  display: none;
}

.status-panel p,
.error-panel p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-panel > span {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  font-weight: 650;
}

.spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid #dce4fa;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel {
  justify-content: space-between;
  border-color: #f0c8cc;
  background: var(--danger-soft);
}

.error-panel strong {
  color: var(--danger);
}

.result-panel {
  margin-top: 24px;
  overflow: hidden;
}

.result-header {
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--line);
}

.source-attribution {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.metric {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.metric strong {
  color: var(--ink);
}

#audio-player {
  display: block;
  width: calc(100% - 56px);
  height: 48px;
  margin: 20px 28px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  border-top: 1px solid var(--line);
}

.transcript-panel,
.insights-panel {
  min-width: 0;
  padding: 26px 28px 32px;
}

.transcript-panel {
  border-right: 1px solid var(--line);
}

.panel-heading {
  align-items: center;
  margin-bottom: 17px;
}

.panel-heading > span:not(.count-badge) {
  color: var(--muted);
  font-size: 0.76rem;
}

.transcript-list {
  display: grid;
  gap: 4px;
}

.segment {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.segment time {
  padding-top: 2px;
  color: var(--blue);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.segment p {
  margin: 0;
  color: #354057;
  font-size: 0.94rem;
}

.segment.is-evidence {
  border-color: #b8c5ed;
  background: var(--blue-soft);
}

.insights-panel {
  display: grid;
  align-content: start;
  gap: 30px;
  background: var(--surface-soft);
}

.count-badge {
  display: grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 999px;
  background: #e8ecf4;
  color: #46536a;
  font-size: 0.75rem;
  font-weight: 760;
}

.insight-list {
  display: grid;
  gap: 9px;
}

.insight-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.insight-card.decision {
  border-left-color: var(--purple);
}

.insight-card.action {
  border-left-color: var(--teal);
}

.insight-card p {
  margin-bottom: 11px;
  color: #303b51;
  font-size: 0.9rem;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.item-meta span {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 650;
}

.evidence-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 720;
}

.evidence-button:hover {
  text-decoration: underline;
}

.empty-result {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.82rem;
}

.verification {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.verification > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.valid-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f6ef;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 750;
}

.invalid-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 750;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 44px;
  color: var(--muted);
  font-size: 0.76rem;
}

footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .workspace-intro,
  .input-grid,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .workspace-intro {
    gap: 34px;
    padding-top: 54px;
  }

  .input-grid {
    gap: 28px;
  }

  .transcript-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .insights-panel {
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .app-bar {
    min-height: 60px;
    padding: 0 18px;
  }

  .model-badge {
    padding: 6px 9px;
    font-size: 0.72rem;
  }

  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .workspace-intro {
    padding: 40px 2px 34px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .input-panel {
    padding: 20px;
    border-radius: 17px;
  }

  .section-heading,
  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p {
    margin-bottom: 0;
  }

  .drop-zone {
    min-height: 240px;
    padding: 22px;
  }

  .sample-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .status-panel,
  .error-panel {
    align-items: flex-start;
    padding: 16px;
  }

  .error-panel {
    flex-direction: column;
  }

  .status-panel > span {
    display: none;
  }

  .result-header,
  .transcript-panel,
  .insights-panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .result-metrics {
    justify-content: flex-start;
  }

  #audio-player {
    width: calc(100% - 40px);
    margin-right: 20px;
    margin-left: 20px;
  }

  .segment {
    grid-template-columns: 50px 1fr;
    gap: 8px;
    padding: 10px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
