:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink: #111827;
  --muted: #5f6b7a;
  --soft: #8892a0;
  --border: #dfe4ea;
  --border-strong: #c4ccd6;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --danger: #b42318;
  --danger-soft: #fff1f2;
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.07);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(223, 228, 234, 0.9);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px max(18px, calc((100% - 1180px) / 2));
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
}

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

.brand strong {
  font-size: 16px;
  line-height: 1.05;
}

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

.top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.top-nav a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 11px;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--ink);
}

main,
.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 34px 0 20px;
}

.home-copy,
.hero-visual {
  min-width: 0;
}

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

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.25;
}

.lead {
  max-width: 710px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 19px);
}

.search-panel {
  max-width: 760px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.search-panel label,
.field label,
.control-group > span,
.file-drop span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

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

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 300px;
  padding: 13px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 760;
  padding: 0 14px;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: #1f2937;
}

button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}

button.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

button.danger {
  border-color: #fecdd3;
  background: var(--danger-soft);
  color: var(--danger);
}

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

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-links a {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  padding: 7px 11px;
  text-decoration: none;
}

.quick-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-visual {
  margin: 0;
  align-self: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow);
  padding: 14px;
}

.hero-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  object-fit: contain;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px 0 22px;
}

.stats-strip div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 15px;
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  margin-bottom: 2px;
  font-size: 25px;
  line-height: 1.05;
}

.stats-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.ad-slot {
  display: grid;
  min-height: 86px;
  place-items: center;
  margin: 22px 0;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--soft);
  text-align: center;
}

.ad-slot span,
.ad-slot strong {
  display: block;
}

.ad-slot span {
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ad-slot strong {
  font-size: 13px;
}

.ad-slot-live {
  min-height: 100px;
  border-style: solid;
  background: transparent;
}

.ad-slot-live ins {
  width: 100%;
}

.directory {
  padding: 18px 0 4px;
}

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

.section-title h2 {
  margin-bottom: 0;
}

.category-block {
  margin-bottom: 26px;
  scroll-margin-top: 90px;
}

.category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.category-heading h2 {
  margin: 0;
  font-size: 22px;
}

.category-heading p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
}

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

.tool-card {
  position: relative;
  display: flex;
  min-height: 164px;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.tool-card::before {
  content: "";
  width: 34px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--category-accent, var(--accent));
}

.tool-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.tool-card h3 {
  font-size: 16px;
}

.tool-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-card.is-hidden {
  display: none;
}

.traffic {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
}

.traffic.high {
  background: var(--green-soft);
  color: #047857;
}

.traffic.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.content-band {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 28px;
  align-items: start;
  margin: 28px 0 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.content-band h2 {
  margin-bottom: 0;
  font-size: 30px;
}

.content-band p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.tool-page {
  padding-bottom: 42px;
}

.tool-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
  padding: 32px 0 6px;
}

.tool-intro h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(34px, 4.5vw, 58px);
}

.privacy-note {
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: var(--green-soft);
  color: #065f46;
  padding: 14px;
}

.privacy-note strong,
.privacy-note span {
  display: block;
}

