:root {
  color-scheme: dark;
  --bg: #06131d;
  --bg-2: #0d1e2b;
  --panel: rgba(12, 22, 35, 0.92);
  --panel-strong: #0f1b2a;
  --panel-soft: #112437;
  --panel-alt: #0a1726;
  --line: rgba(110, 154, 190, 0.24);
  --line-strong: rgba(127, 192, 255, 0.38);
  --text: #edf6ff;
  --muted: #9ab3cb;
  --muted-strong: #c7d8ea;
  --cyan: #43d1ff;
  --blue: #2d7af7;
  --blue-2: #1f5de8;
  --accent-rgb: 67, 209, 255;
  --accent-color: #43d1ff;
  --accent-deep: #1f5de8;
  --green: #47d9ae;
  --red: #ff6f8d;
  --amber: #f4c96b;
  --shadow: 0 18px 45px rgba(1, 5, 11, 0.42);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(56, 136, 255, 0.22), transparent 30%),
    radial-gradient(circle at top left, rgba(67, 209, 255, 0.18), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(19, 35, 52, 0.95);
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
button:hover, .button:hover {
  background: rgba(28, 52, 75, 0.98);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue-2));
  border-color: rgba(119, 228, 255, 0.7);
  box-shadow: 0 12px 30px rgba(31, 122, 241, 0.32);
  font-weight: 700;
}
.primary:hover { background: linear-gradient(135deg, #5ad8ff, #296ef4); }
.danger-button {
  background: rgba(117, 22, 35, 0.8);
  border-color: rgba(255, 123, 149, 0.46);
  color: #ffd8df;
}
.danger-button:hover { background: rgba(148, 30, 46, 0.82); }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
}
.full { width: 100%; }
input, select, textarea {
  width: 100%;
  background: rgba(6, 15, 24, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input::placeholder, textarea::placeholder { color: rgba(171, 195, 220, 0.7); }
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(67, 209, 255, 0.12);
  background: rgba(6, 19, 30, 0.96);
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  padding: 0;
}
input[type="date"] { min-width: 0; }
textarea { resize: vertical; min-height: 96px; }
label {
  display: block;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}
label > input, label > select, label > textarea { margin-top: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(2rem, 2vw + 1.2rem, 3rem);
  letter-spacing: -0.06em;
  line-height: 1.1;
  margin-bottom: 10px;
}
h2 { font-size: clamp(1.5rem, 1vw + 1.1rem, 2.1rem); letter-spacing: -0.04em; margin-bottom: 10px; }
h3 { font-size: 1.08rem; letter-spacing: -0.02em; margin-bottom: 8px; }
p { color: var(--muted); margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #7ea3c8;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.06em;
  font-size: 24px;
  white-space: nowrap;
}
.brand b { color: var(--cyan); }
.brand span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a9bfd7;
  border-left: 1px solid rgba(132, 162, 190, 0.32);
  padding-left: 12px;
  margin-left: 8px;
}
.notice, .empty, .panel, .table-panel, .auth-card, .login-panel, .detail {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 23, 35, 0.96), rgba(9, 19, 31, 0.9));
  box-shadow: var(--shadow);
}
.notice {
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--muted-strong);
  margin-top: 18px;
}
.empty {
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin-bottom: 12px;
  background: rgba(67, 209, 255, 0.12);
  color: var(--cyan);
  font-size: 30px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 0 28px;
  background: rgba(6, 18, 28, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-weight: 600;
}
.avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(67, 209, 255, 0.2), rgba(45, 122, 247, 0.35));
  border: 1px solid rgba(112, 177, 255, 0.5);
  font-weight: 800;
  color: var(--text);
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(71, 217, 174, 0.15);
}
.app-layout {
  display: flex;
  min-height: calc(100vh - 76px);
}
.sidebar {
  width: 270px;
  padding: 20px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 22, 33, 0.96), rgba(7, 17, 26, 0.9));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #d7e9ff;
  padding: 12px 12px;
  font-weight: 600;
  text-align: left;
}
.sidebar nav button.active, .sidebar nav button:hover {
  background: linear-gradient(135deg, rgba(67, 209, 255, 0.12), rgba(45, 122, 247, 0.18));
  border-color: rgba(67, 209, 255, 0.18);
}
.sidebar nav button span {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  font-size: 15px;
}
.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(14, 27, 39, 0.7);
  color: var(--muted-strong);
  font-weight: 600;
}
.session-card small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 11px;
}
.main {
  flex: 1;
  padding: 30px 28px 34px;
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--muted);
  background: rgba(11, 18, 30, 0.7);
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.page-head p { max-width: 740px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 28, 42, 0.96), rgba(10, 20, 31, 0.9));
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(67, 209, 255, 0.2), rgba(45, 122, 247, 0.25));
  border: 1px solid rgba(105, 190, 255, 0.35);
  font-size: 24px;
}
.stat strong {
  display: block;
  font-size: clamp(1.6rem, 1vw + 1rem, 2.2rem);
  letter-spacing: -0.04em;
  margin-bottom: 2px;
}
.stat small { color: var(--muted); font-size: 12px; }
.vault-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  align-items: start;
  gap: 20px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr);
  gap: 12px;
  margin-bottom: 14px;
}
.table-panel, .panel { border-radius: 18px; overflow: hidden; }
.table-panel { padding: 0; }
.table-scroll { overflow: auto; max-width: 100%; }
.table-panel table, #records table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}
.table-panel th, .table-panel td, #records th, #records td {
  text-align: left;
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table-panel thead th, #records thead th {
  background: rgba(14, 28, 42, 0.86);
  color: #a5bfd7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.table-panel tbody tr:hover, #records tbody tr:hover { background: rgba(17, 35, 52, 0.65); }
