:root {
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --cyan: #06b6d4;
  --cyan-soft: #ecfeff;
  --navy: #0f172a;
  --slate: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-raised: #ffffff;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-sm: 0 10px 30px rgb(15 23 42 / 0.06);
  --shadow-md: 0 20px 45px rgb(15 23 42 / 0.1);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 288px;
  --topbar-height: 72px;
  --transition: 180ms ease;
}

/* Contas opcionais */
.account-auth { max-width: 560px; margin: 48px auto; }
.account-auth__intro { text-align: center; margin-bottom: 24px; }
.account-auth__intro h1, .account-hero h1 { color: var(--text); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; }
.account-auth__intro p, .account-hero p, .account-card p { color: var(--text-secondary); }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); color: var(--text); }
.account-card h2 { color: var(--text); font-size: 1.15rem; font-weight: 800; margin-bottom: 14px; }
.account-form { display: grid; gap: 10px; }
.account-form label { color: var(--text); font-size: .9rem; font-weight: 700; }
.account-form input, .account-form select, .account-form textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-subtle); color: var(--text); padding: 11px 12px; }
.account-form input:disabled { background: var(--background); color: var(--text-muted); opacity: 1; }
.account-form input:focus, .account-form select:focus, .account-form textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); border-color: var(--brand); }
.account-form small, .account-note, .account-list small { color: var(--text-muted); font-size: .78rem; }
.password-strength { display: grid; gap: 6px; margin: 2px 0 4px; }
.password-strength__track { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: var(--border); }
.password-strength__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--text-muted); transition: width .2s ease, background-color .2s ease; }
.password-strength[data-level="weak"] .password-strength__track span { background: #dc2626; }
.password-strength[data-level="fair"] .password-strength__track span { background: #d97706; }
.password-strength[data-level="good"] .password-strength__track span { background: #2563eb; }
.password-strength[data-level="strong"] .password-strength__track span { background: #16a34a; }
.account-auth__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; font-size: .88rem; }
.account-auth__links a, .account-card a { color: var(--brand-strong); font-weight: 700; }
.account-card a.button--primary { color: #fff; }
.account-alert { border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--border)); border-radius: 12px; background: var(--cyan-soft); color: var(--text); padding: 13px 15px; margin-bottom: 16px; }
.account-alert a { color: var(--brand-strong); font-weight: 800; text-decoration: underline; }
.account-alert--success { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); background: var(--success-soft); color: var(--success); }
.account-alert--error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.account-page { display: grid; gap: 22px; }
.account-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; border-radius: 18px; background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(6,182,212,.10)); }
.account-plan-badge { min-width: 170px; display: grid; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; color: var(--text-secondary); }
.account-plan-badge strong { color: var(--brand-strong); font-size: 1.25rem; }
.account-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.account-tabs a { flex: 0 0 auto; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 13px; font-size: .85rem; font-weight: 700; }
.account-tabs a:hover, .account-tabs a:focus-visible { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-card--wide { grid-column: 1 / -1; }
.account-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.account-card dl div { background: var(--brand-soft); border-radius: 10px; padding: 12px; }
.account-card dt { color: var(--text-muted); font-size: .75rem; }.account-card dd { color: var(--text); font-weight: 800; }
.account-list { display: grid; gap: 0; color: var(--text-secondary); }.account-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding: 11px 0; }.account-list li:first-child { border-top: 0; }.account-list span { display: grid; }
.account-check { display: flex !important; align-items: center; gap: 9px; font-weight: 600 !important; }.account-check input { width: 18px; height: 18px; }
.account-danger-actions { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-top: 18px; }.account-delete { max-width: 360px; }.account-logout { justify-self: end; }
.account-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.account-card__heading h2 { margin-bottom: 0; }
.account-remove-button { color: var(--danger); }
.account-remove-button:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.account-remove-button .ui-icon { width: 18px; height: 18px; }
.account-history-groups { display: grid; gap: 10px; }
.account-history-group { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-subtle); }
.account-history-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; color: var(--text); cursor: pointer; list-style: none; }
.account-history-group > summary::-webkit-details-marker { display: none; }
.account-history-group > summary span { display: grid; gap: 3px; }
.account-history-group > summary small { color: var(--text-muted); font-size: .78rem; font-weight: 600; }
.account-history-group > summary > .ui-icon { color: var(--text-muted); transition: transform var(--transition); }
.account-history-group[open] > summary > .ui-icon { transform: rotate(180deg); }
.account-history-group__content { padding: 0 14px 14px; border-top: 1px solid var(--border); }
.account-history-group__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 12px; }
.tool-favorite { margin-left: auto; align-self: start; }
@media (max-width: 760px) { .account-grid { grid-template-columns: 1fr; }.account-card--wide { grid-column: auto; }.account-hero { align-items: stretch; flex-direction: column; }.account-danger-actions { align-items: stretch; flex-direction: column; }.account-card dl { grid-template-columns: 1fr; }.tool-favorite { margin-left: 0; width: 100%; }.tool-favorite .button { width: 100%; }.account-card__heading { align-items: flex-start; flex-direction: column; }.account-history-group__actions { align-items: stretch; flex-direction: column; }.account-history-group__actions .button { width: 100%; } }

html[data-theme="dark"] {
  --brand: #818cf8;
  --brand-strong: #a5b4fc;
  --brand-soft: #242554;
  --cyan-soft: #083344;
  --border: #293548;
  --border-strong: #3b4a62;
  --background: #0b1120;
  --surface: #111827;
  --surface-subtle: #172033;
  --surface-raised: #162033;
  --success: #4ade80;
  --success-soft: #123524;
  --warning: #fbbf24;
  --warning-soft: #3a2b10;
  --danger: #fca5a5;
  --danger-soft: #3b171c;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.22);
  --shadow-sm: 0 12px 34px rgb(0 0 0 / 0.22);
  --shadow-md: 0 24px 50px rgb(0 0 0 / 0.32);
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body.public-body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: Manrope, Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(.public-body) button,
:where(.public-body) input,
:where(.public-body) select,
:where(.public-body) textarea {
  color: inherit;
  font: inherit;
}

:where(.public-body) button,
:where(.public-body) a {
  -webkit-tap-highlight-color: transparent;
}

:where(.public-body) a {
  color: inherit;
  text-decoration: none;
}

:where(.public-body) button {
  border: 0;
}

.public-body img,
.public-body svg {
  display: block;
}

.public-body ::selection {
  background: color-mix(in srgb, var(--brand) 24%, transparent);
  color: var(--text);
}

.public-body :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 70%, white);
  outline-offset: 3px;
}

.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform var(--transition);
}

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

[hidden] {
  display: none !important;
}

/* Buttons */
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.button--primary {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 8px 20px rgb(79 70 229 / 0.2);
}

.button--primary:hover:not(:disabled) {
  background: #4338ca;
  box-shadow: 0 10px 24px rgb(79 70 229 / 0.28);
}

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

.button--secondary:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--brand-strong);
}

.button--soft {
  border-color: color-mix(in srgb, var(--brand) 20%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.button--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.button--ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--danger);
}

.button--light {
  border-color: rgb(255 255 255 / 0.2);
  background: #fff;
  color: #312e81;
}

.button--small {
  min-height: 44px;
  padding: 9px 13px;
  font-size: 13px;
}

/* Main application shell */
.public-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-column {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1 0 auto;
}

.content-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 32px 72px;
}

.sidebar-overlay {
  display: none;
}

/* Sidebar */
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px 14px 14px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: width var(--transition), transform 220ms ease;
}

.sidebar-brand-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 2px 3px;
  border-radius: var(--radius-sm);
  background: #fff;
}

.sidebar-logo {
  width: 190px;
  height: auto;
}

.public-body .sidebar-symbol {
  display: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-icon-button,
.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.sidebar-icon-button:hover,
.icon-button:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-close-button {
  display: none;
}

.collapse-icon--open {
  display: none;
}

.sidebar-search > label,
.mobile-search-panel label,
.search-page__form > label {
  display: block;
  margin: 0 0 7px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.search-control {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-muted);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-control:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}

.search-control input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-control input::placeholder {
  color: var(--text-muted);
}

.search-control kbd {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font: 600 12px/1 Manrope, sans-serif;
  box-shadow: 0 1px 0 var(--border);
}

.search-control button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
}

