/* ==================================================================================================
   Info board & Vault (apps/vault)                                              owner: A2 (vault UI)

   r4 "Birge OS" (spec 04 §12.11 — Apple Passwords): white cards (radius 18, soft shadow, no hairline
   border) on the grouped background; the type is a 36 px app-icon squircle (tone gradient, white
   glyph); "label ···· value" rows; secrets are •••••• with round glass 👁 / ⧉ buttons (⧉ → green ✓
   for 1.2 s + haptic); dates that run out are tinted chips (warning → urgent → red). The card dialog
   is a large sheet with a 64 px squircle and inset grouped panels; sudo shows a 64 px lock squircle.

   Root classes   .vault (board) · .vault-modal (card dialog / editor) · .vault-sudo (re-auth)
                  .vault-resp (Overview widget) · .vault-log (audit page) · .wsjoin (join page,
                  3D card — §15, the one place the old 3D card survives)
   Map            1 board head & toolbar · 2 "+ Add" picker · 3 groups, shelves & grids · 4 card ·
                  5 fields & secrets · 6 badges · 7 card states · 8 list view · 9 bulk bar ·
                  10 empty states · 11 card dialog · 12 editor · 13 sudo · 14 widgets, tabs, log ·
                  15 join-page 3D card · 16 card ⇄ dialog transition
   JS hooks (static/js/vault.js) are classes and data-attributes; keep them: .vcard / __body /
   __link / __swipe, .vault-grid (masonry: .is-masonry), .vault-shelf (.is-collapsed,
   .is-animating), .vsecret (+ __value / __dots / __ch / __block / __timer, .is-revealed,
   .is-revealing, .is-masking, .is-multiline, .is-block), .vtotp, .vrow (.is-editing, .is-saved),
   .vtabs__tab, .vbtn (.is-done), .vault-sudo (.is-checking, .is-error, .is-unlocked).
   ================================================================================================== */

.vault,
.vault-modal,
.vault-sudo,
.vault-resp,
.vault-picker,
.vault-log {
  --vc-mono: var(--font-mono);
}

/* -- Glyph tile (r4): the app-icon squircle of content.css .icon-tile — vertical tone gradient, white
   glyph at 58 %, hairline light rim. Sizes: --sm 24 (list rows) · 28 (default) · --lg 36 (cards,
   pickers) · --xl 64 (card dialog). --soft keeps the old tint for dense spots. ---------------------- */
.vault-glyph {
  --size: 28px;
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: calc(var(--size) * 0.25);
  background: var(--tone-gradient);
  color: var(--tone-on);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.06),
    0 1px 2px rgb(0 0 0 / 0.12);
}
.vault-glyph .icon {
  --icon-stroke: 2.2;
  width: 58%;
  height: 58%;
}
.vault-glyph--sm {
  --size: 24px;
}
.vault-glyph--sm .icon {
  width: 62%;
  height: 62%;
}
.vault-glyph--lg {
  --size: 36px;
}
.vault-glyph--xl {
  --size: 64px;
}
.vault-glyph--xl .icon {
  --icon-stroke: 2;
  width: 52%;
  height: 52%;
}
.vault-glyph--soft {
  background: var(--tone-soft, var(--fill-1));
  color: var(--tone-ink, var(--text-2));
  box-shadow: none;
}

/* ==================================================================================================
   1. Board head — core toolbar, type pills, stats, filter panel, active filters
   ================================================================================================== */
.vault {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding-bottom: var(--space-12);
}
.vault-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.vault-toolbar {
  flex-wrap: wrap;
  row-gap: var(--space-2);
}
.vault-toolbar__main {
  min-width: 0;
}
.vault-tools__search {
  display: flex;
  flex: 0 1 240px;
  min-width: 0;
}
.vault-tools__search .toolbar-search {
  flex: 1 1 auto;
}
/* The core field collapses to its icon in a narrow toolbar: the wrapper follows it. */
@container toolbar (max-width: 359px) {
  .vault-tools__search:not(:focus-within):not(:has(input:not(:placeholder-shown))) {
    flex: 0 0 auto;
  }
}
.vault-view-toggle .segmented__item {
  min-width: 34px;
  padding: 0 8px;
}
.vault-add__trigger .icon {
  transition: rotate var(--dur-2) var(--ease-out);
}
.vault-add__trigger[aria-expanded="true"] .icon {
  rotate: 45deg;
}