.table-panel tbody tr:last-child td, #records tbody tr:last-child td { border-bottom: none; }
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(10, 18, 29, 0.9);
}
.device-name { display: flex; align-items: center; gap: 12px; }
.device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(67, 209, 255, 0.12);
  border: 1px solid rgba(67, 209, 255, 0.18);
  font-size: 17px;
  color: var(--cyan);
  overflow: hidden;
}
.device-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-icon.equipment-photo img { object-fit: contain; padding: 3px; background: #fff; }
.tone0 { background: rgba(67, 209, 255, 0.12); }
.tone1 { background: rgba(45, 122, 247, 0.14); }
.tone2 { background: rgba(71, 217, 174, 0.12); }
.tone3 { background: rgba(244, 201, 107, 0.12); }
.tone4 { background: rgba(255, 111, 141, 0.12); }
.device-name strong { display: block; margin-bottom: 2px; }
.device-name small { color: var(--muted); }
.nowrap { white-space: nowrap; }
.secret-mask {
  font-family: Consolas, monospace;
  letter-spacing: 0.14em;
  color: #cbdee9;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.star {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
}
.detail {
  border-radius: 18px;
  padding: 18px 18px 16px;
}
.detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.detail-head .device-icon {
  width: 84px;
  height: 72px;
  flex: 0 0 84px;
  border-radius: 14px;
  font-size: 22px;
}
.detail-head.equipment-only {
  justify-content: center;
  min-height: 112px;
}
.detail-head.equipment-only .device-icon {
  width: min(100%, 220px);
  height: 104px;
  flex: 0 1 220px;
}
.detail-head > div:last-child { min-width: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(67, 209, 255, 0.1);
  border: 1px solid rgba(67, 209, 255, 0.2);
  color: #d6f4ff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge.green { background: rgba(71, 217, 174, 0.12); border-color: rgba(71, 217, 174, 0.18); color: #c9fee9; }
.badge.red { background: rgba(255, 111, 141, 0.1); border-color: rgba(255, 111, 141, 0.18); color: #ffd9e2; }
.badge.amber { background: rgba(244, 201, 107, 0.12); border-color: rgba(244, 201, 107, 0.22); color: #fef2c9; }
.detail-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(132, 162, 190, 0.12);
  color: var(--muted-strong);
}
.detail-row span:first-child { color: var(--muted); }
.detail-copy-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.detail-copy-value > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.copy-field {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.3;
}
.detail-secret {
  margin: 14px 0 10px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 17, 28, 0.9);
}
.private-notes {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.06);
}
.private-notes strong { display: block; margin-bottom: 6px; color: var(--accent-color); font-size: 12px; }
.private-notes pre { margin: 0; color: var(--muted-strong); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; }
.secret-value {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(6, 17, 27, 0.86);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.secret-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #8fa8c2;
}
.detail-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 35;
  min-width: 220px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(9, 20, 30, 0.96);
  border: 1px solid rgba(78, 143, 228, 0.5);
  box-shadow: var(--shadow);
  color: var(--text);
}
#modal {
  width: min(720px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 18, 29, 0.98);
  color: var(--text);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.54);
  padding: 0;
}
#modal::backdrop {
  background: rgba(2, 7, 13, 0.7);
  backdrop-filter: blur(3px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}
