:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f8;
  --ink: #161c28;
  --text: #3a4657;
  --muted: #677487;
  --line: rgba(22, 28, 40, 0.18);
  --green: #197a56;
  --teal: #146f7a;
  --orange: #d96b1d;
  --shadow-soft: 0 16px 40px rgba(22, 28, 40, 0.08);
  --shadow-panel: 0 18px 44px rgba(22, 28, 40, 0.1);
  --shadow-lift: 0 12px 26px rgba(22, 28, 40, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

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

.narrow {
  width: min(780px, 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 247, 251, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-row,
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand,
.site-nav a,
.text-link {
  text-decoration: none;
}

.brand {
  font-weight: 800;
  color: var(--ink);
}

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

.site-nav a {
  font-weight: 700;
  color: var(--muted);
}

.site-nav a.active {
  color: var(--ink);
}

.hero,
.page-hero {
  padding: 72px 0 48px;
}

.hero {
  background:
    linear-gradient(135deg, rgba(25, 122, 86, 0.1), rgba(20, 111, 122, 0.08)),
    var(--surface);
  border-bottom: 2px solid var(--line);
}

.page-hero {
  background: var(--surface-alt);
  border-bottom: 2px solid var(--line);
}

.hero-copy {
  margin-bottom: 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  max-width: 12ch;
}

.lead {
  margin: 18px 0 0;
  max-width: 68ch;
  font-size: 18px;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section {
  padding: 56px 0;
}

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

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.article-stack {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.panel ul,
.panel ol,
.callout ul,
.callout ol {
  margin: 14px 0 0;
  padding-left: 20px;
}

.panel p + p,
.callout p + p {
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.button.primary {
  background: var(--green);
  color: #fff;
  border-color: rgba(12, 72, 49, 0.28);
}

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

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

.text-link {
  color: var(--teal);
  font-weight: 800;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.tool-surface {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-panel);
}

.tool-controls,
.tool-preview {
  display: grid;
  gap: 18px;
}

.control-block,
.preview-panel,
.result-pack {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.upload-box {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 2px dashed rgba(22, 28, 40, 0.26);
  border-radius: 8px;
  background: var(--surface-alt);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-title {
  font-weight: 800;
  color: var(--ink);
}

.upload-help,
.small-note {
  color: var(--muted);
  font-size: 14px;
}

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

.setting-field {
  display: grid;
  gap: 8px;
}

.setting-field span {
  font-weight: 700;
  color: var(--ink);
}

.setting-field input[type="color"],
.setting-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.setting-field input[type="range"] {
  width: 100%;
}

.pack-options {
  display: grid;
  gap: 10px;
}

.pack-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  box-shadow: var(--shadow-soft);
}

.pack-copy {
  display: grid;
  gap: 2px;
}

.pack-copy strong {
  color: var(--ink);
}

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

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.preview-header,
.result-pack-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.preview-canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(22, 28, 40, 0.03) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(22, 28, 40, 0.03) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(22, 28, 40, 0.03) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(22, 28, 40, 0.03) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

#source-preview {
  width: min(100%, 320px);
  height: auto;
  border-radius: 8px;
}

.results-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  border: 2px dashed rgba(22, 28, 40, 0.26);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted);
}

.results-grid {
  display: grid;
  gap: 16px;
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.callout {
  background: var(--surface);
  border: 2px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(22, 28, 40, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--surface-alt);
  font-size: 14px;
}

td strong {
  color: var(--ink);
}

.stat-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.stat-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.step-list {
  display: grid;
  gap: 14px;
  counter-reset: howto;
}

.step-item {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.step-item::before {
  counter-increment: howto;
  content: "Step " counter(howto);
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.faq-item h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.icon-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  box-shadow: var(--shadow-soft);
}

.icon-card strong {
  color: var(--ink);
}

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

.icon-preview {
  display: grid;
  place-items: center;
  min-height: 108px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.button:hover,
.pack-option:hover,
.icon-card:hover,
.panel:hover,
.control-block:hover,
.preview-panel:hover,
.result-pack:hover {
  box-shadow: var(--shadow-lift);
}

.icon-preview canvas {
  width: 96px;
  height: 96px;
  display: block;
}

.site-footer {
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
}

.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px;
}

@media (max-width: 920px) {
  .tool-surface {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .grid,
  .setting-grid {
    grid-template-columns: 1fr;
  }

  .lead {
    font-size: 16px;
  }

  h1 {
    max-width: 13ch;
  }

  .preview-header,
  .result-pack-header,
  .header-row,
  .footer-row {
    align-items: start;
    flex-direction: column;
  }
}
.adsterra-link-wrap {
  padding: 0 0 1.25rem;
  text-align: center;
}

.adsterra-link {
  color: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}