/* Numbers next to the filters: muted; what needs attention reads in the warning ink. */
.vault-stats {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  margin-left: 6px;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.vault-stats__item {
  flex-shrink: 0;
}
.vault-stats__item + .vault-stats__item::before {
  content: "·";
  margin: 0 6px;
  color: var(--text-3);
}
.vault-stats__item strong {
  color: var(--text-2);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.vault-stats__item--warn {
  color: var(--warning-ink);
  font-weight: var(--fw-medium);
}
@container toolbar (max-width: 760px) {
  .vault-stats {
    display: none;
  }
}

/* One row of one-tap filters (core .filter-pill): types with their counts · expiring · pinned · mine */
.vault-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.vault-filters::-webkit-scrollbar {
  display: none;
}
.vault-filters .filter-pill .icon {
  flex-shrink: 0;
  color: var(--text-3);
}
.vault-filters .filter-pill:has(> input:checked) .icon {
  color: inherit;
}
.vault-pill-count {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.filter-pill:has(> input:checked) .vault-pill-count {
  color: inherit;
  opacity: 0.8;
}
.vault-filters__sep {
  flex-shrink: 0;
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: var(--line);
}
.vault-filters:not(:has(input:checked)) .vault-filters__clear {
  display: none;
}

.vault-filter-panel {
  width: min(600px, calc(100vw - 16px));
  max-width: min(600px, calc(100vw - 16px));
}
.vault-filter-panel .filter-option .icon {
  flex-shrink: 0;
  color: var(--text-3);
}
.vault-filter-panel__footer {
  justify-content: stretch;
}
.vault-filter-panel__footer .filter-option {
  flex: 1;
  color: var(--text-2);
}
.vault-active-filters {
  margin-bottom: calc(var(--space-2) * -1);
}

/* ==================================================================================================
   2. "+ Add" — card types in a popover (and in a modal from a section's +)
   ================================================================================================== */
.vault-picker.popover__panel {
  width: min(460px, calc(100vw - 16px));
  max-width: none;
  max-height: min(80vh, 560px);
  padding: 6px;
}
.vault-picker__title {
  padding: 6px 8px 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.vault-picker__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
@media (min-width: 420px) {
  .vault-picker__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.vault-kind {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.vault-kind:hover {
  background: var(--fill-1);
}
.vault-kind:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: -2px;
}
.vault-kind__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.vault-kind__label {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-kind__hint {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.vault-picker__foot {
  display: flex;
  margin: 6px -6px -6px;
  padding: 6px;
  border-top: 0.5px solid var(--line);
}
/* The modal chooser (sheet md): a 3-column App Library grid — 48 px squircle over the name. */
.modal.vault-modal.vault-modal--picker {
  --modal-w: 520px;
}
.vault-picker--inline .vault-picker__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 4px;
}
.vault-picker--inline .vault-kind {
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 4px 10px;
  border-radius: var(--radius-card);
  text-align: center;
}
.vault-picker--inline .vault-glyph {
  --size: 48px;
}
.vault-picker--inline .vault-kind__text {
  align-items: center;
  width: 100%;
}
.vault-picker--inline .vault-kind__label {
  max-width: 100%;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.vault-picker--inline .vault-kind__hint {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .vault-picker--inline .vault-kind .vault-glyph {
    transition: transform var(--dur-snappy) var(--spring-snappy);
  }
  .vault-picker--inline .vault-kind:hover .vault-glyph {
    transform: scale(1.06);
  }
  .vault-picker--inline .vault-kind:active .vault-glyph {
    transform: scale(0.92);
  }
}

/* ==================================================================================================
   3. Group headers, shelves (sections), grids, pinned
   ================================================================================================== */
.vault-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
  margin-top: var(--space-2);
  transition: opacity var(--dur-2) var(--ease-out);
}
.vault-results.htmx-request,
.htmx-request > .vault-results {
  opacity: 0.55;
}
.vault-shelves {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* A group header (Reminders / Passwords): chevron · squircle · bold name · count ··· actions —
   no hairline, the cards' grouped background separates the groups. */
.vault-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  margin-bottom: var(--space-2);
}
.vault-group-head__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 4px;
  font-size: var(--type-title3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
.vault-group-head__icon {
  flex-shrink: 0;
  color: var(--text-3);
}
.icon-tile .vault-group-head__icon {
  color: inherit;
}
.vault-group-head__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-group-head__count {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.vault-shelf {
  min-width: 0;
}
.vault--large .vault-shelf {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}
.vault-shelf.sortable-ghost {
  opacity: 0.4;
}
.vault-shelf__toggle {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--type-title3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
}
.vault-shelf__toggle:hover {
  background: var(--fill-1);
}
.vault-shelf__toggle:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
}
.vault-shelf__chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: rotate var(--dur-2) var(--ease-out);
}
.vault-shelf__toggle[aria-expanded="false"] .vault-shelf__chevron {
  rotate: -90deg;
}
.vault-shelf.is-collapsed .vault-group-head {
  margin-bottom: 0;
}
.vault-shelf__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.vault-shelf__grip {
  display: none;
  position: absolute;
  top: 11px;
  left: -20px;
  color: var(--text-3);
  cursor: grab;
}
@media (hover: hover) and (pointer: fine) {
  .vault-shelf__grip {
    display: inline-grid;
    opacity: 0;
    transition: opacity var(--dur-1);
  }
  .vault-group-head:hover .vault-shelf__grip {
    opacity: 1;
  }
  .vault-shelf__actions .btn {
    opacity: 0;
    transition: opacity var(--dur-1);
  }
  .vault-group-head:hover .vault-shelf__actions .btn,
  .vault-shelf__actions .btn:focus-visible,
  .vault-shelf__actions .btn[aria-expanded="true"] {
    opacity: 1;
  }
}
/* grid-template-rows 1fr ↔ 0fr collapse */
.vault-shelf__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur-3) var(--ease-out);
}
.vault-shelf.is-collapsed .vault-shelf__body {
  grid-template-rows: 0fr;
}
.vault-shelf__inner {
  min-width: 0;
  min-height: 0;
}
.vault-shelf.is-collapsed .vault-shelf__inner,
.vault-shelf.is-animating .vault-shelf__inner {
  overflow: clip;
  overflow-clip-margin: 0;
}
.vault-shelf.is-collapsed .vault-shelf__inner {
  visibility: hidden;
  transition: visibility 0s linear var(--dur-3);
}
.vault-shelf__more {
  display: flex;
  justify-content: center;
}
.vault-shelf__more:has(.btn) {
  margin-top: var(--space-2);
}
/* An empty shelf: one quiet (dashed, for editors) line; the empty grid above it stays a drop target. */
.vault-shelf__empty .empty-inline {
  min-height: 44px;
}
.vault-grid:not(:has(> .vcard)) {
  position: relative;
  z-index: 1;
  min-height: 44px;
  margin-bottom: -44px;
}

/* Card grid. Row-major; vault.js turns it into masonry (4px rows + measured spans, .is-masonry) —
   reading order and drag & drop stay left-to-right. Native masonry where shipped. */
.vault-grid {
  --col: 280px;
  --gap: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--col), 100%), 1fr));
  align-items: start;
  gap: var(--gap);
}
.vault-grid.is-masonry {
  grid-auto-rows: 4px;
  row-gap: 0;
}
.vault-grid.is-masonry > .vcard {
  margin-bottom: var(--gap);
}
@supports (grid-template-rows: masonry) {
  .vault-grid,
  .vault-grid.is-masonry {
    grid-template-rows: masonry;
    grid-auto-rows: auto;
    row-gap: var(--gap);
  }
  .vault-grid.is-masonry > .vcard {
    margin-bottom: 0;
  }
}
@media (min-width: 1536px) {
  .vault-grid {
    --col: 300px;
  }
}

/* Pinned: the same cards, one row of equal heights; a swipeable rail on phones. */
.vault-showcase {
  min-width: 0;
}
.vault-showcase .vault-group-head {
  padding-left: 4px;
}
.vault-showcase__rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
}
.vault-showcase__rail > .vcard {
  display: flex;
  flex-direction: column;
}
.vault-showcase__rail > .vcard > .vcard__body {
  flex: 1;
}
@media (max-width: 639px) {
  .vault-showcase__rail {
    grid-template-columns: none;
    grid-auto-columns: 86%;
    grid-auto-flow: column;
    margin-inline: calc(var(--page-pad-x, 16px) * -1);
    padding: 1px var(--page-pad-x, 16px) 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--page-pad-x, 16px);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .vault-showcase__rail::-webkit-scrollbar {
    display: none;
  }
  .vault-showcase__rail > .vcard {
    scroll-snap-align: start;
  }
}

/* ==================================================================================================
   4. The card
   ================================================================================================== */
