:root {
  --mint-25: #f8fcfa;
  --mint-50: #eef7f2;
  --mint-100: #deeee5;
  --mint-200: #c7e2d3;
  --emerald: #087a55;
  --emerald-dark: #056443;
  --emerald-soft: #e5f4ec;
  --slate-950: #14231e;
  --slate-700: #3e514a;
  --slate-500: #687a73;
  --line: #d8e5de;
  --white: #ffffff;
  --danger: #a43f3f;
  --danger-soft: #fff1f1;
  --shadow: 0 18px 45px rgba(25, 65, 50, .09), 0 2px 8px rgba(25, 65, 50, .05);
  --font-display: ui-rounded, "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--mint-50); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--slate-950);
  background-color: var(--mint-50);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--emerald); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--white);
  background: var(--emerald-dark);
}
.skip-link:focus { transform: translateY(0); }

.page-shell {
  width: min(100% - 32px, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 28px;
}
.topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.private-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgba(8, 122, 85, .1);
}
.profile { text-align: center; margin: 6px auto 30px; }
.profile-avatar {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 15px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(8, 122, 85, .18);
  border-radius: 27px;
  color: var(--white);
  background: var(--emerald);
  box-shadow: 0 12px 28px rgba(8, 122, 85, .2), inset 0 0 0 5px rgba(255, 255, 255, .13);
  font: 800 34px/1 var(--font-display);
  letter-spacing: -.08em;
  transform: rotate(-2deg);
}
.profile-avatar span {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 34px;
  height: 34px;
  border: 7px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.025em; }
.profile h1 { margin: 0; font-size: clamp(27px, 8vw, 34px); letter-spacing: .08em; }
.profile-handle { margin: 2px 0 7px; color: var(--emerald); font-weight: 750; }
.profile-description { margin: 0; color: var(--slate-500); font-size: 14px; }

.auth-card, dialog {
  border: 1px solid rgba(199, 226, 211, .88);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.auth-card { padding: clamp(22px, 6vw, 32px); }
.auth-card h2 { margin: 7px 0 9px; font-size: clamp(25px, 7vw, 31px); }
.auth-card form { margin-top: 24px; }
.eyebrow {
  color: var(--emerald);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.subtle { margin: 0; color: var(--slate-500); }
label { display: block; margin: 15px 0 7px; color: var(--slate-700); font-size: 13px; font-weight: 700; }
.required-label { color: var(--emerald); font-size: 11px; text-transform: uppercase; }
input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cbdad2;
  border-radius: 12px;
  outline: 0;
  color: var(--slate-950);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 84px; resize: vertical; }
input:hover, textarea:hover { border-color: #a8c3b5; }
input:focus, textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(8, 122, 85, .12); }
input:invalid:not(:placeholder-shown) { border-color: #bd6868; }
.field-hint { margin: 6px 0 0; color: var(--slate-500); font-size: 12px; }
.form-error {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #f0caca;
  border-radius: 10px;
  color: #833333;
  background: var(--danger-soft);
  font-size: 13px;
}
.notice {
  padding: 12px 14px;
  border: 1px solid var(--mint-200);
  border-radius: 12px;
  color: var(--slate-700);
  background: var(--emerald-soft);
}
.notice p { margin: 4px 0 13px; }
.auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--slate-500);
  font-size: 12px;
}

.primary-button, .secondary-button, .quiet-button, .delete-button, .close-button, .view-button, .icon-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 720;
}
.primary-button, .delete-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  text-decoration: none;
}
.primary-button { color: var(--white); background: var(--emerald); box-shadow: 0 7px 18px rgba(8, 122, 85, .16); }
.primary-button:hover { background: var(--emerald-dark); }
.secondary-button { border: 1px solid var(--line); background: var(--white); }
.secondary-button:hover { border-color: var(--mint-200); background: var(--mint-25); }
.delete-button { color: var(--white); background: var(--danger); }
.quiet-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: var(--slate-500);
  background: transparent;
  font-size: 13px;
}
.quiet-button:hover { color: var(--emerald-dark); background: rgba(255, 255, 255, .72); }
.full-width { width: 100%; margin-top: 15px; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(8, 122, 85, .3); outline-offset: 3px; }
.lock-icon {
  display: inline-block;
  width: 11px;
  height: 9px;
  border: 1.7px solid currentColor;
  border-radius: 2px;
  vertical-align: middle;
}
.lock-icon::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: -7px auto 0;
  border: 1.7px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.loading-state { padding: 26px 0; text-align: center; color: var(--slate-500); }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 7px;
  border: 2px solid var(--mint-200);
  border-top-color: var(--emerald);
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.view-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .64);
}
.view-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--slate-500);
  background: transparent;
  font-size: 13px;
}
.view-button[aria-pressed="true"] { color: var(--slate-950); background: var(--white); box-shadow: 0 3px 10px rgba(25, 65, 50, .08); }
.count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  font-size: 11px;
}
.search-wrap { position: relative; margin-bottom: 26px; }
.search-wrap input { padding-left: 42px; border-color: transparent; box-shadow: 0 5px 18px rgba(25, 65, 50, .06); }
.search-icon {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 1.7px solid var(--slate-500);
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 1.7px; background: var(--slate-500); transform: rotate(45deg); }

