/* ==========================================================================
   WE Tools — public stylesheet
   Mobile-first, no framework. Brand: blue #0260A2, red accent #9D0207.
   ========================================================================== */

:root {
  --brand: #0260A2;
  --brand-600: #01568f;
  --brand-700: #014a7b;
  --brand-50: #eef5fb;
  --brand-100: #d9e9f6;
  --accent: #9D0207;
  --accent-50: #fbeeee;
  --ink: #132131;
  --ink-2: #33414f;
  --muted: #5d6b7a;
  --line: #e2e7ee;
  --line-2: #eef2f6;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --success: #12733e;
  --success-50: #eaf6ef;
  --warn: #8a5a00;
  --warn-50: #fdf5e4;
  --danger: #b4231f;
  --danger-50: #fdeeed;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(19, 33, 49, .06);
  --shadow: 0 6px 24px -10px rgba(19, 33, 49, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-main { flex: 1; }
img, svg, canvas { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-700); }
h1, h2, h3 { line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); margin: 0 0 .35rem; }
h2 { font-size: 1.3rem; margin: 0 0 .75rem; }
h3 { font-size: 1.08rem; margin: 1.25rem 0 .5rem; }
p { margin: 0 0 1rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); border: 1px solid var(--line-2); padding: .05em .35em; border-radius: 5px; }
:focus-visible { outline: 3px solid rgba(2, 96, 162, .45); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.container.narrow, .narrow { max-width: 760px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute !important; 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; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }
.hp { position: absolute; left: -9999px; }

/* ---------- icons ---------- */
.icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 3rem; height: 3rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .6rem 1.15rem;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand-100); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-sm { min-height: 36px; padding: .4rem .8rem; font-size: .875rem; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header--home { position: relative; border-bottom-color: transparent; background: transparent; }
.site-header--home .brand { visibility: hidden; }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: .02em; flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark { display: block; }
.brand-name { font-size: 1.1rem; text-transform: uppercase; }
.header-search { position: relative; flex: 1; max-width: 420px; display: none; }
.header-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; font: inherit; font-size: .95rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--ink);
}
.header-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(2, 96, 162, .12); }
.header-search .search-icon { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.nav-toggle { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--ink); }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 16px 16px; }
.site-nav.is-open { display: block; }
.site-nav > ul { list-style: none; margin: 0; padding: 0; }
.nav-link { display: flex; align-items: center; gap: 4px; width: 100%; padding: 12px 4px; font: inherit; font-weight: 600; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-link:hover { color: var(--brand); }
.nav-cta { color: var(--brand); }
.menu ul { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.menu a:hover { background: var(--brand-50); color: var(--brand-700); }
.menu a .icon { color: var(--brand); }
.menu a small { margin-left: auto; color: var(--muted); font-size: .8rem; }
.menu-all { font-weight: 600; font-size: .9rem; }
.menu .menu-all { color: var(--brand); }

@media (min-width: 900px) {
  .header-search { display: block; }
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; padding: 0; border: 0; box-shadow: none; background: transparent; margin-left: auto; }
  .site-nav > ul { display: flex; align-items: center; gap: 6px; }
  .nav-link { padding: 8px 12px; border-radius: 8px; width: auto; }
  .nav-cta { border: 1px solid var(--brand-100); }
  .nav-cta:hover { background: var(--brand-50); }
  .has-menu { position: relative; }
  .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; }
  .menu-all { display: block; padding: 8px 10px; border-top: 1px solid var(--line-2); }
}

/* ---------- search suggestions ---------- */
.suggest { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; text-align: left; max-height: 70vh; overflow: auto; }
.suggest a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.suggest a .icon { color: var(--brand); }
.suggest a span { display: block; min-width: 0; }
.suggest a strong { display: block; font-weight: 600; }
.suggest a small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest a:hover, .suggest a.is-active { background: var(--brand-50); }
.suggest .suggest-empty { padding: 12px; color: var(--muted); font-size: .95rem; }
.suggest .suggest-all { display: block; padding: 10px 12px; border-top: 1px solid var(--line-2); margin-top: 4px; font-weight: 600; color: var(--brand); }