.vcard {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.vcard__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px 14px 12px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-sm),
    inset 0 0.5px 0 var(--card-highlight);
  transition:
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-snappy) var(--spring-snappy);
}
@media (hover: hover) {
  .vcard:hover .vcard__body {
    box-shadow:
      0 0 0 0.5px var(--card-ring),
      var(--shadow-md),
      inset 0 0.5px 0 var(--card-highlight);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .vcard:has(.vcard__link:active) .vcard__body {
    transform: scale(0.985);
  }
}
.vault--large .vcard {
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}

/* Whole-card link (stretched over the card; tools and copy buttons sit above it) */
.vcard__link {
  color: inherit;
  text-decoration: none;
  outline: none;
}
.vcard__link::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: var(--radius-panel);
}
.vcard__link:focus-visible::after {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.vcard :is(button, a:not(.vcard__link), input, label, [data-vault-secret]) {
  position: relative;
  z-index: 2;
}

.vcard__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.vcard__icon {
  --size: 36px;
}
.vcard__titles {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.vcard__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: calc(0.9375rem * var(--text-scale)); /* 15 */
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.vcard__kind {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vcard__tools {
  display: flex;
  flex-shrink: 0;
  align-self: flex-start;
  align-items: center;
  gap: 2px;
  margin: -4px -6px 0 0;
}
.vcard__pin {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--text-3);
}
.vcard__pin .icon {
  fill: currentColor;
}
.vcard__select {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .vcard__select:not(:has(:checked)) {
    opacity: 0;
    transition: opacity var(--dur-1);
  }
  .vcard:hover .vcard__select,
  .vcard__select:focus-within,
  .vault.is-selecting .vcard__select {
    opacity: 1;
  }
}

.vcard__note {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.vcard__note--big {
  -webkit-line-clamp: 7;
}
.vcard__note.is-empty {
  color: var(--text-3);
}
.vcard__host {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.vcard__host:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.vcard__host > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vcard__host .vmid {
  flex: 1 1 auto;
}

/* Responsible person (responsibility cards, dialog side panel) */
.vperson {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 32px;
}
.vperson__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vperson__name {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vperson__role {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.vperson--empty .vperson__name {
  color: var(--text-3);
  font-weight: var(--fw-regular);
}
.vperson__action {
  margin-left: auto;
}

/* Foot: who / when on the left, the date signals on the right */
.vcard__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 20px;
  margin-top: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.vcard__people {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.vcard__people-name {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vcard__updated {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vcard__badges {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  margin-left: auto;
}

/* ==================================================================================================
   5. Fields, small icon buttons, secrets, TOTP, middle ellipsis
   ================================================================================================== */
/* Label / value rows on a card face: one label column for the card (subgrid), mono values. */
.vcard__fields {
  display: grid;
  grid-template-columns: fit-content(44%) minmax(0, 1fr) auto;
  column-gap: 12px;
  margin: 0;
}
.vfield {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  min-height: 24px;
  font-size: var(--fs-sm);
}
.vfield__label {
  overflow: hidden;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfield__value {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfield__value--mono,
.vrow__value--mono {
  font-family: var(--vc-mono);
  font-size: 12.5px;
  letter-spacing: -0.01em;
}
.vfield__value a,
.vrow__value a {
  color: var(--accent-ink);
  text-decoration: none;
}
.vfield__value a:hover,
.vrow__value a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.vfield__value:has(> .vmid),
.vfield__value:has(> a > .vmid) {
  display: flex;
}
.vfield__value > a:has(> .vmid) {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
}
.vfield__copy {
  --s: 24px;
  margin-right: -2px;
}

/* Small round icon button inside cards and dialog rows (copy, reveal, edit) — r4: a circle; in
   secret rows a glass bead (sheen + rim over a faint fill). ⧉ → ✓ turns it green for 1.2 s. */
.vbtn {
  --s: 28px;
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--s);
  height: var(--s);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease,
    opacity var(--dur-1) ease,
    transform var(--dur-snappy) var(--spring-snappy);
}
@media (pointer: coarse) {
  .vbtn {
    --s: 34px;
  }
  .vcard .vsecret .vbtn {
    --s: 32px;
  }
}
.vbtn:active:not([disabled]) {
  transform: scale(0.9);
}
.vsecret .vbtn {
  background: var(--glass-sheen), var(--fill-1);
  box-shadow:
    var(--glass-rim),
    0 0 0 0.5px var(--glass-border);
  color: var(--text-2);
}
.vsecret .vbtn:hover {
  background: var(--glass-sheen), var(--fill-2);
  color: var(--text);
}
.vsecret .vbtn[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent-ink);
}
.vbtn.is-done,
.vsecret .vbtn.is-done {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  box-shadow: none;
}
.vbtn:hover {
  background: var(--fill-1);
  color: var(--text);
}
.vbtn:active {
  background: var(--fill-2);
}
.vbtn:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 0;
}
.vbtn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.vbtn .icon {
  width: 14px;
  height: 14px;
}
.vbtn[aria-pressed="true"] {
  color: var(--text);
}
/* ⧉ → ✓ */
.vbtn__a,
.vbtn__b {
  grid-area: 1 / 1;
  display: inline-grid;
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}
.vbtn__b {
  color: var(--success-ink);
  opacity: 0;
  transform: scale(0.6);
}
.vbtn.is-done .vbtn__a {
  opacity: 0;
  transform: scale(0.6);
}
.vbtn.is-done .vbtn__b {
  opacity: 1;
  transform: none;
}
/* Copy buttons stay quiet until the row is hovered or focused (always there on touch). */
@media (hover: hover) and (pointer: fine) {
  .vfield .vfield__copy {
    opacity: 0;
  }
  .vfield:hover .vfield__copy,
  .vfield__copy:focus-visible,
  .vfield__copy.is-done {
    opacity: 1;
  }
}

/* -- Secrets ---------------------------------------------------------------------------------------
   Masked: one line — lock · label ········ •••••• 👁 ⧉. Revealed (or a TOTP code / a key block):
   the value gets its own line under the label. The label never gets squeezed by the mask. */
.vcard__secrets {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 0.5px solid var(--line);
}
.vsecret {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto auto auto;
  grid-template-areas: "lock label value timer reveal copy";
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  min-height: 34px;
  font-size: var(--fs-sm);
}
.vsecret__lock {
  grid-area: lock;
  flex-shrink: 0;
  color: var(--text-3);
}
.vsecret__label {
  display: -webkit-box;
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.vsecret__value {
  position: relative;
  grid-area: value;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 26px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--vc-mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.vsecret__dots {
  color: var(--text-3);
  letter-spacing: 0.08em;
}
.vsecret__timer {
  grid-area: timer;
}
.vsecret [data-vault-reveal] {
  grid-area: reveal;
}
.vsecret [data-vault-copy] {
  grid-area: copy;
}
.vsecret--denied .vsecret__value,
.vsecret__value--empty {
  grid-column: value-start / copy-end;
  justify-content: flex-end;
  color: var(--text-3);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
}
.vsecret.is-revealed,
.vsecret.is-multiline {
  grid-template-areas:
    "lock label label timer reveal copy"
    "value value value value value value";
}
.vsecret.is-revealed .vsecret__value {
  padding: 0 0 4px 20px;
}
.vsecret__value.is-revealed {
  display: block;
  overflow-x: auto;
  line-height: 26px;
  scrollbar-width: none;
  user-select: all;
}
.vsecret__value.is-revealed::-webkit-scrollbar {
  display: none;
}
.vcard__more-secrets {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
/* reveal: each dot dissolves into its character (blur → sharp, staggered) */
.vsecret__ch {
  display: inline-block;
  white-space: pre;
}
@media (prefers-reduced-motion: no-preference) {
  .vsecret__value.is-revealing .vsecret__ch {
    animation: vault-dissolve-in 240ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 12ms);
  }
  .vsecret__value.is-masking .vsecret__ch {
    animation: vault-dissolve-out 180ms var(--ease-in-out) both;
    animation-delay: calc(var(--r, 0) * 10ms);
  }
}
@keyframes vault-dissolve-in {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}
@keyframes vault-dissolve-out {
  to {
    opacity: 0;
    filter: blur(4px);
  }
}
/* Multi-line values (SSH keys, certificates, recovery codes, long tokens): a wrapped block. */
.vsecret__value.is-block {
  display: block;
  min-height: 0;
  max-height: 10.5em;
  margin: 4px 0 6px;
  padding: 8px 10px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  box-shadow: inset 0 0 0 0.5px var(--line-subtle);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  user-select: text;
}
.vsecret.is-revealed .vsecret__value.is-block {
  padding-left: 10px;
}
.vsecret__block {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .vsecret__value.is-block.is-revealing .vsecret__block {
    animation: vault-dissolve-in 280ms var(--ease-out) both;
  }
  .vsecret__value.is-block.is-masking .vsecret__block {
    animation: vault-dissolve-out 180ms var(--ease-in-out) both;
  }
}
/* 30-second countdown ring while a value is shown */
.vsecret__timer {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  rotate: -90deg;
}
.vsecret__timer[hidden] {
  display: none;
}
.vsecret__timer circle {
  fill: none;
  stroke-width: 3;
}
.vsecret__timer .track {
  stroke: var(--fill-2);
}
.vsecret__timer .bar {
  stroke: var(--text-3);
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  stroke-linecap: round;
}
.vsecret.is-revealed .vsecret__timer .bar {
  animation: vault-countdown var(--reveal-ms, 30000ms) linear forwards;
}
@keyframes vault-countdown {
  to {
    stroke-dashoffset: 100;
  }
}

/* TOTP: ring + rolling digits */
.vtotp {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* r4: 6 mono digits (20 px) then a small 16 px countdown ring (Passwords). */
.vtotp__ring {
  --p: 1;
  position: relative;
  flex-shrink: 0;
  order: 1;
  width: 16px;
  height: 16px;
}
.vtotp__ring svg {
  width: 100%;
  height: 100%;
  rotate: -90deg;
}
.vtotp__ring circle {
  fill: none;
  stroke-width: 4;
}
.vtotp__ring .track {
  stroke: var(--fill-2);
}
.vtotp__ring .bar {
  stroke: var(--accent);
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p) * 100);
  stroke-linecap: round;
  transition:
    stroke-dashoffset 1s linear,
    stroke var(--dur-3);
}
.vtotp.is-ending .vtotp__ring .bar {
  stroke: var(--danger);
}
.vtotp__secs {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.vtotp.is-ending .vtotp__secs {
  color: var(--danger-ink);
}
.vtotp__code {
  display: inline-flex;
  gap: 1px;
  color: var(--text);
  font-family: var(--vc-mono);
  font-size: 20px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.vtotp__code .gap {
  width: 8px;
}
.vtotp__digit {
  position: relative;
  display: inline-block;
  height: 1.25em;
  overflow: hidden;
  line-height: 1.25em;
}
.vtotp__digit > span {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .vtotp__digit.is-rolling > span {
    animation: vault-roll 380ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 30ms);
  }
}
@keyframes vault-roll {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Middle ellipsis for long hosts / e-mails / URLs: the head shrinks with "…", the distinctive tail
   (domain, TLD) always stays — "analytics-01.eu-ce…birbit.kg". vault.js trims the head exactly. */
.vmid {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  vertical-align: bottom;
}
.vmid__head {
  flex: 0 1 auto;
  min-width: 2ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vmid__tail {
  flex: 0 0 auto;
  white-space: nowrap;
}
.vmid.is-fit .vmid__head {
  text-overflow: clip;
}

/* ==================================================================================================
   6. Badges — capsule chips, neutral by default; dates that run out are tinted chips
      (warning: ≤ 30 days, warm tint "⏳ 4 days left" · urgent: ≤ 7 days, stronger tint ·
      danger: expired / today, red tint — the one loud signal on a card)
   ================================================================================================== */
.vbadge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vbadge .icon {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}
.vbadge--icon {
  justify-content: center;
  width: 22px;
  padding: 0;
  background: transparent;
  color: var(--text-3);
}
.vbadge[data-tone="warning"] {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning-ink);
}
.vbadge[data-tone="urgent"] {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--warning-ink);
  font-weight: var(--fw-semibold);
}
.vbadge[data-tone="danger"] {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger-ink);
  font-weight: var(--fw-semibold);
}

/* ==================================================================================================
   7. Card states — selected, open, archived, drag, flash, phone swipe
   ================================================================================================== */
.vcard.is-selected .vcard__body,
.vcard.is-active .vcard__body {
  box-shadow:
    0 0 0 1.5px var(--accent),
    var(--shadow-sm);
}
.vcard.is-archived .vcard__body {
  background: var(--surface-2);
}
.vcard.is-archived :is(.vcard__title, .vfield__value, .vcard__note) {
  color: var(--text-2);
}
.vcard.sortable-ghost .vcard__body {
  opacity: 0.4;
  box-shadow: 0 0 0 1px var(--accent);
}
.vcard.sortable-drag .vcard__body {
  box-shadow:
    0 0 0 0.5px var(--line-strong),
    var(--shadow-lg);
  transform: rotate(-1.5deg);
}
.vcard.is-flash .vcard__body {
  animation: vault-flash 1.2s var(--ease-out);
}
@keyframes vault-flash {
  0%,
  40% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent),
      var(--shadow-sm);
  }
}

/* Phone swipe: slide a card left to reveal Copy / Open behind it */
.vcard__swipe {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-panel);
  background: var(--surface-sunken);
}
@media (pointer: coarse) {
  .vcard__swipe {
    display: flex;
  }
  .vcard.is-swiping .vcard__body,
  .vcard.is-swiped .vcard__body {
    transform: translateX(var(--swipe-x, 0px));
  }
  .vcard.is-swiping .vcard__body {
    transition: none;
  }
  .vcard:not(.is-swiping, .is-swiped) .vcard__swipe {
    visibility: hidden;
  }
}
.vcard__swipe-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--text-on-accent);
  font: inherit;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
}
.vcard__swipe-btn--copy {
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--line);
  color: var(--text);
}

/* ==================================================================================================
   8. List view
   ================================================================================================== */
.vault-list {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs),
    inset 0 0.5px 0 var(--card-highlight);
}
.vault-list__scroll {
  overflow-x: auto;
}
.vault-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.vault-list th {
  height: 32px;
  padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: left;
  white-space: nowrap;
}
.vault-list td {
  height: var(--row-h-list, 40px);
  padding: 4px 12px;
  border-bottom: 0.5px solid var(--line-subtle);
  vertical-align: middle;
}
.vault-list tbody tr {
  transition: background-color var(--dur-1);
}
.vault-list tbody tr[data-card-id] {
  content-visibility: auto;
  contain-intrinsic-size: auto 40px;
}
.vault-list tbody tr[data-card-id]:hover {
  background: var(--fill-1);
}
.vault-list tbody tr.is-selected {
  background: var(--accent-softer);
}
.vault-list tbody:last-child tr:last-child td {
  border-bottom: 0;
}
.vault-list__group td {
  height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--line-subtle);
}
.vault-list tbody + tbody .vault-list__group td {
  border-top: 0.5px solid var(--line);
}
.vault-list__group-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.vault-list__more td {
  height: 36px;
  text-align: center;
}
.vault-list__check {
  width: 36px;
  padding-right: 0 !important;
}
.vault-list__title-cell {
  width: 100%;
  max-width: 0;
}
.vault-list__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.vault-list__name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.vault-list__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.vault-list__line a {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-weight: var(--fw-medium);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-list__line a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.vault-list__line .vcard__pin {
  width: auto;
  height: auto;
}
.vault-list__meta {
  display: none;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-list__meta .is-mono {
  font-family: var(--vc-mono);
}
.vault-list td:not(.vault-list__title-cell):not(.vault-list__check) {
  white-space: nowrap;
}
.vault-list__kind {
  color: var(--text-2);
}
.vault-list__primary {
  max-width: min(260px, 22vw);
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-list__primary:has(> .vmid) {
  display: flex;
}
.vault-list__primary.is-mono {
  font-family: var(--vc-mono);
  font-size: 12.5px;
}
.vault-list__updated {
  color: var(--text-3);
  font-size: var(--fs-sm);
}
@media (max-width: 1199px) {
  .vault-list .hide-compact {
    display: none;
  }
}
@media (max-width: 767px) {
  .vault-list .hide-narrow,
  .vault-list__updated,
  .vault-list__updated-head {
    display: none;
  }
  .vault-list__meta {
    display: block;
  }
  .vault-list td {
    height: 52px;
  }
}

/* ==================================================================================================
   9. Bulk bar (same glass pill as the task list's bulk bar)
   ================================================================================================== */
.vault-bulk {
  position: fixed;
  z-index: var(--z-sticky);
  bottom: max(24px, calc(var(--safe-bottom, 0px) + 12px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-full);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-xl);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  translate: -50% 0;
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}
.vault-bulk[hidden] {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  visibility: hidden;
}
:root:has(.app.has-tabbar) .vault-bulk {
  bottom: calc(var(--tabbar-h, 64px) + var(--safe-bottom, 0px) + 16px);
}
.vault-bulk__count {
  margin-right: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vault-bulk__sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--line);
}

/* ==================================================================================================
   10. Empty board (small open safe + templates), no results
   ================================================================================================== */
.vault-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-4);
  text-align: center;
}
.vault-empty__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.vault-empty__title {
  font-size: var(--fs-title-3);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
.vault-empty__text {
  max-width: 520px;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.5;
}
.vault-empty__note {
  color: var(--text-2);
  font-size: var(--fs-md);
}
.vault-empty__templates {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: min(100%, 980px);
  margin-top: var(--space-4);
}
.vault-empty__subtitle {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: left;
}
.vault-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  text-align: left;
}
.vault-templates form {
  display: flex;
}
.vault-template {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow var(--dur-2) var(--ease-out);
}
.vault-template:hover {
  box-shadow:
    0 0 0 0.5px var(--line-strong),
    var(--shadow-sm);
}
.vault-template:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.vault-template__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vault-template__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}
.vault-template__text {
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.vault-template__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.vault-template__chip {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 0.5px var(--line);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
}
.vault-noresults {
  min-width: 0;
}

/* The open safe — neutral metal, three floating cards (one soft glyph each). */
.vault-safe {
  --u: clamp(0.56px, 0.2vw + 0.36px, 0.66px);
  position: relative;
  width: calc(300 * var(--u));
  height: calc(250 * var(--u));
  perspective: calc(1100 * var(--u));
}
.vault-safe__scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-8deg) rotateY(-16deg);
}
.vault-safe__floor {
  position: absolute;
  bottom: calc(6 * var(--u));
  left: 50%;
  width: calc(240 * var(--u));
  height: calc(30 * var(--u));
  border-radius: 50%;
  background: radial-gradient(closest-side, light-dark(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.5)), transparent);
  translate: -50% 0;
}
.vault-safe__box {
  position: absolute;
  bottom: calc(26 * var(--u));
  left: calc(70 * var(--u));
  width: calc(150 * var(--u));
  height: calc(140 * var(--u));
  border-radius: calc(16 * var(--u));
  background: linear-gradient(160deg, var(--surface-2), var(--surface-sunken));
  box-shadow:
    0 0 0 0.5px var(--line),
    0 calc(16 * var(--u)) calc(30 * var(--u)) calc(-14 * var(--u)) light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.6));
  transform-style: preserve-3d;
}
.vault-safe__inside {
  position: absolute;
  inset: calc(12 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 0 calc(14 * var(--u));
  border-radius: calc(9 * var(--u));
  background: var(--surface-sunken);
  box-shadow: inset 0 calc(4 * var(--u)) calc(10 * var(--u)) light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.5));
}
.vault-safe__inside span {
  height: calc(3 * var(--u));
  border-radius: 2px;
  background: var(--line-strong);
}
.vault-safe__door {
  position: absolute;
  inset: 0;
  border-radius: calc(16 * var(--u));
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  box-shadow:
    0 0 0 0.5px var(--line),
    calc(-8 * var(--u)) calc(10 * var(--u)) calc(22 * var(--u)) calc(-10 * var(--u)) light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.6));
  transform: rotateY(-118deg);
  transform-origin: left center;
  backface-visibility: visible;
}
.vault-safe__dial {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(50 * var(--u));
  height: calc(50 * var(--u));
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 calc(5 * var(--u)) var(--fill-2),
    0 0 0 0.5px var(--line);
  translate: -50% -50%;
}
.vault-safe__dial::after {
  content: "";
  position: absolute;
  top: calc(8 * var(--u));
  left: 50%;
  width: calc(3 * var(--u));
  height: calc(11 * var(--u));
  border-radius: 2px;
  background: var(--text-3);
  translate: -50% 0;
}
.vault-safe__card {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: calc(7 * var(--u));
  width: calc(108 * var(--u));
  height: calc(68 * var(--u));
  padding: calc(10 * var(--u));
  border-radius: calc(10 * var(--u));
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    0 calc(10 * var(--u)) calc(20 * var(--u)) calc(-8 * var(--u)) light-dark(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.6));
  color: var(--tone-ink);
}
.vault-safe__card i {
  display: block;
  height: calc(5 * var(--u));
  border-radius: 3px;
  background: var(--fill-2);
}
.vault-safe__card i:first-of-type {
  width: 72%;
  background: var(--line-strong);
}
.vault-safe__card i:last-of-type {
  width: 46%;
}
.vault-safe__card .icon {
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
}
.vault-safe__card--1 {
  top: calc(20 * var(--u));
  left: calc(12 * var(--u));
  transform: translateZ(calc(70 * var(--u))) rotate(-10deg);
}
.vault-safe__card--2 {
  top: 0;
  left: calc(110 * var(--u));
  transform: translateZ(calc(90 * var(--u))) rotate(4deg);
}
.vault-safe__card--3 {
  top: calc(34 * var(--u));
  right: calc(2 * var(--u));
  transform: translateZ(calc(60 * var(--u))) rotate(12deg);
}
@media (prefers-reduced-motion: no-preference) {
  .vault-safe__card {
    animation: vault-float 5s var(--ease-in-out) infinite;
  }
  .vault-safe__card--2 {
    animation-delay: -1.6s;
  }
  .vault-safe__card--3 {
    animation-delay: -3.2s;
  }
}
@keyframes vault-float {
  50% {
    translate: 0 calc(-7 * var(--u));
  }
}

