:root {
  --ink: #181b19;
  --muted: #686e69;
  --paper: #f4f1e9;
  --surface: #fffef9;
  --line: #d8d8cf;
  --green: #4d9f38;
  --green-dark: #2e7023;
  --green-soft: #e4f1dd;
  --signal: #b9ef53;
  --warm: #e9ddc8;
  --danger: #a84432;
  --radius: 18px;
  --shadow: 0 28px 80px rgba(25, 31, 27, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(24, 27, 25, 0.04) 50%, transparent 50.2%),
    var(--paper);
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(77, 159, 56, 0.28);
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(390px, 0.95fr) minmax(460px, 1.05fr);
  min-height: 100vh;
}

.briefing {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(38px, 6vw, 88px);
  background: var(--ink);
  color: #f8f7f0;
}

.eyebrow {
  margin: 0 0 48px;
  color: var(--signal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.briefing h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(44px, 5.7vw, 82px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.briefing h1 em {
  color: var(--signal);
  font-family: Georgia, serif;
  font-weight: 400;
}

.briefing__lead {
  max-width: 530px;
  margin: 32px 0 0;
  color: #b9bdb9;
  font-size: 17px;
  line-height: 1.45;
}

.formula {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 64px 0;
  color: var(--signal);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.formula i {
  color: #727a73;
  font-style: normal;
}

.briefing__notes {
  max-width: 520px;
  padding-top: 22px;
  border-top: 1px solid #3a403b;
  color: #aeb3ae;
  font-size: 13px;
  line-height: 1.42;
}

.briefing__notes p {
  margin: 0 0 8px;
}

.briefing__notes strong {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.device-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 38px;
}

.device {
  display: flex;
  flex-direction: column;
  width: min(100%, 430px);
  height: min(860px, calc(100vh - 76px));
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(24, 27, 25, 0.18);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  justify-self: start;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.07em;
  text-decoration: none;
}

.wordmark strong {
  color: var(--green);
}

.prototype-badge {
  justify-self: end;
  padding: 5px 7px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.icon-button {
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 23px;
}

.icon-button:hover {
  background: var(--paper);
}

.progress {
  padding: 14px 22px 0;
}

.progress__line {
  height: 3px;
  overflow: hidden;
  background: #e3e3dc;
}

.progress__line span {
  display: block;
  width: 14.285%;
  height: 100%;
  background: var(--green);
  transition: width 280ms ease;
}

.progress p {
  display: flex;
  gap: 5px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.07em;
}

.progress p b {
  margin-left: auto;
  color: var(--ink);
}

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 28px 22px 24px;
  scrollbar-width: thin;
}

.screen__intro {
  margin-bottom: 24px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.screen h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.screen h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.subline {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intent-input,
.text-input,
.select-input,
.message-input {
  width: 100%;
  border: 1px solid #bfc3bc;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.intent-input {
  min-height: 112px;
  padding: 15px;
  resize: none;
  font-size: 18px;
  line-height: 1.35;
}

.text-input,
.select-input {
  height: 46px;
  padding: 0 12px;
  font-size: 14px;
}

.message-input {
  min-height: 116px;
  padding: 13px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}

.field-grid .field--wide {
  grid-column: 1 / -1;
}

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

.example-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

.example-chip span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
}

.example-chip:hover,
.example-chip.is-selected {
  border-color: var(--green);
  background: #f4faef;
}

.button-row {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

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

.button--wide {
  width: 100%;
}

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

.button--green {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.intent-summary {
  margin-bottom: 18px;
  padding: 16px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.intent-summary p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.network-options {
  display: grid;
  gap: 10px;
}

.network-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
}

.network-option:has(input:checked) {
  border-color: var(--green);
  background: #f4faef;
}

.network-option input {
  position: absolute;
  opacity: 0;
}

.network-level {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.network-option:has(input:checked) .network-level {
  background: var(--green);
}

.network-copy strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 14px;
}

.network-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.notice {
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid var(--warm);
  border-radius: 9px;
  background: #faf6ed;
  color: #625747;
  font-size: 10.5px;
  line-height: 1.4;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
}

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

.match-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.match-card__top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.match-card__name strong {
  display: block;
  font-size: 14px;
}

.match-card__name span {
  color: var(--muted);
  font-size: 10px;
}

.degree {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 700;
}

.match-reason {
  margin: 12px 0 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.match-tags span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
}

.text-link {
  display: inline-flex;
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--green);
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.person-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.person-hero .avatar {
  width: 58px;
  height: 58px;
  background: var(--green-soft);
}

.person-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.reason {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reason__icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
}

.reason strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}

.reason p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.request-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.request-recipient p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.request-recipient span {
  color: var(--muted);
  font-size: 10px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 10px auto 22px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--ink);
  font-size: 29px;
  font-weight: 700;
}

.success-copy {
  text-align: center;
}

.success-copy h2 {
  max-width: 310px;
  margin: 0 auto;
}

.success-copy .subline {
  max-width: 310px;
  margin: 12px auto 0;
}

.feedback {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.feedback p {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.feedback__buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.feedback__buttons button {
  min-width: 90px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.feedback__buttons button.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.test-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 900px) {
  body {
    background: var(--surface);
  }

  .workspace {
    display: block;
  }

  .briefing {
    display: none;
  }

  .device-wrap {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .device {
    width: 100%;
    height: 100vh;
    min-height: 620px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 390px) {
  .app-header {
    padding-inline: 16px;
  }

  .progress,
  .screen {
    padding-inline: 18px;
  }

  .screen h2 {
    font-size: 27px;
  }

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

  .field-grid .field--wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
