:root {
  color-scheme: dark;
  --bg: #0f1412;
  --surface: #151b19;
  --surface-2: #1c2421;
  --border: #2d3a35;
  --text: #edf4f0;
  --muted: #9eaaa5;
  --accent: #38d996;
  --accent-2: #7cc7ff;
  --warn: #f0b45b;
  --danger: #ff7a7a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 0;
  background: rgba(15, 20, 18, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(45, 58, 53, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #07110d;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}

.workspace {
  margin-top: 22px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #17201c, #111714);
  box-shadow: var(--shadow);
}

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

.workspace-heading > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4.5vw, 4.4rem);
  line-height: 1.02;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.hero-copy {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.status-chip {
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  text-align: center;
  background: #101613;
}

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

.tool-card {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.tool-card strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.2;
}

.tool-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: #527166;
  outline: none;
}

.tool-card.active {
  border-color: var(--accent);
  background: #13251d;
  box-shadow: inset 0 0 0 1px rgba(56, 217, 150, 0.35);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(21, 27, 25, 0.86);
}

.upload-panel,
.preview-panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.panel-title-row h2 {
  margin-bottom: 0;
}

.panel-title-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.small-button,
.secondary-button,
.primary-button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.small-button {
  padding: 8px 10px;
  color: var(--muted);
  background: #121816;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #567066;
  border-radius: 8px;
  background: #111815;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #13251d;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-main {
  font-size: 1.2rem;
  font-weight: 800;
}

.drop-sub {
  max-width: 320px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

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

.file-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #111815;
}

.file-pill strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.88rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f1513;
  color: var(--text);
}

.field input[type="range"] {
  min-height: 30px;
  padding: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #07110d;
  font-weight: 800;
}

.secondary-button {
  background: #101613;
  color: var(--text);
}

.primary-button:disabled,
.secondary-button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.preview-box {
  margin: 0;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #111815 25%, transparent 25%),
    linear-gradient(-45deg, #111815 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #111815 75%),
    linear-gradient(-45deg, transparent 75%, #111815 75%);
  background-color: #1a211f;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.preview-frame img {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-frame.has-image img {
  display: block;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.preview-frame.has-image .empty-state {
  display: none;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.metric {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111815;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.checklist {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.check-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #101613;
}

.check-item.pass {
  border-color: rgba(56, 217, 150, 0.45);
  color: #baf6dc;
}

.check-item.warn {
  border-color: rgba(240, 180, 91, 0.48);
  color: #ffe1aa;
}

.check-item.fail {
  border-color: rgba(255, 122, 122, 0.55);
  color: #ffc1c1;
}

.seo-section,
.info-band {
  margin: 28px 0;
}

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

.page-list a {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}

.page-list a:hover,
.page-list a:focus-visible {
  border-color: var(--accent-2);
  outline: none;
}

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

.info-band > div {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.info-band p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.site-footer a {
  margin-left: 14px;
  color: var(--text);
}

.legal-page {
  max-width: 820px;
  margin: 34px auto 52px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.legal-page h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.legal-page h2 {
  margin-top: 26px;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.7;
}

.contact-card {
  display: grid;
  gap: 6px;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101613;
}

.contact-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.contact-card strong {
  font-size: 1.1rem;
}

.tool-landing {
  margin: 34px 0 56px;
}

.tool-hero {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #17201c, #111714);
  box-shadow: var(--shadow);
}

.tool-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #07110d;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.content-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.content-card p {
  color: var(--muted);
  line-height: 1.65;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(6, 9, 8, 0.76);
  backdrop-filter: blur(6px);
}

.busy-overlay.active {
  display: grid;
}

.busy-overlay p {
  margin: 12px 0 0;
  font-weight: 800;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(237, 244, 240, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .tool-grid,
  .page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-layout,
  .info-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

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

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px;
    overflow-x: visible;
  }

  .nav-links a {
    padding: 8px 10px;
  }

  .workspace {
    padding: 16px;
  }

  .tool-grid,
  .page-list,
  .preview-grid,
  .metrics,
  .two-col,
  .action-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.95rem;
    line-height: 1.08;
  }

  .hero-copy {
    max-width: 280px;
    font-size: 0.98rem;
  }

  .site-footer {
    flex-direction: column;
  }
}
