/* Notepadle Vault — builds on /assets/style.css tokens */
.vault-main { flex: 1; padding: 32px 16px 20px; }
.vault-app { max-width: 1100px; margin: 0 auto; min-height: 420px; }
.vault-card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 36px 32px; animation: cardIn .5s var(--ease) both; }
.vault-center { max-width: 560px; margin: 20px auto; text-align: center; }
.vault-narrow { max-width: 460px; }
.vault-center h2 { font-size: 24px; font-weight: 800; margin: 14px 0 8px; }
.vault-center .muted { color: var(--text-2); margin: 0 0 20px; }
.vault-badge { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 10px 24px rgba(99, 102, 241, .35); }
.vault-badge .i { width: 30px; height: 30px; }
.vault-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.vault-form { display: grid; gap: 4px; text-align: left; }
.vault-form .btn-block { height: 46px; margin-top: 8px; }
.vault-form .link-btn { justify-self: center; }
.vault-ack { align-items: flex-start; font-size: 13.5px; line-height: 1.5; margin: 10px 0 4px; }
.vault-ack input { margin-top: 3px; flex: none; }
.vault-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); margin: 0 auto 14px; animation: vspin .8s linear infinite; }
.vault-spinner.sm { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; vertical-align: -3px; }
@keyframes vspin { to { transform: rotate(360deg); } }
.muted-sm { font-size: 13px; color: var(--text-2); }
.muted-sm.good { color: #059669; font-weight: 600; }
.muted-sm.bad { color: var(--error); font-weight: 600; }
.mono { font-family: var(--mono); }

/* password inputs */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .input { padding-right: 84px; }
.pw-eye { position: absolute; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); display: grid; place-items: center; transition: background-color .15s, color .15s; }
.pw-eye + .pw-eye { right: 40px; }
.pw-eye:hover { background: var(--bg); color: var(--primary); }
.pw-meter { display: block; height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 8px; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .35s var(--ease), background-color .35s; }
.lvl-1 { background: var(--error); } .lvl-2 { background: var(--warning); } .lvl-3 { background: #22C55E; } .lvl-4 { background: var(--success); }
.pw-label { display: block; font-size: 12px; color: var(--text-2); margin-top: 4px; min-height: 1em; font-weight: 500; }

/* unlocked app */
.vault-shell { background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; overflow: clip; animation: cardIn .45s var(--ease) both; }
.vault-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.vault-title { display: flex; align-items: center; gap: 12px; }
.vault-title > .i { width: 38px; height: 38px; padding: 8px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.vault-title h2 { margin: 0; font-size: 19px; font-weight: 800; }
.vault-title .muted { font-size: 12.5px; color: var(--text-2); }
.vault-search { flex: 1; min-width: 200px; max-width: none; }
.vault-top-actions { display: flex; gap: 8px; align-items: center; }
.vault-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 22px; border-bottom: 1px solid var(--border); background: var(--bg); }
.vault-filters .chip { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vault-filters .chip span { font-size: 12px; opacity: .75; }
.vault-filters .chip .i { width: 14px; height: 14px; }
.vault-filters .chip.warn { color: #B45309; border-color: rgba(245, 158, 11, .4); }
.vault-filters .chip.warn[aria-current] { background: var(--warning); border-color: var(--warning); color: #fff; }
.vault-body { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); min-height: 460px; }
.vault-body > * { min-width: 0; }
.vault-shell, .vault-top > * { min-width: 0; }
.vault-list { list-style: none; margin: 0; padding: 8px; border-right: 1px solid var(--border); }
.v-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: var(--text); transition: background-color .15s, transform .2s var(--ease); animation: fadeUp .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.v-row:hover { background: var(--bg); }
.v-row.active { background: var(--active-bg); }
.v-row-text { flex: 1; min-width: 0; display: grid; }
.v-row-text strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-row-text span { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-fav .i, .v-star.on .i { color: var(--warning); fill: var(--warning); }
.v-fav .i { width: 15px; height: 15px; }
.v-warn .i { width: 16px; height: 16px; color: var(--warning); }
.v-avatar { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; }
.v-avatar.c0 { background: #6366F1; } .v-avatar.c1 { background: #8B5CF6; } .v-avatar.c2 { background: #3B82F6; } .v-avatar.c3 { background: #10B981; }
.v-avatar.c4 { background: #F59E0B; } .v-avatar.c5 { background: #EF4444; } .v-avatar.c6 { background: #DB2777; } .v-avatar.c7 { background: #0EA5E9; }
.vault-empty { padding: 40px 16px; text-align: center; color: var(--text-2); display: grid; gap: 6px; }
.vault-empty strong { color: var(--text); }
/* No inner scrollbars: the page scrolls; details stay in view beside long lists */
.vault-detail { padding: 22px 26px; align-self: start; position: sticky; top: calc(var(--topbar-h, 70px) + 12px); }
.vault-detail-empty { height: 100%; min-height: 300px; display: grid; place-content: center; justify-items: center; color: var(--text-2); gap: 8px; }
.vault-detail-empty .i { width: 40px; height: 40px; opacity: .5; }
.v-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; animation: fadeUp .3s var(--ease) both; }
.v-detail-head .v-avatar { width: 48px; height: 48px; font-size: 20px; border-radius: 14px; }
.v-detail-head div { flex: 1; min-width: 0; }
.v-detail-head h3 { margin: 0; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.v-back { display: none; }
.v-field { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; animation: fadeUp .3s var(--ease) both; }
.v-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.v-value { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.v-value > span:first-child, .v-value > a:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.v-value.mono > span:first-child { font-family: var(--mono); letter-spacing: .02em; }
.v-field-actions { display: flex; gap: 4px; flex: none; }
.v-field-actions .icon-btn.sm { width: 32px; height: 32px; }
.v-field-actions .i { width: 16px; height: 16px; }
.v-notes { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; margin-bottom: 6px; overflow-wrap: anywhere; }
.v-pw-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pw-tag { font-size: 11.5px; font-weight: 700; color: #fff; padding: 2px 9px; border-radius: 20px; }
.v-meta { font-size: 12.5px; color: var(--text-2); margin: 14px 0; }
.v-detail-actions { display: flex; gap: 10px; }
.icon-btn.sm { width: 34px; height: 34px; }
.vault-modal-wide { max-width: 560px; }
.v-grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.gen-out { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); margin-top: 12px; }
.gen-out span { flex: 1; font-size: 17px; overflow-wrap: anywhere; font-weight: 600; letter-spacing: .02em; }
.gen-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
input[type=range] { width: 100%; accent-color: var(--primary); }
.vault-landing { padding-top: 64px; }
/* FAQ arrows on this page: point down, flip up when open */
.vault-page .faq summary .i { transform: rotate(90deg); }
.vault-page .faq details[open] summary .i { transform: rotate(-90deg); }

@media (max-width: 820px) {
  .vault-main { padding: 18px 12px; }
  .vault-card { padding: 28px 20px; }
  .vault-top { padding: 14px 16px; }
  .vault-top-actions { width: 100%; justify-content: flex-end; }
  .vault-top-actions .btn span { display: none; }
  .vault-search { min-width: 0; flex-basis: 100%; order: 3; }
  .vault-filters { padding: 10px 16px; overflow-x: auto; flex-wrap: nowrap; }
  .vault-filters .chip { flex: none; }
  .vault-body { grid-template-columns: minmax(0, 1fr); }
  .vault-list { border-right: 0; max-height: none; }
  .vault-detail { display: none; padding: 18px 16px; position: static; }
  .has-detail .vault-list { display: none; }
  .has-detail .vault-detail { display: block; }
  .v-back { display: inline-flex; }
  .v-grid2, .gen-opts { grid-template-columns: 1fr; }
}

/* Small phones: keep the shared header within the screen (it now has a Vault link) */
@media (max-width: 420px) {
  .topbar.simple .topbar-right { gap: 2px; }
  .topbar.simple .top-link { padding: 8px 6px; font-size: 13.5px; }
}
