/* Scratchpad — two-pane layout. Inkwell tokens only; never hardcode colors. */

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--slate);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* App page: cap body at viewport height so inner scroll regions (sidebar
   note list, editor card) have a definite size to scroll within. Privacy
   page opts out via .page-privacy below. The tinted wash sits behind the
   two floating glass panels. */
body:not(.page-privacy) {
  height: 100vh;
  height: 100dvh;
  background: var(--wash-app);
  background-attachment: fixed;
}

/* ---------- Accessibility: motion + touch ---------- */
/* Inkwell sets html { scroll-behavior: smooth }; honor reduced-motion for it too. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Enlarge small hit areas on touch devices and narrow layouts. */
@media (pointer: coarse), (max-width: 640px) {
  .btn,
  .popover-menu button,
  .app-footer a {
    min-height: 44px;
  }
  .filter-x,
  .tag-pill-filter,
  .tag-pill-remove,
  .tag-add-empty,
  .tag-add-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  body:not(.page-privacy) .theme-toggle,
  .icon-btn,
  .dialog-close,
  .back-btn {
    min-width: 44px;
    min-height: 44px;
  }
  body:not(.page-privacy) .theme-toggle {
    min-width: 45px;
    min-height: 45px;
  }
  .btn-sm {
    min-height: 44px;
    padding-inline: 14px;
  }
  .tag-pill {
    min-height: 44px;
    padding: 0 4px 0 12px;
  }
  .tag-pill-filter {
    padding: 0 8px;
  }
  .tag-pill-remove {
    padding: 0;
  }
  .tag-bar .tag-input {
    height: 44px;
  }
}

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 302px 1fr;
  grid-template-rows: 1fr;
  gap: 16px;
  padding: 18px;
  flex: 1;
  min-height: 0;
}

/* Two floating frosted-glass panels. Blur is compositing-heavy, so it lives
   only on these two top-level panels (never on rows/chips). contain isolates
   their rendering. Fallbacks for no-backdrop-filter support and for
   prefers-reduced-transparency live just below. */
.sidebar,
.main {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--r-panel);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  contain: layout style paint;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .main,
  .dialog,
  .onboarding-panel,
  .status-chip.is-floating {
    background: var(--glass-fallback);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar,
  .main,
  .dialog,
  .onboarding-panel,
  .status-chip.is-floating {
    background: var(--glass-fallback);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Optional entrance: panels fade/translate up once on load. */
@media (prefers-reduced-motion: no-preference) {
  .sidebar { animation: panel-rise var(--t-slow) var(--ease-out) both; }
  .main    { animation: panel-rise var(--t-slow) var(--ease-out) 40ms both; }
  @keyframes panel-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ---------- Sidebar head ---------- */
.sidebar-head {
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font: 700 16px/1 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body:not(.page-privacy) .theme-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--control-fill);
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  box-shadow: none;
}
body:not(.page-privacy) .theme-toggle:hover {
  background: var(--control-fill-hover);
  color: var(--ink);
}
.theme-toggle .theme-icon { display: none; }
.theme-toggle[data-theme-icon="auto"] .theme-icon-auto { display: block; }
.theme-toggle[data-theme-icon="light"] .theme-icon-light { display: block; }
.theme-toggle[data-theme-icon="dark"] .theme-icon-dark { display: block; }

/* Note-count kicker retired in Soft Glass; the sidebar-foot status chip
   carries the "Local-only · never syncs" message instead. Element kept in
   the DOM (app.js writes #note-count) but hidden. */
.sidebar-kicker { display: none; }

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
  background: var(--accent-grad);
  border-radius: var(--r-glyph);
  box-shadow: var(--shadow-glyph);
}
.brand-mark-bg { fill: transparent; }
.brand-mark-lines {
  stroke: var(--glyph-ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-primary.btn-sm,
.btn-danger.btn-sm { box-shadow: var(--shadow-primary-sm); }

.sidebar-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  background: var(--field-bg);
  border: 1px solid var(--hairline-color-2);
  border-radius: var(--r-md);
  box-shadow: var(--field-inset-shadow);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.search-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus-ring);
}

.search-icon { flex: none; color: var(--text-muted); }

.search-control .search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font: 400 13.5px/1 var(--sans);
  color: var(--ink);
}

.search-control .search-input:focus {
  border-color: transparent;
  box-shadow: none;
}
.search-control .search-input::placeholder { color: var(--text-muted); }

.search-hint {
  flex: none;
  font: 500 11px/1 var(--sans);
  color: var(--text-muted);
  background: var(--control-fill);
  border-radius: var(--r-code);
  padding: 3px 6px;
}

@media (pointer: coarse), (max-width: 640px) {
  .search-control { height: 44px; }
  .search-hint { display: none; }
}

/* Two intentional rows: the primary CTA gets the full width (no text
   wrapping), then a quiet utility strip — Select left, icon cluster right.
   One shared row cannot hold all five controls in the 274px content box. */
.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sidebar-actions .btn-primary {
  flex: 1 1 100%;
  border-radius: var(--r-md);
}

/* First icon after the Select button opens the right-aligned cluster. */
.sidebar-actions .btn-secondary + .btn-ghost {
  margin-left: auto;
}
.sidebar-actions .btn-ghost {
  flex: none;
  width: 40px;
  padding: 0;
}
@media (pointer: coarse), (max-width: 640px) {
  .sidebar-actions .btn-ghost { width: 44px; }
}

/* View switch — a segmented control (track + segments). */
.sidebar-view-switch {
  display: flex;
  background: var(--control-fill);
  border-radius: var(--r-seg-track);
  padding: 3px;
  gap: 2px;
}

.sidebar-view-switch .btn {
  flex: 1;
  height: 28px;
  padding: 0 12px;
  justify-content: center;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  font: 500 12.5px/1 var(--sans);
}
.sidebar-view-switch .btn:hover {
  background: transparent;
  color: var(--ink);
}
.sidebar-view-switch .btn.is-active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-seg);
}

/* Pressed/active state for standalone toggle buttons (e.g. bulk "Select"). */
.btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Folders / Recent grouping toggle ---------- */
.sidebar-group-toggle {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}
.sidebar-group-toggle .btn {
  flex: 1;
  height: 26px;
  justify-content: center;
  font: 500 12px/1 var(--sans);
  color: var(--text-muted);
}
.sidebar-group-toggle .btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Folder accordion ---------- */
.folder-section { padding-top: 4px; }

