/* ToolsHub — public site styles. One bold element: the LCD-style result display. */
:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #15202b;
  --muted: #5b6673;
  --line: #dce1e7;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --lcd: #12343b;
  --lcd-ink: #cff5e7;
  --lcd-dim: #86b8a8;
  --warn: #9a4a12;
  --radius-s: 6px;
  --radius-m: 12px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f161c; --surface: #16202a; --ink: #e8edf2; --muted: #9aa7b4; --line: #2a3744;
    --accent: #7c9bff; --accent-ink: #0f161c; --lcd: #0b2227; --lcd-ink: #c4f3e2; --lcd-dim: #6f9e90; --warn: #f0a46a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--font-body);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 650; margin-top: 2.2em; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 68ch; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--lcd); color: var(--lcd-ink); display: grid; place-items: center; font-size: .95rem; }
.header-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.header-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.pick select {
  font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); max-width: 170px;
}
@media (max-width: 560px) { .header-nav .hide-sm { display: none; } }

/* Breadcrumbs */
.crumbs { font-size: .88rem; color: var(--muted); margin: 18px 0 8px; }
.crumbs a { color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--line); }

/* Home */
.hero { padding: 40px 0 28px; display: grid; gap: 28px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); max-width: 14ch; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 42ch; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 24px; } }
.quick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.quick-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.quick-row .input-wrap { width: 110px; flex: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 36px; }
.section-head h2 { margin: 0; }
.tool-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 2px 28px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tool-list a { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tool-list a:hover .tl-name { color: var(--accent); }
.tl-icon { font-size: 1.3rem; width: 32px; flex: none; text-align: center; }
.tl-name { font-weight: 700; display: block; }
.tl-desc { color: var(--muted); font-size: .92rem; display: block; line-height: 1.4; }
.featured { min-height: 120px; }
.featured.loading .tool-list { opacity: .5; }

/* Tool page */
.tool-head { margin: 4px 0 18px; }
.tool-head .lead { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }
.tool-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .tool-shell { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.input-wrap { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); overflow: hidden; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input-wrap .affix { padding: 0 12px; display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: var(--surface); }
input, select, textarea { font: inherit; color: var(--ink); }
.input-wrap input, .input-wrap select { border: 0; background: transparent; padding: 10px 12px; width: 100%; min-width: 0; outline: none; font-variant-numeric: tabular-nums; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .92rem; }
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* The LCD result display */
.lcd {
  background: var(--lcd); color: var(--lcd-ink); border-radius: var(--radius-m); padding: 20px 22px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.06), inset 0 -3px 0 rgba(0,0,0,.25);
  position: sticky; top: 12px;
}
.lcd-primary-label { color: var(--lcd-dim); font-size: .9rem; }
.lcd-primary { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-word; margin: 2px 0 14px; }
.lcd-rows { display: grid; gap: 6px; border-top: 1px dashed color-mix(in srgb, var(--lcd-dim) 50%, transparent); padding-top: 12px; }
.lcd-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.lcd-row span:first-child { color: var(--lcd-dim); }
.lcd-row span:last-child { font-weight: 700; text-align: end; }
.lcd-note { color: var(--lcd-dim); font-size: .85rem; margin-top: 12px; }
.lcd-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.lcd-actions button { font: inherit; font-size: .88rem; color: var(--lcd-ink); background: transparent; border: 1px solid color-mix(in srgb, var(--lcd-ink) 35%, transparent); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.lcd-actions button:hover { background: rgba(255,255,255,.08); }
.lcd .flash { animation: lcdflash .35s ease-out; }
@keyframes lcdflash { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lcd .flash { animation: none; } }

.table-scroll { overflow-x: auto; margin-top: 12px; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .92rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: end; }
table.data th:first-child, table.data td:first-child { text-align: start; }

.btn { font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-s); padding: 10px 16px; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-m); padding: 28px 16px; text-align: center; cursor: pointer;
  background: var(--paper);
}
.drop.over { border-color: var(--accent); }
.thumbs { display: grid; gap: 10px; margin-top: 14px; }
.thumb { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; background: var(--surface); }
.thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.thumb .meta { flex: 1; font-size: .9rem; min-width: 0; }
.thumb .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content below the tool */
.content { margin-top: 12px; }
.example { background: var(--surface); border-inline-start: 4px solid var(--lcd); padding: 14px 18px; border-start-end-radius: var(--radius-s); border-end-end-radius: var(--radius-s); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; }
.review-note { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 0; list-style: none; }
.chips a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; color: var(--ink); background: var(--surface); font-size: .92rem; }
.chips a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Ads: reserve space only where an ad really loads, so empty slots never leave gaps */
.ad-slot.ad-live { margin: 24px 0; min-height: 100px; }
.ad-slot ins { display: block; width: 100%; }
.house-ad { margin: 16px 0; }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink); }
.site-footer .fine { color: var(--muted); margin-top: 24px; }

