@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Manrope:wght@500;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #475569;
  --line: #dbe5e2;
  --panel: #ffffff;
  --soft: #f8fbfa;
  --deep: #0f172a;
  --accent: #00a97b;
  --accent-2: #11d59d;
  --danger: #c74635;
  --violet: #6554d9;
  --radius: 8px;
  --shadow: 0 26px 80px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 42% 8%, rgba(0, 169, 123, 0.12), transparent 34%),
    linear-gradient(90deg, rgba(236, 253, 245, 0.88), rgba(248, 250, 252, 0.92) 44%, #ffffff 44%),
    #f8fafc;
  color: var(--ink);
  font-family:
    "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.is-hidden {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.intro-screen {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 100vh;
  padding: 24px clamp(16px, 6vw, 92px);
  background:
    linear-gradient(112deg, rgba(8, 14, 31, 0.24) 0%, rgba(8, 17, 38, 0.14) 34%, rgba(10, 24, 54, 0.08) 100%),
    url("assets/synergy-main-bg.png") center center / cover no-repeat;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: opacity 640ms ease, transform 720ms ease, filter 720ms ease;
}

.intro-screen.is-leaving {
  opacity: 0;
  transform: scale(1.035);
  filter: blur(10px);
  pointer-events: none;
}

.intro-screen::before,
.intro-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.intro-screen::before {
  display: none;
}

.intro-screen::after {
  display: none;
}

.intro-card {
  position: relative;
  z-index: 2;
  grid-column: 1;
  width: min(560px, calc(50vw - 36px));
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.intro-card::before,
.intro-card::after {
  display: none;
}

.intro-card::before {
}

.intro-card::after {
}

.intro-card h1 {
  max-width: 760px;
  text-align: center;
  color: #e9f4ff;
  font-family: "Space Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1;
  text-wrap: balance;
}

.intro-card p:not(.eyebrow) {
  margin: 0;
  max-width: 700px;
  text-align: center;
  color: rgba(219, 236, 255, 0.94);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.38;
  font-weight: 600;
}

.voice-diagnostic {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(231, 244, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 2px 10px rgba(4, 10, 24, 0.65);
  z-index: 3;
  pointer-events: none;
}

.intro-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

.intro-play {
  position: relative;
  width: 116px;
  height: 116px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  background: linear-gradient(160deg, #2b3c53 0%, #1f2f46 52%, #132235 100%);
  box-shadow:
    0 14px 40px rgba(35, 55, 84, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  animation: intro-pulse 2.8s ease-in-out infinite;
}

.intro-play::before {
  content: "";
  position: absolute;
  left: 44px;
  top: 36px;
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 31px solid #ffffff;
}

.intro-play::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 1px solid rgba(180, 255, 230, 0.36);
}

#openSilentlyBtn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(238, 248, 255, 0.92);
  border: 1px solid rgba(192, 214, 236, 0.92);
  color: #1f2f43;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.intro-bottom-action {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(242, 248, 255, 0.84);
  border: 1px solid rgba(191, 216, 242, 0.86);
  color: #1e334a;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(5, 15, 31, 0.2);
}

.intro-bottom-arrow {
  font-size: 13px;
  line-height: 1;
}

.intro-bottom-action:hover {
  transform: translateX(-50%);
}

#openSilentlyBtn.intro-bottom-action:hover {
  transform: translateX(-50%);
}

#openSilentlyBtn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 1);
}

@keyframes intro-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 14px 40px rgba(8, 193, 129, 0.36),
      inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow:
      0 20px 52px rgba(7, 212, 173, 0.46),
      inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.86fr) minmax(520px, 1.14fr);
  gap: 48px;
  width: min(1340px, calc(100vw - 64px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}

.app-shell.is-entering {
  animation: app-enter 720ms ease both;
}

@keyframes app-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.interview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
}

.results {
  position: sticky;
  top: 34px;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 26px;
  min-height: calc(100vh - 96px);
  padding: 40px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(219, 229, 226, 0.95);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}

.topbar,
.results-head,
.progress-label,
.controls,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  position: relative;
  display: block;
  padding-right: 148px;
}

.topbar .status {
  position: absolute;
  top: 0;
  right: 0;
}

.result-actions {
  padding-right: 188px;
}

.hero-copy {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.58;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 620px;
  color: var(--deep);
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 950;
  line-height: 0.98;
}