/* ==================================================================================================
   11. Card dialog — header (glyph · kind/section/board · title · signals · actions), then a
       two-column body: the content, and a side panel (who can see secrets · about) on a quieter
       surface. A full-height sheet on phones.
   ================================================================================================== */
.modal.vault-modal {
  --modal-w: 960px;
  max-height: min(88dvh, 900px);
  overflow: hidden;
}
.modal.vault-modal--form {
  --modal-w: 680px;
}
.vault-modal .modal__panel {
  border-radius: inherit;
}
@media (max-width: 639px) {
  .modal.vault-modal {
    height: calc(100dvh - var(--safe-top) - 12px);
    max-height: none;
  }
  .modal.vault-modal--form {
    height: auto;
    max-height: calc(100dvh - var(--safe-top) - 12px);
  }
}
.vault-modal:not(.vault-modal--form) .modal__header {
  display: none;
}
.vault-modal:not(.vault-modal--form) .modal__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.vault-modal:not(.vault-modal--form) .modal__panel {
  height: 100%;
}
.vault-modal--form .modal__body {
  padding-top: 4px;
}

.vdetail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.vdetail__hero {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 16px;
  padding: 20px 14px 18px 24px;
  border-bottom: 0.5px solid var(--line);
}
.vdetail__glyph {
  align-self: flex-start;
}
.vdetail__hero-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.vdetail__kind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.vdetail__kind .sep {
  color: var(--text-3);
}
.vdetail__kind a {
  color: var(--text-2);
  text-decoration: none;
}
.vdetail__kind a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.vdetail__title {
  font-size: var(--fs-title-2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.vdetail__title:focus {
  outline: none;
}
.vdetail__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.vdetail__actions {
  display: flex;
  flex-shrink: 0;
  align-self: flex-start;
  align-items: center;
  gap: 2px;
}
.vdetail__pin.is-on .icon {
  fill: currentColor;
}
.vdetail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.vdetail__grid {
  display: grid;
  min-height: 100%;
}
.vdetail__main,
.vdetail__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vdetail__main {
  gap: var(--space-6);
  padding: 20px 24px 28px;
  background: var(--bg);
}
.vdetail__side {
  gap: 0;
  padding: 4px 20px 24px;
  border-top: 0.5px solid var(--line);
  background: var(--surface);
}
@media (min-width: 820px) {
  .vdetail__grid {
    grid-template-columns: minmax(0, 1fr) 296px;
  }
  .vdetail__side {
    padding-top: 8px;
    border-top: 0;
    border-left: 0.5px solid var(--line);
  }
}
@media (max-width: 639px) {
  /* Phones: glyph + actions on the first line, the words get the full width under them. */
  .vdetail__hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    padding: 20px 8px 14px 16px;
  }
  .vdetail__glyph {
    margin-top: 0;
  }
  .vdetail__actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .vdetail__hero-text {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-right: 8px;
  }
  .vdetail__main {
    padding: 16px 16px 24px;
  }
  .vdetail__side {
    padding-inline: 16px;
  }
}

/* Panels: a small heading over a hairline card (main column) or flat rows (side panel). */
.vpanel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.vpanel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding-inline: 4px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.vpanel__head .spacer {
  flex: 1;
}
.vpanel__head .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vpanel__lock[hidden] {
  display: none;
}
.vdetail__main .vpanel__body {
  min-width: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs),
    inset 0 0.5px 0 var(--card-highlight);
}
.vpanel__empty {
  padding: 10px 12px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.vdetail__side .vpanel {
  padding: 14px 0;
}
.vdetail__side .vpanel + .vpanel {
  border-top: 0.5px solid var(--line);
}
.vdetail__side .vpanel__empty {
  padding: 0;
}

/* Field rows (in-place editable): label · value · tools */
.vrow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(96px, 32%) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
  padding: 4px 8px 4px 16px;
}
/* inset hairline separators, like .form-row */
.vrow + .vrow::before,
.vpanel--secrets .vsecret + .vsecret::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  height: 0.5px;
  background: var(--line);
  pointer-events: none;
}
.vpanel__body > .vrow:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.vpanel__body > .vrow:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
@media (hover: hover) {
  .vpanel__body > .vrow:hover {
    background: var(--fill-1);
  }
}
@media (max-width: 479px) {
  .vrow {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 8px;
  }
  .vrow__label {
    grid-column: 1 / -1;
    padding-top: 4px;
  }
}
.vrow__label {
  min-width: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
.vrow__value {
  min-width: 0;
  font-size: var(--fs-md);
  overflow-wrap: anywhere;
}
.vrow__value.is-empty {
  color: var(--text-3);
}
.vrow__tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .vrow__tools .vbtn {
    opacity: 0;
  }
  .vrow:hover .vrow__tools .vbtn,
  .vrow__tools .vbtn:focus-visible,
  .vrow__tools .vbtn.is-done {
    opacity: 1;
  }
}
.vrow__edit {
  display: flex;
  grid-column: 2 / -1;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
@media (max-width: 479px) {
  .vrow__edit {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }
}
.vrow__edit .input {
  flex: 1;
  min-width: 0;
}
.vrow__edit[hidden],
.vrow__view[hidden],
.vrow__tools[hidden] {
  display: none;
}
.vrow__error {
  grid-column: 2 / -1;
  padding-bottom: 4px;
  color: var(--danger-ink);
  font-size: var(--fs-xs);
}
.vault-modal .input--mono,
.vrow__edit .input--mono {
  font-family: var(--vc-mono);
}
/* "✓ saved" */
.vrow__saved {
  position: absolute;
  top: 50%;
  right: 40px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: var(--text-on-accent);
  opacity: 0;
  pointer-events: none;
  translate: 0 -50%;
}
.vrow__saved .icon {
  width: 11px;
  height: 11px;
  --icon-stroke: 3;
}
.vrow.is-saved .vrow__saved {
  animation: vault-saved 1.4s var(--ease-out) both;
}
.vrow.is-saved {
  animation: vault-saved-row 1.4s var(--ease-out);
}
@keyframes vault-saved {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  20%,
  80% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}
@keyframes vault-saved-row {
  0%,
  30% {
    background: color-mix(in srgb, var(--success) 9%, transparent);
  }
}
/* Title (rename in place) and notes rows */
.vrow--title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  margin-left: -8px;
  padding: 2px 4px 2px 8px;
  border-radius: var(--radius-sm);
}
.vrow--title .vrow__edit {
  flex: 1;
}
.vrow--title .vrow__saved {
  right: 4px;
}
@media (hover: hover) {
  .vrow--title:hover {
    background: var(--fill-1);
  }
}
.vrow--notes {
  display: block;
  padding: 0;
}
.vrow--notes .vpanel__head {
  margin-bottom: 8px;
}
.vrow--notes .vrow__tools .vbtn {
  opacity: 1;
}
.vrow--notes .vrow__saved {
  top: 12px;
  right: 34px;
}
.vrow--notes .vrow__edit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.vrow--notes .vrow__edit[hidden] {
  display: none;
}
.vnotes.prose {
  font-size: var(--fs-md);
}
.vnotes__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.vrow--notes .vpanel__empty {
  padding: 0;
}

