/* ==========================================================================
   AceSEO theme - redesign v2 (2026-10)
   Loaded after theme.css. Full-width layout, home directory, tool workspace.
   ========================================================================== */
:root{
  --container: 1640px;
  --gutter: clamp(16px, 2.6vw, 44px);
  --rail: 340px;
  --brand-grad: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0891b2 100%);
}
.page{padding-block:0 3.5rem}

/* ---------- Home hero ---------- */
.hero{padding:clamp(2.5rem,5vw,4.5rem) 0 clamp(3rem,6vw,5rem)}
.hero .container.hero-grid{max-width:var(--container);text-align:start;display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(2rem,4vw,4rem);align-items:center}
@media (min-width:1100px){.hero .container.hero-grid{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)}}
.hero-copy h1{font-size:clamp(2.2rem,3.6vw + 1rem,4.1rem);line-height:1.05;margin-bottom:1rem}
.hero-accent{background:linear-gradient(90deg,#a5f3fc,#e0f2fe);-webkit-background-clip:text;background-clip:text;color:transparent}
.hero-copy p{margin:0 0 1.8rem;max-width:60ch;font-size:clamp(1.02rem,.5vw + .9rem,1.22rem)}
.hero .eyebrow svg{width:14px;height:14px}
.hero-search{margin:0;max-width:680px}
.hero-search .input-group-addon svg{width:20px;height:20px}
.hero-stats{justify-content:flex-start;gap:clamp(1.5rem,3vw,3rem);margin-top:2rem}
.hero-stats strong{font-size:1.6rem}
.hero-panel{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.22);border-radius:24px;padding:1.4rem;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 30px 80px -30px rgba(0,0,0,.45)}
.hero-panel-title{font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.8);margin:0 0 .9rem .2rem}
.hero-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.hero-tile{display:flex;align-items:center;gap:.75rem;padding:.85rem .9rem;border-radius:16px;background:rgba(255,255,255,.95);color:#0f172a;font-weight:600;font-size:.95rem;line-height:1.25;transition:transform .15s,box-shadow .15s}
.hero-tile:hover{transform:translateY(-2px);box-shadow:0 12px 30px -12px rgba(0,0,0,.4);text-decoration:none;color:#0f172a}
.hero-tile .tool-icon{width:40px;height:40px;border-radius:12px;flex:0 0 auto;display:grid;place-items:center;background:#dbeafe;color:#1d4ed8}
.hero-tile .tool-icon svg{width:20px;height:20px}
.hero-tile .tool-icon img{width:26px;height:26px;object-fit:contain}
html[data-theme="dark"] .hero-tile{background:rgba(15,23,42,.85);color:#e5e7eb}
html[data-theme="dark"] .hero-tile .tool-icon{background:#1e3a8a;color:#bfdbfe}
@media (max-width:520px){.hero-tiles{grid-template-columns:1fr}}

/* ---------- Home: category bar + directory ---------- */
.home-page{padding-top:1.5rem}
.cat-nav{position:sticky;top:var(--header-h);z-index:40;display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.85rem 0;margin-bottom:1.5rem;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.cat-pill{display:inline-flex;align-items:center;gap:.45rem;font:inherit;font-size:.9rem;font-weight:600;color:var(--text-2);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:.5rem .95rem;cursor:pointer;transition:all .15s}
.cat-pill svg{width:16px;height:16px}
.cat-pill span{font-size:.75rem;color:var(--muted);background:var(--bg-2);border-radius:999px;padding:.05rem .45rem}
.cat-pill:hover{border-color:var(--primary);color:var(--primary)}
.cat-pill.active{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.cat-pill.active span{background:rgba(255,255,255,.22);color:var(--on-primary)}
.cat-filter{margin-inline-start:auto;display:flex;align-items:center;gap:.5rem;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:0 .9rem;min-width:240px;color:var(--muted);font-weight:400}
.cat-filter svg{width:16px;height:16px;flex:0 0 auto}
.cat-filter input{border:0!important;box-shadow:none!important;background:transparent!important;padding:.5rem 0!important;font-size:.9rem}
.cat-filter:focus-within{border-color:var(--primary);box-shadow:var(--ring)}
@media (max-width:760px){.cat-nav{position:static;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.cat-nav::-webkit-scrollbar{display:none}.cat-pill{flex:0 0 auto}.cat-filter{display:none}}
.tools-section{margin-bottom:3rem;scroll-margin-top:calc(var(--header-h) + 80px)}
.section-head{align-items:center;justify-content:flex-start;gap:1rem;margin-bottom:1.25rem;flex-wrap:nowrap}
.section-head > div{flex:1 1 auto;min-width:0}
.section-head h2{font-size:clamp(1.3rem,.8vw + 1rem,1.65rem);margin:0 0 .15rem}
.section-head p{font-size:.95rem}
.section-icon{width:46px;height:46px;border-radius:14px;background:var(--brand-grad);color:#fff;display:grid;place-items:center;flex:0 0 auto;box-shadow:0 10px 24px -10px rgba(37,99,235,.6)}
.section-icon svg{width:22px;height:22px}
@media (max-width:600px){.section-head .count{display:none}}
.tool-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:1rem}
.tool-card{flex-direction:row;align-items:center;gap:1rem;padding:1.05rem 1.1rem;border-radius:16px}
.tool-card .tool-icon{width:48px;height:48px;border-radius:14px;color:var(--primary)}
.tool-card .tool-icon svg{width:24px;height:24px}
.tool-card .tool-text{display:flex;flex-direction:column;gap:.2rem;min-width:0;flex:1 1 auto}
.tool-card .tool-name{font-size:1rem}
.tool-card .tool-desc{font-size:.84rem;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.45}
.tool-card .tool-go{flex:0 0 auto;width:32px;height:32px;border-radius:10px;display:grid;place-items:center;color:var(--muted);background:var(--bg-2);transition:all .15s}
.tool-card .tool-go svg{width:16px;height:16px}
.tool-card:hover .tool-go{background:var(--primary);color:var(--on-primary)}
.tool-card[hidden],.tools-section[hidden]{display:none!important}
.no-match{text-align:center;color:var(--muted);padding:2rem 0}
.ad-wide{margin:0 0 2.5rem;text-align:center;overflow:hidden}
.features{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));margin-top:1rem}
.feature{padding:1.4rem;border-radius:18px}

/* ---------- Tool page ---------- */
.tool-hero{background:linear-gradient(180deg,var(--surface) 0%,var(--bg) 100%);border-bottom:1px solid var(--border);padding:1.4rem 0 2.6rem;position:relative;overflow:hidden}
.tool-hero::before{content:"";position:absolute;inset:-40% -10% auto auto;width:640px;height:640px;background:radial-gradient(closest-side,rgba(37,99,235,.10),transparent);pointer-events:none}
html[data-theme="dark"] .tool-hero::before{background:radial-gradient(closest-side,rgba(96,165,250,.12),transparent)}
.tool-hero .breadcrumbs{margin-bottom:1.1rem}
.tool-head{display:flex;gap:1.25rem;align-items:flex-start;margin:0;position:relative}
.tool-head-icon{width:68px;height:68px;border-radius:20px;background:var(--brand-grad);color:#fff;display:grid;place-items:center;flex:0 0 auto;box-shadow:0 16px 36px -14px rgba(37,99,235,.65)}
.tool-head-icon svg{width:32px;height:32px}
.tool-head-icon img{width:40px;height:40px;object-fit:contain;filter:brightness(0) invert(1)}
.tool-head h1{font-size:clamp(1.9rem,2.2vw + 1rem,2.9rem);margin:0 0 .35rem;letter-spacing:-.025em}
.tool-head .tool-summary{font-size:clamp(1rem,.4vw + .92rem,1.15rem);max-width:80ch}
@media (max-width:600px){.tool-head{flex-direction:column;gap:.9rem}.tool-head-icon{width:56px;height:56px;border-radius:16px}}
.tool-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:2rem;align-items:start;margin-top:-1.4rem;position:relative}
@media (min-width:1180px){.tool-layout{grid-template-columns:minmax(0,1fr) var(--rail);gap:2.25rem}}
.tool-page .tool-body{padding:clamp(1.25rem,2.4vw,2.25rem);border-radius:20px;box-shadow:var(--shadow);margin-bottom:2rem}
.tool-page .tool-body > br{display:none}

/* Command bar (single-field forms, built by app.js) */
.cmdbar{display:flex;align-items:stretch;gap:.6rem;background:var(--surface-2);border:1px solid var(--border-2);border-radius:16px;padding:.45rem;transition:border-color .15s,box-shadow .15s}
.cmdbar:focus-within{border-color:var(--primary);box-shadow:var(--ring)}
.cmdbar .cmd-ico{display:grid;place-items:center;padding-inline:.55rem;color:var(--muted)}
.cmdbar .cmd-ico svg{width:20px;height:20px}
.cmdbar input.form-control{flex:1 1 auto;border:0!important;box-shadow:none!important;background:transparent!important;font-size:1.08rem;padding:.8rem .2rem!important;margin:0!important}
.cmdbar .btn{border-radius:12px;padding-inline:1.5rem;min-width:0!important;font-size:1rem}
@media (max-width:560px){.cmdbar{flex-wrap:wrap}.cmdbar .cmd-ico{display:none}.cmdbar input.form-control{flex:1 1 100%;padding-inline:.6rem!important}.cmdbar .btn{flex:1 1 100%}}
.form-lead{font-weight:600;color:var(--text);margin:0 0 .75rem;font-size:1rem}
.examples{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;margin-top:.85rem;font-size:.85rem;color:var(--muted)}
.examples button{font:inherit;font-size:.82rem;color:var(--primary-2);background:var(--primary-soft);border:0;border-radius:999px;padding:.25rem .7rem;cursor:pointer}
html[data-theme="dark"] .examples button{color:#bfdbfe}
.examples button:hover{filter:brightness(.96)}
.tool-page .tool-body textarea.form-control{min-height:170px;border-radius:14px;font-size:1rem}
.tool-page .tool-body form .text-center{margin-top:1.1rem}
.tool-page .tool-body form .btn[type="submit"],.tool-page .tool-body form input.btn{padding:.85rem 1.8rem;font-size:1rem;border-radius:12px}
.is-busy .btn[type="submit"],.is-busy input[type="submit"]{opacity:.7;pointer-events:none}
.is-busy .cmdbar{background-image:linear-gradient(90deg,transparent,rgba(37,99,235,.12),transparent);background-size:200% 100%;animation:busy 1.2s linear infinite}
@keyframes busy{from{background-position:200% 0}to{background-position:-200% 0}}

/* Results */
.result-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin:0 0 1.2rem;padding-bottom:1rem;border-bottom:1px solid var(--border)}
.result-toolbar .rt-title{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1.05rem}
.result-toolbar .rt-title svg{width:18px;height:18px;color:var(--success)}
.result-toolbar .rt-actions{display:flex;gap:.4rem;flex-wrap:wrap}
.result-toolbar .btn svg{width:15px;height:15px}
.tool-page .tool-body .widget-box{border-radius:14px}
.tool-page .tool-body .widget-header{padding:.8rem 1.1rem}
.tool-page .tool-body .widget-main{padding:1.1rem}
.tool-page .tool-body table.table{border-radius:12px;overflow:hidden;border:1px solid var(--border)}
.tool-page .tool-body table.table td{font-size:.95rem}
.tool-page .tool-body .table-wrap{border-radius:12px;margin-bottom:1.25rem}
.result-hero{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding:1.4rem 1.5rem;border-radius:16px;background:var(--brand-grad);color:#fff;margin-bottom:1.25rem}
.result-hero-label{font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
.result-hero-value{font-size:clamp(1.6rem,2.5vw + 1rem,2.6rem);font-weight:800;letter-spacing:-.02em;word-break:break-all;line-height:1.1}
.result-hero-actions{display:flex;gap:.5rem;align-items:center;margin-top:.3rem}
.result-hero .chip{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.3);color:#fff}
.kv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:.75rem;margin:0}
.kv-grid > div{border:1px solid var(--border);border-radius:14px;padding:.9rem 1rem;background:var(--surface-2);min-width:0}
.kv-grid dt{font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:.25rem}
.kv-grid dd{margin:0;font-weight:600;color:var(--text);word-break:break-word}
.kv-grid > div.wide{grid-column:1/-1}

/* How-to, about, FAQ */
.howto{margin:0 0 2rem}
.howto h2,.info-grid h2{font-size:clamp(1.25rem,.6vw + 1rem,1.5rem);margin-bottom:1rem}
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:1rem}
.steps li{display:flex;gap:.9rem;align-items:flex-start;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:1.1rem 1.15rem}
.steps p{margin:0;color:var(--text-2);font-size:.95rem}
.step-n{width:34px;height:34px;border-radius:11px;background:var(--primary-soft);color:var(--primary-2);font-weight:800;display:grid;place-items:center;flex:0 0 auto}
html[data-theme="dark"] .step-n{color:#bfdbfe}
.info-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:1.5rem;align-items:start}
@media (min-width:1400px){.info-grid{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)}}
.info-grid .tool-about,.info-grid .faq{margin:0}
.info-grid .card-body{padding:1.6rem}
.faq details{border-radius:12px}
.faq details:last-child{margin-bottom:0}

/* Right rail */
.tool-rail{display:flex;flex-direction:column;gap:1.25rem}
@media (min-width:1180px){.tool-rail{position:sticky;top:calc(var(--header-h) + 18px)}}
.rail-card{padding:1.2rem;border-radius:18px}
.rail-card .card-title{font-size:.95rem}
.rail-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.15rem}
.rail-list a{display:flex;align-items:center;gap:.75rem;padding:.55rem .5rem;border-radius:12px;color:var(--text);font-weight:600;font-size:.93rem;line-height:1.3}
.rail-list a:hover{background:var(--bg-2);color:var(--primary);text-decoration:none}
.rail-list .tool-icon{width:36px;height:36px;border-radius:11px;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;flex:0 0 auto}
html[data-theme="dark"] .rail-list .tool-icon{background:#1e3a8a;color:#bfdbfe}
.rail-list .tool-icon svg{width:18px;height:18px}
.rail-list .tool-icon img{width:22px;height:22px;object-fit:contain}
.rail-all{display:inline-flex;align-items:center;gap:.35rem;margin-top:.8rem;font-weight:600;font-size:.88rem}
.rail-all svg{width:14px;height:14px}

/* Generic pages keep their sidebar layout, at the wider container */
@media (min-width:1024px){.layout{grid-template-columns:minmax(0,1fr) var(--rail)}.layout.sidebar-left{grid-template-columns:var(--rail) minmax(0,1fr)}}
.is-page .page{padding-top:2rem}

/* Copy feedback */
.copied-toast{position:fixed;inset-inline:0;bottom:24px;margin:auto;width:max-content;max-width:90vw;background:var(--text);color:var(--bg);padding:.6rem 1rem;border-radius:12px;font-weight:600;font-size:.9rem;box-shadow:var(--shadow-lg);z-index:2000;opacity:0;transform:translateY(10px);transition:all .2s;pointer-events:none}
.copied-toast.show{opacity:1;transform:none}
@media print{.tool-rail,.howto,.cat-nav,.result-toolbar .rt-actions{display:none!important}.tool-layout{grid-template-columns:1fr}}
