:root {
  --bg: #f7f4ed;
  --panel: #fffdf8;
  --ink: #1f2933;
  --muted: #697386;
  --line: #d8d2c4;
  --accent: #176b5b;
  --accent-soft: #d7eee6;
  --warn: #8a5b13;
  --warn-soft: #f7e7bf;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: calc(100vh - 56px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.state-switch {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  gap: 8px;
}

.state-button {
  height: 44px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.state-button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  min-height: calc(100vh - 200px);
}

.input-panel,
.output-panel {
  padding: 28px;
}

.input-panel {
  border-right: 1px solid var(--line);
  background: #fbf7ef;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-title span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
}

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

fieldset {
  border: 1px solid var(--line);
  padding: 14px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
}

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

.chips label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.82rem;
}

.chips input {
  width: auto;
}

.state-note {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  color: #123c34;
  font-weight: 700;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.check-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.check-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.check-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.check-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.label-preview {
  margin-bottom: 22px;
  padding: 22px;
  width: min(100%, 520px);
  border: 2px solid var(--ink);
  background: #ffffff;
}

.label-brand {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.label-preview h3 {
  margin: 6px 0 14px;
  font-size: 1.8rem;
  line-height: 1.05;
}

.label-preview p {
  margin-bottom: 8px;
  line-height: 1.42;
}

.label-preview .disclaimer {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 800;
}

.source-box {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbf7ef;
}

.source-box h2,
.cta-panel h2 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.source-box p,
.cta-panel p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.source-box a {
  display: inline-block;
  margin: 0 10px 8px 0;
  color: var(--accent);
  font-weight: 800;
}

.last-checked {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  background: var(--warn-soft);
  border: 1px solid #e7c46c;
}

.cta-panel p {
  margin-bottom: 0;
}

.included-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.review-section {
  padding: 28px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.lead-sm {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.55;
}

.review-form {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin-top: 18px;
}

.review-form button {
  width: fit-content;
  min-width: 170px;
  height: 46px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.review-form button:disabled,
.cta-panel button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.packet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.review-card {
  max-width: 920px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.review-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.review-status span {
  padding: 6px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.review-status strong {
  font-size: 1.1rem;
}

.review-card pre {
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbf7ef;
  overflow-x: auto;
}

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

.review-card h3 {
  margin: 14px 0 8px;
  font-size: 0.98rem;
}

.review-card ul {
  margin-top: 0;
  padding-left: 18px;
  color: var(--muted);
}

.source-list a {
  color: var(--accent);
  font-weight: 800;
}

.cta-panel button {
  min-width: 150px;
  height: 46px;
  border: 0;
  background: var(--warn);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.email-inline {
  min-width: 220px;
  margin: 0;
}

.form-message {
  width: 100%;
  margin: 0;
  color: var(--warn);
  font-size: 0.88rem;
  font-weight: 800;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.top-link,
.primary-link {
  color: var(--accent);
  font-weight: 900;
}

.top-link {
  align-self: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  text-decoration: none;
}

.landing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding: 28px;
}

.landing-main {
  max-width: 780px;
}

.lead {
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.55;
}

.landing-main h2 {
  margin: 28px 0 10px;
  font-size: 1.25rem;
}

.landing-main p {
  color: var(--muted);
  line-height: 1.62;
}

.landing-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.cta-panel.stacked {
  display: grid;
  align-items: stretch;
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
  }

  .topbar {
    flex-direction: column;
    padding: 22px;
  }

  .landing-layout {
    grid-template-columns: 1fr;
    padding: 22px;
  }

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

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .input-panel,
  .output-panel {
    padding: 22px;
  }

  .split,
  .cta-panel,
  .review-columns {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}