/* Secrets panel */
.vpanel--secrets .vsecret {
  position: relative;
  grid-template-columns: 14px minmax(0, 1fr) auto auto auto auto;
  column-gap: 8px;
  min-height: 48px;
  padding: 6px 10px 6px 16px;
  font-size: var(--fs-md);
}
.vpanel--secrets .vsecret__label {
  color: var(--text);
}
.vpanel--secrets .vsecret__value {
  font-size: 13px;
}
@media (min-width: 560px) {
  .vpanel--secrets .vsecret {
    grid-template-columns: 14px minmax(110px, 32%) minmax(0, 1fr) auto auto auto;
    column-gap: 10px;
  }
  .vpanel--secrets .vsecret.is-revealed:not(.is-multiline) {
    grid-template-areas: "lock label value timer reveal copy";
  }
  .vpanel--secrets .vsecret.is-revealed:not(.is-multiline) .vsecret__value {
    padding: 0;
  }
  .vpanel--secrets .vsecret__label {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .vpanel--secrets .vsecret--denied .vsecret__value,
  .vpanel--secrets .vsecret__value--empty {
    justify-content: flex-start;
  }
}
/* Neutral callouts: unlock, vault locked, request access, a file row's glyph */
.vault-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 0.5px var(--line-subtle);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.vault-callout__icon {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--line);
  color: var(--text-2);
}
.vault-callout__icon--success {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  box-shadow: none;
  color: var(--success-ink);
}
.vault-locked__text,
.vrequest__text {
  flex: 1 1 200px;
  min-width: 0;
}
.vault-locked__title,
.vrequest__text strong {
  display: block;
  color: var(--text);
  font-weight: var(--fw-semibold);
}
@media (max-width: 479px) {
  .vault-callout > .btn {
    width: 100%;
    justify-content: center;
  }
}
.vdetail__side .vault-callout,
.vdetail__side .vrequest {
  margin: 8px 0 0;
}
/* An access request (side panel): avatar · who · Decline / Allow */
.vrequest--decide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--line);
  font-size: var(--fs-sm);
}
.vrequest--decide .vrequest__text {
  color: var(--text-2);
}

