/* Futurised Home — dark UI with the Futurised purple as the accent. */

:root {
    color-scheme: dark;
    --bg: #09080f;
    --surface: #131120;
    --soft: #191627;
    --softer: #100e1b;
    --raised: #241f36;
    --line: #241f36;
    --line-strong: #3a3352;
    --fg: #fafafa;
    --on-fg: #0a0a0b;
    --ink: #e7e5ef;
    --text: #cbc8d8;
    --muted: #8a85a0;

    --violet: #8b4cf6;
    --violet-700: #6000c0;
    --blue: #4c7cf6;
    --cyan: #30c5e0;
    --danger: #f05252;
    --danger-soft: rgba(240, 82, 82, .14);
    --ok: #35d07f;

    --accent: var(--violet);
    --accent-2: var(--violet-700);
    --accent-soft: rgba(139, 76, 246, .14);
    --on-accent: #ffffff;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px rgba(0,0,0,.55);
    --glow: 0 0 0 1px rgba(139,76,246,.25), 0 10px 40px rgba(96,0,192,.25);
    --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --header-h: 68px;
}

.accent-violet { --accent: var(--violet); --accent-2: var(--violet-700); --accent-soft: rgba(139,76,246,.14); }
.accent-blue   { --accent: var(--blue);   --accent-2: #1d4ed8;        --accent-soft: rgba(76,124,246,.14); }
.accent-cyan   { --accent: var(--cyan);   --accent-2: #0e7490;        --accent-soft: rgba(48,197,224,.14); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    overflow-x: clip;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60vw 40vw at 85% -5%, rgba(96,0,192,.18), transparent 60%),
        radial-gradient(50vw 40vw at 0% 0%, rgba(76,124,246,.10), transparent 55%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--fg); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 1em; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container.narrow, .narrow > .container { max-width: 760px; }
.section { padding: 40px 0; }
.section.narrow { max-width: 640px; margin: 0 auto; }
.pt-0 { padding-top: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-xs { margin-top: 10px; }
.stack { display: grid; gap: 20px; align-content: start; }

/* Brand accents -------------------------------------------------------- */
.brandline { height: 3px; background: linear-gradient(90deg, var(--violet-700), var(--violet) 45%, var(--cyan)); }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 10px rgba(139,76,246,.8); display: inline-block; }

/* Logo ----------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo-mark { display: inline-flex; width: 30px; height: 30px; }
.logo-mark svg { width: 30px; height: 30px; }
.logo-mark.big { width: 48px; height: 48px; margin-bottom: 18px; }
.logo-mark.big svg { width: 48px; height: 48px; }
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: -.04em; color: var(--fg); line-height: 1; display: inline-flex; align-items: baseline; gap: 5px; }
.logo-text small { font-size: 20px; font-weight: 800; color: var(--violet); letter-spacing: -.04em; }

/* Header --------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(9,8,15,.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.site-header-slim .header-inner { justify-content: space-between; }
.main-nav { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; margin-inline-start: 8px; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted);
    transition: background .15s, color .15s;
}
.main-nav a:hover { color: var(--fg); }
.main-nav a.active { background: var(--raised); color: var(--fg); }
.main-nav a.active svg { color: var(--violet); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.icon-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
    color: var(--ink); transition: background .15s; text-decoration: none;
}
.icon-btn:hover { background: var(--soft); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.avatar {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--violet-700));
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}

/* Dropdowns */
.dropdown { position: relative; }
.dropdown summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary:hover { background: var(--soft); }
.account-menu summary { padding: 2px; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 180px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: 6px; z-index: 60;
}
.dropdown-right { inset-inline-start: auto; inset-inline-end: 0; min-width: 240px; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer; font-size: 14px; text-align: start; color: inherit;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--soft); }
.dropdown-menu a.active { font-weight: 700; color: var(--fg); }
.dropdown-menu svg { color: var(--muted); }
.dropdown-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; }
.dropdown-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: transform .1s, background .15s, border-color .15s, color .15s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-accent { background: linear-gradient(135deg, var(--violet), var(--violet-700)); color: var(--on-accent); box-shadow: 0 6px 20px rgba(96,0,192,.35); }
.btn-accent:hover { box-shadow: 0 8px 26px rgba(96,0,192,.5); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--fg); }
.btn-outline:hover { border-color: var(--violet); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--soft); }
.btn-ghost.danger-text { color: var(--danger); }
.btn-ghost.danger-text:hover { background: var(--danger-soft); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; cursor: pointer; color: inherit; font-size: 14px; }