.hero-accent {
  display: block;
  color: var(--accent);
}

@media (max-width: 760px) {
  .intro-screen {
    grid-template-columns: 1fr;
    justify-content: center;
    padding: 16px;
  }

  .intro-card {
    width: min(560px, calc(100vw - 26px));
    padding: 0;
    gap: 8px;
  }

  .intro-actions {
    gap: 10px;
  }

  .intro-play {
    width: 100px;
    height: 100px;
    min-height: 100px;
  }

  .intro-play::before {
    left: 38px;
    top: 31px;
    border-top-width: 18px;
    border-bottom-width: 18px;
    border-left-width: 27px;
  }

  .intro-bottom-action {
    bottom: 12px;
    min-height: 34px;
    padding: 0 12px;
  }
}

#introScreen:not(.is-hidden) ~ .assistant-fab {
  display: none;
}

h2 {
  font-size: 25px;
  line-height: 1.16;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-color: rgba(0, 169, 123, 0.26);
  border-radius: 999px;
  color: #007a5d;
  background: rgba(236, 253, 245, 0.84);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
}

.status.recording span {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(199, 70, 53, 0.12);
}

.demo-note {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(219, 229, 226, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.demo-note::after {
  content: "✦";
  position: absolute;
  right: 28px;
  top: 34px;
  color: rgba(0, 169, 123, 0.09);
  font-size: 86px;
  line-height: 1;
}

.demo-note p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 620;
  line-height: 1.55;
}

.demo-note h2 {
  position: relative;
  max-width: 420px;
  color: var(--deep);
  font-size: 24px;
  font-weight: 900;
}

.demo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-meta span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
}

.progress-wrap {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.progress-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  background: #e5ecea;
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #10d68f, #00a97b);
  transition: width 220ms ease;
}

.question-panel {
  display: grid;
  gap: 24px;
  padding: 38px 40px;
  border: 1px solid rgba(219, 229, 226, 0.96);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 72%, rgba(236, 253, 245, 0.78) 100%);
  box-shadow: var(--shadow-soft);
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.upload-panel.is-highlighted {
  border-color: rgba(15, 139, 118, 0.72);
  background: #f0fbf8;
  box-shadow: 0 0 0 4px rgba(15, 139, 118, 0.12);
}

.upload-panel strong {
  color: var(--deep);
}

.upload-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--deep);
  font-weight: 800;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.file-chip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.assistant-panel {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 108px));
  max-height: calc(100vh - 108px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(217, 225, 223, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(18, 63, 58, 0.2);
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  color: #ffffff;
}

.assistant-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #edf0f2;
  background: #ffffff;
}

.assistant-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  background: #ffffff;
  color: #9aa2af;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 900;
}

.assistant-tab.is-active {
  color: #7b3ff2;
  border-bottom-color: #8d5af7;
}

.tab-icon {
  color: currentColor;
  font-size: 17px;
  line-height: 1;
}

.assistant-tab b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.assistant-title strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.assistant-title p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.3;
}

.spark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: #ffe07c;
  font-weight: 900;
}

.assistant-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
}

.assistant-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.assistant-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.assistant-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.assistant-progress-track {
  height: 7px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #eef3f2;
  border-radius: 999px;
}

.assistant-progress-track div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7b3ff2);
  transition: width 220ms ease;
}

.assistant-checklist {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow: auto;
}

.assistant-checkitem {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e6ecea;
  border-radius: var(--radius);
  background: #fbfdfc;
}

.assistant-checkitem span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #cad7d4;
  color: #a0aaa7;
  font-size: 12px;
  font-weight: 900;
}

.assistant-checkitem.done {
  background: #f1fbf7;
  border-color: rgba(15, 139, 118, 0.34);
}

.assistant-checkitem.active {
  border-color: rgba(123, 63, 242, 0.4);
  box-shadow: inset 3px 0 0 #7b3ff2;
}

.assistant-checkitem.draft {
  background: #fffaf1;
  border-color: rgba(215, 134, 28, 0.34);
}

.assistant-checkitem.skipped {
  background: #f7f8fb;
  border-color: rgba(100, 116, 139, 0.28);
}

.assistant-checkitem.done span:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.assistant-checkitem.draft span:first-child {
  background: #d7861c;
  border-color: #d7861c;
  color: #ffffff;
}

.assistant-checkitem.skipped span:first-child {
  background: #64748b;
  border-color: #64748b;
  color: #ffffff;
}

