/* ==========================================================================
   Tooliffy – site styles
   ========================================================================== */

:root {
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-2: #cbd5e1;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-tint: #f5f7ff;
    --success: #16a34a;
    --danger: #dc2626;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 10px 24px -6px rgba(15, 23, 42, .10);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .18);
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --tool: var(--brand);
}

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

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

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

img, svg { display: block; max-width: 100%; }
.icon { flex-shrink: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--text); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }

.text-gradient {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 55%, #db2777 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.25rem; border-radius: 12px; border: 1px solid transparent;
    font-weight: 700; font-size: .975rem; line-height: 1.2; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-tool { background: var(--tool); color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--tool) 80%, transparent); }
.btn-tool:hover { background: color-mix(in srgb, var(--tool) 88%, #000); color: #fff; }
.btn-ghost { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); background: var(--bg-soft); }
.btn-sm { padding: .45rem .8rem; font-size: .875rem; border-radius: 10px; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn-xl { padding: 1.05rem 2rem; font-size: 1.125rem; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }

.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.logo-img { display: block; height: 36px; width: auto; }
.site-footer .logo-img { height: 34px; }
.logo-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 6px 14px -6px var(--brand);
}

.main-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .55rem .85rem; border-radius: 10px; border: 0; background: none;
    color: var(--text-2); font-weight: 600; font-size: .95rem; cursor: pointer;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0; width: 360px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: .5rem; opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.nav-dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.nav-tool { display: flex; gap: .75rem; align-items: center; padding: .6rem; border-radius: 12px; color: var(--text); }
.nav-tool:hover { background: var(--bg-soft); color: var(--text); }
.nav-tool strong { display: block; font-size: .95rem; }
.nav-tool small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }

.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .45rem; cursor: pointer; }

/* ---------- Tool icons & cards ---------- */

.tool-icon {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    color: var(--tool); background: color-mix(in srgb, var(--tool) 12%, #fff);
}
.tool-icon-sm { width: 38px; height: 38px; border-radius: 10px; }
.tool-icon-lg { width: 64px; height: 64px; border-radius: 18px; color: #fff; background: var(--tool); box-shadow: 0 12px 24px -10px var(--tool); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.tool-card {
    position: relative; display: flex; flex-direction: column; gap: .2rem;
    padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    color: var(--text); box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--tool) 40%, var(--line)); color: var(--text); }
.tool-card .tool-icon { margin-bottom: .9rem; }
.tool-card h3 { font-size: 1.15rem; margin: 0 0 .25rem; }
.tool-card p { color: var(--muted); font-size: .925rem; margin: 0 0 1rem; flex: 1; }
.tool-card-go { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .875rem; color: var(--tool); }
.tool-card:hover .tool-card-go .icon { transform: translateX(3px); }
.tool-card-go .icon { transition: transform .2s ease; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; padding: 88px 0 72px; text-align: center; background: linear-gradient(180deg, var(--bg-tint), #fff 85%); }
.hero-glow {
    position: absolute; inset: -40% -10% auto; height: 640px; pointer-events: none;
    background:
        radial-gradient(closest-side at 30% 40%, rgba(124, 58, 237, .16), transparent),
        radial-gradient(closest-side at 70% 30%, rgba(79, 70, 229, .14), transparent),
        radial-gradient(closest-side at 55% 70%, rgba(219, 39, 119, .08), transparent);
}
.hero-inner { position: relative; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .9rem; margin-bottom: 1.4rem;
    border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    font-size: .85rem; font-weight: 600; color: var(--text-2);
}
.eyebrow .icon { color: var(--success); }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.9rem); font-weight: 800; max-width: 860px; margin: 0 auto .5em; letter-spacing: -.035em; }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 680px; margin: 0 auto 2rem; }

.hero-search {
    display: flex; align-items: center; gap: .75rem; max-width: 560px; margin: 0 auto;
    padding: .4rem .4rem .4rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow); color: var(--muted); cursor: text;
}
.hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: .75rem 0; font-size: 1.05rem; background: transparent; color: var(--text); }

.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 2rem; list-style: none; padding: 0; margin: 1.75rem 0 0; color: var(--muted); font-size: .95rem; }
.hero-stats strong { color: var(--text); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section-tools { padding-top: 24px; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: .3rem; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.section-head-center { text-align: center; }
.search-empty { text-align: center; color: var(--muted); padding: 2rem 0; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.feature { padding: 1.6rem; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); }
.feature-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); margin-bottom: 1rem; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--muted); font-size: .95rem; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; list-style: none; padding: 0; margin: 0; counter-reset: none; }
.steps li { text-align: center; padding: 1.75rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--muted); margin: 0; }
.step-num {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800;
}

/* ---------- FAQ ---------- */

.faq { display: grid; gap: .75rem; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.25rem; transition: border-color .2s ease, box-shadow .2s ease; }
.faq details[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.faq summary {
    list-style: none; cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; position: relative;
    font-weight: 700; font-size: 1.02rem; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: ""; position: absolute; right: .25rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--text-2); margin: 0 0 1.1rem; }

/* ---------- Ads ---------- */

