:root {
  --bg: #0b0f17;
  --card: #121c2e;
  --text: #e7eefc;
  --muted: rgba(231, 238, 252, 0.65);
  --border: rgba(231, 238, 252, 0.12);
  --accent: #7aa2ff;
  --danger: #ff6b6b;
  --shadow: 0 10px 22px rgba(0,0,0,0.25);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1400px 700px at 20% 0%, rgba(122,162,255,0.18), transparent 60%),
              radial-gradient(1200px 700px at 100% 30%, rgba(255,107,107,0.10), transparent 60%),
              var(--bg);
  color: var(--text);
}
a { color: inherit; }
.app-shell { min-height: 100%; display: flex; flex-direction: column; }
.main { flex: 1 1 auto; padding: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; min-height: 0; }
.footer { padding: 14px 22px; border-top: 1px solid var(--border); color: var(--muted); text-align: center; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 23, 0.55);
  display: flex; align-items: center; justify-content: space-between;
}

.topbar.topbar-menu-open {
  /* Keep Goodies/Settings menus above the full-screen backdrop without jumping ahead of modal dialogs. */
  z-index: 10910;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.brand-link {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.2px;
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
}
.brand-meta {
  font-weight: 650;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 24, 39, 0.55);
}

.brand-link:hover { text-decoration: underline; }
.pill {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 24, 39, 0.80);
  color: var(--muted);
  font-size: 12px;
}

button.pill {
  font-family: inherit;
}

.pill-btn {
  cursor: pointer;
  color: var(--text);
}

.pill-btn:hover {
  border-color: rgba(231, 238, 252, 0.22);
}