.folder-head {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  border-radius: var(--r-lg);
}
.folder-head.is-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.folder-toggle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: var(--sans);
}
.folder-toggle:hover { background: var(--row-hover); }
.folder-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.folder-chevron {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: 5px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(90deg);
  transition: transform var(--t-fast) ease;
}
.folder-head.is-collapsed .folder-chevron { transform: rotate(0deg); }

.folder-name {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 13px/1.2 var(--sans);
  color: var(--ink);
}

.folder-count {
  flex: 0 0 auto;
  font: 500 11.5px/1 var(--sans);
  color: var(--text-muted);
}

.folder-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.folder-dot[data-color="accent"] { background: var(--accent); }
.folder-dot[data-color="olive"] { background: var(--olive); }
.folder-dot[data-color="sky"] { background: var(--sky); }
.folder-dot[data-color="gray"] { background: var(--gray-500); }

/* Global folder menu: positioned from JS against its trigger. Double-class
   selector so these overrides beat the later .popover-menu base rule
   (equal-specificity single classes resolve by source order). */
.popover-menu.folder-menu {
  position: fixed;
  right: auto;
  top: 0;
  left: 0;
}

.new-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  font: 500 13px/1 var(--sans);
  color: var(--text-muted);
}
.new-folder-row:hover {
  background: var(--row-hover);
  color: var(--ink);
}
.new-folder-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.new-folder-plus { font-size: 15px; line-height: 1; }

.folder-swatches {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  border: none;
}
.folder-swatches legend { padding: 0 0 8px; }
.swatch { position: relative; display: inline-flex; }
.swatch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.swatch-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: var(--border);
  pointer-events: none;
}
.swatch-chip[data-color="accent"] { background: var(--accent); }
.swatch-chip[data-color="olive"] { background: var(--olive); }
.swatch-chip[data-color="sky"] { background: var(--sky); }
.swatch-chip[data-color="gray"] { background: var(--gray-500); }
.swatch input:checked + .swatch-chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.swatch input:focus-visible + .swatch-chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.move-folder-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.move-folder-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font: 500 14px/1 var(--sans);
  color: var(--ink);
}
.move-folder-option:hover { background: var(--gray-100); }
.move-folder-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.move-folder-option[disabled] {
  color: var(--text-muted);
  cursor: default;
}
.move-folder-option[disabled]:hover { background: transparent; }

.folder-menu-btn {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity var(--t-fast) ease;
}
.folder-head:hover .folder-menu-btn,
.folder-head:focus-within .folder-menu-btn,
.folder-menu-btn[aria-expanded="true"] { opacity: 1; }
@media (pointer: coarse) {
  .folder-menu-btn { opacity: 1; }
}

/* ---------- Sidebar foot status chip ---------- */
.sidebar-foot {
  flex: 0 0 auto;
  padding: 10px 14px 12px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--control-fill);
  font: 500 11px/1 var(--sans);
  color: var(--text-secondary);
}
.status-chip .status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--success);
  flex: none;
}
.status-chip.is-floating {
  position: fixed;
  left: 30px;
  bottom: 30px;
  height: 28px;
  background: var(--glass-bg-pill);
  -webkit-backdrop-filter: blur(var(--glass-blur-pill));
  backdrop-filter: blur(var(--glass-blur-pill));
  border: var(--glass-border);
  box-shadow: var(--shadow-md);
  z-index: var(--z-sticky);
}

.active-filter {
  display: flex;
}
.active-filter .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-x {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: 600 14px/1 var(--sans);
  padding: 0 2px;
  border-radius: var(--r-pill);
}
.filter-x:hover { background: var(--accent-tint); }

/* ---------- Note list ---------- */
.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trash-retention-note {
  font: 500 12px/1.4 var(--sans);
  color: var(--text-muted);
  padding: 8px 10px 0;
}

.trash-tools {
  display: flex;
  padding: 8px 8px 2px;
}

.trash-tools .btn { width: 100%; }

.bulk-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 4px 8px;
  padding: 10px;
  border: none;
  border-radius: var(--r-md);
  background: var(--control-fill);
}

.bulk-count {
  font: 600 12px/1 var(--sans);
  color: var(--ink);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.note-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
}

.note-section-head {
  font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  gap: 5px;
  padding: 6px 8px 2px;
}
/* Neutralize the .eyebrow accent dash for section labels. */
.note-section-head::before { content: none; }

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  row-gap: 3px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--sans);
  position: relative;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.note-row:hover { background: var(--row-hover); }

.note-row-open {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.note-row-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.note-row:not(.is-bulk) > :not(.note-row-open) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.note-row:not(.is-bulk) .note-row-tag {
  pointer-events: auto;
}

.note-row.is-active {
  background: var(--paper);
  border-color: var(--accent-strong-border);
  box-shadow: var(--shadow-card);
  padding: 11px 12px;
}

.note-row.is-bulk {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.note-row.is-bulk .note-row-check {
  grid-column: 1;
  grid-row: 1 / span 3;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding-top: 1px;
}

.note-row.is-bulk .note-row-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.note-row.is-bulk .note-row-title {
  grid-column: 2;
}

.note-row.is-bulk .note-row-when {
  grid-column: 3;
}

.note-row.is-bulk .note-row-excerpt,
.note-row.is-bulk .note-row-tags {
  grid-column: 2 / -1;
}

.note-row.is-bulk.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent-strong-border);
}

.note-row.is-trashed .note-row-title {
  color: var(--text-secondary);
}

.note-row.is-pinned { background: transparent; }
.note-row.is-pinned:hover { background: var(--row-hover); }