.assistant-checkitem strong {
  display: block;
  color: var(--deep);
  font-size: 12px;
  line-height: 1.2;
}

.assistant-checkitem p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.28;
}

.assistant-checkitem em,
.answer-card em {
  display: inline-flex;
  margin-right: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff2d6;
  color: #9a5c10;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.assistant-orb-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 14px;
  flex: 0 0 auto;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid rgba(219, 229, 226, 0.86);
  border-radius: var(--radius);
  background: rgba(248, 251, 250, 0.92);
}

.assistant-orb {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: background 240ms ease, box-shadow 240ms ease;
}

.assistant-orb::before,
.assistant-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}

.assistant-orb .grant-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: transparent;
  overflow: hidden;
  will-change: transform, filter;
}

.assistant-orb .grant-mark::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 46%, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.56) 44%, transparent 62%);
  mix-blend-mode: screen;
  transform: translateX(-54%) rotate(12deg);
}

.grant-mark img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  display: block;
  filter: drop-shadow(0 18px 32px rgba(52, 42, 128, 0.28));
  transform: scale(1.08);
  transform-origin: 50% 50%;
  will-change: transform, filter;
}

.assistant-orb.listening {
  background: transparent;
  box-shadow: none;
}

.assistant-orb.listening::before,
.assistant-orb.listening::after {
  opacity: 1;
  background: rgba(37, 201, 155, 0.18);
  animation: orb-ping 2s ease-out infinite;
}

.assistant-orb.listening::after {
  inset: -7px;
  animation-delay: 0.28s;
}

.assistant-orb.speaking {
  background: transparent;
  box-shadow: none;
}

.assistant-orb.speaking::before,
.assistant-orb.speaking::after {
  opacity: 1;
  border: 2px solid rgba(109, 84, 215, 0.34);
  animation: orb-ping 1.45s ease-out infinite;
}

.assistant-orb.speaking::after {
  animation-delay: 0.42s;
}

.assistant-orb.thinking {
  background: transparent;
  box-shadow: none;
}

.assistant-orb.connecting::before,
.assistant-orb.connecting::after {
  opacity: 1;
  border: 2px solid rgba(109, 84, 215, 0.28);
  animation: orb-ping 1.4s ease-out infinite;
}

.assistant-orb.connecting::after {
  animation-delay: 0.35s;
}

.assistant-orb.thinking::before {
  opacity: 1;
  inset: -4px;
  background: conic-gradient(from 0deg, transparent 0%, rgba(214, 138, 39, 0.95), transparent 100%);
  mask-image: radial-gradient(transparent 61%, black 63%);
  -webkit-mask-image: radial-gradient(transparent 61%, black 63%);
  animation: orb-spin 1.3s linear infinite;
}

.assistant-orb.listening .grant-mark img,
.assistant-orb.speaking .grant-mark img,
.assistant-orb.connecting .grant-mark img {
  animation: grant-orb-breathe 2.6s ease-in-out infinite;
}

.assistant-orb.thinking .grant-mark img {
  animation: grant-orb-breathe 1.8s ease-in-out infinite;
}

.assistant-orb.listening .grant-mark::after,
.assistant-orb.speaking .grant-mark::after,
.assistant-orb.thinking .grant-mark::after,
.assistant-orb.connecting .grant-mark::after {
  animation: grant-orb-shine 2.4s ease-in-out infinite;
}