/* Banners & flashes ---------------------------------------------------- */
.verify-banner { background: var(--soft); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.verify-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.verify-banner span { display: inline-flex; align-items: center; gap: 8px; }
.verify-banner svg { width: 16px; height: 16px; color: var(--violet); }
.verify-banner form { margin: 0; }
.verify-banner .link-btn { color: var(--fg); }

.flash-stack { position: fixed; top: calc(var(--header-h) + 16px); left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; max-width: 520px; width: calc(100% - 32px); }
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--raised); color: var(--fg);
    box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
    animation: flash-in .25s ease-out; border-inline-start: 4px solid var(--line-strong);
}
.flash-success { border-inline-start-color: var(--ok); }
.flash-error { border-inline-start-color: var(--danger); }
.flash-info { border-inline-start-color: var(--violet); }
.flash-close { background: none; border: 0; color: var(--fg); opacity: .6; cursor: pointer; display: grid; padding: 4px; }
.flash-close:hover { opacity: 1; }
.flash.hide { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

/* Hero ----------------------------------------------------------------- */
.hero { padding: 56px 0 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px; }
.hero-title { font-size: clamp(34px, 5.5vw, 56px); line-height: 1.02; letter-spacing: -.045em; max-width: 820px; margin-bottom: 14px; }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 620px; margin: 0; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; letter-spacing: -.03em; }
.count-badge, .head-row .count-badge { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--soft); padding: 2px 10px; border-radius: 999px; }

/* App solution cards --------------------------------------------------- */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.app-card {
    position: relative; display: flex; flex-direction: column; gap: 16px;
    padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
    overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.app-card::after {
    content: ""; position: absolute; inset-inline-end: -50px; top: -50px; width: 160px; height: 160px;
    border-radius: 50%; background: var(--accent); opacity: .12; filter: blur(20px); transition: opacity .3s, transform .3s;
}
.app-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.app-card:hover::after { opacity: .22; transform: scale(1.3); }
.app-card.is-soon { cursor: default; }
.app-icon { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.app-icon svg { width: 26px; height: 26px; }
.app-body { flex: 1; }
.app-body h3 { font-size: 18px; letter-spacing: -.02em; margin-bottom: 4px; }
.app-body p { color: var(--muted); font-size: 14px; margin: 0; }
.app-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--accent); }
.app-cta svg { width: 16px; height: 16px; transition: transform .2s; }
.app-card:hover .app-cta svg { transform: translateX(3px); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--ink); align-self: flex-start; }
.pill-soon { background: var(--accent-soft); color: var(--accent); }