.note-row-title {
  grid-column: 1;
  font: 600 13.5px/1.3 var(--sans);
  letter-spacing: -0.006em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-row-when {
  grid-column: 2;
  align-self: start;
  margin-top: 3px;
  font: 500 10.5px/1 var(--sans);
  color: var(--text-muted);
  white-space: nowrap;
}

.note-row-pin-corner {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  margin-top: 1px;
  color: var(--warning);
  display: inline-flex;
}

.note-row.is-pinned .note-row-when {
  grid-column: 1 / -1;
  grid-row: auto;
  margin-top: 2px;
}

.note-row-excerpt {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font: 400 12px/1.45 var(--sans);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row.is-active .note-row-excerpt { -webkit-line-clamp: 2; }

/* Tag chips show on the active/selected card only (per the Soft Glass spec). */
.note-row-tags {
  grid-column: 1 / -1;
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.note-row.is-active .note-row-tags { display: flex; }

.note-row-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 0;
  font: 600 10px/1 var(--sans);
  color: var(--accent);
  cursor: pointer;
}
.note-row-tag::before { content: none; }
.note-row-tag:hover { background: var(--accent-soft-2); }
.note-row-tag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.note-row-tag.is-static {
  pointer-events: none;
  cursor: default;
}
.note-row-tag.is-static:hover { background: var(--accent-soft); }

.search-hit {
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: var(--r-xs);
  padding: 0 2px;
}

.note-section-head.is-pinned::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--warning);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M9 4h6l-1 6 3 3H7l3-3-1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M9 4h6l-1 6 3 3H7l3-3-1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-empty {
  margin: 8px 4px;
  padding: 16px 14px;
  border: none;
  border-radius: var(--r-md);
  background: var(--control-fill);
}

.sidebar-empty-title {
  margin: 0 0 4px;
  color: var(--ink);
  font: 700 15px/1.3 var(--sans);
}

.sidebar-empty-copy {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font: 400 12px/1.45 var(--sans);
}

.sidebar-empty-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.sidebar-empty .btn {
  width: 100%;
}

/* ---------- Main / Editor view ---------- */
.editor-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--hairline-color);
}

.note-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  margin-right: auto;
  min-width: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--control-fill);
  font: 500 12px/1 var(--sans);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.note-breadcrumb .crumb-sep {
  display: inline-block;
  width: 10px;
  height: 10px;
  font-size: 0;
  flex: none;
  background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.note-breadcrumb .crumb-current { color: var(--ink); font-weight: 600; }

.editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: var(--gray-300);
  margin: 0 4px;
}

.overflow-wrap {
  position: relative;
  display: inline-flex;
}

.popover-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
}
.popover-menu[hidden] { display: none; }
.popover-menu button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-xs);
  padding: 8px 10px;
  font: 14px/1 var(--sans);
  color: var(--slate);
  cursor: pointer;
}
.popover-menu button:hover { background: var(--gray-100); }
.popover-menu button:focus-visible {
  outline: 2px solid var(--accent-focus-ring);
  outline-offset: -1px;
}
.popover-menu button.is-destructive { color: var(--rust); }
.popover-menu button.is-destructive:hover { background: var(--rust-tint); }
.menu-divider {
  border: 0;
  border-top: var(--border-hair);
  margin: 4px 2px;
}

.dirty-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  font: 600 11px/1 var(--sans);
  color: var(--warning-dark);
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--warning-tint);
}
.dirty-indicator .dot {
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--warning);
}

.editor-format {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-seg-track);
  background: var(--control-fill);
}
.editor-format[hidden] { display: none; }
.fmt-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--r-code);
  background: transparent;
  color: var(--text-secondary);
  font: 700 12px/1 var(--sans);
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.fmt-chip.fmt-italic { font: italic 600 12px/1 var(--serif); }
.fmt-chip.fmt-code { font: 600 11px/1 var(--mono); }
.fmt-chip.fmt-link svg { width: 13px; height: 13px; }
.fmt-chip:hover,
.fmt-chip:focus-visible {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-chip);
}
.fmt-chip:active { transform: scale(0.97); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--control-fill);
  border: none;
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--t-fast) ease, background var(--t-fast) ease;
}
.icon-btn:hover { background: var(--control-fill-hover); color: var(--ink); }
.icon-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.back-btn {
  display: none;
  align-items: center;
  gap: 4px;
}

/* ---------- Tag bar (collapsible) ---------- */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 0;
  background: transparent;
  border: 0;
}

.tag-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.tag-pill-item { display: inline-flex; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 4px 0 11px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  font: 600 11.5px/1 var(--sans);
  color: var(--accent);
}

.tag-pill-filter {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.tag-pill-filter:hover { text-decoration: underline; }

.tag-pill-remove {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: 600 13px/1 var(--sans);
  padding: 0 6px;
  border-radius: var(--r-pill);
  opacity: 0.7;
}
.tag-pill-remove:hover {
  opacity: 1;
  background: var(--accent-tint);
}

.tag-add-empty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 11px;
  font: 500 11.5px/1 var(--sans);
  color: var(--text-muted);
  border: 1.5px dashed var(--idle-border);
  border-radius: var(--r-pill);
  background: transparent;
  cursor: pointer;
}
.tag-add-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font: 600 14px/1 var(--sans);
  color: var(--text-muted);
  border: none;
  border-radius: var(--r-pill);
  background: var(--control-fill);
  cursor: pointer;
}
.tag-add-empty:hover { color: var(--accent); border-color: var(--accent); }
.tag-add-plus:hover { color: var(--accent); background: var(--accent-soft); }

.tag-bar .tag-input {
  background: transparent;
  border: 1.5px dashed var(--accent);
  border-radius: var(--r-pill);
  box-shadow: none;
  height: 24px;
  padding: 0 12px;
  font: 500 11.5px/1 var(--sans);
  color: var(--ink);
  min-width: 140px;
  flex: 0 1 180px;
}
.tag-bar .tag-input:focus {
  border-style: solid;
  box-shadow: none;
}

@media (pointer: coarse), (max-width: 640px) {
  .tag-bar .tag-input {
    min-height: 44px;
    height: 44px;
  }
}

.tag-bar.is-readonly .tag-pill {
  padding-right: 10px;
}

/* ---------- Editor card ---------- */
/* Editor content sits directly inside the glass main panel — not a nested
   card. Override the .card component surface to transparent. */
