/* ============================================================
   Keystone — design system
   A restrained, premium dark interface.
   ============================================================ */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jbmono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jbmono-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ---------- tokens ---------- */
:root {
    --bg-0: #07080d;
    --bg-1: #0b0e14;
    --bg-2: #11151e;
    --bg-3: #171c28;
    --bg-4: #1e2433;

    --line-1: #1b2130;
    --line-2: #252d3f;
    --line-3: #34405a;

    --txt-1: #eef1f8;
    --txt-2: #a3adc0;
    --txt-3: #68748c;

    --acc-0: #8b7dff;
    --acc-1: #7a6df2;
    --acc-2: #5b4fe0;
    --acc-soft: rgba(122, 109, 242, 0.12);
    --acc-line: rgba(122, 109, 242, 0.32);

    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, 0.12);
    --warn: #f6b955;
    --warn-soft: rgba(246, 185, 85, 0.12);
    --danger: #f0616a;
    --danger-soft: rgba(240, 97, 106, 0.12);
    --info: #63a9ff;
    --info-soft: rgba(99, 169, 255, 0.12);

    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --sh-2: 0 10px 30px rgba(0, 0, 0, 0.38);
    --sh-3: 0 30px 70px rgba(0, 0, 0, 0.55);
    --ring: 0 0 0 3px rgba(122, 109, 242, 0.35);

    --r-xs: 6px;
    --r-sm: 9px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-pill: 999px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --sidebar-w: 252px;
    --topbar-h: 68px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--txt-1);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: rgba(122, 109, 242, 0.35); color: #fff; }

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--r-sm);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- generic layout ---------- */
.app-body { overflow: hidden; min-height: 100vh; }
.app-root { height: 100vh; }
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100%; }

.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background:
        radial-gradient(1200px 520px at 82% -10%, rgba(122, 109, 242, 0.055), transparent 60%),
        radial-gradient(900px 480px at 12% 108%, rgba(122, 109, 242, 0.04), transparent 55%),
        var(--bg-0);
}
.view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 36px 64px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- topbar ---------- */
.topbar {
    flex: none;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 36px;
    padding-left: 30px;
    border-bottom: 1px solid var(--line-1);
    background: rgba(7, 8, 13, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-title { min-width: 0; }
.topbar-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--txt-3);
}
.topbar-h {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--txt-1);
    line-height: 1.25;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
        color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.12s var(--ease);
    user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-icon { width: 17px; height: 17px; flex: none; }
.btn .spinner {
    width: 15px; height: 15px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    opacity: 0.85;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }

.btn-primary {
    background: linear-gradient(180deg, #8a7cff 0%, #6f62f0 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 14px rgba(109, 98, 240, 0.35), var(--sh-1);
}
.btn-primary:hover { background: linear-gradient(180deg, #9689ff 0%, #7b6ef6 100%); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 18px rgba(109, 98, 240, 0.42), var(--sh-1); }
.btn-primary:active { box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 2px 8px rgba(109, 98, 240, 0.3); }

.btn-secondary {
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    color: var(--txt-1);
    box-shadow: var(--sh-1);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--line-3); }

.btn-ghost { color: var(--txt-2); padding: 0 12px; }
.btn-ghost:hover { color: var(--txt-1); background: var(--bg-2); }

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(240, 97, 106, 0.28);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 4px 14px rgba(240, 97, 106, 0.35); }
.btn-danger-soft { color: var(--danger); }
.btn-danger-soft:hover { background: var(--danger-soft); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
    color: var(--txt-2);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
    position: relative;
}
.icon-btn:hover { background: var(--bg-3); color: var(--txt-1); }
.icon-btn-ghost:hover { background: var(--bg-2); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12.5px; font-weight: 600; color: var(--txt-2);
    letter-spacing: 0.01em;
}
.field-label .opt { color: var(--txt-3); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--txt-3); }
.field-error { font-size: 12.5px; color: var(--danger); display: none; }

.input, .select, .textarea {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--txt-1);
    caret-color: var(--acc-0);
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
    appearance: none;
}
.textarea { height: auto; min-height: 92px; padding: 10px 13px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--txt-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:-webkit-autofill,
.textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--txt-1);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset;
    transition: background-color 9999s ease-out;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--acc-1);
    background: var(--bg-3);
    box-shadow: var(--ring);
}
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2368748c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
.has-error .input { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 3px rgba(240, 97, 106, 0.3); }
.has-error .field-error { display: block; }
.has-error .field-label { color: var(--danger); }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-trailing {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-xs);
    color: var(--txt-3);
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.input-trailing:hover { color: var(--txt-1); background: var(--bg-4); }
.input-trailing svg { width: 16px; height: 16px; }

