/* Self-hosted webfonts (SIL OFL 1.1, licences beside the files). Loaded from
   Google Fonts before 2026-09-25: that sent every visitor's IP address to Google
   (a GDPR problem for an EU-hosted site) and the late swap shifted the layout.
   Variable fonts, split into the same unicode-range subsets Google serves. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --bg: #f7f8f5;
  --bg-2: #e9eee7;
  --ink: #171a18;
  --muted: #5d665f;
  --accent: #0f766e;
  --accent-2: #b45309;
  --card: #ffffff;
  --border: #dbe2dc;
  --shadow: 0 14px 34px rgba(23, 26, 24, 0.08);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 15% -10%, #ffffff 0%, transparent 62%),
    radial-gradient(900px 640px at 100% 0%, #e1ece7 0%, transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* Locale-safe line breaking for catalog cards and hero copy. Long compound
   words should wrap on narrow screens instead of expanding the page canvas. */
.homepage {
  overflow-wrap: anywhere;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

/* Consistent keyboard focus indicator (focus-visible only, never on mouse
   click). Applied uniformly to links, buttons, inputs, and the mobile nav
   toggle together, per the 2026-07-29 ui-consistency review. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.site-header nav {
  display: grid;
  /* Fourth track is the language switcher; .nav-panel uses display: contents,
     so .nav-links, .site-search and .lang-switch are all direct grid children. */
  grid-template-columns: 1fr auto 260px auto;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
}

/* The site name is a span, not an h1: every page supplies its own single h1. */
.logo-name {
  margin: 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #0f5f52;
  color: #fff;
  font-weight: 800;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  font-weight: 600;
  color: var(--ink);
}

.site-search input {
  width: 100%;
  height: 36px;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
}

/* Language switcher. Options are labelled in their own language so a reader
   who can't read the current page still finds theirs. */
.lang-switch {
  display: flex;
  align-items: center;
}

.lang-switch select {
  height: 36px;
  max-width: 160px;
  padding: 0 1.6rem 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.lang-switch select:focus-visible {
  outline: 2px solid var(--accent, #1a73e8);
  outline-offset: 2px;
}

/* Available to screen readers, invisible on screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Mobile nav toggle: hidden on desktop, .nav-panel stays transparent to the
   grid (display: contents) so .nav-links and .site-search remain direct
   grid children of `.site-header nav` and the 1fr auto 260px column track
   is unaffected. Both switch to real mobile behavior at the 768px breakpoint. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle:hover { background: #fff; }

.nav-toggle-icon {
  display: inline-flex;
}

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

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: inline-flex;
}

.nav-panel {
  display: contents;
}

.hero {
  padding: 3rem 0 2rem;
}

.utility-hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.45rem, 4.05vw, 4.45rem);
  line-height: 0.98;
  margin: 0 0 0.75rem;
  max-width: 780px;
}

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

.search-box input {
  width: min(680px, 100%);
  padding: 0.95rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), var(--shadow);
  font: inherit;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-chips,
.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.quick-chips a,
.mini-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.lead-panel,
.workflow-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.hero-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-panel img {
  width: 100%;
  height: auto; /* keep the 610x345 ratio; the width/height attributes still reserve space */
  border-radius: var(--radius);
  box-shadow: 0 38px 60px rgba(15, 35, 31, 0.18);
  display: block;
}

.trust-metric {
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: #10231f;
  color: #f8faf8;
}

.trust-metric strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3rem;
  line-height: 1;
}

