:root {
  color-scheme: light;
  --page: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #f1f4ef;
  --ink: #17211c;
  --muted: #5f6d64;
  --line: #d7ded5;
  --code: #101815;
  --code-surface: #edf2ec;
  --green: #117a4f;
  --amber: #b06416;
  --blue: #2f5f9d;
  --coral: #b84c3d;
  --shadow: 0 22px 60px rgba(23, 33, 28, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: end;
  padding: 56px 0 26px;
}

.eyebrow,
.pane-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: #2f3b34;
  font-size: 1.18rem;
  line-height: 1.55;
}

.support-copy,
.privacy-note p,
.content-grid p,
.method-section p,
.faq-section p,
footer p {
  color: var(--muted);
  line-height: 1.7;
}

.support-copy {
  max-width: 820px;
  margin: 16px 0 0;
}

.privacy-note {
  border-left: 4px solid var(--green);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.privacy-note h2 {
  font-size: 1rem;
}

.tool-shell {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.toolbar label,
.toggle-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

select,
button,
.file-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

select {
  padding: 0 36px 0 12px;
}

button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file-button:focus-visible {
  outline: 3px solid rgba(47, 95, 157, 0.3);
  outline-offset: 2px;
}

.primary-action {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.secondary-action {
  border-color: #b9c7bd;
  background: #e8eee7;
}

.ghost-button,
.file-button {
  background: #fbfcfa;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr);
  min-height: 520px;
}

.editor-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.output-pane {
  border-left: 1px solid var(--line);
}

.pane-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.pane-header h2 {
  margin: 0;
}

.pane-header span,
.status-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  min-height: 100%;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: var(--code-surface);
  color: var(--code);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 18px;
}

textarea.nowrap {
  white-space: pre;
  overflow: auto;
}

.action-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: #f8faf7;
}

.action-pane button {
  width: 100%;
}

.status-card {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-card.valid {
  border-color: rgba(17, 122, 79, 0.4);
}

.status-card.invalid {
  border-color: rgba(184, 76, 61, 0.45);
}

.status-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-card strong {
  color: var(--green);
  line-height: 1.2;
}

.status-card.invalid strong {
  color: var(--coral);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.metrics-strip article {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metrics-strip article:last-child {
  border-right: 0;
}

.metrics-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.metrics-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 1.35rem;
}

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

.examples-section,
.method-section,
.faq-section {
  padding: 44px 0 10px;
}

.example-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.example-list article {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.example-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.method-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  align-items: start;
}

.check-list {
  margin: 0;
  padding: 22px 22px 22px 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.7;
}

.faq-section details {
  border-top: 1px solid var(--line);
  background: transparent;
}

.faq-section summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 800;
}

.faq-section details p {
  max-width: 820px;
  margin: 0;
  padding: 0 0 18px;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 38px auto 0;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .content-grid,
  .method-section {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: auto;
  }

  .action-pane,
  .output-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  textarea {
    min-height: 300px;
  }

  .metrics-strip,
  .example-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    padding-top: 34px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar > :not(.visually-hidden),
  .toolbar label,
  .toolbar button,
  .file-button {
    width: 100%;
  }

  .pane-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-strip,
  .example-list {
    grid-template-columns: 1fr;
  }

  .metrics-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
