:root {
  --notes-pin-version: 20261127-pin6-only-1;
}

/* The default gate prevents a pre-authentication flash of workspace content. */
html:not([data-notes-access='unlocked']):not([data-notes-preserve-view='true'])
  :is(
    .notes-hero,
    .notes-main,
    .notes-workspace-rail,
    .notes-workspace-dashboard,
    .notes-workspace-resizer
  ) {
  display: none !important;
}

.notes-access-gate {
  width: min(100% - 2rem, 540px);
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--border, #ccd4e0);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
}

.notes-access-gate[hidden],
.notes-logout-panel[hidden],
.notes-access-gate [hidden] {
  display: none;
}

.notes-access-gate form,
.notes-vault-dialog form {
  display: grid;
  gap: 1rem;
}

.notes-access-gate label,
.notes-vault-dialog label {
  display: grid;
  gap: 0.4rem;
}

.notes-access-gate .notes-btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.notes-access-gate input:not([type='checkbox']),
.notes-access-gate select,
.notes-vault-dialog input,
.notes-vault-dialog select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem;
  border: 1px solid #9aa6b8;
  border-radius: 6px;
  background: inherit;
  color: inherit;
  font: inherit;
}

.notes-access-consent {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.notes-logout-panel {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  z-index: 3000;
  width: min(540px, calc(100% - 2rem));
  transform: translateX(-50%);
  padding: 1rem;
  border: 1px solid #9aa6b8;
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
  box-shadow: 0 8px 35px #0003;
}

.notes-vault-dialog {
  width: min(900px, calc(100% - 2rem));
  max-height: 85vh;
  padding: 1.5rem;
  overflow: auto;
  border: 1px solid #9aa6b8;
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
}

.notes-vault-dialog::backdrop {
  background: #10182788;
}

.notes-conflict-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.notes-conflict-compare pre,
.notes-vault-dialog details pre {
  max-height: 320px;
  padding: 1rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #869ab51a;
}

.notes-workspace-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 767px) {
  .site-header .tagline {
    display: none;
  }

  #driveSyncBtn {
    min-width: 36px;
    font-size: 0;
  }

  #driveSyncBtn::before {
    content: '↻';
    font-size: 1.3rem;
  }

  .notes-conflict-compare {
    grid-template-columns: 1fr;
  }

  .notes-access-gate {
    margin-top: 2rem;
    padding: 1.2rem;
  }
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-access-gate,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-vault-dialog,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-logout-panel {
  background: #172033;
  color: #e8edf5;
}

html[data-notes-network] .notes-workspace-create-button,
html[data-notes-network] [data-workspace-create-type],
html[data-notes-network] .notes-workspace-card-menu {
  pointer-events: none;
  opacity: 0.5;
}

.notes-entry-landing[hidden],
.notes-entry-workspace[hidden] {
  display: none !important;
}

.landing-page .google-account-controls .notes-access-gate {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.notes-pin-icon {
  display: none;
}

.notes-pin-dialog,
.vault-restore-dialog {
  box-sizing: border-box;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 32px;
  overflow: auto;
  border: 1px solid #e3e5e8;
  border-radius: 20px;
  background: #fff;
  color: #17191d;
  box-shadow: 0 20px 70px #0e1b3d26;
}

.notes-pin-dialog::backdrop,
.vault-restore-dialog::backdrop {
  background: #14213b59;
  backdrop-filter: blur(4px);
}

.notes-pin-dialog .notes-access-gate {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: center;
}

.notes-pin-dialog h1 {
  margin: 12px 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.notes-pin-dialog #notesAccessHelp {
  margin: 0 0 20px;
  color: #737373;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.notes-pin-dialog .notes-pin-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin: 4px auto 0;
  color: #4f83ee;
}

.notes-pin-icon svg {
  width: 100%;
  height: 100%;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-pin-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #737373;
  cursor: pointer;
}

.notes-pin-close svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.notes-pin-close:focus-visible,
.vault-gate-actions button:focus-visible,
.vault-restore-browse:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.notes-pin-dialog #notesAccessAccount {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #e2e2e5;
  border-radius: 12px;
  color: inherit;
  text-align: left;
}