.trust-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.trust-list li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.trust-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.trust-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.trust-strip {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-strip .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.trust-item {
  min-height: 92px;
  padding: 1rem 1rem 1rem 3.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  position: relative;
}

.trust-item .trust-icon {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
  background: #d9ebe6;
  color: #0f5f52;
  text-transform: none;
}

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

.trust-item span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trust-item strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.tools-grid {
  padding: 1.5rem 0 3rem;
}

.page {
  padding: 2.5rem 0 3rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2,
.tools-grid h2 {
  font-size: 1.5rem;
  margin: 0;
}

.category {
  margin: 1.5rem 0 2rem;
}

.category h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin: 0 0 0.3rem;
}

/* Tier 3 mockup alignment: icon chip beside each category heading. */
.category-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-sm);
  background: #e7f5ee;
  color: #0f5f52;
}

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

.category-summary {
  color: var(--muted);
  margin: 0 0 1rem;
}

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

/* Tier 3 mockup alignment: a lone trailing card (e.g. a 5-tool category in a
   4-up row) is centered instead of left with empty columns. Only at widths
   where the grid is 4-up; narrower layouts already balance via auto-fit. */
@media (min-width: 1010px) {
  .category .grid > :last-child:nth-child(4n+1) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(25% - 0.75rem);
  }
}

.tool-card {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 150px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(31, 27, 22, 0.12);
}

/* Tier 3 mockup alignment: top-right arrow affordance on tool cards. */
.card-arrow {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--muted);
  opacity: 0.5;
  transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.card-arrow svg {
  width: 16px;
  height: 16px;
}

.tool-card:hover .card-arrow {
  color: var(--accent);
  opacity: 1;
  transform: translateX(2px);
}

.tool-card h4 {
  margin: 0.75rem 0 0.35rem;
  color: var(--ink);
}

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

.processing-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.processing-badge.browser {
  background: #e7f5ee;
  color: #166534;
}

.processing-badge.server {
  background: #e0f2fe;
  color: #075985;
}

.processing-badge.queued {
  background: #fff7ed;
  color: #9a3412;
}

/* .tool-status (the "Roadmap" badge) flows in normal document layout,
   after the card copy, instead of being absolutely positioned over it.
   This guarantees it can never overlap the title/description no matter
   how long the copy is. */
.tool-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  width: fit-content;
  min-height: 26px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: auto;
  background: #f1f5f9;
  color: #475569;
}

