:root {
    color-scheme: dark;
    --bg: #0d1320;
    --bg-soft: #111929;
    --panel: #182132;
    --panel-2: #1d2739;
    --line: #2d394e;
    --line-soft: #232e40;
    --text: #f7f9fc;
    --muted: #95a1b5;
    --cyan: #4b92b2;
    --violet: #5534ff;
    --magenta: #d40062;
    --orange: #ffb84d;
    --danger: #ff6376;
    --success: #68d6ab;
    --radius: 18px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 760; letter-spacing: -.02em; }
.brand-large { font-size: 25px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: white; font-size: 17px; font-weight: 850; background: linear-gradient(145deg, #2a65db, #512bf1); box-shadow: inset 0 0 0 5px rgba(9,15,28,.35), 0 0 24px rgba(84,51,255,.25); }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 720; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--orange); color: #111827; box-shadow: 0 10px 28px rgba(255,184,77,.16); }
.button-primary:hover { background: #ffc66d; }
.button-ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button-wide { width: 100%; }
.icon-button, .text-button, .favorite-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); font-size: 21px; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.06); }
.text-button { color: #79b9d7; font-size: 13px; font-weight: 700; }
.text-button:hover { color: #b3e5fb; }
.danger { color: var(--danger); }

.field { display: grid; gap: 8px; color: #c5cede; font-size: 13px; font-weight: 650; }
.field small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.field input, .field select, .field textarea, .category-row input { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--text); background: #111927; transition: border-color .15s, box-shadow .15s; }
.field input, .field select, .category-row input { height: 46px; padding: 0 13px; }
.field textarea { padding: 12px 13px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .category-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(75,146,178,.14); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-action { position: relative; display: flex; align-items: center; }
.input-action input { padding-right: 122px; }
.input-action .text-button { margin-left: -57px; width: 57px; position: relative; z-index: 1; }
.input-action .text-button + .text-button { margin-left: 0; }
.check-field { display: flex; align-items: center; gap: 9px; color: #c5cede; font-size: 13px; }
.check-field input { width: 17px; height: 17px; accent-color: var(--orange); }
.alert { padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert-error { color: #ffc2ca; background: rgba(255,99,118,.09); border-color: rgba(255,99,118,.25); }
.alert-warning { color: #f6d79c; background: rgba(255,184,77,.07); border-color: rgba(255,184,77,.2); }
.kicker, .nav-label { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: 10px; font-weight: 800; }

/* Authentication */
.auth-page { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(460px, .92fr); background: radial-gradient(circle at 78% 28%, rgba(84,51,255,.14), transparent 30%), var(--bg); }
.auth-brand { min-height: 100vh; padding: 44px clamp(40px, 6vw, 90px); display: flex; flex-direction: column; position: relative; overflow: hidden; border-right: 1px solid rgba(255,255,255,.04); }
.auth-brand::before { content: ""; position: absolute; width: 520px; height: 520px; right: -280px; top: 14%; border: 1px solid rgba(85,52,255,.25); border-radius: 50%; box-shadow: 0 0 90px rgba(85,52,255,.1); }
.auth-brand::after { content: ""; position: absolute; width: 210px; height: 210px; right: -78px; top: calc(14% + 155px); border: 1px solid rgba(255,184,77,.25); border-radius: 50%; }
.auth-copy { margin: auto 0; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid rgba(75,146,178,.55); border-radius: 999px; color: #d8eafa; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 750; }
.eyebrow i, .encryption-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px rgba(255,184,77,.5); }
.auth-copy h1 { margin: 30px 0 18px; max-width: 680px; font-size: clamp(54px, 6.4vw, 92px); line-height: .92; letter-spacing: -.065em; font-weight: 760; }
.auth-copy h1 strong { color: var(--orange); font-weight: inherit; }
.auth-copy p { max-width: 530px; margin: 0; color: #c2cad8; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; }
.brand-line { width: 280px; height: 5px; display: grid; grid-template-columns: 1.25fr .9fr 1fr .8fr; margin-bottom: 8vh; border-radius: 5px; overflow: hidden; }
.brand-line i:nth-child(1) { background: var(--cyan); }.brand-line i:nth-child(2) { background: var(--violet); }.brand-line i:nth-child(3) { background: var(--magenta); }.brand-line i:nth-child(4) { background: var(--orange); }
.auth-panel { padding: 44px clamp(30px, 5vw, 90px); display: grid; place-items: center; }
.auth-card { width: min(100%, 470px); display: grid; gap: 20px; padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: rgba(24,33,50,.88); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card-setup { width: min(100%, 580px); }
.auth-card-heading { display: flex; align-items: center; gap: 17px; margin-bottom: 4px; }
.auth-card-heading h2 { margin: 4px 0 0; font-size: 27px; letter-spacing: -.035em; }
.lock-orbit { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--violet); position: relative; }
.lock-orbit::before { content: ""; width: 22px; height: 26px; border-radius: 6px; background: #283456; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.lock-orbit::after { content: ""; width: 10px; height: 10px; border: 2px solid var(--orange); border-top: 0; border-left: 0; transform: rotate(45deg); position: absolute; }
.lock-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); right: -4px; top: 19px; }
.security-note { margin: -3px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.security-note span { color: var(--success); margin-right: 5px; }

/* Vault shell */
.vault-shell { min-height: 100vh; display: grid; grid-template-columns: 266px 1fr; }
.sidebar { min-height: 100vh; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 25px 18px 18px; border-right: 1px solid var(--line-soft); background: #0b111d; z-index: 10; }
.sidebar .brand { padding: 0 10px 28px; }
.sidebar-nav { display: grid; gap: 5px; overflow-y: auto; }
.nav-label { padding: 13px 12px 6px; }
.nav-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.nav-heading .icon-button { width: 30px; height: 30px; }
.nav-item { min-height: 43px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: #aeb8c9; font-size: 13px; font-weight: 620; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: white; border-color: rgba(75,146,178,.21); background: linear-gradient(90deg, rgba(75,146,178,.14), rgba(85,52,255,.07)); }
.nav-item b { color: #7f8ba0; font-size: 11px; }
.nav-icon { color: #78b4cf; font-size: 18px; }
.category-dot { width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(75,146,178,.08); }
.nav-item:nth-of-type(3n) .category-dot { background: var(--violet); }.nav-item:nth-of-type(4n) .category-dot { background: var(--orange); }.nav-item:nth-of-type(5n) .category-dot { background: var(--magenta); }
.sidebar-footer { margin-top: auto; display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 10px; padding: 15px 8px 2px; border-top: 1px solid var(--line-soft); }
.sidebar-tools { margin-top: auto; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.sidebar-tools + .sidebar-footer { margin-top: 0; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #d8eafa; background: linear-gradient(145deg, #22465e, #29365d); font-size: 13px; font-weight: 800; }
.user-info { min-width: 0; display: grid; gap: 2px; }
.user-info strong, .user-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info strong { font-size: 12px; }.user-info span { color: var(--muted); font-size: 10px; }
.lock-button { font-size: 18px; }
.vault-main { min-width: 0; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 18px; padding: 0 clamp(22px, 3.5vw, 52px); border-bottom: 1px solid var(--line-soft); background: rgba(13,19,32,.88); backdrop-filter: blur(18px); }
.search-form { flex: 1; max-width: 640px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line-soft); border-radius: 11px; background: #111927; }
.search-form span { color: #77859a; font-size: 24px; line-height: 1; transform: rotate(-15deg); }
.search-form input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-form input::placeholder { color: #6f7b8f; }
.mobile-menu { display: none; border: 0; background: transparent; color: white; font-size: 21px; }
.vault-content { padding: 42px clamp(22px, 3.5vw, 52px) 70px; }
.toast { margin-bottom: 20px; padding: 12px 15px; border: 1px solid rgba(104,214,171,.24); border-radius: 10px; color: #a6efd3; background: rgba(104,214,171,.07); font-size: 13px; }
.vault-content > .alert { margin-bottom: 20px; }
.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.content-heading h1 { margin: 6px 0 7px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; }
.content-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.encryption-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(104,214,171,.2); border-radius: 999px; color: #a8d9c7; background: rgba(104,214,171,.05); font-size: 11px; font-weight: 700; }
.encryption-pill i { background: var(--success); box-shadow: 0 0 11px rgba(104,214,171,.45); }
.item-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 16px; }
.vault-card { min-height: 230px; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(29,39,57,.82), rgba(21,29,44,.82)); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.vault-card:hover { transform: translateY(-3px); border-color: #3b4a63; box-shadow: 0 18px 35px rgba(0,0,0,.16); }
.card-error { border-color: rgba(255,99,118,.25); }
.card-top, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(75,146,178,.24); border-radius: 12px; color: #b8e5f7; background: linear-gradient(145deg, rgba(75,146,178,.18), rgba(85,52,255,.12)); font-weight: 850; }
.favorite-button { color: #657187; font-size: 25px; }.favorite-button:hover, .favorite-button.selected { color: var(--orange); }
.card-body { margin: 26px 0 20px; }
.card-body h2 { margin: 0 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; letter-spacing: -.02em; }
.card-body p { margin: 0 0 9px; overflow: hidden; color: #aab5c7; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.site-url { display: block; overflow: hidden; color: #6f829b; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.card-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.card-footer > span { color: #69768a; font-size: 10px; }
.card-actions { display: flex; align-items: center; gap: 10px; }.card-actions form { display: flex; }.card-actions .icon-button { width: 25px; height: 25px; font-size: 18px; }
.empty-state { min-height: 430px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 20px; background: rgba(255,255,255,.012); }
.empty-state h2 { margin: 18px 0 5px; }.empty-state p { margin: 0 0 22px; color: var(--muted); }.empty-icon { display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid var(--violet); border-radius: 50%; color: var(--orange); font-size: 30px; box-shadow: 0 0 45px rgba(85,52,255,.15); }

/* Modals */
.modal { width: min(94vw, 680px); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--panel); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(4,8,15,.76); backdrop-filter: blur(5px); }
.modal-card { display: block; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-heading h2 { margin: 4px 0 0; font-size: 23px; letter-spacing: -.03em; }
.modal-body { max-height: calc(92vh - 160px); display: grid; gap: 17px; padding: 24px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 24px; border-top: 1px solid var(--line-soft); }
.modal-history-link { margin-right: auto; align-self: center; }
.generator-row { display: flex; align-items: center; justify-content: space-between; margin-top: -7px; }
.chip { padding: 7px 10px; border: 1px solid rgba(75,146,178,.24); border-radius: 999px; color: #9fd4ea; background: rgba(75,146,178,.07); cursor: pointer; font-size: 11px; font-weight: 720; }
#password-strength { color: var(--success); font-size: 11px; }
.inline-create { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.category-list { display: grid; gap: 8px; }
.category-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.category-row > form:first-child { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.category-row input { height: 40px; }
.attachment-panel { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(10,16,27,.34); }
.attachment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.attachment-heading > div { display: grid; gap: 3px; }
.attachment-heading strong { color: #dbe3ee; font-size: 13px; }
.attachment-heading span, #attachment-help { color: var(--muted); font-size: 11px; }
#attachment-help { margin: 0; line-height: 1.45; }
#attachment-help.attachment-error { color: #ffc2ca; }
.attachment-list { display: grid; gap: 7px; }
.attachment-row { min-width: 0; display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line-soft); border-radius: 9px; background: #111927; }
.attachment-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #9fd4ea; background: rgba(75,146,178,.1); }
.attachment-row > div { min-width: 0; display: grid; gap: 2px; }
.attachment-row a, .attachment-row > div > strong { overflow: hidden; color: #dce7f3; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 680; }
.attachment-row a:hover { color: #9fd4ea; }
.attachment-row > div > span { color: var(--muted); font-size: 10px; }
.attachment-row .icon-button { width: 28px; height: 28px; }
.attachment-row.pending { border-color: rgba(255,184,77,.23); background: rgba(255,184,77,.04); }
.attachment-row.pending .attachment-icon { color: var(--orange); background: rgba(255,184,77,.1); }
.upload-progress { display: grid; gap: 7px; padding-top: 2px; }
.upload-progress[hidden] { display: none; }
.upload-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #b9c5d6; font-size: 11px; }
.upload-progress-copy strong { color: var(--orange); font-variant-numeric: tabular-nums; }
.upload-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #0b111d; box-shadow: inset 0 0 0 1px var(--line-soft); }
.upload-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--orange)); box-shadow: 0 0 16px rgba(85,52,255,.35); transition: width .18s ease; }

/* Account security */
.otp-input { letter-spacing: .16em; font-size: 18px; font-weight: 760; }
.security-page { min-height: 100vh; background: radial-gradient(circle at 74% 15%, rgba(85,52,255,.1), transparent 28%), var(--bg); }
.security-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid var(--line-soft); background: rgba(13,19,32,.9); }
.security-topbar-actions { display: flex; align-items: center; gap: 10px; }.security-topbar-actions form { display: flex; }
.security-content { width: min(920px, calc(100% - 36px)); margin: 0 auto; padding: 58px 0 80px; }
.security-content > .toast, .security-content > .alert { margin-bottom: 20px; }
.security-heading { margin-bottom: 32px; }
.security-heading h1 { margin: 7px 0 8px; font-size: clamp(34px, 4vw, 50px); letter-spacing: -.05em; }
.security-heading > p:last-child { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.55; }
.security-card { display: grid; grid-template-columns: 58px 1fr; gap: 22px; margin-bottom: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: rgba(24,33,50,.86); box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.security-card-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--violet); border-radius: 50%; color: var(--orange); background: #151e31; font-size: 19px; font-weight: 850; }
.success-icon { color: var(--success); border-color: var(--success); }
.security-card-copy h2 { margin: 8px 0 7px; font-size: 23px; letter-spacing: -.03em; }
.security-card-copy > p { max-width: 680px; margin: 0 0 20px; color: var(--muted); line-height: 1.55; font-size: 13px; }
.import-content { width: min(880px, calc(100% - 36px)); }
.import-upload-form { display: grid; gap: 16px; }
.import-upload-form .button { justify-self: start; }
.import-file { min-height: 92px; display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px dashed #3d5272; border-radius: 14px; background: rgba(10,18,31,.5); cursor: pointer; transition: border-color .2s, background .2s; }
.import-file:hover { border-color: var(--cyan); background: rgba(73,153,184,.06); }
.import-file-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #0c1524; background: var(--orange); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.import-file > span:nth-child(2) { display: grid; gap: 4px; }
.import-file small, .import-footnote { color: var(--muted); }
.import-file input { margin-left: auto; max-width: 260px; color: var(--muted); }
.import-explanation .security-card-copy > p { margin-bottom: 10px; }
.import-preview-list { display: grid; margin: 4px 0 20px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.import-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.import-preview-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.import-preview-row small { flex: 0 0 auto; color: var(--muted); }
.import-preview-more { padding: 12px 14px; color: var(--muted); font-size: 12px; }
.import-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.import-actions form { display: flex; }
.import-history-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.import-history-row > span { display: grid; gap: 3px; }
.import-history-row small { color: var(--muted); }
.import-history-row form { display: flex; }
.trash-content { width: min(980px, calc(100% - 36px)); }
.trash-empty { min-height: 360px; }
.trash-list { display: grid; gap: 12px; }
.trash-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(24,33,50,.86); }
.trash-row .site-icon { width: 44px; height: 44px; }
.trash-row-copy { min-width: 0; }
.trash-row-copy h2 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.trash-row-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.trash-actions { display: flex; align-items: center; gap: 8px; }
.trash-actions form { display: flex; }
.trash-actions .button { min-height: 39px; padding: 0 13px; font-size: 11px; }
.history-content { width: min(880px, calc(100% - 36px)); }
.history-empty { min-height: 350px; }
.history-list { position: relative; display: grid; gap: 10px; }
.history-list::before { content: ''; width: 1px; position: absolute; top: 24px; bottom: 24px; left: 23px; background: var(--line); }
.history-current, .history-row { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 70px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(24,33,50,.86); }
.history-current { border-color: rgba(104,214,171,.22); }
.history-dot { width: 14px; height: 14px; z-index: 1; justify-self: center; border: 3px solid var(--panel); border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.history-current .history-dot { background: var(--success); box-shadow: 0 0 0 1px var(--success), 0 0 13px rgba(104,214,171,.35); }
.history-current > div, .history-row > div { min-width: 0; display: grid; gap: 4px; }
.history-current small, .history-row small { color: var(--muted); font-size: 11px; }
.history-row form { display: flex; }
.history-row .button { min-height: 38px; padding: 0 13px; font-size: 11px; }
.status-badge { display: inline-flex; padding: 5px 9px; border: 1px solid; border-radius: 999px; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 800; }
.status-on { color: #a6efd3; border-color: rgba(104,214,171,.27); background: rgba(104,214,171,.07); }
.status-off { color: #a8b3c5; border-color: var(--line); background: rgba(255,255,255,.025); }
.two-factor-setup { display: grid; grid-template-columns: 250px 1fr; gap: 28px; padding-top: 8px; }
.qr-frame { width: 250px; height: 250px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.qr-frame img { display: block; width: 100%; height: 100%; }
.setup-instructions { min-width: 0; }
.setup-instructions ol { margin: 0 0 18px; padding-left: 20px; color: #c7d0df; line-height: 1.8; font-size: 13px; }
.setup-instructions details, .danger-zone { color: var(--muted); font-size: 12px; }
.setup-instructions summary, .danger-zone summary { cursor: pointer; color: #b8c3d4; font-weight: 700; }
.manual-secret { display: block; margin: 10px 0; padding: 10px; overflow-wrap: anywhere; border: 1px solid var(--line-soft); border-radius: 8px; color: #b8e5f7; background: #0f1725; letter-spacing: .08em; }
.confirm-code-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin: 18px 0 12px; }
.recovery-card { border-color: rgba(104,214,171,.24); }
.recovery-codes { width: min(100%, 420px); margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: #d9e3f0; background: #0f1725; resize: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.6; letter-spacing: .08em; }
.danger-zone { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.disable-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 16px; }
.auto-lock-form { width: min(100%, 470px); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.password-change-form { max-width: 680px; display: grid; gap: 15px; margin-top: 18px; }
.password-change-form > .button { justify-self: start; }

@media (max-width: 1050px) {
    .item-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
    .auth-shell { grid-template-columns: 1fr 1fr; }
    .auth-brand { padding-inline: 45px; }
    .auth-copy h1 { font-size: 58px; }
}

@media (max-width: 780px) {
    .auth-shell { display: block; padding: 24px; }
    .auth-brand { min-height: auto; padding: 4px 0 34px; border: 0; }
    .auth-brand::before, .auth-brand::after, .brand-line { display: none; }
    .auth-copy { margin-top: 50px; }
    .auth-copy h1 { margin: 20px 0 12px; font-size: 47px; }
    .auth-copy p { font-size: 16px; }
    .auth-panel { padding: 0; }
    .auth-card { padding: 25px 20px; }
    .field-row { grid-template-columns: 1fr; }
    .vault-shell { display: block; }
    .sidebar { width: 280px; position: fixed; left: -295px; box-shadow: 18px 0 60px rgba(0,0,0,.4); transition: left .2s ease; }
    .sidebar.open { left: 0; }
    .mobile-menu { display: block; }
    .topbar { padding: 0 18px; gap: 10px; }
    .topbar .button-primary { width: 44px; flex: 0 0 44px; overflow: hidden; white-space: nowrap; padding: 0; }
    .topbar .button-primary .button-label { display: none; }
    .topbar .button-primary .button-icon { font-size: 23px; line-height: 1; }
    .vault-content { padding: 30px 18px 55px; }
    .content-heading { align-items: flex-start; flex-direction: column; }
    .item-grid { grid-template-columns: 1fr; }
    .security-topbar { padding-inline: 18px; }.security-topbar .brand > span:last-child { display: none; }
    .security-topbar-actions .button { min-height: 40px; padding: 0 12px; font-size: 12px; }
    .security-content { padding-top: 36px; }
    .security-card { grid-template-columns: 1fr; padding: 21px; }
    .import-file { align-items: flex-start; flex-wrap: wrap; }
    .import-file input { width: 100%; max-width: none; margin-left: 0; }
    .import-history-row { align-items: flex-start; flex-direction: column; }
    .trash-row { grid-template-columns: 44px minmax(0, 1fr); }
    .trash-actions { grid-column: 1 / -1; flex-wrap: wrap; }
    .history-current, .history-row { grid-template-columns: 26px minmax(0, 1fr); }
    .history-row form { grid-column: 2; }
    .two-factor-setup { grid-template-columns: 1fr; }.qr-frame { margin: 0 auto; }
    .disable-form, .confirm-code-form, .auto-lock-form { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-shell { padding: 18px; }
    .auth-copy h1 { font-size: 39px; }
    .auth-card-heading h2 { font-size: 23px; }
    .modal { width: 96vw; }
    .modal-body, .modal-heading, .modal-actions { padding-left: 17px; padding-right: 17px; }
    .inline-create { grid-template-columns: 1fr; }
}