.sidebar-navigation {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-primary-links {
  display: grid;
  gap: 3px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-primary-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.sidebar-primary-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.sidebar-primary-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-primary-link small {
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 9px 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-section-heading span:last-child {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  text-align: center;
  letter-spacing: 0;
}

.sidebar-categories {
  min-height: 0;
  padding: 0 4px 8px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar-category {
  margin: 2px 0;
  border-radius: var(--radius-sm);
}

.sidebar-category > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  transition: background var(--transition), color var(--transition);
}

.sidebar-category > summary::-webkit-details-marker {
  display: none;
}

.sidebar-category > summary:hover,
.sidebar-category.is-active > summary {
  background: var(--surface-subtle);
  color: var(--text);
}

.sidebar-category-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-category-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.sidebar-category-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-category-count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-category-chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
}

.sidebar-category-chevron .ui-icon {
  width: 15px;
  height: 15px;
}

.sidebar-category[open] .sidebar-category-chevron {
  transform: rotate(180deg);
}

.sidebar-tool-list {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 1px 0 8px 23px;
  padding: 3px 0 3px 15px;
  border-left: 1px solid var(--border);
}

.sidebar-category-all,
.sidebar-tool-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}

.sidebar-category-all {
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.sidebar-category-all .ui-icon {
  width: 13px;
  height: 13px;
}

.sidebar-tool-link:hover,
.sidebar-category-all:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.sidebar-tool-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.active-indicator {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.sidebar-footer-links {
  display: grid;
  gap: 5px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.sidebar-product-link {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.sidebar-product-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.sidebar-product-link > span:first-child {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.sidebar-product-link > span:first-child .ui-icon {
  width: 16px;
  height: 16px;
}

.sidebar-product-link > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.sidebar-product-link strong {
  color: var(--text);
  font-size: 14px;
}

.sidebar-product-link small {
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-product-link > .ui-icon {
  width: 14px;
  height: 14px;
}

.sidebar-footer-links > p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 7px 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.status-dot,
.topbar-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 15%, transparent);
}

/* Collapsed desktop sidebar */
@media (min-width: 1024px) {
  .public-body.sidebar-is-collapsed .public-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .public-body.sidebar-is-collapsed .app-sidebar {
    padding-inline: 12px;
  }

  .public-body.sidebar-is-collapsed .sidebar-logo,
  .public-body.sidebar-is-collapsed .sidebar-search label,
  .public-body.sidebar-is-collapsed .sidebar-search input,
  .public-body.sidebar-is-collapsed .sidebar-search kbd,
  .public-body.sidebar-is-collapsed .sidebar-primary-link span,
  .public-body.sidebar-is-collapsed .sidebar-primary-link small,
  .public-body.sidebar-is-collapsed .sidebar-section-heading,
  .public-body.sidebar-is-collapsed .sidebar-category-name,
  .public-body.sidebar-is-collapsed .sidebar-category-count,
  .public-body.sidebar-is-collapsed .sidebar-category-chevron,
  .public-body.sidebar-is-collapsed .sidebar-category > .sidebar-tool-list,
  .public-body.sidebar-is-collapsed .sidebar-product-link > span:nth-child(2),
  .public-body.sidebar-is-collapsed .sidebar-product-link > .ui-icon,
  .public-body.sidebar-is-collapsed .sidebar-footer-links > p {
    display: none;
  }

  .public-body.sidebar-is-collapsed .sidebar-symbol {
    display: block;
  }

  .public-body.sidebar-is-collapsed .sidebar-brand-row {
    flex-direction: column;
    justify-content: center;
  }

  .public-body.sidebar-is-collapsed .sidebar-brand {
    padding: 3px;
  }

  .public-body.sidebar-is-collapsed .sidebar-collapse-button {
    width: 44px;
    height: 44px;
  }

  .public-body.sidebar-is-collapsed .collapse-icon--close {
    display: none;
  }

  .public-body.sidebar-is-collapsed .collapse-icon--open {
    display: block;
  }

  .public-body.sidebar-is-collapsed .search-control,
  .public-body.sidebar-is-collapsed .sidebar-primary-link,
  .public-body.sidebar-is-collapsed .sidebar-category > summary,
  .public-body.sidebar-is-collapsed .sidebar-product-link {
    display: flex;
    justify-content: center;
    padding-inline: 0;
  }

  .public-body.sidebar-is-collapsed .sidebar-categories {
    padding-right: 0;
  }
}

/* Topbar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 32px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  background: color-mix(in srgb, var(--background) 91%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-mobile-brand,
.mobile-only,
.mobile-tools-button,
.mobile-search-panel {
  display: none;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.topbar-context strong {
  color: var(--text);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logout {
  display: inline-flex;
  margin: 0;
}

.topbar-logout__button {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: var(--danger);
}

.topbar-logout__button:hover {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.topbar-text-action {
  min-height: 44px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.topbar-text-action:hover {
  background: var(--surface);
  color: var(--text);
}

.theme-icon--sun,
html[data-theme="dark"] .theme-icon--moon {
  display: none;
}

html[data-theme="dark"] .theme-icon--sun {
  display: block;
}

/* Shared headings and cards */
.eyebrow,
.section-kicker {
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.eyebrow > span {
  width: 21px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
}

.page-section {
  margin-top: 72px;
}

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

.section-heading h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.section-heading p {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.section-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.section-link .ui-icon {
  width: 17px;
  height: 17px;
  transition: transform var(--transition);
}

.section-link:hover .ui-icon {
  transform: translateX(3px);
}

.tool-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.tool-card__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tool-card__icon .ui-icon {
  width: 23px;
  height: 23px;
}

.tool-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tool-card__body strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.tool-card__body > span:not(.tool-card__eyebrow) {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tool-card__eyebrow {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-card__arrow {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}

.tool-card__arrow .ui-icon {
  width: 17px;
  height: 17px;
}

.tool-card:hover .tool-card__arrow {
  color: var(--brand-strong);
  transform: translateX(3px);
}

/* Home */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 28px;
  padding: clamp(30px, 4.2vw, 58px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, #4f46e5 10%, transparent), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.home-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
}

.home-hero__content {
  position: relative;
  z-index: 1;
}

.home-hero h1 {
  max-width: 800px;
  margin: 14px 0 16px;
  color: var(--text);
  font-size: clamp(39px, 5vw, 66px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.home-hero h1 span {
  color: #4f46e5;
}

html[data-theme="dark"] .home-hero h1 span {
  color: #a5b4fc;
}

.home-hero__content > p {
  max-width: 650px;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.7vw, 19px);
}

.hero-search {
  max-width: 760px;
  margin-top: 30px;
}

.hero-search > label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.hero-search__control {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.07);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search__control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent), 0 12px 30px rgb(15 23 42 / 0.08);
}

.hero-search__control > .ui-icon {
  color: var(--text-muted);
}

.hero-search__control input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.hero-search__control input::placeholder {
  color: var(--text-muted);
}

.hero-search__control .button {
  min-width: 110px;
  min-height: 48px;
}

.quick-search {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.quick-search > span {
  padding-top: 5px;
  font-weight: 700;
}

.quick-search > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-search a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.quick-search a:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.hero-shortcuts {
  align-self: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--brand-soft) 38%, var(--surface));
}

.hero-shortcuts__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 14px;
}

.hero-shortcuts__icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 8px 18px rgb(79 70 229 / 0.2);
}

.hero-shortcuts__head > div {
  display: grid;
}

.hero-shortcuts__head strong {
  color: var(--text);
  font-size: 13px;
}

.hero-shortcuts__head span {
  color: var(--text-secondary);
  font-size: 13px;
}

.hero-shortcuts__list {
  display: grid;
  gap: 6px;
}

.hero-shortcuts__list > a {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), transform var(--transition);
}

.hero-shortcuts__list > a:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
  transform: translateX(2px);
}

.hero-shortcuts__list > a > span:first-child {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.hero-shortcuts__list > a > span:first-child .ui-icon {
  width: 17px;
  height: 17px;
}

.hero-shortcuts__list > a > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.hero-shortcuts__list strong {
  color: var(--text);
  font-size: 14px;
}

.hero-shortcuts__list small {
  color: var(--text-muted);
  font-size: 12px;
}

.hero-shortcuts__list > a > .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.hero-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 11px 3px 0;
  border-top: 1px solid color-mix(in srgb, var(--brand) 15%, var(--border));
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.hero-privacy-note .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.hero-privacy-note strong {
  color: var(--text);
}

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

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

.category-showcase {
  --category-accent: #4f46e5;
  --category-tint: #eef2ff;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.category-showcase--2 {
  --category-accent: #0369a1;
  --category-tint: #f0f9ff;
}

.category-showcase--3 {
  --category-accent: #7c3aed;
  --category-tint: #f5f3ff;
}

.category-showcase--4 {
  --category-accent: #0f766e;
  --category-tint: #f0fdfa;
}

html[data-theme="dark"] .category-showcase {
  --category-tint: var(--surface-subtle);
}

html[data-theme="dark"] .category-showcase--1 {
  --category-accent: #a5b4fc;
}

html[data-theme="dark"] .category-showcase--2 {
  --category-accent: #38bdf8;
}

html[data-theme="dark"] .category-showcase--3 {
  --category-accent: #c4b5fd;
}

html[data-theme="dark"] .category-showcase--4 {
  --category-accent: #5eead4;
}

.category-showcase > summary {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.category-showcase > summary::-webkit-details-marker {
  display: none;
}

.category-showcase__summary-copy {
  min-width: 0;
  flex: 1;
}

.category-showcase__icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--category-tint);
  color: var(--category-accent);
}

.category-showcase__summary-copy > span {
  color: var(--category-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-showcase h3 {
  margin: 2px 0 3px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.category-showcase summary p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.category-showcase__toggle {
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--category-accent);
  transition: transform var(--transition), background var(--transition);
}

.category-showcase__toggle .ui-icon {
  width: 18px;
  height: 18px;
}

.category-showcase[open] .category-showcase__toggle {
  transform: rotate(180deg);
}

.category-showcase__body {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.category-showcase__tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 18px;
  margin: 18px 0;
}

.category-showcase__tools a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 3px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.category-showcase__tools a:hover {
  color: var(--brand-strong);
}

.category-showcase__tools .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

.category-showcase__all {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--category-tint);
  color: var(--category-accent);
  font-size: 14px;
  font-weight: 700;
}

.category-showcase__all .ui-icon {
  width: 15px;
  height: 15px;
}

.trust-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 36px;
  margin-top: 72px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.trust-section__intro h2 {
  margin: 5px 0 12px;
  color: var(--text);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.trust-section__intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.trust-grid > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  column-gap: 11px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.trust-grid > div > span {
  width: 38px;
  height: 38px;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.trust-grid strong {
  align-self: end;
  color: var(--text);
  font-size: 14px;
}

.trust-grid p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

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

.api-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(350px, 0.7fr);
  gap: 48px;
  margin-top: 72px;
  padding: clamp(30px, 4vw, 50px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.api-section::before {
  content: "";
  position: absolute;
  top: -130px;
  right: -70px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(6 182 212 / 0.2), transparent 68%);
  pointer-events: none;
}

.api-section__content {
  position: relative;
  z-index: 1;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.07);
  color: #a5f3fc;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-section h2 {
  max-width: 630px;
  margin: 15px 0 12px;
  color: #fff;
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.api-section__content > p {
  max-width: 580px;
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: 13px;
}

.api-code {
  position: relative;
  z-index: 1;
  align-self: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius-lg);
  background: #070c17;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.28);
}

.api-code > div {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.api-code > div > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
}

.api-code > div > span:nth-child(2) {
  background: #fbbf24;
}

.api-code > div > span:nth-child(3) {
  background: #4ade80;
}

.api-code small {
  margin-left: auto;
  color: #94a3b8;
  font-size: 12px;
}

.api-code pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  color: #e2e8f0;
  font: 500 12px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.api-code code span {
  color: #67e8f9;
}

.about-section {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 60px;
  margin-top: 72px;
  padding-top: 10px;
}

.about-section__content h2 {
  margin: 5px 0 14px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.about-section__content p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.home-faq {
  display: grid;
  gap: 8px;
}

.home-faq h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

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

.home-faq summary {
  min-height: 48px;
  padding: 13px 15px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.home-faq details p {
  margin: 0;
  padding: 0 15px 15px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 20px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.breadcrumb a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--brand-strong);
}

.breadcrumb li > span[aria-hidden="true"] .ui-icon {
  width: 13px;
  height: 13px;
}

.breadcrumb [aria-current="page"] {
  max-width: 280px;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tool page */
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 920px;
}

.tool-header__content {
  min-width: 0;
  flex: 1 1 auto;
}

.tool-header__icon {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tool-header__icon .ui-icon {
  width: 29px;
  height: 29px;
}

.tool-header h1 {
  margin: 3px 0 6px;
  color: var(--text);
  font-size: clamp(29px, 3.4vw, 43px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.tool-header__content > p {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tool-badges > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.tool-badges .ui-icon {
  width: 13px;
  height: 13px;
}

.tool-badges .tool-badge--privacy {
  border-color: color-mix(in srgb, var(--success) 20%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: 16px;
  margin-top: 28px;
  align-items: start;
}

.tool-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tool-panel--result {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.tool-panel__header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.tool-panel__header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-step {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.tool-panel__header > div > div {
  display: grid;
}

.tool-panel__header > div > div > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-panel__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.panel-status {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-status > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.panel-status--ready,
.panel-status.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.panel-status--ready > span,
.panel-status.is-success > span {
  background: var(--success);
}

.panel-status.is-loading {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.panel-status.is-loading > span {
  background: var(--brand);
  animation: status-pulse 1s ease infinite;
}

.panel-status.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.panel-status.is-error > span {
  background: var(--danger);
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

#tool-form {
  padding: 20px;
}

.tool-alert-region:not(:empty) {
  padding: 16px 20px 0;
}

.tool-options {
  display: grid;
  gap: 16px;
}

.tool-options label,
.tool-options legend,
.tool-options p.text-sm.font-medium {
  color: var(--text-secondary) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.tool-options input[type="text"],
.tool-options input[type="number"],
.tool-options input[type="url"],
.tool-options input[type="email"],
.tool-options select,
.tool-options textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 11px 13px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  outline: 0;
  background: var(--surface-subtle) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.tool-options textarea {
  min-height: 140px;
  resize: vertical;
}

.tool-options input:focus,
.tool-options select:focus,
.tool-options textarea:focus {
  border-color: var(--brand) !important;
  background: var(--surface) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 11%, transparent) !important;
}

.tool-options input::placeholder,
.tool-options textarea::placeholder {
  color: var(--text-muted);
}

.tool-options input[type="checkbox"],
.tool-options input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #4f46e5;
}

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

.tool-options .flex,
.tool-options .inline-flex,
.tool-options .flex-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-options .flex-wrap {
  flex-wrap: wrap;
}

.tool-options .mb-3 {
  margin-bottom: 12px;
}

.tool-options .mt-3 {
  margin-top: 12px;
}

.tool-options .tool-form-grid {
  display: grid;
  gap: 14px;
}

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

.format-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}

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

.segmented-options label {
  position: relative;
  cursor: pointer;
}

.segmented-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-options span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.segmented-options input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.segmented-options input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--brand) 60%, white);
  outline-offset: 2px;
}

.advanced-options {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.advanced-options summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.advanced-options summary::after {
  content: "+";
  font-size: 17px;
  font-weight: 500;
}

.advanced-options[open] summary::after {
  content: "−";
}

.advanced-options__body {
  padding: 0 13px 13px;
  border-top: 1px solid var(--border);
}

.advanced-options__body label {
  display: block;
  margin-top: 12px;
}

.advanced-options__body p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.word-counter-input textarea {
  min-height: 245px;
}

.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
}

.inline-action {
  min-height: 44px;
  padding: 4px 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.inline-action:hover {
  background: var(--brand-soft);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  cursor: pointer;
}

.toggle-control > input {
  position: absolute;
  opacity: 0;
}

.toggle-control__track {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background var(--transition);
}

.toggle-control__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.25);
  transition: transform var(--transition);
}

.toggle-control input:checked + .toggle-control__track {
  background: #4f46e5;
}

.toggle-control input:checked + .toggle-control__track::after {
  transform: translateX(17px);
}

.toggle-control input:focus-visible + .toggle-control__track {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, white);
  outline-offset: 2px;
}

.toggle-control > span:last-child {
  display: grid;
}

.toggle-control strong {
  color: var(--text);
  font-size: 13px;
}

.toggle-control small {
  color: var(--text-muted);
  font-size: 12px;
}

.privacy-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--success) 18%, var(--border));
  border-radius: var(--radius-md);
  background: var(--success-soft);
  color: var(--text-secondary);
}

.privacy-callout > span {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--success);
}

.privacy-callout .ui-icon {
  width: 17px;
  height: 17px;
}

.privacy-callout p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.privacy-callout strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.tool-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 15px;
}

.synthetic-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 9px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.synthetic-note .ui-icon {
  width: 13px;
  height: 13px;
}

.result-content {
  min-height: 258px;
  padding: 20px;
  overflow-wrap: anywhere;
}

.result-empty {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  text-align: center;
}

.result-empty > span {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.result-empty strong {
  color: var(--text);
  font-size: 12px;
}

.result-empty p {
  max-width: 280px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.result-actions {
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.result-actions #btn-clear {
  margin-left: auto;
}

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

.result-skeleton {
  height: 15px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-subtle), var(--border), var(--surface-subtle));
  background-size: 200% 100%;
  animation: skeleton-wave 1.2s linear infinite;
}

.result-skeleton:nth-child(2) { width: 78%; }
.result-skeleton:nth-child(3) { width: 56%; }

@keyframes skeleton-wave {
  to { background-position: -200% 0; }
}

.result-value {
  display: grid;
  gap: 8px;
}

.result-value__toolbar,
.structured-result__header,
.structured-result__section-header,
.batch-record__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-value__toolbar strong,
.structured-result__header strong,
.structured-result__section-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.result-value__main {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--text);
  font: 700 15px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.result-value__message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.result-copy-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.result-copy-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 48%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.result-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.structured-result {
  display: grid;
  gap: 14px;
}

.structured-result__header {
  align-items: flex-start;
}

.structured-result__header > div {
  min-width: 0;
}

.structured-result__header > div > span {
  display: block;
  margin-bottom: 2px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.structured-result__header p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.structured-result__section {
  display: grid;
  gap: 8px;
}

.structured-result__section-header {
  min-height: 32px;
}

.result-field-list {
  overflow: hidden;
  display: grid;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
}

.result-field {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 8px 9px 8px 13px;
  background: var(--surface);
}

.result-field__content {
  min-width: 0;
}

.result-field__label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.result-field__value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 700 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.result-field--status .result-field__value {
  color: var(--success);
}

.result-field--invalid .result-field__value {
  color: var(--danger);
}

.batch-record-list {
  display: grid;
  gap: 10px;
}

.batch-record {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.batch-record > summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.batch-record > summary::-webkit-details-marker {
  display: none;
}

.batch-record > summary::after {
  margin-left: auto;
  color: var(--text-muted);
  content: "+";
  font-size: 18px;
}

.batch-record[open] > summary::after {
  content: "−";
}

.batch-record__body {
  display: grid;
  gap: 10px;
  padding: 0 11px 11px;
}

.batch-record__toolbar {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.batch-record__toolbar span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.cpf-result-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cpf-result-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px 44px;
  grid-template-areas: "select value state copy-value copy-state";
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.cpf-select {
  grid-area: select;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  cursor: pointer;
}

.cpf-select:hover {
  background: var(--brand-soft);
}

.cpf-result-list input {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
}

.cpf-result-list code {
  grid-area: value;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.cpf-result-list small {
  grid-area: state;
  color: var(--text-muted);
  font-size: 12px;
}

.cpf-copy-one {
  grid-area: copy-value;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.cpf-copy-state {
  grid-area: copy-state;
}

.cpf-copy-one .ui-icon {
  width: 15px;
  height: 15px;
}

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

.metric-card {
  position: relative;
  padding: 12px;
  padding-right: 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.metric-card > strong {
  display: block;
  color: var(--brand-strong);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-card > span {
  display: block;
  margin-top: 1px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card .metric-card__copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

.qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-align: center;
}

.qr-result img {
  width: min(100%, 280px);
  height: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.qr-result p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.qr-result a,
.image-result__download {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: #4f46e5;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.qr-result .result-field {
  width: 100%;
  text-align: left;
}

.upload-zone {
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-zone__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
}

.upload-zone__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 22px;
  font-weight: 500;
}

.upload-zone p {
  margin: 0;
  color: var(--text);
  font-size: 14px !important;
  font-weight: 600 !important;
}

.upload-zone p span {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-zone small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.selected-file {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  text-align: left;
}

.selected-file--single {
  max-width: 560px;
}

.image-selection__summary,
.image-batch-result__header,
.image-result-item__header,
.image-result-item__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-selection__summary {
  padding: 2px 2px 10px;
}

.image-selection__summary strong,
.image-batch-result__summary,
.image-batch-progress__title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.image-selection__summary span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.image-selection-list,
.image-batch-progress__list,
.image-batch-result__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.image-selection-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.image-selection-item--success {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  background: var(--success-soft);
}

.image-selection-item--error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: var(--danger-soft);
}

.image-selection-item__details {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
}

.image-selection-item__name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-selection-item__meta,
.image-selection-item__status {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.image-selection-item__status {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--text-secondary);
  text-align: right;
}

.image-selection-item--success .image-selection-item__status {
  color: var(--success);
}

.image-selection-item--error .image-selection-item__status {
  color: var(--danger);
}

.image-selection-item__progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  accent-color: var(--brand);
}

.image-selection-item__progress::-webkit-progress-bar,
.image-batch-progress__item progress::-webkit-progress-bar {
  border-radius: 99px;
  background: var(--border);
}

.image-selection-item__progress::-webkit-progress-value,
.image-batch-progress__item progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--brand);
}

.image-selection-item__remove {
  min-width: 76px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.image-selection-item__remove:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

.image-selection-item__remove:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.image-settings {
  display: grid;
  gap: 15px;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-heading output {
  color: var(--brand-strong);
  font-size: 14px;
  font-weight: 800;
}

.quality-control input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  accent-color: #4f46e5;
  cursor: pointer;
}

.image-settings label span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.image-result {
  display: grid;
  gap: 13px;
}

.image-result__preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: repeating-conic-gradient(#e2e8f0 0 25%, #fff 0 50%) 50% / 18px 18px;
}

.image-result__preview img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
}

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

.image-result__stats > div {
  position: relative;
  padding: 9px;
  padding-right: 55px;
  border-radius: 9px;
  background: var(--surface-subtle);
}

.image-result__stats > div > span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.image-result__stats > div > strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
}

.image-result__saving strong {
  color: var(--success);
}

.image-result__stats .image-stat__copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

.image-batch-progress,
.image-batch-result {
  display: grid;
  gap: 14px;
}

.image-batch-progress {
  min-height: 210px;
  align-content: center;
  padding: 18px;
}

.image-batch-progress__list {
  gap: 10px;
}

.image-batch-progress__item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.image-batch-progress__item > span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-batch-progress__item > span:nth-child(2) {
  text-align: right;
}

.image-batch-progress__item progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 99px;
  accent-color: var(--brand);
}

.image-batch-progress__item--success {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  background: var(--success-soft);
}

.image-batch-progress__item--error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: var(--danger-soft);
}

.image-batch-result__header {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}

.image-batch-result__download-all,
.image-result-item__download {
  cursor: pointer;
}

.image-batch-result__download-all:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.image-batch-result__list {
  gap: 14px;
}

.image-result-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.image-result-item--success {
  border-color: color-mix(in srgb, var(--success) 22%, var(--border));
}

.image-result-item--error {
  display: grid;
  gap: 6px;
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: var(--danger-soft);
}

.image-result-item--error h3,
.image-result-item--error p {
  margin: 0;
}

.image-result-item--error h3 {
  color: var(--danger);
  font-size: 14px;
}

.image-result-item--error p {
  color: var(--text-secondary);
  font-size: 13px;
}

.image-result-item--error .image-result-item__remove {
  width: fit-content;
  margin-top: 4px;
}

.image-result-item__header {
  justify-content: flex-start;
}

.image-result-item__thumbnail {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  object-fit: cover;
}

.image-result-item__heading {
  min-width: 0;
}

.image-result-item__name-copy {
  margin-left: auto;
}

.image-result-item__heading h3 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-result-item__status {
  display: inline-flex;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.image-result-item__status--success {
  color: var(--success);
}

.image-result-item__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.inline-alert--success {
  border-color: color-mix(in srgb, var(--success) 20%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.inline-alert--error {
  border-color: color-mix(in srgb, var(--danger) 20%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.inline-alert--warning {
  border-color: color-mix(in srgb, var(--warning) 20%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.inline-alert__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.inline-alert__icon .ui-icon {
  width: 16px;
  height: 16px;
}

.inline-alert__symbol {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
}

.inline-alert__close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: -3px -5px -3px auto;
  border-radius: 8px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.inline-alert__close:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.button-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}

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

.result-error {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--border));
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  text-align: center;
}

.result-error strong {
  color: var(--danger);
  font-size: 13px;
}

.result-error p {
  max-width: 340px;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.image-preview-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.image-preview-card figcaption {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.image-preview-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: repeating-conic-gradient(#e2e8f0 0 25%, #fff 0 50%) 50% / 18px 18px;
}

.image-preview-card small {
  display: block;
  padding: 7px 9px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.tool-help,
.faq-section,
.related-section {
  margin-top: 64px;
}

.how-to-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-to-steps li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.how-to-steps li > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.how-to-steps strong {
  color: var(--text);
  font-size: 14px;
}

.how-to-steps p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

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

.content-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.content-card--wide {
  grid-column: 1 / -1;
}

.content-card__icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.content-card h2 {
  margin: 2px 0 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.rich-content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.rich-content p {
  margin: 0 0 10px;
}

.rich-content p:last-child {
  margin-bottom: 0;
}

.rich-content ul,
.rich-content ol {
  display: grid;
  gap: 6px;
  margin: 7px 0 10px;
  padding-left: 19px;
}

.rich-content li::marker {
  color: var(--brand);
}

.rich-content strong {
  color: var(--text);
  font-weight: 700;
}

.rich-content a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-list {
  display: grid;
  gap: 8px;
  max-width: 920px;
}

.faq-list summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq-list details[open] summary .ui-icon {
  transform: rotate(180deg);
}

.faq-list details > div {
  padding: 0 16px 15px;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.review-date {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 26px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.review-date .ui-icon {
  width: 14px;
  height: 14px;
}

/* Collections, search and institutional pages */
.collection-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.collection-header__icon,
.search-page__icon,
.institutional-page__icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.collection-header h1,
.search-page__header h1,
.institutional-page h1 {
  margin: 3px 0 6px;
  color: var(--text);
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.collection-header p,
.search-page__header > p,
.institutional-page header > p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.collection-count {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.tool-card--collection {
  min-height: 130px;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
}

.collection-help {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.collection-help > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.collection-help strong {
  color: var(--text);
  font-size: 12px;
}

.collection-help p {
  margin: 1px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.search-page__header {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.search-page__icon {
  margin: 0 auto 11px;
}

.search-page__form {
  margin: 24px auto 0;
  text-align: left;
}

.search-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 38px;
  color: var(--text-secondary);
  font-size: 14px;
}

.search-summary strong {
  color: var(--text);
}

.search-empty {
  margin-top: 36px;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: -24px;
  color: var(--text-muted);
  font-size: 13px;
}

.search-suggestions a {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
}

.search-start-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
}

.search-start-grid a {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.search-start-grid a:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.search-start-grid a > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.search-start-grid strong {
  color: var(--text);
  font-size: 12px;
}

.search-start-grid small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.institutional-page {
  max-width: 920px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.institutional-page > header {
  padding: 30px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.institutional-page__icon {
  margin-bottom: 14px;
}

.institutional-page__body {
  padding: 30px;
  font-size: 13px;
}

.institutional-page__body h3 {
  margin: 25px 0 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

/* Empty, errors, ads and toast */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 40px 20px;
  text-align: center;
}

.empty-state__icon {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.empty-state__icon .ui-icon {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 15px 0 5px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.empty-state p {
  max-width: 480px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.empty-state .button {
  margin-top: 18px;
}

.error-page {
  max-width: 680px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 50px 20px;
  text-align: center;
}

.error-code {
  position: absolute;
  color: color-mix(in srgb, var(--brand) 6%, transparent);
  font-size: clamp(130px, 18vw, 230px);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.error-page__icon {
  position: relative;
  width: 70px;
  height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.error-page__icon--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.error-page h1 {
  position: relative;
  margin: 18px 0 8px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.error-page > p {
  position: relative;
  max-width: 480px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.error-page__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}

.ad-slot {
  min-height: var(--ad-slot-height, 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 56px 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.ad-slot > span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-slot > div {
  font-size: 12px;
}

.ui-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 180;
  max-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px 13px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.ui-toast.is-visible {
  animation: toast-in 180ms ease both;
}

.ui-toast::before {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  content: "i";
  font-size: 13px;
  font-weight: 800;
}

.ui-toast[data-type="copy"] {
  border-color: #6366f1;
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 18px 38px rgb(79 70 229 / 0.3);
}

.ui-toast[data-type="copy"]::before {
  background: #22c55e;
  color: #fff;
  content: "✓";
}

.ui-toast[data-type="success"] {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.ui-toast[data-type="success"]::before {
  background: var(--success);
  color: #fff;
  content: "✓";
}

.ui-toast[data-type="error"] {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.ui-toast[data-type="error"]::before {
  background: var(--danger);
  color: #fff;
  content: "!";
}

.ui-toast[data-type="warning"] {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.ui-toast[data-type="warning"]::before {
  background: var(--warning);
  color: #fff;
  content: "!";
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-container {
  max-width: 1280px;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(480px, 1.2fr);
  gap: 70px;
  margin: 0 auto;
  padding: 46px 32px 30px;
}

.footer-brand {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: #fff;
}

.footer-brand img {
  width: 192px;
  height: auto;
}

.footer-intro > p {
  max-width: 360px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.footer-trust .ui-icon {
  width: 15px;
  height: 15px;
}

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

.footer-links-grid > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-links-grid h2 {
  margin: 0 0 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.footer-links-grid a,
.footer-links-grid button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: color var(--transition);
}

.footer-links-grid a:hover,
.footer-links-grid button:hover {
  color: var(--brand-strong);
}

.pwa-install-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.footer-links-grid small {
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-bottom {
  max-width: 1280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 18px 32px 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

/* Responsive */
@media (min-width: 640px) {
  .tool-options .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .tool-options .sm\:col-span-2 {
    grid-column: span 2 / span 2;
  }

  .tool-options .sm\:col-span-1 {
    grid-column: span 1 / span 1;
  }
}

@media (max-width: 1199px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-shortcuts {
    display: grid;
    grid-template-columns: 0.65fr 1.35fr;
    gap: 12px;
  }

  .hero-shortcuts__head,
  .hero-privacy-note {
    align-self: center;
  }

  .hero-shortcuts__list {
    grid-column: 2;
    grid-row: 1 / 3;
  }

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

  .trust-section,
  .about-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .api-section {
    gap: 28px;
  }

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

  .tool-panel--result {
    position: static;
  }

  .footer-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 1023px) {
  :root {
    --topbar-height: 68px;
  }

  .public-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: min(88vw, 352px);
    min-height: 100dvh;
    transform: translateX(-102%);
    box-shadow: var(--shadow-md);
    visibility: hidden;
  }

  .public-body.sidebar-open .app-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .sidebar-close-button {
    display: inline-flex;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    border: 0;
    background: rgb(15 23 42 / 0.56);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  .public-body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  .public-body.drawer-lock {
    overflow: hidden;
  }

  .app-topbar {
    padding: 10px 20px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }

  .topbar-context,
  .desktop-only {
    display: none !important;
  }

  .topbar-mobile-brand,
  .mobile-only,
  .mobile-tools-button {
    display: block;
  }

  .topbar-mobile-brand {
    margin-right: auto;
  }

  .topbar-mobile-brand a {
    width: clamp(128px, 38vw, 160px);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    border-radius: 10px;
    background: #fff;
  }

  .topbar-mobile-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .mobile-tools-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    flex: 0 0 auto;
    padding-inline: 13px;
  }

  .mobile-tools-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
  }

  .mobile-tools-button__icon .ui-icon {
    display: block;
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
  }

  .mobile-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .mobile-search-panel:not([hidden]) {
    display: block;
  }

  .content-container {
    padding: 24px 20px 60px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-inline: 20px;
  }

  .footer-bottom {
    padding-inline: 20px;
  }
}

@media (max-width: 767px) {
  .content-container {
    padding: 18px 16px 50px;
  }

  .app-topbar {
    gap: 6px;
    padding-inline: 12px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .mobile-tools-button {
    padding-inline: 10px;
    font-size: 14px;
  }

  .mobile-search-panel {
    padding-inline: 16px;
  }

  .home-hero {
    gap: 24px;
    padding: 25px 18px 18px;
  }

  .home-hero h1 {
    font-size: clamp(37px, 11vw, 50px);
  }

  .hero-search__control {
    min-height: 56px;
    flex-wrap: wrap;
    padding: 9px 10px;
  }

  .hero-search__control > .ui-icon {
    width: 18px;
    height: 18px;
  }

  .hero-search__control input {
    width: calc(100% - 32px);
    flex-basis: calc(100% - 32px);
    font-size: 13px;
  }

  .hero-search__control .button {
    width: 100%;
    min-height: 44px;
  }

  .quick-search {
    display: block;
  }

  .quick-search > span {
    display: block;
    margin-bottom: 6px;
  }

  .quick-search > div {
    flex-wrap: nowrap;
    margin-right: -18px;
    padding-right: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-search > div::-webkit-scrollbar {
    display: none;
  }

  .hero-shortcuts {
    display: block;
    padding: 14px;
  }

  .hero-shortcuts__list {
    margin-top: 2px;
  }

  .hero-privacy-note {
    margin-top: 12px;
  }

  .page-section,
  .trust-section,
  .api-section,
  .about-section,
  .tool-help,
  .faq-section,
  .related-section {
    margin-top: 48px;
  }

  .section-heading {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .section-heading .section-link {
    display: none;
  }

  .popular-tools-grid,
  .category-showcase-grid,
  .recent-tools-grid,
  .collection-grid,
  .related-tools-grid,
  .tool-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-showcase {
    padding: 18px;
  }

  .category-showcase__toggle {
    display: inline-flex;
  }

  .category-showcase__tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .category-showcase__tools a {
    min-height: 44px;
  }

  .trust-section {
    padding: 22px 18px;
  }

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

  .api-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 26px 18px;
  }

  .about-section {
    gap: 26px;
  }

  .breadcrumb {
    margin-bottom: 15px;
    overflow: hidden;
  }

  .breadcrumb ol {
    min-width: 0;
    overflow: hidden;
  }

  .breadcrumb li {
    font-size: 13px;
  }

  .tool-header {
    gap: 13px;
    flex-wrap: wrap;
  }

  .tool-header__content {
    width: calc(100% - 61px);
    flex: 1 1 calc(100% - 61px);
  }

  .tool-favorite {
    flex: 1 0 100%;
  }

  .tool-header__icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }

  .tool-header__icon .ui-icon {
    width: 23px;
    height: 23px;
  }

  .tool-header h1 {
    font-size: clamp(27px, 8.2vw, 36px);
  }

  .tool-header__content > p {
    font-size: 12px;
  }

  .tool-badges {
    margin-left: -61px;
    padding-top: 5px;
  }

  .tool-workspace {
    gap: 12px;
    margin-top: 22px;
  }

  .tool-panel__header {
    min-height: 64px;
    padding: 12px 14px;
  }

  #tool-form,
  .result-content {
    padding: 16px;
  }

  .tool-form-grid--two,
  .how-to-steps,
  .image-result__stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .selected-file {
    padding: 8px;
  }

  .image-selection__summary,
  .image-batch-result__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-selection-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .image-selection-item__details {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-selection-item__status {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
  }

  .image-selection-item__remove,
  .image-batch-result__download-all {
    width: 100%;
  }

  .image-batch-progress {
    padding: 10px 0;
  }

  .image-batch-progress__item {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-batch-progress__item > span:nth-child(2) {
    text-align: left;
  }

  .image-result-item {
    padding: 11px;
  }

  .image-result-item__actions > * {
    flex: 1 1 100%;
  }

  .word-counter-input textarea {
    min-height: 220px;
  }

  .result-content {
    min-height: 230px;
  }

  .result-empty {
    min-height: 198px;
  }

  .result-actions {
    padding: 10px 13px;
  }

  .result-actions .button {
    flex: 1 1 auto;
  }

  .result-actions #btn-clear {
    margin-left: 0;
  }

  .cpf-result-list li {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas:
      "select value copy-value"
      "select state copy-state";
  }

  .cpf-result-list small {
    display: block;
  }

  .content-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    padding: 17px;
  }

  .content-card__icon {
    width: 36px;
    height: 36px;
  }

  .collection-header {
    padding: 20px 17px;
  }

  .collection-header__icon {
    width: 48px;
    height: 48px;
  }

  .collection-header h1,
  .search-page__header h1,
  .institutional-page h1 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .collection-help {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .collection-help .button {
    grid-column: 1 / -1;
  }

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

  .search-start-grid a {
    min-height: 130px;
  }

  .institutional-page > header,
  .institutional-page__body {
    padding: 22px 18px;
  }

  .footer-container {
    padding: 38px 16px 25px;
  }

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

  .footer-links-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    display: block;
    padding: 17px 16px 22px;
  }

  .footer-bottom p + p {
    margin-top: 5px;
  }

  .ui-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

/* API */
.api-key-reveal { display: grid; gap: 10px; overflow-wrap: anywhere; scroll-margin-block: 120px; }
.api-context-cta { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 20px; margin: 28px 0; padding: 24px; border: 1px solid color-mix(in srgb,var(--brand) 32%,var(--border)); border-radius: 22px; background: linear-gradient(135deg,color-mix(in srgb,var(--brand) 10%,var(--surface)),var(--surface)); box-shadow: var(--shadow-sm); }
.api-context-cta__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff; }
.api-context-cta__icon svg { width: 25px; height: 25px; }
.api-context-cta__content { min-width: 0; }
.api-context-cta__content h2 { margin: 3px 0 5px; color: var(--text); font-size: clamp(1.15rem,2vw,1.45rem); }
.api-context-cta__content p { margin: 0; color: var(--text-muted); }
.api-context-cta__button { white-space: nowrap; }
@media (max-width: 760px) { .api-context-cta { grid-template-columns: auto 1fr; padding: 20px; } .api-context-cta__button { grid-column: 1/-1; width: 100%; } }
.api-key-reveal code, .api-docs code, .api-console code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.api-project { margin-top: 20px; }
.api-project__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.api-console h3 { margin: 20px 0 10px; color: var(--text); }
.api-console details, .api-docs details { margin-top: 12px; }
.api-console summary, .api-docs summary { cursor: pointer; color: var(--brand-strong); font-weight: 800; }
.api-console .admin-table-wrap, .api-docs .admin-table-wrap { overflow-x: auto; }
.api-console .admin-table, .api-docs .admin-table { width: 100%; border-collapse: collapse; color: var(--text); }
.api-console .admin-table th, .api-console .admin-table td, .api-docs .admin-table th, .api-docs .admin-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.api-console .admin-table small, .api-docs .admin-table small { display: block; color: var(--text-muted); }
.api-docs pre { overflow-x: auto; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-subtle); color: var(--text); }
@media (max-width: 760px) { .api-project__header { align-items: stretch; flex-direction: column; } }

/* API credit store and Pix checkout */
.account-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.credit-package-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.credit-package { display: flex; flex-direction: column; padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.credit-package > span { color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.credit-package > h2 { margin: 12px 0 0; color: var(--text); font-size: 34px; line-height: 1; }
.credit-package > p { margin: 5px 0 18px; color: var(--text-muted); }
.credit-package > strong { margin-bottom: 24px; color: var(--brand-strong); font-size: 24px; }
.credit-package form { margin-top: auto; }
.payment-status { display: inline-flex; width: max-content; align-items: center; padding: 7px 11px; border-radius: 999px; background: var(--surface-subtle); color: var(--text-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.payment-status--paid { background: var(--success-soft); color: var(--success); }
.payment-status--pending,.payment-status--creating,.payment-status--confirmed { background: var(--warning-soft); color: var(--warning); }
.payment-status--failed,.payment-status--canceled,.payment-status--overdue,.payment-status--refund_attention { background: var(--danger-soft); color: var(--danger); }
.pix-payment-grid { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(0,1.3fr); gap: 18px; }
.pix-qr { display: flex; align-items: center; flex-direction: column; text-align: center; }
.pix-qr img { width: min(280px,100%); height: auto; border: 12px solid #fff; border-radius: 12px; image-rendering: pixelated; }
.pix-qr__placeholder { display: grid; width: 260px; max-width: 100%; aspect-ratio: 1; place-items: center; border: 1px dashed var(--border); color: var(--text-muted); }
.pix-copy-code { width: 100%; margin-bottom: 12px; padding: 14px; resize: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-subtle); color: var(--text); font-family: ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap: anywhere; }
.payment-waiting { display: flex; align-items: center; gap: 12px; margin: 22px 0; padding: 15px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); }
.payment-waiting > span { width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: payment-spin .8s linear infinite; }
.payment-waiting p { display: grid; gap: 3px; margin: 0; color: inherit; }
.payment-waiting small { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.payment-result { text-align: center; }
.payment-result--success { border-color: color-mix(in srgb,var(--success) 40%,var(--border)); background: var(--success-soft); }
@keyframes payment-spin { to { transform: rotate(360deg); } }
@media(max-width:900px){.credit-package-grid{grid-template-columns:1fr}.pix-payment-grid{grid-template-columns:1fr}}

/* Dedicated API documentation */
.api-docs-body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: Manrope, Inter, "Segoe UI", sans-serif;
}

.docs-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.docs-brand { display: flex; width: 156px; padding: 2px 3px; border-radius: var(--radius-sm); background: #fff; }
.docs-brand img { width: 100%; height: auto; }
.docs-product { display: flex; align-items: center; gap: 10px; padding-left: 22px; border-left: 1px solid var(--border); }
.docs-product strong { padding: 4px 8px; border-radius: 7px; background: var(--brand); color: #fff; font-size: 12px; letter-spacing: .08em; }
.docs-product small { color: var(--text-muted); font-weight: 700; }
.docs-topbar__actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.docs-topbar__actions a { color: var(--text-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.docs-topbar__actions a:hover { color: var(--brand-strong); }
.docs-icon-button { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px; }
.docs-menu-button { display: none; }

.docs-shell { min-height: 100vh; padding-top: 72px; }
.docs-sidebar {
  position: fixed;
  z-index: 90;
  top: 72px;
  bottom: 0;
  left: 0;
  width: 272px;
  overflow-y: auto;
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.docs-sidebar__intro { display: grid; gap: 4px; margin: 0 10px 22px; }
.docs-sidebar__intro span { color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.docs-sidebar__intro strong { font-size: 15px; }
.docs-sidebar nav { display: grid; gap: 3px; }
.docs-sidebar nav a { padding: 10px 12px; border-radius: 9px; color: var(--text-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.docs-sidebar nav a:hover, .docs-sidebar nav a.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.docs-endpoint-count { float: right; min-width: 24px; padding: 1px 6px; border-radius: 999px; background: var(--brand-strong); color: #fff; font-size: 12px; text-align: center; }
.docs-sidebar__endpoints { display: grid; max-height: 44vh; margin: 2px 0 8px 12px; padding-left: 8px; overflow-y: auto; border-left: 1px solid var(--border); }
.docs-sidebar nav .docs-endpoint-link { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 5px; padding: 7px 8px; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.docs-sidebar nav .docs-endpoint-link span { color: var(--brand-strong); font-size: 12px; font-weight: 900; }
.docs-sidebar__help { margin-top: 28px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-subtle); }
.docs-sidebar__help strong { font-size: 13px; }
.docs-sidebar__help p { margin: 6px 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.docs-sidebar__help a { color: var(--brand-strong); font-size: 12px; font-weight: 800; text-decoration: none; }
.docs-sidebar-overlay { display: none; }

.docs-content { width: calc(100% - 272px); min-width: 0; max-width: 1260px; margin-left: 272px; padding: 54px clamp(28px, 5vw, 78px) 100px; }
.docs-content code, .docs-content pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.docs-content :where(section[id]) { scroll-margin-top: 96px; }
.docs-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr); align-items: center; gap: 56px; min-width: 0; min-height: 470px; padding-bottom: 64px; }
.docs-hero > * { min-width: 0; }
.docs-kicker { color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.docs-hero h1 { max-width: 760px; margin: 14px 0 18px; color: var(--text); font-size: clamp(38px, 5vw, 64px); line-height: 1.05; letter-spacing: -.045em; }
.docs-hero p { max-width: 690px; margin: 0; color: var(--text-muted); font-size: 16px; line-height: 1.75; }
.docs-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.docs-code-card { min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid #334155; border-radius: 18px; background: #0f172a; box-shadow: 0 24px 60px rgb(15 23 42 / .22); }
.docs-code-card > div { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border-bottom: 1px solid #334155; }
.docs-code-card > div > span { width: 8px; height: 8px; border-radius: 50%; background: #f87171; }
.docs-code-card > div > span:nth-child(2) { background: #fbbf24; }
.docs-code-card > div > span:nth-child(3) { background: #4ade80; }
.docs-code-card small { margin-left: auto; color: #94a3b8; font-size: 12px; }
.docs-code-card pre { margin: 0; padding: 22px; overflow-x: auto; color: #cbd5e1; font-size: 12px; line-height: 1.75; }
.docs-code-card b { color: #67e8f9; }

.docs-section { padding: 64px 0; border-top: 1px solid var(--border); }
.docs-section > header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 30px; }
.docs-section > header > span { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.docs-section h2 { margin: 0 0 5px; color: var(--text); font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; }
.docs-section > header p { margin: 0; color: var(--text-muted); }
.docs-section h3 { color: var(--text); }
.docs-steps, .docs-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.docs-steps article, .docs-feature-grid article { padding: 22px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.docs-steps article > b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; }
.docs-steps h3, .docs-feature-grid h3 { margin: 18px 0 7px; font-size: 15px; }
.docs-steps p, .docs-feature-grid p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.docs-callout { margin-bottom: 20px; padding: 20px; border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border)); border-radius: 14px; background: var(--brand-soft); }
.docs-callout > code { display: block; overflow-wrap: anywhere; color: var(--brand-strong); font-weight: 700; }
.docs-callout p { margin: 10px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.docs-callout--info { margin-top: 24px; }

.api-playground { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(380px, 1.2fr); overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.api-playground__form { display: grid; align-content: start; gap: 17px; padding: 26px; border-right: 1px solid var(--border); }
.api-playground__form label { display: grid; gap: 7px; color: var(--text); font-size: 12px; font-weight: 800; }
.api-playground__form label small { color: var(--text-muted); font-weight: 500; }
.api-playground__form input, .api-playground__form select, .api-playground__form textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-subtle); color: var(--text); font: inherit; font-weight: 500; outline: none; }
.api-playground__form input, .api-playground__form select { min-height: 44px; padding: 0 12px; }
.api-playground__form textarea { resize: vertical; padding: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.api-playground__form :is(input, select, textarea):focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.api-key-input { display: flex; }
.api-key-input input { min-width: 0; border-radius: 10px 0 0 10px; }
.api-key-input button { padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--brand-strong); cursor: pointer; font-size: 12px; font-weight: 800; }
.api-playground__notice { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.api-playground__response { min-width: 0; background: #0f172a; color: #e2e8f0; }
.api-playground__response > header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 18px; border-bottom: 1px solid #334155; }
.api-playground__response > header > div { display: grid; gap: 3px; }
.api-playground__response header button { border: 1px solid #475569; border-radius: 8px; background: #1e293b; color: #e2e8f0; cursor: pointer; padding: 8px 10px; font-size: 12px; font-weight: 700; }
.api-response-status { color: #cbd5e1; font-size: 12px; font-weight: 800; }
.api-response-status[data-state="success"] { color: #4ade80; }
.api-response-status[data-state="error"] { color: #fca5a5; }
.api-playground__response small { color: #94a3b8; }
.api-response-headers { min-height: 74px; padding: 14px 18px; border-bottom: 1px solid #334155; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.api-playground__response pre { min-height: 350px; max-height: 620px; margin: 0; padding: 20px; overflow: auto; color: #e2e8f0; font-size: 12px; line-height: 1.7; }

.docs-endpoint-list { display: grid; gap: 10px; }
.docs-endpoint { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.docs-endpoint summary { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 17px; cursor: pointer; list-style: none; }
.docs-endpoint summary::-webkit-details-marker { display: none; }
.docs-endpoint summary > code { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.docs-endpoint summary > span:last-child { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.docs-method { padding: 5px 7px; border-radius: 6px; background: #dcfce7; color: #166534; font-size: 12px; font-weight: 900; text-align: center; }
[data-theme="dark"] .docs-method { background: #14532d; color: #bbf7d0; }
.docs-endpoint > div { padding: 0 18px 18px; border-top: 1px solid var(--border); }
.docs-endpoint > div > p { color: var(--text-muted); font-size: 13px; }
.docs-endpoint__actions { display: flex; margin: 16px 0; }
.docs-endpoint > div > h3 { margin: 18px 0 6px; color: var(--text); font-size: 13px; }
.docs-endpoint dl { display: flex; flex-wrap: wrap; gap: 24px; }
.docs-endpoint dl div { display: grid; gap: 3px; }
.docs-endpoint dt { color: var(--text-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.docs-endpoint dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 700; }
.docs-endpoint pre, .docs-two-columns pre, .docs-example-list pre { overflow-x: auto; margin: 16px 0 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-subtle); color: var(--text); font-size: 12px; line-height: 1.7; }
.docs-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.docs-two-columns h3 { margin-top: 0; }
.docs-header-list { display: grid; gap: 1px; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; list-style: none; background: var(--border); }
.docs-header-list li { display: flex; justify-content: space-between; gap: 20px; padding: 13px 15px; background: var(--surface); }
.docs-header-list span { color: var(--text-muted); font-size: 12px; }
.docs-error-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.docs-error-grid article { display: grid; gap: 7px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.docs-error-grid b { color: var(--danger); font-size: 20px; }
.docs-error-grid span { color: var(--text-muted); font-size: 12px; }
.docs-example-list { display: grid; gap: 12px; }
.docs-example-list details { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.docs-example-list summary { padding: 15px 18px; cursor: pointer; color: var(--brand-strong); font-size: 13px; font-weight: 800; }
.docs-example-list pre { margin: 0; border-width: 1px 0 0; border-radius: 0; }
.docs-version article { display: flex; gap: 24px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.docs-version time { color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.docs-version article p, .docs-version > p { color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.docs-version article p { margin-bottom: 0; }

@media (max-width: 1023px) {
  .docs-menu-button { display: inline-grid; place-items: center; }
  .docs-sidebar { transform: translateX(-102%); transition: transform 180ms ease; box-shadow: 18px 0 50px rgb(15 23 42 / .2); }
  .docs-menu-open .docs-sidebar { transform: translateX(0); }
  .docs-sidebar-overlay { position: fixed; z-index: 80; inset: 72px 0 0; display: block; border: 0; background: rgb(15 23 42 / .42); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .docs-menu-open .docs-sidebar-overlay { opacity: 1; pointer-events: auto; }
  .docs-content { width: 100%; margin-left: 0; }
  .docs-hero { grid-template-columns: 1fr; min-height: auto; }
  .api-playground { grid-template-columns: 1fr; }
  .api-playground__form { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
  .docs-topbar { height: 64px; gap: 12px; padding: 0 14px; }
  .docs-brand { width: 120px; }
  .docs-product { padding-left: 12px; }
  .docs-product small, .docs-topbar__actions > a { display: none; }
  .docs-topbar__actions { gap: 8px; }
  .docs-shell { padding-top: 64px; }
  .docs-sidebar { top: 64px; width: min(300px, 86vw); }
  .docs-sidebar-overlay { inset-block-start: 64px; }
  .docs-content { padding: 34px 18px 72px; }
  .docs-hero { gap: 32px; padding-bottom: 48px; }
  .docs-hero h1 { overflow-wrap: anywhere; font-size: 38px; }
  .docs-steps, .docs-feature-grid, .docs-two-columns { grid-template-columns: 1fr; }
  .docs-error-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-section { padding: 48px 0; }
  .docs-endpoint summary { grid-template-columns: 55px minmax(0, 1fr); }
  .docs-endpoint summary > span:last-child { grid-column: 2; }
  .api-playground__form { padding: 20px; }
  .api-playground__response > header { align-items: flex-start; gap: 12px; }
  .docs-version article { flex-direction: column; gap: 8px; }
}

@media (max-width: 419px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .mobile-tools-button {
    width: 44px;
    padding-inline: 0;
  }

  .mobile-tools-button__label {
    display: none !important;
  }

  .tool-card {
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    gap: 11px;
    padding: 14px;
  }

  .tool-card__icon {
    width: 44px;
    height: 44px;
  }

  .segmented-options {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .field-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

@media (forced-colors: active) {
  .button,
  .tool-card,
  .tool-panel,
  .category-showcase,
  .sidebar-primary-link,
  .segmented-options span {
    border: 1px solid CanvasText;
  }
}

/* Consent Banner */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 300;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.consent-banner[hidden] {
  display: none !important;
}

.consent-banner__inner {
  width: 100%;
  max-width: 860px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 24px;
  pointer-events: auto;
}

.consent-banner__title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.consent-banner__text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.consent-banner__text a {
  color: var(--brand-strong);
  text-decoration: underline;
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Keep the essential-only action readable before and during hover. */
#consent-reject {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--text) !important;
}

#consent-reject:hover:not(:disabled),
#consent-reject:focus-visible {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong) !important;
}

@media (min-width: 640px) {
  .consent-banner {
    bottom: 24px;
  }
}

/* Consent Details */
.consent-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.consent-details[hidden] {
  display: none !important;
}

.consent-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.consent-option:last-child {
  border-bottom: 0;
}

.consent-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.consent-option strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.consent-option small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-details__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Consent preference form (cookies page) */
.consent-form {
  display: grid;
  gap: 16px;
  max-width: 512px;
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.consent-form label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.consent-form strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.consent-form small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-form .button--primary {
  justify-self: start;
}

/* Ad Slots */
.ad-slot {
  position: relative;
  width: 100%;
  min-height: 90px;
  margin: 18px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: min-height 180ms ease;
}

.ad-slot[hidden] {
  display: none !important;
}

.ad-slot--active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
  background: var(--surface);
}

.ad-slot--empty {
  opacity: 0.7;
}

.ad-slot--failed {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.ad-slot__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-subtle));
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot__code {
  display: none;
}

.ad-slot__container {
  width: 100%;
  min-height: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot__container > * {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 767px) {
  .ad-slot {
    min-height: 250px;
  }
}

/* Responsive advertising inventory */
.ad-slot {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 24px auto;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.ad-slot--workspace {
  width: calc(100% - 32px);
  margin: 18px 16px 16px;
  background: var(--surface-subtle);
}

.ad-slot__label {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.2;
}

.ad-slot__creative {
  max-width: 100%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  overflow: hidden;
}

.ad-slot__creative > iframe,
.ad-slot__creative > img,
.ad-slot__creative > a,
.ad-slot__creative > div {
  flex: 0 0 auto;
}

.ad-slot--failed {
  display: none;
}

.ad-slot__dock-close {
  display: none;
}

.ad-slot__dock-placeholder {
  width: 100%;
  margin: 24px 0;
}

.ad-slot--result-dock.ad-slot--docked {
  position: fixed;
  right: 18px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 65;
  width: min(calc(100vw - var(--sidebar-width) - 36px), calc(var(--ad-width) + 48px));
  max-height: calc(100vh - var(--topbar-height) - 30px);
  margin: 0;
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
  background: var(--surface);
  box-shadow: 0 20px 52px rgb(15 23 42 / 0.22);
  animation: ad-dock-enter 220ms ease-out both;
}

.ad-slot--result-dock.ad-slot--docked .ad-slot__dock-close {
  position: absolute;
  top: -11px;
  right: -11px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

@keyframes ad-dock-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.collection-grid__ad {
  min-width: 0;
  grid-column: 1 / -1;
}

.house-ad {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--border));
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface));
  box-shadow: var(--shadow-xs);
}

.house-ad--workspace {
  width: calc(100% - 32px);
  grid-template-columns: auto minmax(0, 1fr);
  margin: 18px 16px 16px;
  padding: 14px;
}

.house-ad--workspace .button {
  grid-column: 1 / -1;
  width: 100%;
}

.house-ad__icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: var(--shadow-xs);
}

.house-ad__icon .ui-icon {
  width: 21px;
  height: 21px;
}

.house-ad__content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.house-ad__content > span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.house-ad__content strong {
  color: var(--text);
  font-size: 15px;
}

.house-ad__content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .ad-slot {
    min-height: 0;
    margin-block: 18px;
    padding: 8px 4px 10px;
  }

  .house-ad {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    margin-block: 18px;
    padding: 14px;
  }

  .house-ad .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ad-slot--result-dock.ad-slot--docked {
    right: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(calc(100vw - 20px), calc(var(--ad-width) + 20px));
    max-height: 30vh;
    padding: 6px 4px 8px;
    transform: translateX(50%);
    animation-name: ad-dock-enter-mobile;
  }
}

@keyframes ad-dock-enter-mobile {
  from { opacity: 0; transform: translate(50%, 18px); }
  to { opacity: 1; transform: translate(50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ad-slot--result-dock.ad-slot--docked { animation: none; }
}

@media (max-width: 351px) {
  .ad-slot--leaderboard {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding-inline: 0;
    border-radius: 0;
  }
}
.topbar-credit-balance { display:inline-flex; align-items:center; min-height:36px; padding:0 12px; border-radius:999px; background:var(--brand-soft); color:var(--brand-strong); font-size:12px; font-weight:800; text-decoration:none; white-space:nowrap; }
.api-wallet-balance { display:inline-grid; gap:2px; margin-top:14px; padding:10px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.api-wallet-balance small { color:var(--text-muted); }
.api-project > summary { cursor:pointer; list-style:none; }
.api-project > summary::-webkit-details-marker { display:none; }
.api-project > summary::after { content:'+'; margin-left:12px; font-size:24px; color:var(--brand-strong); }
.api-project[open] > summary::after { content:'−'; }
.api-project[open] > summary { margin-bottom:20px; }
.api-scope-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:6px 12px; }
.api-project-meta { display:flex; align-items:center; justify-content:flex-end; gap:8px; color:var(--text-muted); font-size:12px; white-space:nowrap; }
.api-project-meta > * + *::before { content:'·'; margin-right:8px; color:var(--border-strong); }
.api-project-meta strong { color:var(--brand-strong); font-size:13px; }
@media (max-width: 640px) { .api-project-meta { justify-content:flex-start; } }
.pagination{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.5rem;margin:1.5rem 0}.pagination__link{display:inline-flex;align-items:center;justify-content:center;min-width:2.25rem;min-height:2.25rem;padding:.4rem .7rem;border:1px solid var(--border,#dbe2ea);border-radius:.65rem;background:var(--surface,#fff);color:var(--text,#0f172a);font-size:.875rem;text-decoration:none}.pagination__link:hover{border-color:#6366f1}.pagination__link.is-current{background:#4f46e5;border-color:#4f46e5;color:#fff}.pagination__link.is-disabled{opacity:.45;pointer-events:none}.pagination__ellipsis{color:var(--muted,#64748b)}
