:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e8ebf2;
  --text: #171923;
  --muted: #62697a;
  --border: #dfe3eb;
  --primary: #6557e8;
  --primary-strong: #5142dc;
  --primary-soft: #eeecff;
  --accent: #087c64;
  --accent-soft: #e0f7f0;
  --danger: #c43b52;
  --danger-soft: #fff0f2;
  --warning: #9a6700;
  --code: #252938;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow: 0 12px 36px rgb(31 35 48 / 8%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --content: 1180px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101118;
  --surface: #181a24;
  --surface-2: #20232f;
  --surface-3: #292d3b;
  --text: #f4f5f8;
  --muted: #aeb4c3;
  --border: #303544;
  --primary: #9487ff;
  --primary-strong: #a99fff;
  --primary-soft: #292643;
  --accent: #5bd5b2;
  --accent-soft: #173a32;
  --danger: #ff8092;
  --danger-soft: #3f222a;
  --warning: #ffd479;
  --code: #f3f4f8;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --shadow: 0 16px 40px rgb(0 0 0 / 24%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--primary) 11%, transparent), transparent 34rem),
    radial-gradient(circle at 95% 14%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  transition: background-color 160ms ease, color 160ms ease;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

img,
svg {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary-strong);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner,
.container {
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #7567f2, #4c3fd1);
  box-shadow: 0 8px 18px rgb(82 67 220 / 25%);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
}

.header-nav,
.header-actions,
.button-row,
.field-row,
.choice-row,
.tool-meta,
.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-nav {
  margin-left: auto;
}

.header-nav a {
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.icon-button,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 100ms ease, border-color 140ms ease, background 140ms ease;
}

.button {
  padding: 10px 15px;
  color: #fff;
  background: var(--primary-strong);
  box-shadow: var(--shadow-sm);
}

.button:hover {
  background: var(--primary);
  text-decoration: none;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button.secondary,
.icon-button {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.button.secondary:hover,
.icon-button:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: var(--primary-soft);
}

.button.ghost {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.button.ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: var(--danger-soft);
}

.button.small {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 13px;
}

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

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 18px;
}

.hero {
  padding-block: clamp(56px, 8vw, 100px) 46px;
  text-align: center;
}

.compact-hero {
  padding-block: clamp(44px, 6vw, 76px) 34px;
}

.home-page .hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.eyebrow,
.category-label {
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero h1,
.tool-hero h1 {
  max-width: 850px;
  margin: 14px auto 18px;
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero p,
.tool-hero > p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trust-row {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.trust-row span::before {
  content: "✓";
  margin-right: 6px;
  color: var(--accent);
  font-weight: 900;
}

.section {
  padding-block: 36px 66px;
}

.compact-section {
  padding-block: 24px 46px;
}

.text-link {
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.search-wrap {
  position: relative;
  width: min(100%, 360px);
}

.search-wrap::before {
  content: "⌕";
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--muted);
  font-size: 20px;
  transform: translateY(-52%);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-input:focus,
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}

.category-block + .category-block {
  margin-top: 38px;
}

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

.category-heading .category-title {
  margin: 0;
}

.category-heading > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.category-title {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

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

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

.category-card:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-card-count {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 11px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
}

.category-card strong {
  margin-bottom: 5px;
  font-size: 15px;
}

.category-card > span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.featured-grid .tool-card {
  min-height: 170px;
}

.section-cta {
  margin-top: 22px;
  text-align: center;
}

.tool-card {
  min-height: 185px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  text-decoration: none;
}

.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 12px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 900;
}

.tool-card h3 {
  margin: 0 0 7px;
  font-size: 1rem;
  line-height: 1.3;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tool-card .arrow {
  margin-top: auto;
  padding-top: 16px;
  color: var(--primary-strong);
  font-weight: 800;
}

.empty-search {
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.home-about {
  max-width: 900px;
}

.catalog-hero {
  padding-block: 38px 28px;
}

.catalog-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.25rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.catalog-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.catalog-controls {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
}

.catalog-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.catalog-search-row .search-wrap {
  width: min(100%, 520px);
}

.catalog-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.catalog-count strong {
  color: var(--text);
  font-family: var(--mono);
}

.category-filters {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: var(--primary-soft);
}

.catalog-results {
  padding-block: 34px 20px;
}

.catalog-about {
  max-width: 900px;
}

.privacy-strip {
  padding: 34px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.privacy-strip .large-icon {
  font-size: 30px;
}

.privacy-strip h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.privacy-strip p {
  margin: 0;
  color: var(--muted);
}

.breadcrumbs {
  padding-top: 26px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs ol {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border);
}

.tool-hero {
  padding-block: 36px 30px;
  text-align: left;
}

.tool-hero h1 {
  max-width: 850px;
  margin-inline: 0;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.tool-hero > p {
  max-width: 760px;
  margin-inline: 0;
}

.tool-meta {
  margin-top: 20px;
}

.pill,
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.network-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.network-badge.online::before {
  background: var(--accent);
}

.network-badge.offline::before {
  background: var(--warning);
}

.tool-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.tool-shell-header strong {
  font-size: 14px;
}

.local-note {
  color: var(--muted);
  font-size: 12px;
}

.local-note::before {
  content: "●";
  margin-right: 6px;
  color: var(--accent);
}

.tool-workspace {
  padding: clamp(18px, 3vw, 30px);
}

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

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

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input,
.select {
  min-height: 44px;
  padding: 9px 11px;
}

.textarea {
  min-height: 260px;
  padding: 13px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

.textarea.short {
  min-height: 150px;
}

.textarea.tall {
  min-height: 360px;
}

.output {
  background: var(--surface-2);
}

.field-row {
  align-items: end;
}

.field-row > .field {
  flex: 1 1 180px;
}

.choice-row {
  padding: 12px 0;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.choice input {
  accent-color: var(--primary-strong);
}

.button-row {
  margin-top: 16px;
}

.status-message {
  min-height: 25px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

.status-message.success {
  color: var(--accent);
}

.status-message.error {
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-soft);
}

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

.stat-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.stat-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.35rem;
  line-height: 1.2;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.result-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.result-panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.result-panel pre,
.code-output {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--code);
  font-family: var(--mono);
  font-size: 13px;
}

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

.history-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.history-heading,
.history-item-top,
.history-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.history-save-row {
  align-items: end;
  margin-top: 16px;
}

.history-save-row .field {
  flex: 1 1 240px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.history-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  color: var(--muted);
  text-align: center;
}

.history-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.history-item-top > div:first-child {
  min-width: 0;
  display: grid;
}

.history-item-top span {
  color: var(--muted);
  font-size: 12px;
}

.history-preview {
  min-width: 0;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px 10px;
}

.history-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.history-preview code {
  overflow: hidden;
  color: var(--code);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact {
  margin-top: 0;
  padding: 0;
  gap: 6px;
}

.password-item {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.password-item button {
  flex: 0 0 auto;
}

.range-line {
  display: grid;
  grid-template-columns: 1fr 70px;
  align-items: center;
  gap: 12px;
}

.range-line input[type="range"] {
  width: 100%;
  accent-color: var(--primary-strong);
}

.color-preview {
  min-height: 130px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
}

.image-preview-wrap {
  min-height: 120px;
  margin-top: 18px;
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-preview-wrap:has(img[hidden])::before {
  content: "Image preview appears here";
  color: var(--muted);
  font-size: 13px;
}

.image-preview-wrap img {
  max-width: 100%;
  max-height: 520px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
}

.seo-article {
  width: min(100%, 820px);
  margin: 72px auto 0;
  padding-bottom: 34px;
}

.seo-article h2 {
  margin: 2.2em 0 0.6em;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.seo-article h2:first-child {
  margin-top: 0;
}

.seo-article h3 {
  margin: 1.8em 0 0.45em;
  font-size: 1.25rem;
  line-height: 1.3;
}

.seo-article p,
.seo-article li {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

.seo-article pre,
.seo-article code {
  font-family: var(--mono);
}

.seo-article :not(pre) > code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.9em;
}

.seo-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.seo-article th,
.seo-article td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.seo-article th {
  background: var(--surface-2);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.faq-list summary {
  padding: 15px 17px;
  cursor: pointer;
  font-weight: 750;
}

.faq-list details p {
  margin: 0;
  padding: 0 17px 17px;
}

.related-tools {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.related-tools h2 {
  margin-top: 0;
}

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

.related-link {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.related-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

.privacy-page {
  width: min(calc(100% - 32px), 820px);
  margin: 0 auto;
  padding-block: 60px 90px;
}

.privacy-page h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.045em;
}

.site-footer {
  margin-top: 68px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
}

.footer-inner {
  min-height: 128px;
  padding-block: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-link-button,
.inline-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.footer-link-button:hover,
.inline-button:hover {
  color: var(--text);
  text-decoration: underline;
}

.inline-button {
  color: var(--primary-strong);
  font-weight: 700;
  text-underline-offset: 3px;
}

.cookie-banner {
  position: fixed;
  z-index: 240;
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: min(calc(100% - 32px), 980px);
  margin-inline: auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 18px 55px rgb(16 24 40 / 22%);
  backdrop-filter: blur(18px);
}

.cookie-banner-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.45;
}

.cookie-banner-copy span {
  color: var(--muted);
}

.cookie-banner-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.consent-dialog {
  width: min(calc(100% - 32px), 620px);
  max-height: min(760px, calc(100vh - 32px));
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(0 0 0 / 32%);
}

.consent-dialog::backdrop {
  background: rgb(8 10 18 / 58%);
  backdrop-filter: blur(3px);
}

.consent-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.consent-dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.consent-dialog > p {
  color: var(--muted);
  font-size: 14px;
}

.consent-options {
  display: grid;
  gap: 10px;
  margin-block: 20px;
}

.consent-option {
  min-height: 72px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

label.consent-option {
  cursor: pointer;
}

.consent-option-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.consent-option-copy > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--primary-strong);
}

.consent-dialog .consent-note {
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100% - 36px));
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 160ms ease, opacity 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

[hidden] {
  display: none !important;
}

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

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

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

@media (max-width: 720px) {
  .header-nav {
    display: none;
  }

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

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-wrap {
    width: 100%;
  }

  .catalog-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-search-row .search-wrap {
    width: 100%;
  }

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

  .textarea {
    min-height: 210px;
  }

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

  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-banner-actions .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 540px) {
  .header-inner,
  .container {
    width: min(calc(100% - 22px), var(--content));
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 14px;
  }

  .install-label {
    display: none;
  }

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

  .category-overview {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 138px;
  }

  .tool-card {
    min-height: 164px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1,
  .tool-hero h1 {
    letter-spacing: -0.04em;
  }

  .privacy-strip {
    grid-template-columns: 1fr;
    padding: 24px;
  }

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

  .tool-workspace {
    padding: 15px;
  }

  .consent-dialog {
    padding: 18px;
  }

  .consent-option {
    align-items: flex-start;
  }

  .button-row .button {
    flex: 1 1 auto;
  }

  .history-heading,
  .history-item-top,
  .history-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .history-save-row .field {
    width: 100%;
    flex-basis: auto;
  }

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

@media (max-width: 420px) {
  .network-badge {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .tool-shell-header,
  .button-row,
  .breadcrumbs {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .tool-shell {
    border: 0;
    box-shadow: none;
  }
}