.editor-card {
  flex: 1;
  min-height: 0;
  padding: 30px 40px;
  overflow: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.editor-card.is-editing {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-card.is-editing .editor-doc-head,
.editor-card.is-editing .tag-bar {
  flex: 0 0 auto;
}

.editor-doc-head {
  max-width: 720px;
  margin: 0 auto 22px;
}

/* Soft Glass drops the eyebrow above the title. */
.editor-doc-head .eyebrow { display: none; }

.editor-doc-head .byline {
  margin: 0;
  font: 400 12.5px/1.4 var(--sans);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  gap: 8px;
}

.note-doc-title {
  margin: 0 0 10px;
  padding: 0;
  font: 700 32px/1.2 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}

.note-doc-title-input {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid transparent;
  outline: 0;
  box-shadow: none;
  height: auto;
  border-radius: 0;
}
.note-doc-title-input:focus {
  border-bottom-color: var(--gray-300);
  background: transparent;
  box-shadow: none;
}

.editor-doc-head .byline {
  margin: 0;
}
.editor-doc-head .byline:empty { display: none; }

.tag-bar {
  max-width: 720px;
  margin: 0 auto;
}

.note-editor {
  width: 100%;
  max-width: 720px;
  min-height: 360px;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;
  resize: none;
  font: 400 14px/1.85 var(--mono);
  color: var(--text-body);
}
.note-editor:focus { outline: 0; box-shadow: none; }

/* Edit mode: the textarea gains the inset glass writing surface. */
.editor-card.is-editing .note-editor {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  background: var(--field-bg-textarea);
  border: 1px solid var(--hairline-color);
  border-radius: var(--r-textarea);
  padding: 20px 22px;
  box-shadow: var(--textarea-inset-shadow);
}

/* ---------- Empty editor canvas (#7) ---------- */
.editor-empty {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 28px;
  max-width: 60ch;
  margin: 0 auto;
}
.editor-empty .editor-empty-quote {
  font: 600 24px/1.3 var(--sans);
  letter-spacing: -0.015em;
  max-width: 26ch;
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}
.editor-empty .editor-empty-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: 400 12.5px/1 var(--sans);
  color: var(--text-muted);
  margin: 0;
}
.editor-empty .editor-empty-meta .dotsep { color: var(--meta-dot); }
.editor-empty .editor-empty-meta .author {
  color: var(--text-secondary);
}
.editor-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.editor-hints .hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--r-pill);
  font: 400 12px/1 var(--sans);
  color: var(--text-secondary);
  background: var(--control-fill);
}
.editor-hints .hint kbd {
  min-width: 0;
  height: 18px;
  font-size: 10.5px;
  padding: 0 4px;
}

/* ---------- Rendered markdown (scoped, Inkwell tokens only) ---------- */
.note-rendered {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--sans);
  color: var(--text-body);
  font-size: 15.5px;
  line-height: 1.75;
}
.note-rendered h1,
.note-rendered h2,
.note-rendered h3,
.note-rendered h4,
.note-rendered h5,
.note-rendered h6 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 1.5em 0 0.5em;
}
.note-rendered h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin-top: 0.2em; }
.note-rendered h2 { font-size: 20px; line-height: 1.3; }
.note-rendered h3 { font-size: 17px; line-height: 1.35; }
.note-rendered h4 { font-size: 15.5px; }
.note-rendered p { margin: 0 0 1em; }
.note-rendered a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.note-rendered a:hover { color: var(--accent-d); }
.note-rendered ul,
.note-rendered ol { padding-left: 1.3em; margin: 0.6em 0; }
.note-rendered li { margin: 0.2em 0; }
/* Blockquote: accent-soft box with a pill-shaped accent bar (the ::before). */
.note-rendered blockquote {
  display: flex;
  gap: 12px;
  margin: 1.2em 0;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: var(--r-lg);
  color: var(--text-quote);
  font-style: italic;
}
.note-rendered blockquote::before {
  content: "";
  flex: none;
  width: 3.5px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.note-rendered blockquote p { margin: 0; }
.note-rendered code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-fill);
  color: var(--ink);
  padding: 2px 7px;
  border-radius: var(--r-code);
}
.note-rendered pre,
.note-rendered pre.code-block {
  margin: 1.2em 0;
  padding: 16px 18px;
  background: var(--code-fill);
  border: none;
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}
.note-rendered pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}
.note-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
  border-top: var(--border-rule);
}
.note-rendered th,
.note-rendered td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: var(--border-hair);
}
.note-rendered th {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text-secondary);
}
.note-rendered hr {
  border: 0;
  border-top: var(--border-rule);
  margin: 1.4em 0;
}
.note-rendered img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}
.rendered-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Editorial markdown: lede + pullquote (sans in Soft Glass) ---------- */
.note-rendered p.is-lede {
  font: 400 17px/1.6 var(--sans);
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 0 18px;
}

/* Short blockquotes are auto-tagged .is-pullquote; keep them as the pill box. */
.note-rendered blockquote.is-pullquote {
  max-width: none;
  margin: 1.2em 0;
  padding: 14px 18px;
  background: var(--accent-soft);
  color: var(--text-quote);
  border-radius: var(--r-lg);
  font: italic 400 15.5px/1.6 var(--sans);
}
.note-rendered blockquote.is-pullquote p { margin: 0; }

/* ---------- Task-list checkboxes (rendered as spans; see markdown.js) ---------- */
.note-rendered .task-checkbox {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.45em;
  vertical-align: -0.15em;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--control-fill);
  cursor: pointer;
  position: relative;
}
.note-rendered .task-checkbox[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}
.note-rendered .task-checkbox[aria-checked="true"]::after {
  content: "";
  position: absolute;
  left: 0.28em;
  top: 0.08em;
  width: 0.3em;
  height: 0.6em;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.note-rendered .task-checkbox:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.note-rendered .task-checkbox[aria-disabled="true"] {
  cursor: default;
  opacity: 0.6;
}
.note-rendered li:has(> .task-checkbox) {
  list-style: none;
}

/* ---------- Wikilinks ---------- */
.note-rendered a.wikilink {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 2px;
}
.note-rendered a.wikilink.is-phantom {
  color: var(--text-muted);
  text-decoration-style: dashed;
}

/* ---------- Backlinks ---------- */
.backlinks {
  margin-top: 24px;
  border-top: 1px solid var(--border-hair);
  padding-top: 12px;
}
.backlinks-summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
}
.backlinks-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.backlinks-list .backlink-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--control-fill);
  color: var(--text-body);
  padding: 3px 11px;
  font-size: 13.5px;
  cursor: pointer;
}
.backlinks-list .backlink-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Wikilink autocomplete ---------- */
.editor-card {
  position: relative;
}
.wikilink-suggest {
  position: absolute;
  z-index: 30;
  min-width: 220px;
  max-width: 320px;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  padding: 4px;
}
.wikilink-suggest [role="option"] {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-body);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.wikilink-suggest [role="option"][aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Empty states ---------- */
.center-state {
  margin: auto;
  width: min(560px, calc(100% - 40px));
  max-width: 560px;
  text-align: center;
  padding: 24px 0;
}

.onboarding-panel {
  width: 100%;
  padding: 44px 48px;
  border: var(--glass-border-strong);
  border-radius: var(--r-empty);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  backdrop-filter: blur(var(--glass-blur-strong));
  box-shadow: var(--shadow-empty);
}

.onboarding-panel .empty-state-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-xl);
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2));
  box-shadow: var(--shadow-glyph-inset), var(--shadow-primary-sm);
  color: var(--accent);
}

