/* BeautifyNex tool hub: home / category / all-tools pages, tool page layout with wide ad areas, the tool workspace */

/* ---------- header: tools mega menu + search ---------- */
.nav-mega .nav-menu.mega { display: none; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 2px; width: min(560px, 92vw); padding: 10px; }
.nav-mega:hover .nav-menu.mega, .nav-mega:focus-within .nav-menu.mega { display: grid; }
.nav-menu.mega a { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; }
.nav-menu.mega a b { font-size: 14px; color: var(--text); } .nav-menu.mega a small { font-size: 12px; color: var(--muted); }
.nav-menu.mega a:hover { background: var(--primary-50); text-decoration: none; }
.nav-menu.mega .mega-all { grid-column: 1 / -1; background: var(--grad-soft); }
.hdr-search { position: relative; display: flex; align-items: center; margin-right: 6px; }
.hdr-search .ico { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.hdr-search input { width: 220px; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 0 12px 0 32px; font-size: 13.5px; color: var(--text); }
.hdr-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); background: var(--elev); }
@media (max-width: 1180px) { .hdr-search input { width: 160px; } }

/* ---------- hero + search ---------- */
.hub-hero { padding: 56px 0 22px; text-align: center; background: radial-gradient(900px 420px at 50% -20%, var(--primary-100), transparent 70%); }
.hub-hero h1 { font-size: clamp(32px, 5vw, 54px); letter-spacing: -.035em; line-height: 1.06; margin: 14px auto 12px; max-width: 900px; }
.hub-hero .lead { max-width: 760px; margin: 0 auto 24px; color: var(--muted); font-size: 18px; }
.hub-search { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; padding: 0 16px; height: 58px; border: 2px solid var(--line); border-radius: 16px; background: var(--elev); box-shadow: var(--shadow-pop); }
.hub-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 5px var(--primary-100), var(--shadow-pop); }
.hub-search .ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.hub-search input { flex: 1; border: 0; background: transparent; font-size: 18px; color: var(--text); outline: none; min-width: 0; }
.hub-search kbd { font: 600 11px var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.hub-search-sm { margin: 0 0 18px; max-width: 560px; height: 46px; box-shadow: none; }
.hub-search-sm input { font-size: 16px; }
.hub-chips, .hub-catnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hub-catnav { justify-content: flex-start; margin: 0 0 18px; }
.hub-chips .chip, .hub-catnav .chip { border: 1px solid var(--line); background: var(--elev); color: var(--text-2); border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; }
.hub-chips .chip:hover, .hub-catnav .chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.hub-catnav .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- tool cards ---------- */
.hub-home { padding-bottom: 30px; }
.hub-group { margin: 30px 0 8px; }
.hub-group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.hub-group-head h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.hub-group-head h2 a { color: var(--text); } .hub-group-head p { margin: 0; font-size: 14px; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hub-cards-lg { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hub-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--elev); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.hub-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.hub-card b { font-size: 15px; padding-right: 56px; } .hub-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-card[hidden] { display: none; }
.hub-hot { position: absolute; top: 12px; right: 12px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-50); padding: 2px 7px; border-radius: 999px; }
.hub-group[hidden] { display: none; }
.hub-none { text-align: center; margin: 24px auto; max-width: 560px; }
.hub-group-ad { margin: 22px 0 0; }
.hub-native { max-width: 760px; margin: 28px auto 0; }

/* ---------- tool page layout: billboard on top, content + 300 px sticky ad sidebar ---------- */
.hub-page { max-width: 1520px; margin: 0 auto; padding: 14px 20px 70px; }
.hub-billboard { display: flex; justify-content: center; margin: 4px 0 16px; }
.hub-billboard:has(.ad-slot[hidden]) { display: none; }
.hub-billboard-bottom { margin: 24px 0 8px; }
.hub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.hub-main { min-width: 0; }
.hub-side { min-width: 0; }
.hub-sticky { position: sticky; top: calc(var(--header-h) + 12px); display: grid; gap: 14px; }
.hub-pop { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.hub-pop h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hub-pop a { color: var(--text-2); font-size: 14px; padding: 5px 8px; border-radius: 8px; } .hub-pop a:hover, .hub-pop a.on { background: var(--primary-50); color: var(--primary); text-decoration: none; }
.hub-pop-all { font-weight: 700; color: var(--primary) !important; }
@media (max-width: 1100px) { .hub-layout { grid-template-columns: 1fr; } .hub-sticky { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); margin: 4px 0 6px; } .crumbs a { color: var(--muted); }
.hub-title h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; margin: 2px 0 6px; }
.hub-title p { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; max-width: 860px; }
.hub-note { margin-bottom: 14px; }
.hub-about { margin-top: 26px; }
.hub-about h2 { font-size: 20px; margin: 22px 0 10px; }
.hub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0 6px; }
.hub-facts .card { padding: 14px 16px; display: grid; gap: 4px; } .hub-facts .ico { color: var(--primary); } .hub-facts small { color: var(--muted); }

