/* Vault-specific layout. Secrets stay in the existing unlock session and dialogs. */
.heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.heading {
  margin-bottom: 1.5rem;
}
.heading p,
.section-title h2,
.section-title p {
  margin-bottom: 0;
}
#vault-unlocked,
.vault-gate {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}
#vault-unlocked {
  padding: 1.25rem;
}
label {
  display: grid;
  gap: 0.3rem;
  margin: 0.8rem 0;
}
label > input,
label > textarea {
  width: 100%;
}
dialog .section-title {
  position: sticky;
  top: -24px;
  z-index: 1;
  padding: 0.5rem 0;
  background: var(--card);
}
.conflict-panel {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.conflict-panel > p {
  margin: 0.75rem 0;
}
.conflict-panel table {
  table-layout: fixed;
  margin: 1rem 0;
}
.conflict-panel :is(th, td) {
  vertical-align: top;
  overflow-wrap: anywhere;
}
.vault-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.vault-state p {
  margin: 0;
  font-size: 0.8rem;
}
#lock-status {
  font-weight: 500;
}
.vault-gate {
  width: min(100%, 480px);
  margin: 2rem auto;
  padding: 2rem;
}
.vault-gate h2 {
  font-size: 1.35rem;
  margin: 0.7rem 0;
}
.vault-gate > p {
  line-height: 1.7;
}
.vault-gate-label {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  background: var(--muted);
}
.compact-form {
  margin: 1.25rem 0;
}
.compact-form > button {
  width: 100%;
  margin-top: 0.5rem;
}
.vault-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr);
  gap: 1rem;
  margin: 0.75rem 0;
}
.vault-filters label {
  margin: 0;
}
.entries,
.drafts {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.entries li {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr) minmax(0, auto);
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 0.5rem;
  border-top: 1px solid var(--border);
}
.entries li:has(button):hover {
  background: var(--muted);
}
.entries li > button {
  border: 0;
  padding: 0.2rem 0;
  border-radius: 0.25rem;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.entries li > span {
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.entry-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.entry-quick-actions button,
.entry-quick-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
}
.entry-quick-actions a {
  color: var(--primary);
}
.entry-quick-actions a:hover {
  background: var(--muted);
  text-decoration: none;
}
.vault-secondary {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
}
.vault-secondary > summary {
  font-weight: 500;
}
.vault-secondary > p {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  line-height: 1.75;
}
#draft-count {
  margin-left: 0.4rem;
}
.drafts li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}
.drafts li > span {
  flex: 1 1 100%;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}
.vault-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}
.vault-settings-row h3,
.vault-settings-row p {
  margin: 0.3rem 0;
}
#entry-dialog {
  width: min(680px, calc(100% - 2rem));
}
#rewrap-dialog {
  width: min(540px, calc(100% - 2rem));
}
.vault-version {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin: 0.75rem 0;
}
.password-actions {
  margin: 0.5rem 0 1rem;
}
.password-actions button {
  font-size: 0.8rem;
}
.password-actions .inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
}
.password-actions .inline input {
  width: 4.5rem;
}
.vault-entry-options {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  margin: 1rem 0;
}
.vault-entry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
#entry-save-state {
  min-height: 1.4em;
}
#conflict-detail td p {
  white-space: pre-wrap;
}
@media (max-width: 650px) {
  .conflict-panel :is(table, tbody, tr, td) {
    display: block;
    width: 100%;
  }
  .conflict-panel thead {
    display: none;
  }
  .conflict-panel td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--foreground);
  }
  .vault-gate {
    margin: 1rem auto;
    padding: 1.25rem;
  }
  .vault-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }
  .entries li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }
  .entry-quick-actions {
    justify-content: flex-start;
  }
  .password-actions > * {
    flex: 1 1 auto;
  }
  .vault-entry-footer > .actions {
    width: 100%;
  }
  .vault-entry-footer > .actions > button {
    flex: 1 1 auto;
  }
  .vault-secondary {
    padding: 0.9rem;
  }
}
