:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-strong: #eef3f6;
  --ink: #15202b;
  --muted: #66727f;
  --line: #d8e0e6;
  --accent: #0e7c66;
  --accent-dark: #075f4d;
  --accent-soft: #dff2ed;
  --coral: #d85b43;
  --gold: #d6a429;
  --warn: #a56200;
  --shadow: 0 18px 50px rgba(21, 32, 43, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

button,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.landing {
  max-width: 1380px;
  min-height: calc(88vh - 56px);
  margin: 0 auto 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  margin-bottom: 22px;
}

.compact-brand {
  font-size: 1rem;
  font-weight: 850;
}

.brand-logo {
  display: block;
  width: clamp(168px, 19vw, 224px);
  height: auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-try-button {
  min-width: 86px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(420px, 0.9fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 18px 0 32px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.96;
}

.hero-subtitle {
  max-width: 620px;
  color: #465463;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  margin-top: 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-try-button,
.hero-sample-button {
  width: auto;
  min-width: 154px;
  padding-inline: 18px;
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.proof-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #40515e;
  font-size: 0.86rem;
  font-weight: 750;
  padding: 8px 11px;
}

.trust-note {
  max-width: 650px;
  margin-top: 16px;
  border-left: 3px solid var(--accent);
  color: #40515e;
  font-size: 0.92rem;
  line-height: 1.5;
  padding-left: 12px;
}

.trust-note strong {
  color: var(--ink);
}

.hero-preview {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(216, 91, 67, 0.09), transparent 36%),
    linear-gradient(315deg, rgba(214, 164, 41, 0.13), transparent 32%),
    #ffffff;
  box-shadow: 0 26px 70px rgba(21, 32, 43, 0.16);
  padding: clamp(16px, 2vw, 24px);
  overflow: hidden;
}

.hero-preview::before {
  content: "";
  position: absolute;
  inset: auto -18% -24% 38%;
  height: 140px;
  background: var(--accent);
  opacity: 0.08;
  transform: rotate(-8deg);
}

.preview-toolbar {
  display: flex;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.preview-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.preview-toolbar span:nth-child(1) {
  background: var(--coral);
}

.preview-toolbar span:nth-child(2) {
  background: var(--gold);
}

.preview-toolbar span:nth-child(3) {
  background: var(--accent);
}

.preview-before,
.preview-after {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
}

.preview-before small,
.preview-after small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.preview-before p {
  color: #465463;
  line-height: 1.5;
}

.preview-after {
  border-color: rgba(14, 124, 102, 0.35);
  background: #fbfefd;
}

.preview-after strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
}

.preview-after ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.preview-after li {
  border-left: 3px solid var(--accent);
  color: #263541;
  line-height: 1.4;
  padding-left: 10px;
}

.proof-section {
  max-width: 1380px;
  margin: 0 auto 26px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: clamp(1.35rem, 2.3vw, 2.1rem);
}

.section-header p {
  max-width: 560px;
  color: #40515e;
  line-height: 1.5;
}

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

.example-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
}

.example-card > span {
  color: var(--accent);
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.example-split {
  display: grid;
  gap: 12px;
}

.example-split strong {
  display: block;
  margin-bottom: 6px;
}

.example-split p,
.example-split li {
  color: #40515e;
  font-size: 0.92rem;
  line-height: 1.45;
}

.example-split ul {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.example-split li {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.workspace {
  max-width: 1380px;
  margin: 0 auto;
  scroll-margin-top: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  display: block;
  width: 48px;
  height: 48px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p,
.panel-header p,
#outputState {
  color: var(--muted);
  margin-top: 5px;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.input-panel,
.output-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 132px);
  padding: 18px;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.output-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.counter {
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

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

.field-control {
  display: grid;
  gap: 7px;
}

.field-control span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 0 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-height: 42px;
  padding: 5px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.segment {
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segment.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(21, 32, 43, 0.08);
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 420px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #fbfcfd;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.example-row,
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.ghost-button,
.ghost-link,
.secondary-button {
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-strong);
  padding: 10px 12px;
  min-height: 40px;
}

.chip:hover,
.ghost-button:hover,
.ghost-link:hover,
.secondary-button:hover {
  background: #e2ebef;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

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

.small-button {
  min-height: 34px;
  padding: 7px 10px;
}

.hero-actions .primary-button,
.hero-actions .secondary-button {
  width: auto;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: var(--surface-strong);
  border-radius: 8px;
}

.tab {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(21, 32, 43, 0.08);
}

.result-box {
  flex: 1;
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.empty-state {
  min-height: 380px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  width: min(480px, 100%);
}

.empty-preview span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-weight: 850;
}

.result-content {
  line-height: 1.55;
}

.doc-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.doc-title span {
  color: var(--accent);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.result-content h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0;
}

.result-content p {
  margin: 0 0 12px;
}

.lead {
  color: #263541;
  font-size: 1.02rem;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
}

.doc-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 9px;
}

.doc-section {
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
}

.doc-section h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.doc-section ul,
.doc-section ol {
  margin: 0;
  padding-left: 22px;
}

.doc-section li {
  margin: 8px 0;
}

.email-draft {
  white-space: pre-wrap;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: #263541;
  font: inherit;
  line-height: 1.55;
}

.notice {
  margin-top: 14px;
  color: var(--warn);
  font-size: 0.92rem;
}

.pro-section {
  max-width: 1380px;
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(14, 124, 102, 0.28);
  border-radius: 8px;
  background: #fbfefd;
  padding: clamp(18px, 3vw, 28px);
}

.pro-section h2 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.pro-section p {
  max-width: 760px;
  color: #40515e;
  line-height: 1.55;
  margin-top: 8px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 190px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

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

.trust-section {
  max-width: 1380px;
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: clamp(18px, 3vw, 28px);
  scroll-margin-top: 18px;
}

.section-kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.trust-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(420px, 1.22fr);
  gap: clamp(18px, 4vw, 44px);
}

.trust-layout h2 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.trust-layout p {
  color: #40515e;
  line-height: 1.55;
  margin-top: 10px;
}

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

.trust-item {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.trust-item strong {
  display: block;
}

.trust-item p {
  font-size: 0.92rem;
  margin-top: 5px;
}

.history-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-header p,
.history-empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  display: grid;
  gap: 5px;
  padding: 10px;
  text-align: left;
}

.history-item:hover {
  border-color: rgba(14, 124, 102, 0.45);
  background: #ffffff;
}

.history-item strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.history-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer {
  max-width: 1380px;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 2px 0;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 920px) {
  .app-shell {
    padding: 18px;
  }

  .landing {
    min-height: auto;
    margin-bottom: 22px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding: 18px 0 30px;
  }

  .hero-copy h1 {
    font-size: clamp(2.45rem, 11vw, 4.7rem);
  }

  .section-header,
  .pro-section,
  .topbar,
  .panel-header,
  .history-header,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .example-grid,
  .trust-layout,
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .output-panel {
    min-height: auto;
  }

  textarea,
  .result-box {
    min-height: 320px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 520px) {
  .app-shell {
    padding: 12px;
  }

  .landing-nav {
    margin-bottom: 12px;
  }

  .nav-actions {
    gap: 8px;
  }

  .hero-grid {
    gap: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(2.15rem, 11.8vw, 3rem);
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-top: 16px;
  }

  .hero-actions {
    display: grid;
    margin-top: 22px;
  }

  .hero-try-button,
  .hero-sample-button {
    width: 100%;
  }

  .hero-preview {
    gap: 10px;
    padding: 12px;
  }

  .proof-row,
  .preview-toolbar {
    display: none;
  }

  .preview-before {
    display: none;
  }

  .preview-after {
    padding: 14px;
  }

  .preview-after ul {
    gap: 8px;
    margin-top: 12px;
  }

  .preview-after li {
    font-size: 0.92rem;
  }

  .preview-after li:nth-child(3) {
    display: none;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

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

  .empty-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
