/* ==========================================================================
   Utilidades Online — folha de estilo principal
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f5f8fd;
  --bg-soft: #eaeff8;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --text: #0e1729;
  --text-soft: #334155;
  --muted: #61708a;
  --border: #e1e8f2;
  --border-strong: #c8d3e3;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #e8efff;
  --accent: #0d9488;
  --success: #15803d;
  --success-soft: #e7f7ee;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --warning: #b45309;
  --warning-soft: #fff3e2;
  --shadow-sm: 0 1px 2px rgba(14, 23, 41, 0.05);
  --shadow: 0 12px 32px -20px rgba(14, 23, 41, 0.4);
  --shadow-lg: 0 34px 70px -38px rgba(14, 23, 41, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --header-h: 68px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1120;
  --bg-soft: #0e1728;
  --surface: #111b2d;
  --surface-2: #0e1726;
  --text: #e8eefb;
  --text-soft: #c3d0e4;
  --muted: #8da0ba;
  --border: #1e2b41;
  --border-strong: #2c3c57;
  --brand: #6ba4ff;
  --brand-strong: #93c0ff;
  --brand-soft: #152643;
  --accent: #2dd4bf;
  --success: #4ade80;
  --success-soft: #10281b;
  --danger: #f87171;
  --danger-soft: #2c1417;
  --warning: #fbbf24;
  --warning-soft: #2b2110;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

h1, h2, h3, h4, h5 {
  color: var(--text);
  line-height: 1.2;
}

[hidden] {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
}

::selection {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.container-narrow {
  width: min(940px, calc(100% - 40px));
  margin-inline: auto;
}

/* ============================ Header ============================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.9);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.nav-desktop {
  display: flex;
  gap: 2px;
  margin-left: 18px;
}

.nav-desktop a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.search-trigger kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.menu-btn {
  display: none;
}

.mobile-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 12px 20px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-nav a:hover {
  background: var(--surface-2);
  color: var(--brand);
}

/* ============================ Hero ============================ */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(46px, 7vw, 88px) 0 clamp(34px, 5vw, 54px);
  background:
    radial-gradient(900px 420px at 18% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(760px 380px at 88% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin-inline: auto;
  text-align: center;
}

.hero-home {
  padding-top: clamp(26px, 4vw, 48px);
  padding-bottom: 46px;
}

.home-popular {
  margin-top: 34px;
}

.home-more {
  margin: 22px 0 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 20px 0 14px;
  font-size: clamp(2.05rem, 5.4vw, 3.55rem);
  line-height: 1.04;
  letter-spacing: -0.042em;
}

.hero h1 .grad {
  display: block;
  background: linear-gradient(92deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 640px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.65;
}

.search-hero {
  position: relative;
  max-width: 620px;
  margin-inline: auto;
  text-align: left;
}

.search-hero form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-hero form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow);
}

.search-hero input {
  flex: 1;
  min-width: 0;
  padding: 11px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.hero-results {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 370px;
  overflow: auto;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--surface-2);
}

.search-result-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.9rem;
}

.search-result-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-body strong {
  font-size: 0.92rem;
}

.search-result-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.search-heading,
.search-empty {
  margin: 6px 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-stats li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-stats li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============================ Sections ============================ */

.section {
  padding: 44px 0;
}

.section-tight {
  padding: 28px 0;
}

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

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.028em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.section-link {
  flex: none;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

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

.grid {
  display: grid;
  gap: 14px;
}

.cards-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cards-cat { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 19px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.card,
a.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

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

.tool-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cat, var(--brand)) 12%, transparent);
  color: var(--cat, var(--brand));
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.01rem;
  letter-spacing: -0.012em;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tool-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
}

.cat-card {
  position: relative;
  overflow: hidden;
}

.cat-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cat, var(--brand)) 10%, transparent);
  pointer-events: none;
}

.cat-card .cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cat-card h3 {
  margin: 10px 0 4px;
  font-size: 1rem;
  letter-spacing: -0.012em;
}

.cat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.notice {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  color: var(--text-soft);
  font-size: 0.89rem;
  line-height: 1.6;
}

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

/* ============================ Steps ============================ */

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

.step {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.step-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.9rem;
}

.step h3 {
  margin: 12px 0 5px;
  font-size: 0.98rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ============================ Breadcrumb ============================ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 22px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

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

.breadcrumb a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.breadcrumb .sep {
  opacity: 0.55;
}

/* ============================ Page / tool ============================ */

.page-narrow {
  max-width: 980px;
  margin-inline: auto;
}

.tool-header {
  max-width: 820px;
  margin: 14px 0 22px;
}

.tool-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  letter-spacing: -0.032em;
}