/* People (side panel) */
.vpeople {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* About — label column sized to its words (max 45 %), values wrap, dates never overflow */
.vmeta {
  display: grid;
  grid-template-columns: fit-content(45%) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: var(--fs-sm);
}
.vmeta dt {
  min-width: 0;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.vmeta dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.vmeta dd > * {
  max-width: 100%;
}
.vmeta__by {
  color: var(--text-3);
}

/* History / Access log tabs: text tabs with an underline, like the view tabs */
.vtabs {
  display: flex;
  gap: 16px;
  border-bottom: 0.5px solid var(--line);
}
.vtabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.vtabs__tab:hover {
  color: var(--text);
}
.vtabs__tab[aria-selected="true"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.vtabs__tab:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.vault-skeleton {
  padding: 12px 0;
}
.vtimeline {
  display: flex;
  flex-direction: column;
  padding: 10px 0 0;
}
.vtimeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}
.vtimeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 2px;
  left: 11.5px;
  width: 1px;
  background: var(--line);
}
.vtimeline__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--line);
  color: var(--text-3);
}
.vtimeline__icon[data-color="red"] {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  box-shadow: none;
  color: var(--danger-ink);
}
.vtimeline__icon .icon {
  width: 12px;
  height: 12px;
}
.vtimeline__text {
  padding-top: 3px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.vtimeline__text strong {
  color: var(--text);
  font-weight: var(--fw-medium);
}
.vtimeline__time {
  display: block;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.vtimeline__diff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.vtimeline__diff del {
  color: var(--text-3);
}
.vtimeline__diff ins {
  color: var(--text);
  text-decoration: none;
}

/* Files ("file" cards): glyph · name (+ size, who, when) · download · delete */
.vfile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 6px 6px 10px;
}
.vfile + .vfile {
  border-top: 0.5px solid var(--line-subtle);
}
.vfile__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.vfile__name {
  overflow: hidden;
  color: var(--text);
  font-weight: var(--fw-medium);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfile__name:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.vfile__meta {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vfile-upload {
  padding: 6px;
}
.vfile + .vfile-upload,
.vpanel__empty + .vfile-upload {
  border-top: 0.5px solid var(--line-subtle);
}
.vfile-upload__drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius-md);
  outline: 1px dashed var(--line-strong);
  outline-offset: -1px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.vfile-upload__drop:hover {
  background: var(--fill-1);
  color: var(--text);
}
.vfile-upload__drop:focus-within {
  outline: 2px solid var(--focus-outline);
}
.htmx-request .vfile-upload__drop,
.vfile-upload.htmx-request .vfile-upload__drop {
  opacity: 0.6;
  pointer-events: none;
}

/* Who can see secrets — a compact radio list (dialog side panel, editor, "Move to…") */
.vaccess-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
}
.vaccess-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.vaccess-option:hover {
  background: var(--fill-1);
}
.vaccess-option:has(.icon-tile) {
  align-items: center;
}
.vaccess-option input {
  flex-shrink: 0;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.vaccess-option:has(.icon-tile) input {
  margin-top: 0;
}
.vaccess-option__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: var(--fs-sm);
}
.vaccess-option__title {
  font-weight: var(--fw-medium);
}
.vaccess-option__hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.vdetail__side .vaccess-options {
  margin-inline: -8px;
}
.vaccess-people {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  margin-top: 10px;
  padding-top: 10px;
  overflow-y: auto;
  border-top: 0.5px solid var(--line-subtle);
}
.vaccess-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.vaccess-add .input {
  flex: 1;
  min-width: 0;
}

/* "Move to…" (sheet sm): search field + an inset grouped list — squircle · name · ✓ when chosen. */
.vmove__list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(50vh, 380px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
  overscroll-behavior: contain;
}
.vmove__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-h-list, 44px);
  padding: 6px 14px;
  font-size: var(--type-body);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.vmove__item + .vmove__item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 50px;
  height: 0.5px;
  background: var(--line);
}
.vmove__item:hover {
  background: var(--fill-1);
}
.vmove__item:active {
  background: var(--fill-2);
}
.vmove__item:has(.vmove__radio:focus-visible) {
  outline: 2px solid var(--focus-outline);
  outline-offset: -2px;
}
.vmove__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.vmove__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vmove__check {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-snappy) var(--spring-snappy);
  --icon-stroke: 2.6;
}
.vmove__item:has(.vmove__radio:checked) .vmove__check {
  opacity: 1;
  transform: none;
}
.vmove__item:has(.vmove__radio:checked) .vmove__name {
  font-weight: var(--fw-semibold);
}
.vmove__item[hidden] {
  display: none;
}
/* <fieldset class="segmented">: drop the fieldset's default groove border (core has no reset). */
.vmove fieldset.segmented {
  min-inline-size: 0;
  margin: 0;
  border: 0;
}
.vmove__none {
  padding: 12px 14px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}

