:root {
  --gv-n0: #ffffff;
  --gv-n50: #fafafa;
  --gv-n100: #f5f5f5;
  --gv-n200: #efefef;
  --gv-n300: #e0e0e0;
  --gv-accent: #1b5188;
  --gv-dark-accent: #062556;
  --gv-text-base: rgba(0, 0, 0, 0.95);
  --gv-text-pale: rgba(51, 51, 51, 0.7);
  --gv-text-xpale: rgba(51, 51, 51, 0.55);
  --gv-text-inverse: #ffffff;
  --gv-text-success: #059669;
  --gv-border-base: rgba(51, 51, 51, 0.08);
  --gv-border-dark: rgba(51, 51, 51, 0.15);
  --gv-shadow1: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 1px 2.5px rgba(0, 0, 0, 0.1);
  --gv-shadow2: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 6px 12px -3px rgba(0, 0, 0, 0.14);
  --gv-transition-base: 0.125s ease;
  --radius-card: 18px;
  --radius-control: 999px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--gv-text-base);
  font-family: Inter, -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  text-size-adjust: 100%;
}

button,
textarea {
  font: inherit;
}

button {
  appearance: none;
}

.shell {
  width: 100%;
  max-width: none;
  min-height: 100%;
  margin: 0;
  padding: 18px 26px 24px;
  background: var(--gv-n0);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gv-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  color: var(--gv-text-base);
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  max-width: 420px;
  font-size: 24px;
  line-height: 1.14;
}

#screen-title,
.topbar-copy h1 {
  display: none !important;
}

h2 {
  font-size: 21px;
  line-height: 1.18;
}

p {
  margin: 9px 0 0;
  color: var(--gv-text-pale);
  font-size: 15px;
  line-height: 1.42;
  letter-spacing: 0;
}

.progress-pill {
  min-width: 58px;
  padding: 7px 11px 8px;
  border-radius: var(--radius-control);
  background: var(--gv-n100);
  color: var(--gv-accent);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: var(--gv-shadow1);
}

.progress-track {
  height: 7px;
  margin: 0 0 15px;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: var(--gv-n100);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--gv-dark-accent);
  transition: width 240ms ease;
}

.card,
.question {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gv-border-base);
  border-radius: 18px;
  background: var(--gv-n0);
  box-shadow: 0 10px 26px -18px rgba(0, 0, 0, 0.28);
}

.card {
  padding: 18px 18px 18px;
}

.question {
  padding: 16px 16px 14px;
}

.mark-row {
  display: flex;
  gap: 4px;
  margin-bottom: 15px;
}

.mark-row span {
  display: block;
  width: 22px;
  height: 7px;
  border-radius: 9px 3px 9px 3px;
  background: var(--gv-dark-accent);
  transform: skew(-18deg);
}

.primary-btn,
.ghost-btn,
.option-btn {
  border: 0;
  cursor: pointer;
  transition:
    transform var(--gv-transition-base),
    box-shadow var(--gv-transition-base),
    background var(--gv-transition-base),
    color var(--gv-transition-base),
    border-color var(--gv-transition-base);
}

.primary-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px 13px;
  border-radius: var(--radius-control);
  background: var(--gv-n0);
  color: #1f2937;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

.primary-btn:hover,
.option-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.option-btn:active,
.ghost-btn:active {
  transform: translateY(0);
}

.question-head {
  padding: 0 0 6px;
}

.question-head .eyebrow {
  margin-bottom: 5px;
}

.question-head p:last-child {
  margin-bottom: 0;
}