.notes-pin-dialog #notesAccessAccount[hidden] {
  display: none;
}

.vault-gate-summary {
  min-width: 0;
}

.vault-gate-summary .vault-identity {
  position: relative;
  padding-left: 44px;
  font-size: 14px;
}

.vault-gate-summary .vault-icon {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 8px;
  background: #edf3ff;
  color: #2563eb;
}

.vault-gate-summary small {
  display: block;
  padding-left: 44px;
  color: #737373;
  font-size: 12px;
  line-height: 1.5;
}

.vault-gate-chevron {
  margin-left: 8px;
  color: #737373;
}

.notes-pin-dialog #vaultSwitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.notes-pin-dialog #notesAccessAccount:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.notes-pin-dialog form label {
  gap: 12px;
  color: #737373;
  text-align: left;
  font-size: 13px;
}

.notes-pin-field {
  position: relative;
  display: block;
  width: 100%;
}

.notes-pin-field > input[data-pin-input] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}

.notes-pin-cells {
  display: grid;
  grid-template-columns: repeat(var(--notes-pin-length, 6), minmax(0, 1fr));
  gap: 8px;
}

.notes-pin-cells[hidden] {
  display: none;
}

.notes-pin-cells > span {
  display: grid;
  place-items: center;
  height: 54px;
  border: 1px solid #dedee3;
  border-radius: 10px;
  background: #fcfcfd;
  color: inherit;
  font:
    24px ui-monospace,
    monospace;
}

.notes-pin-cells > span.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb1a;
}

.notes-pin-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.notes-pin-actions .notes-btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  border: 1px solid #2563eb;
  border-radius: 10px;
  font-size: 14px;
}

#notesPinDialog .notes-pin-actions .notes-btn.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

#notesPinDialog .notes-pin-actions .notes-btn.primary:hover {
  background: #1d4ed8;
}

#notesPinDialog .notes-pin-actions .notes-btn.primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.notes-pin-dialog #notesAccessStatus {
  color: #b54722;
  text-align: left;
  font-size: 13px;
}

.notes-pin-dialog #notesAccessStatus:empty {
  display: none;
}

.vault-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f2;
}

.vault-gate-actions .notes-btn {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #737373;
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
}

.vault-gate-actions .notes-btn:hover {
  color: #2563eb;
}

.vault-restore-dialog h2 {
  margin: 0 24px 12px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.vault-restore-dialog p {
  margin: 0 0 12px;
  color: #737373;
  font-size: 13px;
  line-height: 1.5;
}

.vault-restore-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 176px;
  padding: 16px;
  border: 1px dashed #a5bde8;
  border-radius: 14px;
  background: #fcfcfd;
  text-align: center;
}

.vault-restore-drop.is-dragging {
  border-color: #2563eb;
  background: #edf3ff;
}

.vault-restore-drop svg {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  color: #737373;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vault-restore-drop strong {
  font-size: 14px;
  font-weight: 600;
}

.vault-restore-drop span {
  color: #737373;
  font-size: 13px;
}

.vault-restore-browse {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #dedee3;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.vault-restore-dialog .vault-restore-note {
  margin: 12px 0 0;
  font-size: 12px;
}

.vault-restore-dialog .vault-restore-status {
  margin: 12px 0 0;
  color: #b54722;
}

.vault-restore-status:empty {
  display: none;
}

.notes-pin-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2000;
}

.notes-pin-launcher[hidden] {
  display: none !important;
}

#notesPasswordDialog {
  width: min(560px, calc(100% - 2rem));
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog {
  border-color: #34425b;
  background: #172033;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-cells > span {
  border-color: #50607b;
  background: #202c42;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-cells > span.active {
  border-color: #5b8cff;
  outline-color: #5b8cff40;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog #notesAccessHelp,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog #notesAccessAccount {
  color: #a7b5cd;
}

/* The access gate occupies the workspace grid while the encrypted vault is locked. */
.funify-notes-page .wrap > .notes-access-gate:not([hidden]) {
  box-sizing: border-box;
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  min-width: 0;
}

.notes-trial-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 1.25rem;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f8;
}

