:root {
  --ink: #f5f7fb;
  --muted: #a8b0bf;
  --paper: #0f1115;
  --panel: #171a21;
  --line: #2b303a;
  --ember: #7f8cff;
  --ember-dark: #5f68d8;
  --teal: #4ea7a0;
  --gold: #5d6ef0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at top, rgba(95, 104, 216, 0.16), transparent 42%), var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(15, 17, 21, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
}

.brand img {
  width: min(190px, 42vw);
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 2.4vw, 24px);
  flex-wrap: wrap;
}

.site-nav a {
  color: #d0d4dd;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.site-nav a[aria-current="page"] {
  color: #ffffff;
}

.interview-shell {
  width: min(920px, calc(100% - 20px));
  margin: 0 auto;
  min-height: calc(100vh - 86px);
  display: block;
  padding: clamp(16px, 2.8vw, 28px) 0 clamp(18px, 3vw, 32px);
}

.intro-panel {
  max-width: none;
  margin: 0 0 18px;
  padding: 0 4px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8fd1cc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 60ch;
}

.note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.note span {
  color: var(--muted);
}

.chat-card {
  min-height: min(760px, calc(100vh - 190px));
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  overflow: hidden;
  background: rgba(23, 26, 33, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.link-button {
  border: 0;
  background: transparent;
  color: #c7ccff;
  font-weight: 700;
  cursor: pointer;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 26px 22px 24px;
  scroll-behavior: smooth;
}

.message {
  max-width: min(86%, 700px);
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message.bot {
  align-self: flex-start;
  background: #20242e;
  color: #f4f6fb;
  border-top-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.message.user {
  align-self: flex-end;
  background: #2d3240;
  color: #ffffff;
  border-top-right-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-text {
  white-space: pre-wrap;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message-attachment {
  display: grid;
  gap: 8px;
}

.message-attachment-preview {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.message-attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-attachment-link {
  color: inherit;
  text-decoration: underline;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.35;
}

.composer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  background: rgba(17, 19, 25, 0.94);
}

.composer-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.composer-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.composer-media input[type="url"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #343a45;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #12151b;
}

.composer-media input[type="url"]:focus {
  outline: 3px solid rgba(33, 115, 111, 0.2);
  border-color: var(--teal);
}

.composer-media button {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: #2f7d78;
}

.composer-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.pending-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.pending-attachment {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.pending-attachment-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.pending-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pending-attachment-meta {
  color: #bac1cd;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.pending-attachment-remove {
  border: 0;
  background: transparent;
  color: #c7ccff;
  font-weight: 800;
  padding: 0;
  justify-self: start;
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 112px;
  max-height: 260px;
  resize: vertical;
  border: 1px solid #343a45;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: #12151b;
}

textarea:focus {
  outline: 3px solid rgba(95, 104, 216, 0.24);
  border-color: var(--teal);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.complete-actions button,
.complete-actions a,
#send-answer {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

#send-answer {
  color: #fff;
  background: #4b63f0;
}

#send-answer:disabled {
  opacity: 0.55;
  cursor: wait;
}

.composer-hint {
  color: var(--muted);
  font-size: 14px;
}

#send-answer:hover,
.complete-actions button:hover,
.complete-actions a:hover {
  background: var(--ember-dark);
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 19, 25, 0.98);
}

.complete-actions button,
.complete-actions a {
  color: #fff;
  background: #2f7d78;
}

.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;
}

@media (max-width: 860px) {
  .interview-shell {
    width: min(100% - 16px, 920px);
  }

  .intro-panel {
    max-width: none;
  }

  .chat-card {
    min-height: 680px;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .interview-shell {
    width: min(100% - 12px, 920px);
    padding-top: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .messages {
    padding: 16px 12px;
  }

  .message {
    max-width: 94%;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-media {
    grid-template-columns: 1fr;
  }
}