.options {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.option-btn {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px 10px 45px;
  border: 1px solid var(--gv-border-base);
  border-radius: 14px;
  background: var(--gv-n0);
  color: var(--gv-text-base);
  text-align: left;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.42;
  letter-spacing: 0;
  white-space: pre-line;
  box-shadow: var(--gv-shadow1);
}

.option-btn::before {
  content: attr(data-letter);
  position: absolute;
  left: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: var(--radius-control);
  background: var(--gv-n100);
  color: var(--gv-accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.option-btn:hover {
  background: var(--gv-n50);
  box-shadow: var(--gv-shadow2);
}

.option-btn.selected {
  border-color: rgba(27, 81, 136, 0.32);
  background: #f8fbff;
  box-shadow: var(--gv-shadow2);
}

.option-btn.processing {
  opacity: 0.72;
  cursor: default;
}

.option-btn:disabled,
.ghost-btn:disabled,
.primary-btn:disabled {
  cursor: default;
}

.option-btn.selected::before {
  background: var(--gv-dark-accent);
  color: var(--gv-text-inverse);
}

.feedback-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--gv-text-base);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.hint-box {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(27, 81, 136, 0.14);
  border-radius: 13px;
  background: #f8fbff;
}

.hint-box strong {
  color: var(--gv-accent);
  font-size: 12px;
  font-weight: 780;
}

.hint-box span {
  color: var(--gv-text-pale);
  font-size: 12px;
  line-height: 1.35;
}

textarea {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--gv-border-base);
  border-radius: 14px;
  outline: none;
  background: var(--gv-n50);
  color: var(--gv-text-base);
  font-size: 13px;
  line-height: 1.35;
}

textarea::placeholder {
  color: var(--gv-text-xpale);
}

textarea:focus {
  border-color: rgba(27, 81, 136, 0.42);
  background: var(--gv-n0);
  box-shadow: 0 0 0 4px rgba(27, 81, 136, 0.08);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.ghost-btn {
  min-height: 38px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--gv-n0);
  color: #1f2937;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.15;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

.ghost-btn:hover {
  background: var(--gv-n0);
  color: var(--gv-text-base);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 10px 22px -10px rgba(0, 0, 0, 0.42);
}

.done-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: var(--radius-control);
  background: rgba(5, 150, 105, 0.11);
  color: var(--gv-text-success);
  font-size: 30px;
  font-weight: 900;
  box-shadow: var(--gv-shadow1);
}

.summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.summary-item {
  padding: 10px 12px;
  border: 1px solid var(--gv-border-base);
  border-radius: 14px;
  background: var(--gv-n50);
  color: var(--gv-text-pale);
  font-size: 13px;
  line-height: 1.4;
}

.summary-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gv-text-base);
  font-size: 14px;
  font-weight: 800;
}

.examples {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.examples-title {
  color: var(--gv-text-base);
  font-size: 12px;
  font-weight: 760;
}

.example-item {
  padding: 10px 11px;
  border: 1px solid var(--gv-border-base);
  border-radius: 13px;
  background: var(--gv-n50);
}

.example-item.accepted {
  border-color: rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.06);
}

.example-item.rejected {
  border-color: rgba(220, 44, 38, 0.22);
  background: rgba(220, 44, 38, 0.04);
}

.example-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gv-accent);
  font-size: 11px;
  font-weight: 760;
}

.example-item p {
  margin: 0;
  color: var(--gv-text-pale);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.example-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.example-actions .ghost-btn {
  min-height: 31px;
  padding: 7px 9px;
  font-size: 11px;
}

.message-decision {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}

.message-decision .ghost-btn.selected {
  color: var(--gv-accent);
  box-shadow: 0 0 0 1px rgba(27, 81, 136, 0.28), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

.message-segments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.segment-title {
  margin: 0;
  color: var(--gv-text-base);
  font-size: 12px;
  font-weight: 800;
}

.segment-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid var(--gv-border-base);
  border-radius: 11px;
  background: var(--gv-n0);
}

.segment-row input {
  margin-top: 3px;
}

.segment-row span {
  color: var(--gv-text-pale);
  font-size: 11px;
  line-height: 1.35;
}

.segment-row strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gv-text-base);
  font-size: 11px;
}

.segment-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.segment-feedback button {
  min-height: 28px;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--gv-n0);
  color: var(--gv-text-pale);
  font-size: 11px;
  font-weight: 750;
  box-shadow: var(--gv-shadow1);
}