.notes-trial-tabs button {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #697791;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.notes-trial-tabs button[aria-selected='true'] {
  background: #fff;
  color: #1761ff;
  box-shadow: 0 1px 4px #17203314;
}

.notes-trial-tabs button:disabled {
  opacity: 0.45;
  cursor: default;
}

.notes-trial-tabs button:focus-visible {
  outline: 2px solid #1761ff;
  outline-offset: 2px;
}

.notes-pin-dialog .notes-trial-field {
  margin-bottom: 0.25rem;
  color: #697791;
  font-size: 0.875rem;
  text-align: left;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog .notes-access-gate {
  background: transparent;
  color: inherit;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-close,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) #notesUseLegacyPassword svg {
  color: #aac6ff;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-help .notes-pin-link {
  color: #aac6ff;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog #notesAccessStatus {
  color: #ffb4a8;
}

.notes-startup {
  box-sizing: border-box;
  width: min(480px, calc(100% - 40px));
  margin: 12vh auto;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
}

.notes-startup[hidden] {
  display: none;
}

.notes-startup h1 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.notes-startup p {
  color: var(--color-muted);
  font-size: 14px;
}

.notes-startup a {
  color: var(--color-primary);
  text-underline-offset: 3px;
}

#notesAccessRetry {
  margin-top: 12px;
  min-height: 44px;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .vault-restore-dialog {
  border-color: #34425b;
  background: #172033;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(.notes-pin-dialog #notesAccessAccount, .vault-gate-actions, .vault-restore-browse) {
  border-color: #44546e;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(.vault-restore-drop, .vault-restore-browse) {
  background: #202c42;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(
    .vault-gate-summary small,
    .vault-gate-actions .notes-btn,
    .vault-restore-dialog p,
    .vault-restore-drop span,
    .vault-restore-drop svg
  ) {
  color: #a7b5cd;
}

.vault-picker-illustration {
  display: none;
}

.vault-action-icon {
  display: inline-block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  font-size: 22px;
  line-height: 20px;
  vertical-align: middle;
}