/* Knowledge band on home ---------------------------------------------- */
.knowledge-band {
    display: flex; align-items: center; gap: 22px; padding: 24px 28px; border-radius: 20px;
    background: linear-gradient(120deg, rgba(96,0,192,.18), rgba(76,124,246,.08) 60%, transparent);
    border: 1px solid var(--line); transition: border-color .2s, transform .2s; flex-wrap: wrap;
}
.knowledge-band:hover { border-color: var(--violet); transform: translateY(-2px); }
.kb-band-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--violet), var(--violet-700)); color: #fff; }
.kb-band-icon svg { width: 28px; height: 28px; }
.kb-band-text { flex: 1; min-width: 200px; }
.kb-band-text h2 { margin: 0 0 2px; font-size: 20px; }
.kb-band-text p { margin: 0; color: var(--muted); font-size: 14px; }
.kb-band-stats { display: flex; gap: 24px; }
.kb-band-stats span { display: grid; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kb-band-stats strong { font-size: 26px; font-weight: 800; color: var(--fg); letter-spacing: -.03em; }
.kb-band-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); color: var(--fg); }
.knowledge-band:hover .kb-band-arrow { background: var(--violet); color: #fff; }

/* Page head ------------------------------------------------------------ */
.page-head { padding: 36px 0 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 6px; }
.page-head p { margin: 0; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.head-actions form { margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb svg { width: 14px; height: 14px; }

/* Knowledge base cards ------------------------------------------------- */
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.kb-card {
    display: grid; gap: 8px; padding: 22px; border-radius: 18px; background: var(--surface);
    border: 1px solid var(--line); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.kb-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.kb-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--violet); margin-bottom: 4px; }
.kb-icon svg { width: 24px; height: 24px; }
.kb-card h3 { margin: 0; font-size: 17px; }
.kb-card p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.kb-meta span { display: inline-flex; align-items: center; gap: 5px; }
.kb-meta svg { width: 14px; height: 14px; }

/* Knowledge base detail ------------------------------------------------ */
.kb-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.kb-side .panel { position: sticky; top: calc(var(--header-h) + 20px); }
.doc-list { display: grid; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s; }
.doc-item:hover { border-color: var(--line-strong); }
.doc-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--soft); color: var(--muted); flex-shrink: 0; }
.doc-icon svg { width: 22px; height: 22px; }
.doc-icon.ext-pdf { color: #f05252; background: rgba(240,82,82,.12); }
.doc-icon.ext-doc, .doc-icon.ext-docx { color: #4c7cf6; background: rgba(76,124,246,.12); }
.doc-icon.ext-xls, .doc-icon.ext-xlsx, .doc-icon.ext-csv { color: #35d07f; background: rgba(53,208,127,.12); }
.doc-icon.ext-ppt, .doc-icon.ext-pptx { color: #f6934c; background: rgba(246,147,76,.12); }
.doc-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.doc-name { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-name:hover { text-decoration: underline; }
.doc-meta { font-size: 12.5px; color: var(--muted); }
.doc-actions { display: flex; align-items: center; gap: 2px; }
.doc-actions form { margin: 0; }

/* Forms ---------------------------------------------------------------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-row { display: flex; justify-content: space-between; align-items: center; }
.field-row a { font-weight: 500; color: var(--muted); }
.field-row a:hover { color: var(--fg); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], select, textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--softer); color: var(--fg); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
select {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a85a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,76,246,.18); }
textarea { resize: vertical; min-height: 44px; }
.code-input { text-align: center; font-size: 28px; font-weight: 800; letter-spacing: .5em; padding-inline-start: .5em; }
.hint { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.hint.ok { color: var(--ok); }
.hint.warn { color: #f6b44c; }
.hint svg { width: 14px; height: 14px; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.field:has(.field-error) input, .field:has(.field-error) select, .field:has(.field-error) textarea { border-color: var(--danger); }
.form-actions-inline { display: flex; justify-content: flex-end; gap: 10px; }

/* Panels --------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 18px; }
.panel h2 svg { width: 19px; height: 19px; color: var(--violet); }
/* Settings ------------------------------------------------------------- */
.avatar-lg { width: 52px; height: 52px; font-size: 19px; }
.profile-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 28px; }
.profile-id { flex: 1; min-width: 0; display: grid; }
.profile-id strong { color: var(--fg); font-size: 16px; }
.profile-id span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.badge-2fa { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.badge-2fa .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge-2fa.on { color: var(--ok); background: rgba(53,208,127,.12); }
.badge-2fa.on .dot { background: var(--ok); box-shadow: 0 0 8px rgba(53,208,127,.7); }

.settings-section { margin-bottom: 26px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 10px 4px; }
.settings-list { display: grid; gap: 10px; }
.setting-row { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s; }
.setting-row:hover { border-color: var(--line-strong); }
.setting-row.static { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; }
.setting-row.static form { margin: 0; }
.setting-row > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.setting-row > summary::-webkit-details-marker { display: none; }
.setting-main { display: grid; gap: 2px; min-width: 0; }
.setting-main strong { color: var(--fg); font-size: 14.5px; font-weight: 700; }
.setting-value { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.setting-desc { color: var(--muted); font-size: 13px; }
.setting-cta { color: var(--violet); font-weight: 700; font-size: 14px; white-space: nowrap; }
.setting-row[open] > summary .setting-cta { opacity: .5; }
.setting-edit { padding: 0 18px 18px; border-top: 1px solid var(--line); margin-top: -2px; padding-top: 16px; }
.setting-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.verify-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.verify-chip svg { width: 12px; height: 12px; }
.verify-chip.ok { color: var(--ok); background: rgba(53,208,127,.12); }
.verify-chip.warn { color: #f6b44c; background: rgba(246,180,76,.12); }
.select-inline { width: auto; min-width: 150px; padding: 9px 36px 9px 14px; font-size: 14px; font-weight: 600; border-radius: 10px; }

/* Toggle switch */
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; border: 0; background: var(--line-strong); cursor: pointer; padding: 0; transition: background .2s; flex-shrink: 0; }
.switch.on { background: linear-gradient(135deg, var(--violet), var(--violet-700)); }
.switch-knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch.on .switch-knob { transform: translateX(20px); }
[dir=rtl] .switch.on .switch-knob { transform: translateX(-20px); }

/* Modal ---------------------------------------------------------------- */
.modal { position: fixed; margin: auto; inset: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px; max-width: 420px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); color: inherit; text-align: center; }
.modal::backdrop { background: rgba(5,4,10,.7); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } }
.modal-close-form { position: absolute; top: 14px; inset-inline-end: 14px; margin: 0; }
.modal-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--accent-soft); color: var(--violet); margin-bottom: 14px; }
.modal-icon svg { width: 26px; height: 26px; }
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal > .muted { margin-bottom: 22px; font-size: 14px; }
.modal .form { text-align: start; }
.modal .code-input { text-align: center; }
.modal-foot { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.modal-foot form { margin: 0; }
.muted-link { color: var(--muted); font-weight: 600; text-decoration: none; }
.muted-link:hover { color: var(--fg); }

/* Dropzone ------------------------------------------------------------- */
.dropzone {
    display: grid; justify-items: center; gap: 4px; padding: 28px 18px; text-align: center; cursor: pointer;
    border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--softer); transition: .15s; margin-bottom: 14px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--violet); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--violet); margin-bottom: 4px; }