.topbar-menu-backdrop {
  position: fixed;
  inset: 0;
  /* Sit above editor overlays, but below the active topbar/menu so Goodies buttons remain clickable. */
  z-index: 10900;
  /* v5.9aa: use a nearly-transparent fill so iOS reliably treats it as a tap target */
  background: rgba(0,0,0,0.01);
  pointer-events: auto;
  touch-action: auto;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  background: rgba(18, 28, 46, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 20;
  overflow-wrap: anywhere;
}


.settings-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-label {
  font-size: 13px;
  color: var(--text);
}

.settings-notebook-block {
  min-width: 0;
  margin-bottom: 10px;
}

.settings-notebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.settings-crc32 {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.settings-notebook-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 2px;
  padding-bottom: 8px;
}

.settings-notebook-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-rename-btn {
  margin-left: auto;
  white-space: nowrap;
  align-self: flex-start;
}

.settings-create-block {
  margin-top: 0;
  margin-bottom: 0;
}

.settings-underline {
  border-bottom: 1px solid rgba(231, 238, 252, 0.22);
}

.settings-menu .settings-input.settings-underline {
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.settings-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
h1 { margin: 0 0 12px; font-size: 34px; letter-spacing: -0.4px; }
h2 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.card {
  background: rgba(18, 28, 46, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-title { font-weight: 750; font-size: 16px; margin-bottom: 4px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.field { display: grid; gap: 8px; margin-bottom: 12px; }
.label { font-size: 12px; color: var(--muted); }
.input, .title-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(16, 24, 39, 0.95);
  color: var(--text);
  outline: none;
}
.input:focus, .title-input:focus {
  border-color: rgba(122, 162, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.14);
}
.btn {
  border: 1px solid var(--border);
  background: rgba(16, 24, 39, 0.95);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 90ms ease, border-color 120ms ease, background 120ms ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(231, 238, 252, 0.22); }
.btn:active { transform: translateY(0px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { border-color: rgba(122, 162, 255, 0.55); background: rgba(122, 162, 255, 0.14); }
.btn.danger { border-color: rgba(255, 107, 107, 0.55); background: rgba(255, 107, 107, 0.12); }
.btn.full { width: 100%; justify-content: center; }
.loading { display: grid; place-items: center; height: 100vh; gap: 14px; }
.spinner { width: 34px; height: 34px; border-radius: 999px; border: 3px solid rgba(231, 238, 252, 0.20); border-top-color: rgba(122, 162, 255, 0.75); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.notepad-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; flex: 1 1 auto; min-height: 0; }
.sidebar { background: rgba(18, 28, 46, 0.75); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  min-height: 0;
}
.sidebar-top { margin-bottom: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.page-list { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-direction: column; gap: 0; overflow: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page { padding: 10px 10px; border: 1px solid var(--border); background: rgba(16, 24, 39, 0.72); border-radius: 0; cursor: pointer; }
.page:hover { border-color: rgba(231, 238, 252, 0.22); }
.page.active { border-color: rgba(122, 162, 255, 0.65); background: rgba(122, 162, 255, 0.12); }
.page-btn { width: 100%; display: block; text-align: left; -webkit-appearance: none; appearance: none; font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.page-title { font-weight: 650; font-size: 14px; }
.editor-area { background: rgba(18, 28, 46, 0.75); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.editor-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.title-input { font-size: 16px; font-weight: 700; }
.status { margin-left: auto; font-size: 12px; }
.rte { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; min-height: 0; }
.rte-toolbar-wrap { display: flex; align-items: center; gap: 8px; }
.rte-toolbar-toggle {
  margin-left: auto;
  min-width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(16, 24, 39, 0.70);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.rte-toolbar-toggle:hover { border-color: rgba(122, 162, 255, 0.55); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rte-toolbar .sep { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }

/* If the editor JS module fails to load, show a visible warning so troubleshooting is obvious. */
.rte-js-warning {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.10);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
}
.rte-surface { flex: 1 1 auto; min-height: 420px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)) 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(16, 24, 39, 0.70); overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: none; line-height: 1.5;
  /* iOS Safari: disable the native press-and-hold callout so we can show the SupNote context menu */
  -webkit-touch-callout: none;
  touch-action: pan-y;
 }

/*
  Keep text readable in dark mode even when pasted HTML carries inline colors.
  (Inline styles can set black text, which becomes nearly invisible.)
*/
.rte-surface,
.rte-surface * {
  color: var(--text) !important;
}
.rte-surface:empty:before { content: attr(data-placeholder); color: rgba(231, 238, 252, 0.35); }
.rte-surface img { max-width: 100%; height: auto; border-radius: 10px; }

/* Page-door split (single-click reference peek) */
.door-split {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.door-split-parent {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.door-split.on .door-split-parent {
  flex: 0 0 50%;
}

.door-split-divider { height: 8px; background: rgba(231, 238, 252, 0.10); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0; flex: 0 0 auto; }

.door-split-child {
  flex: 0 0 50%;
  min-height: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(16, 24, 39, 0.70);
  overflow: auto;
}

.door-peek-title {
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.2px;
  margin: 0 0 10px;
  cursor: pointer;
  color: var(--text);
  text-decoration: underline;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Mode indicator shown next to a child page title (View/Edit). */
.door-mode-indicator {
  font-size: 12px;
  margin-left: 10px;
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0;
}

.door-peek-body {
  line-height: 1.5;
}

/*
  Pasted content from web/email clients can carry inline color styles (often rgb(0,0,0)).
  In dark mode this can render as “blank” in the peek (read-only) pane.
  Force peek text to use the app theme color.
*/
.door-peek-body,
.door-peek-body * {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
}

.peek-truncated-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* When split is active, allow the parent editor surface to shrink below the normal min-height. */
.door-split.on .rte-surface { min-height: 0; }

/* Page-door highlight = swapped foreground/background */
/* New page title line */
.page-title-line {
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.2px;
  margin: 0 0 10px;
}
/* Page title line shown on pages behind page-doors (keep it simple and familiar). */
.page-title-line.page-back {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 4px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  padding: 0 8px 6px;
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* Clarify child-page mode: Edit vs View (same size/style as "Saved"). */
.rte .page-title-line.page-back::after {
  content: "";
  font-size: 12px;
  color: var(--muted);
  margin-left: 10px;
  text-decoration: none !important;
  font-weight: 400;
  letter-spacing: 0;
}
.rte.mode-edit .page-title-line.page-back::after { content: "Edit"; }
.rte.mode-view .page-title-line.page-back::after { content: ""; }

.page-back-divider {
  height: 8px;
  background: rgba(231, 238, 252, 0.10);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0;
}



.page-title-line.page-back:hover {
  text-decoration: none;
}

.page-title-line.page-back .title-text {
  text-decoration: underline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.page-title-line.page-back:hover .title-text {
  text-decoration: underline;
}


@media (max-width: 900px) {
  .notepad-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  /* iOS Safari: always show version/build at the top */
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-right .pill-status { display: none; }
  .brand-meta { display: inline-flex; font-size: 11px; padding: 2px 6px; }
  .patch-badge { display: inline-flex; font-size: 11px; padding: 2px 6px; }
  /* Mobile: keep Settings dropdown fully on-screen */
  .settings-menu { left: 0; right: auto; }

}

/* Robust page-door highlight: works in dark or light themes */
span.page-door {
    padding: 0.05rem 0.35rem;
    margin: 0 0.08rem;
    border-radius: 9999px;
    border: 2px solid currentColor;          /* uses the current text color */
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;                     /* keep the token together */
    cursor: grab;
    touch-action: manipulation;
    display: inline-block;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  touch-action: manipulation;
    touch-action: manipulation;

}


span.page-door.supnote-door-dragging {
    cursor: grabbing;
    opacity: 0.35;
}

/* Supnote context menu for page-door actions */
.supnote-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    background-color: #020617;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    padding: 0.25rem;
    display: none;
}

.supnote-context-menu .supnote-menu-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.9;
    padding: 0.35rem 0.6rem 0.25rem 0.6rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.6);
    margin-bottom: 0.15rem;
    text-align: center;
    text-transform: uppercase;
}


.supnote-context-menu button {
    width: 100%;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    padding: 0.4rem 0.6rem;
    cursor: grab;
    touch-action: manipulation;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.supnote-context-menu button:hover {
    background-color: #111827;
}

.supnote-context-menu .menu-sep {
    border-top: 1px solid #4b5563;
    margin: 0.25rem 0.2rem;
}

.supnote-context-menu .stack-title {
    font-size: 0.72rem;
    opacity: 0.8;
    padding: 0.25rem 0.6rem 0.1rem 0.6rem;
}

.supnote-context-menu .stack-item {
    font-size: 0.8rem;
    opacity: 0.85;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Debug panel for Supreme Notepad (v5.1) */
.debug-panel {
    position: fixed;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    background-color: rgba(15, 23, 42, 0.9); /* slate-900-ish */
    color: #e5e7eb;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    max-width: calc(100vw - 24px);
    z-index: 9999;
    overflow-wrap: anywhere;
    word-break: break-word;
}



.debug-panel .debug-row {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.debug-panel .debug-row + .debug-row {
    margin-top: 0.15rem;
}



/* v5.3v: iOS Safari readability fix — force light text on dark backgrounds */
@supports (-webkit-touch-callout: none) {
  .rte-surface,
  .rte-surface * {
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
  }
  .title-input {
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text) !important;
  }
}

/* v5.3ze: Private Browsing advisory banner */
.banner {
  border: 1px solid var(--border);
  background: rgba(18, 28, 46, 0.88);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.banner-text { color: var(--text); line-height: 1.35; }
.banner-text strong { color: var(--accent); }
.banner-actions { flex: 0 0 auto; }

.btn.small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
}




/* v5.7h: Private/Incognito hard gate + persistent WON'T REMEMBER badge */
.nosync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.6px;
  border: 1px solid rgba(244, 63, 94, 0.55);
  background: rgba(244, 63, 94, 0.18);
  color: rgba(255, 255, 255, 0.92);
  user-select: none;
  white-space: nowrap;
  margin-right: 10px;
}

.private-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top))
           calc(18px + env(safe-area-inset-right))
           calc(18px + env(safe-area-inset-bottom))
           calc(18px + env(safe-area-inset-left));
}

.private-gate-card {
  width: min(680px, 100%);
  background: rgba(18, 28, 46, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
}

.private-gate-title {
  font-size: 1.12rem;
  font-weight: 950;
  color: var(--accent);
}

.private-gate-text {
  color: var(--text);
  margin-top: 6px;
  line-height: 1.35;
}

.private-gate-steps {
  margin: 8px 0 12px 20px;
  color: var(--text);
}

.private-gate-steps li { margin: 6px 0; }

.private-gate-instructions 
.settings-menu .settings-divider {
  width: 100%;
  background: rgba(231, 238, 252, 0.38);
}

.settings-subtitle {
  margin-top: 10px;
}

/* v5.4a: Notebook join UI helpers */
.settings-divider {
  height: 2px;
  background: rgba(231, 238, 252, 0.34);
  opacity: 1;
  margin: 12px 0;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(231, 238, 252, 0.10);
}

.settings-subtitle {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin: 0 0 6px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}



/* v5.4g: Goodies menu file input overlay (so the label behaves like a button) */
.file-btn { position: relative; overflow: hidden; }
.file-input-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}


/* Pages panel collapse toggle (v5.5u) */
.notepad-layout.pages-collapsed { grid-template-columns: auto 1fr; gap: 8px; }
.sidebar.collapsed { background: transparent; border: none; box-shadow: none; padding: 0; justify-self: start; }
.sidebar.collapsed .sidebar-top { margin-bottom: 0; }
.pages-toggle { background: transparent; border: none; padding: 0; margin-top: 0; font: inherit; color: var(--muted); cursor: pointer; text-align: left; width: auto; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.pages-toggle:hover { color: rgba(231, 238, 252, 0.88); }
.sidebar.collapsed .pages-toggle { margin-top: 0; padding: 10px 10px; }

/* v5.9l: Pages button mode hint ("Lastest" / "AlphNum") aligned to the right */
.pages-toggle-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.pages-toggle-left { white-space: nowrap; }
.pages-toggle-right { white-space: nowrap; opacity: 0.95; }

/* Mobile: keep Notepad stacked even if Pages panel is collapsed */
@media (max-width: 900px) {
  .notepad-layout.pages-collapsed { grid-template-columns: 1fr; }
  .sidebar.collapsed { justify-self: start; width: auto; }
}


/* v5.9w: Make editor selection highlight obvious (desktop + iOS where supported) */
.rte-surface::selection { background: rgba(99, 102, 241, 0.48); }
.rte-surface::-moz-selection { background: rgba(99, 102, 241, 0.48); }

/* v5.8af: Settings modals + higher-contrast Settings inputs */
.settings-menu .settings-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.settings-menu .settings-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.20);
}

.sn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top))
           calc(18px + env(safe-area-inset-right))
           calc(18px + env(safe-area-inset-bottom))
           calc(18px + env(safe-area-inset-left));
}

.sn-modal-card {
  width: min(560px, 100%);
  background: rgba(18, 28, 46, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
}

.sn-modal-title {
  font-size: 1.06rem;
  font-weight: 950;
  color: var(--accent);
}


/* Persistent highlight for Goodies Find results */
.supnote-find-highlight {
  background: #155eef !important;
  color: #fff !important;
  -webkit-text-fill-color: currentColor !important;
  border-radius: 2px;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  font-weight: 700;
}