/* ---------- hero (home) ---------- */
.hero { padding: 40px 0 16px; text-align: center; background:
  radial-gradient(1100px 380px at 50% -140px, var(--brand-50), rgba(255,255,255,0)); }
.hero-inner { max-width: 760px; }
.hero-title { display: inline-flex; align-items: center; gap: 14px; font-size: clamp(2.1rem, 1.5rem + 3vw, 3.4rem); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 8px 0 6px; }
.hero-logo .brand-mark { width: clamp(44px, 9vw, 60px); height: auto; }
.hero-tagline { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: var(--muted); margin-bottom: 26px; }
.hero-search { position: relative; display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 50px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(2, 96, 162, .12), var(--shadow); }
.hero-search .search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; font: inherit; font-size: 1.05rem; background: transparent; color: var(--ink); }
.hero-search input::-webkit-search-cancel-button { cursor: pointer; }
.hero-search-btn { border-radius: 999px; min-height: 48px; padding: 0 22px; }
.hero-search--inline { box-shadow: var(--shadow-sm); }
.hero-quick { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; font-size: .9rem; }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; color: var(--ink-2); font-size: .875rem; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 520px) {
  .hero-search { padding-left: 44px; }
  .hero-search .search-icon { left: 14px; }
  .hero-search-btn { padding: 0 14px; }
  .hero-search input { font-size: 1rem; }
}