/* Soft Glass empty card drops the eyebrow. */
.onboarding-eyebrow { display: none; }

.onboarding-panel h3 {
  font-size: 24px;
  letter-spacing: -0.02em;
}
.onboarding-panel p {
  max-width: 38ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.onboarding-actions .btn {
  text-decoration: none;
}

.onboarding-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

/* Subtle "new here?" nudge for returning users with an empty store — they skip
   the first-run redirect, so this quietly points them to the About page. */
.onboarding-tour {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 20px;
  font: 500 12.5px/1 var(--sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
.onboarding-tour:hover { color: var(--accent); }
.onboarding-tour svg { width: 13px; height: 13px; flex: none; }

/* ---------- About dialog ---------- */
.about-dialog { max-width: 560px; }
.about-body { font-size: 14px; }

/* Links + version row in the About-dialog foot (replaces what the app-page
   footer used to carry). version.js fills #app-version / #app-build-date. */
.about-dialog-foot {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.about-dialog-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font: 400 12px/1.4 var(--sans);
  color: var(--text-muted);
}
.about-dialog-meta a {
  color: var(--text-secondary);
  text-decoration: none;
}
.about-dialog-meta a:hover { color: var(--accent); }
.about-dialog-meta .sep { color: var(--gray-300); }
.about-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.backup-reminder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border: var(--border-hair);
  border-left: 2px solid var(--warning);
  border-radius: var(--r-sm);
  background: var(--ivory);
}

.backup-reminder[hidden] {
  display: none;
}

.backup-reminder .about-subhead {
  margin-top: 0;
}

.backup-reminder p {
  margin: 0;
  color: var(--gray-700);
  line-height: 1.45;
}

.backup-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diagnostics-panel {
  margin: 16px 0;
}

.diagnostics-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.diagnostics-list div {
  padding: 8px 10px;
  border: var(--border-hair);
  border-radius: var(--r-sm);
  background: var(--paper);
}

.diagnostics-list dt {
  color: var(--gray-700);
  font: 500 11px/1.2 var(--mono);
  margin-bottom: 5px;
}

.diagnostics-list dd {
  margin: 0;
  color: var(--slate);
  font: 600 13px/1.25 var(--sans);
  overflow-wrap: anywhere;
}

.about-control-row,
.pwa-update-actions,
.conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-control-row {
  margin-top: 10px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--rust);
  border-radius: var(--r-sm);
  background: var(--paper);
}

.danger-zone .about-subhead {
  margin: 0 0 4px;
}

.danger-zone p {
  margin: 0;
  color: var(--gray-700);
  line-height: 1.45;
}

.about-subhead {
  font: 600 14px/1.2 var(--sans);
  margin: 16px 0 8px;
  color: var(--slate);
}
.shortcut-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-700);
}

.field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--gray-700);
  font: 500 12px/1.2 var(--mono);
}

.passphrase-form {
  display: grid;
  gap: 14px;
}

.passphrase-form > p {
  margin: 0;
}

.passphrase-form .input {
  width: 100%;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  font-size: 13px;
}

.field-error {
  color: var(--rust);
  font: 500 12px/1.4 var(--mono);
}

/* ---------- History / import / tag dialogs ---------- */
.history-dialog,
.import-preview-dialog,
.tag-manager-dialog,
.command-palette-dialog {
  max-width: 620px;
}

.command-palette-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.command-palette-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.command-palette-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--slate);
  text-align: left;
  cursor: pointer;
}

.command-palette-item:hover,
.command-palette-item.is-active {
  background: var(--gray-100);
}

.command-palette-item:focus-visible {
  outline: 2px solid var(--accent-focus-ring);
  outline-offset: -1px;
}

.command-palette-label {
  min-width: 0;
  font: 600 14px/1.25 var(--sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-palette-meta {
  color: var(--gray-700);
  font: 400 12px/1 var(--mono);
  white-space: nowrap;
}

.history-list,
.tag-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row,
.tag-manager-row {
  border: var(--border-hair);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--paper);
}

.history-title {
  font: 600 14px/1.3 var(--sans);
  color: var(--slate);
  margin-bottom: 4px;
}

.history-meta,
.muted-copy,
.tag-count {
  color: var(--gray-700);
  font-size: 13px;
}

.history-details {
  margin: 8px 0;
}

.history-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
}

.history-preview {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  font: 400 12px/1.5 var(--mono);
  color: var(--slate);
  background: var(--gray-100);
  border-radius: var(--r-sm);
  padding: 10px;
}

.import-counts {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px 16px;
  margin: 0 0 16px;
}

.import-counts dt {
  color: var(--gray-700);
}

.import-counts dd {
  margin: 0;
  font-family: var(--mono);
  color: var(--slate);
}

.import-errors {
  border: var(--border-hair);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 0 0 16px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 13px;
}

.import-errors p {
  margin: 0 0 6px;
  color: var(--slate);
  font-weight: 600;
}

.import-errors ul {
  margin: 0;
  padding-left: 18px;
}

.import-options {
  border: var(--border-hair);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-options legend {
  color: var(--gray-700);
  padding: 0 4px;
}

.import-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-manager-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 8px;
}

.tag-rename-input {
  min-width: 0;
  height: 32px;
}

/* ---------- Share dialog ---------- */
.share-dialog { max-width: 460px; }
.share-dialog .dialog-body p { margin: 0 0 12px; line-height: 1.5; }
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}
.share-warning {
  color: var(--gray-700);
  font-size: 13px;
  padding: 8px 10px;
  border: var(--border-hair);
  border-radius: var(--r-sm);
  background: var(--gray-100);
}
.share-status {
  font: 500 12px/1 var(--mono);
  color: var(--accent);
  margin: 8px 0 0;
  min-height: 1em;
}

/* ---------- Toast (transient action feedback) ----------
   One polite aria-live region holds the stack, bottom-center. Toasts are
   overlays, so a shadow is allowed here (see Inkwell Flat-Surface Rule).
   Callers never fire a toast while a modal <dialog> is open, so the normal
   z-index sits correctly above page content. */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

.pwa-update-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(520px, calc(100% - 40px));
  padding: 14px 16px;
  border: var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.pwa-update-notice[hidden] {
  display: none;
}

.pwa-update-notice strong {
  display: block;
  color: var(--slate);
  font: 600 14px/1.2 var(--sans);
}

