:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --accent: #111827;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

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

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a,
.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #111827;
}

/* Product introduction */

.page-intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

/* Main tool area */

.tool-section {
  padding-bottom: 56px;
}

.workspace {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.045);
}

.workspace h2 {
  margin-top: 0;
}

.workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.workspace-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.workspace-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Formatter options */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
}

.option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
}

.tab-width {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
}

.tab-width select,
.toolbar select {
  min-height: 36px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.tab-width select:focus,
.toolbar select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.13);
  border-color: #93c5fd;
}

/* Editor panels */

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.editor-panel {
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.panel-heading label,
.panel-heading strong,
.panel-heading span {
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover:not(:disabled) {
  color: var(--blue);
}

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

textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  outline: none;
  background: #fbfcfe;
  color: #253047;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea::placeholder {
  color: #9ca3af;
}

#outputText {
  background: #f9fafb;
}

/* Action buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

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

.button-primary {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  border-color: #293548;
  background: #293548;
}

.button-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.button-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

/* Privacy notice */

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 30px;
  padding: 14px 16px;
  border: 1px solid #dcfce7;
  border-radius: 11px;
  background: #f0fdf4;
}

.privacy-icon {
  flex: 0 0 auto;
  font-size: 17px;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
}

.privacy-note strong {
  color: #14532d;
}

/* Instructions and content */

.content-section {
  padding: 10px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 46px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.content-grid h2,
.faq-section h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.content-grid p,
.content-grid li,
.faq-section p {
  color: #4b5563;
  font-size: 14px;
}

.content-grid p {
  margin: 8px 0;
}

.content-grid ol,
.content-grid ul {
  padding-left: 20px;
}

.content-grid li {
  padding: 4px 0;
}

.faq-section {
  max-width: 860px;
}

.faq-section .eyebrow {
  margin-bottom: 8px;
}

.faq-section details {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.faq-section summary:hover {
  color: var(--blue);
}

.faq-section p {
  margin: 8px 0 2px;
  line-height: 1.7;
}

/* Related tools */

.related-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.related-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0;
}

.related-inner h2 {
  margin: 0 0 5px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.related-inner p:not(.eyebrow) {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
}

.related-inner .eyebrow {
  margin-bottom: 5px;
}

/* Unified footer */

.site-footer {
  padding: 24px 0;
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  font-size: 12px;
}

/* Tablet */

@media (max-width: 800px) {
  .header-inner {
    min-height: 0;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 14px 0;
  }

  .top-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-left: 0;
  }

  .page-intro {
    padding: 40px 0 24px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .workspace {
    padding: 16px;
  }

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

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

  textarea {
    min-height: 220px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .related-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .related-inner .button {
    width: 100%;
  }
}

/* Mobile */

@media (max-width: 520px) {
  .container,
  .header-inner {
    width: calc(100% - 28px);
  }

  .brand-logo {
    width: 155px;
  }

  .top-nav {
    gap: 10px 15px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro h1 {
    font-size: 34px;
  }

  .trust-points {
    gap: 8px 14px;
  }

  .workspace {
    padding: 14px;
  }

  .workspace-heading {
    flex-direction: column;
  }

  .options {
    gap: 10px 14px;
  }

  .tab-width {
    width: 100%;
    justify-content: space-between;
  }

  .actions {
    gap: 8px;
  }

  .actions .button {
    flex: 1 1 auto;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-inner nav {
    gap: 10px 16px;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