@keyframes orb-ping {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

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

@keyframes grant-orb-breathe {
  0%, 100% {
    transform: scale(1.08);
    filter: drop-shadow(0 18px 32px rgba(52, 42, 128, 0.26)) saturate(1.04) brightness(1);
  }
  50% {
    transform: scale(1.11);
    filter: drop-shadow(0 20px 38px rgba(15, 139, 118, 0.42)) saturate(1.2) brightness(1.08);
  }
}

@keyframes grant-orb-shine {
  0% {
    opacity: 0;
    transform: translateX(-56%) rotate(12deg);
  }
  38% {
    opacity: 0.72;
  }
  70%, 100% {
    opacity: 0;
    transform: translateX(58%) rotate(12deg);
  }
}

.assistant-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.voice-meter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-meter.listening span {
  background: #25c99b;
  animation: meter 680ms ease-in-out infinite;
}

.voice-meter span {
  width: 5px;
  height: 10px;
  background: var(--line);
}

.voice-meter.speaking span {
  background: var(--accent);
  animation: meter 780ms ease-in-out infinite;
}

.voice-meter.speaking span:nth-child(2) {
  animation-delay: 120ms;
}

.voice-meter.speaking span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes meter {
  0%, 100% {
    height: 8px;
  }
  50% {
    height: 22px;
  }
}

.dialog-log {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

.dialog-msg {
  max-width: 86%;
  padding: 12px 14px;
  border: 1px solid rgba(217, 225, 223, 0.92);
  font-size: 15px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.admin-page {
  position: relative;
  background:
    linear-gradient(112deg, rgba(8, 14, 31, 0.3) 0%, rgba(8, 17, 38, 0.18) 34%, rgba(10, 24, 54, 0.08) 100%),
    url("assets/synergy-main-bg.png") center center / cover fixed no-repeat;
  color: #eef7ff;
  overflow-x: hidden;
}

.admin-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 9, 27, 0.08), rgba(7, 16, 36, 0.1) 44%, rgba(209, 239, 247, 0.16)),
    radial-gradient(circle at 28% 62%, rgba(28, 214, 177, 0.22), transparent 18%);
}

.admin-shell {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 56px;
}

.admin-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.55fr) minmax(360px, 0.45fr);
  align-items: center;
  gap: 24px;
  min-height: 100vh;
  margin: 0;
  padding: 24px clamp(16px, 6vw, 92px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-hero::after {
  display: none;
}

.admin-hero > div,
.admin-hero > button {
  position: relative;
  z-index: 1;
}

.admin-hero h1 {
  max-width: 760px;
  color: #f1f6ff;
  font-family: "Space Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 1;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 10px 32px rgba(3, 8, 22, 0.44);
}

.admin-hero .eyebrow {
  color: rgba(219, 236, 255, 0.94);
  text-align: center;
  text-shadow: 0 2px 14px rgba(3, 8, 22, 0.4);
}

.admin-hero p:not(.eyebrow) {
  max-width: 700px;
  margin: 18px auto 0;
  color: rgba(219, 236, 255, 0.94);
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 800;
  line-height: 1.38;
  text-align: center;
  text-shadow: 0 2px 14px rgba(3, 8, 22, 0.46);
}

.admin-hero .primary {
  justify-self: center;
  align-self: end;
  min-width: 148px;
  margin-bottom: 4vh;
  border: 1px solid rgba(192, 214, 236, 0.92);
  border-radius: 999px;
  background: rgba(238, 248, 255, 0.92);
  color: #1f2f43;
  box-shadow: 0 10px 24px rgba(5, 15, 31, 0.2);
  backdrop-filter: none;
}

.admin-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  min-height: calc(100vh - 88px);
}

.admin-topbar h1 {
  max-width: 620px;
  color: #f1f6ff;
  text-shadow: 0 10px 32px rgba(3, 8, 22, 0.34);
}

.admin-topbar .hero-accent {
  color: #f1f6ff;
}

.admin-topbar .eyebrow {
  color: rgba(210, 248, 255, 0.9);
  text-shadow: 0 2px 14px rgba(3, 8, 22, 0.4);
}

.admin-topbar .hero-copy {
  max-width: 560px;
  color: rgba(233, 244, 255, 0.94);
  font-size: clamp(18px, 1.65vw, 24px);
  line-height: 1.42;
  text-shadow: 0 2px 14px rgba(3, 8, 22, 0.46);
}

.admin-topbar .status {
  color: #e9fbff;
  border-color: rgba(196, 241, 255, 0.34);
  background: rgba(9, 20, 47, 0.54);
  box-shadow: 0 16px 40px rgba(4, 10, 28, 0.22);
  backdrop-filter: blur(12px);
}

.admin-note {
  margin-top: 20px;
  max-width: 620px;
  border-color: rgba(205, 232, 255, 0.26);
  background: rgba(8, 17, 38, 0.56);
  box-shadow: 0 28px 90px rgba(3, 9, 26, 0.34);
  backdrop-filter: blur(16px);
}

.admin-note h2 {
  color: #ffffff;
}

.admin-note p {
  color: rgba(231, 242, 255, 0.9);
}

.admin-note::after {
  color: rgba(206, 247, 255, 0.16);
}

.admin-note .demo-meta span {
  color: #e8f7ff;
  border-color: rgba(214, 237, 255, 0.24);
  background: rgba(236, 249, 255, 0.12);
}