svg.vault-action-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vault-gate-actions .notes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notes-pin-dialog.vault-themed-dialog,
.vault-restore-dialog.vault-themed-dialog,
.funify-notes-page .vault-pin-dialog.vault-themed-dialog {
  padding: 24px;
  border-color: #ffffff;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 5% 0%, #ccdeffa6, transparent 48%),
    radial-gradient(ellipse at 100% 30%, #e0e9ff8c, transparent 58%),
    linear-gradient(150deg, #ffffff 25%, #f4f7ff 100%);
  color: #101e43;
  box-shadow: 0 24px 80px #20375b40;
}

.notes-pin-dialog.vault-themed-dialog .notes-pin-icon {
  width: 164px;
  height: 96px;
  margin-top: -4px;
}

.vault-themed-dialog .notes-pin-icon > svg {
  display: none;
}

.vault-themed-dialog .vault-picker-illustration {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.notes-pin-dialog.vault-themed-dialog h1 {
  margin: 10px 0 8px;
  color: #101e43;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.notes-pin-dialog.vault-themed-dialog #notesAccessHelp {
  margin-bottom: 22px;
  color: #687795;
  font-size: 14px;
}

.is-space-picker .vault-picker {
  gap: 12px;
}

.is-space-picker .vault-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 12px;
  border: 1.5px solid #dce3f1;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffffd9, #f9fbffcc);
  color: #101e43;
  box-shadow: 0 2px 3px #293c6310;
}

.is-space-picker .vault-choice.is-current,
.is-space-picker .vault-choice:hover,
.is-space-picker .vault-choice:focus-visible {
  border-color: #2574ff;
  background: linear-gradient(120deg, #e3edff, #eef4ff);
  outline: none;
  box-shadow: 0 0 0 1px #2574ff24;
}

.is-space-picker .vault-choice:focus-visible {
  outline: 3px solid #2574ff40;
  outline-offset: 3px;
}

.is-space-picker .vault-choice-icon {
  display: grid;
  flex: 0 0 46px;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(140deg, #dceaff, #cddfff);
  color: #1563dd;
}

.is-space-picker .vault-choice:nth-child(3n + 2) .vault-choice-icon {
  background: linear-gradient(140deg, #f0ebff, #e4ddff);
  color: #7550d4;
}

.is-space-picker .vault-choice:nth-child(3n + 3) .vault-choice-icon {
  background: linear-gradient(140deg, #e2f6f3, #cfebe7);
  color: #248677;
}

.is-space-picker .vault-choice-icon .vault-icon {
  width: 28px;
  height: 28px;
}

.is-space-picker .vault-choice-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
}

.is-space-picker .vault-choice-copy .vault-identity {
  display: block;
}

.is-space-picker .vault-choice-copy strong {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.is-space-picker .vault-choice-copy small {
  color: #687795;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.is-space-picker .vault-choice-indicator {
  position: relative;
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid #b5c0d6;
  border-radius: 50%;
}

.is-space-picker .is-current .vault-choice-indicator {
  border-color: #2476f7;
  background: #2476f7;
}

.is-space-picker .is-current .vault-choice-indicator::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  content: '';
}

.vault-themed-dialog .vault-gate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  padding: 0;
  border: 0;
}

.notes-pin-dialog.vault-themed-dialog .vault-gate-actions .notes-btn {
  gap: 8px;
  min-height: 46px;
  padding: 8px;
  border: 1px solid #d9e2f3;
  border-radius: 12px;
  background: linear-gradient(#f7faff, #eaf0fc);
  color: #172747;
  box-shadow: 0 2px 3px #293c6314;
  font-size: 13px;
  font-weight: 500;
}

.notes-pin-dialog.vault-themed-dialog .vault-gate-actions .notes-btn:hover {
  border-color: #9ebbf0;
  background: #e3ecff;
}

@media (max-width: 360px) {
  .notes-pin-dialog.vault-themed-dialog {
    padding: 20px;
  }

  .notes-pin-dialog.vault-themed-dialog h1 {
    font-size: 21px;
  }

  .is-space-picker .vault-choice {
    gap: 10px;
    padding: 10px;
  }

  .is-space-picker .vault-choice-icon {
    flex-basis: 38px;
    width: 38px;
    height: 42px;
  }

  .is-space-picker .vault-choice-copy strong {
    font-size: 15px;
  }

  .notes-pin-dialog.vault-themed-dialog .vault-gate-actions .notes-btn {
    gap: 4px;
    padding: 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  .vault-themed-dialog .vault-gate-actions .vault-action-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .notes-pin-dialog.vault-themed-dialog {
  border-color: #46577b;
  background: radial-gradient(ellipse at top left, #273d69, transparent 65%), #172033;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .is-space-picker h1,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) .is-space-picker .vault-choice {
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .is-space-picker .vault-choice {
  border-color: #435373;
  background: #202c42;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  .is-space-picker
  .vault-choice.is-current {
  border-color: #699cff;
  background: #283f65;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  .notes-pin-dialog.vault-themed-dialog
  .vault-gate-actions
  .notes-btn {
  border-color: #435373;
  background: #202c42;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  .notes-pin-dialog.vault-themed-dialog
  #notesAccessHelp,
:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  .is-space-picker
  .vault-choice-copy
  small {
  color: #b0bed6;
}

/* Shared access theme covers unlock, creation, restore and verification dialogs. */
.vault-themed-dialog {
  max-width: calc(100vw - 32px);
}

.notes-pin-dialog .vault-fields,
.notes-pin-dialog .vault-fields label,
.notes-pin-dialog .vault-fields input,
.notes-pin-dialog .vault-fields select {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

#notesPinDialog .vault-fields {
  gap: 14px;
  margin: 0 0 4px;
}

#notesPinDialog .vault-fields label {
  position: relative;
  align-self: start;
  gap: 8px;
  color: #233555;
  font-size: 12px;
  font-weight: 600;
}

#notesPinDialog .vault-fields input,
#notesPinDialog .vault-fields select {
  height: 40px;
  min-height: 40px;
  border: 1px solid #cfdaf0;
  border-radius: 9px;
  background: #ffffffbf;
  color: #172747;
  font-size: 13px;
  font-weight: 400;
}

#notesPinDialog .vault-fields select {
  padding-left: 32px;
}

#notesPinDialog #vaultIconPreview {
  position: absolute;
  bottom: 10px;
  left: 9px;
  display: flex;
  width: 20px;
  height: 20px;
  color: #3472e6;
  pointer-events: none;
}

#notesPinDialog #vaultIconPreview .vault-icon {
  width: 20px;
  height: 20px;
}

#notesPinDialog .vault-fields .vault-help {
  position: relative;
  padding: 9px 10px 9px 30px;
  border-radius: 9px;
  background: #e9f0fc9c;
  color: #687795;
  font-size: 11px;
  line-height: 1.5;
}

#notesPinDialog .vault-fields .vault-help::before {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 14px;
  content: 'ⓘ';
}

.notes-pin-dialog .notes-pin-icon {
  position: relative;
}

.is-creating-space .notes-pin-icon > svg {
  position: absolute;
  top: 4px;
  left: 20px;
  display: block;
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 9px;
  background: #edf5ff;
  color: #377ef0;
}

.notes-pin-dialog .notes-pin-cells > span,
.vault-pin-dialog .notes-pin-cells > span {
  border-color: #d3ddef;
  background: linear-gradient(145deg, #ffffffd9, #f0f4fcc7);
  box-shadow: 0 1px 2px #263c6608;
}

#notesPinDialog #notesAccessSubmit,
dialog.vault-pin-dialog .vault-management .notes-btn.primary {
  border-color: #2671ed;
  background: linear-gradient(180deg, #4b88ff, #1455e5);
  color: #ffffff;
  box-shadow: 0 3px 6px #1958cc1a;
}

.vault-restore-dialog.vault-themed-dialog {
  width: min(380px, calc(100% - 32px));
}

.funify-notes-page .vault-pin-dialog.vault-themed-dialog {
  width: min(340px, calc(100% - 32px));
  padding: 24px;
}

.vault-pin-illustration {
  display: block;
  width: 112px;
  height: 76px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.vault-pin-dialog .vault-management {
  gap: 14px;
  min-width: 0;
}

.vault-pin-dialog h2,
.vault-restore-dialog.vault-themed-dialog h2 {
  margin: 0 0 10px;
  color: #172747;
  text-align: center;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.vault-restore-dialog #vaultRestoreHelp {
  color: #687795;
  text-align: center;
  font-size: 12px;
}

.vault-restore-dialog.vault-themed-dialog .vault-restore-drop {
  min-height: 160px;
  border-color: #9ebbec;
  background: #ffffff99;
}

.vault-pin-dialog .vault-management label {
  min-width: 0;
  color: #687795;
  font-size: 12px;
}

.vault-pin-dialog .notes-pin-cells > span {
  height: 48px;
}

dialog.vault-pin-dialog .vault-management .notes-btn {
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cfdaf0;
  border-radius: 10px;
  background: linear-gradient(#f9fbff, #eaf0fc);
  color: #233555;
}

@media (max-width: 360px) {
  .vault-themed-dialog {
    padding: 20px;
  }

  #notesPinDialog .notes-access-gate .vault-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .notes-pin-dialog .notes-pin-cells {
    gap: 6px;
  }

  .notes-pin-dialog .notes-pin-cells > span {
    height: 52px;
  }

  .vault-themed-dialog .vault-gate-actions {
    gap: 8px;
  }
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .vault-themed-dialog,
:is(html[data-theme='dark'], body[data-notes-theme='dark']) .vault-pin-dialog.vault-themed-dialog {
  border-color: #46577b;
  background: radial-gradient(ellipse at top left, #273d69, transparent 65%), #172033;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(
    .notes-pin-dialog.vault-themed-dialog h1,
    .vault-pin-dialog h2,
    .vault-restore-dialog.vault-themed-dialog h2,
    #notesPinDialog .vault-fields label
  ) {
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(
    #notesPinDialog .vault-fields input,
    #notesPinDialog .vault-fields select,
    .vault-restore-dialog.vault-themed-dialog .vault-restore-drop,
    .vault-pin-dialog .notes-pin-cells > span,
    .vault-pin-dialog .vault-management .notes-btn:not(.primary)
  ) {
  border-color: #435373;
  background: #202c42;
  color: #e8edf5;
}

.notes-pin-dialog .notes-pin-cells > span.active,
.vault-pin-dialog .notes-pin-cells > span.active {
  border-color: #347cff;
  box-shadow: 0 0 0 2px #347cff1a;
}

/* The native selects retain form values; themed popovers present their options. */
.vault-combo {
  position: relative;
  min-width: 0;
  width: 100%;
}

.vault-combo select[hidden] {
  display: none;
}

.vault-combo-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cfdaf0;
  border-radius: 9px;
  background: linear-gradient(145deg, #ffffffd9, #f0f4fcc7);
  color: #172747;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.vault-combo-trigger > .vault-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #3472e6;
}

.vault-combo-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-combo-arrow {
  flex: 0 0 auto;
  margin-left: auto;
  color: #687795;
  transition: transform 120ms ease;
}

.vault-combo-trigger[aria-expanded='true'] .vault-combo-arrow {
  transform: rotate(180deg);
}

.vault-combo-trigger:focus-visible {
  outline: 2px solid #347cff;
  outline-offset: 2px;
}

#notesPinDialog #vaultIconPreview {
  display: none;
}

.notes-pin-dialog #notesAccessAccount:has(.is-space-combo) {
  padding: 0;
}

.is-space-combo .vault-combo-trigger {
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
}

.vault-combo-menu {
  --vault-scroll-thumb: #b7c8e5;
  --vault-scroll-thumb-hover: #8da9d5;
  position: fixed;
  inset: auto;
  box-sizing: border-box;
  margin: 0;
  padding: 5px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #cedbf2;
  border-radius: 12px;
  background: #f9fbff;
  color: #172747;
  box-shadow: 0 10px 28px #20375b29;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: var(--vault-scroll-thumb) transparent;
}

@supports selector(::-webkit-scrollbar) {
  .vault-combo-menu {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  .vault-combo-menu::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .vault-combo-menu::-webkit-scrollbar-track {
    margin-block: 8px;
    background: transparent;
  }

  .vault-combo-menu::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--vault-scroll-thumb);
    background-clip: padding-box;
  }

  .vault-combo-menu::-webkit-scrollbar-thumb:hover {
    background-color: var(--vault-scroll-thumb-hover);
  }

  .vault-combo-menu::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  .vault-combo-menu::-webkit-scrollbar-corner {
    background: transparent;
  }
}

.vault-combo-menu:not(:popover-open) {
  display: none;
}

.vault-combo-menu:popover-open {
  display: grid;
  gap: 2px;
}

.vault-combo-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
}

.vault-combo-option > .vault-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #3472e6;
}

.vault-combo-option > span:not(.vault-combo-check) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.vault-combo-option[aria-selected='true'] {
  background: #e6eeff;
  color: #164fae;
  font-weight: 600;
}

.vault-combo-option.is-active {
  background: #dce8ff;
}

.vault-combo-check {
  flex: 0 0 auto;
  margin-left: auto;
  color: #2563eb;
  visibility: hidden;
}

.vault-combo-option[aria-selected='true'] .vault-combo-check {
  visibility: visible;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(.vault-combo-trigger, .vault-combo-menu) {
  border-color: #435373;
  background: #202c42;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark'])
  :is(.vault-combo-option[aria-selected='true'], .vault-combo-option.is-active) {
  background: #304a76;
  color: #e8edf5;
}

:is(html[data-theme='dark'], body[data-notes-theme='dark']) .vault-combo-menu {
  --vault-scroll-thumb: #52698f;
  --vault-scroll-thumb-hover: #7894be;
}

#notesPinDialog #notesAccessAccount,
#notesPinDialog .is-space-combo .vault-combo-trigger,
#notesPinDialog .is-space-combo .vault-combo-trigger:hover {
  background: transparent;
  box-shadow: none;
}

.vault-gate-chevron {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 120ms ease;
}

.vault-combo-trigger[aria-expanded='true'] .vault-gate-chevron {
  transform: rotate(180deg);
}

#notesPinDialog .vault-combo:has(#vaultIcon) .vault-combo-trigger,
#notesPinDialog .vault-combo:has(#vaultIcon) .vault-combo-trigger:hover {
  background: transparent;
  box-shadow: none;
}

.vault-combo-arrow {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vault-pin-dialog .vault-pin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Access surfaces follow the same locally selected colors as workspace buttons. */
.funify-notes-page {
  --vault-surface: var(--color-surface, #fff);
  --vault-foreground: var(--color-text, #172747);
  --vault-muted: color-mix(in srgb, var(--vault-foreground) 65%, var(--vault-surface));
  --vault-accent: var(--notes-selection-accent, #6c9bc2);
  --vault-border: color-mix(in srgb, var(--vault-accent) 35%, var(--vault-surface));
  --vault-tint: color-mix(
    in srgb,
    var(--notes-selection-background, #d4e9f8) 20%,
    var(--vault-surface)
  );
  --vault-subtle: color-mix(
    in srgb,
    var(--notes-selection-background, #d4e9f8) 8%,
    var(--vault-surface)
  );
}

#notesPinDialog,
dialog.vault-restore-dialog.vault-themed-dialog,
.funify-notes-page dialog.vault-pin-dialog.vault-themed-dialog,
.funify-notes-page dialog.vault-edit-profile {
  border-color: var(--vault-border);
  background: linear-gradient(155deg, var(--vault-tint), var(--vault-subtle) 72%);
  color: var(--vault-foreground);
}

#notesPinDialog :is(h1, .vault-fields label),
.funify-notes-page .vault-themed-dialog h2,
.funify-notes-page .vault-edit-profile h2 {
  color: var(--vault-foreground);
}

#notesPinDialog :is(#notesAccessHelp, .vault-gate-summary small, .vault-choice-copy small),
.funify-notes-page .vault-themed-dialog :is(label, #vaultRestoreHelp) {
  color: var(--vault-muted);
}

#notesPinDialog #notesAccessSubmit,
body.funify-notes-page dialog.vault-management-dialog .notes-btn.primary {
  border-color: var(--vault-accent);
  background: var(--notes-selection-background);
  color: var(--notes-selection-text);
  box-shadow: 0 2px 5px color-mix(in srgb, var(--vault-accent) 12%, transparent);
}

#notesPinDialog #notesAccessSubmit:hover,
body.funify-notes-page dialog.vault-management-dialog .notes-btn.primary:hover {
  background: var(--notes-selection-hover);
  color: var(--notes-selection-text);
}

#notesPinDialog .vault-gate-actions .notes-btn,
body.funify-notes-page
  dialog.vault-pin-dialog.vault-themed-dialog
  .vault-management
  .notes-btn:not(.primary),
body.funify-notes-page .vault-edit-profile .notes-btn:not(.primary),
body.funify-notes-page dialog.vault-restore-dialog.vault-themed-dialog .vault-restore-browse {
  border-color: var(--vault-border);
  background: var(--vault-subtle);
  color: var(--vault-foreground);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--vault-accent) 8%, transparent);
}

#notesPinDialog .vault-gate-actions .notes-btn:hover,
body.funify-notes-page
  dialog.vault-pin-dialog.vault-themed-dialog
  .vault-management
  .notes-btn:not(.primary):hover,
body.funify-notes-page .vault-edit-profile .notes-btn:not(.primary):hover,
body.funify-notes-page dialog.vault-restore-dialog.vault-themed-dialog .vault-restore-browse:hover {
  border-color: var(--vault-accent);
  background: var(--vault-tint);
  color: var(--vault-foreground);
}

#notesPinDialog :is(input, select, .vault-choice),
body.funify-notes-page dialog.vault-pin-dialog .notes-pin-cells > span,
body.funify-notes-page dialog.vault-restore-dialog.vault-themed-dialog .vault-restore-drop,
body.funify-notes-page .vault-edit-profile :is(input, .vault-combo-trigger) {
  border-color: var(--vault-border);
  background: var(--vault-surface);
  color: var(--vault-foreground);
}

#notesPinDialog .notes-pin-cells > span {
  border-color: var(--vault-border);
  background: var(--vault-surface);
}

#notesPinDialog .notes-pin-cells > span.active,
body.funify-notes-page dialog.vault-pin-dialog .notes-pin-cells > span.active,
#notesPinDialog .vault-choice:is(:hover, :focus-visible),
body.funify-notes-page .vault-restore-dialog.vault-themed-dialog .vault-restore-drop.is-dragging {
  border-color: var(--vault-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--vault-accent) 18%, transparent);
}

#notesPinDialog .vault-choice:is(:hover, :focus-visible) {
  background: var(--vault-tint);
  outline-color: var(--vault-accent);
}

#notesPinDialog :is(#notesAccessAccount:focus-within, .vault-combo-trigger:focus-visible),
.funify-notes-page :is(.vault-themed-dialog, .vault-edit-profile) button:focus-visible {
  outline-color: var(--vault-accent);
}

.funify-notes-page div.vault-combo-menu {
  --vault-scroll-thumb: var(--vault-border);
  --vault-scroll-thumb-hover: var(--vault-accent);
  border-color: var(--vault-border);
  background: var(--vault-surface);
  color: var(--vault-foreground);
}

.funify-notes-page div.vault-combo-menu .vault-combo-option:is([aria-selected='true'], .is-active) {
  background: var(--notes-selection-background);
  color: var(--notes-selection-text);
}

.funify-notes-page :is(.vault-combo-check, .vault-combo-option > .vault-icon) {
  color: inherit;
}

#vaultChangePINDialog {
  width: min(340px, calc(100vw - 32px));
  padding: 20px 18px;
  border-radius: 20px;
}

#vaultChangePINDialog .vault-management {
  gap: 0;
}

.vault-change-pin-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--notes-selection-background);
  color: var(--notes-selection-text);
}

.vault-change-pin-badge svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#vaultChangePINDialog h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.vault-change-pin-help {
  margin: 0 0 18px;
  color: var(--vault-muted);
  font-size: 12px;
  text-align: center;
}

#vaultChangePINDialog .vault-profile-fields {
  gap: 16px;
}

#vaultChangePINDialog label {
  gap: 7px;
  color: var(--vault-muted);
  font-size: 12px;
}