/* custom checkbox */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--line-3);
    border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    flex: none;
}
.check-box svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(0.4); transition: 0.15s var(--ease); }
.check input:checked + .check-box { background: var(--acc-1); border-color: var(--acc-1); }
.check input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check-box { box-shadow: var(--ring); }
.check-label { font-size: 13.5px; color: var(--txt-2); font-weight: 500; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch-track {
    width: 38px; height: 22px;
    border-radius: var(--r-pill);
    background: var(--bg-4);
    border: 1px solid var(--line-2);
    position: relative;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
    flex: none;
}
.switch-track::after {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--txt-2);
    transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.switch input:checked + .switch-track { background: var(--acc-1); border-color: var(--acc-1); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-label { font-size: 13.5px; color: var(--txt-2); font-weight: 500; }

/* ---------- cards & surfaces ---------- */
.card {
    background: var(--bg-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.card-pad { padding: 20px; }

/* ---------- badges & pills ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px;
    border-radius: var(--r-pill);
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-acc { background: var(--acc-soft); color: var(--acc-0); }
.badge-neutral { background: var(--bg-4); color: var(--txt-2); }
.badge-dot { background: transparent; color: var(--txt-3); }
.badge-dot::before { display: none; }

.pill {
    display: inline-flex; align-items: center;
    height: 22px; padding: 0 9px;
    border-radius: var(--r-pill);
    font-size: 11.5px; font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; }

.cat-social { background: rgba(244, 128, 130, 0.13); color: #ff8a92; }
.cat-email { background: rgba(80, 165, 255, 0.13); color: #74b4ff; }
.cat-banking { background: rgba(52, 211, 153, 0.13); color: #45dca7; }
.cat-work { background: rgba(166, 148, 255, 0.13); color: #a99cf4; }
.cat-shopping { background: rgba(246, 185, 85, 0.13); color: #f2c063; }
.cat-entertainment { background: rgba(244, 130, 210, 0.13); color: #f58fd6; }
.cat-other { background: rgba(167, 179, 200, 0.14); color: #aab4c6; }
.cat-neutral { background: rgba(167, 179, 200, 0.14); color: #aab4c6; }

/* ---------- avatar ---------- */
.avatar {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center;
    flex: none;
    font-size: 15px; font-weight: 700;
    color: rgba(238, 241, 248, 0.92);
    letter-spacing: 0.01em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.avatar.is-user { border-radius: var(--r-md); background: linear-gradient(180deg, #3a335f, #26223710); background: linear-gradient(160deg, #2c2c55, #1d1b38); color: #c9c3ff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 1px var(--acc-line), 0 0 14px rgba(122, 109, 242, 0.22); }

/* ---------- avatars palette (service initials) ---------- */
[data-avatar="0"] { background: linear-gradient(150deg, #e2607d, #a93a5c); }
[data-avatar="1"] { background: linear-gradient(150deg, #5b8cff, #3a5cd8); }
[data-avatar="2"] { background: linear-gradient(150deg, #35c68f, #1e8f6a); }
[data-avatar="3"] { background: linear-gradient(150deg, #9d8cff, #6a5ae0); }
[data-avatar="4"] { background: linear-gradient(150deg, #f2a94e, #d07c28); }
[data-avatar="5"] { background: linear-gradient(150deg, #44b9d6, #2b7fa0); }
[data-avatar="6"] { background: linear-gradient(150deg, #ea7ccc, #b64893); }
[data-avatar="7"] { background: linear-gradient(150deg, #7fb069, #4f7f3e); }
[data-avatar="8"] { background: linear-gradient(150deg, #c96f5e, #94402f); }
[data-avatar="9"] { background: linear-gradient(150deg, #6d7fb8, #47598f); }

/* ---------- page scaffolding ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-eyebrow {
    font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--acc-0);
}
.page-title { font-size: 27px; font-weight: 700; letter-spacing: -0.025em; margin-top: 6px; }
.page-sub { color: var(--txt-2); margin-top: 6px; max-width: 620px; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* ---------- skeletons ---------- */
.skeleton {
    border-radius: var(--r-sm);
    background: linear-gradient(100deg, var(--bg-3) 40%, var(--bg-4) 50%, var(--bg-3) 60%);
    background-size: 220% 100%;
    animation: shimmer 1.4s var(--ease) infinite;
    min-height: 12px;
}
.skeleton-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-1); }
.skeleton-avatar { width: 44px; height: 44px; border-radius: var(--r-md); }
.skeleton-line { height: 13px; border-radius: 6px; }
.skeleton-line.short { width: 42%; }
.skeleton-line.tiny { width: 26%; height: 10px; }

/* ---------- toasts ---------- */
.toast-root {
    position: fixed;
    top: 18px; right: 18px;
    z-index: 200;
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(380px, calc(100vw - 36px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 15px;
    background: rgba(23, 28, 40, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font-size: 13.5px; color: var(--txt-1);
    pointer-events: auto;
    transform: translateX(calc(100% + 24px));
    animation: toast-in 0.34s var(--ease) forwards;
}
.toast.is-out { animation: toast-out 0.28s var(--ease) forwards; }
.toast-icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast-ok .toast-icon { color: var(--ok); }
.toast-err .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-body { display: flex; flex-direction: column; gap: 1px; }
.toast-title { font-weight: 600; font-size: 13px; }
.toast-text { color: var(--txt-2); font-size: 12.5px; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.is-open { display: block; }
.modal-overlay {
    position: absolute; inset: 0;
    background: rgba(4, 5, 9, 0.72);
    backdrop-filter: blur(4px);
    animation: fade-in 0.22s var(--ease);
}
.modal {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.965);
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-3);
    animation: modal-in 0.26s var(--ease) forwards;
    overflow: hidden;
}
.modal-lg { width: min(700px, calc(100vw - 40px)); }
.modal-sm { width: min(400px, calc(100vw - 40px)); }
.modal-head {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px 0;
}
.modal-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.modal-sub { color: var(--txt-3); font-size: 12.5px; margin-top: 2px; }
.modal-close { margin-left: auto; }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }
.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line-1);
    background: var(--bg-1);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.modal-foot .foot-hint { margin-right: auto; color: var(--txt-3); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.modal-foot .foot-hint svg { width: 15px; height: 15px; color: var(--ok); }

/* ---------- drawer (detail panel) ---------- */
.drawer-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(4, 5, 9, 0.6);
    backdrop-filter: blur(3px);
    animation: fade-in 0.22s var(--ease);
}
.drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(480px, 100vw);
    background: var(--bg-1);
    border-left: 1px solid var(--line-2);
    box-shadow: var(--sh-3);
    z-index: 95;
    display: flex; flex-direction: column;
    transform: translateX(105%);
    animation: drawer-in 0.34s var(--ease) forwards;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 0 26px 28px; }
.drawer-head {
    flex: none;
    display: flex; align-items: center; gap: 14px;
    padding: 0 26px;
    height: 64px;
    border-bottom: 1px solid var(--line-1);
    position: sticky; top: 0;
    background: var(--bg-1);
    z-index: 2;
}
.drawer-title { font-size: 15px; font-weight: 700; }

/* ---------- generic lists ---------- */
.list { border: 1px solid var(--line-1); border-radius: var(--r-lg); background: var(--bg-2); box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, 0.03); overflow: hidden; }

/* ---------- icons sizes ---------- */
.icon-svg, .nav-svg { width: 20px; height: 20px; flex: none; }
.sm-icon { width: 16px; height: 16px; flex: none; }

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { transform: translateX(calc(100% + 24px)); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(calc(100% + 24px)); opacity: 0; } }
@keyframes modal-in { from { transform: translate(-50%, -50%) scale(0.965); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(105%); } to { transform: translateX(0); } }
@keyframes rise-in { from { transform: translateY(10px) scale(0.992); opacity: 0; filter: blur(3px); } to { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); } }
@keyframes pop-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes check-pop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.view-enter { animation: rise-in 0.26s var(--ease); }
.view-leave { animation: rise-in 0.18s var(--ease-in) reverse; }

/* utility */
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.text-2 { color: var(--txt-2); }
.text-3 { color: var(--txt-3); }
.stack > * + * { margin-top: 16px; }
.clipboard-temp { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }
.u-flex-1 { flex: 1; min-width: 0; }
.u-mt-xs { margin-top: 6px; }
.u-mt-sm { margin-top: 14px; }
.u-mt-md { margin-top: 22px; }
.u-mt-lg { margin-top: 26px; }
.u-mb-lg { margin-bottom: 18px; }
.u-mla { margin-left: auto; }
.u-min-0 { min-width: 0; }
.u-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-pre { white-space: pre-wrap; }
.u-strong-13 { font-size: 13px; font-weight: 600; }

.select-narrow { width: 160px; flex: none; }

/* scroll-lock for overlay surfaces (CSP-safe) */
body.is-modal-open, body.is-drawer-open { overflow: hidden; }

/* confirm dialog overrides */
.confirm-dialog .detail-hero { padding: 0 0 6px; }
.confirm-dialog .detail-url { margin-top: 6px; }

/* recent lists (dashboard) */
.recent-list { padding: 6px 0 8px; }

/* auth error box (CSP-safe, no cssText) */
.auth-error {
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--r-md);
    padding: 11px 13px;
    font-size: 13px;
    margin-top: 16px;
}

/* drawer skeleton avatar */
.drawer-hero-avatar {
    width: 58px;
    height: 58px;
    border-radius: var(--r-lg);
}

/* cat tile icon accent (dashboard + categories) */
.cat-tile-icon { color: var(--acc-0); background: var(--acc-soft); }
.cat-card .stat-icon { margin-bottom: 0; }
.categories-foot { margin-top: 22px; font-size: 12.5px; }

/* category pill on locked list */
.pill .issue-chip { margin-left: auto; }

/* drawer close alignment (fallback for inline removed) */
.drawer-head .drawer-close { margin-left: auto; }

/* security score chip */
.chip.score-chip { font-size: 11px; padding: 0 9px; }

/* entry position for kebab menu anchoring */
.entry { position: relative; }
.menu-wrap {
    position: absolute;
    top: calc(100% - 8px);
    right: 46px;
    z-index: 60;
}

/* generator copy pulse feedback (CSP-safe) */
.icon-btn.copied-pulse { color: var(--ok); }

/* skeleton size variants */
.sk-h-110 { height: 110px; }
.sk-h-120 { height: 120px; }
.sk-h-150 { height: 150px; }
.sk-h-180 { height: 180px; }

/* compact empty state */
.empty-compact { padding: 44px 20px; }
.empty-compact .text-3 { font-size: 13px; }
.empty-icon.is-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(240, 97, 106, 0.25); }

/* ============================================================
   Sidebar + brand
   ============================================================ */
.sidebar {
    border-right: 1px solid var(--line-1);
    background:
        linear-gradient(180deg, rgba(139, 125, 255, 0.035), transparent 34%),
        rgba(11, 14, 20, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 40;
    min-height: 0;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 22px 16px 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(150deg, rgba(139, 125, 255, 0.14), rgba(91, 79, 224, 0.14)); border: 1px solid var(--acc-line); }
.brand-svg { width: 24px; height: 24px; }
.brand-img { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; }
.preloader-mark .brand-img { width: 33px; height: 33px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-edition { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--txt-3);
    padding: 14px 12px 7px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    height: 42px; padding: 0 12px;
    border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 600; color: var(--txt-2);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
    position: relative;
}
.nav-item svg { color: var(--txt-3); transition: color 0.15s var(--ease); }
.nav-item:hover { background: var(--bg-2); color: var(--txt-1); }
.nav-item:hover svg { color: var(--txt-2); }
.nav-item.is-active { background: var(--acc-soft); color: var(--acc-0); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 14px rgba(109, 98, 240, 0.16); }
.nav-item.is-active svg { color: var(--acc-0); }
.nav-item.is-active::before {
    content: "";
    position: absolute; left: -16px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--acc-1);
}

.sidebar-footer { margin-top: auto; padding-top: 16px; }
.user-card {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 10px;
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    background: var(--bg-2);
}
.user-meta { min-width: 0; flex: 1; }
.user-name { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; font-size: 11.5px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-version { text-align: center; font-size: 10.5px; color: var(--txt-3); padding-top: 12px; letter-spacing: 0.02em; }

.backdrop {
    position: fixed; inset: 0;
    background: rgba(3, 4, 8, 0.66);
    backdrop-filter: blur(2px);
    z-index: 35;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s var(--ease);
}

/* ============================================================
   Boot preloader
   ============================================================ */
.preloader {
    position: fixed; inset: 0; z-index: 999;
    display: grid; place-items: center;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(122, 109, 242, 0.06), transparent 60%),
        var(--bg-0);
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.preloader-ring {
    position: relative; width: 96px; height: 96px;
    display: grid; place-items: center;
}
.preloader-ring::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent 0deg, transparent 302deg,
        rgba(122, 109, 242, 0.4) 328deg,
        #8b7dff 346deg,
        #c9bfff 356deg, transparent 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
    animation: preloader-spin 1.15s linear infinite;
}
.preloader-ring::after {
    content: ""; position: absolute; inset: -16px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(122, 109, 242, 0.16), transparent 72%);
    animation: preloader-breathe 2.8s var(--ease) infinite;
}
.preloader-mark {
    position: relative; z-index: 1;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    border-radius: 15px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    box-shadow: var(--sh-2), 0 0 0 1px rgba(122, 109, 242, 0.1);
    animation: preloader-breathe 2.8s var(--ease) infinite;
}
.preloader-mark svg { width: 33px; height: 33px; }
.preloader-name {
    font-size: 14px; font-weight: 700;
    letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--txt-1);
}
.preloader-hint { font-size: 12px; color: var(--txt-3); margin-top: -8px; }
@keyframes preloader-spin { to { transform: rotate(360deg); } }
@keyframes preloader-breathe {
    0%, 100% { opacity: 0.55; transform: scale(0.97); }
    50% { opacity: 1; transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
    .preloader-ring::before, .preloader-ring::after, .preloader-mark { animation: none; }
    .preloader.is-done { transition: none; }
}

/* ============================================================
   Auth screens
   ============================================================ */
.auth-root {
    position: relative;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 28px 20px;
    overflow: hidden;
    background:
        radial-gradient(1100px 560px at 78% -12%, rgba(122, 109, 242, 0.08), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(122, 109, 242, 0.06), transparent 55%),
        var(--bg-0);
}
.auth-root[hidden] { display: none; }
.auth-root::before,
.auth-root::after {
    content: ""; position: absolute; border-radius: 50%;
    filter: blur(70px); pointer-events: none;
}
.auth-root::before {
    width: 420px; height: 420px; left: 8%; top: -120px;
    background: rgba(122, 109, 242, 0.09);
    animation: preloader-breathe 9s var(--ease) infinite;
}
.auth-root::after {
    width: 380px; height: 380px; right: 6%; bottom: -140px;
    background: rgba(80, 165, 255, 0.07);
}
.auth-shell { width: min(430px, 100%); position: relative; z-index: 1; }
.auth-card {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 34px 36px 30px;
}
.auth-card::before {
    content: ""; position: absolute; left: 18px; right: 18px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--acc-line), transparent);
}
.auth-crest { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.auth-brandmark {
    width: 58px; height: 58px;
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(139, 125, 255, 0.16), rgba(91, 79, 224, 0.16));
    border: 1px solid var(--acc-line);
    display: grid; place-items: center;
    margin-bottom: 16px;
    box-shadow: var(--sh-1);
}
.auth-brandmark .brand-svg { width: 34px; height: 34px; }
.auth-crest h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.auth-crest p { color: var(--txt-3); font-size: 13px; margin-top: 6px; max-width: 300px; }

.auth-tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--bg-1);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: 24px;
}
.auth-tab {
    height: 38px;
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600;
    color: var(--txt-3);
    transition: color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.auth-tab:hover { color: var(--txt-1); }
.auth-tab.is-active { background: var(--bg-3); color: var(--txt-1); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line-2); }

.auth-foot { text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--txt-3); }
.auth-note {
    display: flex; align-items: flex-start; gap: 9px;
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--bg-1);
    border: 1px solid var(--line-1);
    font-size: 12.5px; color: var(--txt-2); line-height: 1.5;
}
.auth-note svg { width: 16px; height: 16px; color: var(--acc-0); flex: none; margin-top: 1px; }
.auth-brandmeta { display: flex; justify-content: center; gap: 18px; margin-top: 22px; font-size: 11.5px; color: var(--txt-3); }
.auth-brandmeta span { display: inline-flex; align-items: center; gap: 6px; }
.auth-brandmeta svg { width: 13px; height: 13px; color: var(--ok); }

.lock-screen { text-align: center; }
.lock-screen .lock-icon { margin: 0 auto 16px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--acc-soft); border: 1px solid var(--acc-line); }
.lock-screen .lock-icon svg { width: 22px; height: 22px; color: var(--acc-0); }
.lock-sub { color: var(--txt-3); font-size: 13px; margin-top: 8px; max-width: 300px; margin-left: auto; margin-right: auto; }

/* Password recovery */
.sent-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sent-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); border: 1px solid rgba(52, 211, 153, 0.3); }
.sent-icon svg { width: 22px; height: 22px; color: var(--ok); }
.sent-wrap h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-top: 12px; }
.sent-text { font-size: 12.5px; color: var(--txt-2); line-height: 1.55; margin-top: 9px; max-width: 300px; }
.dev-link-wrap { width: 100%; text-align: left; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-1); border: 1px dashed var(--line-3); }
.dev-link-label { display: block; font-size: 11.5px; color: var(--txt-3); margin-bottom: 8px; line-height: 1.5; }
.dev-link { display: block; font-family: var(--mono); font-size: 11px; color: var(--acc-0); word-break: break-all; line-height: 1.5; }
.btn.is-copied { border-color: var(--ok); color: var(--ok); }
.ok-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 600; font-size: 12px; }
.ok-tag svg { width: 13px; height: 13px; }

/* ============================================================
   Dashboard
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
    position: relative; overflow: hidden;
}
.stat-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat-card::before {
    content: "";
    position: absolute; left: 18px; top: 0;
    width: 26px; height: 2px;
    border-radius: 0 0 4px 4px;
    background: var(--acc-1);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 14px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-acc { background: var(--acc-soft); color: var(--acc-0); }
.stat-ok { background: var(--ok-soft); color: var(--ok); }
.stat-warn { background: var(--warn-soft); color: var(--warn); }
.stat-danger { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--txt-3); font-weight: 600; margin-top: 4px; }
.stat-hint { font-size: 11px; color: var(--txt-3); margin-top: 6px; }

.dash-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.panel-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.panel-link { font-size: 12px; color: var(--acc-0); font-weight: 600; }
.panel-link:hover { text-decoration: underline; }

.recent-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid var(--line-1);
    cursor: pointer;
    transition: background 0.15s var(--ease);
}
.recent-row:first-of-type { border-top: 0; }
.recent-row:hover { background: var(--bg-3); }
.recent-body { flex: 1; min-width: 0; }
.recent-service { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-time { font-size: 12px; color: var(--txt-3); margin-top: 1px; }
.recent-chev { color: var(--txt-3); }

.cat-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 14px; }
.cat-tile {
    background: var(--bg-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    padding: 14px 12px;
    cursor: pointer;
    transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), background 0.16s var(--ease);
    text-align: left;
}
.cat-tile:hover { border-color: var(--line-3); background: var(--bg-3); transform: translateY(-1px); }
.cat-tile-icon { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 12px; }
.cat-tile-icon svg { width: 15px; height: 15px; }
.cat-tile-name { font-size: 12.5px; font-weight: 600; color: var(--txt-2); }
.cat-tile-count { font-size: 17px; font-weight: 700; margin-top: 2px; }

.sec-banner { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line-1); background: var(--bg-2); margin-top: 14px; }
.sec-banner-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }
.sec-banner-icon svg { width: 22px; height: 22px; }
.sec-banner-body { flex: 1; min-width: 0; }
.sec-banner-title { font-size: 14.5px; font-weight: 700; }
.sec-banner-text { font-size: 12.5px; color: var(--txt-2); margin-top: 2px; }
.sec-banner-cta { flex: none; }

/* ============================================================
   Vault
   ============================================================ */
.vault-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-wrap .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--txt-3); width: 17px; height: 17px; pointer-events: none; }
.search-wrap .input { padding-left: 40px; height: 42px; background: var(--bg-2); }
.search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
    color: var(--txt-3); transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.search-clear:hover { color: var(--txt-1); background: var(--bg-4); }
.search-clear svg { width: 13px; height: 13px; }
.vault-count { font-size: 12.5px; color: var(--txt-3); font-weight: 500; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
    height: 32px; padding: 0 13px;
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--txt-2);
    font-size: 12.5px; font-weight: 600;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { border-color: var(--line-3); color: var(--txt-1); }
.chip.is-active { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-0); }
.chip .chip-n { color: var(--txt-3); font-size: 11px; }

.entry {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px;
    border-top: 1px solid var(--line-1);
    cursor: pointer;
    transition: background 0.15s var(--ease);
}
.entry:first-child { border-top: 0; }
.entry:hover { background: var(--bg-3); }
.entry-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.entry-service { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-username { font-size: 12.5px; color: var(--txt-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-main { min-width: 0; }
.entry-meta { display: flex; align-items: center; gap: 14px; flex: none; }
.entry-pw { display: inline-flex; align-items: center; gap: 9px; min-width: 96px; }
.pw-dots { font-family: var(--mono); letter-spacing: 2px; color: var(--txt-3); font-size: 13px; }
.pw-value { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; color: var(--txt-1); word-break: break-all; }
.entry-actions { display: inline-flex; align-items: center; gap: 4px; opacity: 0; transform: translateX(4px); transition: opacity 0.16s var(--ease), transform 0.16s var(--ease); }
.entry:hover .entry-actions, .entry:focus-within .entry-actions { opacity: 1; transform: translateX(0); }
@media (hover: none) { .entry-actions { opacity: 1; transform: none; } }
.entry-time { font-size: 11.5px; color: var(--txt-3); white-space: nowrap; width: 84px; text-align: right; flex: none; }
.icon-action {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px;
    color: var(--txt-3);
    transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.icon-action svg { width: 15.5px; height: 15.5px; }
.icon-action:hover { background: var(--bg-4); color: var(--txt-1); }
.icon-action.copied { color: var(--ok); background: var(--ok-soft); }
.icon-action.copied svg { animation: check-pop 0.28s var(--ease); }

/* ============================================================
   Detail drawer
   ============================================================ */
.detail-hero { padding: 26px 0 4px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.detail-hero .avatar { width: 58px; height: 58px; font-size: 21px; border-radius: var(--r-lg); }
.detail-service { font-size: 18px; font-weight: 700; margin-top: 12px; letter-spacing: -0.01em; }
.detail-url { font-size: 12.5px; color: var(--txt-3); margin-top: 3px; word-break: break-all; }
.detail-cats { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

.detail-sec { margin-top: 22px; }
.detail-sec-t { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 10px; }
.detail-field {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-md);
    margin-bottom: 9px;
}
.detail-field + .detail-field { margin-top: 0; }
.detail-field-label { flex: none; width: 74px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-3); }
.detail-field-value { flex: 1; min-width: 0; font-size: 13.5px; word-break: break-all; }
.detail-field-value.mono { font-family: var(--mono); font-size: 13px; }
.detail-field-value .off { filter: blur(5px); user-select: none; pointer-events: none; }
.detail-field .icon-action { flex: none; }

.detail-notes { margin-top: 10px; background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-md); padding: 14px 16px; white-space: pre-wrap; }
.detail-date-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--txt-3); margin-top: 14px; }
.detail-date-row b { color: var(--txt-2); font-weight: 600; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-top: 8px; }

/* ============================================================
   Add / edit modal form
   ============================================================ */
.pwgen-inline { display: flex; gap: 10px; align-items: center; }
.pwgen-inline .input-wrap { flex: 1; }
.pwgen-inline .btn { flex: none; }
.strength { margin-top: 9px; display: flex; align-items: center; gap: 12px; }
.strength-bar { flex: 1; height: 5px; border-radius: 4px; background: var(--bg-4); overflow: hidden; display: flex; gap: 3px; }
.strength-bar i { flex: 1; border-radius: 3px; background: var(--bg-4); transition: background 0.25s var(--ease); }
.strength-bar i.filled { background: currentColor; }
.strength-label { font-size: 12px; font-weight: 600; flex: none; min-width: 74px; text-align: right; color: var(--txt-3); }
.strength-0 { color: var(--danger); } .strength-1 { color: var(--danger); }
.strength-2 { color: var(--warn); }
.strength-3 { color: var(--info); }
.strength-4 { color: var(--ok); }
.gen-opts { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }

/* ============================================================
   Generator page
   ============================================================ */
.gen-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.gen-panel { padding: 26px; }
.gen-output {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    padding: 18px 20px;
    position: relative;
}
.gen-output-value {
    flex: 1; min-width: 0;
    font-family: var(--mono);
    font-size: 21px; font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--txt-1);
    word-break: break-all;
    line-height: 1.4;
}
.gen-output .icon-btn { flex: none; }
.gen-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--acc-0); }
.gen-link:hover { text-decoration: underline; }

.gen-side-panel > .card { padding: 22px 24px; margin-bottom: 14px; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row output { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--txt-1); min-width: 38px; text-align: right; }
input[type="range"] {
    flex: 1;
    -webkit-appearance: none; appearance: none;
    height: 5px; border-radius: 4px;
    background: var(--bg-4);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 17px; height: 17px; border-radius: 50%;
    background: var(--acc-1);
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.12s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--acc-1); border: 2px solid rgba(255,255,255,0.85); cursor: pointer;
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line-1); }
.toggle-name { font-size: 13.5px; font-weight: 600; color: var(--txt-1); }
.toggle-desc { font-size: 11.5px; color: var(--txt-3); margin-top: 1px; }