.pwa-update-notice p {
  margin: 4px 0 0;
  color: var(--gray-700);
  font-size: 12.5px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .danger-zone,
  .pwa-update-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .pwa-update-notice {
    right: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
  }
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 9px 14px;
  font: 500 12.5px/1.35 var(--mono);
  color: var(--slate);
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--olive);
  flex: none;
}
.toast.is-info .toast-dot { background: var(--accent); }
.toast.is-error .toast-dot { background: var(--rust); }
.toast-dismiss {
  margin-left: 4px;
  padding: 0 2px;
  background: transparent;
  border: 0;
  color: var(--gray-500);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
}
.toast-dismiss:hover { color: var(--slate); }
@media (prefers-reduced-motion: reduce) {
  .toast {
    transform: none;
    transition: opacity var(--t-fast) linear;
  }
  .toast.is-visible { transform: none; }
}

/* ---------- Footer (shared across pages) ----------
   Two visual modes from one markup:
   • Compact (default, used on the app page) — single row, tight.
   • Rich (scoped by .page-privacy on about/privacy/terms) — brand block,
     nav, and a divided meta row with breathing room.
   Tokens-only. Single accent rule on top mirrors the sidebar's accent edge. */

.app-footer {
  flex-shrink: 0;
  background: var(--paper);
  color: var(--gray-500);
  font: 400 12px/1.4 var(--mono);
  border-top: 1.5px solid var(--accent);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 8px 16px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  padding: 4px 0;
}
.footer-brand:hover .footer-wordmark { color: var(--accent); }
.footer-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.footer-wordmark {
  font: 600 14px/1 var(--serif);
  letter-spacing: 0.01em;
  color: var(--slate);
  transition: color .12s ease;
}

.footer-tagline {
  display: none; /* shown only in rich mode below */
  font: 400 12px/1.2 var(--sans);
  color: var(--gray-500);
}

.footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.app-footer a {
  color: var(--gray-700);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color .12s ease, background-color .12s ease;
}
.app-footer a:hover {
  color: var(--accent);
  background: var(--accent-tint);
}
.app-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  color: var(--accent);
}

.footer-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer-ext-icon {
  width: 11px;
  height: 11px;
  flex: none;
  opacity: 0.65;
}

.footer-meta-row {
  padding: 4px 16px 8px;
  display: flex;
  justify-content: flex-end;
}
.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--gray-500);
}

.footer-sep { color: var(--gray-300); }

/* ---------- Rich footer mode (about / privacy / terms) ---------- */
.page-privacy .app-footer {
  margin-top: 56px;
}
.page-privacy .footer-inner {
  align-items: flex-start;
  gap: 18px 32px;
  padding: 24px 24px 18px;
}
.page-privacy .footer-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.page-privacy .footer-wordmark { font-size: 18px; }
.page-privacy .footer-tagline { display: block; }
.page-privacy .footer-nav {
  gap: 4px;
  padding-top: 4px;
}
.page-privacy .footer-meta-row {
  border-top: var(--border-hair);
  padding: 12px 24px 18px;
  justify-content: center;
}
.page-privacy .footer-meta-row .footer-meta {
  max-width: 1180px;
  margin: 0 auto;
  justify-content: center;
}

/* ---------- Mobile (≤640px) ---------- */
@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 10px 12px 6px;
  }
  body:not(.page-privacy) .footer-meta-row { display: none; }
  body:not(.page-privacy) .footer-inner { padding: 6px 12px; }
  .footer-meta-row { justify-content: center; }
  .footer-nav { justify-content: center; }
  .app-footer a {
    padding: 10px 12px; /* ≥40px tap target on touch */
  }

  /* Rich mode mobile: keep generous spacing but center everything.
     Override .page-privacy .footer-inner specificity to win the cascade. */
  .page-privacy .app-footer { margin-top: 40px; }
  .page-privacy .footer-inner {
    padding: 22px 16px 14px;
    gap: 14px;
    align-items: center;
  }
  .page-privacy .footer-brand { align-items: center; }
  .page-privacy .footer-meta-row { padding: 14px 16px 20px; }
}

/* ---------- Privacy page ---------- */
/* Document-flow layout: body grows with content, window handles scrolling.
   Overrides the app's viewport-locked overflow: hidden. */
.page-privacy {
  overflow: visible;
}

.privacy-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: var(--border-hair);
  background: var(--paper);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font: 700 15px/1.2 var(--sans);
  letter-spacing: -0.01em;
}
.brand-link:hover { color: var(--accent); }
.brand-title-inline { font: inherit; }

/* About page: the header becomes a centered floating glass nav pill. */
.page-about .privacy-header {
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 20px auto 0;
  justify-content: flex-start;
  gap: 20px;
  height: 48px;
  padding: 0 8px 0 18px;
  border: var(--glass-border);
  border-radius: var(--r-pill);
  background: var(--glass-bg-pill);
  -webkit-backdrop-filter: blur(var(--glass-blur-pill));
  backdrop-filter: blur(var(--glass-blur-pill));
  box-shadow: var(--shadow-pill-float);
}

.privacy-main {
  flex: 1 0 auto;
  padding: 32px 24px 48px;
}

.privacy-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 36px;
}

.privacy-title {
  font: 600 28px/1.2 var(--serif);
  letter-spacing: -0.01em;
  margin: 8px 0 12px;
  color: var(--slate);
}

.privacy-lede {
  font-size: 16px;
  line-height: 1.55;
  color: var(--gray-700);
  margin: 0 0 24px;
}

.privacy-card h2 {
  font: 600 18px/1.3 var(--serif);
  letter-spacing: -0.01em;
  margin: 30px 0 8px;
  padding-top: 18px;
  border-top: var(--border-hair);
  color: var(--slate);
}

.privacy-card h2:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.privacy-card p {
  line-height: 1.6;
  margin: 8px 0;
}

.privacy-card ul {
  padding-left: 1.2em;
  margin: 8px 0 12px;
  line-height: 1.6;
}
.privacy-card li { margin: 4px 0; }

.privacy-card code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--gray-100);
  color: var(--slate);
  padding: 1px 6px;
  border-radius: var(--r-xs);
}

.privacy-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-card a:hover { color: var(--accent-d); }

