/* ==========================================================================
   ToolHub — app.css  (Phase 2)
   Refined utilitarian tool platform. Light + dark via [data-theme].
   Type: Bricolage Grotesque (display) + Hanken Grotesk (body).
   ========================================================================== */

:root {
    --font-sans: "Hanken Grotesk", system-ui, -apple-system, Segoe UI, sans-serif;
    --font-display: "Bricolage Grotesque", var(--font-sans);

    --bg: #faf9f7;
    --surface: #ffffff;
    --surface-2: #f3f2ef;
    --border: #e7e5e0;
    --border-strong: #d8d5cd;
    --text: #18181b;
    --text-2: #6c6a72;
    --brand: #1f6feb;
    --brand-ink: #ffffff;
    --accent: var(--brand);

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(20,18,30,.05);
    --shadow: 0 1px 2px rgba(20,18,30,.04), 0 8px 24px rgba(20,18,30,.06);
    --shadow-lg: 0 12px 40px rgba(20,18,30,.12);
    --wrap: 1280px;
    --header-h: 64px;
}

[data-theme="dark"] {
    --bg: #0d0e12;
    --surface: #16171d;
    --surface-2: #1c1e26;
    --border: #282a33;
    --border-strong: #353846;
    --text: #f3f3f6;
    --text-2: #9b9aa6;
    --brand: #5b8cff;
    --brand-ink: #0d0e12;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
/* Normalize: the `hidden` attribute must always hide, even when a more specific
   rule (e.g. .field-row{display:grid}) would otherwise win. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0; font-family: var(--font-sans); color: var(--text); background: var(--bg);
    line-height: 1.55; display: flex; flex-direction: column; min-height: 100vh;
    -webkit-font-smoothing: antialiased; transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.1; }

.wrap { width: min(var(--wrap), 100% - 3rem); margin-inline: auto; }
.site-main { flex: 1 0 auto; padding-block: 2.25rem 3rem; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.lede { color: var(--text-2); font-size: 1.05rem; margin: .35rem 0 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 1em; height: 1em; display: inline-block; vertical-align: middle; }

.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    font: 600 .92rem/1 var(--font-sans); white-space: nowrap;
    padding: .62rem 1.1rem; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    transition: background .15s, border-color .15s, transform .05s, color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); color: var(--brand-ink); }
/* Ghost buttons keep a visible resting state so Copy / Download / secondary
   actions always look like buttons — not plain text that only appears on hover. */
.btn-ghost { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px;
    border-radius: 9px; border: 1px solid transparent; background: transparent;
    color: var(--text-2); cursor: pointer; font-size: 1.1rem; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* HEADER */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border);
}
.header-inner { width: 100%; min-height: var(--header-h); display: flex; align-items: center; gap: 1.25rem; padding-inline: clamp(1rem, 3vw, 2rem); }
.header-left { display: flex; align-items: center; gap: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #12a594); color: #fff; font-size: 1.18rem; }
.brand-name { font-family: var(--font-display); font-size: 1.38rem; letter-spacing: -.02em; }

.main-nav { display: flex; align-items: center; gap: .15rem; margin-inline: auto; }

/* Category hover mega-menu */
.nav-item { position: relative; }
.nav-item .chev { font-size: .8rem; display: inline-flex; transition: transform .18s ease; opacity: .6; }
.nav-item:hover .chev { transform: rotate(180deg); }
.cat-mega {
    position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(-8px);
    width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-lg); padding: 1rem; z-index: 60;
    opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
/* Bridge the 12px gap so the menu doesn't close when the cursor crosses it */
.cat-mega::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.nav-item:hover .cat-mega, .nav-item:focus-within .cat-mega {
    opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.cat-mega-head { display: flex; align-items: center; gap: .65rem; padding: 0 .3rem .8rem; border-bottom: 1px solid var(--border); margin-bottom: .7rem; }
.cat-mega-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.cat-mega-ico svg { width: 20px; height: 20px; }
.cat-mega-title { display: block; font-weight: 700; font-size: .95rem; }
.cat-mega-sub { display: block; color: var(--text-2); font-size: .78rem; }
.cat-mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; }
.cat-mega-link { display: flex; align-items: center; gap: .5rem; padding: .5rem .55rem; border-radius: 9px; color: var(--text); font-size: .87rem; font-weight: 500; }
.cat-mega-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); text-decoration: none; }
.cat-mega-link-ico { flex: none; display: inline-flex; color: var(--text-2); }
.cat-mega-link-ico svg { width: 16px; height: 16px; }
.cat-mega-link:hover .cat-mega-link-ico { color: var(--accent); }
.cat-mega-all { display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem; padding: .55rem .55rem 0; font-size: .85rem; font-weight: 650; color: var(--accent); border-top: 1px solid var(--border); padding-top: .7rem; width: 100%; }
.cat-mega-all svg { width: 15px; height: 15px; }

.nav-link { color: var(--text-2); font-size: .92rem; font-weight: 600; padding: .45rem .75rem; border-radius: 8px; background: transparent; border: none; cursor: pointer; font-family: var(--font-sans); display: inline-flex; align-items: center; gap: .25rem; }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav-link .chev { font-size: .8rem; display: inline-flex; transition: transform .18s ease; }

/* Mega menu */
.nav-mega { position: relative; }
.nav-mega.open .chev { transform: rotate(180deg); }
.mega-panel { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-8px); width: min(720px, 90vw); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: .9rem; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 60; }
.mega-panel::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.nav-more-wrap:hover .mega-panel, .nav-more-wrap:focus-within .mega-panel,
.nav-mega.open .mega-panel { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-more-wrap:hover .nav-mega-btn .chev, .nav-mega.open .nav-mega-btn .chev { transform: rotate(180deg); }
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; }
.mega-item { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem; border-radius: 12px; color: var(--text); }
.mega-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); text-decoration: none; }
.mega-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mega-ico svg { width: 19px; height: 19px; }
.mega-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mega-name { font-weight: 650; font-size: .9rem; line-height: 1.2; }
.mega-desc { color: var(--text-2); font-size: .76rem; line-height: 1.35; }

.header-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Language switcher */
.lang-switcher { position: relative; }
/* native <details> disclosure — hide the default marker, behave like a button */
summary.lang-btn { list-style: none; cursor: pointer; }
summary.lang-btn::-webkit-details-marker { display: none; }
.lang-switcher[open] .lang-caret { transform: rotate(180deg); }
.lang-btn .lang-caret svg { width: 14px; height: 14px; transition: transform .15s; }
.lang-btn > svg:first-child { width: 18px; height: 18px; }
.drawer-lang { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.drawer-lang-title { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: .6rem; }
.drawer-lang-title svg { width: 15px; height: 15px; }
.lang-btn { display: inline-flex; align-items: center; gap: .35rem; width: auto; padding-inline: .6rem; }
.lang-btn .lang-current { font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.lang-btn .lang-caret { display: inline-flex; font-size: .7rem; opacity: .7; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .35rem; z-index: 60; }
.lang-opt { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 9px; color: var(--text); font-size: .88rem; font-weight: 500; }
.lang-opt:hover { background: var(--surface-2); text-decoration: none; }
.lang-opt .lang-code { font-size: .68rem; font-weight: 800; color: var(--text-2); width: 22px; }
.lang-opt .lang-label { flex: 1; }
.lang-opt .lang-tick { opacity: 0; color: var(--accent, var(--brand)); font-size: .8rem; }
.lang-opt.is-active .lang-tick { opacity: 1; }
.lang-opt.is-active { color: var(--brand); }

/* Search (10% wider: 240 -> 264) */
.search { position: relative; }
.search-form { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; padding: .15rem .7rem; transition: border-color .15s, background .15s; width: 264px; }
.search-form:focus-within { border-color: var(--brand); background: var(--surface); }
.search-icon { color: var(--text-2); font-size: 1rem; display: inline-flex; }
.search-input { border: none; background: transparent; outline: none; color: var(--text); font: 500 .9rem var(--font-sans); padding: .5rem 0; width: 100%; }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-width: 88vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; max-height: 70vh; overflow-y: auto; z-index: 60; }
.search-result { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 9px; color: var(--text); cursor: pointer; }
.search-result:hover, .search-result.active { background: var(--surface-2); text-decoration: none; }
.search-result .sr-ico { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); font-size: 1rem; }
.search-result .sr-name { font-weight: 600; font-size: .9rem; }
.search-result .sr-cat { color: var(--text-2); font-size: .78rem; }
.search-empty { padding: 1rem; text-align: center; color: var(--text-2); font-size: .9rem; }

.theme-toggle .theme-moon, .theme-toggle-m .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun, [data-theme="dark"] .theme-toggle-m .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-moon, [data-theme="dark"] .theme-toggle-m .theme-moon { display: inline-flex; }

.auth-buttons { display: flex; align-items: center; gap: .4rem; }
.btn-upgrade { background: linear-gradient(135deg, #f59e0b, #f76808); color: #fff; gap: .35rem; box-shadow: 0 2px 8px rgba(247,104,8,.28); }
.btn-upgrade:hover { filter: brightness(1.05); text-decoration: none; }
.btn-upgrade svg { width: 16px; height: 16px; }

/* Mobile control cluster (hidden on desktop) */
.mobile-controls { display: none; align-items: center; gap: .1rem; }

/* HERO + HOME */
.hero { padding-block: clamp(1.25rem, 3.5vw, 2.5rem) 1.5rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; }
.hero .lede { max-width: 46ch; margin-inline: auto; font-size: 1.12rem; }
.hero-search { display: flex; align-items: center; gap: .5rem; max-width: 560px; margin: 1.6rem auto 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: .35rem .35rem .35rem .9rem; box-shadow: var(--shadow); }
.hero-search:focus-within { border-color: var(--accent); }
.hero-search input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font: 500 1rem var(--font-sans); padding: .6rem .2rem; }

.home-categories { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-top: 1.5rem; }
.cat-block { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.2rem 1rem; box-shadow: 0 1px 2px rgba(20,18,30,.04); overflow: hidden; transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease, border-color .28s ease; }
/* Animated accent bar that sweeps across the top on hover */
.cat-block::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent)); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
/* Soft radial glow that fades in */
.cat-block::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.cat-block:hover { transform: translateY(-6px); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 10%, rgba(20,18,30,.06)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cat-block:hover::before { transform: scaleX(1); }
.cat-block:hover::after { opacity: 1; }
.cat-block-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; position: relative; z-index: 1; }
.cat-block-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 1.05rem; transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .3s ease; }
.cat-block:hover .cat-block-icon { transform: scale(1.12) rotate(-6deg); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.cat-block-title { font-family: var(--font-display); font-size: 1.18rem; color: var(--text); font-weight: 600; transition: color .2s ease; }
.cat-block-title:hover { color: var(--accent); text-decoration: none; }
.cat-block-grid, .cat-block-all { position: relative; z-index: 1; }
.cat-block-all .chev { font-size: .85rem; transition: transform .2s ease; }
.cat-block:hover .cat-block-all .chev { transform: translateX(4px); }
.pill { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: .12rem .5rem; border-radius: 999px; }
.cat-block-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; }
.mini-tool { display: flex; align-items: center; gap: .5rem; padding: .42rem .5rem; border-radius: 8px; color: var(--text); font-size: .88rem; font-weight: 500; }
.mini-tool:hover { background: var(--surface-2); text-decoration: none; }
.mini-ico { color: var(--accent); font-size: .95rem; display: inline-flex; opacity: .85; }
.cat-block-all { display: inline-flex; align-items: center; gap: .3rem; margin-top: .7rem; font-size: .85rem; font-weight: 600; }

/* TOOL GRID + CARD */
.tool-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.tool-card { display: flex; align-items: flex-start; gap: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.05rem; box-shadow: var(--shadow-sm); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); transform: translateY(-3px); }
.tool-card-icon { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 1.2rem; }
.tool-card-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tool-card-title { font-weight: 700; font-size: .98rem; }
.tool-card-desc { color: var(--text-2); font-size: .85rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-cat { margin-top: .3rem; font-size: .72rem; font-weight: 600; color: var(--accent); }

.stagger .tool-card { opacity: 0; animation: fade-up .5s ease forwards; }
.stagger .tool-card:nth-child(1){animation-delay:.02s}.stagger .tool-card:nth-child(2){animation-delay:.05s}
.stagger .tool-card:nth-child(3){animation-delay:.08s}.stagger .tool-card:nth-child(4){animation-delay:.11s}
.stagger .tool-card:nth-child(5){animation-delay:.14s}.stagger .tool-card:nth-child(6){animation-delay:.17s}
.stagger .tool-card:nth-child(7){animation-delay:.20s}.stagger .tool-card:nth-child(8){animation-delay:.23s}
.stagger .tool-card:nth-child(n+9){animation-delay:.26s}
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stagger .tool-card { opacity: 1; animation: none; } html { scroll-behavior: auto; } }

/* PAGE HEAD + BREADCRUMBS */
.breadcrumbs { margin: .25rem 0 1.25rem; font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] span { color: var(--text); font-weight: 600; }
.breadcrumbs .sep { color: var(--text-2); opacity: .6; }

.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.page-head-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 1.5rem; }
.page-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; }
.page-head-count { margin-left: auto; align-self: flex-start; font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: .3rem .7rem; border-radius: 999px; }
.empty { padding: 3rem 0; text-align: center; }

/* TOOL PAGE */
.tool-shell { width: min(1020px, 100% - 3rem); margin: 0 auto; }
.tool-head { text-align: center; margin-bottom: 1.5rem; }
.tool-head-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 1.7rem; margin-bottom: .7rem; }
.tool-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0; }
.tool-head .lede { margin-top: .4rem; }
.tool-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; }

.coming-soon { text-align: center; padding: 1.5rem .5rem; }
.coming-soon-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: 1.4rem; margin-bottom: .6rem; }
.coming-soon h3 { margin: .2rem 0 .4rem; }

.tool-form { display: grid; gap: 1.2rem; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2.9rem 1.25rem; min-height: 200px; text-align: center; cursor: pointer; display: grid; gap: .45rem; align-content: center; justify-items: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dz-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin: 0 auto .15rem; }
.dz-icon svg { width: 28px; height: 28px; }
.dropzone:hover .dz-icon, .dropzone.is-over .dz-icon { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dz-text strong { color: var(--accent); }
.dz-hint { font-size: .82rem; color: var(--text-2); }
.dz-file { font-size: .9rem; font-weight: 600; margin-top: .4rem; }

.levels { border: none; padding: 0; margin: 0; }
.levels legend { font-weight: 600; font-size: .92rem; margin-bottom: .55rem; padding: 0; }
.level-opt { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.1rem; font-size: .92rem; cursor: pointer; }
.level-opt input { accent-color: var(--accent); }

.result { margin-top: 1.2rem; padding: 1.3rem; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); text-align: center; }
.result-stat { font-size: 1.3rem; margin: 0 0 .2rem; font-family: var(--font-display); }
.result .btn { margin-top: .9rem; }
.alert { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius); background: color-mix(in srgb, #e5484d 12%, var(--surface)); border: 1px solid color-mix(in srgb, #e5484d 35%, var(--border)); color: #c62a2f; font-size: .92rem; }
[data-theme="dark"] .alert { color: #ff8a8e; }

.related { margin-top: 3rem; }

/* SEO content block (intro + features + FAQ) */
.tool-seo { margin-top: 3.5rem; display: grid; gap: 2.2rem; }
.tool-seo h2 { font-size: 1.4rem; margin: 0 0 .7rem; }
.tool-seo h3 { font-size: 1.15rem; margin: 0 0 1rem; }
.tool-seo-intro p { color: var(--text-2); line-height: 1.7; max-width: 75ch; }
.seo-feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.seo-feature { display: flex; gap: .7rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.seo-feature-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--brand)) 14%, transparent); color: var(--accent, var(--brand)); }
.seo-feature-ico svg { width: 16px; height: 16px; }
.seo-feature-title { display: block; font-weight: 650; font-size: .95rem; margin-bottom: .2rem; }
.seo-feature-text { display: block; color: var(--text-2); font-size: .87rem; line-height: 1.55; }
.seo-faq-list { display: grid; gap: .6rem; }
.seo-faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 1.1rem; }
.seo-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; padding: 1rem 0; font-weight: 600; font-size: .96rem; list-style: none; }
.seo-faq-item summary::-webkit-details-marker { display: none; }
.seo-faq-chev { display: inline-flex; color: var(--text-2); transition: transform .2s ease; }
.seo-faq-item[open] .seo-faq-chev { transform: rotate(180deg); }
.seo-faq-item p { margin: 0; padding: 0 0 1.1rem; color: var(--text-2); line-height: 1.65; font-size: .9rem; }
@media (max-width: 640px) { .seo-feature-grid { grid-template-columns: 1fr; } }
/* Desktop shows up to 8 related tools; mobile caps at 5 to avoid long scrolling. */
@media (max-width: 640px) {
    .related .tool-grid > :nth-child(n+6) { display: none; }
}
.related-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.related-head h2 { font-size: 1.25rem; margin: 0; display: inline-flex; align-items: center; gap: .45rem; }
.related-head .h2-ico { color: var(--text-2); font-size: 1.1rem; }
.related-all { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; font-weight: 600; background: none; border: none; cursor: pointer; color: var(--accent); font-family: var(--font-sans); }
.related-all .chev { font-size: .9rem; }
.recent-section { margin-top: 1.75rem; }
.recent-chips { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .55rem; }
.recent-chip {
    display: block; text-align: center; padding: .55rem .7rem; border: 1px solid var(--border);
    border-radius: 10px; background: var(--surface); color: var(--text); font-size: .82rem;
    font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; transition: border-color .15s, color .15s, background .15s;
}
.recent-chip:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); color: var(--brand); text-decoration: none; }
@media (max-width: 1040px) { .recent-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 768px) { .recent-section { display: none !important; } }