/* ---------- wide ad formats ---------- */
.ad-slot.ad-wide { width: 100%; max-width: 970px; margin: 0 auto; }
.ad-slot.ad-wide .ad-leader img, .ad-slot.ad-wide .ad-bill img { width: 100%; height: auto; display: block; }
.ad-bill { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card); }
.ad-bill img { width: 970px; max-width: 100%; height: auto; }
.ad-bill-text { display: flex; align-items: center; gap: 22px; padding: 26px 30px; min-height: 180px; background: linear-gradient(135deg, var(--ad-accent), color-mix(in srgb, var(--ad-accent) 55%, #0f172a)); color: #fff; }
.ad-bill-text b { display: block; font-size: 28px; letter-spacing: -.02em; } .ad-bill-text .ad-txt span { opacity: .92; font-size: 16px; }
.ad-bill-text .ad-cta { margin-left: auto; background: #fff; color: #0f172a; font-weight: 700; padding: 12px 20px; border-radius: 999px; white-space: nowrap; }
.ad-bill-text .ad-icon { width: 64px !important; height: 64px !important; font-size: 22px; }
.ad-slot.ad-halfpage { width: 300px; max-width: 100%; margin: 0 auto; }
.ad-half { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card); }
.ad-half img { width: 300px; max-width: 100%; height: auto; display: block; }
.ad-half-text { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; min-height: 600px; padding: 26px 22px; color: #fff; background: linear-gradient(170deg, var(--ad-accent), color-mix(in srgb, var(--ad-accent) 45%, #0f172a)); }
.ad-half-text b { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; } .ad-half-text .ad-cta { align-self: flex-start; background: #fff; color: #0f172a; font-weight: 700; padding: 11px 18px; border-radius: 999px; }
@media (max-width: 760px) { .ad-bill-text { flex-wrap: wrap; padding: 20px; min-height: 0; } .ad-bill-text b { font-size: 21px; } .ad-bill-text .ad-cta { margin-left: 0; } .ad-half-text { min-height: 360px; } }

/* ---------- the tool workspace ---------- */
.hub-ws { position: relative; display: flex; flex-direction: column; background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.hub-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hub-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; min-width: 0; flex: 1 1 400px; }
.hub-opt { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hub-opt .input, .hub-opt select { height: 34px; min-width: 120px; font-size: 13.5px; color: var(--text); }
.hub-opt input[type=number] { width: 110px; min-width: 0; }
.hub-opt input[type=color] { width: 54px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--elev); padding: 2px; }
.hub-wide { flex: 1 1 280px; } .hub-wide .input { width: 100%; }
.hub-pick { flex: 1 1 240px; } .hub-pick select { width: 100%; }
.hub-check { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; height: 34px; }
.hub-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.hub-run { display: flex; align-items: center; gap: 12px; }
.hub-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: min(66vh, 720px); min-height: 420px; }
.hub-panes.hub-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hub-panes.hub-single { grid-template-columns: 1fr; height: min(56vh, 600px); }
.hub-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.hub-pane:last-child { border-right: 0; }
.hub-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 7px 10px; border-bottom: 1px solid var(--line); min-height: 46px; }
.hub-head b { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-right: 8px; }
.hub-meta { font-size: 12px; color: var(--muted); }
.hub-cm { flex: 1; min-height: 0; position: relative; }
.hub-cm .CodeMirror { position: absolute; inset: 0; height: auto; font: 13.5px/1.6 var(--font-mono); background: var(--bg); color: var(--text); }
.hub-cm .CodeMirror[hidden] { display: none; }
.hub-view { flex: 1; min-height: 0; overflow: auto; background: var(--bg); padding: 10px 12px; }
.hub-view[hidden] { display: none; }
.hub-out .hub-cm:has(.CodeMirror[hidden]) { display: none; }
.hub-info { padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--success); background: var(--success-bg); font-weight: 600; }
.hub-info[hidden] { display: none; }
.hub-err { display: flex; align-items: center; gap: 8px; border: 0; border-top: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); padding: 8px 12px; font: 600 13px var(--font-ui); text-align: left; cursor: pointer; }
.hub-err b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-err[hidden] { display: none; }
.hub-ws.hub-busy .hub-out .hub-head b::after { content: " · working…"; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.hub-ws.hub-has-err .hub-out .CodeMirror { opacity: .45; }
.hub-ws.hub-full { position: fixed; inset: 0; z-index: 90; border-radius: 0; border: 0; }
.hub-ws.hub-full .hub-panes { height: auto; flex: 1; }
.hub-frame { width: 100%; height: 100%; min-height: 380px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.hub-qrwrap { display: grid; place-items: center; gap: 14px; padding: 20px; }
.hub-qr { max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-card); image-rendering: pixelated; }
.hub-diff { font: 13px/1.6 var(--font-mono); }
.hub-diff div { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 8px; border-radius: 4px; }
.hub-diff span { display: inline-block; width: 16px; color: var(--muted); user-select: none; }
.hub-diff .hd-add { background: var(--success-bg); color: var(--success); } .hub-diff .hd-del { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.hub-regex { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.7 var(--font-mono); margin: 0; }
.hub-regex mark { background: color-mix(in srgb, var(--warning) 40%, transparent); color: inherit; border-radius: 3px; padding: 1px 0; outline: 1px solid color-mix(in srgb, var(--warning) 60%, transparent); }
.hub-ws .cc-adwrap { border-top: 1px solid var(--line); }
.mono { font-family: var(--font-mono); }
@media (max-width: 899px) {
  .hub-panes, .hub-panes.hub-three { grid-template-columns: 1fr; height: auto; }
  .hub-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .hub-cm { height: 300px; flex: none; }
  .hub-view { min-height: 300px; }
  .hub-head .btn span { display: none; } .hub-head .btn { padding: 0 9px; }
  .hub-page { padding: 10px 12px 60px; }
}
.nav-menu.mega a { text-align: left; align-items: flex-start; }