.admin-progress {
  margin-top: 0;
  max-width: 620px;
}

.admin-progress .progress-label {
  color: rgba(230, 243, 255, 0.88);
  text-shadow: 0 2px 12px rgba(3, 8, 22, 0.36);
}

.admin-progress .progress-track {
  background: rgba(225, 246, 255, 0.22);
}

.admin-panel {
  gap: 20px;
  padding: 34px;
  max-width: 620px;
  border-color: rgba(205, 232, 255, 0.26);
  background: rgba(8, 17, 38, 0.56);
  box-shadow: 0 28px 90px rgba(3, 9, 26, 0.34);
  backdrop-filter: blur(16px);
}

.admin-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel-head h2 {
  max-width: none;
  color: #ffffff;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 950;
}

.admin-panel-head .primary {
  flex: 0 0 auto;
}

.admin-insights {
  align-self: start;
  position: sticky;
  top: 44px;
  min-height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
  overflow: hidden;
  border-color: rgba(214, 237, 255, 0.3);
  background: rgba(8, 17, 38, 0.56);
  box-shadow: 0 30px 100px rgba(4, 10, 28, 0.32);
  backdrop-filter: blur(18px);
}

.admin-insights .results-head h2 {
  color: #ffffff;
}

.admin-insights .summary-grid div {
  border-color: rgba(214, 237, 255, 0.24);
  background: rgba(238, 248, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-insights .summary-grid span {
  color: #f1f8ff;
}

.admin-insights .summary-grid p,
.admin-insights .answer-card p {
  color: rgba(230, 243, 255, 0.82);
}

.admin-insights .summary-grid div:last-child {
  border-color: rgba(125, 245, 221, 0.48);
  background: rgba(0, 169, 123, 0.14);
}

.admin-insights .summary-grid div:last-child span {
  color: #a7fff0;
}

.admin-insights .answer-card {
  border-color: rgba(214, 237, 255, 0.22);
  background: rgba(238, 248, 255, 0.1);
}

.admin-insights .answer-card strong {
  color: #ffffff;
}

.admin-grid {
  display: grid;
  gap: 16px;
  width: min(1180px, calc(100vw - 64px));
  max-width: 100%;
  margin: 0 auto;
}

.admin-empty,
.submission-card {
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(215, 235, 246, 0.36);
  border-radius: var(--radius);
  background: rgba(246, 251, 255, 0.88);
  box-shadow: 0 14px 38px rgba(4, 12, 30, 0.16);
}

.submission-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(237, 242, 240, 0.96);
}

.submission-card h2 {
  max-width: 520px;
  color: var(--deep);
  font-size: 28px;
  font-weight: 950;
  line-height: 1.08;
}

.submission-card header span,
.submission-meta {
  color: var(--muted);
  font-size: 13px;
}

.submission-card header strong {
  min-width: 68px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #ecfdf5;
  color: #007a5d;
  font-size: 18px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(17, 213, 157, 0.25);
}

.submission-progress {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.submission-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.submission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.submission-meta span {
  padding: 8px 10px;
  border: 1px solid rgba(208, 226, 236, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.submission-answers {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.submission-answers section,
.submission-drafts {
  padding: 16px;
  border: 1px solid rgba(217, 231, 240, 0.92);
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.86);
}

.submission-answers b,
.submission-drafts b {
  color: var(--deep);
  font-size: 13px;
}

.submission-answers p,
.submission-drafts p {
  margin: 8px 0 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.5;
}

.submission-drafts {
  margin-top: 10px;
  background: #fffaf1;
  border-color: rgba(215, 134, 28, 0.28);
}

.admin-highlights {
  max-height: none;
}

.admin-mini-track {
  height: 7px;
}

.dialog-msg.assistant {
  justify-self: start;
  background: #f3fbf8;
  color: var(--deep);
  border-radius: 16px 16px 16px 4px;
}

.dialog-msg.user {
  justify-self: end;
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  border-radius: 16px 16px 4px 16px;
}

.assistant-actions {
  display: block;
  flex: 0 0 auto;
  padding: 14px 14px 10px;
  border-top: 1px solid rgba(217, 225, 223, 0.82);
  background: rgba(255, 255, 255, 0.98);
}

.assistant-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  background: var(--deep);
  color: #ffffff;
  font-weight: 800;
}

.assistant-voice.recording {
  background: var(--danger);
}

.dialog-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px 14px;
  background: rgba(255, 255, 255, 0.98);
}

.dialog-input-row input {
  margin-top: 0;
}

.assistant-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent), var(--violet));
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(18, 63, 58, 0.22);
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.assistant-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(18, 63, 58, 0.28);
}