.dropzone strong { color: var(--fg); font-size: 14px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Empty states --------------------------------------------------------- */
.empty { text-align: center; padding: 56px 20px; border: 1.5px dashed var(--line); border-radius: 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--soft); color: var(--violet); margin-bottom: 16px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty h2, .empty h3 { margin-bottom: 6px; }

/* Auth ----------------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: 48px 20px 80px; min-height: calc(100vh - var(--header-h) - 160px); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 26px; }
.auth-switch { text-align: center; margin-top: 22px; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--fg); font-weight: 700; text-decoration: underline; }

/* Error ---------------------------------------------------------------- */
.error-page { padding-top: 72px; padding-bottom: 72px; }
.error-code { font-size: 110px; font-weight: 800; letter-spacing: -.06em; line-height: 1; background: linear-gradient(90deg, var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }

/* Footer --------------------------------------------------------------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--softer); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; padding-bottom: 28px; flex-wrap: wrap; }
.footer-copy { margin: 0; color: var(--muted); font-size: 13px; }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1000px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }
    .kb-grid { grid-template-columns: repeat(2, 1fr); }
    .kb-layout { grid-template-columns: 1fr; }
    .kb-side .panel { position: static; }
}
@media (max-width: 720px) {
    :root { --header-h: 60px; }
    .container { padding: 0 16px; }
    .header-inner { gap: 10px; }
    .main-nav { margin-inline-start: 0; }
    .main-nav a span { display: none; }
    .lang-switch summary span { display: none; }
    .app-grid, .kb-grid, .settings-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 36px; }
    .knowledge-band { gap: 16px; }
    .kb-band-stats { gap: 18px; }
    .head-row { align-items: flex-start; }
    .panel { padding: 18px; }
}