.tool-intro {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-row .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.tool-shell {
  padding: clamp(17px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

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

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

.field-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

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

.mono {
  font-family: var(--mono);
  font-size: 0.88rem;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
}

.range-value {
  min-width: 46px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.89rem;
  cursor: pointer;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--brand) 90%, transparent);
}

.btn-primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

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

.btn-sm {
  padding: 7px 11px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn.copied {
  border-color: var(--success);
  color: var(--success);
}

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

.result-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.result-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-value {
  color: var(--text);
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.result-value.big {
  color: var(--brand);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.result-value.small {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.result-highlight {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.error-msg,
.success-msg {
  display: block;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}

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

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

.hidden {
  display: none !important;
}

/* ============================ Tables ============================ */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ============================ Diff ============================ */

.diff {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.81rem;
}

.diff-line {
  display: flex;
  gap: 10px;
  padding: 3px 10px;
  border-left: 3px solid transparent;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diff-ln {
  flex: none;
  width: 36px;
  color: var(--muted);
  font-size: 0.71rem;
  text-align: right;
  user-select: none;
}

.diff-add {
  border-left-color: var(--success);
  background: var(--success-soft);
}

.diff-del {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.diff-same {
  color: var(--text-soft);
}

/* ============================ FAQ / prose ============================ */

.prose {
  max-width: 780px;
}

.prose h2 {
  margin: 30px 0 10px;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 20px 0 8px;
  font-size: 1.02rem;
}

.prose p,
.prose li {
  color: var(--text-soft);
  line-height: 1.72;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

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

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

.faq summary {
  position: relative;
  padding: 14px 26px 14px 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2013";
}

.faq-body {
  padding: 0 0 15px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.68;
}

.faq-body p {
  margin: 0;
}

/* ============================ Image tools ============================ */

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 30px 18px;
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface-2));
}

.dropzone strong {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.dropzone span {
  font-size: 0.8rem;
}

.image-stage {
  display: grid;
  gap: 12px;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  overflow: auto;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, color-mix(in srgb, var(--border) 60%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--border) 60%, transparent) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--border) 60%, transparent) 75%),
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--border) 60%, transparent) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.canvas-wrap canvas,
.canvas-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
}

.canvas-wrap.picking canvas {
  cursor: crosshair;
}

.image-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  vertical-align: middle;
}

.color-preview {
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #2563eb;
}

/* ============================ QR / password ============================ */

.qr-output {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.qr-output img,
.qr-output canvas {
  max-width: 100%;
  height: auto;
}

.password-output {
  padding: 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.strength-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.strength-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--danger);
  transition: width 0.25s ease, background 0.25s ease;
}

.strength-text {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.counter-grid {
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
}

.big-stat {
  font-size: clamp(1.35rem, 3.2vw, 1.8rem);
}

/* ============================ Footer ============================ */

.site-footer {
  margin-top: 64px;
  padding: 42px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}

.footer-brand p {
  max-width: 330px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.65;
}

.footer h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 7px;
}

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

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.79rem;
}

.footer-bottom p {
  margin: 0;
}

.disclaimer {
  max-width: 680px;
  font-size: 0.76rem;
  line-height: 1.6;
}

/* ============================ Search overlay ============================ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: start center;
  padding: 11vh 16px 16px;
  background: color-mix(in srgb, #050b16 62%, transparent);
  backdrop-filter: blur(5px);
}

.search-panel {
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 15px;
  border-bottom: 1px solid var(--border);
}

.search-top svg {
  flex: none;
  color: var(--muted);
}

.search-top input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#searchResults {
  max-height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
}

.overlay-close {
  flex: none;
}

/* ============================ Utilitários ============================ */

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.full { width: 100%; }

.cat-texto { --cat: #2563eb; }
.cat-calculadoras { --cat: #7c3aed; }
.cat-saude { --cat: #e11d48; }
.cat-energia { --cat: #ca8a04; }
.cat-trabalho { --cat: #d97706; }
.cat-datas-e-horas { --cat: #0d9488; }
.cat-conversores { --cat: #0891b2; }
.cat-desenvolvedores { --cat: #475569; }
.cat-financas { --cat: #16a34a; }
.cat-negocios { --cat: #ea580c; }
.cat-arquivos { --cat: #4f46e5; }
.cat-imagens { --cat: #db2777; }
.cat-qr-code { --cat: #9333ea; }

:root[data-theme="dark"] .cat-desenvolvedores { --cat: #94a3b8; }

/* ============================ Responsivo ============================ */

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

  .menu-btn {
    display: grid;
  }

  .search-trigger kbd {
    display: none;
  }

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

@media (max-width: 640px) {
  .container,
  .container-narrow {
    width: calc(100% - 28px);
  }

  .search-trigger span {
    display: none;
  }

  .search-trigger {
    width: 38px;
    justify-content: center;
    padding: 0;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-home {
    padding-top: 20px;
  }

  .section {
    padding: 34px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards-2,
  .cards-3,
  .cards-4,
  .cards-cat {
    grid-template-columns: 1fr;
  }

  .tool-shell {
    padding: 15px;
  }

  .btns .btn {
    flex: 1 1 auto;
  }

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

  .search-overlay {
    padding-top: 6vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
