/* ==========================================================================
   WebImage — app styles on top of the Tayon theme
   (app.min.css + app-new-layout.css + app-dark-theme.css).
   Tokens: --wi-* resolve to light values by default and to the Tayon
   --app-* dark tokens under body.wl-dark (dark is the default theme).
   ========================================================================== */

body {
    --wi-bg: #f1f5fa;
    --wi-surface: #ffffff;
    --wi-surface-2: #f7f8fc;
    --wi-border: #e3e7f1;
    --wi-text: #303e67;
    --wi-muted: #6b6d75;
    --wi-accent: #6366f1;
    --wi-accent-hover: #4f46e5;
    --wi-accent-soft: rgba(99, 102, 241, 0.10);
    --wi-success: #10b981;
    --wi-danger: #dc2626;
    --wi-warning: #f59e0b;
    --wi-sidebar: #0e021c;
    --wi-radius: 14px;
    font-family: 'Poppins', sans-serif;
}

body.wl-dark {
    --wi-bg: var(--app-bg);
    --wi-surface: var(--app-surface);
    --wi-surface-2: #1d2135;
    --wi-border: var(--app-border);
    --wi-text: var(--app-text);
    --wi-muted: var(--app-muted);
    --wi-accent: var(--app-accent);
    --wi-accent-hover: var(--app-accent-hover);
    --wi-accent-soft: rgba(99, 102, 241, 0.16);
    --wi-sidebar: var(--app-bg);
}

body.wi-app,
body.wi-app .page-content-tab,
body.wi-app .main-container {
    background: var(--wi-bg);
}

/* ---- Primary colour = Tayon indigo (Tayon sets it per white label) ------- */
.btn.btn-primary,
.btn-gradient-primary,
.badge-primary {
    background-color: var(--wi-accent) !important;
    border-color: var(--wi-accent) !important;
    color: #fff !important;
    box-shadow: none;
}
.btn.btn-primary:hover,
.btn-gradient-primary:hover { background-color: var(--wi-accent-hover) !important; border-color: var(--wi-accent-hover) !important; }
.btn.btn-outline-primary { color: var(--wi-accent); border-color: var(--wi-accent); }
.btn.btn-outline-primary:hover { background: var(--wi-accent); color: #fff; }
body.wl-dark a.btn.btn-primary, body.wl-dark a.btn.btn-primary:hover { color: #fff !important; }
a { color: var(--wi-accent); }
.text-primary { color: var(--wi-accent) !important; }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--wi-accent); border-color: var(--wi-accent); }
.page-item.active .page-link { background-color: var(--wi-accent); border-color: var(--wi-accent); }

/* ---- Sidebar ------------------------------------------------------------- */
.app-navbar-container.wi-navbar { background-color: var(--wi-sidebar); }
.wi-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none !important; }
.wi-brand img.logo-default { height: 38px; }
.wi-brand-sub { color: #fff; font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; opacity: 0.75; }
.wi-logo-small { color: #fff; font-size: 26px; }
.wi-nav-section { width: 100%; padding: 1.25rem 1rem 0.35rem; }
.wi-nav-section span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; opacity: 0.6; }
body.wl-dark .wi-nav-section span { color: var(--app-text); }
.wi-navbar-foot { margin-top: auto; padding: 1rem; font-size: 0.72rem; }
.app-navbar-container .wi-navbar-foot a { color: rgba(255, 255, 255, 0.55); }
.app-navbar-container .wi-navbar-foot a:hover { color: #fff; }
.app-navbar-container .app-menu-item .menu-icon .mdi { font-size: 22px; }
.app-navbar-container .app-menu-item .menu-icon .navbar-title { font-size: 0.85rem; margin-bottom: 0; }

/* ---- Topbar -------------------------------------------------------------- */
.app-topbar-container { border-bottom: 1px solid var(--wi-border); }
body.wl-dark .app-topbar-container { background: var(--app-bg); }
.app-topbar-container a.wi-topbar-link,
.wi-auth-top a.wi-topbar-link { color: var(--wi-text); font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; }
body.wl-dark .app-topbar-container a.wi-topbar-link,
body.wl-dark .wi-auth-top a.wi-topbar-link,
body.wl-dark .app-topbar-container a.wi-topbar-link:hover { color: var(--app-text); }
.wi-brand-mobile { color: var(--wi-text); font-weight: 600; }
.wi-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--wi-accent); color: #fff; font-weight: 600; font-size: 0.9rem;
}
.app-topbar-container .nav-user { display: flex; align-items: center; gap: 8px; }
.wi-btn-signup { border-radius: 999px; padding: 0.3rem 0.9rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--wi-accent); color: #fff; }