/* FOOTER */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--surface); margin-top: 3rem; }
.footer-inner { width: min(var(--wrap), 100% - 3rem); margin-inline: auto; display: flex; flex-wrap: wrap; gap: 2.5rem; padding-block: 2.2rem 1.4rem; }
.footer-brand { max-width: 280px; }
.footer-brand .brand { margin-bottom: .5rem; }
.footer-cols { display: flex; gap: 3rem; margin-left: auto; flex-wrap: wrap; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.footer-cols a { color: var(--text-2); font-size: .9rem; }
.footer-cols a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); }

/* RESPONSIVE */
@media (max-width: 1180px) { .search-form { width: 200px; } }
@media (max-width: 1040px) {
    /* Switch to mobile header: hide desktop nav/search/auth, show control cluster */
    .main-nav, .header-right .search, .header-right .lang-switcher,
    .header-right > .theme-toggle, .auth-buttons { display: none; }
    .mobile-controls { display: inline-flex; }
}
@media (min-width: 1041px) { .mobile-controls { display: none; } }

/* Desktop header logo ~13% larger (mobile keeps its size). */
@media (min-width: 1041px) {
    .site-header .brand-mark { width: 40px; height: 40px; font-size: 1.34rem; }
    .site-header .brand-name { font-size: 1.56rem; }
    .site-header .brand-logo { height: 50px; }
}

/* Mega menu collapses to 2 cols on smaller desktops */
@media (max-width: 920px) { .mega-grid { grid-template-columns: repeat(2, 1fr); } .mega-panel { width: min(460px, 92vw); } }

/* Mobile drawer */
.mobile-drawer { position: fixed; inset: 0; z-index: 80; }
.mobile-drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s ease; }
.mobile-drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(360px, 86vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); overflow: hidden; }
.mobile-drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.drawer-head .brand-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.drawer-nav { display: flex; flex-direction: column; padding: .6rem; gap: .1rem; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.drawer-link { display: flex; align-items: center; gap: .7rem; padding: .75rem .8rem; border-radius: 10px; color: var(--text); font-weight: 600; font-size: .95rem; }
.drawer-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); text-decoration: none; }
.drawer-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.drawer-ico svg { width: 17px; height: 17px; }
.drawer-auth { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; border-top: 1px solid var(--border); flex: none; background: var(--surface); box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
.btn-block { width: 100%; justify-content: center; }
.drawer-lang { padding: 0 1.1rem 1.3rem; }
.drawer-lang-label { display: flex; align-items: center; gap: .4rem; color: var(--text-2); font-size: .82rem; font-weight: 600; margin-bottom: .5rem; }
.drawer-lang-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.drawer-lang-opt { padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 8px; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.drawer-lang-opt:hover { background: var(--surface-2); text-decoration: none; }
.drawer-lang-opt.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
body.drawer-open { overflow: hidden; }

@media (max-width: 720px) {
    .page-head { flex-wrap: wrap; } .page-head-count { margin-left: 0; }
}
@media (max-width: 520px) { .cat-block-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   PHASE 3 — Image tool controls
   ========================================================================== */
.field { display: grid; gap: .4rem; margin: 0; }
.field + .field, .tool-form > .field { margin-top: 0; }
.field-label { font-weight: 600; font-size: .92rem; }
.field-hint { font-size: .8rem; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .8rem; }

input[type="number"], input[type="text"] {
    font: 500 .95rem var(--font-sans); color: var(--text); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: 9px; padding: .55rem .7rem; width: 100%;
}
input[type="number"]:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); }

.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; cursor: pointer; margin-top: .3rem; }
.check input { accent-color: var(--accent); }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; background: var(--surface-2); padding: .25rem; border-radius: 10px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span {
    display: inline-block; padding: .42rem .8rem; border-radius: 8px; font-size: .88rem; font-weight: 600;
    color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap;
}
.seg-opt input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Preview */
.preview-wrap { display: flex; justify-content: center; }
.preview-img { max-width: 100%; max-height: 320px; border-radius: var(--radius); border: 1px solid var(--border); background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px; }

/* Result rows */
.result-rows { display: grid; gap: .35rem; max-width: 320px; margin: .6rem auto 0; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }

/* Crop stage */
.crop-stage { display: grid; gap: 1rem; justify-items: center; }
.crop-canvas-wrap {
    position: relative; display: block; width: fit-content; max-width: 100%;
    margin: 0 auto; line-height: 0; cursor: crosshair; user-select: none; touch-action: none;
}
.crop-img { display: block; max-width: 100%; max-height: 460px; width: auto; height: auto; border-radius: var(--radius-sm); }
.crop-box {
    position: absolute; top: 0; left: 0; width: 0; height: 0; box-sizing: border-box;
    border: 1px solid #fff; outline: 1px solid rgba(0,0,0,.4);
    box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none;
}
[data-theme="dark"] .crop-box { box-shadow: 0 0 0 9999px rgba(0,0,0,.6); }
.crop-box::before {
    content: ""; position: absolute; inset: 0; border: 1px dashed var(--accent); pointer-events: none;
}
.crop-handle {
    position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--accent);
    border-radius: 50%; box-sizing: border-box;
}
.crop-handle.br { right: -7px; bottom: -7px; }
.crop-hint { font-size: .82rem; color: var(--text-2); text-align: center; }

/* ==========================================================================
   PHASE 4 — PDF file list + Color Picker
   ========================================================================== */
/* PDF merge file list (drag to reorder) */
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.file-item {
    display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: grab; transition: border-color .15s, box-shadow .15s;
}
.file-item:hover { border-color: var(--accent); }
.file-item.dragging { opacity: .5; box-shadow: var(--shadow); }
.fi-handle { color: var(--text-2); cursor: grab; font-size: .9rem; letter-spacing: -2px; }
.fi-name { flex: 1; font-size: .92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-size { font-size: .82rem; flex: none; }
.fi-remove { border: none; background: none; color: var(--text-2); cursor: pointer; font-size: .9rem; padding: .2rem .4rem; border-radius: 6px; }
.fi-remove:hover { background: var(--surface-2); color: #e5484d; }

/* Color picker */
.cp-stage { display: grid; gap: 1.1rem; }
.cp-canvas-wrap { display: flex; justify-content: center; }
.cp-canvas {
    max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); cursor: crosshair;
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px;
}
.cp-readout { display: flex; align-items: center; gap: 1rem; }
.cp-swatch { width: 64px; height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); flex: none; box-shadow: var(--shadow-sm); }
.cp-values { flex: 1; display: grid; gap: .5rem; }
.cp-val-row { display: flex; align-items: center; gap: .5rem; }
.cp-label { width: 38px; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.cp-input { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .95rem; letter-spacing: .02em; }
.cp-copy { padding: .45rem .7rem; font-size: .82rem; }
.cp-history { display: grid; gap: .5rem; }
.cp-history-swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.cp-chip { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.cp-chip:hover { transform: scale(1.08); }

/* ==========================================================================
   PHASE 5 — Home page polish (stats · FAQ · premium · footer · static)
   ========================================================================== */

.wrap-narrow { width: min(760px, 100% - 3rem); }

/* Hero eyebrow */
.hero-eyebrow {
    display: inline-block; font-size: .82rem; font-weight: 600; letter-spacing: .02em;
    color: var(--accent); background: color-mix(in srgb, var(--brand) 12%, transparent);
    padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.1rem;
}

/* Section heads (shared by FAQ etc.) */
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 1.8rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .4rem; }

/* ---- Stats band ---------------------------------------------------------- */
.stats-band {
    margin: 2.5rem 0 1rem;
    background: none;
    border: none;
    padding-block: 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat {
    display: grid; grid-template-columns: auto 1fr;
    grid-template-areas: "ico num" "ico label";
    align-items: center; column-gap: .9rem; text-align: left;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 1.05rem 1.2rem;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); box-shadow: 0 8px 22px rgba(17,12,46,.06); transform: translateY(-2px); }
.stat-ico { grid-area: ico; display: grid; place-items: center; width: 46px; height: 46px; margin: 0; border-radius: 13px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.stat-ico svg { width: 22px; height: 22px; }
.stat-num {
    grid-area: num; display: block; font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.05; letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--brand), #12a594);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-variant-numeric: tabular-nums;
}
.stat-label { grid-area: label; display: block; margin-top: .15rem; color: var(--text-2); font-weight: 500; font-size: .88rem; }

/* ---- FAQ ----------------------------------------------------------------- */
.faq-section { margin-top: 3.5rem; }
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: .7rem; }
.faq-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color .15s;
}
.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.faq-item summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1.05rem 1.2rem; font-weight: 600; font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { color: var(--text-2); flex: none; transition: transform .2s ease; font-size: 1.1rem; }
.faq-item[open] .faq-icon { transform: rotate(180deg); color: var(--accent); }
.faq-a { padding: 0 1.2rem 1.15rem; color: var(--text-2); line-height: 1.6; }
.faq-a p { margin: 0; }

/* ---- Premium ------------------------------------------------------------- */
.premium {
    position: relative; margin-top: 3.5rem; border-radius: 22px; overflow: hidden;
    background: linear-gradient(135deg, #1f4fd6 0%, #2563eb 45%, #0ea5b7 120%);
    color: #fff; box-shadow: 0 24px 60px -24px rgba(31,79,214,.6);
}
.premium-glow {
    position: absolute; inset: -40% -10% auto auto; width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(255,255,255,.22), transparent 60%); pointer-events: none;
}
.premium-inner {
    position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem;
    padding: clamp(1.8rem, 4vw, 3rem);
}
.premium-badge {
    display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    background: rgba(255,255,255,.18); padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.premium-copy h2 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 .6rem; }
.premium-copy > p { color: rgba(255,255,255,.85); font-size: 1.05rem; margin: 0 0 1.4rem; max-width: 38ch; }
.premium-cta {
    background: #fff; color: #1f4fd6; border: none; font-weight: 700; padding: .8rem 1.4rem; font-size: 1rem;
}
.premium-cta:hover { background: #f0f4ff; color: #1f4fd6; }
.premium-note { color: rgba(255,255,255,.7); font-size: .85rem; margin: .9rem 0 0; }
.premium-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; align-content: center; }
.premium-benefit { display: flex; gap: .85rem; align-items: flex-start; }
.premium-benefit-icon {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    background: rgba(255,255,255,.16); color: #fff; font-size: 1.1rem;
}
.premium-benefit strong { display: block; font-size: 1rem; }
.premium-benefit-text { display: block; color: rgba(255,255,255,.8); font-size: .88rem; line-height: 1.45; margin-top: .1rem; }

/* ---- Footer (revised columns) ------------------------------------------- */
.footer-col h3.footer-heading {
    font-family: var(--font-sans); font-size: .8rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-2); margin: 0 0 .8rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: var(--text-2); font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-inner { gap: 3rem; }
.footer-brand { flex: 1 1 240px; }
.footer-col { min-width: 150px; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding-block: 1rem; padding-right: 3.5rem; }
.bmc-button { display: inline-flex; align-items: center; line-height: 0; border-radius: 10px; transition: transform .12s ease, box-shadow .12s ease; }
.bmc-button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); text-decoration: none; }
.bmc-button img { height: 40px; width: 144px; display: block; border-radius: 10px; }
.footer-bottom-links { display: inline-flex; gap: 1rem; }
.footer-bottom-links a { color: var(--text-2); }
.footer-bottom-links a:hover { color: var(--accent); }

/* ---- Static pages -------------------------------------------------------- */
.static-page { padding-block: .5rem 1rem; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.1rem; color: var(--text); line-height: 1.7; }
.prose p:first-child { font-size: 1.05rem; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
    .premium-inner { grid-template-columns: 1fr; gap: 1.6rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   PHASE 6 — Mobile search · scroll-top · footer social/popular · auth
   ========================================================================== */

/* Search trigger: hidden on desktop, shown when the inline box is hidden */
.search-trigger { display: none; }
@media (max-width: 1040px) { .search-trigger { display: inline-flex; } }

/* Mobile full-screen search overlay */
.search-overlay {
    position: fixed; inset: 0; z-index: 200; background: var(--bg);
    display: flex; flex-direction: column; animation: overlay-in .16s ease;
}
.search-overlay[hidden] { display: none; }
@keyframes overlay-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.search-overlay-bar {
    display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem;
    border-bottom: 1px solid var(--border); background: var(--surface);
}
.search-overlay-bar .search-icon { color: var(--text-2); font-size: 1.2rem; }
.search-overlay-input {
    flex: 1; border: none; background: transparent; outline: none; color: var(--text);
    font: 500 1.1rem var(--font-sans); padding: .5rem 0;
}
.search-overlay-results { flex: 1; overflow-y: auto; padding: .6rem 1rem; }
.search-overlay-results .search-result { padding: .7rem .6rem; }
.search-overlay-results .search-empty { padding: 2rem 1rem; }

/* Scroll-to-top */
.scroll-top {
    position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 90;
    width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow);
    display: grid; place-items: center; font-size: 1.2rem;
    opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s, background .15s;
}
.scroll-top.show { opacity: 1; transform: none; }
.scroll-top:hover { background: var(--accent); color: var(--brand-ink); border-color: var(--accent); }

/* Footer: description + social + popular */
.footer-desc { font-size: .9rem; line-height: 1.6; margin: .6rem 0 1rem; max-width: 38ch; }
.footer-social { display: flex; gap: .5rem; }
.social-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); color: var(--text-2); background: var(--surface); font-size: 1.05rem;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.social-icon:hover { background: var(--accent); color: var(--brand-ink); border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.footer-col-wide { min-width: 220px; }
.footer-popular { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4rem; }
.footer-popular ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; align-content: start; }