/* ---------- sections & grids ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; }
.section-head .section-title { margin: 0; }
.section-title.with-icon { display: flex; align-items: center; gap: 8px; }
.section-title.with-icon .icon { color: var(--brand); }
.section-link { font-weight: 600; font-size: .9rem; text-decoration: none; }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 359px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; min-height: 100%; }
.cat-card:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--ink); transform: translateY(-1px); }
.cat-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); margin-bottom: 8px; }
.cat-card-icon .icon { width: 24px; height: 24px; }
.cat-card-name { font-weight: 700; font-size: 1.02rem; }
.cat-card-desc { color: var(--muted); font-size: .875rem; line-height: 1.45; flex: 1; }
.cat-card-count { margin-top: 8px; font-weight: 600; font-size: .875rem; color: var(--brand); }
@media (max-width: 520px) {
  .cat-card { padding: 14px; }
  .cat-card-desc { display: none; }
}

.tool-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1000px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); color: var(--ink); }
.tool-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand); flex: none; }
.tool-card-icon .icon { width: 22px; height: 22px; }
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-title { display: block; font-weight: 650; line-height: 1.3; }
.tool-card-desc { display: block; color: var(--muted); font-size: .875rem; line-height: 1.4; margin-top: 2px; }
.tool-card-arrow { color: var(--line); transition: color .15s, transform .15s; }
.tool-card:hover .tool-card-arrow { color: var(--brand); transform: translateX(2px); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; vertical-align: 2px; }
.badge-new { background: var(--accent-50); color: var(--accent); }

.cta-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.cta-strip h2 { font-size: 1.1rem; margin: 0 0 4px; }
.cta-strip p { margin: 0; color: var(--muted); }

/* ---------- inner pages ---------- */
.page-head { padding-top: 22px; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 70ch; }
.page-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.page-title-row h1 { margin: 0; }
.page-title-row p { margin: 0; }
.page-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand); flex: none; }
.page-icon .icon { width: 28px; height: 28px; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: #b5bfca; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }

.empty-state { text-align: center; padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.empty-state .icon-xl { color: var(--brand); opacity: .7; margin-bottom: 8px; }
.empty-state h2 { font-size: 1.3rem; }
.error-state { border-style: solid; background: #fff; }
.error-code { font-size: 3.6rem; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: 8px; letter-spacing: .02em; }
.error-state .hero-search { max-width: 480px; margin: 18px auto; }
.error-links { font-size: .95rem; }

/* ---------- search results ---------- */
.result-count { color: var(--muted); }
.search-results { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.search-result { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.search-result-body { flex: 1; min-width: 0; }
.search-result h2 { font-size: 1.05rem; margin: 0 0 2px; }
.search-result h2 a { color: var(--ink); text-decoration: none; }
.search-result h2 a:hover { color: var(--brand); }
.search-result p { margin: 0 0 2px; color: var(--ink-2); font-size: .925rem; }
@media (max-width: 520px) { .search-result .btn { display: none; } }

/* ---------- forms & cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form-card { display: grid; gap: 4px; }
.field { margin-bottom: 14px; min-width: 0; }
.field label, .field legend, .segmented-field legend { display: block; font-weight: 600; font-size: .925rem; margin-bottom: 6px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #cdd6e0; border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(2, 96, 162, .14); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6b7a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.textarea.mono, .mono { font-family: var(--mono); font-size: .9rem; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group .input:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-group .input:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--bg-soft); border: 1px solid #cdd6e0; color: var(--muted); font-weight: 600; font-size: .95rem; }
.addon:first-child { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.addon:last-child { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.field-help { display: block; color: var(--muted); font-size: .825rem; margin-top: 4px; }
.field-error { display: block; color: var(--danger); font-size: .85rem; margin-top: 4px; }
.field-error:empty { display: none; }
.has-error .input { border-color: var(--danger); }
.field-check .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.field-check input { width: 18px; height: 18px; accent-color: var(--brand); }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink-2); background: #fff; }
.segmented input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid rgba(2, 96, 162, .45); outline-offset: 2px; }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; }
.notice-success { background: var(--success-50); border-color: #bfe3cd; color: #0d5a31; }
.notice-warn { background: var(--warn-50); border-color: #f0d9a6; color: var(--warn); }
.notice-error { background: var(--danger-50); border-color: #f3c3c1; color: var(--danger); }
.notice-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

/* ---------- tool page ---------- */
.tool-page { padding-top: 22px; padding-bottom: 20px; }
.tool-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.tool-head h1 { margin: 2px 0 4px; }
.tool-lead { color: var(--muted); margin: 0; font-size: 1.02rem; }
.tool-app { padding: 18px; box-shadow: var(--shadow-sm); }
@media (min-width: 700px) { .tool-app { padding: 26px; } }
.privacy-note { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin: 10px 2px 0; }
.privacy-note .icon { color: var(--success); }

.tool-grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .tool-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tool-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.tool-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.tool-result { margin-top: 20px; padding: 18px; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); }
.tool-result.is-error { background: var(--danger-50); border-color: #f3c3c1; color: var(--danger); }
.result-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.result-label { color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.result-value { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.2rem); font-weight: 800; color: var(--brand-700); line-height: 1.2; word-break: break-word; }
.result-summary { margin: 8px 0 0; color: var(--ink-2); }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .result-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--brand-100); border-radius: 12px; padding: 12px; }
.stat-value { display: block; font-size: 1.35rem; font-weight: 750; color: var(--ink); line-height: 1.2; word-break: break-word; }
.stat-label { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stat.is-primary { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.stat.is-primary .stat-value { color: var(--brand-700); }
.result-table { width: 100%; border-collapse: collapse; margin-top: 14px; background: #fff; border-radius: 10px; overflow: hidden; font-size: .925rem; }
.result-table th, .result-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; }
.result-table th { background: var(--bg-soft); font-weight: 600; color: var(--ink-2); }
.result-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.result-formula { margin-top: 12px; padding: 10px 12px; background: #fff; border-radius: 10px; border: 1px dashed var(--brand-100); font-family: var(--mono); font-size: .875rem; color: var(--ink-2); overflow-x: auto; }
.table-wrap { overflow-x: auto; }

.output-box { position: relative; }
.output-box .textarea { background: var(--bg-soft); }
.status-line { font-size: .9rem; margin-top: 8px; min-height: 1.4em; }
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }

/* Dropzone & file list (image tools) */
.dropzone { position: relative; }
.dropzone-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 30px 16px; border: 2px dashed #c2cfdc; border-radius: var(--radius); background: var(--bg-soft); cursor: pointer; text-align: center; color: var(--ink-2); transition: border-color .15s, background-color .15s; }
.dropzone-label .icon { color: var(--brand); margin-bottom: 6px; }
.dropzone-label strong { color: var(--brand); font-size: 1.05rem; }
.dropzone-label small { color: var(--muted); margin-top: 6px; }
.dropzone.is-over .dropzone-label, .dropzone-label:hover { border-color: var(--brand); background: var(--brand-50); }
.dropzone input:focus-visible + .dropzone-label { outline: 3px solid rgba(2, 96, 162, .45); outline-offset: 2px; }
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg-soft) repeating-conic-gradient(#e9eef3 0% 25%, #fff 0% 50%) 50% / 12px 12px; flex: none; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 600; font-size: .925rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: block; color: var(--muted); font-size: .8rem; }
.file-meta .gain { color: var(--success); font-weight: 600; }

/* Range */
input[type=range] { width: 100%; accent-color: var(--brand); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { min-width: 3.5em; text-align: right; font-weight: 700; color: var(--brand-700); }

/* ---------- content blocks ---------- */
.tool-content { margin-top: 28px; display: grid; gap: 14px; }
.content-block { padding: 22px 0; border-top: 1px solid var(--line); }
.content-block:first-child { border-top: 0; }
.prose { max-width: 78ch; color: var(--ink-2); }
.prose h2 { color: var(--ink); }
.prose h3 { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin: .3rem 0; }
.prose table { border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.prose th { background: var(--bg-soft); }
.prose pre { background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.static-page { padding-top: 6px; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.faq-item summary { cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 650; color: var(--ink); list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brand); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 16px 6px; }

.related { border-top: 1px solid var(--line); margin-top: 10px; }
.tool-meta { margin-top: 10px; }

/* ---------- ads (clearly labelled, separated from tool controls) ---------- */
.ad-slot { margin: 24px auto; padding: 10px 0 0; border-top: 1px solid var(--line-2); text-align: center; clear: both; min-height: 0; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8a96a3; margin-bottom: 6px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; background: var(--bg-soft); border-top: 1px solid var(--line); font-size: .925rem; }
.footer-grid { display: grid; gap: 24px; padding-top: 36px; padding-bottom: 16px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: 10px 0 0; color: var(--ink-2); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 24px; color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .related, .breadcrumbs { display: none !important; }
}

/* ---------- Phase 2: shared file-tool UI ---------- */
.file-badge { width: 56px; height: 56px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-50); color: var(--accent); font-weight: 800; font-size: .8rem; letter-spacing: .04em; }
.file-actions { display: flex; gap: 2px; flex: none; }
.file-actions .btn { min-height: 34px; padding: 4px 9px; }
.file-summary { margin: 12px 0 0; color: var(--ink-2); font-size: .925rem; }
.opt-grid { display: grid; gap: 0 16px; margin-top: 16px; }
@media (min-width: 640px) { .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .opt-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.result-files { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.result-files li { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; text-align: center; font-size: .85rem; }
.result-files img { width: 100%; height: 160px; object-fit: contain; background: var(--bg-soft); border-radius: 8px; display: block; margin-bottom: 6px; }
.result-files a { display: block; margin-top: 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.file-item .spinner { width: 20px; height: 20px; border: 2px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: wespin .8s linear infinite; flex: none; }
@keyframes wespin { to { transform: rotate(360deg); } }
.file-item.is-error .file-meta { color: var(--danger); }
.file-meta .gain { color: var(--success); font-weight: 600; }
.jt-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.jt-labelrow > label { margin: 0; }
.jt-mini { display: flex; gap: 6px; flex-wrap: wrap; }
.partial-notice p { margin: 0 0 10px; }