/* ---------- Guide page (guide.html adds .page-guide) ---------- */
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 6px;
}
.guide-toc a {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--control-fill);
  color: var(--text-body);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.guide-toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.guide-card h2 {
  scroll-margin-top: 24px;
}
.guide-card pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--gray-100);
  color: var(--slate);
  padding: 12px 14px;
  border-radius: var(--r-md);
  overflow-x: auto;
}
.guide-card pre code {
  background: transparent;
  padding: 0;
}
.guide-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.guide-card th,
.guide-card td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-hair);
}
.guide-card th {
  color: var(--text-muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .privacy-header { padding: 12px 16px; }
  .privacy-main { padding: 20px 14px 32px; }
  .privacy-card { padding: 22px 18px; }
  .privacy-title { font-size: 22px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .sidebar,
  .main {
    border-radius: 18px;
  }
  .main { display: none; }
  .app-shell.mobile-editor .sidebar { display: none; }
  .app-shell.mobile-editor .main { display: flex; }
  .app-shell.mobile-list .sidebar { display: flex; }
  .app-shell.mobile-list .main { display: none; }
  .back-btn { display: inline-flex; }
  .editor-view { padding: 14px 16px 20px; }
  .note-doc-title { font-size: 26px; }
  .editor-card { padding: 14px 16px; }
  .editor-doc-head { padding-bottom: 14px; margin-bottom: 16px; }
  .note-breadcrumb { font-size: 12px; }
  .popover-menu { right: 4px; }
  .tag-manager-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .tag-manager-row .btn {
    justify-content: center;
  }
}

/* =====================================================================
   About / landing page
   Document-flow layout (opted in via .page-privacy on <body>). Editorial
   hero + numbered steps + feature grid + privacy promises + final CTA.
   Tokens-only. Single accent. 1.5px borders. No surface shadows.
   ===================================================================== */

.about-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 15px;
  gap: 8px;
}

/* Hero wash sits behind the whole About page (fixed, gradient blobs). */
.page-about {
  background: var(--wash-hero);
  background-attachment: fixed;
}

/* ---------- Hero ---------- */
.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: 44px 0 0;
}
/* Soft Glass hero drops the eyebrow above the display headline. */
.about-hero .eyebrow { display: none; }

.about-hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  min-width: 0;
  width: 100%;
}

.about-display {
  margin: 0;
  font: 800 clamp(40px, 6vw, 62px)/1.08 var(--sans);
  letter-spacing: -0.035em;
  color: var(--ink);
}
.about-display em.accent {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-lede {
  margin: 0;
  max-width: 54ch;
  font: 400 17px/1.65 var(--sans);
  color: var(--text-secondary);
}

.about-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}
.about-cta-row .btn {
  text-decoration: none;
}
.about-cta-row-center { justify-content: center; }

.about-pills {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.about-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border: var(--glass-border);
  border-radius: var(--r-pill);
  background: var(--glass-bg-pill);
  font: 600 11px/1 var(--sans);
  color: var(--text-secondary);
}
.about-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
}
.dot-accent  { background: var(--accent); }
.dot-olive   { background: var(--olive); }
.dot-warning { background: var(--warning); }

/* ---------- Hero mockup ---------- */
.about-hero-visual {
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(820px, 100%);
}
.app-mockup {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.about-mockup-caption { display: none; }

/* mockup tokens — everything reads from CSS vars so dark mode flips automatically */
.mock-frame             { fill: var(--ivory);   stroke: var(--gray-300); stroke-width: 1.5; }
.mock-titlebar          { fill: var(--paper);   stroke: none; }
.mock-titlebar-clip     { fill: var(--paper);   stroke: none; }
.mock-rule              { stroke: var(--gray-300); stroke-width: 1.5; }
.mock-hair              { stroke: var(--gray-200); stroke-width: 1; }
.mock-dot-1 { fill: var(--rust); }
.mock-dot-2 { fill: var(--warning); }
.mock-dot-3 { fill: var(--olive); }
.mock-urlbar { fill: var(--ivory); stroke: var(--gray-200); stroke-width: 1; }
.mock-url    { font: 400 10px/1 var(--mono); fill: var(--gray-500); }

.mock-sidebar             { fill: var(--paper); stroke: none; }
.mock-sidebar-top-accent  { stroke: var(--accent); stroke-width: 2; }
.mock-brand-square        { fill: var(--accent); }
.mock-brand-lines         { stroke: var(--glyph-ink); stroke-width: 1.5; stroke-linecap: round; fill: none; }
.mock-brand-text          { font: 700 13px/1 var(--sans); fill: var(--slate); }
.mock-meta                { font: 400 10px/1 var(--mono); fill: var(--gray-500); }

.mock-input         { fill: var(--ivory); stroke: var(--gray-300); stroke-width: 1.5; }
.mock-input-label   { font: 400 11px/1 var(--sans); fill: var(--gray-500); }
.mock-primary       { fill: var(--accent); }
.mock-primary-label { font: 500 12px/1 var(--sans); fill: var(--paper); }
.mock-icon-btn      { fill: var(--paper); stroke: var(--gray-300); stroke-width: 1.5; }
.mock-icon-dot      { fill: none; stroke: var(--gray-700); stroke-width: 1.2; }
.mock-icon-line     { stroke: var(--gray-700); stroke-width: 1.2; stroke-linecap: round; fill: none; }

.mock-tab            { fill: var(--paper); stroke: var(--gray-300); stroke-width: 1.5; }
.mock-tab-active     { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 1.5; }
.mock-tab-label        { font: 500 11px/1 var(--sans); fill: var(--gray-700); }
.mock-tab-label-active { font: 500 11px/1 var(--sans); fill: var(--accent); }

.mock-note-row         { fill: transparent; stroke: none; }
.mock-note-row-active  { fill: var(--paper); stroke: var(--gray-200); stroke-width: 1; }
.mock-note-accent      { stroke: var(--accent); stroke-width: 2.5; }
.mock-note-title       { font: 600 12.5px/1 var(--sans); fill: var(--slate); }
.mock-note-title-dim   { font: 600 12.5px/1 var(--sans); fill: var(--gray-700); }
.mock-note-time        { font: 400 9.5px/1 var(--mono); fill: var(--gray-500); }
.mock-note-excerpt     { font: 400 10.5px/1.2 var(--sans); fill: var(--gray-500); }

.mock-breadcrumb       { font: 400 10.5px/1 var(--mono); fill: var(--gray-500); letter-spacing: 0.04em; }
.mock-eyebrow          { font: 500 10px/1 var(--mono); fill: var(--gray-500); letter-spacing: 0.12em; }
.mock-doc-title        { font: 700 26px/1.1 var(--sans); fill: var(--slate); letter-spacing: -0.02em; }
.mock-paragraph        { font: 400 13px/1.5 var(--sans); fill: var(--gray-700); }
.mock-h                { font: 700 15px/1.3 var(--sans); fill: var(--slate); letter-spacing: -0.015em; }
.mock-bullet           { fill: var(--gray-500); }
.mock-quote-accent     { stroke: var(--accent); stroke-width: 1.5; }
.mock-quote            { font: italic 500 13px/1.4 var(--sans); fill: var(--slate); }
.mock-tag              { fill: var(--accent-tint); stroke: none; }
.mock-tag-label        { font: 500 10px/1 var(--mono); fill: var(--accent); }

.mock-folder-chevron    { stroke: var(--gray-500); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.mock-folder-dot-accent { fill: var(--accent); }
.mock-folder-dot-olive  { fill: var(--olive); }
.mock-folder-name       { font: 600 12px/1 var(--sans); fill: var(--slate); }
.mock-folder-count      { font: 400 9.5px/1 var(--mono); fill: var(--gray-500); }
.mock-newfolder         { font: 500 11px/1 var(--sans); fill: var(--gray-500); }

/* ---------- Section scaffolding ---------- */
.about-section {
  padding: 72px 0;
  border-top: var(--border-hair);
}
.about-section-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.about-section-head .eyebrow {
  margin: 0;
}
.about-h {
  margin: 0;
  font: 700 clamp(26px, 3.4vw, 38px)/1.18 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
}
.about-h-tight { max-width: 18ch; }
.about-h em.accent { font-style: italic; color: var(--accent); }
.about-section-lede {
  margin: 0;
  max-width: 56ch;
  font: 400 16.5px/1.6 var(--sans);
  color: var(--gray-700);
}

/* ---------- How it works ---------- */
.about-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
}
.about-step {
  position: relative;
  padding: 28px 26px 24px;
  background: var(--paper);
  border: none;
  border-radius: var(--r-panel);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-step-num {
  display: inline-block;
  font: 700 28px/1 var(--sans);
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 6px;
}
.about-step-title {
  margin: 0;
  font: 700 19px/1.25 var(--sans);
  color: var(--ink);
  letter-spacing: -0.015em;
}
.about-step-body {
  margin: 0;
  font: 400 14.5px/1.6 var(--sans);
  color: var(--text-secondary);
}

/* ---------- Features (borderless typographic list, not cards) ---------- */
.about-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: var(--border-hair);
}
.about-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
  padding: 22px 0;
  background: transparent;
  border: 0;
  border-bottom: var(--border-hair);
}
/* Drop the divider under the final row (last two items in the 2-up grid). */
.about-feature:nth-last-child(-n + 2) { border-bottom: 0; }
.about-feature-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  color: var(--accent);
}
.about-feature-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font: 700 17px/1.25 var(--sans);
  letter-spacing: -0.015em;
  color: var(--ink);
}
.about-feature-body {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font: 400 14px/1.55 var(--sans);
  color: var(--text-secondary);
}