/* ---- Page frame ---------------------------------------------------------- */
.wi-root { color: var(--wi-text); padding-top: 0.5rem; padding-bottom: 2rem; }
.wi-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1.25rem; }
.wi-root h1.wi-title, .wi-root h4.wi-title { color: var(--wi-text); font-weight: 600; margin: 0; }
.wi-root h1.wi-title { font-size: 1.6rem; }
.wi-root p.wi-subtitle { color: var(--wi-muted); margin: 0.25rem 0 0; }
.wi-footer { padding: 1rem 1.5rem 1.5rem; font-size: 0.78rem; color: var(--wi-muted); }
.wi-footer a { color: var(--wi-muted); }

.wi-card {
    background: var(--wi-surface);
    border: 1px solid var(--wi-border);
    border-radius: var(--wi-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.wi-card.wi-card--tight { padding: 1rem 1.25rem; }
.wi-root .wi-card h5.wi-card-title { color: var(--wi-text); font-weight: 600; font-size: 1.02rem; margin: 0 0 1rem; }
.wi-muted, .wi-root .wi-muted { color: var(--wi-muted) !important; }
.wi-hint { font-size: 0.8rem; color: var(--wi-muted); }

/* ---- Forms --------------------------------------------------------------- */
.wi-root .form-control, .wi-root .custom-select { border-radius: 10px; border-color: var(--wi-border); }
.wi-root .form-control:focus { border-color: var(--wi-accent); box-shadow: 0 0 0 3px var(--wi-accent-soft); }
.wi-root label { font-weight: 500; color: var(--wi-text); }
.wi-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; min-height: 260px; line-height: 1.55; }

/* ---- Source tabs (segmented) -------------------------------------------- */
.wi-seg { display: inline-flex; background: var(--wi-surface-2); border: 1px solid var(--wi-border); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.wi-seg button {
    border: 0; background: transparent; color: var(--wi-muted); padding: 0.5rem 1rem; border-radius: 9px;
    font-size: 0.88rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.wi-seg button:hover { color: var(--wi-text); }
.wi-seg button.is-active { background: var(--wi-surface); color: var(--wi-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
body.wl-dark .wi-seg button.is-active { background: var(--wi-accent); color: #fff; }

/* option cards (mode chooser) */
.wi-root 
/* dropzone */
.wi-drop {
    border: 2px dashed var(--wi-border); border-radius: var(--wi-radius); padding: 2.5rem 1rem; text-align: center;
    background: var(--wi-surface-2); transition: border-color .15s, background .15s; cursor: pointer; display: block;
}
.wi-drop:hover, .wi-drop.is-over { border-color: var(--wi-accent); background: var(--wi-accent-soft); }
.wi-drop i { font-size: 36px; color: var(--wi-accent); }
.wi-root .wi-drop strong { display: block; color: var(--wi-text); margin-top: .5rem; }

/* ---- Tables -------------------------------------------------------------- */
.wi-table { width: 100%; margin: 0; color: var(--wi-text); }
.wi-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wi-muted); font-weight: 600; border-bottom: 1px solid var(--wi-border); padding: 0.6rem 0.75rem; white-space: nowrap; }
.wi-table td { border-top: 1px solid var(--wi-border); padding: 0.6rem 0.75rem; vertical-align: middle; font-size: 0.88rem; }
.wi-table tr.is-off td { opacity: 0.45; text-decoration: line-through; }
.wi-table-wrap { overflow-x: auto; }
.wi-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--wi-accent-soft); color: var(--wi-accent); }
.wi-pill--ok { background: rgba(16, 185, 129, 0.14); color: var(--wi-success); }
.wi-pill--bad { background: rgba(220, 38, 38, 0.14); color: var(--wi-danger); }
.wi-pill--muted { background: var(--wi-surface-2); color: var(--wi-muted); }

/* ---- Stats --------------------------------------------------------------- */
.wi-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.wi-stat { background: var(--wi-surface); border: 1px solid var(--wi-border); border-radius: var(--wi-radius); padding: 1rem 1.25rem; }
.wi-stat .wi-stat-label { font-size: 0.75rem; color: var(--wi-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wi-stat .wi-stat-value { font-size: 1.7rem; font-weight: 600; color: var(--wi-text); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wi-stat .wi-stat-foot { font-size: 0.75rem; color: var(--wi-muted); }

/* ---- Hero (home) --------------------------------------------------------- */
.wi-hero { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0 1.5rem; }
.wi-hero-icon {
    width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex: none;
    background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-size: 28px; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.wi-progress { height: 8px; border-radius: 999px; background: var(--wi-surface-2); overflow: hidden; }
.wi-progress > div { height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .4s ease; }

/* ---- Auth ---------------------------------------------------------------- */
body.wi-auth { overflow: auto; }
.wi-auth .auth-card { max-width: 440px; margin: 0 auto; border-radius: 18px; }
.wi-auth .auth-logo { height: 50px; }
.wi-auth-sub { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--wi-muted); margin-top: 6px; }
.wi-auth-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 1rem 1.5rem; z-index: 2; }
.wi-auth-top a { margin-left: 0.5rem; }
body.wl-dark.wi-auth .auth-card { background: var(--app-surface); border: 1px solid var(--app-border); }
.wi-auth .auth-form .form-control { border-radius: 10px; }
.wi-auth .btn-round { border-radius: 999px; }

@media (max-width: 992px) {
    .wi-root { padding-left: 0.25rem; padding-right: 0.25rem; }
    .wi-card { padding: 1.1rem; }
    .wi-root h1.wi-title { font-size: 1.3rem; }
}

.btn.btn-outline-primary { border: 1px solid var(--wi-accent) !important; background: transparent; }
.btn.btn-outline-primary:hover { background: var(--wi-accent) !important; color: #fff !important; }
[x-cloak] { display: none !important; }
.wi-root .apexcharts-canvas, .wi-root .apexcharts-canvas.apexcharts-theme-dark { background: transparent !important; }
.wi-root .apexcharts-text, .wi-root .apexcharts-legend-text { font-family: 'Poppins', sans-serif !important; }

/* ---- Public pages (home content, how it works, use cases) ---------------- */
.wi-mk { max-width: 1100px; }
.wi-mk--page { max-width: 860px; }
.wi-mk-section { margin: 2.25rem 0; }
.wi-root .wi-mk-h2 { font-size: 1.3rem; font-weight: 600; color: var(--wi-text); margin: 0 0 1rem; letter-spacing: -0.005em; }
.wi-root .wi-mk-h3 { font-size: 1rem; font-weight: 600; color: var(--wi-text); margin: 0 0 0.35rem; }
.wi-mk p, .wi-mk-lead { color: var(--wi-muted); line-height: 1.7; }
.wi-mk-lead { max-width: 760px; }
.wi-mk-article p { font-size: 0.95rem; }
.wi-mk-crumbs { font-size: 0.8rem; color: var(--wi-muted); margin: 0.25rem 0 0.5rem; }
.wi-mk-crumbs a { color: var(--wi-muted); }
.wi-mk-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.wi-mk-steps li { display: flex; gap: 0.85rem; background: var(--wi-surface); border: 1px solid var(--wi-border); border-radius: var(--wi-radius); padding: 1.15rem; }
.wi-mk-steps p { margin: 0; font-size: 0.88rem; }
.wi-mk-num { width: 30px; height: 30px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; background: var(--wi-accent-soft); color: var(--wi-accent); }
.wi-mk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.wi-mk-feature { background: var(--wi-surface); border: 1px solid var(--wi-border); border-radius: var(--wi-radius); padding: 1.15rem; }
.wi-mk-feature > i { font-size: 1.4rem; color: var(--wi-accent); display: block; margin-bottom: 0.4rem; }
.wi-mk-feature p { margin: 0; font-size: 0.86rem; }
.wi-mk-fair { display: flex; gap: 1.1rem; align-items: flex-start; background: var(--wi-surface); border: 1px solid var(--wi-border); border-radius: var(--wi-radius); padding: 1.5rem; }
.wi-mk-fair p { margin-bottom: 0.6rem; }
.wi-mk-fair-icon { width: 46px; height: 46px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #6366f1, #a855f7); }
.wi-mk-faq { border: 1px solid var(--wi-border); border-radius: var(--wi-radius); background: var(--wi-surface); }
.wi-mk-faq details { border-top: 1px solid var(--wi-border); padding: 0 1.15rem; }
.wi-mk-faq details:first-child { border-top: 0; }
.wi-mk-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.95rem 0; }
.wi-mk-faq summary::-webkit-details-marker { display: none; }
.wi-mk-faq summary .wi-mk-h3 { margin: 0; font-weight: 500; font-size: 0.95rem; }
.wi-mk-faq summary i { color: var(--wi-muted); transition: transform .2s; }
.wi-mk-faq details[open] summary i { transform: rotate(180deg); }
.wi-mk-faq details p { margin: 0 0 1rem; font-size: 0.9rem; }
.wi-mk-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wi-mk-link { display: inline-flex; align-items: center; gap: 6px; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--wi-border); background: var(--wi-surface); color: var(--wi-text) !important; font-size: 0.86rem; }
.wi-mk-link:hover { border-color: var(--wi-accent); text-decoration: none; }
.wi-mk-link i { color: var(--wi-accent); }
.wi-mk-cta { text-align: center; padding: 2rem 1rem; border-radius: var(--wi-radius); background: var(--wi-accent-soft); }
.wi-mk-cta p { margin-bottom: 1rem; }
@media (max-width: 992px) {
    .wi-mk-steps, .wi-mk-grid { grid-template-columns: 1fr; }
    .wi-mk-fair { flex-direction: column; }
}
@media (min-width: 640px) and (max-width: 992px) { .wi-mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.wi-footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin-bottom: 0.5rem; }
.wi-footer-langs { display: flex; gap: 0.75rem; margin-bottom: 0.5rem; }
.wi-footer-langs a.is-active { color: var(--wi-text); font-weight: 600; }

.wi-lang-offer { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem; margin-bottom: 0.75rem; border-radius: 10px; background: var(--wi-accent-soft); font-size: 0.86rem; color: var(--wi-text); }
.wi-lang-offer i.mdi-translate { color: var(--wi-accent); }
.wi-lang-offer button { margin-left: auto; border: 0; background: transparent; color: var(--wi-muted); cursor: pointer; }

/* ---- Tayon promo slots (edited at /admin/promos) ------------------------- */
.wi-promo-img { display: block; }
.wi-promo-img img { display: block; width: 100%; height: auto; border-radius: 10px; }
.wi-promo--sidebar { margin-bottom: 0.85rem; }
.wi-promo--sidebar .wi-promo-box {
    display: block; color: rgba(255, 255, 255, 0.7); padding: 0.75rem 0.8rem; border-radius: 10px; line-height: 1.35;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.15s, background 0.15s;
}
.wi-promo--sidebar .wi-promo-box:hover { border-color: rgba(129, 140, 248, 0.55); background: rgba(99, 102, 241, 0.10); text-decoration: none; }
.wi-promo.wi-promo--sidebar .wi-promo-kicker { display: block; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); margin-bottom: 0.3rem; }
.wi-promo.wi-promo--sidebar .wi-promo-title { display: block; color: #fff; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; }
.wi-promo.wi-promo--sidebar .wi-promo-text { display: block; color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; margin-bottom: 0.45rem; }
.wi-promo.wi-promo--sidebar .wi-promo-cta { color: #a5b4fc; font-size: 0.74rem; font-weight: 600; }
.wi-promo.wi-promo--home .wi-promo-kicker { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wi-muted); margin-bottom: 0.35rem; }
.wi-promo--home .wi-promo-kicker .mdi { color: var(--wi-accent); }
.wi-root .wi-promo--home h5.wi-card-title { margin-bottom: 0.5rem; }
.wi-promo--home p { font-size: 0.86rem; margin-bottom: 0.75rem; }
.wi-promo--home.wi-promo-img, .wi-promo--home .wi-promo-img { margin-bottom: 1rem; }
.wi-promo-preview { background: var(--wi-surface-2); border: 1px dashed var(--wi-border); border-radius: 12px; padding: 1rem; }
.wi-promo-preview--sidebar { background: var(--wi-sidebar); max-width: 13rem; }
body:not(.wl-dark) .wi-promo-preview--sidebar { background: #0e021c; }
.wi-promo-preview--home { max-width: 380px; }
.wi-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }
.wi-auth-legal { font-size: 0.78rem; margin-top: 1rem; color: var(--wi-muted); }
.wi-auth-legal a { color: var(--wi-muted); }
.wi-navbar-foot .wi-promo { max-width: 11rem; }
.wi-promo .wi-promo-kicker .mdi { font-size: 0.9rem; vertical-align: -1px; }
.wi-promo.wi-promo--sidebar .wi-promo-cta .mdi { font-size: 0.8rem; }

/* ==========================================================================
   Converter
   ========================================================================== */
[x-cloak] { display: none !important; }
.wi-root .wi-text { color: var(--wi-text); }
.wi-drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; cursor: pointer; margin: 0; }
.wi-uploads { list-style: none; margin: .75rem 0 0; padding: 0; font-size: .82rem; }
.wi-uploads li { display: flex; align-items: center; gap: .75rem; padding: .3rem 0; }
.wi-uploads .wi-uploads-name { flex: 0 1 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wi-text); }
.wi-uploads .wi-progress { flex: 1; }
.wi-uploads li.is-error .wi-uploads-name { flex-basis: auto; }
.wi-uploads button { border: 0; background: none; color: var(--wi-muted); font-size: 1.1rem; line-height: 1; margin-left: auto; }

.wi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.wi-file { border: 1px solid var(--wi-border); border-radius: 12px; overflow: hidden; background: var(--wi-surface-2); display: flex; flex-direction: column; }
.wi-file--failed { border-color: rgba(220, 38, 38, .45); }
.wi-file--done { border-color: rgba(16, 185, 129, .45); }
.wi-file-thumb {
    position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden;
    background-color: #e9ecf3;
    background-image: linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%),
                      linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%);
    background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
body.wl-dark .wi-file-thumb { background-color: #23273b; }
.wi-file-thumb img { width: 100%; height: 100%; object-fit: contain; }
.wi-file-thumb > i { font-size: 34px; color: var(--wi-muted); }
.wi-file-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(15, 18, 32, .55); color: #fff; font-size: .82rem; }
.wi-file-badge { position: absolute; top: 8px; right: 8px; background: var(--wi-accent); color: #fff; border-radius: 999px; font-size: .68rem; padding: 2px 8px; }
.wi-file-badge--left { right: auto; left: 8px; background: rgba(15, 18, 32, .7); }
.wi-file-body { padding: .6rem .75rem .25rem; font-size: .8rem; flex: 1; }
.wi-file-name { font-weight: 600; color: var(--wi-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.wi-file-error { font-size: .76rem; margin-top: 2px; }
.wi-file-body .wi-pill { margin-top: 4px; }
.wi-file-actions { display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem .75rem .7rem; }
.wi-file-actions .btn { padding: .2rem .5rem; font-size: .78rem; }
.btn.btn-light { background: var(--wi-surface); border-color: var(--wi-border); color: var(--wi-text); }
body.wl-dark .btn.btn-light { background: #23273b; border-color: var(--wi-border); color: var(--app-text); }
body.wl-dark .btn.btn-light:hover, body.wl-dark .btn.btn-light.active { background: #2c3150; }

.wi-results { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wi-results-big { font-size: 2rem; font-weight: 700; color: var(--wi-success); line-height: 1; }

.wi-settings { position: sticky; top: 1rem; }
.wi-settings fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.wi-settings fieldset[disabled] { opacity: .6; }
.wi-set { padding: .85rem 0; border-top: 1px solid var(--wi-border); }
.wi-settings fieldset .wi-set:first-child { border-top: 0; padding-top: 0; }
.wi-root .wi-set-label { font-size: .84rem; font-weight: 600; margin-bottom: .45rem; display: block; }
.wi-set-label .mdi { color: var(--wi-accent); }
.wi-root .input-group-text { background: var(--wi-surface-2); border-color: var(--wi-border); color: var(--wi-muted); font-size: .78rem; }
body.wl-dark .wi-root .form-control, body.wl-dark .wi-root .custom-select { background-color: #1d2135; color: var(--app-text); border-color: var(--wi-border); }
.wi-color { width: 38px; height: 30px; padding: 2px; border: 1px solid var(--wi-border); border-radius: 8px; background: var(--wi-surface); cursor: pointer; flex: 0 0 auto; }
.wi-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.wi-chip { border: 1px solid var(--wi-border); background: var(--wi-surface); color: var(--wi-text); border-radius: 999px; padding: .2rem .65rem; font-size: .76rem; line-height: 1.4; }
body.wl-dark .wi-chip { background: #1d2135; }
.wi-chip:hover { border-color: var(--wi-accent); }
.wi-chip.is-active, body.wl-dark .wi-chip.is-active { background: var(--wi-accent); border-color: var(--wi-accent); color: #fff; }
.wi-drop.wi-drop--compact { padding: .9rem 1rem; flex-direction: row; justify-content: center; gap: .75rem; }
.wi-drop.wi-drop--compact i { font-size: 24px; }
.wi-drop.wi-drop--compact strong { margin-top: 0; }
.wi-drop.wi-drop--compact .wi-hint { display: none; }
.wi-convert { border-top: 1px solid var(--wi-border); padding-top: 1rem; }
.wi-convert .btn-block { width: 100%; margin-right: 0; }
.wi-presets { min-width: 300px; max-height: 70vh; overflow: auto; }
.wi-presets .dropdown-item { display: flex; align-items: flex-start; gap: .6rem; white-space: normal; padding: .45rem 1rem; }
.wi-presets .dropdown-item .mdi { font-size: 18px; color: var(--wi-accent); margin-top: 1px; }
.wi-presets .dropdown-item small { display: block; color: var(--wi-muted); }
.wi-presets .dropdown-item:hover small, .wi-presets .dropdown-item:active small { color: inherit; }
.wi-seg--full { display: flex; width: 100%; flex-wrap: nowrap; }
.wi-seg--full button { flex: 1; white-space: nowrap; padding-left: .4rem; padding-right: .4rem; font-size: .8rem; }

/* ---- editor ------------------------------------------------------------ */
body.wi-noscroll { overflow: hidden; }
.wi-editor { position: fixed; inset: 0; z-index: 1060; background: rgba(8, 10, 20, .72); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.wi-editor-dialog { background: var(--wi-surface); color: var(--wi-text); border-radius: var(--wi-radius); width: min(1280px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.wi-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--wi-border); flex-wrap: wrap; }
.wi-editor-title { display: flex; align-items: baseline; gap: .5rem; min-width: 0; flex-wrap: wrap; }
.wi-editor-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.wi-editor-body { flex: 1; display: flex; min-height: 0; }
.wi-editor-stage { flex: 1; min-width: 0; background: #0b0d18; position: relative; overflow: hidden; }
/* Cropper.js takes the size of the image's parent: give it an explicit box */
.wi-editor-canvas { position: absolute; inset: 1rem; }
.wi-editor-canvas img { display: block; max-width: 100%; }
.wi-editor-side { width: 330px; flex: 0 0 330px; border-left: 1px solid var(--wi-border); padding: 1rem; overflow-y: auto; font-size: .85rem; }
.wi-ov { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.wi-ov svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wi-ov.is-active { pointer-events: auto; cursor: default; touch-action: none; }
.wi-ov.is-active .wi-ov-item { cursor: move; }
.wi-ov-sel { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.wi-ov-handle { fill: var(--wi-accent); stroke: #fff; stroke-width: 2; cursor: nwse-resize; }
.cropper-disabled .cropper-face, .cropper-disabled .cropper-line, .cropper-disabled .cropper-point { cursor: default; }
.wi-ov-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .4rem; }
.wi-ov-preset { border: 1px solid var(--wi-border); background: var(--wi-surface-2); color: var(--wi-text); border-radius: 10px; padding: .45rem .3rem; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; line-height: 1.2; }
.wi-ov-preset .mdi { font-size: 20px; color: var(--wi-accent); }
.wi-ov-preset:hover:not(:disabled) { border-color: var(--wi-accent); }
.wi-ov-preset:disabled { opacity: .45; }
.wi-layer { border: 1px solid var(--wi-border); border-radius: 10px; padding: .6rem; margin-bottom: .5rem; background: var(--wi-surface-2); }
.wi-layer.is-selected { border-color: var(--wi-accent); box-shadow: 0 0 0 2px var(--wi-accent-soft); }
@media (max-width: 900px) {
    .wi-editor { padding: 0; }
    .wi-editor-dialog { height: 100%; border-radius: 0; }
    .wi-editor-body { flex-direction: column; }
    .wi-editor-stage { flex: 0 0 52%; }
    .wi-editor-side { width: auto; flex: 1; border-left: 0; border-top: 1px solid var(--wi-border); }
}

/* ---- modal (Tayon) ------------------------------------------------------- */
.wi-modal { position: fixed; inset: 0; z-index: 1050; background: rgba(8, 10, 20, .6); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.wi-modal-dialog { background: var(--wi-surface); color: var(--wi-text); border-radius: var(--wi-radius); width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.wi-modal-dialog--wide { width: min(1080px, 100%); height: min(760px, 100%); }
.wi-modal-head, .wi-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; }
.wi-modal-head { border-bottom: 1px solid var(--wi-border); }
.wi-modal-foot { border-top: 1px solid var(--wi-border); }
.wi-modal-foot > div { display: flex; gap: .5rem; }
.wi-modal-body { padding: 1.1rem; overflow-y: auto; flex: 1; min-height: 0; }
.wi-modal-body label { font-weight: 500; }
.wi-modal-close { border: 0; background: none; color: var(--wi-muted); font-size: 1.3rem; line-height: 1; }
.wi-picker { display: flex; gap: 1rem; min-height: 100%; }
.wi-picker-folders { flex: 0 0 210px; display: flex; flex-direction: column; gap: 2px; }
.wi-picker-folders button { text-align: left; border: 0; background: none; color: var(--wi-text); padding: .4rem .6rem; border-radius: 8px; font-size: .84rem; display: flex; align-items: center; gap: .4rem; }
.wi-picker-folders button span { margin-left: auto; font-size: .75rem; }
.wi-picker-folders button:hover { background: var(--wi-surface-2); }
.wi-picker-folders button.is-active { background: var(--wi-accent-soft); color: var(--wi-accent); font-weight: 600; }
.wi-picker-main { flex: 1; min-width: 0; }
.wi-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.wi-pick { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; padding: 0; background: var(--wi-surface-2); text-align: left; color: var(--wi-text); }
.wi-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.wi-pick-name { display: block; font-size: .76rem; font-weight: 600; padding: .35rem .5rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-pick-meta { display: block; font-size: .7rem; color: var(--wi-muted); padding: 0 .5rem .4rem; }
.wi-pick-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(15,18,32,.55); color: transparent; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.wi-pick.is-selected { border-color: var(--wi-accent); }
.wi-pick.is-selected .wi-pick-check { background: var(--wi-accent); color: #fff; }
@media (max-width: 700px) {
    .wi-picker { flex-direction: column; }
    .wi-picker-folders { flex: none; flex-direction: row; overflow-x: auto; }
    .wi-picker-folders button { white-space: nowrap; }
    .wi-settings { position: static; }
}

/* ---- bot protection ------------------------------------------------------ */
.wi-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.wi-turnstile { min-height: 65px; margin: .75rem 0; display: flex; justify-content: center; }

/* ---- Mobile top bar: menu, brand, one sign-in button. The rest moves to the side menu. ---- */
.wi-topbar-narrow, .wi-nav-mobile { display: none !important; }
.app-topbar-container li.wi-topbar-wide { display: flex; }
@media (max-width: 767px) {
    .app-topbar-container li.wi-topbar-wide { display: none !important; }
    .wi-topbar-narrow { display: flex !important; align-items: center; }
    .wi-topbar-narrow .btn { white-space: nowrap; padding: .25rem .7rem; font-size: .82rem; }
    .wi-nav-mobile { display: block !important; width: 100%; padding: 1rem 1rem .25rem; }
    .wi-brand-mobile { font-size: 1rem; white-space: nowrap; }
    .wi-brand-mobile .mdi { color: var(--wi-accent); }
    .app-topbar-container .nav-user-name { display: none; }
}
.wi-nav-mobile .btn-outline-light { color: #fff; border-color: rgba(255,255,255,.45); }
.wi-nav-mobile-row { display: flex; align-items: center; justify-content: space-between; }
.wi-nav-langs { display: inline-flex; gap: .35rem; }
.wi-nav-langs a, .wi-nav-theme { color: rgba(255,255,255,.7) !important; font-size: .8rem; padding: .2rem .45rem; border-radius: 6px; }
.wi-nav-langs a.active { background: rgba(255,255,255,.14); color: #fff !important; font-weight: 600; }
.wi-nav-theme { font-size: 1.15rem; }

/* ---- Phone side menu: a proper drawer instead of the theme's 120px column ---- */
@media (max-width: 899px) {
    .app-navbar-container.wi-navbar.active-menu {
        position: fixed !important; top: 0; bottom: 0; left: 0; z-index: 1060;
        width: 272px !important; min-width: 272px !important; max-width: 85vw !important;
        overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
    }
    .wi-navbar.active-menu .app-menu-item .menu-icon { justify-content: flex-start; padding-left: 1.1rem; gap: .85rem; }
    .wi-navbar.active-menu .app-menu-item .menu-icon .title-box { text-align: left; }
    .wi-navbar.active-menu .app-menu-item .menu-icon .navbar-title { font-size: .95rem; white-space: nowrap; }
}

/* ---- Auth form field icons (name / email / password): the theme's pale circle has almost no contrast ---- */
.auth-form .auth-form-icon,
body.wl-dark .auth-form .auth-form-icon {
    background-color: rgba(99, 102, 241, .12); color: var(--wi-accent) !important;
    display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 17px;
}
body.wl-dark .auth-form .auth-form-icon { background-color: rgba(129, 140, 248, .18); color: #a5b4fc !important; }
.auth-form .auth-form-icon .mdi { color: inherit !important; }
/* light theme: the auth page sits on a busy gradient, so its top bar and legal links get a solid backing */
body.wi-auth:not(.wl-dark) .wi-auth-top { background: rgba(255, 255, 255, .88); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
body.wi-auth:not(.wl-dark) .wi-auth-top a.wi-topbar-link { color: #1f2937 !important; opacity: 1; }
body.wi-auth:not(.wl-dark) .wi-auth-legal { display: table; margin: 1rem auto 0; background: rgba(255, 255, 255, .88); border-radius: 999px; padding: .3rem .9rem; }
body.wi-auth:not(.wl-dark) .wi-auth-legal a { color: #374151 !important; }

/* ---- Errors must be impossible to miss (the dark theme forces span{color:inherit}) ---- */
.invalid-feedback, .invalid-feedback strong, span.invalid-feedback, .text-danger,
body.wl-dark .invalid-feedback, body.wl-dark .invalid-feedback strong { color: #f1646c !important; }
.is-invalid ~ .invalid-feedback, .input-group .invalid-feedback { font-size: .82rem; }
.wi-turnstile { flex-direction: column; align-items: center; text-align: center; }
.wi-turnstile-wait { font-size: .82rem; color: var(--wi-muted); margin-top: .35rem; }
.wi-turnstile-wait.is-error { color: #f1646c; }
.wi-root .wi-card h5.wi-card-title.text-danger { color: #f1646c !important; }
/* light auth pages: the theme's muted greys are too faint on white */
body.wi-auth:not(.wl-dark) .auth-card .text-muted,
body.wi-auth:not(.wl-dark) .auth-card .custom-control-label,
body.wi-auth:not(.wl-dark) .auth-card .wi-hint { color: #5b6478 !important; }
body.wi-auth:not(.wl-dark) .auth-card .auth-form label { color: #374151; }
