:root {
  color-scheme: light;
  --ink: #202426;
  --muted: #687177;
  --line: #d9ded8;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --field: #f6f8f5;
  --accent: #0f766e;
  --accent-dark: #0b534e;
  --gold: #bd7c26;
  --rose: #b85058;
  --blue: #486f9d;
  --shadow: 0 18px 50px rgba(32, 36, 38, 0.13);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(15, 118, 110, 0.06) 0 1px, transparent 1px 100%),
    var(--paper);
  background-size: 44px 44px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(32, 36, 38, 0.1);
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions,
.preview-toolbar,
.repeatable-row,
.packet-cover,
.packet-meta,
.asset-card,
.asset-thumb {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(390px, 0.74fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  padding: clamp(18px, 4vw, 40px);
}

.builder,
.preview-panel {
  min-width: 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.beta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(189, 124, 38, 0.36);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 247, 235, 0.96), rgba(255, 255, 255, 0.86));
  box-shadow: 0 14px 34px rgba(32, 36, 38, 0.08);
}

.beta-banner strong,
.beta-banner p,
.banner-kicker {
  display: block;
}

.banner-kicker {
  margin-bottom: 5px;
  color: #8a5318;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.beta-banner strong {
  font-size: 1.06rem;
}

.beta-banner p {
  margin: 5px 0 0;
  color: #65594d;
  line-height: 1.45;
}

.price-chip {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(189, 124, 38, 0.34);
  border-radius: 999px;
  background: #fff;
  color: #8a5318;
  font-weight: 900;
}

.signup-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 0.62fr);
  gap: 18px;
  align-items: center;
  max-width: 920px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 38px rgba(32, 36, 38, 0.09);
}

.signup-copy h2 {
  max-width: 520px;
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.signup-copy p:last-child,
.preview-signup p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.signup-embed,
.preview-signup .ml-embedded {
  min-width: 0;
}

.ml-embedded {
  width: 100%;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 700px;
  margin-bottom: 12px;
  font-size: clamp(2.15rem, 5vw, 4.65rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.packet-form {
  display: grid;
  gap: 16px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

legend {
  padding: 0 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd7d0;
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
}

.segmented label {
  position: relative;
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: block;
  min-height: 36px;
  padding: 9px 8px;
  border-radius: 6px;
}

.segmented input:checked + span {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(32, 36, 38, 0.16);
}

.repeatable-list {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.repeatable-row {
  gap: 8px;
}

.primary-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.primary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button {
  min-height: 42px;
  padding: 0 15px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

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

.text-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.icon-button.small {
  flex: 0 0 42px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-zone {
  place-items: center;
  min-height: 116px;
  padding: 18px;
  border: 1px dashed #aeb8b1;
  border-radius: var(--radius);
  background: rgba(246, 248, 245, 0.75);
  color: var(--muted);
  text-align: center;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.upload-zone.is-dragging {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
}

.asset-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.asset-card {
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.asset-card span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-thumb {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  justify-content: center;
  border-radius: 6px;
  background: #e8eee9;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.preview-panel {
  position: sticky;
  top: 92px;
}

.preview-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.preview-toolbar h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.preview-price {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.confidence-score {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 900;
}

.packet {
  overflow: hidden;
  border: 1px solid #cbd3cd;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.preview-signup {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.preview-signup strong {
  display: block;
  margin-bottom: 4px;
}

.packet-cover {
  justify-content: space-between;
  gap: 16px;
  min-height: 176px;
  padding: clamp(20px, 4vw, 30px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), transparent 42%),
    linear-gradient(90deg, var(--ink), #32413f);
  color: #fff;
}

.packet-label {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.packet-cover h2 {
  max-width: 420px;
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.packet-cover p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.status-pill {
  align-self: flex-start;
  flex: 0 0 auto;
  max-width: 155px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.packet-meta {
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.packet-meta div {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.packet-meta div:last-child {
  border-right: 0;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.packet-section {
  padding: 20px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
}

.packet-section:last-child {
  border-bottom: 0;
}

.packet-section h3 {
  margin-bottom: 10px;
  font-size: 0.94rem;
}

.packet-section p {
  margin-bottom: 0;
  color: #4d575c;
  line-height: 1.55;
}

.proof-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proof-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #3f474b;
  line-height: 1.45;
}

.proof-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.proof-list li.empty-state {
  display: block;
}

.proof-list li.empty-state::before {
  display: none;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evidence-tile {
  display: grid;
  min-height: 90px;
  place-items: end start;
  padding: 9px;
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.76), transparent 48%),
    #dfe8e2;
  color: #26302f;
  font-size: 0.72rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.evidence-tile:nth-child(2) {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.72), transparent 48%),
    #eadfce;
}

.evidence-tile:nth-child(3) {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.72), transparent 48%),
    #dbe4ed;
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .preview-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .beta-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand small {
    display: none;
  }

  .primary-button {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .field-grid,
  .segmented,
  .packet-meta {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .segmented {
    display: grid;
  }

  .packet-cover,
  .packet-meta {
    display: grid;
  }

  .packet-meta div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .packet-meta div:last-child {
    border-bottom: 0;
  }

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

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .builder,
  .preview-toolbar {
    display: none;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .preview-panel {
    position: static;
  }

  .packet {
    border: 0;
    box-shadow: none;
  }
}