.link-group { margin: 0 0 28px; }
.group-label {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 4px 11px;
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--mint-200); }
.link-stack { display: grid; gap: 10px; }
.link-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px 16px 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(205, 222, 213, .9);
  border-radius: 17px;
  color: var(--slate-950);
  background: var(--white);
  box-shadow: 0 6px 17px rgba(25, 65, 50, .055);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.link-card:hover { transform: translateY(-2px); border-color: #a8cdbb; box-shadow: 0 10px 24px rgba(25, 65, 50, .09); }
.link-card:active { transform: translateY(0); }
.link-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  font: 800 16px/1 var(--font-display);
  letter-spacing: -.03em;
}
.link-copy { min-width: 0; }
.link-title { display: block; overflow: hidden; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.link-note { display: block; overflow: hidden; margin-top: 2px; color: var(--slate-500); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.link-arrow { color: var(--emerald); font-size: 20px; transition: transform .15s ease; }
.link-card:hover .link-arrow { transform: translate(2px, -2px); }

.collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 26px 2px 17px; }
.collection-heading h2 { margin: 0 0 4px; font-size: 25px; }
.collection-heading .primary-button { flex: none; }
#accounts-list { display: grid; gap: 11px; }
.account-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: 0 6px 17px rgba(25, 65, 50, .055); }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-head h3 { margin: 0; font-size: 17px; }
.account-meta { margin: 5px 0 0; color: var(--slate-500); font-size: 13px; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.account-actions button, .account-actions a { min-height: 44px; }
.account-actions .secondary-button { flex: 1; }
.icon-button { width: 44px; border: 1px solid var(--line); color: var(--slate-500); background: var(--white); }
.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.secret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 10px; }
.revealed-password { min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty-state { padding: 35px 24px; border: 1px dashed #b9d2c5; border-radius: 18px; text-align: center; background: rgba(255, 255, 255, .57); }
.empty-symbol { display: grid; width: 46px; height: 46px; margin: 0 auto 12px; place-items: center; border-radius: 15px; color: var(--emerald); background: var(--emerald-soft); font-size: 23px; }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; }
.empty-state p { max-width: 390px; margin: 0 auto 15px; color: var(--slate-500); }
.privacy-note, .export-hint { color: var(--slate-500); font-size: 12px; text-align: center; }
.privacy-note { margin: 17px auto; max-width: 420px; }
.vault-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.export-hint { margin-top: 3px; }

.page-footer { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 36px; color: var(--slate-500); font-size: 11px; }
.footer-wordmark { padding-right: 9px; border-right: 1px solid var(--mint-200); color: var(--slate-700); font: 800 11px/1 var(--font-display); letter-spacing: .12em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
dialog { width: min(calc(100% - 28px), 570px); max-height: calc(100vh - 28px); padding: clamp(20px, 5vw, 28px); overflow: auto; color: var(--slate-950); }
dialog::backdrop { background: rgba(20, 35, 30, .35); backdrop-filter: blur(3px); }
dialog h2 { margin: 5px 0 10px; font-size: 25px; }
.compact-dialog { max-width: 470px; }
.close-button { width: 44px; flex: none; color: var(--slate-500); background: var(--mint-50); font-size: 25px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: min(380px, calc(100% - 36px)); padding: 12px 15px; border-radius: 12px; color: var(--white); background: var(--slate-950); box-shadow: var(--shadow); font-size: 13px; }

@media (max-width: 520px) {
  .page-shell { width: min(100% - 24px, 560px); padding-top: 10px; }
  .topbar { margin-bottom: 12px; }
  .profile { margin-bottom: 25px; }
  .profile-avatar { width: 68px; height: 68px; border-radius: 23px; font-size: 30px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .collection-heading { align-items: flex-start; }
  .collection-heading .primary-button { padding-inline: 12px; }
  .dialog-actions > * { flex: 1; }
}
@media (max-width: 360px) {
  .view-button { font-size: 12px; }
  .view-button .lock-icon { display: none; }
  .link-card { grid-template-columns: 42px minmax(0, 1fr) 20px; gap: 9px; padding-right: 11px; }
  .collection-heading { display: block; }
  .collection-heading .primary-button { width: 100%; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