/* ============================================================
   Security overview
   ============================================================ */
.security-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.health-card { padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-wrap { position: relative; width: 168px; height: 168px; }
.ring-bg { fill: none; stroke: var(--bg-4); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--acc-1); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.9s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-score { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ring-grade { font-size: 12px; font-weight: 700; color: var(--acc-0); margin-top: 6px; letter-spacing: 0.14em; }
.health-text { margin-top: 18px; font-size: 13.5px; color: var(--txt-2); max-width: 300px; }

.check-card { padding: 22px 24px; }
.check-list { display: flex; flex-direction: column; margin-top: 6px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-1); }
.check-item:last-child { border-bottom: 0; }
.check-item-icon { width: 20px; height: 20px; flex: none; }
.check-item-icon.ok { color: var(--ok); }
.check-item-icon.warn { color: var(--warn); }
.check-item-text { font-size: 13.5px; color: var(--txt-2); }
.check-item-text b { color: var(--txt-1); font-weight: 600; }

.stat-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.stat-trio .stat-value { font-size: 22px; }
.issue-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.issue-head svg { width: 18px; height: 18px; color: var(--warn); }
.issue-head h3 { font-size: 14.5px; font-weight: 700; }
.issue-head span { color: var(--txt-3); font-size: 12.5px; }
.issue-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; }
.issue-chip { margin-left: auto; }
.issue-times { font-size: 11.5px; color: var(--txt-3); }