.ad { margin: 2rem auto; text-align: center; min-height: 90px; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.ad-placeholder {
    display: grid; place-items: center; border: 2px dashed var(--line-2); border-radius: var(--radius);
    color: var(--muted); font-size: .85rem; background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f4f6f9 10px, #f4f6f9 20px);
}

/* ---------- Tool page ---------- */

.tool-hero { padding: 32px 0 28px; background: linear-gradient(180deg, color-mix(in srgb, var(--tool) 7%, #fff), #fff); }
.breadcrumb { display: flex; gap: .5rem; font-size: .875rem; color: var(--muted); margin-bottom: 1.25rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.tool-title { display: flex; align-items: center; gap: 1.25rem; }
.tool-title h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 .2rem; }
.tool-title p { color: var(--muted); font-size: 1.08rem; margin: 0; }

.tool-wrap { padding-bottom: 8px; }
.tool-app { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.tool-error { margin: 1rem 0; padding: .8rem 1rem; border-radius: 12px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-size: .925rem; }

.stage-upload { padding: 1.25rem; }
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    min-height: 330px; padding: 2.5rem 1.5rem; text-align: center; border-radius: 18px;
    border: 2px dashed color-mix(in srgb, var(--tool) 35%, var(--line));
    background: color-mix(in srgb, var(--tool) 4%, #fff);
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.dropzone.dragover { background: color-mix(in srgb, var(--tool) 10%, #fff); border-color: var(--tool); transform: scale(1.005); }
.dropzone-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: var(--tool); background: color-mix(in srgb, var(--tool) 12%, #fff); }
.dropzone-hint { margin: 0; color: var(--muted); }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 1rem 0 0; color: var(--muted); font-size: .875rem; }
.privacy-note .icon { color: var(--success); }

.stage-work { display: grid; grid-template-columns: 1fr 340px; min-height: 420px; }
.work-main { padding: 1.5rem; background: var(--bg-soft); min-width: 0; }
.work-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.work-count { margin: 0; font-weight: 700; }
.work-actions { display: flex; gap: .5rem; }
.work-hint { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; margin: 0 0 1rem; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.file-card {
    position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .65rem;
    box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.file-card.sortable { cursor: grab; }
.file-card.sortable:active { cursor: grabbing; }
.file-card:hover { box-shadow: var(--shadow); }
.file-card.sortable-ghost { opacity: .35; }
.file-card.sortable-chosen { box-shadow: var(--shadow-lg); }
.file-thumb {
    display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden;
    background: var(--bg-soft); border: 1px solid var(--line);
}
.file-thumb img, .file-thumb canvas { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.file-thumb .thumb-loading { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--tool); border-radius: 50%; animation: spin .8s linear infinite; }
.file-name { margin: .55rem 0 0; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { margin: 0; font-size: .75rem; color: var(--muted); }
.file-badge {
    position: absolute; top: .4rem; left: .4rem; z-index: 2; min-width: 24px; height: 24px; padding: 0 .4rem;
    display: grid; place-items: center; border-radius: 8px; background: var(--text); color: #fff; font-size: .75rem; font-weight: 700;
}
.file-remove {
    position: absolute; top: .4rem; right: .4rem; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px;
    border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--text-2); cursor: pointer;
    opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.file-card:hover .file-remove, .file-remove:focus-visible { opacity: 1; }
.file-remove:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Page picker (split / pdf-to-jpg) */
.file-grid.pages { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.page-card { cursor: default; }
.pages.selectable .page-card { cursor: pointer; }
.pages.selectable .page-card:hover { border-color: color-mix(in srgb, var(--tool) 45%, var(--line)); }
.page-card.selected { border-color: var(--tool); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool) 25%, transparent); }
.page-card .page-check {
    position: absolute; top: .4rem; right: .4rem; z-index: 2; width: 24px; height: 24px; border-radius: 7px;
    display: grid; place-items: center; border: 2px solid var(--line-2); background: #fff; color: transparent;
}
.page-card.selected .page-check { background: var(--tool); border-color: var(--tool); color: #fff; }
.pages:not(.selectable) .page-check { display: none; }
.page-card.in-range { border-color: color-mix(in srgb, var(--tool) 60%, var(--line)); }
.page-card.in-range .file-badge { background: var(--tool); }

.work-side { padding: 1.5rem; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: .75rem; }
.work-side h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
.work-side #runBtn { margin-top: auto; }

.option-group { border: 0; padding: 0; margin: 0 0 .5rem; display: grid; gap: .5rem; }
.option-group legend { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; padding: 0; }
.option-card {
    display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .9rem; border: 1.5px solid var(--line); border-radius: 12px;
    cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.option-card:hover { border-color: var(--line-2); }
.option-card:has(input:checked) { border-color: var(--tool); background: color-mix(in srgb, var(--tool) 6%, #fff); }
.option-card input { margin-top: .25rem; accent-color: var(--tool); }
.option-card strong { display: flex; align-items: center; gap: .4rem; font-size: .95rem; }
.option-card small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.badge { font-style: normal; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: var(--tool); color: #fff; }

.segmented { display: flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: .5rem .4rem; border-radius: 9px; font-weight: 600; font-size: .875rem; color: var(--text-2); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.segmented input:checked + span { background: #fff; color: var(--tool); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tool) 40%, transparent); }

.option-field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; }
.option-field input { width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 10px; outline: 0; }
.option-field input:focus { border-color: var(--tool); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool) 18%, transparent); }
.option-field small { color: var(--muted); font-size: .8rem; }
.option-hint, .option-status { color: var(--muted); font-size: .85rem; margin: 0; }
.option-status strong { color: var(--text); }
.option-note { display: flex; gap: .65rem; padding: .9rem; border-radius: 12px; background: color-mix(in srgb, var(--tool) 6%, #fff); color: var(--text-2); font-size: .9rem; }
.option-note .icon { color: var(--tool); margin-top: .1rem; }
.option-note p { margin: 0; }

.stage-progress, .stage-done { padding: 4rem 1.5rem; text-align: center; min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 56px; height: 56px; border: 5px solid color-mix(in srgb, var(--tool) 15%, #fff); border-top-color: var(--tool); border-radius: 50%; animation: spin .9s linear infinite; margin-bottom: 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-progress h2, .stage-done h2 { font-size: 1.6rem; }
.progress { width: min(420px, 100%); height: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--tool), color-mix(in srgb, var(--tool) 60%, #fff)); border-radius: 999px; transition: width .25s ease; }
.progress-text { color: var(--muted); margin: .75rem 0 0; font-size: .925rem; }

.done-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--success); color: #fff; margin-bottom: 1.25rem; box-shadow: 0 0 0 10px #dcfce7; animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.done-summary { color: var(--muted); max-width: 520px; margin: 0 auto 1.75rem; font-size: 1.02rem; }
.done-summary strong { color: var(--text); }
.done-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.done-next { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); width: min(560px, 100%); }
.done-next p { margin: 0 0 .75rem; font-weight: 600; color: var(--muted); font-size: .9rem; }
.chip-row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-weight: 600; font-size: .875rem; background: #fff; }
.chip .icon { color: var(--tool); }
.chip:hover { border-color: var(--tool); color: var(--text); }

/* ---------- Content (tool pages, legal pages) ---------- */

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.prose { color: var(--text-2); font-size: 1.04rem; line-height: 1.75; overflow-wrap: break-word; }
.prose h2 { color: var(--text); font-size: 1.6rem; font-weight: 800; margin: 2.25rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--text); font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { color: var(--text); }

/* “How to use” steps: three cards with a glossy icon tile and a number badge. */
.howto-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; margin: 2.25rem 0 1.25rem; }
.howto-head:first-child { margin-top: 0; }
.prose .howto-head h2 { margin: 0; }
.howto-head p { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .3rem .75rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 600; }
.howto-steps { list-style: none; padding: 0 !important; margin: 0 0 2.25rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.howto-step {
    position: relative; margin: 0 !important; padding: 1.5rem 1.25rem 1.4rem;
    border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
    background: linear-gradient(180deg, color-mix(in srgb, var(--tool) 6%, #fff), #fff 55%);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.howto-step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--tool) 35%, var(--line)); }
/* A chevron joining each card to the next. */
.howto-step:not(:last-child)::after {
    content: ""; position: absolute; z-index: 1; top: 2.6rem; right: calc(-.625rem - 13px);
    width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.howto-icon {
    position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 1.1rem; border-radius: 18px; color: #fff;
    background: linear-gradient(140deg, color-mix(in srgb, var(--tool) 78%, #fff) 0%, var(--tool) 45%, color-mix(in srgb, var(--tool) 70%, #1e1b4b) 100%);
    box-shadow: 0 12px 24px -10px var(--tool), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
/* Glossy highlight across the top of the tile. */
.howto-icon::before { content: ""; position: absolute; inset: 1px 1px 50% 1px; border-radius: 17px 17px 40% 40%; background: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0)); pointer-events: none; }
.howto-icon .icon { position: relative; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.howto-num {
    position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; color: var(--tool); font-size: .75rem; font-weight: 800; line-height: 1;
    border: 2px solid color-mix(in srgb, var(--tool) 30%, #fff); box-shadow: var(--shadow-sm);
}
.prose .howto-step h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.prose .howto-step p { margin: 0; font-size: .93rem; line-height: 1.6; color: var(--muted); }

@media (max-width: 760px) {
    .howto-steps { grid-template-columns: 1fr; gap: .9rem; }
    .howto-step { display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 1rem; align-items: start; padding: 1.15rem; }
    .howto-icon { grid-row: span 2; margin: 0; }
    .prose .howto-step h3 { margin-top: .15rem; }
    /* Join the cards with a short vertical line instead of a chevron. */
    .howto-step:not(:last-child)::after { top: auto; bottom: calc(-.45rem - 9px); right: auto; left: calc(1.15rem + 28px); width: 2px; height: 18px; border: 0; border-radius: 2px; box-shadow: none; background: color-mix(in srgb, var(--tool) 35%, var(--line)); }
}

.feature-list { display: grid; gap: 1rem; margin: 1.75rem 0; }
.feature-item { display: flex; gap: .9rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.feature-item h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.feature-item p { margin: 0; font-size: .95rem; }
.feature-check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--tool); color: #fff; flex-shrink: 0; }

.content-side { position: sticky; top: 92px; display: grid; gap: 1rem; }
.side-card { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.side-card h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.side-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.side-card > .icon { color: var(--brand); margin-bottom: .75rem; }
.side-card-privacy { background: linear-gradient(135deg, var(--brand-soft), #f5f3ff); border-color: #e0e7ff; }
.side-tool { display: flex; align-items: center; gap: .75rem; padding: .6rem; margin: 0 -.6rem; border-radius: 12px; color: var(--text); }
.side-tool:hover { background: var(--bg-soft); color: var(--text); }
.side-tool strong { display: block; font-size: .95rem; }
.side-tool small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }

.page-hero { padding: 48px 0 40px; background: linear-gradient(180deg, var(--bg-tint), #fff); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 800; margin-bottom: .3rem; }
.page-hero p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.section-page { padding-top: 48px; }
.prose-page h2 { font-size: 1.35rem; margin-top: 2rem; }

.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0 1rem; }
.value-grid > div { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.value-grid .icon { color: var(--brand); margin-bottom: .6rem; }
.value-grid h3 { margin: 0 0 .2rem; }
.value-grid p { margin: 0; font-size: .93rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); color: var(--text); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

/* ---------- Contact form ---------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; align-items: start; }
.contact-side { display: grid; gap: 1rem; }
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-field label { display: block; font-weight: 700; font-size: .92rem; color: var(--text); margin-bottom: .35rem; }
.form-field input, .form-field textarea, .form-field select {
    width: 100%; padding: .8rem .95rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--tool); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tool) 15%, transparent); }
.field-error { color: var(--danger); font-size: .85rem; margin: .35rem 0 0; }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; }
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }
.alert { display: flex; gap: .75rem; padding: 1rem 1.15rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.alert p { margin: .15rem 0 0; font-size: .93rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-success strong { color: #14532d; }

/* ---------- Admin inbox ---------- */

.inbox-item { padding: 1.25rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.inbox-new { border-left: 4px solid var(--brand); }
.inbox-item header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.inbox-item header strong { display: block; font-size: 1.05rem; }
.inbox-item header .muted { font-size: .875rem; }
.inbox-item p { color: var(--text-2); overflow-wrap: anywhere; }
.inbox-item footer { display: flex; gap: .5rem; }
.pager { display: flex; justify-content: space-between; margin-top: 1.5rem; }

/* ---------- Error page ---------- */

.error-page { text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; line-height: 1; margin: 0 0 .5rem; letter-spacing: -.05em; }
.error-page h1 { font-size: 2rem; }
.error-page > .container > p { color: var(--muted); }
.tool-grid-compact { margin: 2rem 0; text-align: left; }

/* ---------- Footer ---------- */

.site-footer { background: #0b1120; color: #94a3b8; padding: 64px 0 0; margin-top: 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; padding-bottom: 40px; border-bottom: 1px solid #1e293b; margin-bottom: 40px; }
.footer-links-inline { display: flex; gap: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2rem; padding-bottom: 48px; }
.site-footer h3 a { color: #fff; font-size: inherit; }
.footer-more { color: #a5b4fc !important; font-weight: 600; }
.site-footer .logo { color: #fff; margin-bottom: 1rem; }
.footer-brand p { font-size: .93rem; max-width: 320px; }
.footer-privacy { display: inline-flex; align-items: center; gap: .4rem; color: #cbd5e1; }
.footer-privacy .icon { color: #4ade80; }
.site-footer h3 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.site-footer a { color: #94a3b8; font-size: .93rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.5rem 20px; border-top: 1px solid #1e293b; font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* ---------- Cookie notice ---------- */

.cookie-notice {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto;
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem;
    background: #0f172a; color: #cbd5e1; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .9rem;
}
.cookie-notice p { margin: 0; }
.cookie-notice a { color: #fff; text-decoration: underline; }

/* ---------- Mega menu, home and category pages ---------- */

.mega-menu { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); gap: 1rem; width: min(1200px, calc(100vw - 40px)); left: 50%; transform: translate(-50%, 6px); padding: 1.25rem; }
.nav-mega { position: static; }
.nav-mega:hover .mega-menu, .nav-mega.open .mega-menu { transform: translate(-50%, 0); }
.header-inner { position: relative; }
.mega-title { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: .9rem; color: var(--text); margin-bottom: .5rem; }
.mega-title:hover { color: var(--tool); }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col li a { display: block; padding: .3rem .4rem; margin: 0 -.4rem; border-radius: 8px; color: var(--text-2); font-size: .9rem; }
.mega-col li a:hover { background: var(--bg-soft); color: var(--text); }
.tool-icon-xs { width: 28px; height: 28px; border-radius: 8px; }

.heading-icon { display: inline-block; vertical-align: -3px; color: #f59e0b; fill: #fde68a; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.tool-section { margin-top: 3.5rem; }
.category-intro { max-width: 820px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.category-card { display: flex; gap: 1rem; align-items: center; padding: 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: box-shadow .2s ease, transform .2s ease; }
.category-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.category-card strong { display: block; }
.category-card small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }

.side-links { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .1rem; }
.side-links a { display: block; padding: .35rem 0; color: var(--text-2); font-size: .93rem; }
.side-links a:hover { color: var(--brand); }
.side-all { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .875rem; }

.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Extra file-tool options and results ---------- */

.range { width: 100%; accent-color: var(--tool); }
.range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.input-suffix { display: flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.input-suffix:focus-within { border-color: var(--tool); }
.input-suffix input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.input-suffix span { display: grid; place-items: center; padding: 0 .9rem; background: var(--bg-soft); color: var(--muted); font-weight: 700; font-size: .875rem; }
.quick-picks { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .3rem; }
.pick { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; font-weight: 600; color: var(--text-2); cursor: pointer; }
.pick:hover { border-color: var(--tool); color: var(--tool); }
.option-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.check-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; color: var(--text-2); cursor: pointer; margin: .25rem 0; }
.check-row input { accent-color: var(--tool); width: 16px; height: 16px; }

.done-preview { margin: 0 auto 1.5rem; max-width: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.done-preview img { width: 100%; max-height: 420px; object-fit: contain; }
.done-files { list-style: none; padding: 0; margin: 1.75rem auto 0; width: min(640px, 100%); text-align: left; border: 1px solid var(--line); border-radius: var(--radius); max-height: 320px; overflow-y: auto; }
.done-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btn" "meta btn"; column-gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); align-items: center; }
.done-files li:last-child { border-bottom: 0; }
.done-file-name { grid-area: name; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-file-meta { grid-area: meta; color: var(--muted); font-size: .8rem; }
.done-files .btn { grid-area: btn; }

/* ---------- Widget tools (calculators, converters, counters) ---------- */

.tool-widget { padding: 1.75rem; }
.widget-body { display: grid; gap: 1.5rem; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

.tabs { display: flex; gap: .35rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 5px; flex-wrap: wrap; }
.tabs-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.tab { flex: 1 0 auto; border: 0; background: none; padding: .6rem 1rem; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--tool); box-shadow: var(--shadow-sm); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.stat { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.stat strong { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-hero { background: color-mix(in srgb, var(--tool) 7%, #fff); border-color: color-mix(in srgb, var(--tool) 25%, var(--line)); }
.stat-hero strong { font-size: 2rem; color: var(--tool); }

.editor { border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.editor:focus-within { border-color: var(--tool); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tool) 12%, transparent); }
.editor textarea { display: block; width: 100%; min-height: 260px; padding: 1.1rem 1.2rem; border: 0; outline: 0; resize: vertical; font-size: 1.02rem; line-height: 1.7; }
.editor-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem .9rem; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: .875rem; }
.editor-actions { display: flex; gap: .4rem; }

.widget-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.panel h2 { font-size: 1.05rem; margin-bottom: 1rem; }
.limits { display: grid; gap: .8rem; }
.limit-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
.limit-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.limit-bar span { display: block; height: 100%; width: 0; background: var(--success); border-radius: 999px; transition: width .2s ease; }
.limit.near .limit-bar span { background: #f59e0b; }
.limit.over .limit-bar span { background: var(--danger); }
.limit.over .limit-count { color: var(--danger); }
.density { width: 100%; font-size: .9rem; }
.density th, .density td { padding: .45rem .5rem; }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem; align-items: start; }
.calc-inputs { display: grid; gap: 1rem; }
/* Let grid columns shrink below the inputs' default width on narrow phones. */
.calc-layout > *, .form-row > *, .form-field input, .form-field select { min-width: 0; }
.calc-result { padding: 1.5rem; border-radius: 18px; background: color-mix(in srgb, var(--tool) 6%, #fff); border: 1px solid color-mix(in srgb, var(--tool) 20%, var(--line)); min-height: 100%; }
.calc-placeholder { color: var(--muted); margin: 2rem 0; text-align: center; }
.result-label { margin: 0 0 .25rem; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result-big { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--tool); margin: 0 0 1.25rem; }
.result-big small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-right: .35rem; }
.result-date { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.result-facts { display: grid; gap: .4rem; margin-top: 1rem; }
.result-facts p { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--text-2); }
.result-facts .icon { color: var(--tool); }
.link-btn { border: 0; background: none; padding: .35rem 0 0; color: var(--tool); font-weight: 700; font-size: .85rem; cursor: pointer; }

.pct-list { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.pct-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pct-card h2 { font-size: 1.02rem; margin-bottom: .9rem; }
.pct-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 600; color: var(--text-2); }
.pct-row input { width: 110px; padding: .6rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; outline: 0; font-weight: 700; }
.pct-row input:focus { border-color: var(--tool); }
.pct-answer { margin: .9rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.pct-answer strong { font-size: 1.5rem; font-weight: 800; color: var(--tool); }
.pct-formula { font-size: .85rem; color: var(--muted); }

.convert-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.convert-side { display: grid; gap: .5rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-soft); }
.convert-label { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.convert-input { width: 100%; border: 0; background: transparent; outline: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.convert-output { display: block; color: var(--tool); white-space: nowrap; }
.convert-side select { width: 100%; padding: .6rem .75rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; outline: 0; }
.convert-side select:focus { border-color: var(--tool); }
.convert-unit { margin: 0; font-weight: 700; color: var(--text-2); }
.swap-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--tool); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .2s ease; font-size: 1.5rem; font-weight: 800; }
.swap-btn:hover { transform: rotate(180deg); }
.swap-static { cursor: default; }
.swap-static:hover { transform: none; }
.convert-result { margin: 0; text-align: center; font-size: 1.1rem; color: var(--text-2); }
.convert-result strong { color: var(--text); }

.formula-box { padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: 1.5rem; }
.formula-box p { margin: 0; }
.formula { font-size: 1.25rem; font-weight: 800; color: var(--text); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.conversion-table { max-height: 520px; overflow-y: auto; margin-bottom: 1rem; }
.conversion-table tbody tr:nth-child(even) td { background: var(--bg-soft); }

.fx-table-wrap h2 { font-size: 1.05rem; }
.fx-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fx-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.fx-table td { padding: .5rem .8rem; }
.fx-table td:last-child { text-align: right; font-weight: 700; }
.fx-table tr:nth-child(even) td { background: var(--bg-soft); }
.fx-meta { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; }

.qr-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.qr-form { display: grid; gap: 1rem; }
.qr-fields { display: grid; gap: 1rem; }
.qr-fields textarea { min-height: 90px; }
.qr-style { border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem 1rem 1rem; }
.qr-style summary { cursor: pointer; font-weight: 700; padding: .75rem 0; }
.qr-style input[type="color"] { padding: .25rem; height: 46px; cursor: pointer; }
.qr-preview { position: sticky; top: 92px; display: grid; gap: .75rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-soft); }
.qr-canvas-wrap { background: #fff; border-radius: 14px; padding: 10px; border: 1px solid var(--line); }
.qr-canvas-wrap canvas { width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-empty { opacity: .15; filter: blur(1px); }
.qr-actions { display: grid; gap: .5rem; }
.qr-preview .privacy-note { margin: 0; }

/* ---------- Password generator ---------- */

.pw-output { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border: 2px solid color-mix(in srgb, var(--tool) 30%, var(--line)); border-radius: 18px; background: color-mix(in srgb, var(--tool) 4%, #fff); }
.pw-value { flex: 1; min-width: 0; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(1.15rem, 2.6vw, 1.6rem); font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; color: var(--text); }
.pw-value.pw-empty { font-family: var(--font); font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.pw-actions { display: flex; gap: .5rem; }
.pw-strength p { margin: .4rem 0 0; font-size: .9rem; }
.pw-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .25s ease, background-color .25s ease; }
.pw-strength.weak .pw-bar span { background: var(--danger); }
.pw-strength.fair .pw-bar span { background: #f59e0b; }
.pw-strength.strong .pw-bar span { background: #22c55e; }
.pw-strength.very-strong .pw-bar span { background: var(--success); }
.pw-options { display: grid; gap: .35rem; }
.pw-more-head { align-items: center; margin-bottom: .75rem; }
.pw-more-head h2 { margin: 0; font-size: 1.05rem; }
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pw-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.pw-list code { font-size: .95rem; overflow-wrap: anywhere; }

/* ---------- BMI ---------- */

.bmi-cat { font-weight: 800 !important; }
.bmi-cat.under { color: #0284c7 !important; }
.bmi-cat.healthy { color: var(--success) !important; }
.bmi-cat.over { color: #d97706 !important; }
.bmi-cat.obese { color: var(--danger) !important; }
.bmi-scale { position: relative; margin: .5rem 0 1.5rem; }
/* Segments sized to a 15–40 BMI scale: 3.5, 6.5, 5 and 10 points. */
.bmi-track { display: grid; grid-template-columns: 14fr 26fr 20fr 40fr; height: 12px; border-radius: 999px; overflow: hidden; }
.bmi-seg.under { background: #7dd3fc; }
.bmi-seg.healthy { background: #4ade80; }
.bmi-seg.over { background: #fbbf24; }
.bmi-seg.obese { background: #f87171; }
.bmi-marker { position: absolute; top: -5px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; border: 4px solid var(--text); box-shadow: var(--shadow-sm); transition: left .3s ease; }
.bmi-ticks { position: relative; height: 1.2rem; margin-top: .35rem; font-size: .75rem; color: var(--muted); }
.bmi-ticks span { position: absolute; transform: translateX(-50%); }
.bmi-ticks span:nth-child(1) { left: 0; transform: none; }
.bmi-ticks span:nth-child(2) { left: 14%; }
.bmi-ticks span:nth-child(3) { left: 40%; }
.bmi-ticks span:nth-child(4) { left: 60%; }
.bmi-ticks span:nth-child(5) { left: 100%; transform: translateX(-100%); }

/* ---------- Finance calculators ---------- */

.input-unit { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.input-unit:focus-within { border-color: var(--tool); }
.form-field .input-unit input { border: 0; border-radius: 0; box-shadow: none !important; flex: 1; min-width: 0; }
.form-field .input-unit select { width: auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--bg-soft); font-weight: 600; box-shadow: none !important; }
.fin-more { border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem 1rem 1rem; }
.fin-more summary { cursor: pointer; font-weight: 700; padding: .75rem 0; }
.fin-summary { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
/* Donut: --share is the principal / invested part, drawn from 12 o'clock. */
.donut {
    --share: 50%;
    position: relative; flex-shrink: 0; width: 132px; height: 132px; border-radius: 50%;
    background: conic-gradient(var(--tool) 0 var(--share), #fbbf24 var(--share) 100%);
}
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #fff; }
.donut span { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 30px; text-align: center; font-size: .78rem; font-weight: 700; color: var(--text-2); line-height: 1.25; }
.fin-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; flex: 1; min-width: 200px; }
.fin-legend li { display: flex; align-items: center; gap: .5rem; color: var(--text-2); font-size: .93rem; }
.fin-legend strong { margin-left: auto; color: var(--text); }
.fin-legend .fin-total { padding-top: .5rem; border-top: 1px solid var(--line); }
.dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.dot-a { background: var(--tool); }
.dot-b { background: #fbbf24; }
.fin-breakdown { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.fin-breakdown li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .93rem; color: var(--text-2); }
.fin-breakdown li:last-child { border-bottom: 0; }
.fin-breakdown strong { color: var(--text); }
.fin-breakdown .fin-total { background: var(--bg-soft); font-weight: 700; }
.fin-schedule { margin-top: 1.25rem; }
.fin-schedule summary { cursor: pointer; font-weight: 700; padding: .75rem 0; }
.fin-schedule .table-wrap { max-height: 420px; overflow-y: auto; }
.fin-schedule td, .fin-schedule th { white-space: nowrap; }
.fin-schedule tbody tr:nth-child(even) td { background: var(--bg-soft); }
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 2px; }
.bar span { display: block; width: 100%; }
.bar-a { background: var(--tool); border-radius: 0 0 2px 2px; }
.bar-b { background: #fbbf24; border-radius: 3px 3px 0 0; }
.chart-caption { font-size: .78rem; margin: .4rem 0 0; }
.pick.active { background: var(--tool); border-color: var(--tool); color: #fff; }

/* ---------- Generic calculator (widgets/calc) ---------- */

.calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.calc-grid .span-2 { grid-column: 1 / -1; }
.calc-grid .form-field label, .field-label { display: block; font-weight: 700; font-size: .9rem; color: var(--text); margin-bottom: .35rem; }
.calc-grid .form-field small { display: block; margin-top: .3rem; font-size: .78rem; line-height: 1.35; }
.input-affix { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.input-affix:focus-within { border-color: var(--tool); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tool) 15%, transparent); }
.form-field .input-affix input { border: 0; border-radius: 0; box-shadow: none !important; flex: 1; min-width: 0; padding-left: .7rem; }
.affix { display: grid; place-items: center; padding: 0 .8rem; background: var(--bg-soft); color: var(--muted); font-weight: 700; font-size: .875rem; white-space: nowrap; }
.affix:first-child { border-right: 1px solid var(--line); }
.affix:last-child { border-left: 1px solid var(--line); }
.calc-sub { margin: -.75rem 0 1.25rem; color: var(--text-2); font-weight: 600; }
.calc-note { font-size: .82rem; margin: .9rem 0 0; }
.calc-result .fin-breakdown { margin-top: .25rem; }
.calc-result .bar-chart { margin-top: 1.25rem; }
.calc-grid .segmented { flex-wrap: wrap; }
/* Scientific calculator */
.sci { max-width: 620px; margin: 0 auto; width: 100%; }
.sci-screen { padding: 1rem 1.15rem; border-radius: 18px; background: #0f172a; color: #e2e8f0; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .35); }
.sci-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.sci-angle { background: #1e293b; border-color: #334155; padding: 3px; }
.sci-angle span { color: #94a3b8; padding: .3rem .7rem; font-size: .78rem; }
.sci-angle input:checked + span { background: #334155; color: #fff; box-shadow: none; }
.sci-angle input { width: 1px; height: 1px; }
.sci-hint { font-size: .75rem; color: #64748b; }
.sci-input { width: 100%; border: 0; outline: 0; background: transparent; color: #fff; font: 600 1.5rem/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; text-align: right; padding: .25rem 0; caret-color: #a5b4fc; }
.sci-input::placeholder { color: #475569; }
.sci-result { display: block; min-height: 1.6em; text-align: right; font: 700 1.15rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; color: #a5b4fc; overflow-wrap: anywhere; }
.sci-result.sci-error { color: #fca5a5; font-family: var(--font); font-size: .95rem; }
.sci-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; }
.sci-key { padding: .8rem .2rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; font-size: .95rem; color: var(--text); cursor: pointer; transition: transform .08s ease, background-color .15s ease; box-shadow: 0 1px 0 var(--line); }
.sci-key:hover { background: var(--bg-soft); }
.sci-key:active { transform: translateY(1px); }
.sci-key.fn { background: var(--bg-soft); color: var(--text-2); font-size: .85rem; }
.sci-key.op { background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); font-size: 1.15rem; }
.sci-key.clear { background: #fef2f2; color: var(--danger); }
.sci-key.eq { background: var(--brand); color: #fff; border-color: var(--brand); font-size: 1.2rem; }
.sci-key.eq:hover { background: var(--brand-dark); }
.sci-key.wide { grid-column: span 2; }
.sci-history-panel h2 { font-size: 1rem; margin-bottom: .6rem; }
.sci-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.sci-history li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .7rem; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.sci-history li.muted { font-family: var(--font); cursor: default; border-style: dashed; }

/* GPA table */
/* Fixed narrow columns for grade, credits and remove; the course name takes the rest. */
.gpa-table { table-layout: fixed; }
.gpa-table th:nth-child(2) { width: 88px; }
.gpa-table th:nth-child(3) { width: 78px; }
.gpa-table th:nth-child(4) { width: 44px; }
.gpa-table th, .gpa-table td { padding: .45rem .35rem; vertical-align: middle; }
.widget-body > * { min-width: 0; }
@media (max-width: 480px) {
    .gpa-table th:nth-child(2) { width: 70px; }
    .gpa-table th:nth-child(3) { width: 58px; }
    .gpa-table th:nth-child(4) { width: 34px; }
    .gpa-table th, .gpa-table td { padding: .4rem .2rem; }
    .gpa-table input, .gpa-table select { padding: .45rem .35rem; font-size: .9rem; }
    .tool-widget { padding: .75rem; }
}
.gpa-table input, .gpa-table select { width: 100%; min-width: 0; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; outline: 0; }
.gpa-table input:focus, .gpa-table select:focus { border-color: var(--tool); }
.gpa-table .gpa-credits { max-width: 90px; }
.gpa-table .file-remove { position: static; opacity: 1; }

/* Time card (hours calculator) */
.timecard { min-width: 520px; }
.timecard th, .timecard td { padding: .5rem .6rem; vertical-align: middle; }
.timecard tbody th { font-weight: 700; color: var(--text); }
.timecard input { width: 100%; min-width: 0; padding: .5rem .55rem; border: 1.5px solid var(--line); border-radius: 9px; outline: 0; background: #fff; }
.timecard input:focus { border-color: var(--tool); }
.timecard .tc-break { max-width: 90px; }
.timecard .tc-hours { font-weight: 700; white-space: nowrap; }
.day-short { display: none; }
.timecard-wrap { margin-bottom: .5rem; }

/* The hidden radio must not pick up the form's width: 100%, or it widens the page. */
.form-field .segmented input { width: 1px; height: 1px; padding: 0; }
.calc-grid .segmented label { flex: 1 1 auto; }

/* ---------- Responsive ---------- */

/* Eight categories do not fit one row on smaller desktops: two rows of four. */
@media (max-width: 1240px) and (min-width: 861px) {
    .mega-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(860px, calc(100vw - 40px)); }
}

@media (max-width: 1024px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .content-layout { grid-template-columns: 1fr; gap: 2rem; }
    .content-side { position: static; grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .qr-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 860px) {
    .menu-toggle { display: grid; place-items: center; }
    .main-nav {
        position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: .5rem 16px 1rem;
        display: none; max-height: calc(100vh - 68px); overflow-y: auto;
    }
    .main-nav.open { display: flex; }
    .nav-link { padding: .8rem .5rem; justify-content: space-between; width: 100%; }
    .nav-dropdown-menu { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 .5rem; opacity: 1; visibility: visible; transform: none; display: none; }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-dropdown:hover .nav-dropdown-menu { display: none; }
    .nav-dropdown.open:hover .nav-dropdown-menu { display: block; }

    .mega-menu { width: auto; transform: none !important; grid-template-columns: 1fr 1fr; padding: .5rem 0 1rem; }
    .nav-mega.open .mega-menu { display: grid; }
    .nav-mega .nav-link .icon:first-child { display: none; }

    .stage-work { grid-template-columns: 1fr; }
    .work-side { border-left: 0; border-top: 1px solid var(--line); }
    .contact-layout { grid-template-columns: 1fr; }
    .calc-layout, .widget-split, .qr-layout { grid-template-columns: 1fr; }
    .qr-preview { position: static; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .calc-grid { grid-template-columns: minmax(0, 1fr); }
    .hero { padding: 56px 0 48px; }
    .section { padding: 52px 0; }
    .feature-grid, .steps, .value-grid { grid-template-columns: 1fr; }
    .content-side { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
    .tool-title { align-items: flex-start; gap: 1rem; }
    .tool-icon-lg { width: 52px; height: 52px; }
    .dropzone { min-height: 260px; padding: 2rem 1rem; }
    .btn-xl { padding: .95rem 1.4rem; font-size: 1.05rem; }
    .work-main, .work-side { padding: 1rem; }
    .file-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .file-grid.pages { grid-template-columns: repeat(3, 1fr); }
    .file-remove { opacity: 1; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-4 { grid-template-columns: 1fr 1fr; }
    .cookie-notice { flex-direction: column; align-items: stretch; text-align: center; }

    .logo-img { height: 30px; }
    .tool-widget { padding: 1rem; }
    .convert-row { grid-template-columns: 1fr; gap: .5rem; }
    .swap-btn { justify-self: center; transform: rotate(90deg); }
    .swap-btn:hover { transform: rotate(270deg); }
    .swap-static, .swap-static:hover { transform: none; }
    .convert-input { font-size: 1.6rem; }
    .fx-tables { grid-template-columns: 1fr; }
    .pct-list { grid-template-columns: 1fr; }
    .pct-row input { width: 96px; }
    .stat-hero strong { font-size: 1.6rem; }
    .footer-links-inline { gap: 2.5rem; }
    .mega-menu { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
