:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f2f7ff;
  background: #050b14;
  font-synthesis: none;
  --surface: #0a1421; --surface-raised: #0f1d2e; --surface-hover: #14263a;
  --line: #20354d; --line-bright: #315275; --muted: #89a0b9;
  --blue: #52b1ff; --blue-deep: #1878d1; --cyan: #48d6d0;
  --green: #55d6a4; --amber: #ffc66d; --red: #ff7582; --violet: #ad8cff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 78% -15%, #173863 0, transparent 34%), radial-gradient(circle at -10% 90%, #092a37 0, transparent 30%), #050b14; }
button, input, textarea, select { font: inherit; }
button, label[for="import-file"] { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #52b1ff55; outline-offset: 2px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 266px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; border-right: 1px solid var(--line); padding: 24px 17px 18px; background: #07111de8; backdrop-filter: blur(18px); display: flex; flex-direction: column; gap: 22px; }
.brand, .auth-brand, .mobile-brand { display: flex; align-items: center; gap: 11px; font-size: 1.18rem; font-weight: 780; letter-spacing: -.025em; }
.brand > img, .mobile-brand > img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 10px 17px #0c7bdb55); }
.brand > span { display: grid; }
.brand small { margin-top: 2px; color: #5e7894; font-size: .56rem; letter-spacing: .16em; }
.mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #03101c; background: linear-gradient(145deg, #79ccff, #3095ed); box-shadow: 0 11px 30px #1779d74a; font-weight: 850; }
.mobile-brand { display: none; }
.nav { display: grid; gap: 6px; }
.nav button { min-height: 42px; color: var(--muted); background: transparent; border: 0; border-radius: 11px; padding: 9px 11px; display: grid; grid-template-columns: 23px 1fr auto; gap: 7px; align-items: center; text-align: left; }
.nav button em, .folder-row em { font-style: normal; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav button b, .folder-row b { font-size: .73rem; background: #13263a; color: #96acc2; padding: 2px 7px; border-radius: 999px; }
.nav button.active, .nav button:hover { color: white; background: linear-gradient(90deg, #173350, #10243a); }
.folder-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: #637d97; font-size: .65rem; font-weight: 750; letter-spacing: .15em; }
.folder-head button { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #9cb5ce; background: #102238; }
.folder-list { display: grid; gap: 4px; max-height: 230px; overflow: auto; }
.folder-row { display: grid; grid-template-columns: 1fr 32px; align-items: center; border-radius: 10px; }
.folder-row.active, .folder-row:hover { background: #102238; }
.folder-select { min-width: 0; display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; border: 0; color: #9db0c4; background: transparent; text-align: left; padding: 9px 5px 9px 10px; }
.folder-manage { opacity: 0; border: 0; color: #7f96ad; background: transparent; }
.folder-row:hover .folder-manage, .folder-row:focus-within .folder-manage { opacity: 1; }
.folder-empty { width: 100%; border: 1px dashed #20384f; border-radius: 10px; padding: 11px; color: #70879e; background: transparent; }
.folder-color { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--blue); }
.folder-color.cyan, .color-choice.cyan span { background: var(--cyan); }
.folder-color.green, .color-choice.green span { background: var(--green); }
.folder-color.amber, .color-choice.amber span { background: var(--amber); }
.folder-color.red, .color-choice.red span { background: var(--red); }
.folder-color.violet, .color-choice.violet span { background: var(--violet); }
.security-note { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 12px; border: 1px solid #1b4946; background: #092421; border-radius: 11px; }
.security-note > span { color: var(--green); font-size: .65rem; }
.security-note div { display: grid; gap: 2px; }
.security-note strong { font-size: .78rem; }
.security-note small { color: #75a19b; font-size: .67rem; }
.sync-button { width: 100%; padding: 11px 13px; border: 1px solid #284b68; border-radius: 11px; color: #a9c5dd; background: #0b1a28; text-align: left; }
.sync-button.synced { color: var(--green); border-color: #245e4e; background: #0a211c; }
.sync-button.pending { color: var(--amber); border-color: #6b5129; background: #271d0d; }
.sync-button.conflict, .sync-button.error { color: var(--red); border-color: #713843; background: #2a1117; }
.side-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-footer label { display: grid; place-items: center; text-align: center; }
.side-footer .keepass-import { grid-column: 1 / -1; border-color: #2f695c; color: #79ddbd; background: #0b241f; }
.side-footer #change-master, .side-footer #lock { grid-column: 1 / -1; }
.main { padding: 24px clamp(20px, 3vw, 46px) 48px; min-width: 0; }
.topbar { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.search { flex: 1; position: relative; }
.search input { width: 100%; padding: 12px 15px 12px 41px; }
.search > span { position: absolute; left: 15px; top: 12px; color: var(--muted); }
input, textarea, select { color: #eff6ff; background: #091522; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #52b1ff1b; }
textarea { resize: vertical; line-height: 1.5; }
.primary, .secondary, .danger, .ghost { border-radius: 10px; border: 1px solid transparent; padding: 10px 14px; color: white; }
.primary { background: linear-gradient(180deg, #63bdff, var(--blue-deep)); color: #03101d; font-weight: 760; box-shadow: 0 8px 22px #1377cb33; }
.primary:hover { filter: brightness(1.08); }
.secondary { background: var(--surface-raised); border-color: var(--line); }
.ghost { background: transparent; border-color: var(--line); }
.danger { background: #38151e; color: #ffadb5; border-color: #6f2d38; }
.secondary:disabled, .ghost:disabled, .quick-actions button:disabled { opacity: .4; cursor: not-allowed; }
.status-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; color: #9fb4c9; border: 1px solid var(--line); background: #091522; border-radius: 999px; padding: 8px 11px; font-size: .75rem; }
.status-pill span, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #55d6a415; }
.status-pill.saving span { background: var(--amber); }
.status-pill.offline span, .status-dot.offline { background: var(--amber); }
.status-pill.error span { background: var(--red); }
.error-banner { color: #ffc2c8; background: #36141d; border: 1px solid #75313b; padding: 11px 14px; border-radius: 11px; margin-bottom: 16px; }
.overview { min-height: 120px; display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 4px 0 24px; }
.overview h1 { margin: 5px 0 3px; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.045em; }
.overview p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: .66rem; font-weight: 780; letter-spacing: .17em; }
.overview-stats { display: flex; min-width: 300px; border: 1px solid var(--line); border-radius: 14px; background: #09152299; }
.overview-stats div { flex: 1; display: grid; gap: 3px; padding: 14px 17px; text-align: center; }
.overview-stats div + div { border-left: 1px solid var(--line); }
.overview-stats strong { font-size: 1.15rem; }
.overview-stats small { color: var(--muted); font-size: .7rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0 18px; border-top: 1px solid #192b3f; }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 5px; scrollbar-width: thin; }
.filter-chips button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: transparent; color: #8099b1; font-size: .74rem; }
.filter-chips button.active, .filter-chips button:hover { color: #dff1ff; background: #14304a; border-color: #28577e; }
.sort-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .73rem; }
.sort-control select { padding: 7px 30px 7px 9px; font-size: .75rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 13px; }
.card { text-align: left; color: inherit; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, #102137, #091521); padding: 17px; min-height: 177px; transition: transform .15s, border-color .15s, box-shadow .15s; box-shadow: 0 10px 28px #02081222; }
.card:hover { transform: translateY(-3px); border-color: var(--line-bright); box-shadow: 0 18px 38px #02081255; }
.card-head { display: flex; justify-content: space-between; gap: 12px; }
.identity { display: flex; gap: 11px; min-width: 0; align-items: center; }
.identity > div { min-width: 0; }
.site-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #214d74, #14334e); color: #9bd1ff; font-weight: 820; box-shadow: inset 0 0 0 1px #ffffff0b; }
.site-icon.large { width: 50px; height: 50px; border-radius: 15px; font-size: 1.2rem; }
.card h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.meta { margin-top: 3px; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite { color: #405871; }
.favorite.active { color: var(--amber); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.badges > span { display: inline-flex; gap: 6px; align-items: center; color: #8da5bc; background: #0a1928; border: 1px solid #1c354e; border-radius: 999px; padding: 4px 8px; font-size: .66rem; }
.badges .folder-color { width: 6px; height: 6px; }
.site-line { margin-top: 14px; color: #6e89a4; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.totp { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; color: var(--green); font: 740 1.08rem ui-monospace, SFMono-Regular, monospace; letter-spacing: .13em; }
.countdown { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font: 650 .7rem system-ui; color: #97adc2; border: 2px solid var(--blue-deep); letter-spacing: 0; }
.card-footer { margin-top: 18px; display: flex; justify-content: space-between; color: #657f98; font-size: .73rem; }
.card-footer span { letter-spacing: .1em; }
.empty { grid-column: 1 / -1; padding: 62px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty strong { display: block; color: #d7e4f2; }
.empty p { margin: 7px 0 18px; }
.empty-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-raised); margin: 0 auto 13px; color: var(--blue); font-size: 1.35rem; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(450px, 100%); background: #0b1827ed; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 35px 100px #000a; }
.auth-brand { justify-content: center; }
.auth-brand img { width: min(250px, 76%); max-height: 150px; object-fit: contain; filter: drop-shadow(0 20px 32px #0c7bdb40); }
.auth-copy { margin: 32px 0 24px; }
.auth-copy h1 { margin: 6px 0; font-size: 1.9rem; letter-spacing: -.04em; }
.auth-copy p { color: var(--muted); margin: 0; line-height: 1.55; }
.auth-foot { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; color: #70869d; font-size: .72rem; }
.large-button { min-height: 46px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { color: #c8d6e6; font-size: .86rem; }
.hint { color: #6f89a3; font-size: .72rem; }
.warning { color: #ffd28a; background: #34280f; border: 1px solid #5f4a1c; padding: 10px 12px; border-radius: 9px; font-size: .84rem; }
dialog { width: min(620px, calc(100% - 30px)); max-height: calc(100vh - 34px); overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: #edf4ff; background: #0b1827; padding: 0; box-shadow: 0 30px 100px #000c; }
dialog::backdrop { background: #020711d4; backdrop-filter: blur(6px); }
.dialog-body { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.dialog-head h2 { margin: 3px 0 0; }
.icon-button { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); color: white; background: transparent; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.actions.split { justify-content: space-between; align-items: center; }
.actions.split > div { display: flex; gap: 9px; }
.small-dialog { max-width: 460px; }
.color-picker { display: flex; gap: 12px; padding: 4px; }
.color-choice input { position: absolute; opacity: 0; }
.color-choice span { width: 25px; height: 25px; display: block; border-radius: 50%; background: var(--blue); border: 4px solid transparent; }
.color-choice input:checked + span { outline: 2px solid white; outline-offset: 3px; }
.detail-title { display: flex; gap: 13px; align-items: center; min-width: 0; }
.detail-title h2 { margin-top: 6px; }
.detail-title .badges { margin: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.quick-actions button { display: grid; place-items: center; gap: 3px; padding: 13px 7px; color: #dcecff; background: #102238; border: 1px solid #223e5b; border-radius: 12px; }
.quick-actions button:hover { background: #17304b; border-color: #35638e; }
.quick-actions button > span { color: var(--blue); font-size: 1.15rem; }
.quick-actions button strong { font-size: .78rem; }
.quick-actions button small { color: #718da8; font-size: .65rem; }
.detail-list { display: grid; gap: 9px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px; background: #08131f; border: 1px solid #1b3046; border-radius: 12px; }
.detail-row > div:first-child { display: grid; gap: 5px; min-width: 0; }
.detail-row small, .notes small { color: var(--muted); font-size: .72rem; }
.detail-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret-value { font-family: ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; }
.compact { padding: 7px 9px; font-size: .76rem; }
.big-code { color: var(--green); font: 760 1.32rem ui-monospace, SFMono-Regular, monospace; letter-spacing: .14em; }
.visit { display: flex; justify-content: space-between; gap: 15px; color: #91caff; text-decoration: none; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; }
.visit:hover { background: var(--surface-raised); }
.notes { padding: 14px; border-left: 2px solid var(--blue-deep); background: #08131f; border-radius: 4px 11px 11px 4px; }
.notes p { margin: 7px 0 0; white-space: pre-wrap; color: #c0d0e1; line-height: 1.5; }
.sync-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 18px; }
.sync-summary div { min-width: 0; display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #08131f; }
.sync-summary small { color: var(--muted); }
.sync-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
#toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; padding: 11px 15px; border-radius: 10px; color: white; background: #173653; border: 1px solid #3a6388; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; box-shadow: 0 15px 40px #0007; }
#toast.show { opacity: 1; transform: translateY(0); }
.file-input { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .overview-stats { min-width: 250px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; overflow: visible; padding: 13px 16px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .brand, .sidebar .nav, .sidebar .folder-head, .sidebar .folder-list, .sidebar .security-note { display: none; }
  .sync-button { width: auto; margin-left: auto; white-space: nowrap; }
  .side-footer { margin-left: 0; display: flex; }
  .side-footer #export, .side-footer label { display: none; }
  .side-footer #lock { grid-column: auto; }
  .main { padding: 17px 15px 40px; }
  .topbar { flex-wrap: wrap; margin-bottom: 20px; }
  .mobile-brand { display: flex; margin-right: auto; }
  .mobile-brand > img { width: 34px; height: 34px; }
  .search { order: 5; flex-basis: 100%; }
  .status-pill { margin-left: auto; }
  .overview { display: grid; gap: 18px; }
  .overview-stats { width: 100%; min-width: 0; }
  .toolbar { align-items: end; }
  .filter-chips { max-width: calc(100vw - 125px); }
  .sort-control { display: grid; gap: 4px; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
@media (max-width: 480px) {
  .status-pill { display: none; }
  .topbar #add { padding-inline: 11px; }
  .overview-stats div { padding: 12px 8px; }
  .quick-actions { grid-template-columns: 1fr; }
  .sync-summary { grid-template-columns: 1fr; }
  .quick-actions button { grid-template-columns: 28px 1fr auto; justify-items: start; }
  .actions.split { align-items: stretch; display: grid; }
  .actions.split > div { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-body { padding: 19px; }
}
