/* ToolsForAnyone – site styles on top of Bootstrap 5.3 */

:root {
    --brand: #1d4ed8;
    --brand-2: #7c3aed;
    --brand-soft: #e8efff;
    --ink: #0f172a;
    --muted: #5b6475;
    --line: #e3e8f0;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --ok: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    --hero-from: #102a7a;
    --hero-to: #5b21b6;
    --radius: 14px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    /* Category colours (icon tiles, accents): one per tool category, keys in catalog.HUB_COLORS */
    --cat-ip: #1d4ed8;
    --cat-pdf: #dc2626;
    --cat-ai: #7c3aed;
    --cat-money: #15803d;
    --cat-health: #db2777;
    --cat-everyday: #b45309;
    --cat-device: #0e7490;
    --cat-sleep: #4338ca;
    --cat-security: #0f766e;
    --cat-zip: #9a3412;
    --cat-dev: #475569;
    --cat-compilers: #047857;
    --cat-teams: #a21caf;
    --cat-career: #0369a1;
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color-rgb: 30, 64, 175;
}

[data-bs-theme="dark"] {
    --brand: #6d9bff;
    --brand-2: #8b85ff;
    --brand-soft: #18233d;
    --ink: #e6ebf5;
    --muted: #9aa4b6;
    --line: #263049;
    --surface: #121a2b;
    --surface-2: #0c1220;
    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --hero-from: #060c1c;
    --hero-to: #172d6b;
    --cat-ip: #7aa2ff;
    --cat-pdf: #f87171;
    --cat-ai: #a78bfa;
    --cat-money: #4ade80;
    --cat-health: #f472b6;
    --cat-everyday: #fbbf24;
    --cat-device: #22d3ee;
    --cat-sleep: #818cf8;
    --cat-security: #2dd4bf;
    --cat-zip: #fb923c;
    --cat-dev: #94a3b8;
    --cat-compilers: #34d399;
    --cat-teams: #e879f9;
    --cat-career: #38bdf8;
    --bs-body-bg: #0c1220;
    --bs-body-color: #e6ebf5;
    --bs-link-color-rgb: 109, 155, 255;
    --bs-link-hover-color-rgb: 150, 182, 255;
}

html, body { overflow-x: clip; }
body {
    background: var(--surface-2);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); }
code { color: inherit; background: var(--brand-soft); padding: .1em .35em; border-radius: 5px; font-size: .88em; word-break: break-word; }
pre { background: #0b1220; color: #e2e8f0; padding: 1rem 1.1rem; border-radius: 10px; overflow-x: auto; font-size: .88rem; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Navigation ---------- */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav .navbar-brand { font-size: 1.12rem; color: var(--ink); letter-spacing: -.01em; }
.site-nav .navbar-brand strong { color: var(--brand); }
.site-nav .nav-link { color: var(--muted); font-weight: 500; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--brand); }
.nav-search input { min-width: 220px; border-radius: 999px; background: var(--surface-2); }
.theme-toggle { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.mega-menu { border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 0 .5rem; margin-top: .55rem !important; width: 100%; left: 0; right: 0; }
.mega-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .25rem 1rem .4rem; }
.mega-menu .dropdown-item { border-radius: 8px; padding: .38rem 1rem; font-size: .93rem; white-space: normal; }
.mega-menu .dropdown-item i { color: var(--brand); margin-right: .35rem; }
.mega-footer { border-top: 1px solid var(--line); margin-top: .75rem; padding: .6rem 1rem 0; font-size: .9rem; }
@media (max-width: 991.98px) {
    .mega-menu { box-shadow: none !important; border: 0; }
    .nav-search input { min-width: 0; width: 100%; }
    .nav-search { margin-top: .5rem; }
}