/* ==================================================================================================
   12. Editor (create / edit a card): kind line, sections, secret inputs, generator, .env rows
   ================================================================================================== */
.veditor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.veditor__kind {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}
.veditor__kind .vault-glyph {
  --size: 44px;
}
.modal.vault-modal--section {
  --modal-w: 520px;
}
.veditor__section--row {
  padding-block: 12px;
}
.veditor__kind-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.veditor__kind-name {
  font-size: var(--type-title3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
.veditor__kind-hint {
  color: var(--text-3);
  font-size: var(--fs-sm);
}
/* r4: each part is an inset group (macOS System Settings form): a quiet filled panel, radius 16,
   its small heading inside. Secret inputs sit on white tiles inside it. */
.veditor__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 0.5px var(--line);
}
@media (max-width: 479px) {
  .veditor__section {
    padding: 12px;
  }
}
.veditor__section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.veditor__grid {
  display: grid;
  gap: 12px 14px;
}
@media (min-width: 560px) {
  .veditor__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .veditor__grid > .is-wide {
    grid-column: 1 / -1;
  }
}
.veditor__secret {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
}
.veditor__secret-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.veditor__secret-head .icon {
  color: var(--text-3);
}
.veditor__secret-head .badge {
  margin-left: auto;
}
.veditor__secret .input {
  font-family: var(--vc-mono);
}
.veditor__secret textarea.input {
  min-height: 72px;
}
.veditor__help {
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.45;
}
.vgen__actions {
  gap: 6px;
}
.vgen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.vgen__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: var(--fs-sm);
}
.vgen__row input[type="range"] {
  flex: 1 1 140px;
  accent-color: var(--accent);
}
.vgen__len {
  min-width: 2.5ch;
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
}
.vgen__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.vstrength {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
}
.vstrength__bar {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.vstrength__bar span {
  height: 4px;
  border-radius: 2px;
  background: var(--fill-2);
  transition: background-color var(--dur-2) var(--ease-out);
}
.vstrength[data-score="1"] .vstrength__bar span:nth-child(-n + 1) {
  background: var(--c-red);
}
.vstrength[data-score="2"] .vstrength__bar span:nth-child(-n + 2) {
  background: var(--c-orange);
}
.vstrength[data-score="3"] .vstrength__bar span:nth-child(-n + 3) {
  background: var(--c-yellow);
}
.vstrength[data-score="4"] .vstrength__bar span:nth-child(-n + 4) {
  background: var(--c-green);
}
.vstrength__label {
  min-width: 72px;
  color: var(--text-2);
  font-weight: var(--fw-medium);
  text-align: right;
}
.venv {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.venv__row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 6px;
}
@media (max-width: 479px) {
  .venv__row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .venv__row .venv__value {
    grid-column: 1 / 2;
    grid-row: 2;
  }
}
.venv__row .input {
  font-family: var(--vc-mono);
  font-size: 13px;
}
.venv__row.is-removed .input {
  opacity: 0.45;
  text-decoration: line-through;
}
.venv__add {
  align-self: flex-start;
}
.veditor .vaccess-options {
  margin: -4px -8px;
}

/* ==================================================================================================
   13. Sudo (re-authentication) — the lock opens on success, the dialog shakes on error
   ================================================================================================== */
.modal.vault-sudo {
  --modal-w: 400px;
  overflow: hidden;
}
.vault-sudo .modal__header {
  display: none;
}
.vault-sudo__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px 4px;
  text-align: center;
}
.vault-sudo__title {
  margin-top: 6px;
  font-size: var(--fs-title-3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
.vault-sudo__text {
  max-width: 320px;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.45;
}
.vault-sudo__field {
  width: 100%;
  margin-top: 6px;
  text-align: left;
}
.vault-sudo__error {
  min-height: 18px;
  color: var(--danger-ink);
  font-size: var(--fs-sm);
}
.vault-sudo.is-checking .vault-sudo__field .input {
  opacity: 0.7;
}
/* r4: a 64 px app-icon squircle (accent gradient, white lock); green when it opens. */
.vault-lock {
  --lock-tone: var(--accent);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--lock-tone) 78%, white) 0%, var(--lock-tone) 100%);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    inset 0 0 0 0.5px rgb(0 0 0 / 0.06),
    0 4px 12px color-mix(in srgb, var(--lock-tone) 30%, transparent);
  color: var(--text-on-accent);
}
.vault-lock svg {
  width: 32px;
  height: 32px;
  overflow: visible;
}
.vault-lock__shackle {
  transform-box: fill-box;
  transform-origin: 85% 100%;
  transition: transform var(--dur-4) var(--ease-spring);
}
.vault-sudo.is-unlocked .vault-lock {
  --lock-tone: var(--success);
}
.vault-sudo.is-unlocked .vault-lock__shackle {
  transform: translateY(-3px) rotateY(180deg);
}
@media (prefers-reduced-motion: no-preference) {
  .vault-sudo.is-unlocked .vault-lock {
    animation: vault-unlock-pop 500ms var(--ease-spring);
  }
  .vault-sudo.is-error .modal__panel {
    animation: vault-shake 400ms var(--ease-out);
  }
  .vault-sudo.is-checking .vault-lock {
    animation: vault-lock-think 1.1s var(--ease-in-out) infinite;
  }
}
@keyframes vault-unlock-pop {
  40% {
    transform: scale(1.08);
  }
}
@keyframes vault-shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }
  40%,
  60% {
    transform: translateX(6px);
  }
}
@keyframes vault-lock-think {
  50% {
    transform: scale(0.94);
  }
}
.vault-sudo .modal__footer {
  justify-content: stretch;
  border-top: 0;
  background: transparent;
}
@media (min-width: 640px) {
  .vault-sudo .modal__footer .btn {
    flex: 1;
  }
}

/* Clipboard countdown inside the "Copied" toast */
.vault-toast-progress {
  position: absolute;
  right: 14px;
  bottom: 6px;
  left: 14px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--fill-2);
}
.vault-toast-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--success);
  transform-origin: left;
  animation: vault-drain var(--ms, 30000ms) linear forwards;
}
@keyframes vault-drain {
  to {
    transform: scaleX(0);
  }
}