.workflow-section {
  padding: 2rem 0 0.5rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.workflow-card {
  overflow: hidden;
  padding: 0;
}

.workflow-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.workflow-card h3 {
  margin: 1rem 1rem 0.3rem;
}

.workflow-card p {
  color: var(--muted);
  margin: 0 1rem 0.75rem;
}

.workflow-card .mini-links {
  margin: 0 1rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.workflow-card .mini-links a {
  justify-content: space-between;
  border-radius: var(--radius-sm);
}

.workflow-card .mini-links a::after {
  content: "→";
}

.professional-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section-head.centered {
  max-width: 560px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-head.centered p {
  color: var(--muted);
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.benefit-grid article,
.feature-strip article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
}

.benefit-grid h3,
.feature-strip h2 {
  margin: 0.8rem 0 0.45rem;
}

/* Feature-strip items, related-tool cards and guide steps were h3/h4 straight
   under an h1/h2, which skipped heading levels (axe heading-order). They are now
   h2/h3 and keep the sizes they had before. */
.feature-strip h2,
.step-list h2 {
  font-size: 1.17em;
}

.step-list h2 {
  margin-block: 1em; /* the h3 default; h2's default is 0.83em */
}

.benefit-grid p,
.feature-strip p {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}

.icon-box {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #0f5f52;
  color: #fff;
  font-weight: 800;
}

.icon-box svg {
  width: 18px;
  height: 18px;
}

.lead-section {
  padding: 0 0 3rem;
}

.lead-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 1.5rem;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem;
  background: #0f5f52;
  color: #f8fffc;
}

.lead-panel h2 {
  margin: 0 0 0.6rem;
}

.lead-panel p {
  color: #b9d9d0;
  margin: 0;
}

.lead-form {
  display: grid;
  gap: 0.55rem;
}

.lead-form label {
  font-weight: 700;
  font-size: 0.92rem;
}

.lead-row {
  display: flex;
  gap: 0.5rem;
}

.lead-row input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}

.consent-line {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  color: #e6f4ef;
  font-weight: 500 !important;
}

.lead-message {
  min-height: 1.2rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.lead-message.error {
  color: #b91c1c;
}

.site-footer {
  background: #0f5f52;
  color: #e6f4ef;
  border-top: 1px solid #0d4f45;
  padding: 3rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 1.5rem;
}

.footer-section h3,
.footer-section h4 {
  margin: 0 0 0.6rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
}

.footer-section p {
  margin: 0;
  color: #b8d9cf; /* 5.0:1 on the footer green; #a9cfc4 was 4.47:1, under WCAG AA */
}

.footer-note {
  margin-top: 1.5rem !important;
  font-size: 0.85rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer a {
  color: #d7eee7;
}

.site-footer a:hover {
  color: #ffffff;
}

@media (max-width: 768px) {
  /* Hamburger nav: the toggle button appears, the logo+toggle share a row,
     and .nav-panel (nav-links + site-search) becomes a real collapsible
     block instead of the desktop's `display: contents` pass-through. */
  .site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-panel {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 1rem;
  }

  .nav-panel.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-search {
    width: 100%;
  }

  .lang-switch select {
    width: 100%;
    max-width: none;
  }

  .utility-hero .container,
  .trust-strip .container,
  .workflow-grid,
  .lead-panel,
  .benefit-grid,
  .footer-content {
    /* A plain 1fr track retains an automatic min-content floor. Long
       localized labels/placeholders (German exposed this first) can then
       widen the entire mobile grid beyond the viewport. */
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-row {
    flex-direction: column;
  }
}
/* Additional tool styles */
.tool-page h1 { font-family: "Fraunces", Georgia, serif; margin-bottom: 0.5rem; }
.tool-page .description { color: var(--muted); margin-top: 0; }
.tool-container { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.tool-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.tool-controls label { display: flex; gap: 0.4rem; align-items: center; font-size: 0.95rem; }
.tool-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tool-workspace textarea, .tool-output input { width: 100%; min-height: 180px; padding: 0.75rem; border-radius: var(--radius-lg); border: 1px solid var(--border); font-family: inherit; }
.tool-output input { min-height: auto; }
.tool-output { display: grid; gap: 0.5rem; }
.btn { border: 1px solid var(--border); background: var(--bg-2); padding: 0.5rem 0.85rem; border-radius: var(--radius-lg); cursor: pointer; font-weight: 600; }
.btn:hover { background: #fff; }
.btn-accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn-accent:hover { background: #0f5f52; }
.alert { padding: 0.75rem; border-radius: var(--radius-lg); margin-top: 0.75rem; }
.alert-success { background: #e6f3ea; color: #1d4b2b; }
.alert-error { background: #f7e5e5; color: #7a2020; }
/* !important keeps .hidden authoritative over later equal-specificity rules
   that set display (e.g. .privacy-warning { display: flex }), so toggling
   the class is guaranteed to hide the element. */
.hidden { display: none !important; }
.how-to, .related { margin-top: 1.5rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem; display: grid; gap: 0.35rem; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.strength { color: var(--muted); font-weight: 600; }

/* Placed after the .tool-workspace base rule (not migrated up to the
   header's 768px block) so this override still wins the cascade -- CSS
   source order matters between two rules of equal specificity, and the
   media query alone doesn't out-rank a later unconditional rule.
   Migrated from the old 900px breakpoint (was the only rule there); two
   equal 1fr columns scale down proportionally with no fixed-width column
   to create a squeeze, so 768px is safe. */
@media (max-width: 768px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

/* ─── Phase 2: Upload & Image Tool Styles ─── */

/* Upload Drop Zone */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.05) 0%, rgba(180, 83, 9, 0.04) 100%);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.09) 0%, rgba(180, 83, 9, 0.06) 100%);
  transform: translateY(-1px);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
  transform: scale(1.01);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.6;
}

.upload-zone p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.upload-zone .upload-hint {
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.7;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Image Preview */
.image-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: repeating-conic-gradient(var(--bg-2) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--border);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
}

.image-preview .remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.image-preview .remove-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* Options Panel */
.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  align-items: end;
}

.tool-options .option-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tool-options .option-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.tool-options input[type="number"],
.tool-options select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  width: 120px;
}

.tool-options select {
  width: 160px;
}

/* Quality Slider */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}

.slider-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.slider-row .slider-value {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 36px;
  text-align: right;
}

/* File Size Comparison */
.size-comparison {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.size-box {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
}

.size-box .size-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.size-box .size-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.25rem;
  display: block;
}

.size-box.savings {
  background: linear-gradient(135deg, #e6f3ea, #d4edda);
  border-color: #b8dcc4;
}

.size-box.savings .size-value {
  color: #1d6b38;
}

/* Lock Aspect Ratio */
.lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
  align-self: end;
}

.lock-btn.locked {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* EXIF Data Table */
.exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.exif-table th,
.exif-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.exif-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: 40%;
}

.exif-table td {
  word-break: break-word;
}

.exif-table tr:last-child td,
.exif-table tr:last-child th {
  border-bottom: none;
}

.privacy-warning {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: #fff8e6;
  border: 1px solid #f0d68a;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: #8a6d1b;
}

.privacy-warning .warn-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Loading / Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(0,0,0,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Checkbox / Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
}

/* Color picker for background */
.color-input {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .tool-options { flex-direction: column; }
  .size-comparison { flex-direction: column; }
}

/* Premium tool-detail layout */
.premium-tool-page {
  padding: 3rem 0 4rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breadcrumb a,
.breadcrumb strong {
  color: var(--ink);
}

.breadcrumb span::before,
.breadcrumb strong::before {
  content: "›";
  margin-right: 0.6rem;
  color: #9aa6a0;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.tool-hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  margin: 1rem 0 0.8rem;
}

.tool-hero .description {
  max-width: 760px;
  font-size: 1.05rem;
}

.tool-hero img,
.tool-hero-visual {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 24px 44px rgba(15, 35, 31, 0.16);
}

.tool-hero-visual {
  display: grid;
  place-items: center;
  min-height: 220px;
  background: linear-gradient(135deg, #0f5f52 0%, #134f45 100%);
  color: #d7eee7;
}

.tool-hero-visual svg {
  width: 88px;
  height: 88px;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: start;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.segmented-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef4f1;
}

.segmented-tabs button,
.button-grid button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.segmented-tabs button {
  min-width: 105px;
  padding: 0.7rem 1rem;
}

.segmented-tabs button.active,
.button-grid button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #c5d8d2;
}

.compact-controls {
  margin: 0;
}

.code-window {
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fbfa;
  overflow: hidden;
}

.code-window-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: #f4f6f5;
}

.code-window-head span {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: #b9c6c0;
}

.code-window-head strong {
  margin-left: auto;
  color: var(--muted); /* #8b9791 was 2.79:1 */
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.code-window textarea,
.code-window pre,
.code-window .json-tree {
  width: 100%;
  min-height: 260px;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  background: transparent;
  color: #3d4843;
  font: 600 0.98rem/1.55 Consolas, "Courier New", monospace;
}

.code-window textarea {
  resize: vertical;
}

/* Hide the editor's outline only for mouse/touch focus; keyboard focus
   still shows the sitewide :focus-visible ring. */
.code-window textarea:focus:not(:focus-visible) {
  outline: none;
}

.code-window pre {
  white-space: pre-wrap;
}

.code-window .json-tree {
  overflow: auto;
  font-weight: 400;
  font-size: 0.92rem;
}

.json-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1.15rem;
}

.json-tree > ul {
  padding-left: 0;
}

.json-tree li {
  margin: 0.2rem 0;
}

.json-tree .tree-key {
  color: var(--accent);
  font-weight: 700;
}

.json-tree .tree-type {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.json-tree .tree-string {
  color: var(--accent-2);
}

.json-tree .tree-number {
  color: #0f5f52;
  font-weight: 700;
}

.json-tree .tree-boolean,
.json-tree .tree-null {
  color: var(--muted);
  font-weight: 700;
}

.json-tree .tree-empty {
  color: var(--muted);
  margin: 0;
}

.json-tree .tree-error {
  color: #b91c1c;
}

.tool-cta-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: #0f5f52;
  color: #fff;
  box-shadow: 0 18px 34px rgba(15, 95, 82, 0.22);
}

.tool-cta-bar span {
  display: block;
  color: #a9d8cd;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-cta-bar strong {
  font-size: 1.35rem;
}

.btn-light {
  background: #fff;
  color: #0f5f52;
  border-color: transparent;
}

.tool-sidebar {
  display: grid;
  gap: 1.5rem;
}

.settings-panel,
.documentation-panel,
.bulk-card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  padding: 1.25rem;
}

.settings-panel h2,
.documentation-panel h2 {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.settings-panel p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.settings-panel label {
  display: block;
  margin: 1rem 0 0.5rem;
  color: var(--muted); /* #8b9791 was 2.79:1 -- too faint for form labels */
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.button-grid button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

/* Tier 3 mockup alignment: Auto-Validation switch in the formatter sidebar. */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--border);
  transition: background 0.15s ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.toggle[aria-checked="true"] .toggle-track {
  background: var(--accent);
}

.toggle[aria-checked="true"] .toggle-thumb {
  transform: translateX(18px);
}

.toggle-caption {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.documentation-panel details {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.documentation-panel details:last-child {
  border-bottom: 1px solid var(--border);
}

.documentation-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.documentation-panel p,
.bulk-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.bulk-card {
  border: 1px solid #c5d8d2;
  background: #eaf4f1;
}

.bulk-card a {
  color: #0f5f52;
  font-weight: 800;
  text-transform: uppercase;
}

.premium-related {
  margin-top: 5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.related-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  color: var(--ink);
}

.related-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.related-thumb {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-2) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
  color: #0f5f52;
}

.related-thumb svg {
  width: 32px;
  height: 32px;
}

.related-card h3 {
  margin: 1rem 1rem 0.35rem;
  font-size: 1em;
}

.related-card p {
  margin: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Placed here (after the .tool-hero / .feature-strip / .related-grid base
   rules) rather than in the header's 768px block further up the file --
   CSS source order breaks ties between rules of equal specificity, so an
   earlier media-query override loses to a later unconditional rule with
   the same selector. Migrated from the old 920px breakpoint: these three
   are flexible grids with no fixed-pixel column reserved against a
   shrinking flexible one, so collapsing at 768px alongside the rest of
   the mobile layout is safe. See the 920px block below for the one case
   (.tool-layout) that was NOT safe to migrate. */
@media (max-width: 768px) {
  .tool-hero,
  .feature-strip,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .tool-hero img {
    max-width: 360px;
  }
}

/* Intentionally kept at 920px rather than migrated to 768px: .tool-layout
   reserves a FIXED 360px sidebar column (minmax(0,1fr) 360px, 2rem gap).
   At a 768px viewport the .container is ~706px, leaving only ~314px for
   the main column, which houses the code editor toolbar (buttons laid
   out with justify-content: space-between) and code window -- genuinely
   too cramped. Collapsing to a single column earlier (at the wider 920px)
   keeps the editor usable. .editor-toolbar and .tool-cta-bar live inside
   .tool-layout's main column, so they must collapse in lockstep with it. */
@media (max-width: 920px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .editor-toolbar,
  .tool-cta-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ─── QR Code Generator ─── */
.qr-field {
  display: grid;
  gap: 0.4rem;
}

.qr-field + .qr-field {
  margin-top: 0.9rem;
}

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

.qr-field input[type="text"],
.qr-field input[type="url"],
.qr-field input[type="email"],
.qr-field input[type="tel"],
.qr-field textarea,
.qr-field select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
}

.qr-field textarea {
  resize: vertical;
}

.qr-field small {
  color: var(--muted);
  font-size: 0.85rem;
}

.qr-preview-section {
  margin-top: 3rem;
}

.qr-preview-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.qr-canvas-wrap {
  width: 280px;
  height: 280px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.75rem;
}

.qr-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.qr-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-preview.placeholder {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.qr-preview-actions h2 {
  margin: 0 0 0.45rem;
}

.qr-preview-actions p {
  color: var(--muted);
  word-break: break-word;
}

.qr-preview-actions .tool-controls {
  margin: 1.25rem 0 0;
}

.settings-panel input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

/* ─── Image Cropper ─── */
.crop-preview {
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.crop-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  outline: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 3px;
}

.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* ─── Watermark options ─── */
.watermark-options .option-group.full {
  flex-basis: 100%;
}

.watermark-options .option-group.full input {
  width: 100%;
}

/* ─── Image to PDF ─── */
.pdf-file-list {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  max-height: 320px;
  overflow: auto;
}

.pdf-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.pdf-file-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.pdf-file-remove {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7a2020;
  cursor: pointer;
}

.pdf-file-remove:hover {
  background: #f7e5e5;
}

.pdf-result-box {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.pdf-result-box strong {
  font-size: 1.15rem;
}

.pdf-result-box span {
  color: var(--muted);
}

/* ─── Favicon generator ─── */
.favicon-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.75rem 0 0;
}

.favicon-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.favicon-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: #e7f5ee;
  color: #166534;
  font-size: 0.82rem;
  font-weight: 800;
}

.favicon-chip.ico {
  background: #e0f2fe;
  color: #075985;
}

@media (max-width: 768px) {
  .qr-preview-card {
    grid-template-columns: 1fr;
  }

  .qr-canvas-wrap {
    width: min(280px, 100%);
  }

  /* The QR page has six type tabs; let them wrap instead of overflowing
     the viewport horizontally. Scoped to the .qr-field sibling area via
     the page's own .tool-layout so the formatter's three tabs are
     unaffected. */
  .tool-layout .segmented-tabs {
    flex-wrap: wrap;
  }

  .tool-layout .segmented-tabs button {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* --- Right-to-left locales (ar) -------------------------------------------
   The document gets dir="rtl" from the <html> tag, which flips text and the
   flex/grid inline axis on its own. Only genuinely direction-bound details
   need overriding here. */
[dir="rtl"] .lang-switch select {
  padding: 0 0.6rem 0 1.6rem;
}

[dir="rtl"] .card-arrow,
[dir="rtl"] .nav-toggle-icon {
  transform: scaleX(-1);
}

[dir="rtl"] .tool-controls label {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* --- Category hub pages -------------------------------------------------
   /categories and /categories/<slug>: indexable hubs between the homepage
   and individual tools. Reuse existing card and grid styles; only the hub
   chrome needs its own rules. */
.category h2 a,
.category h3 a {
  color: inherit;
  text-decoration: none;
}

.category h2 a:hover,
.category h3 a:hover {
  text-decoration: underline;
}

.hub-count {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.hub-backlink {
  margin: 2rem 0 0;
  font-size: 0.95rem;
}

.pdf-file-remove:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ─── Tool help (long-form guidance under each tool) ─── */
.tool-help {
  margin-top: 2rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
}

.tool-help ol,
.tool-help ul {
  padding-left: 1.25rem;
}

.tool-help li {
  margin-bottom: 0.35rem;
}
