/* Notes (freeappstack.com/notes). Light and dark (Settings: match the device, light, or dark), WCAG 2.2 AA. */
:root, body.theme-light {
  color-scheme: light;
  --ink: #1d1f24; --muted: #5a5e6b; --line: #dcdae4; --paper: #fff; --bg: #f5f4f8; --soft: #efedf4; --side: #faf9fc;
  --accent: #4b3f8f; --accent-ink: #fff; --accent-soft: #ebe7f8; --head: #3b2f6b; --head-ink: #fff;
  --good: #1e6b34; --good-bg: #e5f6e9; --good-line: #b9e3c4;
  --warn: #7a5200; --warn-bg: #fdf3df; --warn-line: #f0d9a8;
  --bad: #a1291c; --bad-ink: #fff; --bad-bg: #fbe8e5; --bad-line: #f0bdb4;
  --info: #2b4f8a; --info-bg: #e7eefa; --info-line: #c4d4ef;
  --field: #767387;   /* form borders: 3:1 against white */
  --focus: #b35c00;
  --radius: 12px;
  --mark: #fff0a0;
  /* note colours: --nc a light wash (cards), --nd the swatch (dots) */
  --red: #fde4e1; --red-d: #d64533; --orange: #feebd9; --orange-d: #e07b1f; --yellow: #fdf4c7; --yellow-d: #d1a90f; --green: #e3f4e1; --green-d: #3c9a3a;
  --teal: #ddf3f1; --teal-d: #1d9488; --blue: #e1ecfb; --blue-d: #2f6fd1; --purple: #eee6fb; --purple-d: #7b4fd0; --pink: #fbe4f0; --pink-d: #cf4a8c;
  --brown: #f1e8df; --brown-d: #8a5a35; --grey: #ebecef; --grey-d: #7a7e88;
}
body.theme-dark {
  color-scheme: dark;
  --ink: #ecebf2; --muted: #b2b0c0; --line: #34323e; --paper: #1c1b22; --bg: #131218; --soft: #26242e; --side: #17161c;
  --accent: #b9adff; --accent-ink: #19132f; --accent-soft: #2c2650; --head: #221c40; --head-ink: #fff;
  --good: #7fd69a; --good-bg: #16301f; --good-line: #2c5a3a;
  --warn: #f2c66d; --warn-bg: #33270e; --warn-line: #5c4718;
  --bad: #f3a196; --bad-ink: #2a0b07; --bad-bg: #3a1a16; --bad-line: #6b2d25;
  --info: #9cbcf0; --info-bg: #1a2638; --info-line: #2f4566;
  --field: #8a879a; --focus: #ffb35c; --mark: #5c4d0a;
  --red: #3b1f1c; --red-d: #f07a6a; --orange: #3a2816; --orange-d: #f0a35a; --yellow: #37310f; --yellow-d: #e8cb4f; --green: #1c3120; --green-d: #79c977;
  --teal: #15312e; --teal-d: #5cc8bc; --blue: #182a44; --blue-d: #77a6ef; --purple: #2a2142; --purple-d: #b391f2; --pink: #3a1d2c; --pink-d: #ef8cbd;
  --brown: #33271d; --brown-d: #c89a74; --grey: #2a2b30; --grey-d: #a5a8b2;
}
@media (prefers-color-scheme: dark) {
  body.theme-auto {
    color-scheme: dark;
    --ink: #ecebf2; --muted: #b2b0c0; --line: #34323e; --paper: #1c1b22; --bg: #131218; --soft: #26242e; --side: #17161c;
    --accent: #b9adff; --accent-ink: #19132f; --accent-soft: #2c2650; --head: #221c40; --head-ink: #fff;
    --good: #7fd69a; --good-bg: #16301f; --good-line: #2c5a3a;
    --warn: #f2c66d; --warn-bg: #33270e; --warn-line: #5c4718;
    --bad: #f3a196; --bad-ink: #2a0b07; --bad-bg: #3a1a16; --bad-line: #6b2d25;
    --info: #9cbcf0; --info-bg: #1a2638; --info-line: #2f4566;
    --field: #8a879a; --focus: #ffb35c; --mark: #5c4d0a;
    --red: #3b1f1c; --red-d: #f07a6a; --orange: #3a2816; --orange-d: #f0a35a; --yellow: #37310f; --yellow-d: #e8cb4f; --green: #1c3120; --green-d: #79c977;
    --teal: #15312e; --teal-d: #5cc8bc; --blue: #182a44; --blue-d: #77a6ef; --purple: #2a2142; --purple-d: #b391f2; --pink: #3a1d2c; --pink-d: #ef8cbd;
    --brown: #33271d; --brown-d: #c89a74; --grey: #2a2b30; --grey-d: #a5a8b2;
  }
}
.c-red { --nc: var(--red); --nd: var(--red-d); } .c-orange { --nc: var(--orange); --nd: var(--orange-d); } .c-yellow { --nc: var(--yellow); --nd: var(--yellow-d); }
.c-green { --nc: var(--green); --nd: var(--green-d); } .c-teal { --nc: var(--teal); --nd: var(--teal-d); } .c-blue { --nc: var(--blue); --nd: var(--blue-d); }
.c-purple { --nc: var(--purple); --nd: var(--purple-d); } .c-pink { --nc: var(--pink); --nd: var(--pink-d); } .c-brown { --nc: var(--brown); --nd: var(--brown-d); }
.c-grey { --nc: var(--grey); --nd: var(--grey-d); } .c-none { --nc: var(--paper); --nd: var(--paper); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-underline-offset: 2px; }
.btn, .brand, .nav a, .top-link, .side-list a, .note-link, .tag, .mini { text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #ffcf8a; }
.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; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: #1d1f24; padding: 8px 14px; border-radius: 8px; z-index: 200; font-weight: 600; }
.skip:focus { top: 8px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.js .js-hide { display: none; }
.show-sm-only { display: none; }
kbd { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; white-space: nowrap; }
h1 { font-size: 1.55rem; margin: 0 0 10px; line-height: 1.2; } h2 { font-size: 1.12rem; margin: 0 0 10px; line-height: 1.3; } h3 { font-size: 1rem; margin: 12px 0 6px; }
.muted { color: var(--muted); } .small { font-size: .87rem; } .center { text-align: center; } .spaced { margin-top: 22px; }
.danger-text { color: var(--bad) !important; }
.lede { font-size: 1.12rem; color: var(--muted); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ── Top bar ── */
.topbar { background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 60; }
.topbar-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; }
.brand { color: #fff; font-weight: 750; font-size: 1.12rem; white-space: nowrap; }
.top-search { flex: 1 1 auto; max-width: 520px; position: relative; margin: 0 auto 0 8px; }
.top-search input { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); color: #fff; min-height: 38px; padding-right: 64px; }
.top-search input::placeholder { color: rgba(255,255,255,.82); }
.top-search input:focus { background: var(--paper); color: var(--ink); }
.kbd-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.45); border-radius: 5px; padding: 0 5px; pointer-events: none; }
.top-search input:focus + .kbd-hint { display: none; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.top-actions .btn { background: #fff; color: var(--head); border-color: #fff; }
.top-link { color: #fff; padding: 7px 10px; border-radius: 8px; font-size: .93rem; }
.top-link:hover { background: rgba(255,255,255,.14); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: #fff; padding: 7px 10px; border-radius: 8px; font-size: .93rem; }
.nav a:hover { background: rgba(255,255,255,.14); }
.nav a.cta { background: #ffd56b; color: #231a00; font-weight: 700; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: inherit; font: inherit; font-size: 1.05rem; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--soft); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.14); }
.side-toggle { display: none; color: #fff; }

/* ── Layout: sidebar and content ── */
.shell { flex: 1 0 auto; display: block; }
.has-side .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.content { padding: 22px 28px 48px; min-width: 0; }
body:not(.has-side) .content { max-width: 1100px; margin: 0 auto; width: 100%; padding: 22px 16px 48px; }
.width-normal .content > .note-page, .width-normal .content > .narrow-read { max-width: 1180px; }
.sidebar { background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 14px 10px 24px; font-size: .93rem; }
.side-quick { padding: 0 4px 8px; }
.side-mini { margin-top: 8px; justify-content: space-between; }
.mini { color: var(--ink); font-size: .85rem; padding: 4px 6px; border-radius: 7px; }
button.mini { text-decoration: none; color: var(--ink); }
.mini:hover { background: var(--soft); }
.side-h { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 8px 4px; }
.side-list { list-style: none; margin: 4px 0 0; padding: 0; }
.side-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink); min-height: 34px; }
.side-list a:hover { background: var(--soft); }
.side-list a.on { background: var(--accent-soft); font-weight: 650; }
.side-list .ic { width: 1.3em; text-align: center; flex: none; }
.side-list .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list .count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.side-list li.child a { padding-left: 34px; }
.side-list a.add { color: var(--muted); font-size: .87rem; }
.side-list.bottom { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--nd); flex: none; }
.badge { display: inline-block; font-size: .72rem; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
@media (max-width: 900px) {
  .has-side .shell { display: block; }
  .side-toggle { display: inline-flex; }
  .sidebar { position: fixed; z-index: 70; top: 56px; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .18s ease; box-shadow: 0 0 30px rgba(0,0,0,.25); visibility: hidden; }
  .side-open .sidebar { transform: none; visibility: visible; }
  .side-open::after { content: ''; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.35); z-index: 65; }
  .content { padding: 16px 14px 40px; }
}
@media (max-width: 640px) {
  .hide-sm, .kbd-hint, .brand + .top-search { display: none; }
  .show-sm-only { display: inline; }
  .topbar-row { gap: 6px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ── Cards, forms, buttons ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 580px; margin-left: auto; margin-right: auto; }
.card.danger { border-color: var(--bad-line); }
.card.empty { text-align: center; padding: 34px 20px; }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.card-list > li.card { margin: 0; padding: 14px 16px; }
.card-list h3 { margin-top: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; } .gap { gap: 8px; } .grow { flex: 1 1 180px; min-width: 0; } .wrap-ok { flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.card .grid.two { gap: 0 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 4px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; min-height: 40px; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.outline { background: transparent; color: var(--accent); }
.btn.small { padding: 5px 11px; font-size: .86rem; min-height: 32px; border-radius: 8px; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.btn.linkish, .linkish { background: none; border: 0; padding: 0 4px; min-height: 24px; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; }
.btn.small.linkish { font-size: .86rem; }
.field { margin-bottom: 12px; min-width: 0; }
fieldset { min-width: 0; }
fieldset.box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 12px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 4px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 6px 0; }
label.check input { margin-top: 4px; flex: none; }
.row > label { margin-bottom: 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--field); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
.row > input:not([type=checkbox]):not([type=radio]), .row > select { width: auto; }
.row > input.grow, .row > select.grow { flex: 1 1 160px; }
textarea { resize: vertical; }
input.short { max-width: 170px; }
.code-box { font: .8rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.hint { font-size: .83rem; color: var(--muted); margin: 4px 0 0; }
.hp { position: absolute; left: -9999px; }
.inline-form { display: inline; }
.with-prefix { display: flex; align-items: stretch; }
.with-prefix > span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--field); border-right: 0; border-radius: 8px 0 0 8px; background: var(--soft); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.with-prefix input { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.file-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; padding: 5px 12px; min-height: 34px; font-size: .88rem; font-weight: 600; cursor: pointer; margin: 0; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; }
.file-btn:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.meter { height: 10px; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.flash, .alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.flash.ok, .alert.ok { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.flash.error, .alert.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.alert p { margin: 4px 0; }
.alert a, .flash a { color: inherit; font-weight: 600; }
.flash .btn.outline { color: inherit; border-color: currentColor; }
.members li, .people li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--soft); padding: 8px 0; }
.people li { padding: 3px 0; border: 0; }
.howto dt { font-weight: 700; margin-top: 10px; }
.howto dd { margin: 2px 0 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.table th, table.table td { padding: 8px 10px; border-bottom: 1px solid var(--soft); text-align: left; vertical-align: top; }
table.table thead th { font-size: .8rem; color: var(--muted); border-bottom-color: var(--line); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; }
.crumbs { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.mini-details summary { cursor: pointer; font-size: .86rem; color: var(--accent); margin: 6px 0; }
details.paste { margin: 4px 0 14px; } details.paste summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

/* ── Lists of notes ── */
.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.list-head h1 { margin-bottom: 2px; }
.list-head p { margin: 0; }
.sort-form label { margin: 0; font-weight: 500; }
.list-sub { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; margin: 8px 0 10px; font-size: .9rem; }
.bulk-bar label { margin: 0; font-weight: 500; }
.bulk-bar select { width: auto; max-width: 100%; min-height: 32px; padding: 4px 8px; }
.bulk-bar.active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: start; background: var(--nc, var(--paper)); border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px 10px 10px; }
.note-item:hover { border-color: var(--field); }
.note-item .pick { margin: 5px 2px 0; width: 18px; height: 18px; }
.note-link { display: block; color: var(--ink); min-width: 0; }
.note-link::after { content: ''; position: absolute; inset: 0 0 0 36px; border-radius: 11px; }   /* the whole card opens the note */
.note-link:focus-visible { outline: none; }
.note-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 1px; }
.nt-title { display: block; font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; }
.nt-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }
.nt-meta { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.nt-meta .checks.all { color: var(--good); }
.nt-meta .due { color: var(--warn); font-weight: 600; }
.note-item .tag-row { grid-column: 2; position: relative; z-index: 1; margin-top: 6px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; }
.pin { margin-right: 4px; font-size: .9em; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag { display: inline-flex; align-items: center; font-size: .78rem; padding: 1px 8px; border-radius: 99px; background: var(--nc, var(--soft)); border: 1px solid var(--line); color: var(--ink); }
.tag:hover { border-color: var(--field); }
.tag-row form { display: inline-flex; align-items: center; }
.tag-row .x { border: 0; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; min-width: 26px; min-height: 26px; border-radius: 6px; }
.tag-row .x:hover { color: var(--bad); background: var(--soft); }
.tag-manage li { margin-bottom: 8px; padding: 10px 14px; }

/* ── A note ── */
.note-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.note-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.save-state { color: var(--muted); min-width: 4em; }
.save-state.busy { color: var(--muted); font-style: italic; }
.save-state.error { color: var(--bad); font-weight: 650; }
.presence { background: var(--accent-soft); color: var(--ink); padding: 2px 10px; border-radius: 99px; }
.presence:empty { display: none; }
.note-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.width-normal .note-main { max-width: 820px; }
.note-main { min-width: 0; background: var(--nc, transparent); border-radius: 14px; }
.note-page:not(.c-none)[class*=" c-"] .note-main { padding: 14px; border: 1px solid var(--line); }
.note-title { font-size: 1.7rem; font-weight: 750; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 4px 2px; min-height: 0; margin-bottom: 8px; }
.note-title:focus { border-bottom-color: var(--accent); outline: none; }
.note-title:focus-visible { outline: none; }
.note-title-read { font-size: 1.7rem; margin: 4px 0 12px; overflow-wrap: anywhere; }
.note-body-raw { min-height: 380px; }
.tox-tinymce { border-radius: 10px !important; border-color: var(--line) !important; }
.editor-hint { margin-top: 6px; }
.note-foot { margin: 10px 0 18px; }
.note-side { font-size: .92rem; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding-right: 4px; }
.note-side section { border-bottom: 1px solid var(--line); padding: 12px 0; }
.note-side section:first-child { padding-top: 0; }
.note-side section:last-child { border-bottom: 0; }
.note-side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.note-side h2 .hint { text-transform: none; letter-spacing: 0; }
.note-side .row > .btn { flex: none; }
.more-list li { padding: 3px 0; }
.more-list .linkish { padding: 0; }
.swatches fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--nd); border: 1px solid var(--field); margin: 0; cursor: pointer; }
.swatch.c-none { background: linear-gradient(135deg, var(--paper) 45%, var(--bad) 45%, var(--bad) 55%, var(--paper) 55%); }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch:has(input:checked)::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #111; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.attachments { margin-top: 8px; }
.attachments h2, .note-main > section h2 { font-size: .95rem; }
.att-list { list-style: none; padding: 0; margin: 0 0 8px; }
.att-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.att-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.att-ic { width: 44px; text-align: center; font-size: 1.4rem; }
.link-list li { padding: 3px 0; }
.backlinks { margin-top: 22px; }
@media (max-width: 1100px) { .note-grid { grid-template-columns: 1fr; } .note-side { position: static; max-height: none; overflow: visible; } }
.focus-mode .topbar, .focus-mode .sidebar, .focus-mode .note-side, .focus-mode .site-footer, .focus-mode .crumbs, .focus-mode .attachments, .focus-mode .editor-hint, .focus-mode .note-foot, .focus-mode .note-main > section { display: none !important; }
.focus-mode .shell { display: block; }
.focus-mode .note-grid { grid-template-columns: 1fr; }
.focus-mode .note-main { max-width: 780px; margin: 0 auto; }
.focus-mode .content { padding-top: 12px; }

/* ── What a note says, read (and on shared and public pages) ── */
.prose { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.65; }
.prose.size-s, .size-s .prose { font-size: .93rem; } .prose.size-l, .size-l .prose { font-size: 1.15rem; }
.font-serif .prose { font-family: Charter, 'Iowan Old Style', Georgia, 'Times New Roman', serif; }
.font-mono .prose { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .94em; }
.prose h1, .prose h2 { font-size: 1.35em; margin: 1.2em 0 .4em; } .prose h3 { font-size: 1.15em; margin: 1.1em 0 .35em; } .prose h4 { font-size: 1em; margin: 1em 0 .3em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 .8em; }
.prose ul, .prose ol { padding-left: 1.6em; margin: 0 0 .8em; }
.prose li { margin: .15em 0; }
.prose ul.checklist { list-style: none; padding-left: .2em; }
.prose ul.checklist > li { position: relative; padding-left: 1.75em; }
.prose ul.checklist > li::before { content: ''; position: absolute; left: 0; top: .28em; width: 1.05em; height: 1.05em; border: 2px solid var(--field); border-radius: 4px; background: var(--paper); }
.prose ul.checklist > li.done::before { background: var(--accent); border-color: var(--accent); }
.prose ul.checklist > li.done::after { content: ''; position: absolute; left: .36em; top: .4em; width: .3em; height: .6em; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.prose ul.checklist > li.done { color: var(--muted); text-decoration: line-through; }
.prose blockquote { margin: 0 0 .8em; padding: .2em 1em; border-left: 4px solid var(--accent); color: var(--muted); }
.prose pre { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .88em; line-height: 1.5; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--soft); border-radius: 4px; padding: .05em .3em; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); }
.prose img { height: auto; border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.prose figure { margin: 0 0 1em; } .prose figcaption { font-size: .88em; color: var(--muted); }

/* ── History ── */
.version-title { font-weight: 650; }
.diff { overflow-wrap: anywhere; line-height: 1.7; }
.diff del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.diff ins { background: var(--good-bg); color: var(--good); text-decoration: underline; }
.current { border-color: var(--accent); }

/* ── The note finder (Ctrl K) ── */
.dialog-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(10, 8, 20, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 12px 12px; }
.dialog { background: var(--paper); color: var(--ink); width: min(640px, 100%); border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.35); padding: 12px; border: 1px solid var(--line); }
.dialog input { font-size: 1.05rem; min-height: 46px; }
#swList { list-style: none; margin: 8px 0 4px; padding: 0; max-height: 52vh; overflow-y: auto; }
#swList li { padding: 8px 10px; border-radius: 9px; cursor: pointer; border-left: 3px solid transparent; }
#swList li[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
#swList .sw-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
#swList .sw-meta { display: block; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#swList .sw-none { color: var(--muted); cursor: default; }

/* ── Landing ── */
.hero { padding: 30px 0 20px; max-width: 780px; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 2.5rem); }
.hero .lede { font-size: 1.15rem; }
.features { margin-top: 18px; }
.features .card h2, .features .card h3 { margin-top: 0; }

/* ── Shared notes and public notebooks ── */
.public-page .content { max-width: 1000px; }
.public-note { max-width: 760px; margin: 0 auto; }
.public-note-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.site-page { max-width: 760px; margin: 0 auto; }
.site-head { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 10px; }
.site-name { margin: 0; font-size: 1rem; font-weight: 700; }
.site-name a { color: var(--accent); text-decoration: none; }
.site-name a:hover, .site-name a:focus-visible { text-decoration: underline; }
.site-intro { color: var(--muted); }
.site-page section > h2 { font-size: 1rem; margin-top: 18px; }
ul.site-list { list-style: none; padding: 0; margin: 0; }
ul.site-list li { padding: 10px 0; border-bottom: 1px solid var(--soft); }
ul.site-list a { font-weight: 600; font-size: 1.05rem; }
.site-pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ── Quick-note popup, print, and the footer ── */
.popup .topbar, .popup .site-footer { display: none; }
.popup .content { padding: 14px; }
.bookmarklet { cursor: grab; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--muted); font-size: .92rem; margin-top: auto; }
.site-footer p { margin: 4px 0; }
.has-side .site-footer { padding-left: 264px; }
@media (max-width: 900px) { .has-side .site-footer { padding-left: 0; } }
.print-page .content { max-width: 800px; }
@media print {
  body { background: #fff; color: #000; display: block; }
  .topbar, .sidebar, .site-footer, .no-print, .flash, .note-side, .attachments form, .editor-hint, .skip { display: none !important; }
  .has-side .shell, .note-grid { display: block; }
  .content { padding: 0 !important; }
  .prose a { color: #000; }
  .prose ul.checklist > li::before { border-color: #000; }
  .prose ul.checklist > li.done::before { background: #000; }
  .prose pre, .prose code, .prose th { background: #f4f4f4; }
}