.prompt-kicker {
  margin: 0;
  color: #d68416;
  font-size: 15px;
  font-weight: 900;
}

.question-panel h2 {
  max-width: 680px;
  color: var(--deep);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 950;
  line-height: 1.16;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 168px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

input {
  height: 42px;
  margin-top: 7px;
  padding: 0 12px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 118, 0.12);
}

.controls {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.primary,
.secondary,
.icon-btn,
.results-head button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-weight: 900;
}

.primary {
  background: #0f172a;
  color: white;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.intro-actions .intro-play {
  min-height: 116px;
  padding: 0;
  border-radius: 999px;
}

.secondary,
.results-head button {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--deep);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #00a97b, #08c48e);
  color: white;
  box-shadow: 0 14px 30px rgba(0, 169, 123, 0.22);
}

.icon-btn.recording {
  background: var(--danger);
}

.mic-icon {
  position: relative;
  width: 14px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 9px;
}

.mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 2px;
  height: 7px;
  background: currentColor;
  transform: translateX(-50%);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.summary-grid div {
  min-height: 134px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid rgba(219, 229, 226, 0.96);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.summary-grid span {
  color: var(--deep);
  font-size: clamp(42px, 4vw, 58px);
  font-weight: 950;
  line-height: 1;
}

.summary-grid div:last-child {
  border-color: rgba(17, 213, 157, 0.48);
  background: linear-gradient(135deg, #ecfdf5, #f8fffc);
}

.summary-grid div:last-child span {
  color: var(--deep);
  color: #007a5d;
}

.summary-grid p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.answer-map {
  display: grid;
  gap: 14px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.answer-card {
  display: grid;
  gap: 12px;
  padding: 24px 28px;
  border: 1px solid rgba(219, 229, 226, 0.96);
  border-radius: var(--radius);
  background: #f8fafc;
}

.answer-card strong {
  color: var(--deep);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.answer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.answer-card.has-answer {
  border-color: rgba(17, 213, 157, 0.5);
  background: #ffffff;
}

.answer-card.has-answer p:last-child {
  color: var(--ink);
}

.answer-card.has-draft {
  border-color: rgba(215, 134, 28, 0.36);
  background: #fffaf1;
}

.answer-card.is-skipped {
  border-color: rgba(100, 116, 139, 0.26);
  background: #f7f8fb;
}

.answer-card.is-active {
  box-shadow: inset 3px 0 0 #7b3ff2;
}

pre {
  flex: 1;
  min-height: 260px;
  max-height: calc(100vh - 286px);
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .app-shell,
  .admin-shell {
    padding: 16px;
    width: min(100%, calc(100vw - 20px));
    gap: 24px;
  }

  .admin-shell {
    padding: 0 0 32px;
  }

  .admin-hero {
    grid-template-columns: 1fr;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
  }

  .admin-hero .primary {
    align-self: end;
    justify-self: center;
    width: auto;
    min-width: 210px;
    margin-bottom: 12px;
  }

  .admin-insights {
    position: static;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .topbar,
  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 36px;
  }

  .interview,
  .results,
  .question-panel,
  .admin-panel {
    padding: 18px;
  }

  .primary,
  .secondary,
  .icon-btn {
    width: 100%;
    justify-content: center;
  }

  .intro-actions .intro-play {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
  }

  .intro-actions #openSilentlyBtn {
    width: 100%;
    max-width: 260px;
  }

  .upload-panel {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    width: 100%;
    padding: 0 0 24px;
  }

  .admin-topbar {
    padding-right: 0;
  }

  .admin-topbar .status {
    position: static;
    margin-top: 14px;
  }

  .admin-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .submission-card {
    padding: 18px;
  }

  .submission-card header {
    flex-direction: column;
  }

  .submission-card header strong {
    width: 100%;
  }

  .submission-card h2 {
    font-size: 25px;
  }

  .dialog-head,
  .dialog-input-row {
    grid-template-columns: 1fr;
  }

  .assistant-panel {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
    max-height: calc(100vh - 96px);
  }

  .assistant-fab {
    right: 12px;
    bottom: 14px;
  }
}