/* Auth pages */
.auth-page { display: flex; justify-content: center; padding-block: 2.5rem 3.5rem; }
.auth-card {
    width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
    border-radius: 18px; box-shadow: var(--shadow); padding: clamp(1.6rem, 4vw, 2.4rem); text-align: center;
}
.auth-brand { justify-content: center; margin-bottom: 1.2rem; }
.auth-card h1 { font-size: 1.6rem; margin: 0 0 .4rem; }
.auth-sub { font-size: .95rem; margin: 0 0 1.6rem; }
.auth-form { display: grid; gap: 1rem; text-align: left; }
.auth-form .field-label { font-size: .85rem; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%; box-sizing: border-box; font: 500 .95rem var(--font-sans); color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: .6rem .75rem;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.auth-link-sm { font-size: .85rem; }
.auth-submit { width: 100%; justify-content: center; padding: .75rem; font-size: 1rem; margin-top: .2rem; }
.auth-note { text-align: center; margin: .2rem 0 0; }
.auth-switch { margin: 1.4rem 0 0; font-size: .92rem; color: var(--text-2); }
.auth-error { display: flex; align-items: center; gap: .5rem; background: color-mix(in srgb, #e5484d 12%, transparent); color: #b42318; border: 1px solid color-mix(in srgb, #e5484d 30%, transparent); border-radius: 10px; padding: .65rem .8rem; font-size: .88rem; margin-bottom: 1rem; text-align: left; }
.auth-error svg { width: 16px; height: 16px; flex: none; }
[data-theme="dark"] .auth-error { color: #ffb4ab; }

/* Password show/hide toggle */
.password-wrap { position: relative; }
.password-wrap input { width: 100%; box-sizing: border-box; padding-right: 2.8rem !important; }
.password-toggle { position: absolute; top: 50%; right: .5rem; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; background: none; border: none; cursor: pointer; color: var(--text-2); border-radius: 7px; }
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .pw-eye-off { display: none; }
.password-toggle.is-showing .pw-eye { display: none; }
.password-toggle.is-showing .pw-eye-off { display: block; }

/* Remember me + forgot password row */
.auth-remember { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; color: var(--text-2); }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.auth-forgot { font-size: .86rem; font-weight: 600; color: var(--brand); }
.auth-forgot:hover { text-decoration: underline; }

/* Mobile: give the auth card breathing room on small screens */
@media (max-width: 520px) {
    .auth-page { padding: 1.25rem 1rem 2.5rem; }
    .auth-card { padding: 1.5rem 1.25rem; border-radius: 16px; }
    .auth-row { flex-wrap: wrap; gap: .6rem; }
}

/* Upgrade / Premium */
.upgrade-page { padding-block: 2rem 3rem; }
.upgrade-hero { text-align: center; margin-bottom: 2rem; }
.upgrade-eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: #f76808; background: color-mix(in srgb, #f76808 12%, transparent); padding: .3rem .7rem; border-radius: 999px; margin-bottom: .8rem; }
.upgrade-eyebrow svg { width: 15px; height: 15px; }
.upgrade-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .5rem; }
.upgrade-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; max-width: 720px; margin: 0 auto; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.8rem 1.5rem; display: flex; flex-direction: column; }
.plan-card.is-featured { border-color: #f76808; box-shadow: 0 8px 30px color-mix(in srgb, #f76808 18%, transparent); }
.plan-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #f59e0b, #f76808); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; }
.plan-name { font-size: 1.2rem; margin: 0 0 .4rem; }
.plan-price { margin-bottom: 1.2rem; }
.plan-amt { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.plan-per { color: var(--text-2); font-size: .9rem; }
.plan-features { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .6rem; flex: 1; }
.plan-features li { display: flex; align-items: center; gap: .55rem; font-size: .92rem; }
.plan-features svg { width: 16px; height: 16px; color: #16a34a; flex: none; }
.plan-current { cursor: default; opacity: .7; }
.upgrade-note { text-align: center; margin-top: 1.5rem; }
@media (max-width: 560px) { .upgrade-grid { grid-template-columns: 1fr; } }

/* Checkout form + coupon (upgrade page) */
.checkout-form { display: grid; gap: .7rem; margin-top: .3rem; }
.coupon-row { display: flex; gap: .5rem; align-items: stretch; }
.coupon-input { flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box; font: 500 .9rem var(--font-sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: .55rem .7rem; }
.coupon-input:focus { outline: none; border-color: var(--brand); }
.coupon-apply { padding: .55rem .9rem; white-space: nowrap; }
.coupon-feedback { font-size: .84rem; border-radius: 8px; padding: .5rem .7rem; }
.coupon-feedback.is-ok { background: color-mix(in srgb, #16a34a 12%, transparent); color: #15803d; }
.coupon-feedback.is-err { background: color-mix(in srgb, #e5484d 12%, transparent); color: #b42318; }
[data-theme="dark"] .coupon-feedback.is-ok { color: #86efac; }
[data-theme="dark"] .coupon-feedback.is-err { color: #ffb4ab; }
.checkout-total { display: flex; align-items: center; justify-content: space-between; font-size: .95rem; padding: .3rem 0; border-top: 1px solid var(--border); padding-top: .7rem; }
.checkout-total b { font-size: 1.15rem; }
.checkout-secure { display: flex; align-items: center; justify-content: center; gap: .35rem; margin: .2rem 0 0; }
.checkout-secure svg { width: 14px; height: 14px; }

/* Billing result page */
.billing-result { padding-block: 3rem 4rem; display: flex; justify-content: center; }
.billing-card { width: min(480px, 100%); text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 2.4rem 2rem; }
.billing-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); margin-bottom: 1rem; }
.billing-icon svg { width: 28px; height: 28px; }
.billing-icon.ok { background: color-mix(in srgb, #16a34a 15%, transparent); color: #16a34a; }
.billing-icon.err { background: color-mix(in srgb, #e5484d 15%, transparent); color: #e5484d; }
.billing-card h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
.billing-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.billing-note { margin-top: 1rem; }

/* Dashboard flash + support */
.dash-flash { display: flex; align-items: center; gap: .5rem; background: color-mix(in srgb, #16a34a 12%, transparent); color: #15803d; border: 1px solid color-mix(in srgb, #16a34a 28%, transparent); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; }
.dash-flash svg { width: 16px; height: 16px; flex: none; }
[data-theme="dark"] .dash-flash { color: #86efac; }
.support-form { display: grid; gap: 1rem; }
.support-form textarea { width: 100%; box-sizing: border-box; font: 500 .95rem var(--font-sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: .6rem .75rem; resize: vertical; }
.support-form textarea:focus, .support-form input:focus { outline: none; border-color: var(--brand); }
.support-history-head { margin: 1.8rem 0 .8rem; font-size: 1.05rem; }
.dash-tab-admin { color: var(--brand); }
.dash-tab-signout { color: #e5484d; }

/* Tickets (shared dashboard + admin) */
.ticket-list { display: grid; gap: .8rem; }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.ticket.is-open { border-left: 3px solid var(--brand); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.ticket-subject { font-weight: 650; font-size: .95rem; }
.ticket-meta { display: block; color: var(--text-2); font-size: .78rem; margin-top: .15rem; }
.ticket-body { color: var(--text-2); font-size: .9rem; line-height: 1.5; margin: .5rem 0; }
.ticket-reply { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; margin-top: .5rem; }
.ticket-actions { display: flex; gap: .5rem; margin-top: .7rem; }
.ticket-reply-input { flex: 1; min-width: 0; font: 500 .85rem var(--font-sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: .45rem .6rem; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.pill-open { color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.pill-closed { color: var(--text-2); background: var(--surface-2); }
.pill-premium { color: #f76808; background: color-mix(in srgb, #f76808 14%, transparent); }
.pill-member { color: var(--text-2); background: var(--surface-2); }

/* Admin dashboard */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.admin-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; text-align: center; }
.admin-stat .n { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.admin-stat .l { display: block; color: var(--text-2); font-size: .82rem; margin-top: .2rem; }
.admin-tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.4rem; flex-wrap: wrap; }
.admin-tab { padding: .6rem .9rem; font-weight: 600; font-size: .9rem; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab:hover { color: var(--text); text-decoration: none; }
.admin-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.admin-table code { font-size: .85rem; background: var(--surface-2); padding: .1rem .4rem; border-radius: 5px; }
@media (max-width: 640px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } .admin-table { font-size: .8rem; } }

@media (max-width: 520px) {
    .footer-popular { grid-template-columns: 1fr 1fr; gap: 0 1rem; }
}
@media (min-width: 761px) {
    .search-overlay { display: none !important; }
}

/* ==========================================================================
   PHASE 7 — Tool actions · rating wizard · how-to · dashboard
   ========================================================================== */

/* Favorite + share actions near the tool heading */
.tool-head { position: relative; }
.tool-head-actions { display: flex; gap: .5rem; justify-content: center; margin-bottom: .9rem; }
.tool-action {
    display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
    font-size: 1.1rem; transition: all .15s;
}
.tool-action:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.favorite-btn.is-active { color: #f5a623; border-color: #f5a623; background: color-mix(in srgb, #f5a623 12%, transparent); }
.favorite-btn.is-active svg { fill: #f5a623; }
.share-btn.copied { color: #16a34a; border-color: #16a34a; }
.share-btn.copied::after { content: "Copied!"; position: absolute; margin-top: -52px; font-size: .72rem;
    background: #16a34a; color: #fff; padding: .2rem .5rem; border-radius: 6px; }

/* Rating wizard ("Help Us Improve") */
.rating-wizard {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center;
    margin: 2rem auto 0; padding: .7rem 1.1rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-sm); max-width: 440px; width: fit-content;
}
.rating-label { font-weight: 700; color: var(--text); font-size: 1rem; }
.rating-stars { display: inline-flex; gap: .15rem; }
.rating-star {
    background: none; border: none; cursor: pointer; padding: .1rem; color: var(--border-strong);
    font-size: 1.3rem; line-height: 1; transition: color .12s, transform .12s;
}
.rating-star:hover { transform: scale(1.15); }
.rating-star.filled { color: #f5a623; }
.rating-star.filled svg { fill: #f5a623; }
.rating-score { font-weight: 700; color: var(--accent); border-left: 1px solid var(--border); padding-left: 1rem; }
.rating-thanks { text-align: center; color: #16a34a; font-weight: 600; margin-top: .8rem; }

/* How-to steps (step circles, connecting line, badges) */
.howto { margin-top: 3.5rem; }
.howto-steps {
    list-style: none; margin: 2.4rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; position: relative;
}
.howto-step { text-align: center; position: relative; padding-top: 4.6rem; }
.howto-icon {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #1f4fd6); color: #fff; font-size: 1.5rem;
    box-shadow: 0 10px 24px -8px rgba(37,99,235,.6); z-index: 2;
}
/* connecting line behind the circles */
.howto-step::before {
    content: ""; position: absolute; top: 33px; left: 50%; width: 100%; height: 2px;
    background: var(--border); z-index: 1;
}
.howto-step:last-child::before { display: none; }
.howto-badge {
    display: inline-block; background: var(--surface-2); color: var(--text-2); font-weight: 700;
    font-size: .72rem; padding: .25rem .7rem; border-radius: 999px; margin-bottom: .6rem;
}
.howto-title { font-size: 1.05rem; margin: 0 0 .35rem; }
.howto-text { color: var(--text-2); font-size: .92rem; line-height: 1.55; margin: 0; max-width: 28ch; margin-inline: auto; }

/* ---- Dashboard ---- */
.dashboard { padding-block: 1rem 3rem; }
.dash-head { display: flex; align-items: center; gap: 1.2rem; margin: 1rem 0 1.5rem; }
.dash-avatar, .settings-avatar {
    width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-2); background-size: cover; background-position: center;
}
.dash-avatar svg { width: 30px; height: 30px; }
.dash-head h1 { margin: 0; font-size: 1.6rem; }
.dash-head .lede { margin: .2rem 0 0; }
.dash-tier { margin-left: auto; align-self: flex-start; font-size: .76rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; padding: .35rem .8rem; border-radius: 999px; }
.tier-guest { background: var(--surface-2); color: var(--text-2); }
.tier-member { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--accent); }
.tier-premium { background: linear-gradient(135deg,#2563eb,#0ea5b7); color: #fff; }
.dash-guest-banner { background: color-mix(in srgb, var(--brand) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
    border-radius: 12px; padding: .9rem 1.2rem; margin-bottom: 1.5rem; }
.dash-guest-banner p { margin: 0; font-size: .92rem; }
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; }
.dash-tabs { display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 90px; }
.dash-tab {
    display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 10px;
    border: none; background: none; color: var(--text-2); font: 600 .95rem var(--font-sans); cursor: pointer;
    text-align: left; width: 100%; transition: background .12s, color .12s;
}
.dash-tab svg { width: 18px; height: 18px; }
.dash-tab:hover { background: var(--surface-2); color: var(--text); }
.dash-tab.is-active { background: var(--accent); color: var(--brand-ink, #fff); }
.dash-tab-signout { color: #e5484d; margin-top: .5rem; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; padding-top: 1rem; }
.dash-tab-signout:hover { background: color-mix(in srgb, #e5484d 10%, transparent); color: #e5484d; }
.dash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dash-panel h2 { margin: 0 0 .3rem; }
.dash-empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.dash-empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: .6rem; }
.dash-empty p { margin: 0 0 1rem; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; margin-top: 1.2rem; }
.dash-card h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.dash-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.dash-row:last-of-type { border-bottom: none; }
.dash-danger { border-color: color-mix(in srgb, #e5484d 40%, var(--border)); }
.dash-delete-btn { background: #e5484d; color: #fff; border: none; }
.dash-delete-btn:hover { background: #d33; color: #fff; }
.settings-profile { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.2rem; }

/* Plans */
.dash-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; position: relative; }
.plan-featured { border-color: var(--accent); box-shadow: 0 16px 40px -20px color-mix(in srgb, var(--brand) 60%, transparent); }
.plan-badge { position: absolute; top: -11px; left: 1.6rem; background: var(--accent); color: var(--brand-ink, #fff);
    font-size: .72rem; font-weight: 700; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px; }
.plan-card h3 { margin: 0 0 .3rem; }
.plan-price { font-size: 2rem; font-weight: 700; font-family: var(--font-display); margin: 0 0 1rem; }
.plan-price .muted { font-size: 1rem; font-weight: 400; }
.plan-list { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .6rem; }
.plan-list li { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.plan-list svg { width: 16px; height: 16px; color: #16a34a; flex: none; }
.plan-current { width: 100%; justify-content: center; cursor: default; }
.plan-card .btn { width: 100%; justify-content: center; }
.search-suggest-label { padding: .5rem .8rem .3rem; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-2); }
.dropzone-sm { padding: 1.2rem; min-height: auto; }

@media (max-width: 820px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-tabs { flex-direction: row; flex-wrap: wrap; position: static; }
    .dash-tab { width: auto; }
    .dash-tab-signout { border-top: none; padding-top: .7rem; margin-top: 0; }
    .howto-steps { grid-template-columns: 1fr; gap: 2rem; }
    .howto-step::before { display: none; }
    .dash-plans { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PHASE 8 (rebuild) — Text tools, native EzyToolz components
   ========================================================================== */
.txt-area {
    width: 100%; min-height: 180px; resize: vertical; box-sizing: border-box;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .8rem .9rem; font: 400 .95rem var(--font-sans); color: var(--text);
    background: var(--surface); line-height: 1.6; outline: none; transition: border-color .15s, box-shadow .15s;
}
.txt-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.txt-area.is-output { background: var(--surface-2); }
.txt-area::placeholder { color: var(--text-2); }

/* monospace variant for code/hash/binary output */
.txt-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9rem; }

/* Inline stat chips below a textarea */
.txt-stats { display: flex; flex-wrap: wrap; gap: .4rem .6rem; margin: .7rem 0 0; }
.txt-stat {
    display: inline-flex; align-items: baseline; gap: .35rem; padding: .3rem .7rem;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
    font-size: .82rem; color: var(--text-2);
}
.txt-stat b { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Big stat grid (Word Counter etc.) */
.txt-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; }
.txt-statcard {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 1rem; text-align: center;
}
.txt-statcard .n { display: block; font: 700 1.6rem var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.txt-statcard .l { display: block; margin-top: .35rem; font-size: .78rem; color: var(--text-2); }

/* Button grid for option sets (case buttons, font lists) */
.txt-btngrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.txt-optbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: 600 .88rem var(--font-sans); cursor: pointer;
    transition: all .14s; text-align: center;
}
.txt-optbtn:hover { border-color: var(--accent); color: var(--accent); }
.txt-optbtn.active { background: var(--accent); border-color: var(--accent); color: var(--brand-ink, #fff); }

/* Action row */
.txt-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }

/* Copyable result row (slug, hashtags, single-line outputs) */
.txt-copyrow { display: flex; gap: .5rem; align-items: stretch; }
.txt-copyrow .txt-area, .txt-copyrow input { flex: 1; }
.txt-input {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .65rem .8rem; font: 400 .95rem var(--font-sans); color: var(--text); background: var(--surface); outline: none;
}
.txt-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* Toast/status line */
.txt-toast { display: none; margin-top: .7rem; padding: .55rem .9rem; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 500; }
.txt-toast.show { display: block; }
.txt-toast.ok  { background: color-mix(in srgb, #16a34a 12%, transparent); color: #16a34a; border: 1px solid color-mix(in srgb,#16a34a 30%,transparent); }
.txt-toast.warn{ background: color-mix(in srgb, #f59e0b 14%, transparent); color: #b45309; border: 1px solid color-mix(in srgb,#f59e0b 35%,transparent); }
.txt-toast.err { background: color-mix(in srgb, #e5484d 12%, transparent); color: #e5484d; border: 1px solid color-mix(in srgb,#e5484d 30%,transparent); }
.txt-toast.info{ background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb,var(--brand) 28%,transparent); }

/* Result chips (hashtags, tags, fancy fonts) */
.txt-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.txt-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; color: var(--text);
    transition: all .14s;
}
.txt-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Fancy/generated text list rows */
.txt-list { display: grid; gap: .5rem; }
.txt-listrow {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.txt-listrow .val { font-size: 1.05rem; color: var(--text); word-break: break-word; }
.txt-listrow .copy-mini { flex: none; }

/* Label + control field block reuse .field/.field-label already exist */
.txt-section { margin-top: 1.2rem; }
.txt-section > .field-label { display: block; margin-bottom: .5rem; }

/* Two-column layout for input|output on wide screens */
@media (min-width: 720px) {
    .txt-io { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
}

/* Select dropdown styled to match inputs */
.select {
    appearance: none; -webkit-appearance: none;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .6rem 2rem .6rem .8rem; font: 400 .95rem var(--font-sans); color: var(--text);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .6rem center;
    cursor: pointer; outline: none;
}
.select:focus { border-color: var(--accent); }

/* ==========================================================================
   Language switcher (header)
   ========================================================================== */
.lang-switcher { position: relative; }
.lang-btn {
    display: inline-flex; align-items: center; gap: .3rem; width: auto; padding: 0 .6rem;
    font: 600 .85rem var(--font-sans); color: var(--text-2);
}
.lang-btn:hover { color: var(--accent); }
.lang-btn svg { width: 18px; height: 18px; }
.lang-current { letter-spacing: .02em; }
.lang-caret svg { width: 14px; height: 14px; }
.lang-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; min-width: 190px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow); padding: .4rem; max-height: 60vh; overflow-y: auto;
}
.lang-menu[hidden] { display: none; }
.lang-opt {
    display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .6rem;
    border: none; background: none; cursor: pointer; border-radius: 8px;
    font: 500 .9rem var(--font-sans); color: var(--text); text-align: left;
}
.lang-opt:hover { background: var(--surface-2); }
.lang-opt .lang-code {
    font-size: .72rem; font-weight: 700; color: var(--text-2); background: var(--surface-2);
    border-radius: 5px; padding: .1rem .35rem; min-width: 26px; text-align: center;
}
.lang-opt .lang-tick { margin-left: auto; opacity: 0; }
.lang-opt .lang-tick svg { width: 16px; height: 16px; color: var(--accent); }
.lang-opt.is-active .lang-tick { opacity: 1; }
.lang-opt.is-active { color: var(--accent); }
@media (max-width: 760px) {
    .lang-current { display: none; }
    .lang-btn { padding: 0 .4rem; }
}


/* ============================================================
   Admin panel — Phase 28: full-width, headerless, responsive
   ============================================================ */
body.is-admin .site-header { display: none; }
body.is-admin .site-main { padding: 0; }
body.is-admin .site-footer { display: none; }
.admin-shell {
    display: grid;
    grid-template-columns: 256px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

/* Sidebar */
.admin-side {
    display: flex; flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.1rem .85rem;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-side-top { display: flex; align-items: center; justify-content: space-between; }
.admin-side-close { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; place-items: center; color: var(--text-2); cursor: pointer; }
.admin-side-close:hover { color: var(--text); border-color: var(--text-2); }
.admin-side-close svg { width: 18px; height: 18px; }
.admin-brand { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem 1rem; text-decoration: none; color: var(--text); }
.admin-brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); flex: none; }
.admin-brand-mark svg { width: 19px; height: 19px; }
.admin-brand-text { font-family: var(--font-display, inherit); font-weight: 700; font-size: 1.05rem; line-height: 1; display: flex; flex-direction: column; gap: .15rem; }
.admin-brand-text small { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.admin-nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .7rem; border-radius: var(--radius-sm);
    color: var(--text-2); text-decoration: none; font-size: .92rem; font-weight: 550;
    transition: background .15s, color .15s; position: relative; flex-shrink: 0;
}
.admin-nav-link:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-link.is-active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 650; }
.admin-nav-ic { display: grid; place-items: center; flex: none; }
.admin-nav-ic svg { width: 18px; height: 18px; }
.admin-nav-label { flex: 1; }
.admin-nav-badge { background: var(--brand); color: var(--brand-ink); font-size: .72rem; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; }

/* Sidebar bottom: theme toggle + back link */
.admin-side-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: .6rem; }
.admin-theme-btn {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; padding: .55rem .7rem; border-radius: var(--radius-sm);
    background: none; border: none; color: var(--text-2); cursor: pointer;
    font: inherit; font-size: .88rem; font-weight: 550; text-align: left;
    transition: background .15s, color .15s;
}
.admin-theme-btn:hover { background: var(--surface-2); color: var(--text); }
.admin-theme-btn svg { width: 18px; height: 18px; }
.admin-theme-label { flex: 1; }
.admin-side-foot { display: flex; align-items: center; gap: .5rem; padding: .65rem .7rem; color: var(--text-2); text-decoration: none; font-size: .88rem; font-weight: 550; }
.admin-side-foot:hover { color: var(--text); }
.admin-side-foot svg { width: 16px; height: 16px; }

/* Main column */
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-body { padding: 1.9rem clamp(1.5rem, 4vw, 3rem); max-width: 1180px; margin-inline: auto; width: 100%; }

/* Inline page header (replaces old admin-top bar) */
.admin-page-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1.5rem; flex-wrap: wrap;
}
.admin-page-head-left { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; }
.admin-page-head h1 { font-size: 1.4rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-tag { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: .2rem .5rem; border-radius: 999px; flex-shrink: 0; }
.admin-top-user { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.admin-user-name { font-size: .9rem; font-weight: 600; color: var(--text-2); }
.admin-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .95rem; flex: none; }
.admin-user-avatar.sm { width: 26px; height: 26px; font-size: .78rem; margin-right: .55rem; }
.admin-burger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: .3rem; }
.admin-burger svg { width: 24px; height: 24px; }
.admin-logout { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .7rem; border-radius: 8px; color: var(--text-2); border: 1px solid var(--border); font-size: .85rem; font-weight: 600; }
.admin-logout:hover { color: #e5484d; border-color: color-mix(in srgb, #e5484d 40%, var(--border)); }
.admin-logout svg { width: 16px; height: 16px; }

/* ===== Cards, Stats, Bars ===== */
.ad-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.ad-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.ad-stat-ic { display: flex; justify-content: center; margin-bottom: .4rem; color: var(--brand); }
.ad-stat-ic svg { width: 22px; height: 22px; }
.ad-stat-n { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.ad-stat-l { display: block; color: var(--text-2); font-size: .78rem; margin-top: .15rem; }

.ad-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.ad-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: 0 1px 2px rgba(20,18,30,.04); }
.ad-card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ad-card-head h3 { margin: 0; font-size: 1.05rem; }
.ad-card-wide { grid-column: span 1; }

.ad-bars { display: flex; flex-direction: column; gap: .55rem; }
.ad-bar-row { display: flex; align-items: center; gap: .7rem; }
.ad-bar-label { width: 140px; font-size: .85rem; font-weight: 550; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.ad-bar-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ad-bar-fill { height: 100%; border-radius: 99px; transition: width .3s; }
.ad-bar-n { font-size: .82rem; font-weight: 700; min-width: 32px; text-align: right; }

.ad-mini { display: flex; flex-direction: column; gap: .5rem; }
.ad-mini-row { display: flex; align-items: center; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.ad-mini-row:last-child { border-bottom: 0; }
.ad-mini-row span { display: inline-flex; align-items: center; gap: .55rem; color: var(--text-2); }
.ad-mini-row svg { width: 16px; height: 16px; }

/* ===== Tables ===== */
.ad-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.3rem; }
.ad-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ad-table th, .ad-table td { padding: .7rem 1.3rem; text-align: left; border-bottom: 1px solid var(--border); }
.ad-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); font-weight: 650; white-space: nowrap; }
.ad-table tbody tr { transition: background .12s; }
.ad-table tbody tr:hover { background: var(--surface-2); }
.ad-table .ta-r { text-align: right; }
.ad-table .ta-c { text-align: center; }
.ad-td-name { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.ad-td-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ad-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--brand); flex: none; }
.ad-ic svg { width: 16px; height: 16px; }
.ad-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-right: .45rem; border: 1px solid var(--border-strong); }
.ad-act { background: none; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--text-2); cursor: pointer; margin-left: .3rem; }
.ad-act:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.ad-act:disabled { opacity: .4; cursor: not-allowed; }
.ad-act svg { width: 15px; height: 15px; }

/* ===== Search + Per-page controls ===== */
.ad-search { font: inherit; font-size: .88rem; padding: .45rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); min-width: 180px; max-width: 100%; }
.ad-card-head-tools { flex-wrap: wrap; }
.ad-tools-controls { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.ad-per-page-wrap { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.ad-per-page { font: inherit; font-size: .84rem; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); cursor: pointer; }

/* ===== Pagination ===== */
.ad-pagination { display: flex; align-items: center; justify-content: center; gap: .3rem; padding: 1rem 0 .3rem; flex-wrap: wrap; }
.ad-pagination:empty { display: none; }
.ad-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 .5rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-2);
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: all .15s;
}
.ad-page-btn:hover { border-color: var(--brand); color: var(--brand); }
.ad-page-btn.is-active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ad-page-btn:disabled { opacity: .35; cursor: not-allowed; }
.ad-page-info { font-size: .82rem; color: var(--text-2); margin: 0 .5rem; }

/* ===== Tabs ===== */
.ad-tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--border); margin-bottom: 1.3rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ad-tab { padding: .65rem 1rem; font-weight: 600; font-size: .9rem; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; white-space: nowrap; transition: color .15s; }
.ad-tab:hover { color: var(--text); }
.ad-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ===== Pills ===== */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 650; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.pill-premium { background: color-mix(in srgb, #f5a623 14%, transparent); color: #b57d14; border-color: transparent; }
.pill-free { background: var(--surface-2); color: var(--text-2); }
.pill-admin { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); border-color: transparent; }
.pill-open { background: color-mix(in srgb, #16a34a 12%, transparent); color: #15803d; border-color: transparent; }
.pill-closed { background: color-mix(in srgb, #e5484d 10%, transparent); color: #c0392b; border-color: transparent; }

/* ===== Tickets ===== */
.ad-tickets { display: flex; flex-direction: column; gap: .8rem; }
.ad-ticket { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem; }
.ad-ticket.is-open { border-left: 3px solid var(--brand); }
.ad-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ad-ticket-subject { font-weight: 650; display: block; }
.ad-ticket-meta { color: var(--text-2); font-size: .8rem; word-break: break-word; }
.ad-ticket-body { margin: .6rem 0; font-size: .92rem; }
.ad-ticket-reply { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; margin-bottom: .6rem; }
.ad-ticket-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ad-input { flex: 1; font: inherit; font-size: .88rem; padding: .45rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); min-width: 120px; }

/* ===== Scaffolds / Notes ===== */
.ad-scaffold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px rgba(20,18,30,.04); }
.ad-scaffold-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.2rem; }
.ad-scaffold-head svg { width: 26px; height: 26px; color: var(--brand); flex: none; margin-top: .1rem; }
.ad-scaffold-head h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
.ad-scaffold-head p { margin: 0; color: var(--text-2); font-size: .92rem; }
.ad-feature-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .55rem; }
.ad-feature-grid li { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: .65rem .8rem; font-size: .9rem; }
.ad-feature-grid svg { width: 15px; height: 15px; color: var(--brand); flex: none; }
.ad-note { display: flex; align-items: flex-start; gap: .5rem; color: var(--text-2); font-size: .84rem; margin: 1rem 0 0; line-height: 1.5; }
.ad-note svg { width: 16px; height: 16px; flex: none; margin-top: .12rem; color: var(--brand); }

/* ===== Forms ===== */
.ad-flash { display: flex; align-items: center; gap: .55rem; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; font-weight: 550; }
.ad-flash svg { width: 18px; height: 18px; flex: none; }
.ad-flash-success { background: color-mix(in srgb, #16a34a 12%, transparent); color: #15803d; border: 1px solid color-mix(in srgb, #16a34a 28%, transparent); }
.ad-flash-error { background: color-mix(in srgb, #e5484d 12%, transparent); color: #c0392b; border: 1px solid color-mix(in srgb, #e5484d 28%, transparent); }

.ad-form .ad-f { display: block; margin-bottom: 1rem; }
.ad-form .ad-f > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.ad-form input[type="text"], .ad-form input[type="email"], .ad-form input[type="number"], .ad-form input[type="date"], .ad-form input[type="url"], .ad-form textarea, .ad-form select {
    width: 100%; font: inherit; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); box-sizing: border-box; }
.ad-form input[type="file"] { width: 100%; font: inherit; font-size: .88rem; padding: .5rem 0; color: var(--text); }
.ad-form textarea { resize: vertical; }
.ad-form input:focus, .ad-form textarea:focus, .ad-form select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; border-color: var(--brand); }
.ad-f-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.ad-check { display: flex; align-items: center; gap: .55rem; font-size: .9rem; margin-bottom: .9rem; cursor: pointer; }
.ad-check input { width: 16px; height: 16px; }
.ad-form-foot { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.ad-form-foot .btn svg { width: 16px; height: 16px; }

.ad-inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.ad-toggle { display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-size: .82rem; font-weight: 600; padding: .32rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.ad-toggle-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ad-toggle.on { color: #15803d; background: color-mix(in srgb, #16a34a 12%, transparent); border-color: transparent; }
.ad-toggle.off { color: #c0392b; background: color-mix(in srgb, #e5484d 10%, transparent); border-color: transparent; }
.ad-star { background: none; border: none; cursor: pointer; color: var(--border-strong); padding: .2rem; display: inline-grid; place-items: center; }
.ad-star svg { width: 18px; height: 18px; }
.ad-star.on { color: #f5a623; }
.ad-star.on svg { fill: #f5a623; }
.ad-color { width: 38px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; vertical-align: middle; }
.ad-table tr.is-off { opacity: .55; }
.ad-user-actions { white-space: nowrap; }
.ad-user-actions .ad-inline { margin-left: .3rem; }

/* Coupon form + Redirect form */
.ad-coupon-form, .ad-redirect-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.ad-coupon-form .ad-card-head { margin-bottom: .8rem; }
.ad-file-current { display: block; font-size: .82rem; color: var(--text-2); margin-top: .3rem; }

/* Buttons */
.btn-danger { background: #e5484d; color: #fff; border: 1px solid #e5484d; }
.btn-danger:hover { background: #d23740; }

/* ===== Admin login ===== */
body.is-admin-login .site-main { padding: 0; }
body.is-admin-login .site-footer { display: none; }
.admin-login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--bg); }
.admin-login-card { width: 100%; max-width: 408px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.2rem 2rem; }
.admin-login-brand { display: flex; justify-content: center; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; margin-bottom: 1.4rem; }
.admin-login-brand small { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.admin-login-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.admin-login-mark svg { width: 18px; height: 18px; }
.admin-login-card h1 { font-size: 1.3rem; margin: 0 0 .3rem; }
.admin-login-sub { color: var(--text-2); font-size: .9rem; margin: 0 0 1.4rem; }
.admin-login-field { display: block; margin-bottom: 1rem; }
.admin-login-field span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.admin-login-field input { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); box-sizing: border-box; }
.admin-login-field input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand); }
.admin-login-btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: .5rem; margin-top: .3rem; }
.admin-login-btn svg { width: 17px; height: 17px; }
.admin-login-error { display: flex; align-items: center; gap: .5rem; background: color-mix(in srgb, #e5484d 12%, transparent); color: #c0392b; border: 1px solid color-mix(in srgb, #e5484d 30%, transparent); border-radius: var(--radius-sm); padding: .65rem .8rem; font-size: .88rem; margin-bottom: 1.1rem; }
.admin-login-error svg { width: 17px; height: 17px; flex: none; }
.admin-login-alert { display: flex; align-items: flex-start; gap: .55rem; background: color-mix(in srgb, var(--brand) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); border-radius: var(--radius-sm); padding: .75rem .85rem; font-size: .84rem; color: var(--text-2); margin-bottom: 1.1rem; line-height: 1.5; }
.admin-login-alert svg { width: 17px; height: 17px; flex: none; color: var(--brand); margin-top: .1rem; }
.admin-login-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.3rem; color: var(--text-2); text-decoration: none; font-size: .87rem; }
.admin-login-back:hover { color: var(--text); }
.admin-login-back svg { width: 15px; height: 15px; }

/* ===== Mobile responsive ===== */
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: fixed; top: 0; left: 0; bottom: 0; width: 272px; z-index: 100;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    .admin-shell.nav-open .admin-side { transform: translateX(0); }
    .admin-side-close { display: inline-grid; }
    .admin-burger { display: inline-grid; place-items: center; }
    .admin-body { padding: 1.1rem; }
    .ad-row { grid-template-columns: 1fr; }
    .admin-user-name { display: none; }
    .ad-td-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Sidebar overlay backdrop */
.admin-shell.nav-open::before {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 99; display: none;
}
@media (max-width: 900px) {
    .admin-shell.nav-open::before { display: block; }
}

@media (max-width: 640px) {
    .ad-stats { grid-template-columns: repeat(2, 1fr); }
    .ad-table { font-size: .82rem; }
    .ad-table th, .ad-table td { padding: .5rem .7rem; }
    .ad-td-name-text { max-width: 130px; }
    .ad-toggle-text { display: none; }
    .admin-page-head { flex-direction: column; align-items: flex-start; gap: .7rem; }
    .ad-tools-controls { width: 100%; }
    .ad-search { min-width: 0; flex: 1; }
    .ad-bar-label { width: 100px; font-size: .8rem; }
    .ad-ticket-actions { flex-direction: column; align-items: stretch; }
    .ad-ticket-actions .ad-input { min-width: 0; }
    .ad-user-actions { display: flex; flex-direction: column; gap: .3rem; }
    .ad-user-actions .ad-inline { margin-left: 0; }
    /* Header stays a single row: burger + title on the left, Sign Out on the right. */
    .admin-page-head { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: .6rem; }
    .admin-page-head h1 { font-size: 1.15rem; }
    .admin-top-user { margin-left: auto; }
}

@media (max-width: 420px) {
    /* On very narrow screens collapse Sign Out to an icon to keep it on the right. */
    .admin-logout span { display: none; }
    .admin-logout { padding: 0 .55rem; }
}

@media (max-width: 420px) {
    .ad-stats { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
    .ad-stat { padding: .8rem .6rem; }
    .ad-stat-n { font-size: 1.25rem; }
    .ad-f-row { grid-template-columns: 1fr; }
    .ad-page-btn { min-width: 30px; height: 30px; font-size: .8rem; }
}

/* ===== Phase 29 additions ===== */

/* Password eye toggle */
.admin-pw-wrap { position: relative; }
.admin-pw-wrap input { width: 100%; padding-right: 2.8rem; box-sizing: border-box; }
.admin-pw-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-2); cursor: pointer; padding: .2rem; display: grid; place-items: center; }
.admin-pw-eye svg { width: 18px; height: 18px; }
.admin-pw-eye .pw-eye-hide { display: none; }
.admin-pw-eye.is-visible .pw-eye-show { display: none; }
.admin-pw-eye.is-visible .pw-eye-hide { display: inline; }

/* Theme toggle — show opposite icon: moon in light, sun in dark */
.admin-theme-ic-alt { display: none; }
[data-theme="dark"] .admin-theme-ic { display: none; }
[data-theme="dark"] .admin-theme-ic-alt { display: inline-flex; }

/* Required asterisk */
.ad-req { color: #e5484d; }

/* Details/summary (collapsible) */
.ad-details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-top: .5rem; }
.ad-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-2); user-select: none; }
.ad-details summary:hover { color: var(--text); }
.ad-details[open] summary { margin-bottom: .5rem; }

/* Richtext textarea styling */
.ad-richtext { min-height: 200px; font-family: inherit; line-height: 1.65; }

/* Tax rows */
.ad-tax-row { display: flex; align-items: flex-end; gap: .5rem; padding: .8rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ad-tax-row .ad-inline-full { flex: 1; min-width: 0; }
.ad-tax-actions { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; }

/* Cookie consent */
.cookie-banner { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 9999; max-width: 380px; width: calc(100% - 2.4rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.18); padding: 1.3rem 1.4rem; font-size: .9rem; line-height: 1.55; animation: cookieSlideIn .35s ease; }
@keyframes cookieSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.cookie-banner p { margin: 0 0 .9rem; color: var(--text-2); }
.cookie-banner a { color: var(--brand); text-decoration: underline; }
.cookie-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-btns .btn { font-size: .85rem; padding: .45rem 1rem; }

/* Plan row responsive */
@media (max-width: 640px) {
    .ad-tax-row { flex-direction: column; align-items: stretch; }
    .ad-tax-actions { flex-wrap: wrap; }
}

/* Blog listing (frontend) */
.blog-listing { padding: 1rem 0; }
.blog-listing-title { font-size: 1.6rem; margin: 0 0 1.3rem; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.blog-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); text-decoration: none; color: var(--text); transition: box-shadow .2s, border-color .2s; }
.blog-card:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.blog-thumb { width: 100%; height: 180px; object-fit: cover; display: block; }
.blog-card-body { padding: 1rem 1.1rem; flex: 1; }
.blog-card-body h2 { font-size: 1.1rem; margin: 0 0 .4rem; line-height: 1.35; }
.blog-card-body p { color: var(--text-2); font-size: .88rem; margin: 0 0 .6rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-date { font-size: .8rem; color: var(--text-2); }
@media (max-width: 520px) { .blog-grid { grid-template-columns: 1fr; } }

/* ===== Phase 30 fixes ===== */

/* Dynamic brand logos */
.brand-logo { height: 44px; width: auto; display: block; }
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.footer-logo { height: 40px; }
.drawer-logo { height: 32px; width: auto; }

/* Drawer divider between primary and secondary categories */
.drawer-divider { height: 1px; background: var(--border); margin: .5rem .8rem; }

/* Admin sidebar — branded with EzyToolz purple */
.admin-brand-mark { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; }
.admin-nav-link.is-active { background: color-mix(in srgb, #7c3aed 12%, transparent); color: #7c3aed; }
.admin-nav-badge { background: #7c3aed; }
.admin-side-logo { height: 34px; width: auto; margin-right: .3rem; }

/* Rich text toolbar */
.ad-editor-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ad-editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: .4rem .5rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ad-editor-toolbar button { background: none; border: 1px solid transparent; border-radius: 4px; width: 30px; height: 28px; display: inline-grid; place-items: center; color: var(--text-2); cursor: pointer; font-size: .85rem; font-weight: 700; }
.ad-editor-toolbar button:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.ad-editor-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: auto .3rem; }
.ad-editor-area { min-height: 220px; padding: .8rem; outline: none; font-family: inherit; font-size: .92rem; line-height: 1.65; color: var(--text); overflow-y: auto; }
.ad-editor-area:focus { background: var(--surface); }
.ad-editor-area h1, .ad-editor-area h2, .ad-editor-area h3 { margin-top: .5rem; }
.ad-editor-area ul, .ad-editor-area ol { padding-left: 1.5rem; }
.ad-editor-area a { color: var(--brand); }
.ad-editor-area img { max-width: 100%; border-radius: 6px; }

/* Billing mock mode warning */
.billing-mock-notice { background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; display: flex; align-items: flex-start; gap: .5rem; }
.billing-mock-notice svg { flex: none; width: 18px; height: 18px; margin-top: .1rem; }

/* ===== Category page tabs ===== */
.cat-tabs {
    display: flex; gap: .4rem; flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5rem; padding-bottom: .1rem;
}
.cat-tab {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .5rem 1rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2); font: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: all .15s;
}
.cat-tab:hover { border-color: var(--accent, var(--brand)); color: var(--text); }
.cat-tab.is-active {
    background: var(--accent, var(--brand)); color: #fff;
    border-color: var(--accent, var(--brand));
}
.cat-tab-count {
    font-size: .75rem; font-weight: 700;
    background: rgba(255,255,255,.2); border-radius: 99px;
    padding: .05rem .4rem; min-width: 18px; text-align: center;
}
.cat-tab:not(.is-active) .cat-tab-count {
    background: var(--surface-2); color: var(--text-2);
}
@media (max-width: 520px) {
    .cat-tabs { gap: .3rem; }
    .cat-tab { padding: .4rem .7rem; font-size: .82rem; }
}
.cat-card-wrap { display: contents; }

/* ===== Category SEO intro section ===== */
.cat-intro {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem;
    align-items: start;
    margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--border);
}
.cat-intro-body h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.cat-intro-body p { color: var(--text-2); line-height: 1.7; margin: 0 0 .9rem; font-size: .95rem; }
.cat-intro-body p:last-child { margin-bottom: 0; }
.cat-intro-side { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; justify-content: center; }
.cat-intro-image { width: 100%; max-width: 380px; height: auto; display: block; }
.cat-intro-visual { border-radius: 16px; overflow: hidden; }
.cat-intro-visual svg { width: 100%; height: auto; display: block; }
.cat-intro-visual g svg { width: 48px; height: 48px; }
.cat-intro-highlights {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: .55rem;
}
.cat-intro-highlights li {
    display: flex; align-items: center; gap: .5rem;
    font-size: .92rem; font-weight: 550; color: var(--text);
}
.cat-intro-highlights svg { width: 18px; height: 18px; color: var(--accent, var(--brand)); flex: none; }

@media (max-width: 760px) {
    .cat-intro { grid-template-columns: 1fr; gap: 1.5rem; }
    .cat-intro-visual { max-width: 320px; }
    .cat-intro-image { max-width: 300px; }
}

/* ===== Category FAQ section ===== */
.cat-faq {
    margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.cat-faq h2 { font-size: 1.3rem; margin: 0 0 1.2rem; text-align: center; }
.cat-faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: .5rem; }
.cat-faq-item {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); overflow: hidden;
    transition: border-color .15s;
}
.cat-faq-item[open] { border-color: var(--accent, var(--brand)); }
.cat-faq-item summary {
    padding: .9rem 1.1rem; font-weight: 650; font-size: .95rem;
    cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    user-select: none; color: var(--text);
}
.cat-faq-item summary::-webkit-details-marker { display: none; }
.cat-faq-item summary::after {
    content: '+'; font-size: 1.3rem; font-weight: 400; color: var(--text-2);
    flex: none; width: 24px; text-align: center;
    transition: transform .2s;
}
.cat-faq-item[open] summary::after { content: '−'; color: var(--accent, var(--brand)); }
.cat-faq-item summary:hover { color: var(--accent, var(--brand)); }
.cat-faq-item p {
    padding: 0 1.1rem 1rem; margin: 0;
    color: var(--text-2); font-size: .92rem; line-height: 1.65;
}

@media (max-width: 520px) {
    .cat-faq-item summary { font-size: .9rem; padding: .75rem .9rem; }
    .cat-faq-item p { padding: 0 .9rem .85rem; font-size: .88rem; }
}

/* Tool card badge (e.g. country flags) */
.tool-card-badge { font-size: .7rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: .1rem .4rem; margin-left: .3rem; vertical-align: middle; white-space: nowrap; letter-spacing: .01em; }

/* ==========================================================================
   PHASE 39 — Platform modernization
   Consistent action buttons, progressive disclosure, reset controls, and
   styling for the new tools. Loaded last so it refines earlier rules.
   ========================================================================== */

/* --- Secondary "soft" button: always reads as a button, even at rest -------
   (Fixes Copy/Download links that previously looked like buttons only on
   hover.) .btn-soft is the canonical secondary action; the scoped rules below
   retro-fit every existing ghost button used inside tool action rows.        */
.btn-soft {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-soft:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
    text-decoration: none;
}
.btn-soft svg { width: 1em; height: 1em; }

/* Make Copy / Download / Clear buttons in tool action areas look like real,
   tappable buttons at all times — not transparent text. */
.txt-actions .btn-ghost,
.txt-copyrow .btn-ghost,
.txt-listrow .btn-ghost,
.result .btn-ghost,
.tool-body .txt-actions .btn-ghost {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}
.txt-actions .btn-ghost:hover,
.txt-copyrow .btn-ghost:hover,
.txt-listrow .btn-ghost:hover,
.result .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

/* Crisp, consistent keyboard focus across every interactive control. */
.btn:focus-visible,
.icon-btn:focus-visible,
.txt-optbtn:focus-visible,
.seg-opt input:focus-visible + span,
.tool-action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.txt-area:focus-visible,
.txt-input:focus-visible,
.select:focus-visible,
input[type="number"]:focus-visible,
input[type="text"]:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* --- Progressive disclosure -------------------------------------------------
   Options and actions are hidden until the user provides input (a file, text,
   etc.), then revealed with a soft fade so the first view stays focused on the
   primary action — the pattern used by leading tool platforms.               */
.tk-hidden { display: none !important; }
.tk-reveal { animation: tkReveal .26s cubic-bezier(.22,.61,.36,1) both; }
@keyframes tkReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tk-reveal { animation: none; }
}

/* Built-in "Start over" / reset control injected into file tools. */
.tool-reset { margin-top: .2rem; }
.tool-form.has-file .dropzone { border-style: solid; border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }

/* --- Result card: actions row + meta --------------------------------------- */
.result-actions {
    display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
    margin-top: 1rem;
}
.result-actions .btn { margin-top: 0; }
.result-meta { margin: .35rem 0 0; }

/* --- Markdown to HTML preview ---------------------------------------------- */
.md-preview {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); padding: 1rem 1.2rem; min-height: 200px;
    overflow-x: auto; line-height: 1.6;
}
.md-preview > :first-child { margin-top: 0; }
.md-preview > :last-child { margin-bottom: 0; }
.md-preview h1, .md-preview h2, .md-preview h3 { font-family: var(--font-display); margin: 1.1em 0 .5em; }
.md-preview h1 { font-size: 1.7rem; } .md-preview h2 { font-size: 1.4rem; } .md-preview h3 { font-size: 1.15rem; }
.md-preview p { margin: .6em 0; }
.md-preview a { color: var(--accent); }
.md-preview code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
    background: var(--surface-2); padding: .12em .4em; border-radius: 5px;
}
.md-preview pre {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .9rem 1rem; overflow-x: auto;
}
.md-preview pre code { background: none; padding: 0; }
.md-preview blockquote {
    margin: .7em 0; padding: .2em 1rem; border-left: 3px solid var(--accent);
    color: var(--text-2); background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.md-preview ul, .md-preview ol { padding-left: 1.4rem; margin: .6em 0; }
.md-preview table { border-collapse: collapse; width: 100%; margin: .7em 0; font-size: .92rem; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: .45rem .65rem; text-align: left; }
.md-preview th { background: var(--surface-2); }
.md-preview hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md-preview img { max-width: 100%; height: auto; border-radius: 6px; }

/* --- Google Index Checker -------------------------------------------------- */
.gic-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.gic-badge { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; }
.gic-badge.ok  { background: color-mix(in srgb, #16a34a 12%, transparent); color: #16a34a; border: 1px solid color-mix(in srgb,#16a34a 30%,transparent); }
.gic-badge.bad { background: color-mix(in srgb, #e5484d 12%, transparent); color: #e5484d; border: 1px solid color-mix(in srgb,#e5484d 30%,transparent); }
.gic-list { display: grid; gap: .55rem; }
.gic-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem .9rem;
    padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.gic-row.is-invalid { opacity: .7; }
.gic-url { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; flex: 1 1 240px; }
.gic-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.gic-actions .btn-sm { padding: .35rem .7rem; font-size: .8rem; }

/* --- Small responsive refinements ------------------------------------------ */
@media (max-width: 560px) {
    .result-actions { flex-direction: column; }
    .result-actions .btn { width: 100%; justify-content: center; }
    .gic-row { flex-direction: column; align-items: stretch; }
    .gic-actions .btn-sm { flex: 1; justify-content: center; }
}

/* --- Selected-file bar (shown in place of the upload box after a file is added)
   Keeps the page short — the large dropzone no longer takes vertical space. */
.ez-filebar {
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem .85rem; margin-bottom: .2rem;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-size: .9rem;
}
.ez-filebar::before {
    content: "✓"; display: inline-flex; align-items: center; justify-content: center;
    width: 1.45rem; height: 1.45rem; border-radius: 50%; flex-shrink: 0;
    background: color-mix(in srgb, #16a34a 16%, transparent); color: #16a34a;
    font-weight: 700; font-size: .78rem;
}
.ez-filebar-name { flex: 1; font-weight: 600; word-break: break-all; line-height: 1.3; }
.ez-filebar-change {
    background: none; border: none; color: var(--accent); font-weight: 600;
    cursor: pointer; font-size: .85rem; white-space: nowrap; padding: .25rem .5rem; border-radius: 6px;
}
.ez-filebar-change:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ── Button alignment (consistent across all tools) ──────────────────────
   .tool-form is a grid, so a bare .btn child would stretch to the full column
   width. Modern tool UIs use content-width buttons aligned to the start, so we
   make direct-child buttons size to their label. Buttons that genuinely need
   full width opt in with .btn-block. Group related actions in .tool-actions. */
.tool-form > .btn,
.tool-form > a.btn { justify-self: start; }
.tool-form > .btn.btn-block { justify-self: stretch; }

.tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.tool-actions.is-center { justify-content: center; }
.tool-actions.is-end { justify-content: flex-end; }
.tool-actions .btn { justify-content: center; }
@media (max-width: 560px) {
    .tool-actions { flex-direction: column; align-items: stretch; }
    .tool-actions .btn { width: 100%; }
}

/* ── Business tools: shared layout helpers ─────────────────────────────── */

/* Two-column calculator layout (inputs | results) that fills the card width
   on desktop and stacks on mobile — fixes the "empty space on the right". */
.calc-cols { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: start; }
@media (min-width: 720px) { .calc-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; } }
.calc-results { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.calc-results .txt-statgrid { margin-top: 0; }

/* Line-item rows that never overflow on mobile. On wide screens it's a single
   row; on narrow screens the qty/price/remove wrap under the description. */
.li-row { display: grid; gap: .5rem; margin-bottom: .5rem;
    grid-template-columns: minmax(0,3fr) minmax(0,1fr) minmax(0,1.2fr) auto; align-items: center; }
.li-row .txt-input { min-width: 0; width: 100%; }
.li-del { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    flex-shrink: 0; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
    border-radius: 8px; cursor: pointer; padding: 0; }
.li-del:hover { border-color: #e5484d; color: #e5484d; }
.li-del svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
    .li-row { grid-template-columns: 1fr 1fr auto; }
    .li-row .li-desc { grid-column: 1 / -1; }
}

/* Logo / image upload tile used by the document generators */
.logo-up { display: flex; align-items: center; gap: .8rem; }
.logo-up-box { width: 72px; height: 72px; flex-shrink: 0; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface-2); cursor: pointer; color: var(--text-2); }
.logo-up-box:hover { border-color: var(--accent); color: var(--accent); }
.logo-up-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-up-box svg { width: 22px; height: 22px; }

/* Mode tabs (Basic / Advanced) */
.mode-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.mode-tabs button { border: none; background: none; padding: .5rem .9rem; border-radius: 7px; font-weight: 600;
    font-size: .9rem; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.mode-tabs button.active { background: var(--accent); color: var(--brand-ink); }
.mode-tabs button .premium-badge { font-size: .68rem; }

/* Premium badge + locked overlay */
.premium-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 99px;
    background: linear-gradient(135deg, #f59e0b, #f76808); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.is-locked { opacity: .55; pointer-events: none; filter: saturate(.6); }

/* ── Calculator tools: narrow the whole shell so they read like real devices ── */
.tool-layout[data-tool-key="calculators/basic-calculator"] .tool-shell { width: min(450px, 100% - 2rem); }
.tool-layout[data-tool-key="calculators/scientific-calculator"] .tool-shell { width: min(600px, 100% - 2rem); }
/* Inner shells then simply fill the narrowed card */
.tool-layout[data-tool-key="calculators/basic-calculator"] .calc-shell,
.tool-layout[data-tool-key="calculators/scientific-calculator"] #sci { max-width: 100%; }

/* ── Ad slots (shown to Free & AI Pro plans only) ───────────────────── */
.ad-slot { margin: 1rem auto; max-width: 1100px; padding: .5rem 1rem; text-align: center; }
.ad-slot .ad-label { display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); opacity: .6; margin-bottom: .25rem; }
.ad-slot-header { border-bottom: 1px solid var(--border); }
.ad-slot-footer { border-top: 1px solid var(--border); }
@media (min-width: 769px) { .ad-mobile-only { display: none; } }

/* ── Plan / upgrade lock panel for premium-API tools ────────────────── */
.tool-lock { max-width: 560px; margin: 1rem auto; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 2rem 1.5rem; }
.tool-lock .lock-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tool-lock h3 { margin: 0 0 .4rem; }
.tool-lock p { color: var(--text-2); margin: 0 0 1.2rem; }

/* ── Pricing page: 4-plan grid, billing toggle, currency switch ─────── */
.pricing-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: center; margin: 1.2rem 0 .4rem; }
.billing-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.billing-toggle .bt-opt { border: none; background: none; cursor: pointer; padding: .45rem 1rem; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--text-2); display: inline-flex; align-items: center; gap: .4rem; }
.billing-toggle .bt-opt.is-active { background: var(--accent); color: #fff; }
.bt-save { font-size: .68rem; font-weight: 700; background: color-mix(in srgb, #16a34a 18%, transparent); color: #16a34a; padding: .05rem .4rem; border-radius: 999px; }
.billing-toggle .bt-opt.is-active .bt-save { background: rgba(255,255,255,.25); color: #fff; }
.currency-switch { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--text-2); }
.currency-switch .cur-opt { padding: .25rem .55rem; border-radius: 8px; font-weight: 700; text-decoration: none; color: var(--text-2); border: 1px solid transparent; }
.currency-switch .cur-opt.is-active { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.upgrade-grid.plans-4 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 680px) { .upgrade-grid.plans-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .upgrade-grid.plans-4 { grid-template-columns: repeat(4, 1fr); } }
.plan-card { position: relative; display: flex; flex-direction: column; }
.plan-card.is-best { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.plan-card.is-current { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.plan-badge-best { background: #16a34a; }
.plan-tagline { font-size: .82rem; color: var(--text-2); margin: .1rem 0 .8rem; min-height: 2.4em; }
.plan-sub { margin-top: .2rem; }
.plan-billed { font-size: .74rem; color: var(--text-2); }
.plan-features { flex: 1; }
.coupon-msg { font-size: .78rem; margin: .4rem 0 0; }
.coupon-msg.is-ok { color: #16a34a; }
.coupon-msg.is-err { color: #e5484d; }
.pricing-foot { text-align: center; margin-top: 1.4rem; }

/* ── Plan badges / pills ────────────────────────────────────────────── */
.plan-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.plan-pill svg { width: 14px; height: 14px; }
.plan-pill-free   { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.plan-pill-pro    { background: color-mix(in srgb, #0091ff 16%, transparent); color: #0091ff; }
.plan-pill-ai_pro { background: color-mix(in srgb, #8e4ec6 18%, transparent); color: #8e4ec6; }
.plan-pill-pro_ai { background: linear-gradient(90deg, color-mix(in srgb,#0091ff 20%,transparent), color-mix(in srgb,#8e4ec6 22%,transparent)); color: var(--text); }

.hdr-plan-badge { display: inline-block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .35rem; border-radius: 5px; margin-right: .35rem; vertical-align: middle; }
.hdr-plan-free   { background: rgba(255,255,255,.18); }
.hdr-plan-pro    { background: #0091ff; color: #fff; }
.hdr-plan-ai_pro { background: #8e4ec6; color: #fff; }
.hdr-plan-pro_ai { background: linear-gradient(90deg,#0091ff,#8e4ec6); color: #fff; }

/* ── Dashboard billing additions ────────────────────────────────────── */
.dash-btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.dash-inline { display: inline; }
.dash-cancel-btn { color: #e5484d; }
.dash-cancel-btn:hover { background: color-mix(in srgb, #e5484d 10%, transparent); }
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table th, .dash-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.dash-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }

/* AI usage meter */
.ai-meter-head { font-size: .92rem; margin-bottom: .5rem; }
.ai-meter-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.ai-meter-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.ai-meter-unlimited .ai-meter-num { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: 1.05rem; color: #8e4ec6; }
.ai-meter-unlimited .ai-meter-num svg { width: 22px; height: 22px; }
.ai-meter .small a, .ai-meter-unlimited .small a { color: var(--accent); }

/* ── Animated hero (heading reveal + rotating word + floating icons) ── */
.hero { position: relative; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 2; }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; line-height: 1.08; }
.hero-line { display: block; }

/* staggered fade-up reveal */
.reveal { opacity: 0; transform: translateY(16px); animation: heroReveal .7s cubic-bezier(.22,.61,.36,1) forwards; }
.reveal-1 { animation-delay: .08s; } .reveal-2 { animation-delay: .20s; }
.reveal-3 { animation-delay: .34s; } .reveal-4 { animation-delay: .46s; }
@keyframes heroReveal { to { opacity: 1; transform: translateY(0); } }

/* typewriter highlighted word (matches reference: coloured box + blinking caret) */
.changing-word { color: #fff; background-color: #3b82f6; padding: 0.05em 0.4em; border-radius: 8px; display: inline-block; transition: background-color .3s ease, opacity .25s ease; }
.changing-word::after { content: '|'; animation: caretBlink 1s infinite; font-weight: 100; margin-left: .1rem; }
.changing-word.no-caret::after { content: ''; }
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* floating background icons */
.hero-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.hero-float { position: absolute; color: var(--accent); opacity: .07; animation: heroFloat 18s ease-in-out infinite; }
.hero-float svg { width: 100%; height: 100%; }
.hf-1 { top: 12%; left: 6%;  width: 52px; height: 52px; animation-duration: 19s; }
.hf-2 { top: 22%; right: 9%; width: 64px; height: 64px; animation-duration: 23s; animation-delay: -3s; color: #8e4ec6; }
.hf-3 { top: 64%; left: 11%; width: 46px; height: 46px; animation-duration: 21s; animation-delay: -7s; color: #0091ff; }
.hf-4 { top: 72%; right: 14%; width: 58px; height: 58px; animation-duration: 25s; animation-delay: -2s; }
.hf-5 { top: 40%; left: 3%;  width: 40px; height: 40px; animation-duration: 20s; animation-delay: -10s; color: #12a594; }
.hf-6 { top: 8%;  right: 22%; width: 38px; height: 38px; animation-duration: 22s; animation-delay: -5s; color: #0091ff; }
.hf-7 { top: 50%; right: 4%; width: 44px; height: 44px; animation-duration: 24s; animation-delay: -12s; color: #f59e0b; }
.hf-8 { top: 84%; left: 42%; width: 36px; height: 36px; animation-duration: 26s; animation-delay: -8s; color: #8e4ec6; }
.hf-9 { top: 30%; left: 18%; width: 34px; height: 34px; animation-duration: 23s; animation-delay: -6s; color: #12a594; }
.hf-10 { top: 58%; right: 24%; width: 40px; height: 40px; animation-duration: 27s; animation-delay: -14s; color: #f59e0b; }
.changing-word { white-space: nowrap; }
@keyframes heroFloat {
    0%   { transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(-18px) rotate(8deg); }
    50%  { transform: translateY(8px) rotate(-6deg); }
    75%  { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; animation: none; }
    .changing-word::after { animation: none; content: ''; }
    .hero-float { animation: none; }
}

/* ── Account deletion (danger zone) ─────────────────────────────────── */
.dash-delete { border-color: color-mix(in srgb, #e5484d 35%, var(--border)); }
.dash-delete h3 { display: flex; align-items: center; gap: .4rem; color: #e5484d; }
.dash-delete h3 svg { width: 18px; height: 18px; }
.acct-delete-trigger { background: transparent; color: #e5484d; border: 1.5px solid #e5484d; font-weight: 600; }
.acct-delete-trigger:hover { background: #e5484d; color: #fff; }
.acct-delete-trigger svg { width: 16px; height: 16px; }
.dash-delete-confirm { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.dash-delete-confirm .txt-input { max-width: 240px; letter-spacing: .08em; font-weight: 700; }
.dash-delete-go { background: #e5484d; color: #fff; border-color: #e5484d; }
.dash-delete-go:hover:not(:disabled) { background: #c93a3f; color: #fff; }
.dash-delete-go:disabled { opacity: .5; cursor: not-allowed; }

/* ── Pricing page: wider shell + roomier 4-card layout (item 9) ─────── */
.tool-shell.upgrade-page { width: min(1240px, 100% - 3rem); }
.upgrade-grid.plans-4 { max-width: none; gap: 1.35rem; align-items: stretch; }
.upgrade-grid.plans-4 .plan-card { padding: 1.6rem 1.4rem; }
@media (min-width: 700px) and (max-width: 1039px) { .upgrade-grid.plans-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .upgrade-grid.plans-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pricing-controls { justify-content: center; }

/* ── Pricing-page FAQ spacing ───────────────────────────────────────── */
.pricing-faq { margin-top: 2.5rem; }
.pricing-faq .section-head { text-align: center; margin-bottom: 1.2rem; }
.pricing-faq .faq-list { max-width: 760px; margin: 0 auto; }

/* ── Coupon carousel on pricing page (item 11) ──────────────────────── */
.coupon-strip { margin: 1.6rem auto 0; max-width: 1100px; }
.coupon-strip-head { display: flex; align-items: center; gap: .45rem; justify-content: center; font-size: .85rem; color: var(--text-2); margin-bottom: .7rem; }
.coupon-strip-head svg { width: 16px; height: 16px; color: var(--accent); }
.coupon-cards { display: flex; gap: .7rem; overflow-x: auto; padding: .3rem; scroll-snap-type: x mandatory; justify-content: center; flex-wrap: wrap; }
.coupon-card { scroll-snap-align: start; display: inline-flex; flex-direction: column; align-items: flex-start; gap: .15rem; min-width: 150px; padding: .7rem .9rem; border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); cursor: pointer; transition: transform .12s, border-color .12s; text-align: left; }
.coupon-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.coupon-card.copied { border-style: solid; border-color: #16a34a; background: color-mix(in srgb, #16a34a 10%, transparent); }
.coupon-card-off { font-weight: 800; font-size: .95rem; color: var(--accent); }
.coupon-card-code { font-family: var(--font-mono, monospace); font-weight: 700; letter-spacing: .04em; background: var(--surface); border-radius: 6px; padding: .05rem .4rem; }
.coupon-card-copy { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--text-2); }
.coupon-card-copy svg { width: 12px; height: 12px; }

/* ── Admin user-management inline plan select (item 8) ──────────────── */
.ad-mini-select { height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font-size: .82rem; padding: 0 .4rem; max-width: 120px; }
.ad-user-plan { display: inline-flex; gap: .3rem; align-items: center; }

/* ── Auth notice (password-reset confirmation) ──────────────────────── */
.auth-notice { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem .9rem; margin-bottom: 1rem; border-radius: var(--radius-sm, 10px); background: color-mix(in srgb, #16a34a 10%, transparent); color: #15803d; font-size: .9rem; line-height: 1.5; }
.auth-notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════════
   Admin sidebar — dark navy/purple brand theme + collapse (items 5 & 9)
   The sidebar is always dark (independent of light/dark content theme)
   for a professional SaaS console look.
   ════════════════════════════════════════════════════════════════════ */
.admin-side {
    --as-bg: #031b4e;            /* EzyToolz deep navy */
    --as-bg-2: #0a2a66;
    --as-accent: #5b8def;        /* blue accent (badges/borders) */
    --as-text: #cdd6ea;
    --as-text-dim: #8fa0c0;
    --as-active-bg: rgba(255,255,255,.12);
    background: linear-gradient(180deg, #0a2a66 0%, #031b4e 55%, #02153d 100%);
    border-right: 1px solid rgba(255,255,255,.08);
    color: var(--as-text);
    transition: width .18s ease;
}
.admin-side-top { gap: .4rem; }
.admin-side .admin-brand { color: #fff; flex: 1; min-width: 0; }
.admin-side .admin-brand-mark { background: rgba(255,255,255,.18); color: #fff; }
.admin-side .admin-brand-text { color: #fff; }
.admin-side .admin-brand-text small { color: var(--as-text-dim); }

.admin-side-collapse {
    display: grid; place-items: center; width: 30px; height: 30px; flex: none;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px; color: var(--as-text); cursor: pointer; transition: background .15s, color .15s;
}
.admin-side-collapse:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-side-collapse svg { width: 17px; height: 17px; }

.admin-side .admin-nav-link { color: var(--as-text); font-weight: 550; border-radius: 9px; }
.admin-side .admin-nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-side .admin-nav-link:focus-visible { outline: 2px solid #FF7A00; outline-offset: 2px; }
.admin-side .admin-nav-link.is-active {
    background: linear-gradient(135deg, #FF8A00 0%, #FF5E00 100%);
    color: #fff; font-weight: 650;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.admin-side .admin-nav-link.is-active:hover { background: linear-gradient(135deg, #FF8A00 0%, #FF5E00 100%); color: #fff; }
.admin-side .admin-nav-link.is-active .admin-nav-ic { color: #fff; }
.admin-side .admin-nav-link.is-active .admin-nav-badge { background: rgba(255,255,255,.25); color: #fff; }
.admin-side .admin-nav-ic { color: var(--as-text-dim); transition: color .15s; }
.admin-side .admin-nav-link:hover .admin-nav-ic { color: #fff; }
.admin-side .admin-nav-badge { background: var(--as-accent); color: #031b4e; font-weight: 700; }

.admin-side-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.admin-side .admin-theme-btn,
.admin-side .admin-back-link {
    color: var(--as-text); border-color: rgba(255,255,255,.08);
}
.admin-side .admin-theme-btn:hover,
.admin-side .admin-back-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side .admin-side-foot { color: var(--as-text); border-radius: 9px; transition: color .15s, background .15s; }
.admin-side .admin-side-foot:hover { color: #FF8A00; background: rgba(255,255,255,.07); }
.admin-side .admin-side-foot:hover svg { color: #FF8A00; }

/* ── Collapsed state: icons only ── */
.admin-shell.side-collapsed { grid-template-columns: 68px 1fr; }
.admin-shell.side-collapsed .admin-side { padding-left: .5rem; padding-right: .5rem; }
.admin-shell.side-collapsed .admin-brand-text,
.admin-shell.side-collapsed .admin-nav-label,
.admin-shell.side-collapsed .admin-theme-label,
.admin-shell.side-collapsed .admin-back-link span,
.admin-shell.side-collapsed .admin-nav-badge { display: none; }
.admin-shell.side-collapsed .admin-brand { justify-content: center; padding: .3rem 0 1rem; }
.admin-shell.side-collapsed .admin-nav-link { justify-content: center; padding: .6rem 0; }
.admin-shell.side-collapsed .admin-side-collapse { transform: rotate(180deg); }
.admin-shell.side-collapsed .admin-theme-btn,
.admin-shell.side-collapsed .admin-back-link { justify-content: center; }
/* tooltip on hover when collapsed */
.admin-shell.side-collapsed .admin-nav-link { position: relative; }
.admin-shell.side-collapsed .admin-nav-link::after {
    content: attr(data-label); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: #1e1b3a; color: #fff; padding: .3rem .6rem; border-radius: 6px; font-size: .8rem; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 50; border: 1px solid rgba(255,255,255,.1);
}
.admin-shell.side-collapsed .admin-nav-link:hover::after { opacity: 1; }
@media (max-width: 880px) {
    /* On mobile the sidebar is a drawer; collapse doesn't apply. */
    .admin-shell.side-collapsed { grid-template-columns: 1fr; }
    .admin-side-collapse { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   Mobile fixes — admin Tools dashboard + user Account settings (items 7 & 8)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 880px) {
    /* Prevent the wide admin tables from pushing the page sideways: the table
       scrolls inside its own wrapper, the page itself never overflows. */
    .admin-main { overflow-x: hidden; max-width: 100%; }
    .ad-card { max-width: 100%; }
    .ad-table-wrap { margin: 0; max-width: 100%; overflow-x: auto; }
    .ad-table th, .ad-table td { padding: .55rem .6rem; }
    .ad-table { font-size: .84rem; }
    /* The legend wraps full-width and never gets clipped on the right. */
    .ad-note { font-size: .8rem; }
}

@media (max-width: 600px) {
    /* Even, modest gutters. The .wrap already sets side margins via its width
       calc, so we must NOT add padding on top (that doubled the spacing and
       squeezed the content). Slightly tighter than default for more room. */
    .dashboard.wrap { width: min(var(--wrap), 100% - 1.5rem); overflow-x: hidden; padding-left: 0; padding-right: 0; }
    .dash-panel { min-width: 0; }
    .dash-card { padding: 1.1rem 1rem; max-width: 100%; box-sizing: border-box; }
    .dash-row { flex-wrap: wrap; gap: .15rem .5rem; }
    .dash-table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
    .dash-btn-row { flex-direction: column; align-items: stretch; }
    .dash-btn-row .btn, .dash-btn-row form, .dash-btn-row .dash-inline { width: 100%; }
    /* Inputs were being cut off on the right — constrain every field to the card. */
    .dash-card .field, .dash-card form { min-width: 0; width: 100%; }
    .dash-card input, .dash-card select, .dash-card textarea, .dash-card .txt-input {
        width: 100%; max-width: 100%; box-sizing: border-box;
    }
    /* Profile row stacks so the avatar + file input each get full width. */
    .settings-profile { flex-direction: column; align-items: flex-start; gap: .9rem; }
    .settings-profile .field { width: 100%; }
    .ai-meter-head { flex-wrap: wrap; }
    .dash-delete p, .dash-card p { overflow-wrap: anywhere; }
}

/* ── Admin sidebar scrollbar: thin, subtle, on-hover (item 2) ───────── */
.admin-side { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.admin-side:hover { scrollbar-color: rgba(201,198,224,.45) rgba(0,0,0,.25); }
.admin-side::-webkit-scrollbar { width: 6px; }
.admin-side::-webkit-scrollbar-track { background: transparent; border-radius: 8px; }
.admin-side::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; transition: background .2s; }
.admin-side:hover::-webkit-scrollbar-track { background: rgba(0,0,0,.25); }
.admin-side:hover::-webkit-scrollbar-thumb { background: rgba(201,198,224,.5); }
.admin-side:hover::-webkit-scrollbar-thumb:hover { background: rgba(201,198,224,.8); }
/* same treatment for the inner nav if it scrolls */
.admin-nav { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.admin-nav:hover { scrollbar-color: rgba(201,198,224,.45) transparent; }
.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; }
.admin-nav:hover::-webkit-scrollbar-thumb { background: rgba(201,198,224,.5); }

/* ════════════════════════════════════════════════════════════════════
   Featured tools carousel (homepage)
   ════════════════════════════════════════════════════════════════════ */
.featured-section { margin-top: 2.5rem; }
.featured-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.featured-head h2 { margin: 0 0 .25rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.featured-head .lede { margin: 0; }
.featured-nav { display: flex; gap: .5rem; flex: none; }
.featured-arrow { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.featured-arrow:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.featured-arrow svg { width: 18px; height: 18px; }
.featured-arrow:disabled { opacity: .4; cursor: default; }
.featured-arrow:disabled:hover { background: var(--surface); color: var(--text); border-color: var(--border); }

.featured-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 345px);
    gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .3rem .2rem 1rem;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.featured-track::-webkit-scrollbar { display: none; }
.featured-card {
    scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, 0 12px 30px rgba(0,0,0,.12)); }
.featured-card-media {
    position: relative; height: 172px; display: grid; place-items: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent) 6%, var(--surface)));
}
.featured-card-badge { position: absolute; top: .7rem; left: .7rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--surface); padding: .2rem .5rem; border-radius: 99px; }
.featured-card-ico { color: var(--accent); }
.featured-card-ico svg { width: 52px; height: 52px; }
.featured-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.featured-card-body h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.featured-card-body p { margin: 0 0 1rem; color: var(--text-2); font-size: .9rem; line-height: 1.5; flex: 1; }
.featured-card-cta { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent); font-weight: 650; font-size: .9rem; text-decoration: none; }
.featured-card-cta svg { width: 15px; height: 15px; transition: transform .15s; }
.featured-card-cta:hover svg { transform: translateX(3px); }

.featured-dots { display: flex; gap: .4rem; justify-content: center; margin-top: .2rem; }
.featured-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--border); border: none; padding: 0; cursor: pointer; transition: width .2s, background .2s; }
.featured-dot.is-active { width: 22px; background: var(--accent); }

@media (max-width: 600px) {
    .featured-nav { display: none; }
    .featured-track { grid-auto-columns: minmax(240px, 84%); }
}

/* ── Admin subscriber metrics ───────────────────────────────────────── */
.ad-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.ad-metric { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; }
.ad-metric-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.ad-metric-ic svg { width: 19px; height: 19px; }
.ad-metric b { display: block; font-size: 1.3rem; line-height: 1.1; }
.ad-metric small { color: var(--text-2); font-size: .76rem; }
.ad-metric-accent .ad-metric-ic { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ad-bar-split { height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--text-2) 18%, transparent); overflow: hidden; margin: .3rem 0 .7rem; }
.ad-bar-paid { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.ad-split-legend { display: flex; gap: 1.2rem; font-size: .85rem; color: var(--text-2); }
.ad-split-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin-right: .35rem; }
.ad-split-legend .dot-paid { background: var(--accent); }
.ad-split-legend .dot-free { background: color-mix(in srgb, var(--text-2) 40%, transparent); }
.ad-top-tools { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.ad-top-tools li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.ad-top-tools li a { text-decoration: none; color: var(--text); }
.ad-top-tools li a:hover { color: var(--accent); }

/* ── Tool page: tool-specific About / Benefits / FAQ (items 3–5) ─────── */
.tool-seo-intro p { max-width: none; font-size: 1.02rem; }
.tool-seo-intro p + p { margin-top: .9rem; }
/* Benefit cards — modern grid that balances whether there are 3 or 6 items */
.benefit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.benefit-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem 1.2rem; transition: border-color .15s, box-shadow .15s, transform .15s; }
.benefit-card:hover { border-color: color-mix(in srgb, var(--accent, var(--brand)) 45%, var(--border)); box-shadow: 0 6px 20px rgba(0,0,0,.06); transform: translateY(-2px); }
.benefit-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--accent, var(--brand)) 14%, transparent); color: var(--accent, var(--brand)); margin-bottom: .8rem; }
.benefit-ico svg { width: 20px; height: 20px; }
.benefit-title { display: block; font-weight: 680; font-size: 1rem; margin-bottom: .35rem; }
.benefit-text { display: block; color: var(--text-2); font-size: .9rem; line-height: 1.6; }
/* FAQ reads best as a centred single column (matches category-page width) */
.tool-seo-faq { width: 100%; max-width: 820px; margin-inline: auto; }
.tool-seo-faq h3 { text-align: center; }
@media (max-width: 640px) { .benefit-grid { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════════════════════════════
   Blog article: content + Recent Articles sidebar + Related Articles
   ════════════════════════════════════════════════════════════════════ */
.blog-article-page { padding-block: 1rem 3rem; }
.blog-article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
.blog-article-head { margin-bottom: 1.2rem; }
.blog-article-cat { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: .25rem .6rem; border-radius: 999px; margin-bottom: .7rem; }
.blog-article-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.15; margin: 0 0 .6rem; }
.blog-article-meta { display: flex; align-items: center; gap: .55rem; color: var(--text-2); font-size: .88rem; flex-wrap: wrap; }
.blog-article-meta time, .blog-article-author { display: inline-flex; align-items: center; gap: .35rem; }
.blog-article-author { font-weight: 600; color: var(--text); }
.blog-article-dot { color: var(--text-2); }
.blog-article-meta svg { width: 15px; height: 15px; }
.blog-article-hero { width: 100%; border-radius: 16px; margin: 0 0 1.6rem; }
.blog-article-body { font-size: 1.15rem; line-height: 1.8; }
/* The reading column already sits beside the sidebar, so let the body use the
   full column width instead of the global narrow .prose cap. */
.blog-article-body.prose { max-width: none; }
.blog-article-body p { font-size: 1.15rem; line-height: 1.8; margin: 0 0 1.2rem; }
.blog-article-body p:first-child { font-size: 1.15rem; }
.blog-article-body h2 { font-size: 1.5rem; margin: 1.8rem 0 .8rem; }
.blog-article-body h3 { font-size: 1.25rem; margin: 1.5rem 0 .7rem; }
.blog-article-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.4rem 0; display: block; }
.blog-article-body ul, .blog-article-body ol { font-size: 1.1rem; line-height: 1.75; margin: 0 0 1.2rem; padding-left: 1.4rem; }
.blog-article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.8rem; }
.blog-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: .25rem .6rem; border-radius: 999px; }
.blog-tag svg { width: 13px; height: 13px; }

/* Related articles */
.blog-related { margin-top: 2.6rem; padding-top: 1.8rem; border-top: 1px solid var(--border); }
.blog-related-title { font-size: 1.25rem; margin: 0 0 1.1rem; }
.blog-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.blog-related-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.blog-related-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: 0 8px 22px rgba(0,0,0,.07); transform: translateY(-2px); }
.blog-related-media { display: block; aspect-ratio: 16/9; background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); overflow: hidden; }
.blog-related-media img { width: 100%; height: 100%; object-fit: cover; }
.blog-rc-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: color-mix(in srgb, var(--brand) 55%, var(--text-2)); }
.blog-rc-fallback svg { width: 30px; height: 30px; }
.blog-related-body { display: block; padding: .9rem 1rem 1.1rem; }
.blog-related-cat { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); margin-bottom: .35rem; }
.blog-related-h { display: block; font-weight: 650; line-height: 1.3; margin-bottom: .35rem; }
.blog-related-ex { display: block; font-size: .85rem; color: var(--text-2); line-height: 1.5; }

/* Sidebar: Recent Articles */
.blog-aside { position: sticky; top: 90px; }
.blog-widget { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.3rem 1.25rem; }
.blog-widget-title { font-size: 1.05rem; margin: 0 0 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.blog-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.blog-recent-item { display: flex; gap: .75rem; align-items: center; padding: .55rem; border-radius: 10px; text-decoration: none; color: inherit; transition: background .15s; }
.blog-recent-item:hover { background: var(--surface-2); }
.blog-recent-media { flex: none; width: 56px; height: 56px; border-radius: 9px; overflow: hidden; background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); display: grid; place-items: center; }
.blog-recent-media img { width: 100%; height: 100%; object-fit: cover; }
.blog-recent-media .blog-rc-fallback svg { width: 20px; height: 20px; }
.blog-recent-h { display: block; font-weight: 600; font-size: .9rem; line-height: 1.35; }
.blog-recent-date { display: block; font-size: .78rem; color: var(--text-2); margin-top: .2rem; }
.blog-widget-all { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem; font-weight: 600; font-size: .88rem; color: var(--brand); text-decoration: none; }
.blog-widget-all svg { width: 15px; height: 15px; }

/* Responsive: sidebar drops below the article on tablet/mobile */
@media (max-width: 920px) {
    .blog-article-grid { grid-template-columns: 1fr; gap: 2rem; }
    .blog-aside { position: static; }
    .blog-widget { max-width: 640px; }
}

/* ── 404 error page ─────────────────────────────────────────────────── */
.error-404 { text-align: center; padding-block: 3rem 4rem; max-width: 640px; }
.error-404-img { width: 100%; max-width: 420px; height: auto; margin: 0 auto 1.5rem; display: block; }
.error-404-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 .6rem; }
.error-404-text { margin: 0 auto 1.6rem; max-width: 480px; }
.error-404-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
@media (max-width: 520px) { .error-404-img { max-width: 280px; } .error-404-actions .btn { flex: 1 1 auto; } }

/* ── Admin tools legend (separate lines, no mobile overflow) ─────────── */
.ad-legend { margin-top: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.ad-legend-row { display: flex; align-items: flex-start; gap: .4rem; margin: 0; color: var(--text-2); font-size: .84rem; line-height: 1.5; }
.ad-legend-row svg { width: 16px; height: 16px; flex: none; margin-top: .12rem; color: var(--brand); }
.ad-legend-row strong { color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   Auth pages — premium split-screen SaaS layout
   (Sign In / Sign Up / Forgot / Reset). Rendered in the "bare" layout
   with no site header/footer.
   ════════════════════════════════════════════════════════════════════ */
/* Kill all default spacing so the purple panel reaches every edge (100vh). */
.bare-layout { margin: 0; }
.bare-layout .site-main { margin: 0; padding: 0; min-height: 100vh; max-width: none; width: 100%; display: block; }

.auth-split { display: grid; grid-template-columns: 47% 53%; min-height: 100vh; min-height: 100dvh; width: 100%; }

/* ── Left: brand panel (solid EzyToolz colour, full height) ─────────── */
.auth-brand-panel {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 3rem 3.5rem; min-height: 100vh;
    background: #5B21B6;
    color: #fff;
}
.auth-brand-pattern { position: absolute; inset: 0; pointer-events: none; }
.auth-brand-pattern .auth-pat { position: absolute; color: #fff; display: block; }
.auth-brand-pattern .auth-pat svg { width: 100%; height: 100%; }

.auth-brand-content { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.auth-brand-logo { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-bottom: 2.4rem; }
.auth-brand-logo:hover { text-decoration: none; }
.auth-brand-logo-img { height: 46px; width: auto; display: block; }
.auth-brand-mark { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.16); }
.auth-brand-mark svg { width: 25px; height: 25px; }
.auth-brand-word { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.auth-brand-h { font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1.1; margin: 0 0 1rem; font-weight: 700; }
.auth-brand-cats { font-size: 1.05rem; font-weight: 600; color: rgba(255,255,255,.95); margin: 0 0 .55rem; }
.auth-brand-tag { font-size: 1.02rem; color: rgba(255,255,255,.8); margin: 0 0 2.2rem; }
.auth-brand-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; }
.auth-brand-points li { display: flex; align-items: center; gap: .7rem; font-size: .98rem; color: rgba(255,255,255,.95); }
.auth-brand-points svg { width: 22px; height: 22px; flex: none; padding: 4px; border-radius: 50%; background: rgba(255,255,255,.2); }
.auth-brand-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 2.4rem; color: rgba(255,255,255,.9); font-weight: 600; font-size: .92rem; text-decoration: none; transition: color .15s; }
.auth-brand-back:hover { color: #fff; text-decoration: none; }
.auth-brand-back svg { width: 17px; height: 17px; }

/* Mobile fallback "Back to Site" (the brand panel with its link is hidden ≤860px) */
.auth-back-mobile { display: none; }
@media (max-width: 860px) {
    .auth-back-mobile { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; margin-top: 1.4rem; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none; }
    .auth-back-mobile:hover { color: var(--brand); }
    .auth-back-mobile svg { width: 16px; height: 16px; }
}

/* ── Right: form panel + card ───────────────────────────────────────── */
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 2rem; min-height: 100vh; min-height: 100dvh; background: #f6f7fb; }
.auth-card {
    width: 100%; max-width: 430px; background: #fff;
    border-radius: 20px; padding: 2.6rem 2.4rem;
    box-shadow: 0 10px 40px rgba(17, 12, 46, .08), 0 2px 8px rgba(17, 12, 46, .04);
}
.auth-head { margin-bottom: 1.7rem; text-align: center; }
.auth-head h1 { font-size: 1.95rem; line-height: 1.15; margin: 0 0 .45rem; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { color: var(--text-2); font-size: .96rem; line-height: 1.55; margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 1.05rem; margin-top: .4rem; }
.auth-form .field { display: flex; flex-direction: column; gap: .4rem; }
.auth-submit { width: 100%; justify-content: center; margin-top: .4rem; height: 48px; font-size: 1rem; font-weight: 600; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .88rem; margin-top: -.2rem; }
.auth-remember { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-2); cursor: pointer; }
.auth-forgot { font-weight: 600; }
.auth-switch, .auth-alt { margin-top: 1.6rem; font-size: .92rem; color: var(--text-2); text-align: center; }
.auth-switch a, .auth-alt a { font-weight: 600; }
.auth-alt a { display: inline-flex; align-items: center; gap: .35rem; }
.auth-alt svg { width: 16px; height: 16px; }

.auth-notice, .auth-error { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1.1rem; line-height: 1.5; }
.auth-notice svg, .auth-error svg { width: 18px; height: 18px; flex: none; margin-top: .08rem; }
.auth-notice { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--text); }
.auth-error { background: color-mix(in srgb, #e5484d 12%, transparent); color: #b42318; }

/* ── Mobile: no split — logo + card only, no horizontal overflow ────── */
@media (max-width: 860px) {
    .auth-split { grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
    .auth-brand-panel { display: none; }
    /* Center the form on screen with comfortable, professional padding. */
    .auth-form-panel { flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; min-height: 100vh; min-height: 100dvh; }
    .auth-card { max-width: 420px; width: 100%; margin: 0 auto; }
    .auth-back-mobile { margin-top: 1.6rem; }
}
@media (max-width: 420px) {
    .auth-form-panel { padding: 1.5rem 1rem; }
    .auth-card { padding: 1.9rem 1.4rem; border-radius: 16px; }
    .auth-head h1 { font-size: 1.65rem; }
}

/* ════════════════════════════════════════════════════════════════════
   Legal / structured content pages (Terms, Privacy, Cookies, etc.)
   ════════════════════════════════════════════════════════════════════ */
.legal-page { padding-block: 1.25rem 3.5rem; }
.legal-head { max-width: 760px; margin-bottom: 2rem; }
.legal-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); line-height: 1.12; margin: .4rem 0 .7rem; }
.legal-intro { font-size: 1.08rem; color: var(--text-2); line-height: 1.6; margin: 0 0 .9rem; }
.legal-updated { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: .3rem .7rem; border-radius: 999px; margin: 0; }
.legal-updated svg { width: 15px; height: 15px; }

.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; align-items: start; }
.legal-toc { position: sticky; top: 90px; }
.legal-toc-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 0 0 .8rem; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; counter-reset: toc; }
.legal-toc a { display: block; padding: .4rem .65rem; border-radius: 8px; font-size: .9rem; color: var(--text-2); text-decoration: none; border-left: 2px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.legal-toc a:hover { background: var(--surface-2); color: var(--text); border-left-color: var(--brand); }

.legal-body { max-width: 820px; }
.legal-body-wide { max-width: 820px; }
.legal-section { margin-bottom: 1.9rem; scroll-margin-top: 90px; }
.legal-section h2 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 .7rem; }
.legal-section p { line-height: 1.75; color: var(--text); margin: 0 0 .8rem; }
.legal-section ul { margin: 0 0 .8rem; padding-left: 1.2rem; line-height: 1.7; }
.legal-section li { margin-bottom: .35rem; }
.legal-section a { color: var(--brand); font-weight: 550; }

@media (max-width: 900px) {
    .legal-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .legal-toc { position: static; order: -1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
    .legal-toc ol { gap: 0; }
}

/* ── Contact page ───────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 1rem; }
.contact-info-card { display: flex; gap: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem; }
.contact-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 11px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.contact-ico svg { width: 21px; height: 21px; }
.contact-info-card h3 { font-size: 1rem; margin: 0 0 .25rem; }
.contact-info-card p { font-size: .9rem; margin: 0 0 .2rem; line-height: 1.5; }
.contact-info-card .muted { font-size: .82rem; }

.contact-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.8rem; box-shadow: 0 8px 30px rgba(17,12,46,.05); }
.contact-form { display: flex; flex-direction: column; gap: 1.05rem; }
.contact-form .field { display: flex; flex-direction: column; gap: .4rem; }
.contact-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form input, .contact-form textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-submit { align-self: flex-start; min-width: 180px; justify-content: center; }

@media (max-width: 820px) {
    .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 520px) {
    .contact-form .field-row { grid-template-columns: 1fr; }
    .contact-form-card { padding: 1.3rem; }
    .contact-submit { width: 100%; align-self: stretch; }
}

/* ════════════════════════════════════════════════════════════════════
   Blog archive — clean modern SaaS listing (no tool layout / card wrapper)
   ════════════════════════════════════════════════════════════════════ */
.blog-archive { padding-block: 1.25rem 3.5rem; }
.blog-archive-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.blog-archive-head-text { min-width: 0; }
.blog-archive-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: .3rem 0 .4rem; }
.blog-archive-sub { color: var(--text-2); font-size: 1.05rem; margin: 0; }

.blog-search { position: relative; flex: 0 1 320px; }
.blog-search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-2); pointer-events: none; }
.blog-search input { width: 100%; box-sizing: border-box; padding: .6rem .9rem .6rem 2.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .95rem; }
.blog-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.blog-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem; }
.blog-chip { font: inherit; font-size: .86rem; font-weight: 550; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s; }
.blog-chip:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); color: var(--text); }
.blog-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.blog-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.blog-card2 { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.blog-card2:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: 0 10px 28px rgba(17,12,46,.08); transform: translateY(-3px); }
.blog-card2-media { display: block; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); overflow: hidden; }
.blog-card2-media img { width: 100%; height: 100%; object-fit: cover; }
.blog-card2-ph { display: grid; place-items: center; width: 100%; height: 100%; color: color-mix(in srgb, var(--brand) 55%, var(--text-2)); }
.blog-card2-ph svg { width: 34px; height: 34px; }
.blog-card2-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.2rem 1.25rem; flex: 1; }
.blog-card2-cat { align-self: flex-start; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: .22rem .6rem; border-radius: 999px; }
.blog-card2-title { font-size: 1.12rem; line-height: 1.3; margin: 0; }
.blog-card2-title a { color: inherit; text-decoration: none; }
.blog-card2-title a:hover { color: var(--brand); }
.blog-card2-excerpt { color: var(--text-2); font-size: .9rem; line-height: 1.6; margin: 0; flex: 1; }
.blog-card2-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .4rem; }
.blog-card2-date { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-2); }
.blog-card2-date svg { width: 14px; height: 14px; }
.blog-card2-more { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.blog-card2-more svg { width: 15px; height: 15px; transition: transform .15s; }
.blog-card2-more:hover svg { transform: translateX(3px); }

.blog-noresults { text-align: center; color: var(--text-2); padding: 2rem 0; }
.blog-empty { display: flex; align-items: center; justify-content: center; gap: .5rem; color: var(--text-2); padding: 3rem 0; }
.blog-empty svg { width: 20px; height: 20px; }
.blog-loadmore-wrap { display: flex; justify-content: center; margin-top: 2rem; }

@media (max-width: 960px) { .blog-cards { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; } }
@media (max-width: 620px) {
    .blog-cards { grid-template-columns: 1fr; }
    .blog-archive-head { gap: .9rem; margin-bottom: 1rem; }
    .blog-search { flex: 1 1 100%; }
    .blog-search input { padding-top: .55rem; padding-bottom: .55rem; font-size: .9rem; }
    .blog-filters { margin-bottom: 1.1rem; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; }
    .blog-chip { flex: none; }
}

/* Admin: blog export/import controls */
.ad-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ad-blog-import { margin-bottom: 1.25rem; }
.ad-import-form { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 560px; margin-top: .5rem; }
.ad-import-form .ad-field { width: 100%; }
.ad-radio-row { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; margin-top: .35rem; }
.ad-import-form .ad-radio { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--text); cursor: pointer; }
.ad-import-btn { align-self: flex-start; min-width: 130px; justify-content: center; }
/* Blog editor: insert-image toolbar */
.ad-editor-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ad-editor-hint { font-size: .8rem; color: var(--text-2); }

/* ════════════════════════════════════════════════════════════════════
   WYSIWYG blog editor
   ════════════════════════════════════════════════════════════════════ */
.we { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.we-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; padding: .45rem .5rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.we-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.we-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.we-btn:disabled { opacity: .4; cursor: not-allowed; }
.we-btn.is-active { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.we-btn svg { width: 17px; height: 17px; }
.we-sep { width: 1px; height: 22px; background: var(--border); margin: 0 .25rem; flex: none; }
.we-select { width: auto; min-width: 132px; max-width: 168px; flex: 0 0 auto; height: 32px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 600; padding: 0 .5rem; cursor: pointer; margin-right: .15rem; }
.we-select:focus { outline: none; border-color: var(--brand); }
.we-area { min-height: 340px; max-height: 70vh; overflow-y: auto; padding: 1.1rem 1.25rem; font-size: 1rem; line-height: 1.7; color: var(--text); outline: none; }
.we-area:focus { outline: none; }
.we-area > *:first-child { margin-top: 0; }
.we-area p { margin: 0 0 1rem; }
.we-area h1 { font-size: 1.8rem; margin: 1.2rem 0 .6rem; }
.we-area h2 { font-size: 1.5rem; margin: 1.1rem 0 .55rem; }
.we-area h3 { font-size: 1.25rem; margin: 1rem 0 .5rem; }
.we-area h4 { font-size: 1.1rem; margin: 1rem 0 .5rem; }
.we-area blockquote { margin: 0 0 1rem; padding: .4rem 0 .4rem 1rem; border-left: 3px solid var(--brand); color: var(--text-2); }
.we-area ul, .we-area ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.we-area a { color: var(--brand); }
.we-area img { max-width: 100%; height: auto; }
.we-area hr { border: none; border-top: 2px solid var(--border); margin: 1.2rem 0; }
.we-code { width: 100%; box-sizing: border-box; min-height: 340px; max-height: 70vh; padding: 1rem 1.1rem; border: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.6; resize: vertical; background: #0d0b1f; color: #d8d0f7; }

/* Figures inserted by the editor (and rendered on the public article) */
.we-fig { margin: 1.2rem 0; }
.we-fig img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.we-fig figcaption { font-size: .85rem; color: var(--text-2); text-align: center; margin-top: .45rem; }
.we-align-center { text-align: center; margin-inline: auto; }
.we-align-center img { margin-inline: auto; }
.we-align-left { float: left; margin: .4rem 1.2rem 1rem 0; }
.we-align-right { float: right; margin: .4rem 0 1rem 1.2rem; }
.we-align-full { width: 100%; }
.we-align-full img { width: 100%; }
.we-area .we-fig { position: relative; cursor: pointer; outline: 2px solid transparent; outline-offset: 3px; border-radius: 10px; transition: outline-color .12s; }
.we-area .we-fig:hover { outline-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.we-area::after, .blog-article-body::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) { .we-align-left, .we-align-right { float: none; max-width: 100%; margin: 1.2rem 0; } }

/* Floating image controls inside the editor */
.we-imgpop { position: fixed; z-index: 250; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .4rem .55rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(17,12,46,.18); }
.we-imgpop-g { display: inline-flex; align-items: center; gap: .15rem; }
.we-imgpop-lbl { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-right: .2rem; }
.we-imgpop-b { font: inherit; font-size: .8rem; min-width: 28px; height: 26px; padding: 0 .45rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.we-imgpop-b:hover { border-color: var(--brand); color: var(--brand); }
.we-imgpop-b.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.we-imgpop-del { color: #b42318; border-color: color-mix(in srgb, #b42318 30%, var(--border)); }
.we-imgpop-del:hover { background: #b42318; border-color: #b42318; color: #fff; }

/* Image dialog */
.we-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(10,8,30,.5); padding: 1rem; }
.we-modal.open { display: flex; }
.we-modal-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.we-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.we-modal-x { background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--text-2); cursor: pointer; }
.we-modal-body { padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.we-mf { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--text); }
.we-mf input, .we-mf select { width: 100%; box-sizing: border-box; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 400; }
.we-modal-msg { font-size: .85rem; color: var(--text-2); min-height: 1em; }
.we-modal-msg.is-error { color: #b42318; }
.we-modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.2rem; border-top: 1px solid var(--border); }

/* ════════════════════════════════════════════════════════════════════
   Pricing — detailed plan comparison table
   ════════════════════════════════════════════════════════════════════ */
.cmp-section { margin: 3rem 0 1rem; }
.cmp-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .92rem; }
.cmp-table th, .cmp-table td { padding: .85rem 1rem; text-align: center; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table thead th { background: var(--surface-2); font-size: .95rem; font-weight: 700; color: var(--text); position: sticky; top: 0; z-index: 2; }
.cmp-table thead th.cmp-feat-col { text-align: left; }
.cmp-tag { display: inline-block; margin-left: .35rem; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--brand); padding: .12rem .4rem; border-radius: 999px; vertical-align: middle; }
.cmp-tag-best { background: #16a34a; }
/* Feature (first) column — sticky on horizontal scroll */
.cmp-feat-col { text-align: left !important; font-weight: 600; color: var(--text); position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 180px; }
.cmp-table thead th.cmp-feat-col { background: var(--surface-2); z-index: 3; }
.cmp-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cmp-table tbody tr:nth-child(even) .cmp-feat-col { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.cmp-table tbody tr:first-child td { font-weight: 700; }
/* Highlighted popular column */
.cmp-col-pop { background: color-mix(in srgb, var(--brand) 7%, transparent) !important; }
.cmp-table thead th.cmp-col-pop { background: color-mix(in srgb, var(--brand) 14%, var(--surface-2)) !important; }
/* Cell content */
.cmp-yes, .cmp-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.cmp-yes { color: #16a34a; }
.cmp-yes svg { width: 18px; height: 18px; }
.cmp-no { color: #d1495b; opacity: .8; }
.cmp-no svg { width: 17px; height: 17px; }
.cmp-txt { color: var(--text); font-weight: 600; }
@media (max-width: 720px) {
    .cmp-table { font-size: .85rem; }
    .cmp-table th, .cmp-table td { padding: .7rem .6rem; }
    .cmp-feat-col { min-width: 140px; }
}

/* ════════════════════════════════════════════════════════════════════
   Footer — dark theme (#292931) with white text + dark-mode logo
   ════════════════════════════════════════════════════════════════════ */
.site-footer { background: #292931; color: #fff; border-top: none; }
/* Footer sits on a dark surface regardless of site theme → always use the
   dark-background logo, and keep brand text white when no logo is set. */
.site-footer .brand-logo-light { display: none !important; }
.site-footer .brand-logo-dark { display: block !important; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-mark { color: #fff; }
.site-footer .footer-tagline,
.site-footer .footer-brand p { color: rgba(255,255,255,.65); }
.site-footer .footer-heading { color: #fff; }
.site-footer .footer-col a,
.site-footer .footer-cols a,
.site-footer .footer-bottom-links a { color: rgba(255,255,255,.68); }
.site-footer .footer-col a:hover,
.site-footer .footer-cols a:hover,
.site-footer .footer-bottom-links a:hover { color: #fff; }
.site-footer .muted,
.site-footer .small.muted,
.site-footer .footer-bottom .muted { color: rgba(255,255,255,.55); }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
/* Social icons — light glassy chips, brand-purple on hover */
.site-footer .footer-social { display: flex; gap: .55rem; }
.site-footer .social-icon {
    color: #fff; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
}
.site-footer .social-icon:hover {
    background: var(--brand); color: #fff; border-color: var(--brand);
    transform: translateY(-2px);
}
