:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #f0f3f8;
  --ink: #182033;
  --muted: #657086;
  --line: #dbe1eb;
  --accent: #e84343;
  --accent-dark: #c72f37;
  --blue: #276ef1;
  --green: #168f63;
  --shadow: 0 18px 50px rgba(24, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.topnav,
.top-actions,
.hero-actions,
.action-row,
.footer,
.preview-stats {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}

.topnav {
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover,
.footer a:hover {
  color: var(--accent);
}

.top-actions,
.hero-actions,
.action-row {
  gap: 10px;
}

.language-select,
.control-group select,
.control-grid select,
.control-grid input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 750;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

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

.button.secondary,
.button.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 36px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 24px 34px;
}

.hero-copy h1,
.tool-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p,
.tool-hero p,
.section-heading p,
.split-section p,
.static-page p {
  color: var(--muted);
  max-width: 720px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-preview {
  min-height: 360px;
  display: grid;
  place-items: center;
}

.preview-window {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

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

.preview-image {
  height: 220px;
  background:
    linear-gradient(135deg, rgba(232, 67, 67, 0.9), rgba(39, 110, 241, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='420' viewBox='0 0 640 420'%3E%3Crect width='640' height='420' fill='%23f5f7fb'/%3E%3Ccircle cx='142' cy='120' r='72' fill='%23ffd166'/%3E%3Cpath d='M0 350 170 210l98 80 96-92 276 184v38H0z' fill='%232e8b57'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.preview-stats {
  justify-content: space-between;
  padding: 18px;
}

.preview-stats strong {
  color: var(--green);
}

.ad-band {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
  margin: 20px auto;
  max-width: 1180px;
  border: 1px dashed #b8c2d6;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.ad-unit .adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.ad-band span {
  font-size: 12px;
  text-transform: uppercase;
}

.section,
.tool-hero,
.workspace,
.static-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 24px;
}

.section-heading {
  margin-bottom: 22px;
}

.section h2,
.static-page h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

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

.tool-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-card {
  min-height: 190px;
  padding: 22px;
}

.tool-card:hover {
  border-color: rgba(232, 67, 67, 0.45);
  box-shadow: 0 12px 30px rgba(24, 32, 51, 0.08);
}

.tool-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 900;
}

.tool-card h3 {
  margin: 16px 0 6px;
}

.tool-card p {
  color: var(--muted);
  margin: 0;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-list span {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.tool-hero {
  text-align: center;
}

.tool-hero p {
  margin-left: auto;
  margin-right: auto;
}

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

.panel {
  padding: 20px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.panel-header span,
.status,
.empty-results,
.result-meta {
  color: var(--muted);
  font-size: 14px;
}

.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 190px;
  border: 2px dashed #b8c2d6;
  border-radius: 8px;
  background: #fafbfd;
  text-align: center;
  cursor: pointer;
  padding: 22px;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #fff5f5;
}

.dropzone input {
  display: none;
}

.drop-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.dropzone small {
  color: var(--muted);
}

.control-group,
.control-grid {
  margin-top: 16px;
}

.control-group,
.control-grid label {
  display: grid;
  gap: 7px;
}

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

.control-grid label span,
.control-group label {
  font-size: 13px;
  font-weight: 800;
}

input[type="range"] {
  accent-color: var(--accent);
}

.action-row {
  margin-top: 18px;
}

.results-list {
  display: grid;
  gap: 12px;
}

.empty-results {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 24px;
}

.result-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-item img {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-strong);
}

.result-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  margin-top: 4px;
}

.static-page {
  min-height: 68vh;
}

.seo-copy {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer {
  justify-content: space-between;
  gap: 16px;
  margin: 44px auto 0;
  max-width: 1180px;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer nav {
  display: flex;
  gap: 16px;
}

@media (max-width: 850px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    padding: 14px 18px;
  }

  .topnav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .home-hero,
  .workspace,
  .split-section {
    grid-template-columns: 1fr;
  }

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

  .hero-copy h1,
  .tool-hero h1 {
    font-size: 42px;
  }

  .ad-band {
    margin-left: 18px;
    margin-right: 18px;
    padding: 14px;
    text-align: center;
  }

  .result-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .result-item .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .top-actions,
  .hero-actions,
  .action-row {
    width: 100%;
  }

  .button,
  .language-select {
    width: 100%;
  }

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