/* ---------- Promises (what we don't do) ---------- */
.about-section-promises {
  background: transparent;
  margin: 0;
  padding: 72px 0;
  border-top: var(--border-hair);
  border-bottom: none;
}
.about-promises {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: none;
  border-radius: var(--r-panel);
  background: var(--paper);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.about-promise {
  display: flex;
  gap: 16px;
  padding: 24px 24px;
  border-right: var(--border-hair);
  border-bottom: var(--border-hair);
}
.about-promise:nth-child(2n)        { border-right: 0; }
.about-promise:nth-last-child(-n+2) { border-bottom: 0; }
.about-promise-mark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--rust-tint);
  color: var(--rust);
}
.about-promise-title {
  margin: 0 0 4px;
  font: 700 16px/1.25 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.about-promise-body {
  margin: 0;
  font: 400 14px/1.55 var(--sans);
  color: var(--text-secondary);
}

/* ---------- Why local-first (editorial) ---------- */
.about-why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}
.about-why-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-why-text .eyebrow { margin-bottom: 4px; }
.about-why-text p {
  margin: 0;
  font: 400 16px/1.7 var(--sans);
  color: var(--text-secondary);
  max-width: 56ch;
}
.about-why-quote {
  padding: 8px 0 0;
}
.about-why-quote .pullquote {
  margin: 0;
  font: 500 clamp(22px, 2.2vw, 26px)/1.4 var(--sans);
  font-style: normal;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}
.about-why-attrib {
  margin: 14px 0 0 22px;
  font: 400 13px/1.4 var(--sans);
  color: var(--text-muted);
}

/* ---------- Keyboard ---------- */
.about-kbd-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: none;
  border-radius: var(--r-panel);
  background: var(--paper);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.about-kbd-row {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  border-bottom: var(--border-hair);
}
.about-kbd-row:last-child { border-bottom: 0; }
.about-kbd-keys {
  font: 400 13px/1 var(--mono);
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.about-kbd-action {
  font: 400 14.5px/1.4 var(--sans);
  color: var(--ink);
}

/* ---------- Final CTA ---------- */
.about-final {
  padding: 80px 0 96px;
}
.about-final-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 48px;
  background: var(--paper);
  border: none;
  border-radius: var(--r-empty);
  box-shadow: var(--shadow-empty);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}
.about-final-card .eyebrow {
  margin: 0;
}
.about-final-title {
  margin: 0;
  font: 700 clamp(28px, 3.6vw, 40px)/1.15 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
}
.about-final-lede {
  margin: 0;
  max-width: 50ch;
  font: 400 16px/1.6 var(--sans);
  color: var(--text-secondary);
}
.about-final-card .about-cta-row {
  margin-top: 18px;
}

/* ---------- About page · responsive ---------- */
@media (max-width: 960px) {
  .about-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0 56px;
  }
  .about-why-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .about-main { padding: 0 16px; }
  .about-section { padding: 48px 0; }
  .about-section-head { margin-bottom: 32px; }
  .about-features {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  /* Single column: restore the divider above the second-to-last item, keep
     only the final item border-free. */
  .about-feature:nth-last-child(-n + 2) { border-bottom: var(--border-hair); }
  .about-feature:last-child { border-bottom: 0; }
  .about-promises {
    grid-template-columns: 1fr;
  }
  .about-promise {
    border-right: 0;
    border-bottom: var(--border-hair);
  }
  .about-promise:last-child { border-bottom: 0; }
  .about-section-promises {
    margin: 0 -16px;
    padding: 48px 16px;
  }
  .about-final {
    padding: 56px 0 72px;
  }
  .about-final-card {
    padding: 36px 24px;
  }
  .about-kbd-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 18px;
  }
  .about-cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .about-cta-row .btn {
    width: 100%;
  }
}
