/* ==========================================================================
   Digital Card — design system
   Light + dark, mobile-first. No frameworks, no external requests.
   ========================================================================== */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e4e7f0;
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-soft: #eef0ff;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #7c3aed 100%);
  --success: #16a34a;  --success-soft: #e8f8ee;
  --danger: #dc2626;   --danger-soft: #fdeded;
  --warn: #b45309;     --warn-soft: #fff4e0;
  --info: #2563eb;     --info-soft: #e8f0ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 6px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --sidebar-w: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#0a0f1f; --surface:#121a30; --surface-2:#0e1528; --text:#e9edf9; --muted:#96a3c1; --border:#222e4d; --brand:#8184ff; --brand-600:#9a9dff; --brand-soft:#1b2250; --success-soft:#0f2a1b; --danger-soft:#2f1417; --warn-soft:#33240c; --info-soft:#13213f; --shadow:0 6px 24px rgba(0,0,0,.35); --shadow-lg:0 24px 60px rgba(0,0,0,.55); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg:#0a0f1f; --surface:#121a30; --surface-2:#0e1528; --text:#e9edf9; --muted:#96a3c1; --border:#222e4d; --brand:#8184ff; --brand-600:#9a9dff; --brand-soft:#1b2250; --success-soft:#0f2a1b; --danger-soft:#2f1417; --warn-soft:#33240c; --info-soft:#13213f; --shadow:0 6px 24px rgba(0,0,0,.35); --shadow-lg:0 24px 60px rgba(0,0,0,.55); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--brand-soft); color: var(--brand-600); padding: .1em .4em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.muted { color: var(--muted); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ic { flex: none; vertical-align: middle; }
