/* Vaultline web portal. One hand-written stylesheet; colours are custom properties with automatic dark mode. */

:root {
  color-scheme: light dark;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f8;
  --border: #e3e6f0;
  --border-strong: #cfd4e3;
  --text: #141a2e;
  --muted: #5d6680;
  --subtle: #8a92a8;
  --accent: #4f46e5;
  --accent-2: #0ea5e9;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --ok: #0f9d6b;
  --ok-soft: #e4f7ef;
  --warn: #b7730b;
  --warn-soft: #fdf3dc;
  --bad: #d33a4a;
  --bad-soft: #fde9eb;
  --focus: 0 0 0 3px rgba(79, 70, 229, 0.35);
  --shadow-sm: 0 1px 2px rgba(20, 26, 46, 0.06);
  --shadow: 0 1px 2px rgba(20, 26, 46, 0.05), 0 6px 24px rgba(20, 26, 46, 0.06);
  --shadow-lg: 0 24px 64px rgba(20, 26, 46, 0.22);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 252px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e17;
    --surface: #131726;
    --surface-2: #181d2f;
    --surface-3: #1f2539;
    --border: #262c42;
    --border-strong: #353d59;
    --text: #e8eaf3;
    --muted: #9aa3bd;
    --subtle: #6f7894;
    --accent: #7c75ff;
    --accent-2: #38bdf8;
    --accent-ink: #0b0e17;
    --accent-soft: #232450;
    --accent-text: #b4b0ff;
    --ok: #34d399;
    --ok-soft: #10302a;
    --warn: #f5b84a;
    --warn-soft: #3a2c10;
    --bad: #f87171;
    --bad-soft: #3b1a20;
    --focus: 0 0 0 3px rgba(124, 117, 255, 0.45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.6rem;
  font-weight: 700;
}
h2 {
  font-size: 1.05rem;
  font-weight: 650;
}
p {
  margin: 0;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
::selection {
  background: var(--accent-soft);
}

.muted {
  color: var(--muted);
}
.subtle {
  color: var(--subtle);
}
.small,
small {
  font-size: 0.84rem;
}
.center {
  text-align: center;
}
.right {
  text-align: right;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row.tight {
  gap: 2px;
  flex-wrap: nowrap;
}
.stack {
  display: grid;
  gap: 14px;
}
.stack-lg {
  display: grid;
  gap: 20px;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.grid.side {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: start;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
}
.skip-link:focus {
  top: 12px;
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand span {
  display: grid;
  line-height: 1.15;
}
.brand strong {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.brand small {
  color: var(--muted);
  font-size: 0.76rem;
}
.brand.light,
.brand.light small {
  color: #fff;
}

nav {
  display: grid;
  gap: 16px;
  flex: 1;
  align-content: start;
}
.nav-group {
  display: grid;
  gap: 2px;
}
.nav-group p {
  margin: 0 10px 4px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}
.nav-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 520;
}
.nav-group a:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}
.nav-group a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  flex: none;
}
.who {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}
.who strong {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 550;
}
.who small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.86rem;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumb {
  font-weight: 600;
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-size: 0.82rem;
  font-weight: 550;
}
.icon-button.menu {
  display: none;
}
.content {
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  outline: none;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head > div:first-child {
  max-width: 720px;
}
.page-head p {
  margin-top: 4px;
}
.scrim {
  display: none;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 580;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:hover {
  background: var(--surface-3);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}
.btn.primary:hover {
  background: var(--accent);
  filter: brightness(1.06);
}
.btn.danger {
  background: var(--bad);
  border-color: transparent;
  color: #fff;
}
.btn.danger.ghost,
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.danger.ghost {
  color: var(--bad);
}
.btn.ghost:hover {
  background: var(--surface-3);
}
.btn.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.86rem;
}
.btn.block {
  width: 100%;
}
.btn.loading {
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn.primary.loading::after,
.btn.danger.loading::after {
  border-color: #fff;
  border-right-color: transparent;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.icon-button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.icon-button.on {
  color: #f5a524;
}
.icon-button.on svg,
.fav svg {
  fill: currentColor;
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-text);
  font: inherit;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 560;
  font-size: 0.9rem;
}
.field output {
  font-weight: 700;
  color: var(--accent-text);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  resize: vertical;
  line-height: 1.45;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
}
input[readonly] {
  background: var(--surface-2);
  color: var(--muted);
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--bad);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  flex: none;
}
.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-group input,
.input-group textarea {
  padding-right: 44px;
}
.input-group:has(.icon-button + .icon-button) input {
  padding-right: 80px;
}
.input-group .icon-button {
  position: absolute;
  right: 3px;
  top: 3px;
}
.input-group .icon-button + .icon-button {
  right: 3px;
}
.input-group .icon-button:not(:last-child) {
  right: 38px;
}
.masked {
  -webkit-text-security: disc;
}
textarea.masked {
  color: transparent;
  text-shadow: 0 0 9px var(--muted);
}
.field-error {
  color: var(--bad);
  font-size: 0.82rem;
  font-weight: 500;
}
.hint {
  color: var(--muted);
  font-weight: 400;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 0.82rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 42px !important;
  height: 24px !important;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(18px);
}

.callout {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.callout.bad {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 25%, transparent);
}
.callout.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.callout.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 620;
  white-space: nowrap;
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 560;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-text);
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--surface-3);
  margin-bottom: 18px;
}
.tabs button {
  border: 0;
  padding: 7px 16px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ---------- cards and lists ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-body {
  display: grid;
  gap: 10px;
}

.list {
  display: grid;
  gap: 2px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--text);
  min-width: 0;
}
a.list-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.list-item.active {
  background: var(--accent-soft);
}
.list-item.dim {
  opacity: 0.6;
}
.list-item .grow {
  display: grid;
}
.list-item strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item + .list-item:not(a) {
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.fav {
  color: #f5a524;
}

.item-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 700;
  flex: none;
}
.item-icon.tone-0 { background: #e0e7ff; color: #4338ca; }
.item-icon.tone-1 { background: #dcfce7; color: #15803d; }
.item-icon.tone-2 { background: #fee2e2; color: #b91c1c; }
.item-icon.tone-3 { background: #fef3c7; color: #b45309; }
.item-icon.tone-4 { background: #e0f2fe; color: #0369a1; }
.item-icon.tone-5 { background: #fae8ff; color: #a21caf; }
.item-icon.tone-6 { background: #ccfbf1; color: #0f766e; }
.item-icon.tone-7 { background: #ffe4e6; color: #be123c; }
.item-icon.type-note { background: #fef9c3; color: #a16207; }
.item-icon.type-card { background: #dbeafe; color: #1d4ed8; }
.item-icon.type-identity { background: #dcfce7; color: #15803d; }
.item-icon.type-id { background: #ede9fe; color: #6d28d9; }
.item-icon.type-bank { background: #ccfbf1; color: #0f766e; }
.item-icon.type-secret { background: #1e293b; color: #a5f3fc; }
.item-icon.type-passkey { background: var(--accent-soft); color: var(--accent-text); }
.item-icon.type-send { background: #e0f2fe; color: #0369a1; }
.item-icon.type-alert { background: var(--bad-soft); color: var(--bad); }
@media (prefers-color-scheme: dark) {
  .item-icon[class*="tone-"],
  .item-icon.type-note,
  .item-icon.type-card,
  .item-icon.type-identity,
  .item-icon.type-id,
  .item-icon.type-bank,
  .item-icon.type-send {
    filter: saturate(0.9) brightness(0.85);
  }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  color: var(--text);
  font-size: 1rem;
}
.empty p {
  max-width: 380px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 6px;
}
.empty-icon svg {
  width: 24px;
  height: 24px;
}
.state-error .empty-icon {
  background: var(--bad-soft);
  color: var(--bad);
}
.empty-action {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.skeleton.box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.skeleton.thin {
  height: 9px;
}
.skeleton.w-60 {
  width: 60%;
}
.skeleton.w-40 {
  width: 40%;
}
.sk-lines {
  display: grid;
  gap: 8px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.actions.start {
  justify-content: flex-start;
}

/* ---------- vault ---------- */

.vault {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.vault-list {
  padding: 14px;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  grid-template-rows: auto auto minmax(0, 1fr);
}
.vault-list .list {
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  align-content: start;
}
.toolbar {
  display: flex;
  gap: 8px;
}
.toolbar select {
  width: auto;
  max-width: 40%;
}
.search {
  position: relative;
  flex: 1;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 11px;
  color: var(--subtle);
}
.search input {
  padding-left: 36px !important;
}
.vault-detail {
  min-height: 420px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-head .item-icon {
  width: 46px;
  height: 46px;
  font-size: 1.2rem;
  border-radius: 12px;
}
.detail-head h2 {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}
.detail-head .back {
  display: none;
}
.fields {
  margin: 0;
  display: grid;
}
.field-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.field-row.multiline {
  align-items: start;
}
.field-row dt {
  color: var(--muted);
  font-size: 0.86rem;
}
.field-row dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.field-row .value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pre {
  white-space: pre-wrap;
}
.field-actions {
  display: flex;
  gap: 2px;
  opacity: 0.75;
}
.field-row:hover .field-actions {
  opacity: 1;
}
.totp {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.totp .code {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}
.ring {
  --progress: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--accent) calc(var(--progress) * 100%), var(--surface-3) 0);
}
.history {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.history summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 580;
  color: var(--muted);
}
.history ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.history li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history li .mono {
  flex: 1;
  overflow-wrap: anywhere;
}
.attachments {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.attachments-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 580;
  color: var(--muted);
}
.attachments-head h3 svg,
.attachment svg {
  width: 18px;
  height: 18px;
}
.attachments ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.attachment .grow {
  min-width: 0;
  overflow-wrap: anywhere;
}
.attachment small {
  display: block;
  color: var(--muted);
}
.attachments input[type="file"] {
  display: none;
}
.field .hint.warn {
  color: var(--warn);
  font-weight: 500;
}
.usage-bar {
  display: block;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.usage-bar span {
  display: block;
  height: 100%;
  width: var(--used, 0%);
  background: var(--accent);
}
.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.edit {
  display: grid;
  gap: 14px;
}
.edit .grid.two {
  align-items: end;
}
.edit .check {
  padding-bottom: 10px;
}
.actions.sticky {
  position: sticky;
  bottom: 0;
  padding: 12px 0 2px;
  background: linear-gradient(transparent, var(--surface) 30%);
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0 6px;
}
.type-option {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.type-option svg {
  width: 22px;
  height: 22px;
  color: var(--accent-text);
}
.type-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.strength {
  display: grid;
  gap: 4px;
  font-weight: 400;
}
.strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.strength-bar span {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  transition: background 0.2s;
}
.strength small {
  color: var(--muted);
}
.strength[data-score="0"] span:nth-child(-n + 1),
.strength[data-score="1"] span:nth-child(-n + 1) {
  background: var(--bad);
}
.strength[data-score="2"] span:nth-child(-n + 2) {
  background: var(--warn);
}
.strength[data-score="3"] span:nth-child(-n + 3) {
  background: var(--ok);
}
.strength[data-score="4"] span {
  background: var(--ok);
}

/* ---------- generator ---------- */

.generated {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.generated output {
  font-size: 1.35rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.4;
  min-height: 1.4em;
}
.options {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.recent {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.recent li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
}
.recent li .mono {
  flex: 1;
  overflow-wrap: anywhere;
}
.recent li.plain {
  background: none;
  display: block;
}

/* ---------- health ---------- */

.health-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
  margin-bottom: 20px;
}
.score-card {
  display: flex;
  align-items: center;
  gap: 20px;
}
.score-card > div:last-child {
  display: grid;
  gap: 6px;
}
.score {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
}
.score svg {
  width: 112px;
  height: 112px;
  transform: rotate(-90deg);
}
.score circle {
  fill: none;
  stroke-width: 11;
}
.score .track {
  stroke: var(--surface-3);
}
.score .value {
  --score: 0;
  stroke: var(--ok);
  stroke-dasharray: var(--score) 100;
  transition: stroke-dasharray 0.6s ease;
}
.score[data-level="fair"] .value {
  stroke: var(--warn);
}
.score[data-level="poor"] .value {
  stroke: var(--bad);
}
.score strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 750;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 16px;
}
.stat strong {
  font-size: 1.8rem;
  font-weight: 750;
}
.stat small {
  color: var(--muted);
}
.stat.bad strong {
  color: var(--bad);
}
.stat.warn strong {
  color: var(--warn);
}
.stat.active {
  border-color: var(--accent);
  box-shadow: var(--focus);
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status.ok {
  color: var(--ok);
}
.status.bad {
  color: var(--bad);
}

/* ---------- sends, security, settings ---------- */

.link-box {
  display: flex;
  gap: 8px;
  margin: 14px 0 8px;
}
.setting {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.setting .grow {
  display: grid;
  gap: 4px;
}
.setting-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.setting-row:first-child {
  border-top: 0;
}
.setting-row .grow {
  display: grid;
  gap: 2px;
}
.setting-row select {
  width: auto;
  min-width: 190px;
}
.codes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 14px;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
}
.codes code {
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}
.qr-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.qr {
  width: 176px;
  height: 176px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  flex: none;
}
.qr svg {
  width: 100%;
  height: 100%;
}
.qr svg path[stroke] {
  stroke-width: 1;
  stroke-linecap: butt;
}
.secret-key {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  user-select: all;
}
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tr:last-child td {
  border-bottom: 0;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 14px;
}
.timeline li {
  position: relative;
  display: grid;
  gap: 2px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline li.bad::before {
  background: var(--bad);
}
.timeline li.plain::before {
  display: none;
}
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--bad) 35%, var(--border));
}
.danger-zone h2 {
  color: var(--bad);
}
.danger-zone .actions {
  margin-top: 14px;
}

.dropzone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 30px 16px;
  margin: 14px 0;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone svg {
  width: 26px;
  height: 26px;
  color: var(--accent-text);
}
.dropzone input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.dropzone:hover,
.dropzone.over,
.dropzone:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.import-preview {
  display: grid;
  gap: 10px;
}
.sample {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 2px;
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress span {
  --done: 0%;
  display: block;
  height: 100%;
  width: var(--done);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s;
}
.radio-cards {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.radio-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.radio-card span {
  display: grid;
}
.radio-card small {
  color: var(--muted);
}
.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- auth ---------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}
.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 48px;
  color: #e7e9ff;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(14, 165, 233, 0.35), transparent 60%), radial-gradient(900px 700px at 110% 110%, rgba(124, 58, 237, 0.45), transparent 60%), #14123a;
}
.auth-side h1 {
  font-size: 2.1rem;
  color: #fff;
  max-width: 520px;
  margin-bottom: 26px;
}
.auth-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  max-width: 480px;
}
.auth-side li {
  display: grid;
  gap: 2px;
  padding-left: 18px;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  color: #c5c8f0;
}
.auth-side li strong {
  color: #fff;
}
.auth-side .small {
  color: #9fa4d8;
  letter-spacing: 0.04em;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%;
  max-width: 410px;
  display: grid;
  gap: 16px;
}
.auth-card h1 {
  margin-bottom: 4px;
}
.lock-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.lock-mark svg {
  width: 26px;
  height: 26px;
}

/* ---------- public send viewer ---------- */

.send-page {
  min-height: 100vh;
  background: radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--bg);
}
.send-head {
  padding: 22px 28px;
}
.send-main {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 24px 16px 48px;
}
.send-card {
  width: 100%;
  max-width: 560px;
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 30px;
}
.send-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.send-card.gone .send-icon {
  background: var(--surface-3);
  color: var(--subtle);
}
.facts {
  display: flex;
  gap: 28px;
  margin: 0;
}
.facts dt {
  color: var(--muted);
  font-size: 0.8rem;
}
.facts dd {
  margin: 0;
  font-weight: 600;
}
.send-secret {
  width: 100%;
  display: grid;
  gap: 10px;
}
.secret-text {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 50vh;
  overflow: auto;
}

/* ---------- dialog, toast, offline ---------- */

.dialog {
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog.wide {
  width: min(720px, calc(100vw - 24px));
}
.dialog::backdrop {
  background: rgba(10, 12, 28, 0.55);
  backdrop-filter: blur(3px);
}
.dialog[open] {
  animation: pop 0.16s ease-out;
}
.dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 18px;
  border-radius: 12px;
  background: #151a2e;
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 520;
  cursor: pointer;
  animation: toast-in 0.2s ease-out;
}
.toast.bad {
  background: #b4232f;
}
.toast.warn {
  background: #8a5a06;
}
.toast.leaving {
  animation: toast-out 0.25s ease-in forwards;
}
@media (prefers-color-scheme: dark) {
  .toast {
    background: #e8eaf3;
    color: #0b0e17;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}
.offline-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--warn);
  color: #1b1300;
  font-size: 0.88rem;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .health-top {
    grid-template-columns: 1fr;
  }
  .grid.side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: min(var(--sidebar), 86vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .menu-open .sidebar {
    transform: none;
  }
  .menu-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(10, 12, 28, 0.45);
  }
  .icon-button.menu {
    display: inline-grid;
  }
  .topbar {
    padding: 0 14px;
  }
  .content {
    padding: 18px 14px 40px;
  }
  .secure-badge span {
    display: none;
  }
  .vault {
    grid-template-columns: 1fr;
  }
  .vault-list {
    position: static;
    max-height: none;
  }
  .vault.showing .vault-list {
    display: none;
  }
  .vault:not(.showing) .vault-detail {
    display: none;
  }
  .detail-head .back {
    display: inline-grid;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .grid.two,
  .stats,
  .checks,
  .codes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid.two,
  .checks {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 1.35rem;
  }
  .setting-row {
    flex-wrap: wrap;
  }
  .setting-row select {
    width: 100%;
  }
  .inline-form,
  .link-box {
    flex-direction: column;
    align-items: stretch;
  }
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Sharing */
.pill.shared {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.pill svg {
  width: 12px;
  height: 12px;
}
.fingerprint {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  word-spacing: 0.25em;
  overflow-wrap: anywhere;
  user-select: all;
}
.fingerprint-line {
  font-size: 0.72rem;
  color: var(--subtle);
  overflow-wrap: anywhere;
}
.avatar.small {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
}
.list-item.member select {
  width: auto;
  min-width: 112px;
}
.list-item.member small.fingerprint-line {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.shared-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 12px;
}
.shared-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}
[data-recipient] strong {
  display: flex;
  gap: 6px;
  align-items: center;
}
[data-recipient] strong svg {
  width: 16px;
  height: 16px;
}
[data-key-card],
[data-invites-card] {
  margin-bottom: 16px;
}

/* --- Language, profile and account area ------------------------------------------------- */

/* The page stays hidden until i18n.js has translated it (at most 1.5 s, so a failed catalog load
   never leaves a blank page). */
html[data-i18n-pending] body {
  visibility: hidden;
  animation: i18n-reveal 0s linear 1.5s forwards;
}
@keyframes i18n-reveal {
  to {
    visibility: visible;
  }
}

.avatar-c0 { background: #2563eb; }
.avatar-c1 { background: #7c3aed; }
.avatar-c2 { background: #db2777; }
.avatar-c3 { background: #dc2626; }
.avatar-c4 { background: #ea580c; }
.avatar-c5 { background: #ca8a04; }
.avatar-c6 { background: #16a34a; }
.avatar-c7 { background: #0d9488; }
.avatar-c8 { background: #0891b2; }
.avatar-c9 { background: #4f46e5; }
.avatar-c10 { background: #9333ea; }
.avatar-c11 { background: #475569; }
.avatar {
  letter-spacing: 0.02em;
  font-size: 0.86rem;
}
.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}
.who strong.named {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
}

.account-menu {
  position: relative;
}
.account-menu summary {
  list-style: none;
  cursor: pointer;
  border-radius: 50%;
  display: block;
}
.account-menu summary::-webkit-details-marker {
  display: none;
}
.account-menu summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 250px;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 40;
}
.account-menu-who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.account-menu-who .grow {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.account-menu-who small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-menu-panel a,
.account-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-panel a:hover,
.account-menu-panel button:hover {
  background: var(--surface-3);
}

.account-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.account-nav {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 2px;
}
.account-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}
.account-nav a:hover,
.account-nav a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.account-section {
  scroll-margin-top: 84px;
}
.account-section > h2.section-title {
  font-size: 1.05rem;
  margin: 8px 0 12px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.profile-card .grow {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.profile-card h2 {
  margin: 0;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  margin: 0;
}
.facts-grid div {
  display: grid;
  gap: 2px;
}
.facts-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.facts-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.recovery-key {
  display: block;
  font-family: var(--mono);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 18px 12px;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  user-select: all;
  overflow-wrap: anywhere;
}
.lang-picker {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.lang-picker select {
  width: auto;
  min-height: 34px;
  padding: 4px 10px;
}
.print-sheet {
  display: none;
}
@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
  .account-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }
}
@media print {
  body.printing > * {
    display: none !important;
  }
  body.printing > .print-sheet {
    display: block !important;
    visibility: visible;
    color: #000;
    font: 14px/1.5 var(--font);
  }
  .print-sheet .recovery-key {
    border: 1px solid #000;
    background: none;
  }
}

/* ---------- import from other managers ---------- */

.section-label {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.source-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.source-tile:hover,
.source-tile:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.source-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.8rem;
}
.how-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
}
.import-preview h3 {
  margin: 0;
}
.import-preview details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.import-preview summary {
  cursor: pointer;
  font-weight: 580;
}
.import-preview details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
  max-height: 240px;
  overflow: auto;
}
.import-preview .pills {
  justify-content: flex-start;
}
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
}