.vault-pin-single-field {
  position: relative;
  display: flex;
  min-width: 0;
}

#vaultChangePINDialog .vault-pin-single-field input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--vault-border);
  border-radius: 11px;
  background: var(--vault-surface);
  color: var(--vault-foreground);
  font: inherit;
  font-size: 17px;
  letter-spacing: 6px;
}

#vaultChangePINDialog .vault-pin-single-field input:focus {
  border-color: var(--vault-accent);
  outline: 2px solid color-mix(in srgb, var(--vault-accent) 18%, transparent);
  outline-offset: 1px;
}

#vaultChangePINDialog .vault-pin-visibility {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--vault-muted);
  cursor: pointer;
}

#vaultChangePINDialog .vault-pin-visibility:hover {
  background: var(--vault-tint);
}

.vault-pin-visibility svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#vaultChangePINDialog .vault-pin-actions {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 14px;
}

#vaultChangePINDialog .vault-pin-actions .notes-btn.primary {
  min-height: 44px;
  border-radius: 10px;
}

#vaultChangePINDialog .vault-pin-actions .notes-btn:not(.primary) {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--vault-muted);
  box-shadow: none;
  font-size: 12px;
}

#vaultChangePINDialog .vault-pin-actions .notes-btn:not(.primary):hover {
  color: var(--vault-foreground);
  text-decoration: none;
}

#vaultChangePINDialog .vault-pin-actions button[hidden] {
  display: none;
}

#notesPinDialog .vault-fields :is(input, select) {
  border-color: var(--vault-border);
  background: var(--vault-surface);
  color: var(--vault-foreground);
}

#notesPinDialog .vault-fields input:focus-visible {
  outline-color: var(--vault-accent);
}

#notesPinDialog .vault-fields .vault-help,
#notesPinDialog.is-creating-space .notes-pin-icon > svg {
  background: var(--vault-tint);
  color: var(--vault-muted);
}

#notesPinDialog .vault-gate-summary .vault-icon {
  background: var(--notes-selection-background);
  color: var(--notes-selection-text);
}