.show-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .show-light { display: none; } :root:not([data-theme="light"]) .show-dark { display: inline-flex; } }
:root[data-theme="dark"] .show-light { display: none; } :root[data-theme="dark"] .show-dark { display: inline-flex; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; font: inherit; font-weight: 600; font-size: 14px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none !important; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-primary:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent); filter: brightness(1.05); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.spacer { flex: 1; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.req { color: var(--danger); font-style: normal; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.field-msg { display: block; font-size: 12.5px; margin-top: 5px; min-height: 0; }
.field-msg.bad { color: var(--danger); } .field-msg.good { color: var(--success); }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2.tight { gap: 0 10px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.strength { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.strength > i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }
.strength-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: block; }
.otp { letter-spacing: .6em; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Alerts / badges ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error   { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warn    { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info    { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-600); vertical-align: middle; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.badge-ok { background: var(--success-soft); color: var(--success); } .badge-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); } .badge-bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 20px; }
.panel > h2, .panel-head h2 { font-size: 17px; margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none !important; }
.brand-mark { display: inline-grid; place-items: center; border-radius: 10px; background: var(--brand-grad); color: #fff; font-weight: 800; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 40%, transparent); }
.brand-light { color: #fff; }

/* ==========================================================================
   Dashboard shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; transition: transform .25s ease; overflow-y: auto; }
.sidebar .brand { padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none !important; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-600); }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 19px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.avatar-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; }
.avatar-chip > img, .avatar-chip > span { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; }
.avatar-meta { display: flex; flex-direction: column; line-height: 1.15; }
.avatar-meta strong { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-meta small { color: var(--muted); font-size: 11.5px; }
.content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.scrim { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(8, 12, 28, .5); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 90px; }
  .avatar-meta { display: none; } .avatar-chip { padding: 4px; }
}

/* ---------- Overview ---------- */
.hero-card { background: var(--brand-grad); color: #fff; border-radius: 20px; padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; box-shadow: 0 18px 40px color-mix(in srgb, var(--brand) 35%, transparent); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero-card h2 { font-size: 24px; margin: 0 0 6px; } .hero-card p { margin: 0 0 18px; opacity: .88; }
.link-box { display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); padding: 6px 6px 6px 14px; border-radius: 12px; max-width: 520px; backdrop-filter: blur(6px); }
.link-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.link-box .btn { background: #fff; color: var(--brand-600); padding: 7px 12px; font-size: 13px; }
.qr-box { background: #fff; padding: 10px; border-radius: 14px; width: 132px; height: 132px; position: relative; z-index: 1; display: grid; place-items: center; }
.qr-box svg, .qr-box img { width: 100%; height: 100%; display: block; }
@media (max-width: 720px) { .hero-card { grid-template-columns: 1fr; } .qr-box { display: none; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-600); }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; line-height: 1.1; }
.stat small { color: var(--muted); font-weight: 600; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1040px) { .split { grid-template-columns: 1fr; } }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.todo li:last-child { border: 0; }
.todo .box { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; }
.todo .done { color: var(--muted); } .todo .done .box { background: var(--success); border-color: var(--success); color: #fff; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--border) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.phone { width: 270px; max-width: 100%; margin: 0 auto; border-radius: 38px; padding: 10px; background: #0b1020; box-shadow: var(--shadow-lg); position: relative; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 70px; height: 18px; background: #0b1020; border-radius: 99px; z-index: 2; }
.phone iframe { width: 100%; height: 520px; border: 0; border-radius: 28px; background: #fff; display: block; }

/* ---------- Items / tables ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.item-thumb { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-body { padding: 14px; flex: 1; }
.item-body h3 { font-size: 15px; margin: 0 0 4px; }
.item-body p { color: var(--muted); font-size: 13px; margin: 0; }
.item-foot { display: flex; gap: 8px; padding: 0 14px 14px; align-items: center; }
.empty { text-align: center; padding: 56px 20px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: var(--brand); margin-bottom: 10px; }
.empty h3 { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none !important; font-weight: 600; font-size: 13px; padding: 0 10px; }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Upload / profile form ---------- */
.form-sections { display: grid; gap: 20px; }
.save-bar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 14px 18px; margin-top: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.dropzone { display: flex; align-items: center; gap: 16px; padding: 16px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-preview { width: 76px; height: 76px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); }
.dz-preview img { width: 100%; height: 100%; object-fit: cover; }
.dz-text strong { display: block; } .dz-text small { color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.switch-row:last-child { border: 0; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); } .switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 28px; line-height: 1; color: var(--border); cursor: pointer; margin: 0; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f5b301; }
.star-row { color: #f5b301; letter-spacing: 2px; }

/* ---------- Theme picker ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.theme-opt { position: relative; cursor: pointer; display: block; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt .shot { display: block; border: 3px solid transparent; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); transition: all .2s; }
.theme-opt img { display: block; width: 100%; aspect-ratio: 390/800; object-fit: cover; object-position: top; }
.theme-opt:hover .shot { transform: translateY(-3px); box-shadow: var(--shadow); }
.theme-opt input:checked + .shot { border-color: var(--brand); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 35%, transparent); }
.theme-opt input:focus-visible + .shot { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 3px; }
.theme-opt .tick { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.theme-opt input:checked ~ .tick { display: grid; }
.theme-opt .nm { display: block; text-align: center; font-weight: 600; margin-top: 8px; font-size: 14px; }

/* ---------- Security ---------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); padding: 14px; border-radius: 12px; font-size: 15px; letter-spacing: .04em; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px dashed var(--border); padding: 12px; border-radius: 10px; word-break: break-all; font-size: 16px; letter-spacing: .12em; text-align: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.timeline li:last-child { border: 0; }
.timeline .when { color: var(--muted); min-width: 88px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone h2 { color: var(--danger); }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
dialog.modal { border: 0; border-radius: 18px; padding: 26px; max-width: 440px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(8, 12, 28, .55); backdrop-filter: blur(3px); }
dialog.modal h3 { font-size: 18px; }

/* ==========================================================================
   Auth screens
   ========================================================================== */
.auth-wrap { display: grid; grid-template-columns: minmax(340px, 5fr) 6fr; min-height: 100vh; }
.auth-side { background: var(--brand-grad); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before, .auth-side::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.auth-side::before { width: 420px; height: 420px; right: -160px; bottom: -120px; } .auth-side::after { width: 220px; height: 220px; left: -80px; top: 38%; }
.auth-pitch { position: relative; z-index: 1; max-width: 420px; }
.auth-pitch h2 { font-size: 36px; margin-bottom: 16px; } .auth-pitch p { opacity: .9; font-size: 16px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; } .ticks li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.ticks .ic { background: rgba(255,255,255,.2); border-radius: 50%; padding: 3px; width: 24px; height: 24px; }
.auth-copy { opacity: .7; position: relative; z-index: 1; }
.auth-main { display: flex; flex-direction: column; padding: 24px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-mobile-brand { visibility: hidden; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 8px 0 32px; }
.auth-card h1 { font-size: 28px; }
.auth-sub { margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--muted); font-size: 14px; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center-screen .auth-card { background: var(--surface); padding: 34px; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-mobile-brand { visibility: visible; }
}

/* ==========================================================================
   Landing page
   ========================================================================== */
.land-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.land-nav .in { max-width: 1160px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.land-nav nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.land-nav nav a.link { color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.land-nav nav a.link:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 760px) { .land-nav nav a.link { display: none; } }
.land-hero { position: relative; overflow: hidden; padding: 72px 20px 80px; }
.land-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 380px at 12% 8%, color-mix(in srgb, #6366f1 28%, transparent), transparent 70%), radial-gradient(600px 380px at 90% 20%, color-mix(in srgb, #ec4899 20%, transparent), transparent 70%), radial-gradient(600px 400px at 50% 100%, color-mix(in srgb, #06b6d4 18%, transparent), transparent 70%); }
.land-hero .in { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--brand-600); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.land-hero h1 { font-size: clamp(36px, 5.4vw, 62px); letter-spacing: -.035em; margin-bottom: 18px; }
.grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero .lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-bottom: 28px; }
.search-box { position: relative; max-width: 520px; margin-top: 26px; }
.search-box input { padding: 15px 16px 15px 46px; border-radius: 14px; box-shadow: var(--shadow); font-size: 15px; }
.search-box .ic { position: absolute; left: 15px; top: 16px; color: var(--muted); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 20; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 11px 14px; color: var(--text); text-decoration: none; }
.search-results a:hover { background: var(--surface-2); }
.search-results .none { padding: 14px; color: var(--muted); }
.mini-av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.mini-av img { width: 100%; height: 100%; object-fit: cover; }
.mock { position: relative; justify-self: center; }
.mock .phone { width: 290px; transform: rotate(3deg); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: rotate(3deg) translateY(-12px); } }
.mock-screen { height: 560px; border-radius: 28px; overflow: hidden; background: linear-gradient(180deg, #1e1b4b 0%, #312e81 38%, #f5f6fb 38%); color: #fff; position: relative; padding: 46px 18px 18px; font-family: var(--font); }
.mock-av { width: 78px; height: 78px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0 auto 10px; font-weight: 800; color: #4f46e5; font-size: 28px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.mock-screen h4 { text-align: center; margin: 0; font-size: 17px; } .mock-screen small { display: block; text-align: center; opacity: .8; }
.mock-row { margin-top: 12px; background: #fff; color: #0f172a; border-radius: 12px; padding: 11px 13px; display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.mock-row .ic { color: #4f46e5; }
.mock-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mock-btns span { background: #4f46e5; color: #fff; border-radius: 10px; padding: 9px; text-align: center; font-size: 12.5px; font-weight: 700; }
.mock-btns span:first-child { background: #16a34a; }
.chip-float { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 13px; }
.chip-float .ic { color: var(--brand); }
@media (max-width: 900px) { .land-hero .in { grid-template-columns: 1fr; } .mock { margin-top: 20px; } }
.land-section { padding: 72px 20px; } .land-section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.land-section .in { max-width: 1160px; margin: 0 auto; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; } .section-head h2 { font-size: clamp(28px, 3.6vw, 40px); } .section-head p { color: var(--muted); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 26px; transition: transform .2s, box-shadow .2s; } .alt .feature { background: var(--surface-2); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; margin-bottom: 16px; }
.feature h3 { font-size: 18px; } .feature p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: s; }
.step-card { position: relative; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; counter-increment: s; }
.step-card::before { content: counter(s); position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step-card h3 { margin-top: 8px; font-size: 18px; } .step-card p { color: var(--muted); margin: 0; }
.cta-band { background: var(--brand-grad); color: #fff; border-radius: 28px; padding: 56px 28px; text-align: center; max-width: 1120px; margin: 0 auto; position: relative; overflow: hidden; }
.cta-band h2 { font-size: clamp(26px, 3.4vw, 38px); } .cta-band p { opacity: .9; font-size: 17px; max-width: 520px; margin: 0 auto 26px; }
.cta-band .btn { background: #fff; color: var(--brand-600); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.land-foot { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ==========================================================================
   Installer
   ========================================================================== */
.install { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.install-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.install-card h1 { font-size: 24px; } .install-card h2 { font-size: 20px; } .install-card h3 { font-size: 15px; }
.stepper { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.stepper span { flex: 1; min-width: 120px; display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.stepper b { width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: var(--muted); display: grid; place-items: center; font-size: 12px; }
.stepper span.on { color: var(--text); border-color: var(--brand); } .stepper span.on b, .stepper span.done b { background: var(--brand); color: #fff; }
.step[hidden], [hidden] { display: none !important; }
.checks { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.checks .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; margin-top: 2px; }
.checks .ok .dot { background: var(--success); } .checks .bad .dot { background: var(--danger); } .checks .warn .dot { background: #d97706; }
.checks em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-left: 6px; } .checks small { color: var(--muted); }
.wizard-nav { display: flex; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.inline-test { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.test-result { font-size: 14px; } .test-result.ok { color: var(--success); } .test-result.bad { color: var(--danger); }
.log { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); }

@media print { .sidebar, .topbar, .save-bar { display: none !important; } .main { margin: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