/* ---------- Home hero ---------- */
.ip-display { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.ip-value { font-family: var(--mono); font-weight: 700; font-size: clamp(1.6rem, 5.4vw, 3.3rem); line-height: 1.15; word-break: break-all; letter-spacing: -.02em; }
.btn-copy-lg { border-radius: 999px; font-weight: 600; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.badge-soft { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); color: #fff; border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; }
.dual-stack { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.1rem; max-width: 640px; }
.stack-item { background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: .55rem .8rem; min-width: 0; }
.stack-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #c7d7ff; }
.stack-value { font-family: var(--mono); font-size: .92rem; word-break: break-all; }
.stack-item.ok .stack-label::after { content: " ✓"; color: #86efac; }
.stack-item.missing .stack-value { color: #c7d7ff; font-family: inherit; }
.stack-item .btn-copy { color: #dbe5ff; }
.hero-search { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--radius); padding: 1.2rem; }
.hero-search .form-label { color: #dbe5ff; font-size: .95rem; }
@media (max-width: 575.98px) { .dual-stack { grid-template-columns: 1fr; } }
.home-search { position: relative; max-width: 760px; margin: 0 auto; text-align: left; }
.home-search-box { display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 999px; padding: .35rem .35rem .35rem 1.1rem;
    box-shadow: 0 14px 40px rgba(2, 6, 23, .35); }
.home-search-box > .bi-search { color: #64748b; font-size: 1.15rem; }
.home-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #0f172a; font-size: 1.1rem; padding: .55rem .2rem; }
.home-search-box input::placeholder { color: #94a3b8; }
.home-search-box .btn { border-radius: 999px; font-weight: 700; padding: .6rem 1.4rem; }
.home-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + .45rem); list-style: none; margin: 0; padding: .35rem;
    background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); border-radius: 16px;
    box-shadow: 0 18px 44px rgba(2, 6, 23, .3); max-height: 420px; overflow-y: auto; }
.home-suggest a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: inherit; text-decoration: none; }
.home-suggest a.active, .home-suggest a:hover { background: var(--bs-tertiary-bg); }
.home-suggest .bi { color: var(--brand, #1d4ed8); font-size: 1.1rem; }
.home-suggest strong { display: block; font-size: .96rem; }
.home-suggest small { color: var(--bs-secondary-color); }
.home-suggest .sg-cat { margin-left: auto; font-size: .75rem; color: var(--bs-secondary-color); white-space: nowrap; }

/* ---------- Home (Oct 2026): hero, tool cards, category tiles, trust strip, guides, A–Z ----------
   One card style for the whole page; each card takes its category colour from --cat-<key> via .cat-<key>.
   Spacing on an 8px grid: sections 64px apart on desktop, 40px on phones. */
.cat-ip { --c: var(--cat-ip); } .cat-pdf { --c: var(--cat-pdf); } .cat-ai { --c: var(--cat-ai); } .cat-money { --c: var(--cat-money); }
.cat-health { --c: var(--cat-health); } .cat-everyday { --c: var(--cat-everyday); } .cat-device { --c: var(--cat-device); }
.cat-sleep { --c: var(--cat-sleep); } .cat-security { --c: var(--cat-security); } .cat-zip { --c: var(--cat-zip); }
.cat-dev { --c: var(--cat-dev); } .cat-compilers { --c: var(--cat-compilers); } .cat-teams { --c: var(--cat-teams); } .cat-career { --c: var(--cat-career); }

.home-hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 40px 0 48px; }
.hero-center { max-width: 820px; margin: 0 auto; text-align: center; }
.hero-title { font-size: clamp(1.75rem, 4.2vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; }
.hero-lead { color: #dbe5ff; font-size: 1.08rem; max-width: 680px; margin: 0 auto 24px; }

.hm-section { padding: 32px 0; }
.home-body { padding-bottom: 32px; }
.hm-h2, .hm-about-wrap h2 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 16px; }
.hm-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.hm-head .hm-h2 { margin: 0; }
.hm-head-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hm-head-link:hover { text-decoration: underline; }

.tf-grid, .cat-grid, .cat-top, .guide-grid, .hm-trust, .hm-az-list { list-style: none; margin: 0; padding: 0; }
.tf-grid, .cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tf-grid > li[hidden] { display: none; }
.new-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-card, .cat-tile, .guide-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.tf-card:hover, .cat-tile:hover, .guide-card:hover { border-color: color-mix(in srgb, var(--c, var(--brand)) 45%, var(--line));
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08); transform: translateY(-2px); color: var(--ink); }
[data-bs-theme="dark"] .tf-card:hover, [data-bs-theme="dark"] .cat-tile:hover, [data-bs-theme="dark"] .guide-card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.tf-card:focus-visible, .guide-card:focus-visible, .hm-az summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tf-card { display: flex; gap: 12px; align-items: flex-start; height: 100%; min-height: 88px; padding: 16px; text-decoration: none; }
.tf-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem;
    color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 13%, var(--surface)); }
.tf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-name { font-weight: 650; font-size: 1rem; line-height: 1.3; }
.tf-desc { color: var(--muted); font-size: .875rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tf-desc.tf-ip { display: flex; flex-direction: column; -webkit-line-clamp: unset; line-clamp: none; }
.tf-ip-value { font-family: var(--mono); font-weight: 700; font-size: .9rem; color: var(--ink); word-break: break-all; }
.tf-ip-meta { min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* reserved: filled from /json */
.hm-more-wrap { text-align: center; margin-top: 24px; }
.hm-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 24px; border-radius: 999px; font-weight: 600;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.hm-more:hover, .hm-more:focus-visible { border-color: var(--brand); color: var(--brand); background: var(--surface); }

.cat-tile { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.cat-body { min-width: 0; }
.cat-title { font-size: 1rem; font-weight: 650; line-height: 1.3; margin: 0; }
.cat-link { color: var(--ink); text-decoration: none; }
.cat-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }   /* the whole tile opens the category */
.cat-link:hover { color: var(--ink); }
.cat-link:focus-visible { outline: none; }
.cat-link:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 2px; }
.cat-count { display: block; font-size: .8125rem; color: var(--muted); margin: 2px 0 8px; }
.cat-top a { position: relative; z-index: 1; display: inline-block; padding: 3px 0; font-size: .875rem; color: var(--muted); text-decoration: none; }
.cat-top a:hover, .cat-top a:focus-visible { color: var(--c, var(--brand)); }

.hm-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; padding: 24px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 12px; }
.hm-trust li { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.hm-trust-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem;
    color: var(--brand); background: var(--brand-soft); }
.hm-trust strong { display: block; font-size: .95rem; line-height: 1.3; }
.hm-trust li > div > span { display: block; font-size: .875rem; color: var(--muted); }
.hm-trust a { font-weight: 600; }

.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 20px; text-decoration: none; }
.guide-cat { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.guide-card strong { font-size: 1.02rem; line-height: 1.35; }
.guide-card small { color: var(--muted); margin-top: auto; }

.hm-about p { line-height: 1.65; }
.hm-about-wrap .faq .accordion-button { min-height: 52px; }

.hm-az { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.hm-az summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 20px; cursor: pointer;
    list-style: none; border-radius: 12px; }
.hm-az summary::-webkit-details-marker { display: none; }
.hm-az summary .hm-h2 { margin: 0; font-size: 1.25rem; }
.hm-az-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line);
    border-radius: 999px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.hm-az summary:hover .hm-az-btn { border-color: var(--brand); }
.hm-az-btn i { transition: transform .15s ease; }
.hm-az[open] .hm-az-btn i { transform: rotate(180deg); }
.hm-az[open] .hm-az-open, .hm-az:not([open]) .hm-az-close { display: none; }
.hm-az-list { columns: 4 200px; column-gap: 24px; padding: 8px 20px; border-top: 1px solid var(--line); }
.hm-az-list li { break-inside: avoid; }
.hm-az-list a { display: block; padding: 4px 0; font-size: .9rem; text-decoration: none; }
.hm-az-list a:hover { text-decoration: underline; }
.hm-az-foot { padding: 0 20px 16px; margin: 0; font-size: .9rem; }

@media (max-width: 991.98px) {
    .tf-grid, .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hm-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .tf-grid, .cat-grid, .new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .guide-grid { grid-template-columns: 1fr; gap: 12px; }
    .home-hero { padding: 24px 0 32px; }
    .hero-lead { font-size: 1rem; margin-bottom: 20px; }
    .hm-section { padding: 20px 0; }
    .hm-h2, .hm-about-wrap h2 { font-size: 1.3rem; }
    .tf-card { flex-direction: column; gap: 8px; min-height: 0; padding: 12px; }
    .tf-icon { flex-basis: auto; width: 36px; height: 36px; font-size: 1.1rem; }
    .tf-name { font-size: .95rem; }
    .tf-desc { font-size: .8125rem; }
    .cat-tile { flex-direction: column; gap: 8px; padding: 12px; }
    .cat-top a { padding: 4px 0; min-height: 28px; }
    .hm-trust { padding: 16px; }
}
@media (max-width: 575.98px) {
    .mu-grid:not(.is-expanded) > li:nth-child(n+9) { display: none; }   /* phones start with 8 cards */
    .hm-trust { grid-template-columns: 1fr; }
    .hm-az summary { padding: 8px 12px 8px 16px; }
    .hm-az summary .hm-h2 { font-size: 1.1rem; }
    .hm-az-list { columns: 2; column-gap: 16px; padding: 8px 16px; }
    .hm-az-list a { padding: 6px 0; }
}
@media (max-width: 359.98px) {
    .tf-grid, .cat-grid, .new-grid { gap: 8px; }
    .hm-az-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .tf-card, .cat-tile, .guide-card, .hm-az-btn i { transition: none; }
    .tf-card:hover, .cat-tile:hover, .guide-card:hover { transform: none; }
}

/* ---------- Cards and details ---------- */
.card, .details-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .9rem 1.2rem; }
.detail-grid { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; margin: 0; }
.detail-grid dt, .detail-grid dd { padding: .5rem .2rem; border-bottom: 1px solid var(--line); margin: 0; }
.detail-grid dt { color: var(--muted); font-weight: 500; }
.detail-grid dt i { color: var(--brand); width: 1.2rem; display: inline-block; }
.detail-grid dd { word-break: break-word; }
.flag { vertical-align: -1px; border-radius: 2px; }
.map { height: 100%; min-height: 360px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.field-note { color: var(--muted); font-size: .88rem; margin-top: .9rem; }
.field-note i { color: var(--warn); }

.mini-card { position: relative; display: flex; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; height: 100%; }
.mini-card > i { font-size: 1.5rem; color: var(--brand); }
.mini-card small { display: block; color: var(--muted); }

.tool-card { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: 1rem 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(29, 78, 216, .1); color: var(--ink); }
.tool-card > i { font-size: 1.35rem; color: var(--brand); margin-bottom: .25rem; }
.tool-card small { color: var(--muted); line-height: 1.35; }

.btn-copy { background: none; border: 0; padding: 0 .3rem; color: var(--muted); cursor: pointer; line-height: 1; }
.btn-copy:hover { color: var(--brand); }

/* ---------- Tool pages ---------- */
.tool-hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 1.6rem 0 2rem; }
.tool-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; }
.tool-hero h1 i { opacity: .8; }
.tool-hero .lead { color: #dbe5ff; max-width: 780px; }
.tool-hero .breadcrumb { margin-bottom: .6rem; font-size: .85rem; }
.tool-hero .breadcrumb a { color: #c7d7ff; }
.tool-hero .breadcrumb-item.active, .tool-hero .breadcrumb-item + .breadcrumb-item::before { color: #9fb6ef; }
.tool-form { max-width: 820px; }
.tool-form .form-select, .tool-form .form-control { border: 0; }
.tool-form label { color: #dbe5ff; }
.form-examples { margin-top: .55rem; font-size: .85rem; color: #c7d7ff; }
.form-examples a { color: #fff; }
.tool-body { padding-top: 1.6rem; padding-bottom: 3rem; }

.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.result-card > .rc-head { padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.result-card > .rc-head h2, .result-card > .rc-head h3 { font-size: 1.05rem; margin: 0; font-weight: 650; }
.result-card > .rc-body { padding: 1rem 1.15rem; }
.result-card .table { margin: 0; --bs-table-bg: transparent; }
.result-card .table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.result-card .table td { vertical-align: top; word-break: break-word; }
.table-mono td { font-family: var(--mono); font-size: .9rem; }
.kv { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; }
.kv > div { padding: .55rem 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.kv > div:nth-child(odd) { color: var(--muted); font-weight: 500; padding-right: 1rem; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 575.98px) {
    .kv { grid-template-columns: 1fr; }
    .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; font-size: .85rem; }
}
.empty-note { color: var(--muted); font-style: italic; }

.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.pill-ok { background: rgba(21, 128, 61, .12); color: var(--ok); }
.pill-warn { background: rgba(180, 83, 9, .12); color: var(--warn); }
.pill-bad { background: rgba(185, 28, 28, .12); color: var(--bad); }
.pill-info { background: var(--brand-soft); color: var(--brand); }

.big-verdict { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.2rem; }
.big-verdict i { font-size: 2.2rem; }
.big-verdict.ok i { color: var(--ok); }
.big-verdict.warn i { color: var(--warn); }
.big-verdict.bad i { color: var(--bad); }
.big-verdict strong { display: block; font-size: 1.2rem; }

.grade { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 12px; font-size: 1.6rem; font-weight: 800; color: #fff; }
.grade-A { background: #15803d; } .grade-B { background: #4d7c0f; } .grade-C { background: #b45309; } .grade-D { background: #c2410c; } .grade-F { background: #b91c1c; }

.issue-list { list-style: none; padding: 0; margin: 0; }
.issue-list li { padding: .45rem 0 .45rem 1.7rem; position: relative; }
.issue-list li::before { position: absolute; left: 0; font-family: "bootstrap-icons"; }
.issue-list .bad::before { content: "\F622"; color: var(--bad); }
.issue-list .warn::before { content: "\F33B"; color: var(--warn); }
.issue-list .ok::before { content: "\F26B"; color: var(--ok); }

.record-raw { font-family: var(--mono); font-size: .88rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; word-break: break-all; }
details.raw summary { cursor: pointer; color: var(--brand); font-weight: 500; }
details.raw pre { max-height: 420px; margin-top: .6rem; }

.port-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.port-chips a { font-size: .82rem; border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 999px; padding: .15rem .6rem; text-decoration: none; }
.port-chips a:hover { background: rgba(255, 255, 255, .15); }

/* ---------- Prose (guides and tool explainers) ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; line-height: 1.72; font-size: 1.03rem; }
.prose h2 { font-size: 1.45rem; margin: 2rem 0 .8rem; letter-spacing: -.01em; scroll-margin-top: calc(var(--header-h, 70px) + 12px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
.prose .lead { font-size: 1.15rem; color: var(--muted); }
.prose table { font-size: .93rem; }
.prose .table { --bs-table-bg: transparent; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .3rem; }
.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: .9rem 1.1rem; border-radius: 0 10px 10px 0; margin: 1.2rem 0; }
.callout-warn { border-left-color: var(--warn); background: rgba(180, 83, 9, .08); }
@media (max-width: 575.98px) { .prose { padding: 1.2rem 1.1rem; } }
.prose .table-responsive, .prose table { display: block; overflow-x: auto; }

.faq .accordion-button { font-weight: 600; }
.faq .accordion-item { background: var(--surface); }

/* ---------- Sidebar ---------- */
.side-card, .toc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; }
.toc-card { top: calc(var(--header-h, 70px) + 14px); transition: top .2s; }
.side-heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin-bottom: .7rem; }
.side-list { list-style: none; padding: 0; margin: 0 0 .6rem; }
.side-list a { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.side-list li:last-child a { border-bottom: 0; }
.side-list a:hover strong { color: var(--brand); }
.side-list i { color: var(--brand); font-size: 1.1rem; margin-top: .1rem; }
.side-list strong { display: block; font-weight: 600; font-size: .95rem; }
.side-list small { color: var(--muted); }
#toc { padding-left: 1.1rem; margin: 0; font-size: .92rem; }
#toc li { margin-bottom: .35rem; }

/* ---------- Articles ---------- */
.article-hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 1.8rem 0 2.2rem; }
.article-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 750; letter-spacing: -.02em; max-width: 900px; }
.article-hero .breadcrumb a { color: #c7d7ff; }
.article-hero .breadcrumb-item.active, .article-hero .breadcrumb-item + .breadcrumb-item::before { color: #9fb6ef; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; color: #c7d7ff; font-size: .9rem; margin: 0; }
.article-layout { padding-top: 2rem; padding-bottom: 3rem; }
.article-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-top: 1.5rem; }
.guide-card { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.guide-card:hover { border-color: var(--brand); color: var(--ink); }
.guide-card small, .guide-cat { color: var(--muted); font-size: .8rem; }
.guide-cat { text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }

/* ---------- Generic page hero ---------- */
.page-hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 2rem 0 2.3rem; }
.page-hero h1 { font-weight: 750; letter-spacing: -.02em; }
.page-hero .lead { color: #dbe5ff; max-width: 760px; }

/* ---------- Footer ---------- */
/* Footer: company strip, a directory of every category (most-searched tools first), legal bar.
   Desktop shows the directory as a grid; phones get an accordion (one tap per category). */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2.4rem 0 1.2rem; margin-top: 2rem; font-size: .92rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--brand); }
.footer-brand { color: var(--ink) !important; font-size: 1.05rem; }
.footer-brand strong { color: var(--brand); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem 3rem; flex-wrap: wrap; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.footer-about { max-width: 460px; }
.footer-tagline { color: var(--muted); font-size: .88rem; line-height: 1.55; margin: .7rem 0 .5rem; }
.footer-curl { margin: 0; font-size: .82rem; }
.footer-company { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; padding-top: .35rem; }
.footer-company a { color: var(--ink); font-weight: 600; font-size: .9rem; }
.footer-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 1.7rem 1.6rem; padding: 1.9rem 0 .4rem; }
.fcat > summary { list-style: none; cursor: default; }
.fcat > summary::-webkit-details-marker { display: none; }
.footer-heading { display: flex; align-items: center; gap: .45rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); font-weight: 700; margin: 0 0 .75rem; }
.footer-heading i { color: var(--brand); font-size: .95rem; }
.footer-heading small { margin-left: auto; font-size: .68rem; font-weight: 600; letter-spacing: 0; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem; }
.fcat ul { list-style: none; margin: 0; padding: 0; }
.fcat li { margin: 0 0 .42rem; line-height: 1.35; }
.fcat .fcat-all a { color: var(--brand); font-weight: 600; font-size: .86rem; }
.fcat .fcat-all i { font-size: .8rem; transition: transform .15s ease; display: inline-block; }
.fcat .fcat-all a:hover i { transform: translateX(3px); }
.fcat .fcat-extra[hidden] { display: none; }
.fcat-more { border: 0; background: none; padding: 0; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.fcat-more:hover, .fcat-more:focus-visible { color: var(--brand); }
.fcat-more i { font-size: .72rem; transition: transform .15s ease; }
.fcat-more[aria-expanded="true"] i { transform: rotate(180deg); }
.fcat-guides { grid-column: 1 / -1; }
.fcat-guides ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .42rem 1.6rem; }
.fcat-guides li { margin: 0; }
.fcat-guides .fcat-more-li, .fcat-guides .fcat-all { grid-column: 1 / -1; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem 2rem; border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1.1rem; color: var(--muted); font-size: .84rem; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.2rem; }
.footer-copy { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
@media (max-width: 767.98px) {
    .site-footer { padding-top: 1.8rem; }
    .footer-top { flex-direction: column; gap: 1rem; padding-bottom: 1.2rem; }
    .footer-company { gap: .2rem 1.1rem; }
    .footer-company a { display: inline-block; padding: .3rem 0; }
    .footer-dir { display: block; padding: .4rem 0 0; }
    .fcat { border-bottom: 1px solid var(--line); }
    .fcat > summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
    .fcat .footer-heading { min-height: 52px; margin: 0; font-size: .8rem; padding-right: 1.6rem; position: relative; }
    .fcat .footer-heading::after { content: ""; position: absolute; right: .35rem; top: 50%; width: .5rem; height: .5rem; margin-top: -.35rem;
        border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
    .fcat[open] .footer-heading::after { transform: rotate(-135deg); margin-top: -.1rem; }
    .fcat ul, .fcat-guides ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; columns: auto; padding: 0 0 .9rem 1.45rem; }
    .fcat-guides ul { grid-template-columns: 1fr; }
    .fcat li { margin: 0; }
    .fcat li a { display: block; padding: .5rem 0; }
    .fcat .fcat-all, .fcat .fcat-more-li { grid-column: 1 / -1; }
    .fcat-more { padding: .55rem 0; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .footer-legal a, .footer-legal .footer-linkbtn { padding: .3rem 0; }
}
@media (max-width: 359.98px) { .fcat ul { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .fcat .footer-heading::after, .fcat .fcat-all i, .fcat-more i { transition: none; } }

.toast { background: var(--ink); color: var(--surface); }
.container.narrow { max-width: 1140px; }

/* ---------- Extension promo ---------- */
.ext-shot { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.feature-list { list-style: none; padding: 0; }
.feature-list li { display: flex; gap: .8rem; padding: .6rem 0; }
.feature-list i { color: var(--brand); font-size: 1.3rem; }

/* ---------- Speed test ---------- */
.gauge { width: 100%; max-width: 320px; }
.gauge-track, .gauge-fill { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge-track { stroke: var(--line); }
.gauge-fill { stroke: url(#none); stroke: var(--brand); transition: stroke-dasharray .25s ease-out; }
.gauge-readout { margin-top: -78px; margin-bottom: 18px; }
.gauge-value { font-size: 2.6rem; font-weight: 800; font-family: var(--mono); line-height: 1; }
.gauge-unit { color: var(--muted); font-weight: 600; }
.gauge-phase { color: var(--muted); font-size: .9rem; margin-top: .3rem; min-height: 1.4em; }
.speed-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.speed-tile small { display: block; color: var(--muted); }
.speed-tile strong { font-size: 2rem; font-family: var(--mono); margin-right: .3rem; }
.speed-tile span { color: var(--muted); }

/* ---------- Audit reports ---------- */
.grade-lg { width: 4.2rem; height: 4.2rem; font-size: 2.2rem; border-radius: 16px; }
.finding { padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.finding:last-child { border-bottom: 0; }
.finding-high { border-left-color: var(--bad); }
.finding-medium { border-left-color: var(--warn); }
.finding-low { border-left-color: var(--brand); }
.finding-info { border-left-color: var(--line); }
.finding-ok { border-left-color: var(--ok); }
.sev { font-size: .7rem; font-weight: 800; letter-spacing: .06em; padding: .15rem .5rem; border-radius: 6px; color: #fff; white-space: nowrap; }
.sev-high { background: var(--bad); } .sev-medium { background: #c2410c; } .sev-low { background: var(--brand); } .sev-info { background: #64748b; }
.serp { max-width: 620px; font-family: Arial, sans-serif; }
.serp-title { color: #1a0dab; font-size: 1.25rem; line-height: 1.3; }
[data-bs-theme="dark"] .serp-title { color: #8ab4f8; }
.serp-desc { color: var(--muted); }
.heading-line { padding: .15rem 0 .15rem calc((var(--lvl) - 1) * 1.1rem); }
.waterfall { display: grid; gap: .5rem; }
.wf-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: .7rem; font-size: .9rem; }
.wf-row b { text-align: right; font-family: var(--mono); font-weight: 600; }
.wf-bar { background: var(--surface-2); border-radius: 6px; height: 14px; overflow: hidden; }
.wf-bar i { display: block; height: 100%; min-width: 3px; border-radius: 6px; }
.wf-redirect { background: #94a3b8; } .wf-dns { background: #0ea5e9; } .wf-connect { background: #f59e0b; }
.wf-tls { background: #a855f7; } .wf-server { background: #22c55e; } .wf-download { background: #2563eb; }
@media (max-width: 575.98px) { .wf-row { grid-template-columns: 95px 1fr 60px; } }

@media print {
    .site-nav, .site-footer, .tool-hero .tool-form, .tool-hero .breadcrumb, .no-print, .tool-body aside, .tool-body .prose, .toast-container, .skip-link, .article-cta, .toc-card { display: none !important; }
    .tool-hero { background: none !important; color: #000; padding: 0 0 1rem; }
    .tool-hero .lead { display: none; }
    body { background: #fff; }
    .result-card, .mini-card { break-inside: avoid; box-shadow: none; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- Developer tools ---------- */
.devtool { margin-bottom: 1.5rem; }
.dt-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.dt-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.dt-options { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.dt-options label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); }
.dt-options label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: .35rem; }
.dt-options .form-select, .dt-options .form-control { min-width: 8rem; }
.dt-panes { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 991.98px) { .dt-panes { grid-template-columns: 1fr; } }
.dt-pane { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.dt-pane-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .35rem .9rem; border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted); }
.dt-pane-tools .btn { font-size: .8rem; padding: .1rem .4rem; text-decoration: none; }
.dt-input, .dt-output { width: 100%; min-height: 420px; border: 0; padding: .9rem; font-size: .86rem; line-height: 1.5; background: var(--surface); color: var(--ink); resize: vertical; tab-size: 4; white-space: pre; overflow: auto; }
.dt-input:focus, .dt-output:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.dt-output { background: var(--surface-2); }
.dt-short { min-height: 140px; border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; }
textarea.dt-output:not(.dt-pane textarea) { border: 1px solid var(--line); border-radius: var(--radius); min-height: 260px; }
.dt-preview { padding: .9rem 1.1rem; min-height: 420px; overflow: auto; }
.dt-status { margin-top: .6rem; font-size: .88rem; color: var(--muted); min-height: 1.4em; }
.dt-status.dt-ok { color: var(--ok); }
.dt-status.dt-err { color: var(--bad); font-weight: 600; }
.dt-status.dt-warn { color: var(--warn); }
.dt-pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); color: var(--ink); padding: 1rem; border-radius: 0 0 var(--radius) var(--radius); font-size: .86rem; }
.rx-highlight mark { background: rgba(250, 204, 21, .55); color: inherit; border-radius: 3px; padding: 0 1px; }
.ts-now { font-size: 2rem; font-weight: 700; }
.prose-lite h1, .prose-lite h2, .prose-lite h3 { margin-top: 1rem; }
.prose-lite table { border-collapse: collapse; } .prose-lite td, .prose-lite th { border: 1px solid var(--line); padding: .3rem .6rem; }
.prose-lite pre { background: #0b1220; color: #e2e8f0; padding: .8rem; border-radius: 8px; }
.prose-lite blockquote { border-left: 4px solid var(--line); padding-left: .9rem; color: var(--muted); }
.mega-menu-dev .dropdown-item i { color: #7c3aed; }

/* ---------- Share location ---------- */
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.qr-box { width: 148px; height: 148px; background: #fff; border-radius: 10px; padding: 4px; flex: none; }
.qr-box svg { width: 100%; height: 100%; }
.pw-main { display: flex; gap: .5rem; }
.pw-main input { font-size: 1.25rem; letter-spacing: .02em; }
.pw-meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pw-bar { height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
.pw-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem 1rem; font-size: .92rem; }
.pw-options label { display: flex; gap: .4rem; align-items: center; }
@media (max-width: 575.98px) { .pw-main { flex-wrap: wrap; } .pw-main input { flex-basis: 100%; } }

/* ---------- Online compilers ---------- */
.compiler { --pane-height: 460px; --code-font: 14px; }
.compiler-panes .CodeMirror { height: var(--pane-height); font-size: var(--code-font); border: 0; }
.compiler-panes .dt-input { min-height: var(--pane-height); font-size: var(--code-font); }
.compiler-panes.stacked { grid-template-columns: 1fr; }
.compiler-panes.stacked .compiler-output { max-height: calc(var(--pane-height) * .6); min-height: 200px; }
.pane-resizer { height: 10px; margin: 2px 0; cursor: ns-resize; border-radius: 6px; background: linear-gradient(var(--line), var(--line)) center / 48px 3px no-repeat; touch-action: none; }
.pane-resizer:hover { background-color: var(--brand-soft); }
.compiler.fullscreen { position: fixed; inset: 0; z-index: 1080; background: var(--surface-2); padding: .75rem 1rem; display: flex; flex-direction: column; overflow: auto; }
.compiler.fullscreen .compiler-panes { flex: 1; min-height: 0; }
.compiler.fullscreen .compiler-panes .CodeMirror { height: calc(100vh - 150px); }
.compiler.fullscreen .compiler-panes.stacked .CodeMirror { height: calc(60vh - 80px); }
.compiler.fullscreen .compiler-output { max-height: calc(100vh - 150px); }
.compiler.fullscreen .compiler-panes.stacked .compiler-output { max-height: calc(40vh - 60px); }
.compiler.fullscreen .pane-resizer, .compiler.fullscreen ~ .mt-3 { display: none; }
body.compiler-full { overflow: hidden; }
.compiler-output { margin: 0; min-height: 300px; max-height: var(--pane-height); font-size: var(--code-font); overflow: auto; padding: .9rem; background: #0b1220; color: #e2e8f0; border-radius: 0; white-space: pre-wrap; word-break: break-word; font-size: .86rem; flex: 1; }
.compiler-output .out-err { color: #fca5a5; }
.compiler-output .out-muted { color: #94a3b8; font-style: italic; }
.compiler-output .sql-result { color: #e2e8f0; --bs-table-bg: transparent; --bs-table-color: #e2e8f0; border-color: #334155; }
.compiler-output .sql-result th { color: #93c5fd; }
.compiler-stdin { border: 0; padding: .6rem .9rem; background: var(--surface); color: var(--ink); resize: vertical; font-size: .86rem; }
.compiler-stdin:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }

/* ---------- File tools ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 2.4rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone > i { font-size: 2.6rem; color: var(--brand); }
.dropzone strong { font-size: 1.15rem; }
.dropzone.has-files { padding: 1.2rem 1rem; }
.dropzone.has-files > i { font-size: 1.6rem; }
.file-list, .result-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .35rem; min-width: 0; }
.file-tools .btn { padding: 0 .35rem; text-decoration: none; }
.ft-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem 1rem; margin-top: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ft-option { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
.ft-option.ft-check { flex-direction: row; align-items: center; color: var(--ink); }
.result-list li { display: flex; gap: .8rem; align-items: center; padding: .75rem 1.15rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.result-list li:last-child { border-bottom: 0; }
.result-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.min-w-0 { min-width: 0; }
.doc-preview { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.docx-render { position: absolute; left: -10000px; top: 0; width: 700px; background: #fff; color: #000; font-family: Calibri, Arial, sans-serif; font-size: 14px; line-height: 1.45; }
.docx-render img { max-width: 100%; }
.docx-render table { border-collapse: collapse; } .docx-render td, .docx-render th { border: 1px solid #999; padding: 4px; }

/* ---------- Navigation (reorganised) ---------- */
.mega-cols { columns: 2; column-gap: .5rem; }
.mega-cols .dropdown-item { break-inside: avoid; }
.mega-menu-files .dropdown-item i { color: #dc2626; }
.mega-menu-zip .dropdown-item i { color: #b45309; }
.mega-menu-web .dropdown-item i { color: #0f766e; }
.compilers-menu .dropdown-item i { color: #16a34a; }
.site-nav .nav-link { padding-left: .6rem; padding-right: .6rem; }
@media (min-width: 1200px) and (max-width: 1399.98px) { .nav-search input { min-width: 150px; } }
@media (max-width: 1199.98px) {
    .mega-menu { box-shadow: none !important; border: 0; }
    .nav-search input { min-width: 0; width: 100%; }
    .nav-search { margin-top: .5rem; }
    .mega-cols { columns: 1; }
}

/* ---------- Command palette & menu filters ---------- */
.palette-trigger { display: flex; align-items: center; gap: .5rem; min-width: 250px; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; text-align: left; }
.palette-trigger:hover { border-color: var(--brand); color: var(--ink); }
.palette-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-trigger kbd, .palette-head kbd, .palette-foot kbd { font-size: .7rem; background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: none; padding: .05rem .35rem; }
.palette-dialog { margin-top: 8vh; }
.palette-dialog .modal-content { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.palette-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.palette-head i { color: var(--muted); font-size: 1.1rem; }
.palette-head input { border: 0; box-shadow: none !important; font-size: 1.1rem; background: transparent; padding: .3rem 0; }
.palette-results { list-style: none; margin: 0; padding: .4rem; max-height: 60vh; }
.palette-item { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.palette-item > i { font-size: 1.15rem; color: var(--brand); width: 1.4rem; text-align: center; }
.palette-item.active { background: var(--brand-soft); }
.palette-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-cat { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.palette-empty { padding: 1.2rem; color: var(--muted); text-align: center; }
.palette-foot { display: flex; justify-content: space-between; padding: .5rem 1rem; border-top: 1px solid var(--line); }
.mega-filter { max-width: 320px; margin: 0 1rem .75rem; }

/* ZIP & archive tools */
.archive-table { max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.archive-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.archive-table td { font-size: .9rem; }
.zip-edit-list { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem; }
.zip-edit-row { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .25rem .35rem; }
.zip-edit-row.removed input[type=text], .zip-edit-row.removed .form-control { text-decoration: line-through; opacity: .5; }
.ft-option .input-group { flex-wrap: nowrap; }
.site-nav .nav-link { white-space: nowrap; }
.compiler-plot { display: block; max-width: 100%; height: auto; background: #fff; border-radius: 6px; margin: .4rem 0; }
.hero-speed { font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ai-menu .dropdown-item i { color: #7c3aed; margin-right: .35rem; }

/* AI detectors */
.ai-textarea { font-size: .95rem; line-height: 1.55; }
.ai-gauge { display: flex; gap: 1.1rem; align-items: center; padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.ai-gauge-num { font-size: 2.4rem; font-weight: 800; min-width: 5.2rem; text-align: center; line-height: 1; }
.ai-gauge-label { font-weight: 700; font-size: 1.1rem; }
.ai-gauge > div:last-child { flex: 1; min-width: 0; }
.ai-meter { height: 10px; border-radius: 6px; background: var(--line); margin: .45rem 0 .35rem; overflow: hidden; }
.ai-meter span { display: block; height: 100%; border-radius: 6px; background: currentColor; }
.ai-v-high { color: #b91c1c; } .ai-v-mid { color: #c2410c; } .ai-v-mixed { color: #a16207; } .ai-v-low { color: #15803d; } .ai-v-human { color: #15803d; }
.ai-gauge .ai-gauge-label, .ai-gauge .small { color: var(--ink); } .ai-gauge .small.text-body-secondary { color: var(--muted) !important; }
.ai-highlighted { white-space: pre-wrap; line-height: 1.7; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 560px; overflow: auto; }
.ai-highlighted mark, .ai-legend mark { padding: 0 .1em; border-radius: 3px; color: inherit; }
.ai-hl-high { background: rgba(239, 68, 68, .32); } .ai-hl-mid { background: rgba(249, 115, 22, .26); } .ai-hl-low { background: rgba(234, 179, 8, .22); }
.ai-para { background: rgba(234, 179, 8, .3); border-bottom: 2px dotted #a16207; }
.ai-src-0 { background: rgba(239, 68, 68, .3); } .ai-src-1 { background: rgba(59, 130, 246, .3); } .ai-src-2 { background: rgba(168, 85, 247, .3); }
.ai-src-3 { background: rgba(16, 185, 129, .3); } .ai-src-4 { background: rgba(236, 72, 153, .3); } .ai-src-5 { background: rgba(14, 165, 233, .3); }
.ai-src-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; vertical-align: -.05em; }
.ai-signals th { width: 40%; font-weight: 600; }
.ai-checks { list-style: none; padding: 0; } .ai-checks li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.ai-claims li { margin-bottom: .35rem; }
.ai-image-preview { margin-top: 1rem; text-align: center; } .ai-image-preview img { max-width: 100%; max-height: 360px; border-radius: 10px; border: 1px solid var(--line); }
.ai-ela { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #000; }

.sitemap-cols { columns: 3 220px; column-gap: 2rem; padding-left: 1.1rem; } .sitemap-cols li { break-inside: avoid; margin-bottom: .25rem; }

.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: .35rem 0; }
.feature-list i { color: var(--brand); margin-right: .3rem; }
.tool-card.compact { padding: .7rem .9rem; }
.tool-card.compact small { font-size: .78rem; }
.compiler-features .feature-list li { display: block; grid-template-columns: none; }


/* Favourite tools (stored in the browser) */
.tool-title { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tool-title h1 { margin-bottom: 0; }
.fav-btn { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255, 255, 255, .12); color: #fff;
    border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: .3rem .85rem; font-size: .88rem; font-weight: 600; }
.fav-btn:hover { background: rgba(255, 255, 255, .22); }
.fav-btn.on { background: #fde68a; border-color: #fde68a; color: #1e293b; }
.fav-btn.on i { color: #b45309; }
.tool-hero .lead { margin-top: .6rem; }
.hero-favs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem; margin-top: 1.1rem; }
.hero-favs-label { color: #fde68a; font-weight: 700; font-size: .9rem; margin-right: .2rem; }
.hero-favs-list { display: contents; }
.fav-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 999px; box-shadow: 0 4px 14px rgba(2, 6, 23, .25); }
.fav-chip a { color: #0f172a; text-decoration: none; font-weight: 600; font-size: .9rem; padding: .35rem .2rem .35rem .8rem; }
.fav-chip a .bi { color: #1d4ed8; }
.fav-remove { border: 0; background: transparent; color: #64748b; font-size: 1.05rem; line-height: 1; padding: .3rem .65rem .35rem .4rem; border-radius: 999px; }
.fav-remove:hover { color: #dc2626; }
@media (max-width: 767.98px) {
    .hero-favs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px .2rem; }
    .hero-favs::-webkit-scrollbar { display: none; }
    .fav-chip, .hero-favs-label { flex: 0 0 auto; }
}
.scan-consent { color: #dbe5ff; }
.scan-consent a { color: #fde68a; }

/* Contact form */
.contact-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-card { border-radius: var(--radius); }

/* Home hero v2: the IP answer first, then the toolbox headline and search */
.ip-answer { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem 1.6rem; align-items: center;
    max-width: 1100px; margin: 0 auto 2.4rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius); padding: 1.2rem 1.5rem; }
.ip-answer-label { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #c7d7ff; margin: 0 0 .3rem; }
.ip-answer .ip-value { font-size: clamp(1.6rem, 4.6vw, 2.8rem); }
.ip-answer .hero-badges { margin-top: .7rem; }
.ip-answer .dual-stack { margin-top: 0; }
@media (max-width: 767.98px) {
    .ip-answer { grid-template-columns: 1fr; padding: 1rem; margin-bottom: 1.6rem; }
    .ip-answer-side .dual-stack { display: none; }        /* the IP is already shown above */
    .ip-answer-side .d-flex { margin-top: 0 !important; flex-wrap: nowrap !important; }
    .ip-answer-side .btn { flex: 1 1 0; font-size: .9rem; padding: .45rem .5rem; white-space: nowrap; }
    .ip-answer .hero-badges { gap: .35rem; }
    .ip-answer .badge-soft { font-size: .8rem; padding: .2rem .6rem; }
}
@media (max-width: 399.98px) {   /* long translations (de, ru): the two buttons stack instead of running off screen */
    .ip-answer-side .d-flex { flex-wrap: wrap !important; }
    .ip-answer-side .btn { flex: 1 1 100%; }
}

/* Collaborative editor */
.collab-status { margin: .75rem 0 .4rem; font-size: .92rem; color: var(--bs-secondary-color); }
.collab-people { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.collab-person { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; border-radius: 999px;
    padding: .15rem .65rem; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.collab-person::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); }
.collab-editor { border: 1px solid var(--bs-border-color); border-radius: 12px; overflow: hidden; }
.collab-editor .CodeMirror { height: 62vh; min-height: 360px; font-family: var(--mono); font-size: 14px; }
.remote-caret { position: absolute; border-left-style: solid; border-left-width: 2px; height: 1em; }
.remote-caret > div { position: relative; top: -1.05em; font-size: 11px; font-family: system-ui, sans-serif; line-height: normal;
    user-select: none; color: #fff; padding: 0 4px; border-radius: 3px; white-space: nowrap; z-index: 3; }

#collabPanel.fullscreen { position: fixed; inset: 0; z-index: 2000; background: var(--bs-body-bg); padding: .8rem 1rem; overflow: auto; }
#collabPanel.fullscreen .collab-editor .CodeMirror { height: calc(100vh - 11rem); }
body.collab-full { overflow: hidden; }




/* Collaborative editor toolbar */
.collab-fields { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.collab-field { display: flex; align-items: center; gap: .45rem; margin: 0; }
.collab-field input { width: 12rem; }
.collab-field select { width: auto; }

/* ---------- Phones: adaptive tweaks ---------- */
@media (max-width: 575.98px) {
    /* iOS Safari zooms into any focused field under 16px */
    input.form-control, input.form-control-sm, select.form-select, select.form-select-sm, textarea.form-control,
    .home-search-box input, .lookup-form input { font-size: 16px; }
    .tool-hero { padding: 1.1rem 0 1.4rem; }
    .tool-hero h1 { font-size: 1.5rem; }
    .tool-hero .lead { font-size: 1rem; margin-top: .4rem; }
    .tool-hero .breadcrumb { font-size: .8rem; }
    .fav-btn { padding: .3rem .6rem; }
    .fav-btn .fav-label { display: none; }
    .prose { padding: 1.1rem 1rem; font-size: 1rem; line-height: 1.65; }
    .prose h2 { font-size: 1.25rem; margin-top: 1.6rem; }
    .prose h3 { font-size: 1.07rem; }
    .prose .lead { font-size: 1.05rem; }
    #processBtn, .tool-body > .btn-lg { width: 100%; }
    .article-hero h1 { font-size: 1.55rem; }
    .collab-fields, .collab-field, .collab-actions { width: 100%; }
    .collab-field > span { flex: 0 0 5.5rem; }
    .collab-field input, .collab-field select { flex: 1; width: auto; }
    .collab-actions .btn { flex: 1; }
}


/* "Code together" (compiler pages): colourful entry point to the collaborative editor */
.btn-invite { color: #fff; font-weight: 600; border: 0; background: linear-gradient(135deg, #7c3aed, #db2777);
    box-shadow: 0 4px 14px rgba(124, 58, 237, .35); }
.btn-invite:hover, .btn-invite:focus { color: #fff; background: linear-gradient(135deg, #6d28d9, #be185d); }

/* ToolsForAnyone brand: blue-to-violet like the logo */
.site-nav .navbar-brand strong, .footer-brand strong {
    background: linear-gradient(90deg, #2563eb, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-bs-theme="dark"] .site-nav .navbar-brand strong, [data-bs-theme="dark"] .footer-brand strong {
    background: linear-gradient(90deg, #93c5fd, #c4b5fd); -webkit-background-clip: text; background-clip: text; }

/* ATS CV checker */
.ats-label { color: #dbe5ff; font-weight: 700; }
.ats-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center; cursor: pointer;
    min-height: 168px; border: 2px dashed rgba(255, 255, 255, .45); border-radius: 16px; background: rgba(255, 255, 255, .08); color: #fff; padding: 1rem; }
.ats-drop:hover, .ats-drop.dragging { background: rgba(255, 255, 255, .16); }
.ats-drop .bi { font-size: 2.2rem; color: #fde68a; }
.ats-drop span { font-size: .88rem; color: #c7d7ff; }
.ats-drop em { font-style: normal; font-weight: 700; color: #a7f3d0; word-break: break-all; }
.ats-form details summary { color: #c7d7ff; cursor: pointer; }
.ats-private { color: #c7d7ff; }
.ats-gauge { --p: 0; --c: #16a34a; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; position: relative;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bs-tertiary-bg) 0); }
.ats-gauge::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface, var(--bs-body-bg)); }
.ats-gauge span, .ats-gauge small { position: relative; }
.ats-gauge span { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.ats-gauge small { margin-top: -1.6rem; color: var(--bs-secondary-color); }
.ats-gauge.ats-ok { --c: #d97706; } .ats-gauge.ats-low { --c: #dc2626; }
.ats-bar { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: .6rem; align-items: center; font-size: .88rem; margin-bottom: .35rem; }
.ats-bar .progress { height: .55rem; }
.ats-bar b { text-align: right; }
.ats-check { display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line, var(--bs-border-color)); }
.ats-check .bi { font-size: 1.05rem; margin-top: .1rem; }
.ats-check strong { display: block; font-size: .95rem; }
.ats-check small { color: var(--bs-secondary-color); }
.ats-pass .bi { color: #16a34a; } .ats-warn .bi { color: #d97706; } .ats-fail .bi { color: #dc2626; }
.ats-kws { display: flex; flex-wrap: wrap; gap: .35rem; }
.ats-kw { font-size: .82rem; font-weight: 600; border-radius: 999px; padding: .2rem .65rem; background: #dcfce7; color: #166534; }
.ats-missing .ats-kw { background: #fee2e2; color: #991b1b; }
.ats-text summary { list-style: none; cursor: pointer; }
.ats-text pre { max-height: 360px; overflow: auto; white-space: pre-wrap; }
@media (max-width: 575.98px) { .ats-bar { grid-template-columns: 7.5rem 1fr 2.6rem; font-size: .8rem; } .ats-gauge { width: 112px; height: 112px; } }

/* What's my IP number (answer box inside the tool hero) and IP to geolocation */
.ip-answer-inline { max-width: none; margin: 1.2rem 0 0; }
.geo-map { height: 340px; border-radius: 0; margin: 0; }
.geo-table td, .geo-table th { white-space: nowrap; }
.geo-form textarea { font-size: .92rem; }

/* Team Quiz: answer colours and shapes shared by the host screen and the player page */
.quiz-c0 { --qc: #e21b3c; } .quiz-c1 { --qc: #1368ce; } .quiz-c2 { --qc: #c88a00; } .quiz-c3 { --qc: #26890c; }
.quiz-team-red { --tc: #e21b3c; } .quiz-team-blue { --tc: #1368ce; } .quiz-team-green { --tc: #26890c; } .quiz-team-yellow { --tc: #c88a00; }
.quiz-steps { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: #c7d7ff; font-size: .95rem; }
.quiz-steps b { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fbbf24; color: #1f2937; margin-right: .3rem; }
.quiz-qcard { border: 1px solid var(--line); border-radius: .75rem; padding: .85rem; margin-bottom: .85rem; background: var(--bs-body-bg); }
.quiz-qcard-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.quiz-qopts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quiz-qopt { display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border-radius: .55rem; background: var(--qc); margin: 0; }
.quiz-qopt .quiz-shape { color: #fff; width: 1.2rem; text-align: center; }
.quiz-qopt input[type=radio] { width: 1.25rem; height: 1.25rem; accent-color: #fff; flex: 0 0 auto; cursor: pointer; }
@media (max-width: 575.98px) { .quiz-qopts { grid-template-columns: 1fr; } }

/* host screen */
.quiz-live { background: linear-gradient(160deg, #1e1b4b, #312e81 55%, #4c1d95); color: #fff; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; min-height: 460px; }
.quiz-live:fullscreen { border-radius: 0; overflow: auto; display: flex; flex-direction: column; }
.quiz-live:fullscreen .quiz-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.quiz-live:fullscreen .quiz-stage[hidden] { display: none; }
.quiz-live-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; background: rgba(0,0,0,.25); flex-wrap: wrap; }
.quiz-stage { padding: 1.5rem; text-align: center; }
.quiz-join-box { display: inline-flex; align-items: center; gap: 1.5rem; background: #fff; color: #111827; border-radius: 1rem; padding: 1rem 1.5rem; text-align: left; flex-wrap: wrap; justify-content: center; }
.quiz-pin { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 900; letter-spacing: .06em; line-height: 1; }
.quiz-qr { width: 150px; height: 150px; } .quiz-qr svg { width: 100%; height: 100%; }
.quiz-count { font-size: 1.2rem; font-weight: 700; margin: 1.2rem 0 .6rem; }
.quiz-players { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; max-height: 40vh; overflow: auto; }
.quiz-player { background: rgba(255,255,255,.14); border-radius: .5rem; padding: .35rem .8rem; font-weight: 700; animation: quiz-pop .25s ease-out; }
.quiz-player[class*="quiz-team-"] { background: var(--tc); }
.quiz-waiting { opacity: .75; }
@keyframes quiz-pop { from { transform: scale(.6); } }
.quiz-qtext { font-size: clamp(1.3rem, 3.2vw, 2.4rem); font-weight: 800; background: #fff; color: #111827; border-radius: .75rem; padding: 1rem 1.25rem; margin: .5rem 0 1rem; }
.quiz-timer { display: inline-grid; place-items: center; min-width: 3.4rem; height: 3.4rem; border-radius: 50%; background: #7c3aed; font-size: 1.5rem; font-weight: 800; }
.quiz-timer:empty { visibility: hidden; }
.quiz-timer.is-low { background: #e21b3c; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.quiz-option { position: relative; display: flex; align-items: center; gap: .75rem; background: var(--qc); border-radius: .6rem; padding: 1rem 1.1rem; font-size: clamp(1rem, 2.2vw, 1.6rem); font-weight: 700; text-align: left; min-height: 4.5rem; overflow: hidden; }
.quiz-option .quiz-shape { font-size: 1.4em; }
.quiz-option-text { flex: 1; position: relative; z-index: 1; }
.quiz-option.is-wrong { opacity: .4; }
.quiz-tick { font-size: 1.6em; position: relative; z-index: 1; }
.quiz-dist { display: flex; align-items: center; gap: .4rem; width: 32%; position: relative; z-index: 1; }
.quiz-dist-bar { height: .7rem; background: rgba(255,255,255,.85); border-radius: 999px; min-width: 3px; }
.quiz-dist-n { font-weight: 800; }
.quiz-board { list-style: none; padding: 0; margin: 0 auto; text-align: left; max-width: 640px; }
.quiz-board li { display: flex; align-items: center; gap: .65rem; background: #fff; color: #111827; border-radius: .55rem; padding: .6rem .9rem; margin-bottom: .45rem; font-weight: 700; font-size: 1.15rem; animation: quiz-pop .3s ease-out; }
.quiz-board .quiz-rank { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-grid; place-items: center; background: #e5e7eb; font-size: .9rem; flex: 0 0 auto; }
.quiz-board .quiz-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-board .quiz-score { font-variant-numeric: tabular-nums; }
.quiz-podium li:nth-child(1) { background: #fde68a; font-size: 1.45rem; } .quiz-podium li:nth-child(1) .quiz-rank { background: #f59e0b; color: #fff; }
.quiz-podium li:nth-child(2) { background: #e5e7eb; } .quiz-podium li:nth-child(2) .quiz-rank { background: #9ca3af; color: #fff; }
.quiz-podium li:nth-child(3) { background: #fed7aa; } .quiz-podium li:nth-child(3) .quiz-rank { background: #c2410c; color: #fff; }
.quiz-team-dot { width: .9rem; height: .9rem; border-radius: 50%; background: var(--tc); flex: 0 0 auto; display: inline-block; }
@media (max-width: 575.98px) {
    .quiz-stage { padding: 1rem .75rem; }
    .quiz-options { grid-template-columns: 1fr; }
    .quiz-option { min-height: 3.2rem; padding: .7rem .8rem; }
    .quiz-join-box { padding: .8rem 1rem; gap: .8rem; }
    .quiz-qr { width: 120px; height: 120px; }
}

/* player page */
.quiz-play { background: linear-gradient(160deg, #1e1b4b, #4c1d95); min-height: calc(100vh - 64px); color: #fff; transition: background .3s; }
.quiz-play[class*="quiz-play-"] { background: linear-gradient(160deg, #1e1b4b, var(--tc)); }
.quiz-play-red { --tc: #b0152f; } .quiz-play-blue { --tc: #0f4fa0; } .quiz-play-green { --tc: #1d6b09; } .quiz-play-yellow { --tc: #9a6a00; }
.quiz-play .container { max-width: 560px; }
.quiz-card { background: #fff; color: #111827; border-radius: 1rem; padding: 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.quiz-card .text-body-secondary { color: #6b7280 !important; }
.quiz-card .form-control { background: #fff; color: #111827; border-color: #d1d5db; }
.quiz-pin-input { text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: .15em; }
.quiz-team-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quiz-team-btn { position: relative; margin: 0; cursor: pointer; }
.quiz-team-btn input { position: absolute; opacity: 0; }
.quiz-team-btn span { display: block; text-align: center; padding: .7rem; border-radius: .6rem; background: var(--tc); color: #fff; font-weight: 700; border: 3px solid transparent; opacity: .75; }
.quiz-team-btn input:checked + span { border-color: #111827; opacity: 1; box-shadow: 0 0 0 3px #fff inset; }
.quiz-team-btn input:focus-visible + span { outline: 3px solid #fbbf24; }
.quiz-me { display: flex; align-items: center; gap: .5rem; background: rgba(0,0,0,.25); border-radius: .6rem; padding: .5rem .85rem; margin-bottom: .75rem; font-weight: 700; }
.quiz-status { padding: 2rem 1.25rem; }
.quiz-status-icon { font-size: 3rem; display: block; margin-bottom: .4rem; }
.quiz-status-title { font-size: 1.5rem; font-weight: 800; }
.quiz-status-text { margin-top: .35rem; color: #4b5563; }
.quiz-status[class*="quiz-c"] { background: var(--qc); color: #fff; } .quiz-status[class*="quiz-c"] .quiz-status-text { color: rgba(255,255,255,.9); }
.quiz-status.quiz-right { background: #16a34a; color: #fff; } .quiz-status.quiz-wrong { background: #dc2626; color: #fff; }
.quiz-status.quiz-right .quiz-status-text, .quiz-status.quiz-wrong .quiz-status-text { color: rgba(255,255,255,.92); }
.quiz-status.quiz-final .quiz-status-icon { color: #f59e0b; }
.quiz-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.quiz-answer { border: 0; border-radius: .8rem; background: var(--qc); color: #fff; min-height: 30vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: .75rem; font-weight: 700; box-shadow: 0 5px 0 rgba(0,0,0,.25); transition: transform .08s; }
.quiz-answer:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.quiz-answer:disabled { opacity: .55; }
.quiz-answer .quiz-shape { font-size: 2.6rem; line-height: 1; }
.quiz-answer-text { font-size: .95rem; line-height: 1.2; word-break: break-word; }
.quiz-n2 .quiz-answer { min-height: 40vh; }
.quiz-board-sm li { font-size: .95rem; padding: .45rem .7rem; background: #f3f4f6; }
.quiz-board-sm li.is-me { background: #fde68a; }
.quiz-play > .container > p.text-body-secondary { color: rgba(255,255,255,.78) !important; }
.quiz-play > .container > p a, .quiz-play #pjLeave { color: #fde68a; }
/* Team Quiz: question generator and countdowns */
.quiz-gen { border: 1px dashed var(--line); border-radius: .75rem; padding: .85rem; background: var(--bs-tertiary-bg); }
.quiz-gen-head { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .6rem; }
.quiz-gen-head > .bi { font-size: 1.4rem; color: #7c3aed; line-height: 1.2; }
.quiz-gen-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.quiz-gen-cat { margin: 0; cursor: pointer; }
.quiz-gen-cat input { position: absolute; opacity: 0; }
.quiz-gen-cat span { display: inline-block; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bs-body-bg); font-size: .9rem; font-weight: 600; }
.quiz-gen-cat input:checked + span { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.quiz-gen-cat input:focus-visible + span { outline: 2px solid #fbbf24; outline-offset: 2px; }
.quiz-bar { height: .6rem; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; margin: -.4rem 0 1rem; }
.quiz-bar span { display: block; height: 100%; width: 100%; background: #22c55e; border-radius: inherit; transition: width .1s linear; }
.quiz-bar span.is-low { background: #e21b3c; }
.quiz-bar-sm { height: .4rem; margin: 0 0 .6rem; }
.quiz-ready { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1rem 0; }
.quiz-ready span { font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 800; }
.quiz-ready b { font-size: clamp(4rem, 12vw, 8rem); line-height: 1; font-weight: 900; animation: quiz-pop .3s ease-out; }
#lvQuestion.is-ready .quiz-options { display: none; }
.quiz-ptimer { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #7c3aed; font-weight: 800; }
.quiz-ptimer.is-low { background: #e21b3c; }
.quiz-ready-n { font-size: 4.5rem; font-weight: 900; line-height: 1.1; color: #7c3aed; }

/* Cookie consent banner */
.cookie-banner { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1080; max-width: 980px; margin: 0 auto;
    background: var(--surface, var(--bs-body-bg)); color: var(--bs-body-color); border: 1px solid var(--line, var(--bs-border-color));
    border-radius: 1rem; box-shadow: 0 12px 40px rgba(15, 23, 42, .25); padding: 1rem 1.15rem; }
.cookie-inner { display: flex; gap: 1rem; align-items: center; }
.cookie-text { flex: 1; min-width: 0; }
.cookie-text .bi-cookie { color: #d97706; }
.cookie-actions { display: flex; flex-direction: column; gap: .4rem; flex: 0 0 auto; min-width: 9.5rem; }
.cookie-options { margin-top: .6rem; display: grid; gap: .35rem; font-size: .88rem; }
.cookie-options .form-check { margin: 0; }
.site-footer .footer-linkbtn { font-size: inherit; color: var(--muted); text-decoration: none; vertical-align: baseline; border: 0; }
.site-footer .footer-linkbtn:hover { color: var(--brand); }
@media (max-width: 767.98px) {
    .cookie-banner { left: .5rem; right: .5rem; bottom: .5rem; padding: .85rem; max-height: 85vh; overflow: auto; }
    .cookie-inner { flex-direction: column; align-items: stretch; }
    .cookie-actions { flex-direction: row; flex-wrap: wrap; }
    .cookie-actions .btn { flex: 1 1 auto; }
}


/* Router login hub */
.router-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.router-quick-btn { font-family: var(--bs-font-monospace); font-size: .88rem; font-weight: 700; color: #1f2937; background: #fde68a;
    border-radius: .5rem; padding: .3rem .6rem; text-decoration: none; }
.router-quick-btn:hover { background: #fbbf24; color: #111827; }
.router-brands td { vertical-align: top; }
.router-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.router-card { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--line); border-radius: .75rem; padding: .7rem .85rem;
    text-decoration: none; color: inherit; background: var(--surface); }
.router-card:hover { border-color: var(--brand); }
.router-card .bi { font-size: 1.4rem; color: var(--brand); }
.router-card span { display: flex; flex-direction: column; }
.router-card small { color: var(--muted); font-size: .8rem; }

.page-updated { font-size: .82rem; color: var(--muted); margin: 1.5rem 0 0; }
.cookie-text > p { font-size: .82rem; }       /* kept small so the banner never becomes the page's largest paint */
/* secondary links under side cards: comfortable tap targets on phones */
.side-card > a.small { display: inline-block; padding: .3rem 0; min-height: 28px; }
button.router-quick-btn { border: 0; cursor: pointer; line-height: 1.5; }

/* Money menu: 23 calculators in two columns on desktop */
@media (min-width: 1200px) {
    .money-menu { columns: 2; column-gap: 0; min-width: 560px; }
    .money-menu > li { break-inside: avoid; }
    .money-menu .dropdown-header { padding-top: .6rem; font-weight: 700; color: var(--brand); }
}

/* Salary & money calculators: shared layout (fin-*) */
.fin-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; align-items: start; }
@media (max-width: 991.98px) { .fin-grid { grid-template-columns: minmax(0, 1fr); } }
.fin-form .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.fin-form .form-text { font-size: .8rem; }
.fin-form fieldset { border: 1px solid var(--line); border-radius: .75rem; padding: .75rem .9rem .25rem; margin-bottom: .9rem; }
.fin-form legend { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); float: none; width: auto; padding: 0 .35rem; margin: 0; }
@media (pointer: coarse) {   /* bigger checkboxes and radios on touch screens; the label stays tappable too */
  .fin-form .form-check:not(.form-switch) { min-height: 1.75rem; padding-left: 2rem; }
  .fin-form .form-check:not(.form-switch) .form-check-input { width: 1.5rem; height: 1.5rem; margin-left: -2rem; margin-top: 0; }
  .fin-form .form-switch { padding-left: 3.2rem; }
  .fin-form .form-switch .form-check-input { width: 2.6rem; height: 1.4rem; margin-left: -3.2rem; margin-top: 0; }
  .fin-form .form-check-label { padding-top: .1rem; }
}
.fin-form details > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: .4rem 0; }
.fin-sticky { position: sticky; top: calc(var(--header-h, 70px) + 8px); transition: top .2s; }
@media (max-width: 991.98px) { .fin-sticky { position: static; } }
.fin-hero-result { border-radius: var(--radius); padding: 1.1rem 1.25rem; color: #fff; background: linear-gradient(135deg, #1d4ed8, #7c3aed); }
.fin-hero-result .fin-big { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fin-hero-result .fin-sub { opacity: .9; font-size: .92rem; }
.fin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-top: .9rem; }
.fin-stat { border: 1px solid var(--line); border-radius: .75rem; padding: .6rem .75rem; background: var(--surface); }
.fin-stat small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.fin-stat b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.fin-table { width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
.fin-table th, .fin-table td { padding: .45rem .55rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; white-space: normal; }
.fin-table thead th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.fin-table tr.fin-total td { font-weight: 800; border-top: 2px solid var(--ink); }
.fin-table tr.fin-minus td:not(:first-child) { color: var(--bad); }
.fin-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); margin: .75rem 0 .35rem; }
.fin-bar > span { display: block; height: 100%; }
.fin-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .8rem; color: var(--muted); }
.fin-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.fin-c1 { background: #16a34a; } .fin-c2 { background: #1d4ed8; } .fin-c3 { background: #7c3aed; } .fin-c4 { background: #f59e0b; }
.fin-c5 { background: #e11d48; } .fin-c6 { background: #0891b2; } .fin-c7 { background: #64748b; }
.fin-note { font-size: .8rem; color: var(--muted); margin-top: .75rem; }
.fin-tabs .nav-link { font-weight: 600; }
.fin-schedule { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: .75rem; }
.fin-schedule thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* Site header: top row (brand, search, language, theme, menu) + category bar with mega panels (desktop),
   category chips + drawer (mobile). All categories come from context_processors._nav_sections(). */
.site-header { z-index: 1030; }
.site-header .site-nav { position: relative; }
.nav-top { display: flex; align-items: center; gap: .75rem; min-height: 58px; max-width: min(1680px, 100%); }
.nav-top .navbar-brand { margin: 0; flex: none; }
.nav-top .nav-search { flex: 1 1 auto; max-width: 560px; min-width: 0; margin: 0 auto; height: 40px; padding: .3rem .85rem; }
.nav-top .nav-search i { color: var(--muted); }
.nav-top .nav-utils { flex: none; }
.nav-menu-btn { font-size: 1.15rem; line-height: 1; padding: .3rem .55rem; }
.nav-cats { border-top: 1px solid var(--line); }
.nav-cats .container { max-width: min(1680px, 100%); position: relative; }
.nav-cats-list { display: flex; gap: .2rem; list-style: none; margin: 0; padding: .35rem 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.nav-cats-list::-webkit-scrollbar { display: none; }
.nav-cat { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .38rem .7rem; border-radius: 999px; border: 1px solid transparent;
           background: none; color: var(--muted); font-size: .9rem; font-weight: 550; text-decoration: none; line-height: 1.2; cursor: pointer; }
.nav-cat i { font-size: .95rem; color: var(--brand); opacity: .85; }
.nav-cat:hover, .nav-cat[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.nav-cat.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.nav-cat:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-cat-all { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.nav-cat-all i { color: var(--brand-2, var(--brand)); }
.nav-cats-list > li.nav-hide { display: none; }
.nav-cat-more { font-family: inherit; }
.nav-cat-more i { font-size: .72rem; transition: transform .15s ease; }
.nav-cat-more[aria-expanded="true"] i { transform: rotate(180deg); }
/* fade hints when the bar scrolls sideways */
.nav-cats.fade-l .container::before, .nav-cats.fade-r .container::after { content: ""; position: absolute; top: 0; bottom: 0; width: 36px; pointer-events: none; z-index: 1; }
.nav-cats.fade-l .container::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.nav-cats.fade-r .container::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.mega-panels { position: absolute; left: 0; right: 0; top: 100%; }
.mega-panel { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .35);
              max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; padding: 1rem 0 1.25rem; animation: mpIn .14s ease-out; }
.mega-panel .container { max-width: min(1680px, 100%); }
@keyframes mpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mega-panel { animation: none; } .nav-cats-list { scroll-behavior: auto; } }
.mp-head { display: flex; align-items: center; gap: .85rem; padding: 0 .25rem .9rem; margin-bottom: .75rem; border-bottom: 1px solid var(--line); }
.mp-head > i { font-size: 1.35rem; color: var(--brand); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, transparent); flex: none; }
.mp-head > div { flex: 1; min-width: 0; }
.mp-head strong { display: block; font-size: 1.05rem; color: var(--ink); }
.mp-head span { color: var(--muted); font-size: .9rem; }
.mp-head .btn { flex: none; border-radius: 999px; }
.mp-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem 1.25rem; }
.mp-group.is-wide { grid-column: span 2; }
.mp-group.is-wide .mp-links { columns: 2; column-gap: 1.25rem; }
.mp-group .mega-heading { padding: .2rem .55rem .35rem; }
.mp-links a { display: flex; align-items: center; gap: .55rem; padding: .36rem .55rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; break-inside: avoid; }
.mp-links a i { color: var(--brand); width: 1.1rem; text-align: center; flex: none; }
.mp-links a:hover, .mp-links a:focus-visible { background: var(--surface-2); color: var(--brand); }
.mp-links a[aria-current="page"] { font-weight: 650; color: var(--brand); }
.mp-all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .6rem; }
.mp-cat-card { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; background: var(--surface); }
.mp-cat-card:hover, .mp-cat-card:focus-visible { border-color: var(--brand); box-shadow: 0 6px 18px -10px rgba(29, 78, 216, .45); }
.mp-cat-card > i { font-size: 1.2rem; color: var(--brand); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, transparent); flex: none; }
.mp-cat-card > span { flex: 1; min-width: 0; }
.mp-cat-card strong { display: block; font-size: .95rem; }
.mp-cat-card small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.mp-cat-card em { font-style: normal; font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .1rem .5rem; flex: none; }
/* Drawer (mobile and tablet) */
.nav-drawer { width: min(400px, 92vw) !important; background: var(--surface); }
.nav-drawer .offcanvas-body { padding-top: 0; }
.drawer-hub { display: flex; align-items: center; gap: .6rem; padding: .7rem .25rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.drawer-hub i { color: var(--brand); }
.nav-drawer details { border-bottom: 1px solid var(--line); }
.nav-drawer summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .75rem .25rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.nav-drawer summary::-webkit-details-marker { display: none; }
.nav-drawer summary i.bi:first-child { color: var(--brand); }
.nav-drawer summary small { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .75rem; background: var(--surface-2); border-radius: 999px; padding: .05rem .5rem; }
.nav-drawer summary::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.nav-drawer details[open] summary::after { transform: rotate(180deg); }
.nav-drawer .drawer-group { padding: 0 0 .6rem 1.9rem; }
.nav-drawer .drawer-group .mega-heading { padding: .4rem 0 .2rem; }
.nav-drawer .drawer-group a { display: block; padding: .38rem 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav-drawer .drawer-group a:hover { color: var(--brand); }
.nav-drawer .drawer-all { display: inline-block; margin: .2rem 0 .4rem 1.9rem; font-weight: 600; font-size: .9rem; }
@media (min-width: 992px) {
    .nav-menu-btn { display: none; }
}
@media (max-width: 991.98px) {
    .nav-cat-all { display: none; }
    .mega-panels { display: none; }
    .nav-top .nav-search { max-width: none; }
    .nav-top .nav-search span { font-size: .9rem; }
    .nav-top .nav-search kbd { display: none; }
    .nav-cats-list { padding: .4rem 0; }
    .nav-cat { font-size: .85rem; padding: .32rem .65rem; border-color: var(--line); }
}
@media (max-width: 575.98px) {
    .nav-top { gap: .45rem; min-height: 54px; }
    .nav-top .navbar-brand span { display: none; }
    .nav-top .nav-search { height: 38px; padding: .25rem .7rem; }
    .nav-top .nav-utils { gap: .3rem !important; }
    .nav-top #themeToggle { display: none; }
}
@media (max-width: 359.98px) { .nav-top .nav-utils .bi-translate { display: none; } }
@media print { .site-header, .nav-drawer { display: none !important; } }
html { scroll-padding-top: calc(var(--header-h, 70px) + 8px); }
.site-header .nav-cats { transition: margin-top .2s ease; }
.site-header.cats-hidden .nav-cats { margin-top: calc(-1 * var(--cats-h, 46px)); visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .site-header .nav-cats { transition: none; } }
@media (min-width: 992px) and (max-width: 1679.98px) {
    .nav-cats-list { gap: 0; }
    .nav-cat { padding: .36rem .5rem; font-size: .86rem; gap: .32rem; }
}
@media (min-width: 992px) and (max-width: 1299.98px) { .nav-cat i { display: none; } .nav-cat-all i, .nav-cat-more i { display: inline; } }

/* Page actions: favourite (tools), like and share — shown in the hero of tool, hub and guide pages */
.page-actions { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.page-actions .dropdown { display: inline-block; }
.like-btn.on { background: #ffe4e6; border-color: #ffe4e6; color: #881337; }
.like-btn.on i { color: #e11d48; }
.like-btn .like-count { margin-left: .1rem; font-variant-numeric: tabular-nums; }
.like-btn.pop i { animation: likePop .35s ease-out; }
@keyframes likePop { 40% { transform: scale(1.35); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .like-btn.pop i { animation: none; } }
.share-menu { min-width: 13rem; }
.share-menu .dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .45rem .9rem; }
.share-menu .bi-whatsapp { color: #25d366; } .share-menu .bi-telegram { color: #229ed9; } .share-menu .bi-facebook { color: #1877f2; }
.share-menu .bi-linkedin { color: #0a66c2; } .share-menu .bi-reddit { color: #ff4500; } .share-menu .bi-link-45deg, .share-menu .bi-envelope { color: var(--brand); }
.article-hero .page-actions, .page-hero .page-actions { margin-top: .2rem; }


/* Unit converters (cm to inches, kg to lbs, Celsius to Fahrenheit): two-way fields that update as you type */
.uc-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.uc-bar .form-select { width: auto; min-height: 36px; }
.uc-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .6rem; align-items: end; }
.uc-pair.uc-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.uc-arrow { display: grid; place-items: center; min-height: 52px; color: var(--muted); font-size: 1.25rem; }
.uc-field .form-label, .uc-sub .form-label { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.uc-field .form-control { font-size: 1.35rem; font-weight: 650; min-height: 52px; font-variant-numeric: tabular-nums; }
.uc-sub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: .85rem; max-width: 26rem; }
.uc-sub .form-control { font-size: 1rem; min-height: 44px; font-variant-numeric: tabular-nums; }
.uc-out { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; padding: .7rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); }
.uc-out output { flex: 1 1 auto; min-width: 0; font-size: 1.1rem; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-word; }
.uc-out output.uc-err { color: var(--bad); font-size: .95rem; }
.uc-out .btn { flex: none; }
.uc-notes { margin: .6rem 0 0; font-size: .88rem; color: var(--muted); }
.uc-notes div + div { margin-top: .15rem; }
.uc-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.uc-quick .btn { min-height: 36px; }
.uc-hint { font-size: .86rem; color: var(--muted); margin: .9rem 0 0; }
.prose .uc-chart td, .prose .uc-chart th { font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .uc-pair.uc-three { grid-template-columns: 1fr; }
    .uc-field .form-control { font-size: 1.2rem; }
}

/* Body calculators (BMI, calorie/TDEE): unit switch, form + result, BMI scale */
.bc-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; align-items: start; }
.bc-form .form-label { font-size: .85rem; font-weight: 600; margin-bottom: .2rem; }
.bc-form .form-control, .bc-form .form-select { font-size: 1rem; min-height: 44px; font-variant-numeric: tabular-nums; }
.bc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.bc-row.bc-one { grid-template-columns: 1fr; }
.bc-unit { position: relative; }
.bc-unit .form-control { padding-right: 2.6rem; }
.bc-unit > span { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.bc-units .btn { min-height: 36px; }
.bc-seg .btn { min-height: 44px; }
.bc-check { font-size: .9rem; padding-left: 2.1rem; min-height: 1.5rem; }
.bc-check .form-check-input { width: 1.5rem; height: 1.5rem; margin-left: -2.1rem; margin-top: 0; }
.bc-help { font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.bc-empty { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; }
.bc-error { border-radius: var(--radius); padding: .85rem 1rem; border: 1px solid var(--bad); color: var(--bad); background: var(--surface-2); display: flex; gap: .6rem; align-items: flex-start; }
.bc-head { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #fff; border-radius: var(--radius); padding: 1rem 1.15rem; }
.bc-head .bc-kicker { font-size: .85rem; opacity: .9; margin: 0 0 .15rem; }
.bc-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; margin: 0; }
.bc-big b { font-size: clamp(2.2rem, 8vw, 3rem); font-weight: 750; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bc-big small { font-size: 1rem; opacity: .92; }
.bc-badge { display: inline-block; font-size: .9rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; background: #fff; color: #0f172a; }
.bc-badge[data-cat="under"] { background: #e0f2fe; color: #075985; }
.bc-badge[data-cat="healthy"] { background: #dcfce7; color: #14532d; }
.bc-badge[data-cat="over"] { background: #fef3c7; color: #78350f; }
.bc-badge[data-cat="obese"] { background: #fee2e2; color: #7f1d1d; }
.bc-badge[data-cat="none"] { background: #e2e8f0; color: #0f172a; }
.bc-sub { margin: .45rem 0 0; font-size: .92rem; opacity: .95; }
.bc-scale { margin-top: 1rem; }
.bc-bar { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: hidden; }
.bc-bar > span { display: block; height: 100%; }
.bc-bar .s-under { background: #38bdf8; } .bc-bar .s-healthy { background: #22c55e; } .bc-bar .s-over { background: #f59e0b; }
.bc-bar .s-ob1 { background: #f87171; } .bc-bar .s-ob2 { background: #ef4444; } .bc-bar .s-ob3 { background: #b91c1c; }
.bc-marker { position: relative; height: 18px; margin-top: -16px; }
.bc-marker i { position: absolute; top: 0; width: 4px; height: 18px; margin-left: -2px; background: var(--ink); border: 1px solid var(--surface); border-radius: 2px; }
.bc-ticks { position: relative; height: 1.2rem; margin-top: .3rem; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bc-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bc-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .35rem; font-size: .8rem; color: var(--muted); }
.bc-legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; background: var(--c); }
.bc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .9rem; }
.bc-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; min-width: 0; }
.bc-tile.bc-wide { grid-column: 1 / -1; }
.bc-tile .bc-label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.bc-tile .bc-val { display: block; font-size: 1.2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-word; }
.bc-tile .bc-small { display: block; font-size: .85rem; color: var(--muted); }
.bc-note { margin: .85rem 0 0; font-size: .9rem; color: var(--muted); }
.bc-note i { color: var(--warn); }
.bc-work { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); word-break: break-word; }
.bc-work code { font-family: var(--mono); color: var(--ink); background: transparent; padding: 0; }
.bc-table { margin-top: .9rem; }
.bc-table .table { margin: 0; font-variant-numeric: tabular-nums; }
.bc-table .table td, .bc-table .table th { vertical-align: middle; }
.bc-table tr.bc-current td { font-weight: 700; background: var(--brand-soft); }
.bc-table td.bc-na { color: var(--muted); font-weight: 500; font-size: .88rem; }
.bc-table td + td { white-space: nowrap; }
.bc-seg .btn { flex: 1 1 0; min-width: 0; }
@media (max-width: 767.98px) {
    .bc-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .bc-tile .bc-val { font-size: 1.05rem; }
}

/* Flip a coin: 3D coin, multi-coin grid, tally and history */
.cf .rc-head h2, .cf-tally .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.cf-yn { font-size: .92rem; min-height: 1.6rem; display: flex; align-items: center; gap: .1rem; }
.cf-yn.form-switch { padding-left: 3.3rem; }
.cf-yn .form-check-input { width: 2.75rem; height: 1.5rem; margin-top: 0; margin-left: -3.3rem; cursor: pointer; }
.cf-yn .form-check-label { cursor: pointer; padding-left: .3rem; }
.cf-stage { display: flex; justify-content: center; align-items: center; min-height: 15.5rem; padding: .6rem 0 .2rem; }
.cf-single { display: flex; flex-direction: column; align-items: center; perspective: 900px; }
.cf-toss { width: clamp(9rem, 40vw, 13rem); aspect-ratio: 1; }
.cf-coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(0deg);
    transition: transform 1s cubic-bezier(.22, .68, .3, 1); }
.cf-coin.cf-instant { transition: none; }
.cf-face { position: absolute; inset: 0; border-radius: 50%; -webkit-backface-visibility: hidden; backface-visibility: hidden;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(15, 23, 42, .28); }
.cf-face svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cf-face-t { transform: rotateX(180deg); }
.cf-word { position: relative; z-index: 1; margin-top: 50%; width: 66%; text-align: center; line-height: 1.05; white-space: nowrap; overflow: hidden;
    font-weight: 800; font-size: clamp(.95rem, 4.2vw, 1.2rem); letter-spacing: .06em; text-transform: uppercase; }
.cf-face-h .cf-word { color: #5e3f02; }
.cf-face-t .cf-word { color: #2b3443; }
.cf-shadow { width: 58%; height: 12px; margin-top: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(15, 23, 42, .28), transparent); }
[data-bs-theme="dark"] .cf-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, .65), transparent); }
[data-bs-theme="dark"] .cf-face { box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
.cf-toss.cf-go { animation: cfToss 1s cubic-bezier(.3, .6, .4, 1); }
.cf-go + .cf-shadow, .cf-toss.cf-go ~ .cf-shadow { animation: cfShadow 1s ease-in-out; }
@keyframes cfToss { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-46px) scale(1.12); } 80% { transform: translateY(0) scale(1); } 90% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
@keyframes cfShadow { 0%, 100% { transform: scale(1); opacity: 1; } 45% { transform: scale(.65); opacity: .5; } }
.cf-single.cf-fade { animation: cfFade .25s ease-out; }
@keyframes cfFade { from { opacity: .35; } to { opacity: 1; } }

.cf-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, 2.8rem); justify-content: center; gap: .45rem; width: 100%; max-width: 40rem; }
.cf-grid.cf-grid-many { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .3rem; max-width: 26rem; }
.cf-grid.cf-grid-few { grid-template-columns: repeat(auto-fill, 3.6rem); gap: .6rem; }
.cf-grid-few .cf-chip { font-size: 1.35rem; border-width: 3px; }
.cf-chip { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 50%; font-weight: 800; font-size: 1rem; line-height: 1; border: 2px solid; min-width: 0; }
.cf-grid-many .cf-chip { font-size: .85rem; }
.cf-chip-h { background: #f6cf4a; border-color: #b9850f; color: #4a3200; }
.cf-chip-t { background: #d5dce6; border-color: #7d8898; color: #1f2937; }
[data-bs-theme="dark"] .cf-chip-h { background: #e3b52a; border-color: #ffe08a; color: #2e1f00; }
[data-bs-theme="dark"] .cf-chip-t { background: #b9c3d1; border-color: #eef2f7; color: #111827; }
.cf-chip.cf-pop { animation: cfPop .22s ease-out both; }
@keyframes cfPop { from { transform: scale(.4) rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.cf-result { text-align: center; margin: .3rem 0 .2rem; min-height: 4.6rem; }
.cf-main { font-size: clamp(1.6rem, 7vw, 2.3rem); font-weight: 800; margin: 0; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.cf-main.cf-h { color: #a06d00; }
.cf-main.cf-t { color: #475569; }
[data-bs-theme="dark"] .cf-main.cf-h { color: #f6cf4a; }
[data-bs-theme="dark"] .cf-main.cf-t { color: #cbd5e1; }
.cf-sub { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; min-height: 1.4rem; }

.cf-controls { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-top: .6rem; }
.cf-count { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; }
.cf-count-label { font-size: .9rem; color: var(--muted); font-weight: 600; margin-right: .15rem; }
.cf-count .btn { min-width: 2.9rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.cf-count .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.cf-custom .form-control { width: 5.5rem; min-height: 44px; font-size: 1rem; text-align: center; }
.cf-flip { min-width: min(16rem, 100%); min-height: 54px; font-size: 1.25rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.cf.is-flipping .cf-flip { opacity: .85; }
.cf-keys { font-size: .85rem; color: var(--muted); margin: 0; text-align: center; }
.cf-err { color: var(--bad); font-size: .92rem; text-align: center; }

.cf-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.cf-bar span { display: block; height: 100%; width: 50%; transition: width .3s ease; }
.cf-bar-h { background: #e9b824; }
.cf-bar-t { background: #94a3b8; }
@media (prefers-reduced-motion: reduce) { .cf-bar span { transition: none; } }
.cf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: .9rem 0 0; }
.cf-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); padding: .6rem .75rem; min-width: 0; }
.cf-stat dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.cf-stat dd { margin: .1rem 0 0; color: var(--ink); overflow-wrap: anywhere; }
.cf-stat dd b { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.cf-stat dd small { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.cf-stat-h { border-left: 4px solid #e9b824; }
.cf-stat-t { border-left: 4px solid #94a3b8; }
.cf-hist-title { font-size: .95rem; font-weight: 650; margin: 1.1rem 0 .5rem; }
.cf-hist { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.cf-hist .cf-chip { width: 1.9rem; height: 1.9rem; font-size: .8rem; border-width: 1.5px; }
.cf-hist .cf-chip:first-child { outline: 2px solid var(--brand); outline-offset: 2px; }
.cf-empty { color: var(--muted); font-size: .92rem; margin: .2rem 0 0; }
@media (max-width: 575.98px) {
    .cf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cf-stage { min-height: 11.5rem; padding-top: .2rem; }
    .cf-result { min-height: 4.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cf-coin { transition: none; }
    .cf-toss.cf-go, .cf-toss.cf-go ~ .cf-shadow, .cf-chip.cf-pop { animation: none; }
}

/* Barcode generator: type chips, input with validation messages, live SVG preview, check digit working, options */
.bcg-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "calc" "opts"; gap: 1.25rem; }
.bcg-main { grid-area: main; min-width: 0; }
.bcg-side-col { grid-area: side; min-width: 0; }
.bcg-calc { grid-area: calc; min-width: 0; }
.bcg-opts { grid-area: opts; min-width: 0; border-top: 1px solid var(--line); padding-top: 1rem; }
@media (min-width: 992px) {
    .bcg-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "main side" "calc side" "opts side"; column-gap: 2rem; align-items: start; }
    .bcg-side-col { align-self: stretch; }
    .bcg-side { position: sticky; top: 1rem; }
}
.bcg-types { display: flex; flex-wrap: wrap; gap: .4rem; }
.bcg-types label { max-width: 100%; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: .4rem .85rem;
    font-size: .92rem; min-height: 40px; display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.bcg-types label:hover { border-color: var(--brand); }
.bcg-types .btn-check:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-bs-theme="dark"] .bcg-types .btn-check:checked + label { color: #0b1220; }
.bcg-types .btn-check:focus-visible + label { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.bcg-input { font-size: 1.15rem; min-height: 48px; font-family: var(--mono); }
.bcg-extra { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; margin-top: .5rem; }
.bcg-extra .form-check { margin: 0; min-height: 1.75rem; display: flex; align-items: center; gap: .45rem; padding-left: 0; }
.bcg-extra .form-check[hidden] { display: none; }
.bcg-extra .form-check-input { margin: 0; width: 1.5rem; height: 1.5rem; flex: none; float: none; }
.bcg-msg { margin-top: .6rem; }
.bcg-msg:empty { margin: 0; }
.bcg-line { margin: 0 0 .3rem; font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }
.bcg-err { color: var(--bad); font-weight: 600; }
.bcg-ok { color: var(--ok); }
.bcg-warn { color: var(--warn); }
.bcg-warn a { color: inherit; text-decoration: underline; font-weight: 600; }
.bcg-fix { margin: .15rem 0 .45rem; min-height: 36px; font-family: var(--mono); white-space: normal; overflow-wrap: anywhere; }
.bcg-examples { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .7rem; }
.bcg-elabel { font-size: .85rem; color: var(--muted); }
.bcg-ex { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.bcg-ex .btn { min-height: 36px; font-family: var(--mono); font-size: .85rem; }
.bcg-encoded { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin-top: 1rem; padding: .65rem .85rem;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); }
.bcg-encoded[hidden] { display: none; }
.bcg-code { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; letter-spacing: .02em; }
.bcg-encoded .btn { flex: 0 1 auto; max-width: 100%; min-height: 36px; white-space: normal; overflow-wrap: anywhere; }
.bcg-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 180px;
    display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bcg-preview svg { display: block; max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.bcg-preview svg[hidden], .bcg-empty[hidden] { display: none; }
.bcg-empty { text-align: center; color: var(--muted); font-size: .92rem; padding: .5rem; }
.bcg-empty i { font-size: 3rem; display: block; opacity: .35; margin-bottom: .3rem; }
.bcg-size { text-align: center; font-size: .85rem; color: var(--muted); min-height: 1.3em; margin: .55rem 0; font-variant-numeric: tabular-nums; }
.bcg-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.bcg-actions .btn { min-height: 44px; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.bcg-actions .bcg-wide { grid-column: 1 / -1; }
.bcg-gs1 { font-size: .84rem; color: var(--muted); margin: .9rem 0 0; padding: .65rem .8rem; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.bcg-gs1 i { color: var(--brand); }
.bcg-calc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.bcg-calc[hidden] { display: none; }
.bcg-calc h3, .bcg-opts h3 { font-size: .95rem; font-weight: 650; margin-bottom: .6rem; }
.bcg-calc-intro { font-size: .88rem; color: var(--muted); margin: 0 0 .6rem; overflow-wrap: anywhere; }
.bcg-calc-table { overflow-x: auto; }
.bcg-ctable { border-collapse: collapse; font-family: var(--mono); font-size: .85rem; font-variant-numeric: tabular-nums; }
.bcg-ctable th { font-family: system-ui, sans-serif; font-weight: 600; font-size: .78rem; color: var(--muted); text-align: left; padding: .2rem .5rem .2rem 0; white-space: nowrap; }
.bcg-ctable td { text-align: center; min-width: 1.6rem; padding: .2rem .15rem; border-left: 1px solid var(--line); color: var(--ink); }
.bcg-ctable tr:first-child td { font-weight: 700; }
.bcg-ctable td.bcg-w3 { color: var(--brand); font-weight: 700; }
.bcg-calc-sum { margin: .6rem 0 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; overflow-wrap: anywhere; }
.bcg-formula { font-weight: 700; color: var(--ink); }
.bcg-opts .form-control, .bcg-opts .form-select { font-size: 1rem; min-height: 44px; }
.bcg-color { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.bcg-color input[type="color"] { width: 3rem; min-width: 3rem; height: 44px; padding: .2rem; }
.bcg-hex { font-family: var(--mono); font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.bcg-check { min-height: 44px; display: flex; align-items: center; gap: .45rem; padding-left: 0; margin: 0; }
.bcg-check .form-check-input { margin: 0; width: 1.5rem; height: 1.5rem; float: none; flex: none; }
.bcg-warns { margin-top: .8rem; }
.bcg-warns:empty { display: none; }
@media (max-width: 575.98px) {
    .bcg-preview { padding: .6rem; min-height: 150px; }
    .bcg-code { font-size: 1.05rem; }
    .bcg-calc { padding: .75rem .7rem; }
    .bcg-ctable { font-size: .8rem; }
    .bcg-ctable th { font-size: .7rem; padding-right: .3rem; }
    .bcg-ctable td { min-width: 1.15rem; padding: .2rem .05rem; }
    .bcg-actions .btn { padding-left: .4rem; padding-right: .4rem; font-size: .95rem; }
}

/* Print only the barcode after pressing Print (the area is added to <body> by the script) */
#bcgPrintArea { display: none; }
@media print {
    html.bcg-printing body > *:not(#bcgPrintArea) { display: none !important; }
    html.bcg-printing #bcgPrintArea { display: block !important; padding: 0; margin: 0; }
    html.bcg-printing #bcgPrintArea svg { display: block; max-width: none; }
}

/* Roman numerals converter: two-way fields (uses .uc-pair/.uc-field/.uc-quick), validation message, breakdown chips,
   vinculum overline, date in Roman numerals, charts */
.rn-roman { text-transform: uppercase; letter-spacing: .04em; }
#rnApp .uc-field .form-control::placeholder { color: var(--muted); opacity: .7; font-weight: 400; font-size: 1rem; letter-spacing: 0; text-transform: none; }
.rn-out { margin-top: 1rem; padding: .75rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); }
.rn-res { display: flex; align-items: center; gap: .6rem; min-height: 2rem; }
.rn-res output { flex: 1 1 auto; min-width: 0; font-size: 1.2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; }
.rn-res output.rn-muted { color: var(--muted); font-weight: 500; font-size: 1rem; letter-spacing: 0; }
.rn-res output.rn-err { color: var(--bad); font-weight: 600; font-size: .95rem; letter-spacing: 0; }
.rn-res .btn { flex: none; min-width: 40px; min-height: 36px; }
.rn-over { text-decoration: overline; text-decoration-thickness: 2px; }
.rn-msg { display: flex; gap: .55rem; align-items: flex-start; margin-top: .1rem; color: var(--bad); font-size: .95rem; font-weight: 600; }
.rn-res:has(output:empty) { display: none; }
.rn-msg > i { flex: none; margin-top: .1rem; }
.rn-msg .rn-fix { padding: 0 .1rem; vertical-align: baseline; font-size: .95rem; font-weight: 700; min-height: 0; text-align: left; overflow-wrap: anywhere; white-space: normal; }
.rn-note { margin: .45rem 0 0; font-size: .88rem; color: var(--muted); }
.rn-note:empty { display: none; }
.rn-steps { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.rn-steps-title { margin: 0 0 .35rem; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rn-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.rn-chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 2.6rem; padding: .25rem .55rem; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--line); line-height: 1.15; }
.rn-chip b { font-size: 1rem; color: var(--ink); letter-spacing: .03em; }
.rn-chip small { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rn-op { color: var(--muted); font-weight: 600; }
.rn-total { font-weight: 750; font-size: 1.05rem; color: var(--brand); letter-spacing: .03em; overflow-wrap: anywhere; min-width: 0; }

.rn-date-form { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: .85rem 1rem; align-items: end; }
.rn-date-form .form-label { font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
.rn-date-form .form-control, .rn-date-form .form-select { font-size: 1rem; min-height: 44px; }
.rn-date-row { display: flex; gap: .5rem; }
.rn-date-row .form-control { flex: 1 1 auto; min-width: 0; }
.rn-date-row .btn { min-height: 44px; flex: none; }
.rn-sep { flex-wrap: wrap; }
.rn-sep .btn { min-width: 44px; min-height: 44px; font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; }
.rn-sep label[for="rnSepSpace"] { font-size: .9rem; font-weight: 600; }
#rnDateOut { font-size: 1.35rem; letter-spacing: .05em; }

.prose .rn-chart, .prose .rn-pairs, .prose .rn-sym { font-variant-numeric: tabular-nums; }
.prose .rn-chart td { white-space: nowrap; }
.prose .rn-chart .rn-n { display: inline-block; min-width: 2.2em; color: var(--muted); font-weight: 600; }
.prose .rn-r { font-family: var(--mono); font-size: .95em; letter-spacing: .03em; }
.prose .rn-sym th, .prose .rn-sym td { text-align: center; }
.prose .rn-sym th[scope="row"] { text-align: left; }

@media (max-width: 767.98px) {
    .rn-date-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rn-sep-wrap { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .rn-date-form { grid-template-columns: minmax(0, 1fr); }
    .rn-res output { font-size: 1.1rem; }
    .prose .rn-chart { font-size: .86rem; }
    .prose .rn-chart th, .prose .rn-chart td { padding-left: .25rem; padding-right: .25rem; }
    .prose .rn-chart th { white-space: nowrap; font-size: .8rem; }
    .prose .rn-chart .rn-n { min-width: 1.6em; }
    .prose .rn-chart .rn-r { font-family: inherit; font-size: 1em; letter-spacing: .01em; }
}
/* long translations: wrap labels and buttons; Today drops below a narrow date field */
#rnApp .uc-field .form-label, .rn-date-form .form-label, .rn-sep .btn { overflow-wrap: anywhere; }
.rn-date-row { flex-wrap: wrap; }
.rn-date-row .form-control { flex: 1 1 9.5rem; }
.rn-date-row .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Metronome: beat lights, big BPM, tempo controls, settings */
.mt .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.mt-status { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .6rem; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.mt.is-running .mt-status { color: var(--ok); border-color: var(--ok); }

.mt-visual { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: .2rem 0 .9rem; min-height: 4.4rem; justify-content: center; }
.mt-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; max-width: 100%; }
.mt-dot { width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--line); background: var(--surface-2); color: var(--muted);
    font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; padding: 0; position: relative;
    transition: background-color .06s linear, transform .08s ease-out, border-color .06s linear; font-variant-numeric: tabular-nums; }
.mt-dots-many .mt-dot { width: 2.5rem; height: 2.5rem; font-size: .9rem; }
.mt-dot:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.mt-dot[data-level="2"] { border-color: var(--brand); color: var(--brand); border-width: 3px; }
.mt-dot[data-level="0"] { border-style: dashed; opacity: .55; }
.mt-dot[data-level="0"]::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2px; background: currentColor; transform: rotate(-45deg); }
.mt-dot.is-on { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.12); }
.mt-dot.mt-first.is-on { background: var(--brand-2); border-color: var(--brand-2); }
[data-bs-theme="dark"] .mt-dot.is-on { color: #0b1220; }
.mt-subs { display: flex; gap: .4rem; }
.mt-pip { width: .7rem; height: .7rem; border-radius: 50%; background: var(--line); }
.mt-pip.is-on { background: var(--brand); }

.mt-tempo { display: flex; align-items: center; justify-content: center; gap: .8rem; }
.mt-step { width: 3.25rem; height: 3.25rem; border-radius: 50%; font-size: 1.35rem; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
    touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.mt-bpm-box { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.mt-bpm { width: 4.2ch; font-size: clamp(3.2rem, 15vw, 4.8rem); font-weight: 800; line-height: 1; text-align: center; border: 0; border-bottom: 2px dashed transparent;
    background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; padding: 0; letter-spacing: -.03em; -moz-appearance: textfield; appearance: textfield; }
.mt-bpm::-webkit-outer-spin-button, .mt-bpm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mt-bpm:hover { border-bottom-color: var(--line); }
.mt-bpm:focus { outline: none; border-bottom-color: var(--brand); }
.mt-bpm:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 8px; }
.mt-bpm-unit { font-size: .8rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin-top: .1rem; }
.mt-tempo-name { font-size: 1.05rem; font-weight: 650; color: var(--brand); font-style: italic; }
.mt-slider { display: block; width: 100%; max-width: 34rem; margin: .9rem auto .3rem; height: 1.6rem; }
.mt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: .4rem 0 0; }
.mt-chips .btn { min-width: 3.2rem; min-height: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }

.mt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1.1rem 0 .3rem; }
.mt-actions .btn { min-height: 54px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding-left: 1.4rem; padding-right: 1.4rem; }
.mt-start { min-width: min(12rem, 100%); font-size: 1.25rem; }
.mt-tap { min-width: min(10rem, 100%); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.mt-tap.mt-tapped { animation: mtTap .15s ease-out; }
@keyframes mtTap { from { transform: scale(.95); } to { transform: none; } }
.mt-tap-out { text-align: center; color: var(--muted); font-size: .9rem; margin: .2rem 0 0; min-height: 1.4rem; }
.mt-err { color: var(--bad); text-align: center; font-size: .92rem; margin-top: .4rem; }

.mt-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.mt-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.mt-group fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.mt-settings legend { font-size: .9rem; font-weight: 650; margin-bottom: .45rem; float: none; width: auto; padding: 0; }
.mt-seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.mt-seg .btn { min-width: 3rem; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.mt-custom { display: grid; grid-template-columns: repeat(2, minmax(0, 8rem)); gap: .6rem; margin-top: .7rem; }
.mt-custom .form-label, .mt-row .form-label { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.mt-custom .form-select, .mt-row .form-select { font-size: 1rem; min-height: 42px; }
.mt-pulse { margin-top: .7rem; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); }
.mt-pulse-label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
.mt-pulse .form-check { font-size: .92rem; margin-bottom: .15rem; min-height: 1.6rem; }
.mt-note { font-size: .86rem; color: var(--muted); margin: .55rem 0 .2rem; }
.mt-switch { margin-top: .5rem; font-size: .95rem; }
.mt-switch { display: flex; align-items: center; }
.mt-switch.form-switch { padding-left: 3.3rem; }
.mt-switch .form-check-input { width: 2.75rem; height: 1.5rem; margin-top: 0; margin-left: -3.3rem; cursor: pointer; }
.mt-pulse .form-check { padding-left: 1.9rem; }
.mt-pulse .form-check-input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; margin-left: -1.9rem; }
.mt-switch .form-check-label { padding-left: .3rem; cursor: pointer; }
.mt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; margin-top: 1rem; align-items: end; }
.mt-vol .form-range { height: 42px; }
.mt-vol output { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: .25rem; }
.mt-keys { text-align: center; font-size: .85rem; color: var(--muted); margin: 1.1rem 0 0; }

@media (max-width: 767.98px) {
    .mt-settings { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .mt-dot { width: 2.6rem; height: 2.6rem; }
    .mt-dots-many .mt-dot { width: 2.2rem; height: 2.2rem; font-size: .82rem; }
    .mt-tempo { gap: .5rem; }
    .mt-actions .btn { flex: 1 1 0; min-width: 0; padding-left: .6rem; padding-right: .6rem; }
    .mt-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .mt-dot { transition: none; }
    .mt-dot.is-on { transform: none; }
    .mt-tap.mt-tapped { animation: none; }
}

/* Date calculator: mode switch, date fields with Today buttons, amounts, holidays, result head and tiles */
.dc-modes { display: flex; width: 100%; max-width: 40rem; margin-bottom: 1rem; }
.dc-modes .btn { flex: 1 1 0; line-height: 1.2; padding-left: .5rem; padding-right: .5rem; min-width: 0; min-height: 44px; font-weight: 600; white-space: normal; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.dc-panel .form-label { font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
.dc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; align-items: end; }
.dc-date { display: flex; gap: .5rem; }
.dc-date .form-control { flex: 1 1 auto; min-width: 0; font-size: 1rem; min-height: 44px; }
.dc-date .btn { flex: none; min-height: 44px; }
.dc-op { display: flex; width: 100%; }
.dc-op .btn { flex: 1 1 0; line-height: 1.2; min-width: 0; min-height: 44px; font-weight: 600; white-space: normal; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.dc-opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-top: .75rem; }
.dc-check { font-size: .95rem; padding-left: 2.1rem; min-height: 1.5rem; }
.dc-check .form-check-input { width: 1.5rem; height: 1.5rem; margin-left: -2.1rem; margin-top: 0; }
.dc-swap { min-height: 40px; padding-left: .25rem; padding-right: .25rem; text-decoration: none; }
.dc-hol { margin-top: .6rem; }
.dc-hol summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .92rem; min-height: 40px; display: flex; align-items: center; gap: .3rem; }
.dc-hol summary::-webkit-details-marker { display: none; }
.dc-hol summary::before { content: "\25B8"; display: inline-block; transition: transform .15s ease; }
.dc-hol[open] summary::before { transform: rotate(90deg); }
.dc-hol textarea { font-family: var(--mono); font-size: 1rem; }
.dc-help { font-size: .84rem; color: var(--muted); margin: .45rem 0 0; }
.dc-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .85rem; }
.dc-amounts .form-control { font-size: 1.1rem; font-weight: 600; min-height: 46px; font-variant-numeric: tabular-nums; }
.dc-presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.dc-presets .btn { min-height: 36px; }

.dc-out { margin-top: 1.1rem; }
.dc-empty { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.dc-error { border-radius: var(--radius); padding: .85rem 1rem; border: 1px solid var(--bad); color: var(--bad); background: var(--surface-2); display: flex; gap: .6rem; align-items: flex-start; }
.dc-head { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #fff; border-radius: var(--radius); padding: 1rem 1.15rem; }
.dc-kicker { font-size: .88rem; opacity: .92; margin: 0 0 .2rem; overflow-wrap: anywhere; }
.dc-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; margin: 0; }
.dc-big b { font-size: clamp(2.1rem, 8vw, 2.9rem); font-weight: 750; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dc-big small { font-size: 1.05rem; opacity: .92; }
.dc-date-big { font-size: clamp(1.35rem, 5vw, 1.9rem); font-weight: 750; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.dc-range { margin: .45rem 0 0; font-size: .95rem; opacity: .96; overflow-wrap: anywhere; }
.dc-count { margin: .2rem 0 0; font-size: .86rem; opacity: .85; }
.dc-note { margin: .75rem 0 0; font-size: .9rem; color: var(--muted); }
.dc-note i { color: var(--brand); }
.dc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: .85rem; }
.dc-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; min-width: 0; }
.dc-label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.dc-val { display: block; font-size: 1.12rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dc-sub { display: block; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.dc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.dc-actions .btn { min-height: 36px; }

@media (max-width: 991.98px) {
    .dc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .dc-grid2 { grid-template-columns: minmax(0, 1fr); }
    .dc-amounts { gap: .4rem; }
    .dc-amounts .form-label { font-size: .8rem; overflow-wrap: anywhere; }
    .dc-amounts .form-control { padding-left: .5rem; padding-right: .4rem; }
    .dc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .dc-tile { padding: .6rem .7rem; }
    .dc-tile.dc-wide { grid-column: 1 / -1; }
    .dc-modes .btn i { display: none; }
    .dc-val { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dc-hol summary::before { transition: none; }
}
/* long translations: let labels and buttons wrap instead of overflowing; Today drops below a narrow date field */
.dc-modes .btn, .dc-op .btn, .dc-label, .dc-panel .form-label, .dc-hol summary, .dc-swap { overflow-wrap: break-word; hyphens: auto; }
.dc-date { flex-wrap: wrap; }
.dc-date .form-control { flex: 1 1 9.5rem; }
.dc-date .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Scientific calculator: display, grouped keypad (memory, functions, numbers), history side panel */
.sc-card > .rc-head .sc-headhint { font-size: .82rem; color: var(--muted); }
.sc-wrap { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sc-calc { min-width: 0; }
.sc-display { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .8rem .6rem; margin-bottom: .75rem; }
.sc-display:focus-within { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .15); }
.sc-status { display: flex; align-items: center; gap: .35rem; min-height: 32px; }
.sc-chip { font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .12rem .45rem; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-variant-numeric: tabular-nums;
    max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-chip[hidden] { display: none; }
.sc-chip-2nd { background: var(--brand-2); color: #fff; }
.sc-copy { margin-left: auto; flex: none; width: 36px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.sc-copy:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.sc-copy:disabled { opacity: .45; }
.sc-expr { display: block; width: 100%; border: 0; background: transparent; color: var(--ink); text-align: right; font-family: var(--mono); font-size: 1.2rem; padding: .25rem 0; outline: none;
    min-height: 2.2rem; }
.sc-expr::placeholder { color: var(--muted); opacity: .6; }
.sc-resrow { text-align: right; min-height: 3rem; display: flex; justify-content: flex-end; align-items: baseline; overflow: hidden; }
.sc-result { font-size: 2.3rem; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow-x: auto; max-width: 100%;
    scrollbar-width: none; }
.sc-result::-webkit-scrollbar { display: none; }
.sc-result.sc-long { font-size: 1.7rem; }
.sc-result.sc-xlong { font-size: 1.3rem; }
.sc-result.sc-error { font-size: 1rem; font-weight: 600; color: var(--bad); white-space: normal; text-align: right; line-height: 1.35; padding: .4rem 0; }
.sc-result sup, .sc-preview sup { font-size: .6em; }
.sc-preview { font-size: 1.35rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.6; }
.sc-preview:empty { display: none; }

.sc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.sc-grid + .sc-grid { margin-top: .6rem; }
.sc-k { min-height: 46px; min-width: 0; padding: .3rem .2rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    font-size: 1.12rem; font-weight: 600; line-height: 1.1; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere;
    touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: background-color .12s, transform .06s; }
.sc-k:hover { border-color: var(--brand); }
.sc-k:active { transform: translateY(1px); }
.sc-k:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sc-num { font-size: 1.3rem; box-shadow: 0 1px 0 var(--line); }
.sc-num.sc-small { font-size: .95rem; }
.sc-fn { background: var(--surface-2); font-size: 1.02rem; }
.sc-mem, .sc-mode { background: transparent; font-size: .9rem; color: var(--muted); min-height: 44px; }
.sc-mode { color: var(--brand); border-color: var(--brand); font-weight: 700; letter-spacing: .03em; }
.sc-2nd[aria-pressed="true"] { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.sc-op { background: var(--brand-soft); color: var(--brand); font-size: 1.45rem; }
.sc-clr { background: var(--surface-2); color: var(--bad); }
.sc-ac { font-size: 1rem; }
.sc-eq { background: var(--brand); border-color: var(--brand); color: #fff; font-size: 1.6rem; }
.sc-eq:hover { background: #1e40af; border-color: #1e40af; }
[data-bs-theme="dark"] .sc-eq { color: #0c1220; }
[data-bs-theme="dark"] .sc-eq:hover { background: #96b6ff; border-color: #96b6ff; }
[data-bs-theme="dark"] .sc-2nd[aria-pressed="true"], [data-bs-theme="dark"] .sc-chip-2nd { color: #0c1220; }
[data-bs-theme="dark"] .sc-display:focus-within { box-shadow: 0 0 0 .2rem rgba(109, 155, 255, .2); }
@media (prefers-reduced-motion: reduce) { .sc-k { transition: none; } .sc-k:active { transform: none; } }

.sc-side { min-width: 0; }
.sc-side h3 { font-size: 1rem; font-weight: 650; margin: 0; }
.sc-side-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.sc-hist { list-style: none; padding: 0; margin: 0; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sc-hist:empty { display: none; }
.sc-hist li { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.sc-hist li:last-child { border-bottom: 0; }
.sc-hitem { flex: 1 1 auto; min-width: 0; text-align: right; background: transparent; border: 0; padding: .5rem .75rem; color: var(--ink); min-height: 44px; }
.sc-hitem:hover, .sc-hins:hover { background: var(--surface-2); }
.sc-hitem:focus-visible, .sc-hins:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.sc-hexpr { display: block; font-family: var(--mono); font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.sc-hres { display: block; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sc-hres sup { font-size: .65em; }
.sc-hins { flex: none; width: 44px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--brand); }
.sc-empty { color: var(--muted); font-size: .9rem; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin: 0; }
.sc-empty[hidden] { display: none; }
.sc-tips { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.sc-tips h3 { color: var(--ink); margin-bottom: .35rem; }
.sc-tips ul { padding-left: 1.1rem; margin: 0; }
.sc-tips li + li { margin-top: .25rem; }

@media (max-width: 991.98px) {
    .sc-wrap { grid-template-columns: minmax(0, 1fr); }
    .sc-calc { max-width: 30rem; width: 100%; margin: 0 auto; }
    .sc-hist { max-height: 16rem; }
}
@media (max-width: 575.98px) {
    .sc-card > .rc-body { padding: .75rem; }
    .sc-card > .rc-head .sc-headhint { display: none; }
    .sc-grid { gap: .35rem; }
    .sc-grid + .sc-grid { margin-top: .5rem; }
    .sc-k { min-height: 46px; font-size: 1.02rem; border-radius: 10px; }
    .sc-num { font-size: 1.22rem; }
    .sc-fn { font-size: .95rem; }
    .sc-mem, .sc-mode { font-size: .85rem; }
    .sc-expr { font-size: 1.1rem; }
    .sc-result { font-size: 2rem; }
    .sc-result.sc-long { font-size: 1.5rem; }
    .sc-result.sc-xlong { font-size: 1.15rem; }
}

/* GPA calculator: course rows per semester, results panel, cumulative and target GPA */
.gp-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "courses side" "cum side"; grid-template-rows: auto 1fr;
    column-gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.gp-courses { grid-area: courses; }
.gp-side { grid-area: side; position: sticky; top: 1rem; min-width: 0; }
.gp-cumcard { grid-area: cum; }
.gp-layout .result-card { margin-bottom: 1.25rem; }
.gp-headctl { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.gp-headctl .form-select { width: auto; min-height: 36px; }

.gp-term + .gp-term { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.gp-thead { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .8rem; margin-bottom: .5rem; }
.gp-thead h3 { font-size: 1rem; font-weight: 650; margin: 0; }
.gp-tgpa { font-size: .88rem; color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.gp-tdel { margin-left: auto; padding: .2rem .3rem; min-height: 36px; }
.gp-tdel[hidden] { display: none; }

.gp-colhead, .gp-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.75fr) 3.2rem 44px; gap: .5rem; align-items: center; }
.gp-colhead { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 0 0 .3rem; }
.gp-colhead span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-row { padding: .35rem 0; }
.gp-row + .gp-row { border-top: 1px dashed var(--line); }
.gp-f { min-width: 0; }
.gp-f .form-control, .gp-f .form-select { font-size: 1rem; min-height: 44px; font-variant-numeric: tabular-nums; }
.gp-f .form-select { padding-right: 1.9rem; background-position: right .55rem center; }
.gp-flabel { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gp-pts { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.gp-rdel { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; border-radius: 10px; }
.gp-rdel:hover { color: var(--bad); border-color: var(--line); background: var(--surface-2); }
.gp-add { margin-top: .5rem; min-height: 40px; }
.gp-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.gp-actions .btn { min-height: 44px; }
.gp-hint { font-size: .85rem; color: var(--muted); margin: .85rem 0 0; }

.gp-empty { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.2rem 1rem; text-align: center; margin: 0; }
.gp-empty[hidden], .gp-notes[hidden], .gp-ttable[hidden] { display: none; }
.gp-hero { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #fff; border-radius: var(--radius); padding: .9rem 1.1rem 1rem; }
.gp-kicker { font-size: .85rem; opacity: .9; margin: 0 0 .25rem; }
.gp-big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.gp-big > div { min-width: 0; }
.gp-biglabel { display: block; font-size: .8rem; opacity: .92; }
.gp-big b { display: block; font-size: clamp(2.1rem, 7vw, 2.8rem); font-weight: 750; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .8rem; }
.gp-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); padding: .55rem .7rem; min-width: 0; }
.gp-tlabel { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.gp-tval { display: block; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gp-work { margin-top: .8rem; font-size: .88rem; color: var(--muted); }
.gp-work code { background: transparent; padding: 0; color: var(--ink); font-size: .92em; }
.gp-ttable { margin-top: .8rem; }
.gp-ttable .table { font-variant-numeric: tabular-nums; }
.gp-notes { list-style: none; padding: 0; margin: .8rem 0 0; font-size: .88rem; color: var(--muted); }
.gp-notes li + li { margin-top: .3rem; }
.gp-notes li.gp-warn { color: var(--bad); font-weight: 600; }

.gp-scale { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1.25rem; }
.gp-scale summary, .gp-target summary { font-weight: 600; cursor: pointer; min-height: 32px; display: list-item; }
.gp-scale .table { margin: .6rem 0; font-variant-numeric: tabular-nums; --bs-table-bg: transparent; }
.gp-scale .table td, .gp-scale .table th { padding: .3rem .5rem; }

.gp-cumgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: end; }
.gp-cumgrid.gp-two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .75rem; }
.gp-cumgrid .form-label { font-size: .85rem; font-weight: 600; margin-bottom: .2rem; }
.gp-cumgrid .form-control, .gp-cumgrid .form-select { font-size: 1rem; min-height: 44px; font-variant-numeric: tabular-nums; }
.gp-cumbox { margin-top: .9rem; padding: .75rem .9rem; background: var(--brand-soft); border-radius: calc(var(--radius) - 4px); }
.gp-cum { margin: 0; font-weight: 650; color: var(--ink); }
.gp-cumbox.gp-cum-err .gp-cum { color: var(--bad); }
.gp-cumwork { margin: .25rem 0 0; font-size: .85rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.gp-cumwork:empty { display: none; }
.gp-target { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.gp-need { margin: .8rem 0 0; padding: .65rem .85rem; border-radius: calc(var(--radius) - 4px); background: var(--surface-2); border: 1px solid var(--line); font-size: .95rem; }
.gp-need.gp-need-ok { border-color: var(--ok); }
.gp-need.gp-need-bad { border-color: var(--bad); color: var(--bad); }

@media (max-width: 991.98px) {
    .gp-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "courses" "side" "cum"; grid-template-rows: none; }
    .gp-side { position: static; }
}
@media (max-width: 767.98px) {
    .gp-colhead { display: none; }
    .gp-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 44px; grid-template-areas: "name name name del" "grade cr type type"; gap: .35rem .45rem; padding: .6rem 0; align-items: end; }
    .gp-fname { grid-area: name; } .gp-fgrade { grid-area: grade; } .gp-fcr { grid-area: cr; } .gp-ftype { grid-area: type; }
    .gp-rdel { grid-area: del; }
    .gp-pts { display: none; }
    .gp-flabel { position: static; width: auto; height: auto; margin: 0 0 .1rem; overflow: visible; clip: auto; white-space: normal; display: block;
        font-size: .72rem; font-weight: 600; color: var(--muted); }
    .gp-fname .gp-flabel { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .gp-cumgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-cumgrid > div:last-child:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .gp-courses > .rc-body, .gp-cumcard > .rc-body, .gp-results > .rc-body { padding: .85rem; }
    .gp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .gp-tile { padding: .45rem .5rem; }
    .gp-tval { font-size: 1rem; }
    .gp-tlabel { font-size: .65rem; }
    .gp-f .form-select { padding-left: .5rem; padding-right: 1.6rem; background-position: right .4rem center; }
    .gp-f .form-control { padding-left: .55rem; padding-right: .4rem; }
}
.result-card .gp-ttable tbody th, .gp-scale tbody th { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--ink); font-weight: 600; }
.gp-flabel, .gp-biglabel, .gp-tlabel, .gp-kicker, .gp-cumgrid .form-label, .gp-colhead span, .gp-thead h3, .gp-actions .btn, .gp-add, .gp-scale summary, .gp-target summary { overflow-wrap: anywhere; hyphens: auto; }
.gp-actions .btn, .gp-add { white-space: normal; text-align: left; }

/* ===== Currency converter (fx-*) ===== */
.fx-date-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; white-space: nowrap; }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) auto minmax(0, 1.5fr); gap: .75rem; align-items: start; }
.fx-grid .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.fx-input { font-size: 1.05rem; min-height: 48px; font-variant-numeric: tabular-nums; }
.fx-amount .fx-input { font-size: 1.2rem; font-weight: 600; }
.fx-swap { width: 48px; height: 48px; margin-top: 1.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; padding: 0; }
.fx-err { color: var(--bad); font-size: .85rem; min-height: 0; }
.fx-err:empty { display: none; }
.fx-result { margin: 1.1rem 0 .4rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.fx-big { margin: 0; font-size: 1.15rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fx-big strong { display: block; font-size: clamp(1.7rem, 6vw, 2.4rem); color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.fx-eq { color: var(--muted); }
.fx-rates { margin: .35rem 0 0; font-size: .95rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-pairlink { margin: .5rem 0 0; font-weight: 600; font-size: .95rem; }
.fx-note { font-size: .85rem; color: var(--muted); margin: .6rem 0 0; }
.fx-stale { font-size: .9rem; color: var(--warn); font-weight: 600; margin: .4rem 0 0; }
.fx-chart-wrap { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.fx-chart-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.fx-chart-title { font-size: 1rem; font-weight: 700; margin: 0; }
.fx-range .btn { min-height: 44px; font-size: .85rem; padding: .35rem .8rem; }
.fx-chart { position: relative; min-height: 230px; border-radius: 10px; outline-offset: 3px; touch-action: pan-y; }
.fx-chart svg { display: block; overflow: visible; }
.fx-grid-line { stroke: var(--line); stroke-width: 1; }
.fx-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fx-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fx-area { fill: var(--brand); opacity: .08; }
.fx-mark { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.fx-mark-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.fx-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.fx-dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.fx-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--ink); color: var(--surface); font-size: .8rem; font-weight: 600; padding: .3rem .55rem; border-radius: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-chart-sum { font-size: .88rem; color: var(--muted); margin: .4rem 0 0; font-variant-numeric: tabular-nums; }
.fx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fx-table td, .fx-table th { font-variant-numeric: tabular-nums; }
.fx-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-sub { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.fx-table-note { font-size: .82rem; color: var(--muted); margin: .5rem 0 0; caption-side: bottom; }
.fx-matrix th, .fx-matrix td { font-size: .85rem; }
@media (max-width: 767.98px) {
    .fx-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "amount amount" "from swap" "to swap"; column-gap: .6rem; row-gap: .6rem; }
    .fx-amount { grid-area: amount; }
    .fx-from { grid-area: from; }
    .fx-to { grid-area: to; }
    .fx-swap { grid-area: swap; align-self: center; margin-top: 1.6rem; width: 48px; height: 48px; transform: rotate(90deg); }
}
@media (max-width: 420px) {
    .fx-two { grid-template-columns: 1fr; gap: .5rem; }
    .fx-result { padding: .85rem .9rem; }
}

/* ===== Compound interest calculator (ci-*) ===== */
/* Compound interest calculator (ci-*) */
#ciApp { --ci-s1: #1d4ed8; --ci-s2: #0d9488; --ci-s3: #d97706; }
[data-bs-theme="dark"] #ciApp { --ci-s1: #3b82f6; --ci-s2: #0d9488; --ci-s3: #c8740c; }
#ciApp .fin-grid > * { min-width: 0; }
.ci-form .form-control, .ci-form .form-select { font-size: 1rem; min-height: 44px; font-variant-numeric: tabular-nums; }
.ci-form .input-group-text { min-width: 2.4rem; justify-content: center; }
.ci-form .mb-3 { margin-bottom: .8rem !important; }
.ci-pair .form-select { flex: 0 1 auto; width: auto; max-width: 48%; }
.ci-seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.ci-seg .btn { min-height: 44px; display: flex; align-items: center; justify-content: center; white-space: normal; line-height: 1.2; font-size: .9rem; padding: .35rem .5rem; }
.ci-term { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ci-term > * { min-width: 0; }
.ci-err { color: var(--bad); font-weight: 600; padding: .75rem 0; }
.ci-h { font-size: .95rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
.ci-chart-wrap { position: relative; }
.ci-chart { width: 100%; min-height: 220px; }
.ci-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.ci-svg .ci-grid { stroke: var(--line); stroke-width: 1; }
.ci-svg .ci-base { stroke: var(--muted); stroke-width: 1; }
.ci-svg .ci-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ci-svg .ci-s1 { fill: var(--ci-s1); }
.ci-svg .ci-s2 { fill: var(--ci-s2); }
.ci-svg .ci-s3 { fill: var(--ci-s3); }
.ci-svg .ci-hit { fill: transparent; cursor: crosshair; }
.ci-svg .ci-hit.on { fill: var(--ink); fill-opacity: .06; }
.ci-k { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.ci-k.ci-s1 { background: var(--ci-s1); } .ci-k.ci-s2 { background: var(--ci-s2); } .ci-k.ci-s3 { background: var(--ci-s3); }
.ci-legend { margin-top: .4rem; }
.ci-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
          border-radius: .5rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); padding: .45rem .6rem; font-size: .8rem; line-height: 1.45;
          font-variant-numeric: tabular-nums; max-width: 260px; }
.ci-tip b, .ci-tip span { display: block; white-space: nowrap; }
.ci-tip .ci-tip-total { font-weight: 700; border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .2rem; }
.ci-actions { display: flex; gap: .5rem .75rem; flex-wrap: wrap; align-items: center; margin-top: .9rem; }
.ci-actions .btn { min-height: 44px; }
.ci-copied { font-size: .85rem; color: var(--muted); }
.ci-lower { margin-top: .5rem; }
.ci-schedule { max-height: 560px; }
.ci-schedule:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ci-schedule .fin-table th[scope="row"] { font-weight: 600; text-align: left; white-space: nowrap; }
.ci-schedule tfoot td, .ci-schedule tfoot th { position: sticky; bottom: 0; background: var(--surface); }
.ci-formula { border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: .7rem .9rem; }
.ci-formula p { margin: 0 0 .55rem; }
.ci-formula p:last-child { margin-bottom: 0; }
.ci-fl { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ci-fm { font-family: var(--mono); font-size: .9rem; overflow-wrap: anywhere; }
.ci-fm sup { font-size: .7em; }
@media (max-width: 575.98px) {
    .ci-schedule .fin-table { font-size: .8rem; }
    .ci-schedule .fin-table th, .ci-schedule .fin-table td { padding: .4rem .3rem; }
    .ci-schedule .fin-table thead th { font-size: .68rem; letter-spacing: 0; }
}

/* ===== Guitar tuner (gt-*) ===== */
/* Guitar tuner (.gt-) */
.gt .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.gt-status { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .6rem; border-radius: 99px;
    border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.gt-status.is-on { color: var(--ok); border-color: var(--ok); }
.gt-status.is-bad { color: var(--bad); border-color: var(--bad); }

.gt-display { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gt-meter { width: 100%; max-width: 360px; height: auto; display: block; overflow: visible; }
.gt-arc { fill: none; stroke: var(--line); stroke-width: 3; }
.gt-zone { fill: none; stroke: var(--ok); stroke-width: 16; opacity: .28; }
.gt-tick { stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; }
.gt-tick-major { stroke: var(--ink); stroke-width: 2.5; }
.gt-tick-label { fill: var(--muted); font-size: 11px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.gt-sign { fill: var(--muted); font-size: 22px; font-weight: 700; text-anchor: middle; }
#gtNeedle { transform-box: view-box; transform-origin: 150px 160px; transition: transform .14s ease-out; }
.gt-needle { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; transition: stroke .2s; }
.gt-hub { fill: var(--muted); transition: fill .2s; }
.gt[data-gt="in"] .gt-needle { stroke: var(--ok); }
.gt[data-gt="in"] .gt-hub { fill: var(--ok); }
.gt[data-gt="in"] .gt-zone { opacity: .6; }
.gt[data-gt="near"] .gt-needle { stroke: var(--warn); }
.gt[data-gt="near"] .gt-hub { fill: var(--warn); }
.gt[data-gt="far"] .gt-needle { stroke: var(--bad); }
.gt[data-gt="far"] .gt-hub { fill: var(--bad); }

.gt-note-wrap { display: flex; align-items: baseline; justify-content: center; gap: .1rem; margin-top: -.6rem; min-height: 4.6rem; line-height: 1; }
.gt-note { font-size: clamp(3.4rem, 16vw, 4.6rem); font-weight: 800; color: var(--ink); transition: color .2s; }
.gt-oct { font-size: 1.5rem; font-weight: 700; color: var(--muted); }
.gt-alt { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: .5rem; }
.gt[data-gt="idle"] .gt-note, .gt[data-gt="target"] .gt-note { color: var(--muted); }
.gt[data-gt="idle"]:not(.is-listening) .gt-note-wrap, .gt[data-gt="idle"]:not(.is-listening) .gt-readout { display: none; }
.gt[data-gt="in"] .gt-note { color: var(--ok); }
.gt-readout { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; font-size: 1.05rem; font-weight: 600;
    font-variant-numeric: tabular-nums; color: var(--ink); min-height: 1.6rem; }
.gt-cents { color: var(--muted); }
.gt-target { color: var(--muted); font-size: .88rem; margin: .1rem 0 0; min-height: 1.3rem; }
.gt-advice { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-size: 1.15rem; font-weight: 700;
    margin: .55rem 0 .2rem; min-height: 2rem; color: var(--muted); }
.gt-advice[data-k="in"] { color: var(--ok); }
.gt-advice[data-k="up"], .gt-advice[data-k="down"] { color: var(--warn); }
.gt-level { width: min(14rem, 70%); height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: .25rem 0 0; }
.gt-level span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .08s linear; }

.gt-actions { display: flex; justify-content: center; margin: 1rem 0 .3rem; }
.gt-start { min-height: 54px; min-width: min(14rem, 100%); font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center;
    justify-content: center; gap: .45rem; padding-left: 1.4rem; padding-right: 1.4rem; }
.gt.is-listening .gt-start { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.gt-privacy { text-align: center; color: var(--muted); font-size: .85rem; max-width: 34rem; margin: .4rem auto 0; }
.gt-privacy i { color: var(--ok); }
.gt-err { margin: .9rem auto 0; max-width: 40rem; padding: .75rem .9rem; border: 1px solid var(--line); border-left: 4px solid var(--bad);
    border-radius: calc(var(--radius) - 4px); background: var(--surface-2); font-size: .92rem; }
.gt-err-title { font-weight: 700; color: var(--bad); margin: 0 0 .35rem; }
.gt-err ul { margin: 0 0 .4rem; padding-left: 1.2rem; }
.gt-err li { margin-bottom: .2rem; }
.gt-err-links { margin: 0; }

.gt-strings-wrap { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.gt-label { font-size: .9rem; font-weight: 650; margin: 0 0 .5rem; }
.gt-strings { display: flex; gap: .4rem; align-items: stretch; max-width: 46rem; }
.gt-string-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .4rem; flex: 1 1 auto; min-width: 0; }
.gt-string { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; min-height: 56px; min-width: 0;
    padding: .3rem .2rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink);
    position: relative; cursor: pointer; touch-action: manipulation; transition: border-color .15s, background-color .15s; }
.gt-string:hover { border-color: var(--brand); }
.gt-string:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.gt-string-note { font-weight: 800; font-size: 1.05rem; line-height: 1.1; white-space: nowrap; }
.gt-string-hz { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.gt-auto { flex: 0 0 auto; padding-left: .7rem; padding-right: .7rem; }
.gt-auto .gt-string-note { font-size: .95rem; }
.gt-string.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.gt-string.is-active { box-shadow: 0 0 0 3px var(--brand) inset; }
.gt-string.is-done::after { content: "\2713"; font-weight: 800; position: absolute; top: -.55rem; right: -.4rem; width: 1.2rem; height: 1.2rem;
    border-radius: 50%; background: var(--ok); color: #fff; font-size: .8rem; line-height: 1.2rem; text-align: center; }
[data-bs-theme="dark"] .gt-string.is-done::after { color: #0b1220; }

.gt-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.gt-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.gt-settings legend { font-size: .9rem; font-weight: 650; margin-bottom: .45rem; float: none; width: auto; padding: 0; }
.gt-seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.gt-seg .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; padding-left: .8rem; padding-right: .8rem; }
.gt-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.gt-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; }
.gt-row .form-label { font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: .25rem; }
.gt-row .form-select, .gt-row .form-control { font-size: 1rem; min-height: 44px; }
.gt-a4-row { display: flex; gap: .35rem; max-width: 14rem; }
.gt-a4-row .btn { width: 44px; min-width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.gt-a4-row .form-control { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 0; }
.gt-switch { min-height: 1.6rem; margin: 0; }

@media (min-width: 768px) {
    .gt-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .gt-strings { flex-direction: column; }
    .gt-auto { flex-direction: row; gap: .4rem; align-self: flex-start; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    #gtNeedle, .gt-needle, .gt-hub, .gt-note, .gt-level span, .gt-string { transition: none; }
}

/* ===== Image to text / OCR (ocr-*) ===== */
/* ---------- Image to text (OCR) ---------- */
.ocr-settings { display: grid; gap: .75rem 1.25rem; margin-bottom: 1rem; }
.ocr-field .form-select { font-size: 1rem; min-height: 44px; }
.ocr-field .form-label { font-weight: 600; margin-bottom: .3rem; }
.ocr-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; min-height: 44px; margin: 0; padding-left: 2.6em; }
.ocr-switch .form-check-input { width: 2.4em; height: 1.3em; margin-left: -2.6em; margin-top: 0; cursor: pointer; }
.ocr-switch .form-check-label { cursor: pointer; overflow-wrap: anywhere; flex: 1 1 0; min-width: 0; }
.ocr-switch .form-text { flex-basis: 100%; margin: 0; color: var(--muted); }
@media (min-width: 768px) { .ocr-settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: end; } }
.ocr-drop:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ocr-drop span, .ocr-drop small { overflow-wrap: anywhere; }
.ocr-drop kbd { font-size: .8em; }
.ocr-more { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .75rem; }
.ocr-more:not(:has(> :not([hidden]):not(input))) { display: none; }
.ocr-btn { min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.ocr-privacy { margin: .85rem 0 0; font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.ocr-privacy .bi { color: var(--ok); }
.ocr-status { margin-top: 1rem; }
.ocr-status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; font-size: .92rem; }
.ocr-status-row .btn { min-height: 36px; }
.ocr-status .progress { height: .6rem; }
.ocr-err { margin: 1rem 0 0; font-size: .92rem; }
.ocr-results { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.ocr-results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.ocr-all { display: flex; flex-wrap: wrap; gap: .4rem; }
.ocr-all .btn { min-height: 40px; display: inline-flex; align-items: center; gap: .3rem; }
.ocr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ocr-item { display: grid; gap: .75rem; padding: .85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
@media (min-width: 768px) { .ocr-item { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }
.ocr-preview { min-width: 0; }
.ocr-thumb { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.ocr-body { min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.ocr-item-head { display: flex; align-items: flex-start; gap: .5rem; }
.ocr-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; min-width: 0; flex: 1; padding-top: .1rem; }
.ocr-name { overflow-wrap: anywhere; font-size: .95rem; }
.ocr-conf { font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid currentColor; cursor: help; }
.ocr-conf:empty { display: none; }
.ocr-conf-high { color: var(--ok); }
.ocr-conf-medium { color: var(--warn); }
.ocr-conf-low { color: var(--bad); }
.ocr-state { margin: 0; font-size: .9rem; color: var(--muted); }
.ocr-state-bad { color: var(--bad); }
.ocr-working .ocr-state::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .4em; vertical-align: -.05em;
    border: 2px solid var(--brand); border-right-color: transparent; border-radius: 50%; animation: ocr-spin .8s linear infinite; }
@keyframes ocr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ocr-working .ocr-state::before { animation: none; border-right-color: var(--brand); } }
.ocr-text { font-size: 1rem; line-height: 1.5; min-height: 5.5rem; resize: vertical; background: var(--surface); color: var(--ink); }
.ocr-counts { margin: 0; font-size: .82rem; color: var(--muted); }
.ocr-item-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.ocr-item-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: .3rem; }
.ocr-remove { margin: -.5rem -.5rem -.5rem 0; flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.ocr-remove:hover { color: var(--bad); }
.ocr-note { margin: .85rem 0 0; font-size: .84rem; color: var(--muted); }

/* ===== Morse code translator (mc-*) ===== */
/* Morse code translator: direction control, two panes, player with "now playing" and optional light panel,
   settings, examples and the clickable alphabet chart. */
.mc-status { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .6rem; border-radius: 99px;
             border: 1px solid var(--line); color: var(--muted); }
.mc.is-playing .mc-status { color: var(--ok); border-color: var(--ok); }
.mc-dirbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.mc-seg { display: flex; flex-wrap: wrap; gap: .35rem; min-width: 0; }
.mc-seg .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 600; }
.mc-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }

.mc-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; margin-top: 1rem; }
.mc-pane { min-width: 0; display: flex; flex-direction: column; }
.mc-pane-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; margin-bottom: .25rem; }
.mc-pane-head .form-label { font-weight: 600; font-size: .9rem; margin: 0; }
.mc-detect { font-size: .8rem; color: var(--brand); font-weight: 600; }
.mc-in { font-size: 1.05rem; min-height: 8.5rem; resize: vertical; }
.mc-in.mc-mono, .mc-mono { font-family: var(--mono); letter-spacing: .06em; }
.mc-out { flex: 1 1 auto; min-height: 8.5rem; max-height: 22rem; overflow-y: auto; padding: .55rem .75rem; background: var(--surface-2); border: 1px solid var(--line);
          border-radius: var(--bs-border-radius, .375rem); font-size: 1.15rem; line-height: 1.7; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-out:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.mc-out.is-morse { font-family: var(--mono); font-weight: 700; letter-spacing: .08em; }
.mc-out.is-empty::before { content: attr(data-empty); color: var(--muted); font-family: inherit; font-weight: 400; letter-spacing: 0; font-size: 1rem; }
.mc-tok { border-radius: 4px; padding: 0 .05em; }
.mc-tok.is-active { background: var(--brand); color: var(--surface); }
.mc-unk { color: var(--bad); }
.mc-sep { color: var(--muted); font-weight: 400; }
.mc-pane-foot { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.mc-pane-foot .btn { min-height: 38px; display: inline-flex; align-items: center; gap: .35rem; }
.mc-msg { margin-top: .6rem; }
.mc-msg p { margin: .2rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.mc-msg-bad { color: var(--bad); font-weight: 600; }
.mc-msg-note { color: var(--muted); }

.mc-player { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.1rem; }
.mc-play { min-height: 54px; min-width: min(11rem, 100%); font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.mc-now:has(.mc-now-ch:empty) { display: none; }
.mc-now { display: flex; align-items: baseline; gap: .75rem; min-height: 2.6rem; min-width: 0; }
.mc-now-ch { font-size: 2.1rem; font-weight: 800; color: var(--ink); line-height: 1; }
.mc-now-code { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; letter-spacing: .18em; color: var(--brand); overflow-wrap: anywhere; }
.mc-light-wrap { margin-top: .9rem; }
.mc-light-note { font-size: .86rem; color: var(--warn); margin: 0 0 .45rem; }
.mc-light { height: 5.5rem; max-width: 22rem; border-radius: var(--radius); background: var(--surface-2); border: 2px solid var(--line); }
.mc-light.is-on { background: var(--brand); border-color: var(--brand); }

.mc-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem 1.5rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mc-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.mc-field > .form-label, .mc-field #mcEffWrap .form-label { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; font-size: .9rem; margin-bottom: .1rem; }
.mc-field output { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-field .form-range { height: 2rem; }
.mc-field .form-check { min-height: 32px; display: flex; align-items: center; gap: .5rem; padding-left: 2.75em; }
.mc-field .form-check-input { margin-top: 0; }
.mc-field #mcEffWrap { margin-top: .4rem; }
.mc-outputs legend { font-weight: 600; font-size: .9rem; margin-bottom: .15rem; float: none; width: auto; }
.mc-outputs .form-check-label i { color: var(--muted); margin-right: .2rem; }
.mc-timing { margin: .6rem 0 0; font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-examples { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.mc-examples .btn { min-height: 40px; }
.mc-hint { font-size: .86rem; color: var(--muted); margin: .8rem 0 0; }

/* Chart */
.mc-chart-hint { margin: 0; font-size: .92rem; color: var(--muted); }
.mc-chart-h { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.1rem 0 .5rem; }
.mc-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr)); gap: .4rem; }
.mc-keys-wide { grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); }
.mc-key { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 64px; padding: .4rem .3rem; min-width: 0;
          background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; }
.mc-key:hover { border-color: var(--brand); }
.mc-key:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.mc-key.is-active { background: var(--brand-soft); border-color: var(--brand); }
.mc-k-ch { font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.mc-k-code { font-family: var(--mono); font-size: 1rem; font-weight: 700; letter-spacing: .06em; color: var(--brand); line-height: 1.2; white-space: nowrap; }
.mc-k-name { font-size: .74rem; color: var(--muted); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.mc-pro { text-decoration: overline; text-decoration-thickness: 2px; }
.mc-ext { color: var(--warn); font-size: .65em; font-weight: 700; margin-left: .1em; }
.mc-chart-note { font-size: .84rem; color: var(--muted); margin: .6rem 0 0; }
.mc-chart-note sup { color: var(--warn); font-weight: 700; }

@media (min-width: 576px) {
    .mc-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .mc-panes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
    .mc-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
    .mc-seg { width: 100%; }
    .mc-seg .btn { flex: 1 1 auto; padding-left: .5rem; padding-right: .5rem; }
    .mc-play { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .mc-light.is-on { background: color-mix(in srgb, var(--brand) 40%, var(--surface-2)); border-color: var(--brand); }
}

/* ===== Online piano (pn-*) ===== */
/* Online piano: toolbar, learn strip, keyboard, record/songs panels, settings */
.pn .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.pn-status { font-size: .78rem; font-weight: 600; letter-spacing: .03em; padding: .15rem .6rem; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.pn.pn-recording .pn-status { color: var(--bad); border-color: var(--bad); }

.pn-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .75rem; }
.pn-oct { display: inline-flex; align-items: center; gap: .35rem; }
.pn-octbtn { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.pn-range { min-width: 5.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.pn-sus-group { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.pn-susbtn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 600; white-space: nowrap;
    touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Learn strip */
.pn-strip { background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); padding: .55rem .7rem .6rem; margin-bottom: .75rem; }
.pn-strip-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.pn-strip-head strong { font-size: .95rem; min-width: 0; overflow-wrap: anywhere; }
.pn-strip-prog { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.pn-strip-close { flex: none; width: 1.6rem; height: 1.6rem; padding: .5rem; }
[data-bs-theme="dark"] .pn-strip-close { filter: invert(1) grayscale(100%) brightness(200%); }
.pn-notes { display: flex; flex-wrap: wrap; gap: .3rem; max-height: 8.4rem; overflow-y: auto; position: relative; }
.pn-br { flex-basis: 100%; height: 0; }
.pn-n { min-width: 2.1rem; padding: .15rem .3rem; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
    font-weight: 650; font-size: .9rem; line-height: 1.4; color: var(--ink); }
.pn-n.pn-dshort { min-width: 1.75rem; font-size: .82rem; }
.pn-n.pn-ddot { min-width: 2.7rem; }
.pn-n.pn-d2 { min-width: 3.3rem; }
.pn-n.pn-d4 { min-width: 4.8rem; }
.pn-n.is-done { color: var(--muted); opacity: .55; }
.pn-n.is-now { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
[data-bs-theme="dark"] .pn-n.is-now { color: #0b1220; }
.pn-n.is-miss { border-color: var(--bad); animation: pnShake .3s ease-in-out; }
@keyframes pnShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Keyboard: always real piano colours, in both themes */
.pn-kbd-wrap { background: #1d1f24; border-radius: 10px; padding: 10px 6px 6px; border-top: 4px solid #7a1f2b; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.pn-kbd { position: relative; display: flex; height: clamp(170px, 19vw, 230px); touch-action: none; -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; cursor: pointer; border-radius: 2px; }
.pn-kbd:focus { outline: none; }
.pn-kbd:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.pn-key { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; overflow: hidden; }
.pn-key span { pointer-events: none; }
.pn-white { position: relative; flex: 1 1 0; min-width: 0; margin-right: 2px; padding-bottom: 8px; background: linear-gradient(#f4f4f0, #fff 12%, #fdfdfb);
    border-radius: 0 0 5px 5px; box-shadow: inset 0 -6px 0 #d9d9d3, 0 1px 0 rgba(0, 0, 0, .4); }
.pn-white:last-child { margin-right: 0; }
.pn-black { position: absolute; top: 0; height: 62%; z-index: 2; padding-bottom: 6px; background: linear-gradient(#2c2c2e, #111 85%, #2a2a2c);
    border-radius: 0 0 4px 4px; box-shadow: 0 3px 3px rgba(0, 0, 0, .55), inset 0 -5px 0 #3a3a3d; }
.pn-white.is-down, .pn-white.is-play { background: #c7d8ff; background: color-mix(in srgb, var(--brand) 32%, #fff); box-shadow: inset 0 -2px 0 #9fb4e6; }
.pn-black.is-down, .pn-black.is-play { background: #2747a6; background: color-mix(in srgb, var(--brand) 70%, #000); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pn-white.pn-target { background: #dccbfb; background: color-mix(in srgb, var(--brand-2) 35%, #fff); box-shadow: inset 0 0 0 3px var(--brand-2), inset 0 -6px 0 #b9a4ec; }
.pn-black.pn-target { background: #6d3bd6; background: color-mix(in srgb, var(--brand-2) 85%, #000); box-shadow: 0 0 0 2px #fff, 0 3px 3px rgba(0, 0, 0, .55); }
.pn-white.pn-target.is-down, .pn-black.pn-target.is-down { filter: brightness(.92); }
.pn-mid::before { content: ""; position: absolute; top: 10px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #9aa3b5; }
.pn-lbl { font-size: .8rem; font-weight: 700; color: #3a4252; line-height: 1; white-space: nowrap; }
.pn-black .pn-lbl { color: #e9e9ee; font-size: .66rem; font-weight: 600; }
.pn-kb { font-size: .7rem; line-height: 1; color: #5d6676; border: 1px solid #c3c9d4; border-radius: 3px; padding: .12rem .22rem; min-width: 1.15rem; text-align: center; font-family: var(--mono); }
.pn-black .pn-kb { color: #cfd3dc; border-color: #55585f; }
.pn-kbd[data-labels="off"] .pn-lbl { display: none; }
.pn-kbd[data-labels="off"] .pn-target .pn-lbl { display: block; }
.pn-kbd.pn-nokeys .pn-kb { display: none; }
.pn-kbd.pn-narrow .pn-lbl { font-size: .68rem; }
.pn-kbd.pn-narrow .pn-black .pn-lbl { font-size: .56rem; }
.pn-kbd.pn-narrow .pn-kb { font-size: .62rem; padding: .1rem .1rem; min-width: 0; }
.pn-kbd.pn-tiny .pn-white { margin-right: 1px; padding-bottom: 7px; }
.pn-kbd.pn-tiny .pn-lbl { font-size: .6rem; letter-spacing: -.02em; }
.pn-kbd.pn-tiny .pn-black .pn-lbl { display: none; }
.pn-kbd.pn-tiny .pn-black.pn-target .pn-lbl { display: block; font-size: .5rem; }
.pn-kbd.pn-tiny .pn-kb { font-size: .56rem; border: 0; padding: 0; }
.pn-kbd.pn-tiny .pn-mid::before { width: 5px; height: 5px; margin-left: -2.5px; top: 8px; }
.pn.pn-sus .pn-kbd-wrap { border-top-color: var(--brand-2); }

.pn-hint { font-size: .84rem; color: var(--muted); margin: .6rem 0 0; }
.pn-err { color: var(--bad); font-size: .92rem; margin-top: .4rem; }

/* Record and songs */
.pn-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pn-panel, .pn-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.pn-panels legend, .pn-settings legend { font-size: .9rem; font-weight: 650; margin-bottom: .45rem; float: none; width: auto; padding: 0; }
.pn-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.pn-btns .btn { flex: 1 1 auto; min-height: 44px; min-width: 6.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 600; }
.pn-recbtn.active { background: var(--bad); border-color: var(--bad); color: #fff; }
.pn.pn-recording .pn-recbtn .bi { animation: pnBlink 1s steps(2, start) infinite; }
@keyframes pnBlink { to { visibility: hidden; } }
.pn-song { font-size: 1rem; min-height: 44px; margin-bottom: .45rem; }
.pn-note { font-size: .86rem; color: var(--muted); margin: .5rem 0 0; }

/* Settings */
.pn-settings { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.25rem; align-items: end; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pn-seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.pn-seg .btn { min-height: 44px; min-width: 3.4rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; white-space: nowrap; }
.pn-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.pn-switch { display: flex; align-items: center; min-height: 44px; margin: 0; font-size: .95rem; }
.pn-switch.form-switch { padding-left: 3.3rem; }
.pn-switch .form-check-input { width: 2.75rem; height: 1.5rem; margin-top: 0; margin-left: -3.3rem; cursor: pointer; }
.pn-switch .form-check-label { padding-left: .3rem; cursor: pointer; }
.pn-set .form-label { font-size: .9rem; font-weight: 650; margin-bottom: .2rem; }
.pn-set .form-range { height: 44px; }
.pn-set output { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: .25rem; font-weight: 400; }

@media (min-width: 768px) {
    .pn-notes { max-height: 13rem; }
}
@media (max-width: 767.98px) {
    .pn-panels { grid-template-columns: 1fr; }
    .pn-settings { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .result-card.pn > .rc-body { padding-left: .75rem; padding-right: .75rem; }
    .pn-kbd-wrap { padding: 8px 4px 4px; }
    .pn-bar { justify-content: center; }
    .pn-btns .btn { min-width: 0; flex: 1 1 40%; }
}
@media (prefers-reduced-motion: reduce) {
    .pn-n.is-miss { animation: none; }
    .pn.pn-recording .pn-recbtn .bi { animation: none; }
}

/* ===== Text to speech (ts-*) ===== */
/* Text to speech: editor with reading view, play controls, voice and speech settings */
.ts .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.ts-status { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .6rem; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.ts.is-speaking .ts-status { color: var(--ok); border-color: var(--ok); }

.ts-msg { border-radius: 10px; padding: .6rem .85rem; margin-bottom: .8rem; font-size: .92rem; border: 1px solid var(--line); background: var(--surface-2); }
.ts-msg-warn { border-color: var(--warn); }
.ts-msg-bad { border-color: var(--bad); color: var(--bad); }

.ts-label { font-weight: 650; font-size: .9rem; }
.ts-editor { position: relative; }
.ts-text, .ts-view { width: 100%; font-size: 1.05rem; line-height: 1.65; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink); }
.ts-text { min-height: 240px; resize: vertical; display: block; }
.ts-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .18); }
.ts-view { position: relative; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 160px; }
.ts-sent { background: color-mix(in srgb, var(--brand) 9%, transparent); border-radius: 3px; }
.ts-mark { background: var(--brand); color: #fff; border-radius: 3px; padding: 0 .08em; }

.ts-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: .4rem; }
.ts-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s; }
.ts-under { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .45rem; }
.ts-count { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ts-tools { display: flex; gap: .4rem; flex-wrap: wrap; }
.ts-tools .btn { min-height: 38px; }

.ts-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1.1rem 0 .6rem; }
.ts-actions .btn { min-height: 54px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding-left: 1.4rem; padding-right: 1.4rem; }
.ts-play { min-width: min(12rem, 100%); font-size: 1.2rem; }
.ts-stop { min-width: min(9rem, 100%); }

.ts-from { margin: .4rem 0 0; padding: 0; border: 0; min-width: 0; text-align: center; }
.ts-from legend, .ts-settings .form-label { font-size: .85rem; font-weight: 650; color: var(--muted); margin-bottom: .3rem; float: none; width: auto; padding: 0; }
.ts-seg { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.ts-seg .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 1 auto; white-space: normal; }
.ts-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }

.ts-note { font-size: .84rem; color: var(--muted); margin: .5rem 0 0; }
.ts-hl-note { text-align: center; }

.ts-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .3rem 1rem; margin-top: 1.2rem; padding-top: 1rem;
    border-top: 1px solid var(--line); align-items: end; }
.ts-field { min-width: 0; }
.ts-field .form-select { font-size: 1rem; min-height: 44px; text-overflow: ellipsis; }
.ts-voice-info, .ts-switch, .ts-sliders, .ts-reset { grid-column: 1 / -1; }
.ts-voice-info { font-size: .84rem; color: var(--muted); margin: .25rem 0 0; min-height: 1.2em; }
.ts-voice-info.is-online { color: var(--ink); }
.ts-voice-info.is-online .bi { color: var(--warn); }
.ts-switch { margin: .3rem 0 0; min-height: 1.6rem; }
.ts-switch .form-check-label { padding-left: .25rem; }
.ts-draft .form-check-input { width: 1.25em; height: 1.25em; }
.ts-draft .form-check-label { padding-left: .2rem; }
.ts-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem 1.1rem; margin-top: .7rem; }
.ts-slider { min-width: 0; }
.ts-slider .form-label { display: flex; justify-content: space-between; gap: .4rem; }
.ts-slider output { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.ts-slider .form-range { height: 2rem; }
.ts-reset { justify-self: start; margin-top: .3rem; min-height: 38px; }

.ts-draft { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.ts-draft .form-check-label { font-weight: 600; }
.ts-support { margin-top: .9rem; }
.ts-keys { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }

@media (max-width: 575.98px) {
    .ts-text { min-height: 200px; }
    .ts-settings { grid-template-columns: 1fr; }
    .ts-sliders { grid-template-columns: 1fr; }
    .ts-actions .btn { flex: 1 1 auto; min-width: 0; padding-left: .75rem; padding-right: .75rem; font-size: 1.05rem; white-space: nowrap; line-height: 1.15; }
    .ts-play { flex-grow: 1.4 !important; }
    .ts-seg .btn { flex: 1 1 0; min-width: 0; font-size: .95rem; padding-left: .5rem; padding-right: .5rem; }
    .ts-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ts-bar span { transition: none; } }
.ts-seg .btn-outline-secondary { color: var(--ink); border-color: var(--line); }
.ts-seg .btn-check:checked + .btn-outline-secondary { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ===== Time zone converter and world clock (tz-*) ===== */
/* Time zone converter + world clock (prefix .tz-, world clock cards .tz-w-) */
.tz-card {
    --tz-work: rgba(21, 128, 61, .16); --tz-work-ink: #14532d;
    --tz-night: rgba(15, 23, 42, .1); --tz-night-ink: #64748b;
    --tz-sel: var(--brand);
}
[data-bs-theme="dark"] .tz-card {
    --tz-work: rgba(74, 222, 128, .18); --tz-work-ink: #bbf7d0;
    --tz-night: rgba(0, 0, 0, .35); --tz-night-ink: #7c879b;
}
.tz-card .form-label { font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
.tz-card .form-control { font-size: 1rem; min-height: 44px; }
.tz-seg { flex-wrap: nowrap; }
.tz-seg .btn { min-height: 40px; padding: .3rem .7rem; font-size: .9rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; }
.tz-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.tz-switch { min-height: 40px; display: flex; align-items: center; gap: .4rem; padding-left: 2.6em; }
.tz-switch .form-check-input { width: 2.2em; height: 1.2em; margin-top: 0; }

.tz-inputs { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 640px) { .tz-inputs { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; } }
.tz-timebox { display: flex; gap: .5rem; }
.tz-timebox .form-control { flex: 1 1 auto; min-width: 0; }
.tz-timebox .btn { flex: none; min-height: 44px; font-weight: 600; }

.tz-combo { position: relative; }
.tz-combo .form-control { padding-left: 2.3rem; }
.tz-combo-icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tz-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .35);
    max-height: 22rem; overflow-y: auto; }
.tz-opt { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; min-height: 44px; }
.tz-opt[aria-selected="true"], .tz-opt:hover { background: var(--brand-soft); }
.tz-opt-main { display: flex; flex-direction: column; min-width: 0; }
.tz-opt-main strong { font-weight: 650; overflow-wrap: anywhere; }
.tz-opt-main small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.tz-opt-time { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.tz-opt-empty { cursor: default; color: var(--muted); font-size: .9rem; }
.tz-opt-empty:hover { background: none; }

.tz-note { margin: .85rem 0 0; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--warn); color: var(--ink); background: var(--surface-2); font-size: .92rem; }
.tz-note::before { content: "\26A0\FE0E"; color: var(--warn); margin-right: .4rem; }
.tz-summary { margin: .9rem 0 .5rem; color: var(--muted); font-size: .92rem; }

.tz-rows { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tz-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info when" "rel rel" "acts acts"; gap: .3rem .75rem;
    padding: .7rem .85rem; border-top: 1px solid var(--line); background: var(--surface); }
.tz-row:first-child { border-top: 0; }
.tz-row-from { background: var(--brand-soft); }
.tz-row-info { grid-area: info; min-width: 0; }
.tz-row-name { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: 1.02rem; }
.tz-row-name strong { overflow-wrap: anywhere; }
.tz-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--brand); color: #fff; border-radius: 999px; padding: .05rem .5rem; }
[data-bs-theme="dark"] .tz-tag { color: #0c1220; }
.tz-row-sub { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.tz-row-when { grid-area: when; text-align: right; }
.tz-row-time { font-size: 1.55rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tz-row-date { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.tz-row-rel { grid-area: rel; align-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .88rem; }
.tz-day { font-weight: 650; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tz-day-next, .tz-day-prev { border-color: var(--brand-2); color: var(--brand-2); }
.tz-diff { color: var(--ink); }
.tz-row-acts { grid-area: acts; display: flex; gap: .35rem; justify-content: flex-end; }
.tz-icon { min-width: 44px; min-height: 44px; padding: .25rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
@media (min-width: 520px) and (max-width: 767.98px) {
    .tz-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "info info when" "rel acts acts"; }
}
@media (min-width: 768px) {
    .tz-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto; grid-template-areas: "info rel when acts"; align-items: center; }
    .tz-row-rel { flex-direction: column; align-items: flex-start; gap: .2rem; }
    .tz-row-from .tz-row-rel { justify-content: center; }
}

.tz-add { max-width: 36rem; }
.tz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .85rem 0 0; }
.tz-actions .btn { min-height: 44px; font-weight: 600; }
.tz-copied { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }

.tz-planner { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.tz-h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .35rem; }
.tz-help { color: var(--muted); font-size: .88rem; margin: 0 0 .6rem; }
.tz-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; list-style: none; padding: 0; margin: 0 0 .6rem; font-size: .82rem; color: var(--muted); }
.tz-legend li { display: inline-flex; align-items: center; gap: .35rem; }
.tz-sw { width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.tz-sw.tz-work { background: var(--tz-work); }
.tz-sw.tz-edge { background: var(--surface); }
.tz-sw.tz-night { background: var(--tz-night); }
.tz-sw-all { box-shadow: inset 0 3px 0 var(--ok); }
.tz-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tz-grid-wrap:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tz-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; font-variant-numeric: tabular-nums; }
.tz-grid th, .tz-grid td { border-bottom: 1px solid var(--line); }
.tz-grid tr:last-child th, .tz-grid tr:last-child td { border-bottom: 0; }
.tz-gname { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: .35rem .6rem; min-width: 7.5rem; max-width: 9.5rem;
    border-right: 1px solid var(--line); font-weight: 600; font-size: .85rem; line-height: 1.2; }
.tz-gname-n { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-gname-o { display: block; color: var(--muted); font-weight: 400; font-size: .74rem; }
.tz-c { min-width: 2.5rem; padding: 0; text-align: center; cursor: pointer; font-size: .85rem; line-height: 1.1; height: 2.9rem; position: relative; }
.tz-c .tz-c-h { display: block; font-weight: 600; }
.tz-c-m { font-size: .62rem; vertical-align: super; margin-left: 1px; font-weight: 600; }
.tz-c .tz-c-s { display: block; font-size: .64rem; color: var(--muted); white-space: nowrap; }
.tz-c.tz-work { background: var(--tz-work); color: var(--tz-work-ink); }
.tz-c.tz-night { background: var(--tz-night); color: var(--tz-night-ink); }
.tz-c.tz-midnight { border-left: 2px solid var(--brand-2); }
.tz-c.tz-all { box-shadow: inset 0 3px 0 var(--ok); }
.tz-c.tz-sel { outline: 2px solid var(--tz-sel); outline-offset: -2px; }
tr:first-child .tz-c.tz-sel { background: var(--brand); color: #fff; }
tr:first-child .tz-c.tz-sel .tz-c-s { color: #fff; }
[data-bs-theme="dark"] tr:first-child .tz-c.tz-sel, [data-bs-theme="dark"] tr:first-child .tz-c.tz-sel .tz-c-s { color: #0c1220; }
.tz-pick { display: flex; flex-direction: column; justify-content: center; width: 100%; height: 100%; min-height: 44px; border: 0; padding: .2rem 0; background: none; color: inherit; font: inherit; }
.tz-pick:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.tz-c:hover { filter: brightness(.95); }
.tz-overlap { margin: .6rem 0 0; font-size: .9rem; }
.tz-overlap-ok::before { content: "\2713"; color: var(--ok); font-weight: 700; margin-right: .35rem; }

.tz-xlink { display: flex; align-items: center; gap: .75rem; margin-top: 1.25rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-2); color: var(--ink); text-decoration: none; min-height: 44px; }
.tz-xlink > .bi:first-child { font-size: 1.4rem; color: var(--brand); flex: none; }
.tz-xlink > .bi:last-child { margin-left: auto; color: var(--brand); flex: none; }
.tz-xlink strong { color: var(--brand); margin-right: .25rem; }
.tz-xlink:hover, .tz-xlink:focus-visible { border-color: var(--brand); color: var(--ink); }
.tz-xlink:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* World clock */
.tz-w-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.tz-w-hero { display: flex; align-items: center; gap: 1rem 1.25rem; padding: .25rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tz-w-hero-analog { flex: none; width: 5.5rem; height: 5.5rem; }
.tz-w-hero-analog .tz-w-analog { width: 100%; height: 100%; }
.tz-w-hero-text { min-width: 0; }
.tz-w-hero-time { font-size: clamp(2.2rem, 10vw, 3.6rem); font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.tz-w-hero-date { font-size: 1.05rem; font-weight: 600; margin-top: .35rem; }
.tz-w-hero-zone { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.tz-w-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1rem; }
.tz-w-toolbar .tz-add { flex: 1 1 18rem; }
.tz-w-reset { min-height: 44px; font-weight: 600; }
.tz-w-count { margin-bottom: .6rem; }
.tz-w-grid { list-style: none; padding: 0; margin: 0 0 .9rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.tz-w-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: .7rem .8rem .75rem; min-width: 0; }
.tz-w-card.tz-w-night { background: var(--surface-2); }
.tz-w-head { display: flex; align-items: flex-start; gap: .5rem; }
.tz-w-namewrap { flex: 1 1 auto; min-width: 0; }
.tz-w-name { font-size: 1.02rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.tz-w-country { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.tz-w-dn { flex: none; width: 1.6rem; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--warn); }
.tz-w-night .tz-w-dn { color: var(--brand-2); }
.tz-w-rm { margin: -.2rem -.3rem 0 0; border-color: transparent; }
.tz-w-timerow { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 .3rem; }
.tz-w-analog { width: 2.9rem; height: 2.9rem; flex: none; }
.tz-w-face { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.tz-w-night .tz-w-face { fill: var(--surface-2); }
.tz-w-tick { stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }
.tz-w-hh { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.tz-w-mh { stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.tz-w-sh { stroke: var(--bad); stroke-width: .9; stroke-linecap: round; }
.tz-w-pin { fill: var(--bad); }
.tz-w-time { font-size: 1.85rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tz-w-s { font-size: 1rem; font-weight: 600; color: var(--muted); }
.tz-w-day { font-size: .86rem; font-weight: 600; }
.tz-w-day-next, .tz-w-day-prev { color: var(--brand-2); }
.tz-w-rel { font-size: .84rem; color: var(--ink); }
.tz-w-dst { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
@media (prefers-reduced-motion: reduce) { .tz-w-sh { display: none; } }
.tz-row-rel:empty { display: none; }

/* ===== Word unscrambler (wu-*) ===== */
/* Word unscrambler (.wu-) */
.wu-status { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; min-height: 1.2em; }
.wu-status.wu-busy::before { content: ""; width: .9rem; height: .9rem; border: 2px solid var(--line); border-top-color: var(--brand);
    border-radius: 50%; animation: wu-spin .8s linear infinite; }
@keyframes wu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wu-status.wu-busy::before { animation: none; border-color: var(--brand); } }
.wu-label { font-weight: 600; }
.wu-input-row { display: flex; gap: .4rem; align-items: stretch; }
.wu-input { flex: 1 1 auto; min-width: 0; font-size: 1.35rem; letter-spacing: .12em; font-family: var(--mono); text-transform: lowercase;
    min-height: 52px; padding: .5rem .8rem; }
.wu-input::placeholder { letter-spacing: normal; font-family: inherit; font-size: 1rem; text-transform: none; }
.wu-icon-btn { flex: 0 0 auto; min-width: 52px; min-height: 52px; font-size: 1.25rem; font-weight: 700; line-height: 1; padding: 0 .6rem; }
.wu-hint { font-size: .85rem; color: var(--muted); margin: .45rem 0 0; }
.wu-examples { white-space: nowrap; }
.wu-ex { padding: 0 .2rem; font-size: .85rem; font-family: var(--mono); vertical-align: baseline; min-height: 0; }
.wu-mode { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding: 0; border: 0; min-width: 0; }
.wu-mode .btn { flex: 1 1 12rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center;
    white-space: normal; line-height: 1.25; }
.wu-filters { margin: 1rem 0 0; padding: 0; border: 0; min-width: 0; }
.wu-legend { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; float: none; }
.wu-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.wu-grid .form-label { font-size: .85rem; margin-bottom: .25rem; line-height: 1.25; overflow-wrap: anywhere; }
.wu-grid .form-control, .wu-grid .form-select { font-size: 1rem; min-height: 44px; }
.wu-grid .form-control { font-family: var(--mono); text-transform: lowercase; }
@media (max-width: 767.98px) {
    .wu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wu-grid > div:last-child { grid-column: 1 / -1; }
}
.wu-go { width: 100%; margin-top: 1rem; min-height: 48px; }
.wu-msg { margin-top: .9rem; font-size: .92rem; color: var(--muted); }
.wu-msg.wu-msg-err { color: var(--bad); }
.wu-out:not(:empty) { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.wu-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; align-items: baseline; font-weight: 650;
    font-size: 1.05rem; margin: 0 0 .6rem; }
.wu-key { font-size: .82rem; font-weight: 400; color: var(--muted); }
.wu-empty { color: var(--muted); margin: 0; }
.wu-group { margin-bottom: 1rem; }
.wu-group-h { font-size: .95rem; font-weight: 650; margin: 0 0 .45rem; display: flex; align-items: center; gap: .5rem; }
.wu-count { font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
    border-radius: 999px; padding: .05rem .55rem; font-variant-numeric: tabular-nums; }
.wu-words { display: flex; flex-wrap: wrap; gap: .35rem; }
.wu-word { font-family: var(--mono); font-size: 1rem; line-height: 1.2; padding: .5rem .65rem; min-height: 40px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; letter-spacing: .02em; }
.wu-word:hover { border-color: var(--brand); color: var(--brand); }
.wu-word:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wu-word.is-copied { background: var(--brand); border-color: var(--brand); color: #fff; }
.wu-word.is-copied .wu-blank { color: #fff; background: transparent; }
.wu-blank { color: var(--bad); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.wu-key .wu-blank { font-family: var(--mono); font-size: .95rem; }
.wu-more { margin-top: .5rem; min-height: 40px; }
.wu-copied { font-size: .85rem; color: var(--ok); min-height: 1.3em; margin: .4rem 0 0; }
.wu-foot { font-size: .8rem; color: var(--muted); margin: .25rem 0 0; }

/* ===== Yes or no wheel (yn-*) ===== */
/* Yes or No Wheel (prefix .yn-) */
.yn .rc-head, .yn-tally .rc-head { flex-wrap: wrap; gap: .5rem; }
.yn .rc-head h2, .yn-tally .rc-head h2 { display: flex; align-items: center; gap: .45rem; }
.yn-switch { font-size: .92rem; min-height: 1.6rem; display: flex; align-items: center; }
.yn-switch.form-switch { padding-left: 3.3rem; }
.yn-switch .form-check-input { width: 2.75rem; height: 1.5rem; margin-top: 0; margin-left: -3.3rem; cursor: pointer; flex-shrink: 0; }
.yn-switch .form-check-label { cursor: pointer; padding-left: .3rem; }
.yn-stage { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.yn-q { width: 100%; max-width: 420px; }
.yn-q .form-control { font-size: 1rem; min-height: 44px; }
.yn-wrap { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1 / 1; container-type: inline-size; }
.yn-wrap canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; cursor: pointer; }
.yn.is-spinning .yn-wrap canvas { cursor: default; }
.yn-pointer { position: absolute; left: 50%; top: -2px; transform: translateX(-50%); width: 0; height: 0; border-left: 4.6cqi solid transparent; border-right: 4.6cqi solid transparent; border-top: 9cqi solid var(--ink); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); z-index: 2; }
.yn-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 17cqi; height: 17cqi; border-radius: 50%; border: .9cqi solid var(--surface); background: var(--ink); color: var(--surface); font-size: 7cqi; line-height: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); z-index: 2; padding: 0; display: flex; align-items: center; justify-content: center; }
.yn-hub:disabled { opacity: 1; cursor: default; }
.yn-odds { margin: 0; font-size: .9rem; color: var(--muted); text-align: center; font-weight: 600; overflow-wrap: anywhere; }
.yn-odds.yn-odds-weighted { color: var(--warn); }
.yn-result { width: 100%; max-width: 440px; text-align: center; min-height: 8.2rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.yn-asked { margin: 0 0 .15rem; color: var(--muted); font-size: .95rem; font-style: italic; overflow-wrap: anywhere; min-height: 0; }
.yn-asked:empty { display: none; }
.yn-main { margin: 0; font-size: clamp(2.4rem, 12vw, 3.6rem); font-weight: 850; line-height: 1.05; letter-spacing: .02em; color: var(--ink); overflow-wrap: anywhere; }
.yn-main.yn-yes { color: var(--ok); }
.yn-main.yn-no { color: var(--bad); }
.yn-main.yn-maybe { color: var(--warn); }
.yn-sub { margin: .3rem 0 0; color: var(--ink); font-size: .95rem; min-height: 1.4rem; overflow-wrap: anywhere; }
.yn-note { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.yn-note:empty { display: none; }
.yn-series { list-style: none; padding: 0; margin: .45rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.yn-dot { min-width: 3.2rem; padding: .2rem .55rem; border-radius: 999px; border: 2px dashed var(--line); color: var(--muted); font-weight: 700; font-size: .85rem; line-height: 1.3; }
.yn-dot-yes { border: 2px solid var(--ok); color: var(--ok); }
.yn-dot-no { border: 2px solid var(--bad); color: var(--bad); }
.yn-spin { min-width: min(16rem, 100%); min-height: 54px; font-size: 1.2rem; font-weight: 700; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.yn-hint { font-size: .85rem; color: var(--muted); margin: 0; text-align: center; }
.yn-side { display: flex; flex-direction: column; gap: 1rem; }
.yn-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.yn-legend { font-size: .95rem; font-weight: 650; margin-bottom: .4rem; float: none; width: auto; padding: 0; }
.yn-seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.yn-seg .btn { min-height: 44px; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; white-space: normal; line-height: 1.2; }
.yn-seg .btn-check:focus-visible + .btn { outline: 3px solid var(--brand); outline-offset: 2px; }
.yn-seg .btn-check:disabled + .btn { opacity: .45; }
.yn-weights { margin-top: .6rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: .5rem; }
.yn-wrow { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 4.2rem; align-items: center; gap: .5rem; }
.yn-wrow[hidden] { display: none; }
.yn-wrow label { font-weight: 600; display: flex; align-items: center; gap: .45rem; min-width: 0; overflow-wrap: anywhere; }
.yn-wrow .form-control { font-size: 1rem; min-height: 44px; text-align: center; }
.yn-wrow output { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.yn-swatch { width: .9rem; height: .9rem; border-radius: 3px; flex-shrink: 0; }
.yn-sw-yes { background: #15803d; }
.yn-sw-no { background: #dc2626; }
.yn-sw-maybe { background: #f59e0b; }
.yn-series-odds { margin: 0; font-weight: 650; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .8rem; }
.yn-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.yn-bar span { display: block; height: 100%; width: 0; transition: width .3s ease; }
.yn-bar-yes { background: #15803d; }
.yn-bar-no { background: #dc2626; }
.yn-bar-maybe { background: #f59e0b; }
.yn-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .9rem 0 0; }
.yn-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); padding: .6rem .75rem; min-width: 0; }
.yn-stat dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.yn-stat dd { margin: .1rem 0 0; color: var(--ink); overflow-wrap: anywhere; }
.yn-stat dd b { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.yn-stat dd small { color: var(--muted); }
.yn-stat-yes { border-left: 4px solid #15803d; }
.yn-stat-no { border-left: 4px solid #dc2626; }
.yn-stat-maybe { border-left: 4px solid #f59e0b; }
.yn-hist-title { font-size: .95rem; font-weight: 650; margin: 1rem 0 .45rem; }
.yn-hist { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.yn-chip { padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; }
.yn-chip-yes { background: #15803d; }
.yn-chip-no { background: #dc2626; }
.yn-chip-maybe { background: #f59e0b; color: #111827; }
.yn-empty { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 575.98px) {
    .yn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .yn-bar span { transition: none; } }