@media print {
  .site-header, .site-footer, .ad-slot, .lcd-actions, .crumbs, .related, .faq, .pick, .ask, .announce, .share-row, .offers { display: none !important; }
  body { background: #fff; color: #000; }
  .lcd { background: #fff; color: #000; border: 2px solid #000; position: static; }
  .lcd-primary-label, .lcd-row span:first-child, .lcd-note { color: #333; }
}

/* ---------- v2 ---------- */
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.icon-btn { font: inherit; background: transparent; border: 1px solid transparent; color: var(--ink); border-radius: 8px; padding: 6px; cursor: pointer; position: relative; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--line); }
.badge { position: absolute; top: -2px; inset-inline-end: -2px; background: var(--accent); color: var(--accent-ink); font-size: .68rem; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.header-nav { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .pick select { max-width: 120px; } }

.announce { background: var(--lcd); color: var(--lcd-ink); }
.announce .wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.announce a { color: inherit; font-weight: 700; flex: 1; }
.announce .icon-btn { color: inherit; }
.announce-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lcd-ink); flex: none; }

dialog.sheet { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: 80vh; background: var(--surface); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(10, 20, 30, .45); }
.sheet-head { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.sheet-head h2 { margin: 0; flex: 1; font-size: 1.15rem; }
.sheet-head input { flex: 1; font-size: 1.05rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
dialog.sheet .tool-list, dialog.sheet .news-list, dialog.sheet > p { padding: 0 16px; }
.tool-list.one-col { grid-template-columns: 1fr; }
.news-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.news-list li a { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.news-list li.unseen b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-inline-start: 8px; vertical-align: middle; }
.news-list.big li a b { font-size: 1.1rem; }

.notice { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); padding: 10px 14px; border-radius: var(--radius-s); margin: 16px 0 0; }
.notice.ok { border-inline-start-color: #1f8a4c; }

.ask { margin: 28px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.ask h2 { margin: 0 0 10px; font-size: 1.2rem; }
.ask textarea, .msg-form textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--paper); font: inherit; resize: vertical; }
.ask-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ask-note { font-size: .85rem; }
.ask-answer { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ask-answer.err, .form-msg.err { color: #b3261e; }
.form-msg.ok { color: #1f7a45; }
.form-msg { margin: 8px 0 0; min-height: 1.2em; }

.offers { margin-top: 14px; display: grid; gap: 8px; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; }
.offers .fine { font-size: .75rem; color: var(--muted); margin: 0; }

.checked { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 16px; font-size: .92rem; }
.checked ul { margin: 6px 0 0; padding-inline-start: 18px; }
.pill-official { font-size: .72rem; border: 1px solid #1f8a4c; color: #1f7a45; border-radius: 999px; padding: 0 6px; margin-inline-start: 6px; }

.share-row { margin: 24px 0; }
.embed-box { margin-top: 10px; }
.embed-box textarea { width: 100%; font-family: Consolas, monospace; font-size: .85rem; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); }

.subscribe { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 20px; align-items: center; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.subscribe h2 { margin: 0 0 6px; font-size: 1.25rem; }
.subscribe p { margin: 0; }
.sub-form { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-form input[type=email] { flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.sub-form .form-msg { flex-basis: 100%; }
@media (max-width: 720px) { .subscribe { grid-template-columns: 1fr; } }

.lang-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 24px; font-size: .88rem; }
.lang-links a { color: var(--muted); }
.narrow-page { max-width: 640px; margin-top: 28px; }
.msg-form .field textarea { min-height: 120px; }
.country-grid { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.country-grid legend { font-weight: 700; margin-bottom: 8px; }
.check { display: flex; gap: 8px; align-items: center; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.error { color: #b3261e; }

body.embed { background: var(--surface); }
.embed-wrap { padding: 12px; }
.embed-title { font-size: 1.3rem; margin: 0 0 12px; }
.embed .lcd { position: static; }
.embed-credit { font-size: .85rem; margin: 12px 0 0; text-align: end; }

[dir=rtl] .tl-icon, [dir=rtl] .lcd-primary { unicode-bidi: plaintext; }
[dir=rtl] .input-wrap input { text-align: start; }

body.adtest .ad-slot { min-height: 90px; outline: 2px dashed #c0392b; margin: 16px 0; display: grid; place-items: center; }
body.adtest .ad-slot::before { content: "Ad: " attr(data-ad-label); color: #c0392b; font-size: .85rem; }

/* Newsletter slide-in: bottom corner, never over the tool on wide screens */
.nl-slide { position: fixed; inset-inline-end: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); z-index: 40;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 16px 16px 12px; box-shadow: 0 10px 30px rgba(10, 20, 30, .18); transform: translateY(140%); transition: transform .35s ease-out; }
.nl-slide.in { transform: none; }
.nl-slide b { display: block; font-family: var(--font-display); font-size: 1.05rem; padding-inline-end: 28px; }
.nl-slide p { margin: 6px 0 10px; font-size: .9rem; color: var(--muted); }
.nl-slide form { display: flex; flex-wrap: wrap; gap: 8px; }
.nl-slide input[type=email] { flex: 1; min-width: 160px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.nl-slide .form-msg { flex-basis: 100%; margin: 0; font-size: .88rem; }
.nl-close { position: absolute; top: 8px; inset-inline-end: 8px; }
@media (prefers-reduced-motion: reduce) { .nl-slide { transition: none; } }
@media print { .nl-slide { display: none !important; } }
@media (max-width: 600px) {
  .nl-slide { inset-inline: 8px; bottom: 8px; width: auto; padding: 10px 12px 8px; }
  .nl-slide > p { display: none; }
  .nl-slide b { font-size: .95rem; margin-bottom: 8px; }
  .nl-slide input[type=email] { min-width: 0; padding: 8px 10px; }
  .nl-slide .btn { padding: 8px 12px; }
}