#modal-content { padding: 20px; }
.form-grid, .check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(8, 18, 28, 0.72);
  border-radius: 12px;
  color: var(--muted-strong);
}
.check input { width: auto; }
.category-picker {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.category-picker legend { padding: 0 6px; color: var(--muted-strong); font-size: 13px; font-weight: 700; }
.category-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.category-choice { position: relative; cursor: pointer; }
.category-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.category-choice-card {
  display: flex;
  min-height: 120px;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 18, 28, 0.56);
  color: var(--muted-strong);
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.category-choice-card img, .category-choice-fallback {
  display: flex;
  width: 100%;
  height: 76px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), .1);
  object-fit: cover;
}
.category-choice-fallback { font-size: 26px; color: var(--accent-color); }
.category-choice-card strong { font-size: 11px; line-height: 1.2; }
.category-choice:hover .category-choice-card { transform: translateY(-2px); border-color: var(--line-strong); }
.category-choice > input:focus-visible + .category-choice-card { outline: 3px solid rgba(var(--accent-rgb), .42); outline-offset: 2px; }
.category-choice > input:checked + .category-choice-card { border-color: var(--accent-color); background: rgba(var(--accent-rgb), .12); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .16); color: var(--text); }
.span2 { grid-column: span 2; }
.toolbar {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.bar-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.bar-track {
  display: flex;
  align-items: center;
  height: 12px;
  border-radius: 999px;
  background: rgba(17, 29, 41, 0.9);
  border: 1px solid var(--line);
  overflow: hidden;
}
.bar-track meter {
  width: 100%;
  height: 100%;
  accent-color: var(--cyan);
}
.backup-step {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid rgba(132, 162, 190, 0.12);
}
.backup-step:last-child { border-bottom: none; }
.account-info { border-radius: 18px; padding: 22px; }
.notes-layout {
  display: grid;
  grid-template-columns: minmax(260px, 350px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 8px;
}
.note-form, .notes-panel {
  border-radius: 18px;
  padding: 20px;
}
.note-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}
.notes-heading h3 { margin: 0; }
.notes-search {
  width: min(100%, 380px);
  margin-left: auto;
}
.notes-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(12, 22, 34, 0.9);
  border: 1px solid var(--line);
  color: var(--muted-strong);
}
.filter-chip.active {
  background: linear-gradient(135deg, rgba(67, 209, 255, 0.18), rgba(45, 122, 247, 0.2));
  border-color: rgba(67, 209, 255, 0.28);
  color: var(--text);
}
#note-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(10, 20, 31, 0.8);
}
.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.note-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(67, 209, 255, 0.14);
  color: #dff8ff;
  border: 1px solid rgba(67, 209, 255, 0.2);
}
.note-item h4 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.note-item pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(5, 13, 21, 0.88);
  border: 1px solid var(--line);
  color: #dff7ff;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.7;
}
.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.small-copy, .small-edit, .small-delete {
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
}
.small-copy {
  background: rgba(26, 48, 70, 0.9);
}
.small-delete {
  background: rgba(93, 23, 37, 0.45);
  border-color: rgba(255, 111, 141, 0.24);
}
.selected { background: rgba(17, 36, 52, 0.76); box-shadow: inset 0 0 0 1px rgba(67, 209, 255, 0.18); }
tr[data-id].selected td { border-bottom-color: rgba(67, 209, 255, 0.18); }
#records .table-footer { border-top: 1px solid var(--line); }
.login-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  min-height: 100vh;
  background: linear-gradient(120deg, rgba(7, 18, 28, 0.95), rgba(4, 11, 19, 0.94));
}
.login-story, .login-panel { display: flex; align-items: center; justify-content: center; }
.login-story {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px;
  background:
    radial-gradient(circle at 18% 20%, rgba(67, 209, 255, 0.16), transparent 16%),
    radial-gradient(circle at 80% 18%, rgba(45, 122, 247, 0.2), transparent 22%),
    linear-gradient(135deg, rgba(10, 22, 33, 1), rgba(13, 25, 42, 0.96));
}
.login-story > * { position: relative; z-index: 1; }
.login-story::before {
  content: "";
  position: absolute;
  inset: 7% 12% 12% 18%;
  border: 1px solid rgba(114, 170, 220, 0.18);
  border-radius: 32px;
  background: rgba(11, 21, 31, 0.35);
}
.login-story .brand { font-size: 32px; margin-bottom: 18px; }
.login-story h1 {
  max-width: 560px;
  font-size: clamp(2.2rem, 2.4vw, 4rem);
  line-height: 1.05;
  margin-bottom: 18px;
}
.login-story h1 em { color: var(--cyan); font-style: normal; }
.login-story p {
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.7;
  color: #d4e5f8;
}
.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.login-features span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(129, 170, 210, 0.2);
  background: rgba(14, 28, 42, 0.75);
  border-radius: 999px;
  color: #d9ecff;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.orb {
  position: absolute;
  right: 14%;
  bottom: 16%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(67, 209, 255, 0.38), rgba(15, 32, 46, 0.2) 58%, rgba(10, 17, 29, 0.5) 100%);
  border: 1px solid rgba(109, 181, 255, 0.28);
  color: var(--cyan);
  font-size: 52px;
  box-shadow: inset 0 0 30px rgba(67, 209, 255, 0.12);
}
.orb span {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted-strong);
}
.login-panel { padding: 28px; justify-content: center; }
.login-panel { position: relative; }
.auth-card {
  width: min(100%, 440px);
  border-radius: 22px;
  padding: 30px 28px;
}
.auth-card h2 { margin-bottom: 4px; }
.auth-card p { margin-bottom: 18px; }
.auth-card label { margin-bottom: 16px; }
.notice.danger {
  border-color: rgba(255, 111, 141, 0.26);
  background: rgba(93, 23, 37, 0.24);
  color: #ffd8e1;
}
.mobile-only { display: none; }
.appearance-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.appearance-tools button { white-space: nowrap; }
.appearance-tools select { width: auto; min-width: 112px; padding: 9px 30px 9px 10px; }
.login-panel > .appearance-tools { position: absolute; top: 18px; right: 18px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (min-width: 1650px) {
  .vault-grid { grid-template-columns: minmax(0, 1.7fr) 360px; }
  .main { padding: 38px 36px 42px; }
  .stat { padding: 22px 20px; }
}
@media (max-width: 1250px) {
  .sidebar { width: 230px; }
  .main { padding: 24px 20px 30px; }
  .vault-grid { grid-template-columns: 1fr; }
  .detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }
  .detail-head, .detail-footer { grid-column: 1 / -1; }
  .detail-secret { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 150px 160px; }
  .brand { font-size: 22px; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-user > span:nth-child(2) { display: none; }
  .login-story { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-panel { padding: 20px 18px; }
  .two-col { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .mobile-only { display: inline-flex; }
  .topbar { height: 68px; padding: 0 14px; gap: 10px; }
  .brand { font-size: 19px; }
  .brand span { display: none; }
  .app-layout { min-height: calc(100vh - 68px); }
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    width: min(82vw, 260px);
    display: none;
    z-index: 25;
    background: rgba(8, 18, 28, 0.98);
    box-shadow: 18px 0 30px rgba(0, 0, 0, 0.38);
    overflow-y: auto;
  }
  .sidebar.open { display: flex; }
  .main { padding: 18px 14px 24px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .appearance-tools { gap: 5px; }
  .appearance-tools button { padding: 8px 9px; font-size: 12px; }
  .appearance-tools select { min-width: 96px; padding: 8px 24px 8px 8px; font-size: 12px; }
  .notes-heading { align-items: stretch; flex-direction: column; }
  .notes-search { width: 100%; }
  .stats { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .stat { padding: 14px 12px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters > input { grid-column: 1 / -1; }
  .detail { display: block; }
  .check-grid, .form-grid { grid-template-columns: 1fr; }
  .category-picker.span2 { grid-column: auto; }
  .category-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: auto; }
  .table-footer { flex-wrap: wrap; }
  .bar-row { grid-template-columns: 90px 1fr 24px; }
  .auth-card { padding: 24px 18px; }
  .login-panel { padding: 18px 14px; }
}

body[data-accent="violet"] { --accent-rgb: 162, 124, 255; --accent-color: #a27cff; --accent-deep: #7044d8; }
body[data-accent="emerald"] { --accent-rgb: 52, 211, 153; --accent-color: #34d399; --accent-deep: #11845b; }
body[data-accent="sunset"] { --accent-rgb: 251, 146, 60; --accent-color: #fb923c; --accent-deep: #d45b2c; }

.brand b, .login-story h1 em { color: var(--accent-color); }
.primary { background: linear-gradient(135deg, var(--accent-color), var(--accent-deep)); border-color: rgba(var(--accent-rgb), 0.65); }
.primary:hover { background: linear-gradient(135deg, var(--accent-color), var(--accent-deep)); filter: brightness(1.08); }
.sidebar nav button.active, .sidebar nav button:hover, .filter-chip.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.08));
  border-color: rgba(var(--accent-rgb), 0.34);
}
.device-icon, .stat-icon, .badge:not(.green):not(.red):not(.amber), .empty-icon {
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent-color);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-color); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
input[type="checkbox"] { accent-color: var(--accent-color); }

body[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f8;
  --bg-2: #e3edf5;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --panel-soft: #f3f8fc;
  --panel-alt: #eaf2f8;
  --line: rgba(56, 83, 108, 0.17);
  --line-strong: rgba(var(--accent-rgb), 0.55);
  --text: #142536;
  --muted: #60778c;
  --muted-strong: #334c62;
  --shadow: 0 15px 36px rgba(31, 58, 82, 0.1);
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.14), transparent 31%),
    radial-gradient(circle at top left, rgba(77, 134, 191, 0.1), transparent 28%),
    var(--bg);
  color: var(--text);
}
body[data-theme="light"] button,
body[data-theme="light"] .button { background-color: #f5f9fc; color: var(--text); }
body[data-theme="light"] button:hover,
body[data-theme="light"] .button:hover { background-color: #e8f1f8; }
body[data-theme="light"] .primary { color: #fff; background: linear-gradient(135deg, var(--accent-deep), var(--accent-color)); }
body[data-theme="light"] .primary:hover { background: linear-gradient(135deg, var(--accent-deep), var(--accent-color)); }
body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: #fff;
  color: var(--text);
}
body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder { color: #8498aa; }
body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 18px rgba(31, 58, 82, 0.05);
}
body[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #f8fbfd, #edf4f9);
}
body[data-theme="light"] .sidebar nav button { color: #304a60; }
body[data-theme="light"] .session-card,
body[data-theme="light"] .loading,
body[data-theme="light"] .check { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .notice,
body[data-theme="light"] .empty,
body[data-theme="light"] .panel,
body[data-theme="light"] .table-panel,
body[data-theme="light"] .auth-card,
body[data-theme="light"] .login-panel,
body[data-theme="light"] .detail {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.97));
}
body[data-theme="light"] .stat { background: linear-gradient(145deg, #fff, #f4f8fb); }
body[data-theme="light"] .table-panel thead th,
body[data-theme="light"] #records thead th { background: #edf4f8; color: #526a7e; }
body[data-theme="light"] .table-panel tbody tr:hover,
body[data-theme="light"] #records tbody tr:hover { background: #f1f7fb; }
body[data-theme="light"] .table-footer { background: #f5f9fc; }
body[data-theme="light"] .detail-secret,
body[data-theme="light"] .note-item { background: #f5f9fc; }
body[data-theme="light"] .secret-value,
body[data-theme="light"] .note-item pre { background: #eaf1f6; color: #19364d; }
body[data-theme="light"] .badge:not(.green):not(.red):not(.amber) { color: #24465d; }
body[data-theme="light"] .login-layout { background: linear-gradient(120deg, #f0f6fa, #e8f0f6); }
body[data-theme="light"] .login-story {
  background:
    radial-gradient(circle at 18% 20%, rgba(var(--accent-rgb), 0.19), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(85, 130, 190, 0.14), transparent 22%),
    linear-gradient(135deg, #e6f0f6, #f5f9fc);
}
body[data-theme="light"] .login-story::before { background: rgba(255, 255, 255, 0.22); border-color: rgba(71, 105, 133, 0.14); }
body[data-theme="light"] .login-story p { color: #425d73; }
body[data-theme="light"] .login-features span { background: rgba(255, 255, 255, 0.7); color: #2e4b62; }
body[data-theme="light"] .top-user { color: var(--muted-strong); }
body[data-theme="light"] .secret-mask { color: #526a7d; }
body[data-theme="light"] #toast { background: rgba(255, 255, 255, 0.98); color: var(--text); border-color: rgba(var(--accent-rgb), 0.5); }
body[data-theme="light"] #modal { background: #fff; color: var(--text); }
body[data-theme="light"] .login-story .brand span { color: #60778c; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .topbar .appearance-tools { margin-left: auto; }
  .topbar .top-user { display: none; }
  .login-panel > .appearance-tools { top: 10px; right: 10px; }
}