/* ==================================================================================================
   14. Overview widget "Responsibilities", team tabs, workspace vault log
   ================================================================================================== */
.vault-resp__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vault-resp__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-1);
}
.vault-resp__item:hover {
  background: var(--fill-1);
}
.vault-resp__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.vault-resp__area {
  overflow: hidden;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-resp__who {
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-resp__avatars {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}
.vault-resp__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.vault-resp__skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 var(--space-4);
  overflow-x: auto;
  border-bottom: 0.5px solid var(--line);
  scrollbar-width: none;
}
.team-tabs__tab {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
/* text-only tabs, like the project view tabs (the words are the affordance) */
.team-tabs__tab > .icon {
  display: none;
}
.team-tabs__tab:hover,
.team-tabs__tab[aria-current="page"] {
  color: var(--text);
}
.team-tabs__tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Filters in a toolbar row: "Person [Everyone ⌃]" · "Action […]" · "Period […]" · Apply */
.vault-log__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: var(--space-4);
}
.vault-log__filters .field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}
.vault-log__filters .field__label {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.vault-log__filters .input {
  width: auto;
  min-width: 120px;
  max-width: 220px;
}
@media (max-width: 559px) {
  .vault-log__filters .field {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .vault-log__filters .input {
    flex: 1;
    max-width: 65%;
  }
}
/* Sticky glass header: the wrap clips (not a scroll container) so the header can stick. */
@media (min-width: 768px) {
  .vault-log__table.table-wrap {
    overflow: clip;
  }
  .vault-log__table .table--sticky th:first-child {
    border-top-left-radius: var(--radius-card);
  }
  .vault-log__table .table--sticky th:last-child {
    border-top-right-radius: var(--radius-card);
  }
}
.vault-log__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.vault-log__ip {
  color: var(--text-3);
  font-family: var(--vc-mono);
  font-size: var(--fs-xs);
}
.vault-log .table td:first-child,
.vault-log .table td:nth-child(3) {
  white-space: nowrap;
}
/* Vault log on phones: each event is a compact block (who · when / action / card / board · IP). */
@media (max-width: 639px) {
  .vault-log__table.table-wrap {
    overflow: visible;
  }
  .vault-log__table .table,
  .vault-log__table tbody {
    display: block;
  }
  .vault-log__table thead {
    display: none;
  }
  .vault-log__table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "who when"
      "action action"
      "card card"
      "board ip";
    gap: 4px 10px;
    padding: 12px 14px;
  }
  .vault-log__table tr + tr {
    border-top: 0.5px solid var(--line);
  }
  .vault-log__table td {
    display: block;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
  }
  .vault-log__table td:nth-child(1) {
    grid-area: when;
    color: var(--text-3);
    font-size: var(--fs-xs);
    text-align: right;
  }
  .vault-log__table td:nth-child(2) {
    grid-area: who;
  }
  .vault-log__table td:nth-child(3) {
    grid-area: action;
    color: var(--text-2);
  }
  .vault-log__table td:nth-child(4) {
    grid-area: card;
    font-weight: var(--fw-medium);
    overflow-wrap: anywhere;
  }
  .vault-log__table td:nth-child(5) {
    grid-area: board;
    font-size: var(--fs-xs);
  }
  .vault-log__table td:nth-child(6) {
    grid-area: ip;
    text-align: right;
  }
  .vault-log__table tr.vault-log__empty {
    display: block;
  }
}

/* ==================================================================================================
   15. Join page 3D card (templates/workspaces/join.html, .wsjoin — growth.css owns the layout).
       Pointer tilt + glare from vault.js ([data-tilt]); the info board no longer uses it.
   ================================================================================================== */
.wsjoin .vcard {
  --rx: 0deg;
  --ry: 0deg;
  --press: 1;
  --lift: 0px;
  --glare-x: 50%;
  --glare-y: 0%;
  --glare-o: 0;
}
.wsjoin .vcard__shadow {
  position: absolute;
  z-index: 0;
  inset: 18px 14px 20px;
  border-radius: var(--vc-radius, var(--radius-xl));
  box-shadow:
    0 26px 30px -12px light-dark(rgb(15 20 40 / 0.1), rgb(0 0 0 / 0.55)),
    0 46px 60px -26px color-mix(in srgb, var(--tone-solid) 30%, transparent);
  opacity: 0.55;
  pointer-events: none;
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}
.wsjoin .vcard__body {
  gap: 12px;
  padding: var(--vc-pad, 16px);
  border-radius: var(--vc-radius, var(--radius-xl));
  background:
    radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--tone) 14%, transparent), transparent 52%),
    var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-sm);
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--press));
  transform-style: preserve-3d;
  transition:
    transform var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out);
}
.wsjoin .vcard__glow {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 55%;
  height: 46%;
  border-top-right-radius: var(--vc-radius, var(--radius-xl));
  background: radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--tone) 22%, transparent), transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}
.wsjoin .vcard__glare {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  opacity: var(--glare-o);
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease-out);
}
.wsjoin .vcard__glare::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 150%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, light-dark(rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.13)), transparent 72%);
  transform: translate(calc(var(--glare-x) * 0.667 - 50%), calc(var(--glare-y) - 50%));
}
@media (hover: hover) {
  .wsjoin .vcard:hover {
    --lift: -2px;
  }
  .wsjoin .vcard:hover .vcard__shadow {
    opacity: 1;
    transform: translateY(4px);
  }
}
.wsjoin .vcard.is-tilting .vcard__body {
  transition: box-shadow var(--dur-3) var(--ease-out);
  will-change: transform;
}
.wsjoin .vcard.is-tilting .vcard__shadow {
  transform: translate(calc(var(--ry) * -1.4px / 1deg), calc(var(--rx) * 1.4px / 1deg + 6px));
  transition: opacity var(--dur-3) var(--ease-out);
}
.wsjoin .vcard.is-tilting .vcard__icon {
  transform: translateZ(24px);
}
.wsjoin .vcard.is-tilting .vcard__titles {
  transform: translateZ(12px);
}
.wsjoin .vcard__icon,
.wsjoin .vcard__titles {
  transition: transform var(--dur-3) var(--ease-out);
}
.wsjoin .vcard.is-pressed {
  --press: 0.98;
}
@media (prefers-reduced-motion: reduce) {
  .wsjoin .vcard__body,
  .wsjoin .vcard.is-tilting .vcard__body {
    transform: translateY(var(--lift));
  }
  .wsjoin .vcard__glare {
    display: none;
  }
}

/* ==================================================================================================
   16. Card ⇄ dialog shared-element transition. vault.js sets view-transition-name: card-<id> and
       view-transition-class: vault-card on the card surface / dialog panel for one transition.
   ================================================================================================== */
html.vault-vt .modal.vault-modal,
html.vault-vt .modal.vault-modal::backdrop {
  transition: none;
}
@starting-style {
  html.vault-vt .modal.vault-modal[open] {
    opacity: 1;
    transform: none;
  }
}
::view-transition-group(.vault-card) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}
::view-transition-old(.vault-card),
::view-transition-new(.vault-card) {
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
::view-transition-old(.vault-card) {
  animation: vault-vt-fade-out 160ms ease both;
}
::view-transition-new(.vault-card) {
  animation: vault-vt-fade-in 280ms ease both;
}
html.vault-vt-out::view-transition-old(.vault-card) {
  animation-duration: 220ms;
}
html.vault-vt::view-transition-old(root) {
  animation: none;
}
html.vault-vt::view-transition-new(root) {
  animation: vault-vt-fade-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.vault-vt-out::view-transition-new(root) {
  animation: none;
}
html.vault-vt-out::view-transition-old(root) {
  animation: vault-vt-fade-out 220ms ease both;
}
@keyframes vault-vt-fade-out {
  to {
    opacity: 0;
  }
}
@keyframes vault-vt-fade-in {
  from {
    opacity: 0;
  }
}