.reveal-chip { font-size: 11px; font-weight: 600; color: var(--txt-3); font-family: var(--mono); letter-spacing: 0.05em; }

/* ============================================================
   Categories page
   ============================================================ */
.cat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.cat-toolbar .text-3 { color: var(--text-2); margin: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

/* Settings / account */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.settings-card { display: flex; flex-direction: column; gap: 16px; }
.settings-head { display: flex; align-items: center; gap: 12px; }
.settings-head .icon-svg { width: 22px; height: 22px; color: var(--acc); flex: none; }
.settings-head h3 { margin: 0 0 2px; font-size: 15px; }
.settings-head p { margin: 0; }
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.settings-form .btn { align-self: flex-start; }
.settings-brand .brand-row { display: flex; align-items: center; gap: 12px; }
.settings-brand .settings-label { min-width: 74px; color: var(--text-2); font-size: 13px; }
.settings-brand .settings-preview { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; border: 1px solid var(--line-1); background: var(--bg-1); padding: 4px; }
.settings-loading { padding: 40px 0; text-align: center; }
.sidebar .nav-settings { padding: 9px 12px; margin: 8px 12px 4px; border-top: 1px solid var(--line-1); border-radius: 10px; color: var(--text-2); text-decoration: none; display: flex; align-items: center; gap: 11px; font-size: 14px; }
.sidebar .nav-settings:hover { color: var(--text-1); background: var(--bg-2); }
.cat-card {
    background: var(--bg-2);
    border: 1px solid var(--line-1);
    border-radius: var(--r-lg);
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), background 0.16s var(--ease);
    display: flex; flex-direction: column; gap: 14px;
}
.cat-card:hover { border-color: var(--line-3); background: var(--bg-3); transform: translateY(-2px); }
.cat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.cat-card-icon { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; }
.cat-card-icon svg { width: 19px; height: 19px; }
.cat-card-count { font-size: 15px; font-weight: 700; color: var(--txt-1); }
.cat-card-count small { font-size: 11px; color: var(--txt-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.cat-card-name { font-size: 14.5px; font-weight: 600; }
.cat-del { position: relative; margin-left: 10px; vertical-align: middle; width: 22px; height: 22px; border: none; background: transparent; color: var(--txt-3); border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; }
.cat-del svg { width: 14px; height: 14px; }
.cat-del:hover { color: var(--danger, #ef4444); background: var(--bg-3); }
.cat-card-open { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--acc-0); }
.cat-card-open svg { width: 14px; height: 14px; }

/* ============================================================
   Empty states
   ============================================================ */
.empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 64px 28px;
}
.empty-icon {
    width: 64px; height: 64px;
    border-radius: var(--r-lg);
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    display: grid; place-items: center;
    color: var(--txt-3);
    margin-bottom: 20px;
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-icon.has-acc { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-0); }
.empty-title { font-size: 16px; font-weight: 700; }
.empty-text { font-size: 13.5px; color: var(--txt-3); margin-top: 7px; max-width: 360px; }
.empty-cta { margin-top: 22px; }

/* ============================================================
   Dropdown menu (kebab)
   ============================================================ */
.menu-wrap { position: relative; }
.menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 160px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--sh-2);
    padding: 5px;
    z-index: 60;
    transform-origin: top right;
    animation: pop-in 0.16s var(--ease);
}
.menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--r-xs);
    font-size: 13px; font-weight: 500;
    color: var(--txt-2);
    transition: background 0.13s var(--ease), color 0.13s var(--ease);
    text-align: left;
}
.menu-item svg { width: 15px; height: 15px; }
.menu-item:hover { background: var(--bg-4); color: var(--txt-1); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line-1); margin: 5px 4px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1120px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-strip { grid-template-columns: repeat(3, 1fr); }
    .security-grid { grid-template-columns: 1fr; }
    .gen-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        width: min(300px, 84vw);
        transform: translateX(-102%);
        transition: transform 0.3s var(--ease);
        box-shadow: var(--sh-3);
    }
    .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
    .nav-toggle:checked ~ .backdrop { opacity: 1; pointer-events: auto; }
    .menu-btn { display: inline-flex; }
    .view { padding: 22px 20px 90px; }
    .topbar { padding: 0 18px 0 16px; gap: 12px; }
    .topbar-eyebrow { display: none; }
    .topbar-h { font-size: 16px; }
    .dash-cols { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-value { font-size: 21px; }
    .cat-strip { grid-template-columns: repeat(2, 1fr); }
    .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .topbar-right .btn .btn-label { display: none; }
    .topbar-right .btn { padding: 0 12px; }
    .stat-trio { grid-template-columns: 1fr; }
    .gen-panel { padding: 20px; }
    .entry { padding: 13px 14px; }
    .entry-time { display: none; }
    .entry-pw { display: none; }
    .drawer { width: 100vw; }
    .modal, .modal-lg, .modal-sm { width: calc(100vw - 24px); }
    .auth-card { padding: 28px 22px 24px; }
    .detail-actions { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .gen-opts { grid-template-columns: 1fr; }
    .search-wrap { max-width: none; }
    .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}