/* ░░░ ToolWizHub — MediaKit · glass / gradient theme ░░░ */

/* ── Splash (house standard) ──────────────────────── */
.splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(56% 46% at 50% 42%, rgba(255,184,72,0.16), transparent 70%), radial-gradient(120% 90% at 100% 0%, #123a44 0%, transparent 55%), radial-gradient(120% 90% at 0% 100%, #2a1840 0%, transparent 55%), #07070d;
  transition: opacity 0.55s ease, visibility 0.55s ease; animation: splash-failsafe 0s linear 5s forwards; }
html.no-splash .splash { display: none; }
.splash.is-hiding { opacity: 0; visibility: hidden; pointer-events: none; }
.splash.is-hiding .splash__stage { transform: scale(1.08); }
.splash__stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; transition: transform 0.55s cubic-bezier(0.22,1,0.36,1); }
.splash__glow { position: absolute; top: 42%; left: 50%; width: 320px; height: 320px; transform: translate(-50%,-50%); pointer-events: none; background: radial-gradient(circle, rgba(255,184,72,0.34), rgba(34,211,238,0.16) 45%, transparent 70%); filter: blur(10px); animation: splash-glow 2.4s ease-in-out infinite; }
@keyframes splash-glow { 0%,100% { opacity: 0.55; transform: translate(-50%,-50%) scale(0.9); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } }
.splash__logo { position: relative; width: clamp(150px,42vw,200px); height: auto; filter: drop-shadow(0 14px 34px rgba(0,0,0,0.55)); animation: splash-in 0.8s cubic-bezier(0.34,1.56,0.64,1) both, splash-float 3.2s ease-in-out 0.8s infinite; }
@keyframes splash-in { from { opacity: 0; transform: scale(0.6) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes splash-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.splash__tagline { font-family: "Space Grotesk",sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 7px; text-transform: uppercase; padding-left: 7px; color: #ffd486; text-shadow: 0 2px 12px rgba(255,184,72,0.4); opacity: 0; animation: splash-fade 0.6s ease 0.55s forwards; }
@keyframes splash-fade { to { opacity: 0.95; } }
.splash__bar { width: 168px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.splash__bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#ffb648,#22d3ee,#e879f9); animation: splash-bar 1.5s ease 0.3s forwards; }
@keyframes splash-bar { from { width: 0; } to { width: 100%; } }
.splash__sparkles { position: absolute; inset: -10% -20%; pointer-events: none; }
.splash__sparkles span { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px rgba(255,212,134,0.9); opacity: 0; animation: splash-sparkle 1.9s ease-in-out infinite; }
.splash__sparkles span:nth-child(1){top:26%;left:28%;animation-delay:0s}.splash__sparkles span:nth-child(2){top:20%;left:70%;animation-delay:.45s}.splash__sparkles span:nth-child(3){top:58%;left:20%;animation-delay:.9s}.splash__sparkles span:nth-child(4){top:62%;left:78%;animation-delay:.25s}.splash__sparkles span:nth-child(5){top:36%;left:86%;animation-delay:.65s}.splash__sparkles span:nth-child(6){top:78%;left:48%;animation-delay:1.1s}
@keyframes splash-sparkle { 0%,100% { opacity: 0; transform: scale(0); } 40% { opacity: 1; transform: scale(1.25); } 70% { opacity: 0.6; transform: scale(0.9); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

:root {
  --bg:#07070d; --text:#f4f5fb; --soft:#c2c6da; --muted:#8087a0; --faint:#5a6080;
  --glass:rgba(255,255,255,0.045); --glass-2:rgba(255,255,255,0.07); --line:rgba(255,255,255,0.09); --line-strong:rgba(255,255,255,0.16);
  --c1:#22d3ee; --c2:#818cf8; --c3:#e879f9; --grad:linear-gradient(110deg,var(--c1),var(--c2) 55%,var(--c3)); --gold:#ffb648;
  --ok:#34d399; --warn:#fbbf24; --fail:#fb7185;
  --r:22px; --r-sm:14px; --r-pill:999px;
  --mono:"JetBrains Mono",ui-monospace,Menlo,monospace; --sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; --display:"Space Grotesk",var(--sans); --ease:cubic-bezier(0.22,1,0.36,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: var(--sans); color: var(--text); background: var(--bg); min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; position: relative; overflow-x: hidden; }
body::before, body::after { content:""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: 0.5; pointer-events: none; }
body::before { width: 50vw; height: 50vw; top: -14vw; right: -10vw; background: radial-gradient(circle, rgba(34,211,238,0.5), transparent 70%); animation: drift1 18s var(--ease) infinite alternate; }
body::after { width: 46vw; height: 46vw; bottom: -16vw; left: -10vw; background: radial-gradient(circle, rgba(232,121,249,0.42), transparent 70%); animation: drift2 22s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(-8vw,10vw) scale(1.15); } }
@keyframes drift2 { to { transform: translate(8vw,-8vw) scale(1.1); } }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
a { color: var(--c1); }

.app { max-width: 1280px; margin: 0 auto; padding: 22px clamp(16px,4vw,48px) 64px; }

/* App bar */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.brand { display: inline-flex; align-items: center; gap: 13px; padding: 10px 16px 10px 12px; border-radius: var(--r-pill); text-decoration: none; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); transition: border-color 0.25s, transform 0.25s var(--ease); }
.brand:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.brand__mark { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.brand__text { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.brand__text strong { font-family: var(--display); font-size: 16px; font-weight: 700; color: #fff; }
.brand__text span { font-size: 9px; letter-spacing: 0.2em; color: var(--muted); font-weight: 600; }
.local-badge { font-size: 12px; font-weight: 600; color: var(--ok); background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); border-radius: var(--r-pill); padding: 7px 14px; }

/* Workbench layout */
.workbench { display: grid; grid-template-columns: 248px 1fr; gap: 22px; align-items: start; }
.sidebar { position: sticky; top: 18px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; backdrop-filter: blur(14px); }
.tool-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group__title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 12px 6px; }
.nav-group__icon { font-size: 14px; }
.nav-item { display: block; text-decoration: none; color: var(--soft); font-size: 14px; font-weight: 500; padding: 9px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s; }
.nav-item:hover { background: var(--glass-2); color: #fff; }
.nav-item.is-active { background: var(--grad); color: #04141a; font-weight: 600; }

.work { min-width: 0; }
.work__head { margin-bottom: 20px; }
.work__cat { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.work__title { font-family: var(--display); font-size: clamp(24px,4vw,34px); font-weight: 700; color: #fff; letter-spacing: -0.5px; margin: 4px 0; }
.work__desc { color: var(--soft); font-size: 15px; }
.work__note { margin-top: 10px; font-size: 13px; color: var(--warn); background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); border-radius: var(--r-sm); padding: 10px 14px; }

/* Tool surface */
.tool { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px,3vw,28px); backdrop-filter: blur(14px); }

/* Dropzone */
.dz { border: 2px dashed var(--line-strong); border-radius: var(--r-sm); padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease); outline: none; }
.dz:hover, .dz:focus-visible, .dz.is-over { border-color: var(--c1); background: rgba(34,211,238,0.05); transform: translateY(-1px); }
.dz__icon { font-size: 26px; color: var(--c1); margin-bottom: 8px; }
.dz__label { font-weight: 600; color: var(--text); }
.dz__hint { font-size: 12px; color: var(--faint); margin-top: 4px; font-family: var(--mono); }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.file-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 14px; background: var(--glass-2); border: 1px solid var(--line); border-radius: 10px; }
.file-row__name { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__meta { font-size: 12px; color: var(--muted); font-family: var(--mono); flex-shrink: 0; }

/* Controls */
.controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin: 20px 0; }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl__label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ctl__hint { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.inp { width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.25s var(--ease); }
.inp:focus { border-color: transparent; box-shadow: 0 0 0 1.5px var(--c1); }
select.inp { cursor: pointer; }
select.inp option { background: #0d0e18; }

/* ── Custom glass dropdown ─────────────────────────── */
.csel { position: relative; width: 100%; }
.csel__btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(0,0,0,0.25); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .2s, box-shadow .25s var(--ease), background .2s; }
.csel__btn:hover { background: rgba(255,255,255,0.05); }
.csel.is-open .csel__btn, .csel__btn:focus-visible { border-color: transparent; box-shadow: 0 0 0 1.5px var(--c1), 0 0 22px rgba(34,211,238,0.22); outline: none; }
.csel__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csel__chev { flex-shrink: 0; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--muted); transition: transform .25s var(--ease); }
.csel.is-open .csel__chev { transform: rotate(180deg); }
.csel__menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow-y: auto; background: rgba(13,14,24,0.86); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.03); animation: csel-in .16s var(--ease); }
@keyframes csel-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.csel__opt { display: flex; align-items: center; padding: 9px 12px 9px 30px; border-radius: 9px; font-size: 14px; color: var(--soft); cursor: pointer; position: relative; transition: background .15s, color .15s; }
.csel__opt.is-active { background: var(--glass-2); color: #fff; }
.csel__opt.is-sel { color: #fff; font-weight: 600; background: linear-gradient(90deg, rgba(34,211,238,0.14), transparent 80%); }
.csel__opt.is-sel::before { content: ""; position: absolute; left: 12px; top: 48%; width: 5px; height: 9px; border: solid var(--c1); border-width: 0 2px 2px 0; transform: translateY(-60%) rotate(45deg); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c1); cursor: pointer; }
.range { width: 100%; accent-color: var(--c1); }
.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type=number]::-webkit-inner-spin-button { opacity: 0.5; }
input::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* Buttons / actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn { padding: 12px 24px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; color: var(--soft); background: var(--glass-2); border: 1px solid var(--line-strong); transition: transform 0.18s var(--ease), border-color 0.2s, color 0.2s; }
.btn:hover { transform: translateY(-1px); color: #fff; border-color: var(--c1); }
.btn--primary { color: #1a1205; background: linear-gradient(110deg,var(--gold),#ffd486); border: none; box-shadow: 0 10px 28px rgba(255,182,72,0.3); }
.btn--primary:hover { box-shadow: 0 14px 36px rgba(255,182,72,0.42); }

/* Status / progress */
.status { margin-top: 16px; font-size: 13px; color: var(--soft); display: flex; align-items: center; gap: 12px; min-height: 20px; }
.status.is-err { color: var(--fail); font-weight: 600; }
.status__track { display: inline-block; width: 200px; max-width: 50%; height: 8px; background: rgba(255,255,255,0.08); border-radius: var(--r-pill); overflow: hidden; }
.status__bar { display: block; height: 100%; width: 0; background: var(--grad); border-radius: var(--r-pill); transition: width 0.2s; }

/* Audio preview */
.audio-prev { width: 100%; margin-top: 14px; border-radius: var(--r-pill); }

/* Crop stage */
.crop-stage { position: relative; display: inline-block; margin-top: 14px; max-width: 100%; touch-action: none; }
.crop-canvas { display: block; max-width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); }
.crop-sel { position: absolute; border: 2px solid var(--c1); background: rgba(34,211,238,0.14); box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); pointer-events: none; }

/* Footer */
.app-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line); }
.app-footer__brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; opacity: 0.5; transition: opacity 0.2s; }
.app-footer__brand:hover { opacity: 1; }
.app-footer__label { font-size: 12px; font-weight: 600; color: var(--muted); }
.app-footer__brand img { height: 20px; width: auto; display: block; }
.app-footer__credit { font-size: 12px; color: var(--faint); text-align: center; }
.app-footer__credit a { color: var(--muted); }

/* Sidebar sub-groups */
.nav-sub { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }

/* Result area */
.result { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--glass); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.result__img { max-width: 100%; max-height: 360px; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(#1a1c28 0% 25%, #11131c 0% 50%) 50% / 20px 20px; }
.result__file { font-size: 15px; color: var(--text); }
.result__meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* Extra control widgets */
.inp--color { width: 48px; height: 38px; padding: 2px; cursor: pointer; }
.ta { width: 100%; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.pair { display: flex; gap: 8px; }
.pair .inp { width: 100%; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn--sm { padding: 7px 12px; font-size: 12.5px; }
.adjust-canvas { display: block; max-width: 100%; max-height: 460px; margin-top: 14px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.gen-out { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.ascii-out { margin-top: 14px; padding: 12px; background: #05060a; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--mono); font-size: 4px; line-height: 4px; white-space: pre; overflow: auto; max-height: 460px; color: var(--soft); }

@media (max-width: 760px) {
  .workbench { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .tool-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group__title { width: 100%; }
  .local-badge { display: none; }
}