.segment-feedback button.selected {
  color: var(--gv-accent);
  box-shadow: 0 0 0 1px rgba(27, 81, 136, 0.28), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

.example-feedback {
  width: 100%;
  min-height: 58px;
  margin-top: 9px;
  padding: 10px 11px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.35;
  background: var(--gv-bg-front);
}

.error-card {
  border: 1px solid rgba(220, 44, 38, 0.18);
}

.loading-card {
  display: grid;
  justify-items: center;
  padding: 26px 18px;
  text-align: center;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border: 3px solid var(--gv-n200);
  border-top-color: var(--gv-dark-accent);
  border-radius: 999px;
  animation: spin 850ms linear infinite;
}

.loading-card h2 {
  font-size: 18px;
  font-weight: 730;
}

.loading-card p {
  max-width: 260px;
  font-size: 12px;
}

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

.hidden {
  display: none !important;
}

/* Sidebar compact mode: tuned for the Werfy Glide panel. */
.shell {
  padding: 4px 0 10px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 750;
}

h1 {
  font-size: 20px;
  font-weight: 760;
}

h2 {
  font-size: 18px;
  font-weight: 730;
}

p {
  font-size: 13px;
}

.progress-pill {
  min-width: 45px;
  padding: 6px 9px 7px;
  font-size: 12px;
}

.progress-track {
  height: 5px;
  margin-bottom: 9px;
}

.card,
.question {
  border-radius: 15px;
  box-shadow: 0 5px 14px -12px rgba(0, 0, 0, 0.24);
}

.card {
  padding: 14px;
}

.question {
  padding: 13px 13px 12px;
}

.mark-row {
  margin-bottom: 10px;
}

.mark-row span {
  width: 18px;
  height: 6px;
}

.option-btn {
  min-height: 34px;
  padding: 7px 10px 7px 36px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.34;
  box-shadow: var(--gv-shadow1);
}

.option-btn::before {
  left: 9px;
  top: 7px;
  width: 21px;
  height: 21px;
  font-size: 10px;
}

.feedback-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 720;
}

textarea {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.primary-btn,
.ghost-btn {
  font-size: 12px;
}

.primary-btn {
  margin-top: 12px;
  padding: 10px 13px 11px;
  background: var(--gv-n0);
  color: #1f2937;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

.ghost-btn {
  min-height: 34px;
  padding: 8px 10px;
  background: var(--gv-n0);
  color: #1f2937;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 7px 18px -8px rgba(0, 0, 0, 0.38);
}

body[data-screen="question"] .shell {
  padding: 0;
}

body[data-screen="question"] .topbar {
  align-items: center;
  margin-bottom: 7px;
}

body[data-screen="question"] #step-eyebrow,
body[data-screen="question"] #screen-title {
  display: none;
}

body[data-screen="question"] .progress-pill {
  justify-self: end;
  min-width: 48px;
  padding: 6px 9px 7px;
  font-size: 12px;
}

body[data-screen="question"] .progress-track {
  height: 5px;
  margin-bottom: 10px;
}

body[data-screen="question"] .question {
  box-shadow: var(--gv-shadow1);
  border-radius: 15px;
}

body[data-screen="question"] h2 {
  font-size: 18px;
  line-height: 1.18;
  font-weight: 730;
}

body[data-screen="question"] p {
  font-size: 12px;
  line-height: 1.34;
}

@media (max-width: 520px) {
  .shell {
    padding: 4px 0 10px;
  }

  .topbar {
    gap: 12px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  p {
    font-size: 13px;
  }

  .card {
    padding: 14px;
  }

  .question {
    padding: 13px 13px 12px;
  }

  .option-btn {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .shell {
    padding: 0;
  }

  .progress-pill {
    min-width: 42px;
    padding-inline: 8px;
    font-size: 11px;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 17px;
  }

  p {
    font-size: 12px;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