.privacy-note span {
  margin-top: 4px;
  color: #047857;
  font-size: 13px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.tool-workspace,
.side-panel,
.faq-grid article,
.prose {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.tool-workspace {
  min-width: 0;
  box-shadow: var(--shadow);
}

.loading-panel {
  padding: 30px;
  color: var(--muted);
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 14px;
}

.tool-header h2 {
  margin: 0;
  font-size: 18px;
}

.tool-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tool-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 420px;
}

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

.field {
  min-width: 0;
  padding: 14px;
}

.field + .field {
  border-left: 1px solid var(--border);
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.field-head label {
  margin: 0;
}

.mini-actions {
  display: flex;
  gap: 6px;
}

.mini-actions button {
  min-height: 30px;
  border-radius: 6px;
  font-size: 12px;
  padding: 0 8px;
}

.output,
.diff-output,
.preview-output {
  min-height: 300px;
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  padding: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-output {
  font-family: var(--sans);
  white-space: normal;
}

.preview-output pre,
.preview-output code {
  font-family: var(--mono);
}

.preview-output pre {
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  padding: 12px;
}

.preview-output blockquote {
  margin-left: 0;
  border-left: 4px solid var(--border-strong);
  padding-left: 12px;
  color: var(--muted);
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 12px 14px;
}

.control-group {
  display: flex;
  min-width: 130px;
  flex: 1 1 150px;
  flex-direction: column;
  gap: 7px;
}

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

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.status-line {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  padding: 10px 14px;
}

.status-line.ok {
  color: var(--green);
}

.status-line.error {
  color: var(--danger);
}

.side-panel {
  padding: 16px;
}

.side-panel + .side-panel {
  margin-top: 12px;
}

.side-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.side-panel p,
.side-panel dd {
  color: var(--muted);
  font-size: 14px;
}

.side-panel dl,
.side-panel dd {
  margin: 0;
}

.side-panel dt {
  margin-top: 12px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.related-list a {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
}

.related-list a:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.faq-section {
  margin: 34px 0 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.faq-grid article {
  padding: 16px;
}

.faq-grid h3 {
  font-size: 16px;
}

.faq-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.simple-page {
  max-width: 820px;
  padding: 50px 0;
}

.prose {
  padding: clamp(22px, 5vw, 46px);
}

.prose h1 {
  font-size: clamp(36px, 5vw, 56px);
}

.prose h2 {
  margin-top: 26px;
  font-size: 24px;
}

.prose p {
  color: var(--muted);
  font-size: 17px;
}

.contact-box {
  display: inline-grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px 16px;
}

.contact-box a {
  color: var(--accent);
  font-weight: 760;
}

.file-drop {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 20px;
  text-align: center;
}

.file-drop input {
  max-width: 360px;
}

.image-preview {
  max-height: 220px;
  margin: 12px auto 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: contain;
}

.color-result {
  display: grid;
  gap: 10px;
}

.color-swatch {
  min-height: 110px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.kv-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.kv-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.kv-list dt {
  color: var(--soft);
  font-weight: 800;
}

.kv-list dd {
  margin: 0;
  font-family: var(--mono);
}

.diff-line {
  display: block;
  margin: 0 -6px;
  padding: 1px 6px;
}

.diff-line.added {
  background: var(--green-soft);
  color: #047857;
}

.diff-line.removed {
  background: var(--danger-soft);
  color: var(--danger);
}

.diff-line.same {
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
}

.site-footer p {
  margin: 4px 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 680;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

@media (max-width: 1060px) {
  .home-hero,
  .tool-layout {
    grid-template-columns: 1fr;
  }

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

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

  .privacy-note {
    max-width: 420px;
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .category-heading,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    position: static;
  }

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

  .home-hero,
  .content-band {
    grid-template-columns: 1fr;
  }

  .stats-strip,
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .field + .field {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .tool-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  .site-footer {
    width: min(1180px, calc(100% - 24px));
    max-width: calc(100vw - 24px);
    margin-inline: auto;
  }

  .site-header {
    gap: 12px;
    padding-inline: 0;
  }

  h1 {
    font-size: 34px;
    line-height: 1.06;
  }

  .brand small {
    display: none;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-width: 100%;
  }

  .top-nav a {
    min-width: 0;
    font-size: 13px;
    padding-inline: 8px;
    text-align: center;
  }

  .lead {
    font-size: 16px;
  }

  .quick-links {
    gap: 7px;
    max-width: 100%;
  }

  .quick-links a {
    max-width: 100%;
    font-size: 12px;
    padding: 6px 9px;
  }

  .search-row,
  .stats-strip,
  .tool-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 100%;
    overflow: hidden;
    padding: 8px;
  }

  .hero-visual img {
    aspect-ratio: 3 / 2;
  }

  .tool-card {
    min-height: 0;
  }

  .kv-list div {
    grid-template-columns: 1fr;
  }

  textarea,
  .output,
  .diff-output,
  .preview-output,
  .file-drop {
    min-height: 230px;
  }
}
