/* notes. The same paper and ink as tasks and canvas (the base below is canvas's, 2026-10-12): neutral grey paper,
   one sans, small grey text links. The sidebar is shared.css's; the editor is notes-editor.css. */

:root {
  --bg: #f8f8f6; /* a slight off-white (2026-09-23, lightened from #f5f5f2 the same day), so white boxes stand off it */
  --ink: #1a1a1a;
  --muted: #737373;
  --faint: #dcdcdc;
  --hover: #eeeeeb;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text: var(--ui);
  --late: #b8473a;
  --snap: #c93aa0;
  --c1: #f2b8b8; --c2: #f3cc9f; --c3: #e9dc8a; --c4: #badca6;
  --c5: #a6dccf; --c6: #b0ccf1; --c7: #cdbff3; --c8: #ecb9dc;
  --node-bg: #ececec;
  --dot: color-mix(in srgb, var(--muted) 28%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1); --fast: .18s; --mid: .32s; --slow: .5s;
  --live-1: #c2410c; --live-2: #1d4ed8; --live-3: #047857; --live-4: #7e22ce; --live-5: #be123c; --live-6: #0e7490;
  --shadow: 0 10px 30px rgba(0, 0, 0, .14);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #151515; --ink: #e8e8e8; --muted: #8f8f8f; --faint: #333333; --hover: #222222;
  --late: #e0705f; --snap: #ff7ad0;
  --c1: #6e2f2f; --c2: #6d4524; --c3: #5f561c; --c4: #2f5128;
  --c5: #1f4e46; --c6: #264264; --c7: #41326b; --c8: #5e2c52;
  --node-bg: #222222;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.theme-shift, .theme-shift * { transition: background-color var(--mid) var(--ease), color var(--mid) var(--ease), border-color var(--mid) var(--ease) !important; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.fine { font-size: 12px; }
.spacer { flex: 1; }
.err { color: var(--late); margin: 8px 0 0; font-size: 13px; }
a { color: inherit; }
h2 { font-weight: 400; font-size: 22px; margin: 0 0 14px; }

/* ---------- text links, icon buttons, the theme disc ---------- */

button.link, a.link {
  background: none; border: 0; padding: 0; margin: 0; color: var(--muted); font: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
  transition: color var(--fast) var(--ease);
}
button.link:hover, a.link:hover, button.link:focus-visible, a.link:focus-visible { color: var(--ink); outline: none; }
button.link:disabled { opacity: .4; cursor: default; }
button.link.strong { color: var(--ink); font-weight: 500; }
button.link.toggle.on { color: var(--ink); font-weight: 600; }
button.link .ic { width: 14px; height: 14px; }
.ic { width: 15px; height: 15px; flex-shrink: 0; }
button.ib {
  background: none; border: 0; padding: 5px; margin: 0; border-radius: 6px; color: var(--muted); cursor: pointer; line-height: 0;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
button.ib:hover, button.ib:focus-visible { color: var(--ink); background: var(--hover); outline: none; }
button.ib .ic { width: 16px; height: 16px; }
button.ib.toggle-ib.on { color: var(--ink); background: var(--hover); }
.wordmark { font-family: var(--text); font-weight: 400; font-size: 40px; letter-spacing: -0.02em; margin: 0; text-decoration: none; color: var(--ink); }
.wordmark.small { font-size: 19px; }
kbd { display: inline-block; min-width: 18px; text-align: center; font: 11px/1 var(--ui); padding: 3px 5px; border: 1px solid var(--faint); border-bottom-width: 2px; border-radius: 4px; color: var(--ink); background: var(--bg); }
input[type="text"], input[type="number"] {
  font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--faint); border-radius: 0;
  padding: 6px 0; min-width: 0; outline: none; transition: border-color var(--fast) var(--ease);
}
input:focus { border-bottom-color: var(--ink); }
input::placeholder { color: var(--muted); opacity: .7; }

/* ---------- tooltips, menus, the confirmation card, the note ---------- */

#tip {
  position: fixed; z-index: 90; max-width: 280px; padding: 6px 10px; border-radius: 6px;
  background: var(--ink); color: var(--bg); font: 12px/1.45 var(--ui); pointer-events: none;
}
#tip kbd { border-color: color-mix(in srgb, var(--bg) 40%, transparent); color: var(--bg); background: transparent; margin-left: 4px; }
@media (hover: none) { #tip { display: none !important; } }

.ctx {
  position: fixed; z-index: 60; min-width: 190px; max-height: calc(100vh - 12px); overflow-y: auto; padding: 4px 0;
  background: var(--bg); color: var(--ink); border: 1px solid var(--faint); border-radius: 8px;
  box-shadow: var(--shadow); font-size: 13px;
}
.ctx .ctx-head { padding: 5px 12px 3px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.ctx button.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 5px 12px; border: 0; background: none; color: var(--ink); font: 13px var(--ui); cursor: pointer; }
.ctx button.item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx button.item .ic { color: var(--muted); width: 14px; height: 14px; }
.ctx button.item:not(:has(.ic)) { padding-left: 36px; }
.ctx button.item:hover:not(:disabled) { background: var(--hover); }
.ctx button.item:disabled { opacity: .4; cursor: default; }
.ctx button.item.danger, .ctx button.item.danger .ic { color: var(--late); }
.ctx button.item.on span { font-weight: 600; }
.ctx button.item kbd { color: var(--muted); font: 11px var(--ui); border: 0; padding: 0; background: none; min-width: 0; }
.ctx .ctx-row { display: flex; gap: 2px; padding: 3px 8px 3px 12px; align-items: center; }
.ctx .ctx-row-label { width: 72px; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.ctx .ctx-row button.link { font-size: 12px; padding: 3px 6px; border-radius: 5px; }
.ctx .ctx-row button.link:hover { background: var(--hover); }
.ctx .ctx-row button.link.on { color: var(--ink); font-weight: 600; }
.ctx .ctx-row button.ib { padding: 4px; }
.ctx .ctx-row button.ib.on { color: var(--ink); background: var(--hover); }
.ctx .ctx-row button.sw, .ctx .ctx-row button.sw:hover { padding: 0; margin: 0 2px; border-radius: 50%; background: var(--sw); }
.ctx .ctx-sep { height: 1px; background: var(--faint); margin: 4px 0; }
.font-menu { width: 260px; max-height: min(520px, calc(100vh - 80px)); }
.font-menu button.item span { font-size: 15px; }
.font-search { padding: 4px 12px 6px; position: sticky; top: -4px; background: var(--bg); z-index: 1; }
.font-search input { width: 100%; font-size: 13px; }

.ask {
  position: fixed; z-index: 80; width: 290px; max-width: calc(100vw - 16px); padding: 12px 14px 8px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--faint); border-radius: 10px;
  box-shadow: var(--shadow); font: 13px/1.45 var(--ui);
}
.ask p { margin: 0 0 10px; overflow-wrap: anywhere; }
.ask .ask-input { width: 100%; margin: -4px 0 10px; }
.ask-foot { display: flex; justify-content: flex-end; gap: 18px; padding-top: 6px; border-top: 1px solid var(--faint); }
.ask-foot .link.danger { color: var(--late); }

#note {
  position: fixed; z-index: 85; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: baseline; max-width: calc(100vw - 32px);
  padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: var(--shadow);
}
#note.err { background: var(--late); color: #fff; }
/* On a board the dock is at the bottom middle: the note sits above it, so it never covers the buttons. */
body:has(.dock:not([hidden])) #note { bottom: 72px; }
@media (max-width: 700px) { body:has(.dock:not([hidden])) #note { bottom: calc(66px + env(safe-area-inset-bottom)); } }
#note .link { color: color-mix(in srgb, var(--bg) 70%, transparent); }
#tip, .ctx, .ask, #note { transition: opacity var(--fast) var(--ease), translate var(--fast) var(--ease), display var(--fast) allow-discrete; }
#tip[hidden], .ctx[hidden], .ask[hidden], #note[hidden] { opacity: 0; translate: 0 4px; }
@starting-style { #tip, .ctx, .ask, #note { opacity: 0; translate: 0 6px; } }

dialog {
  background: var(--bg); color: var(--ink); border: 1px solid var(--faint); border-radius: 8px;
  padding: 24px 28px; width: min(560px, 92vw); max-height: calc(100dvh - 32px); font-size: 14px;
  transition: opacity var(--mid) var(--ease), translate var(--mid) var(--ease), overlay var(--mid) allow-discrete, display var(--mid) allow-discrete;
}
dialog[open] { opacity: 1; translate: 0 0; }
dialog:not([open]) { opacity: 0; translate: 0 6px; }
@starting-style { dialog[open] { opacity: 0; translate: 0 6px; } }
dialog::backdrop { background: rgba(0, 0, 0, .25); transition: background-color var(--mid) var(--ease), overlay var(--mid) allow-discrete, display var(--mid) allow-discrete; }
dialog:not([open])::backdrop { background-color: transparent; }
@starting-style { dialog[open]::backdrop { background-color: transparent; } }
.dialog-foot { display: flex; gap: 18px; align-items: baseline; justify-content: flex-end; margin-top: 22px; font-size: 13px; }

/* ---------- signed out, missing board ---------- */

#app.gate {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 40px; text-align: center;
}
#app.gate > * { animation: rise var(--slow) var(--ease) both; }
#app.gate > *:nth-child(2) { animation-delay: .12s; }
#app.gate > *:nth-child(3) { animation-delay: .2s; }
#app.gate p { max-width: 380px; margin: 0; }
.signin { font-size: 18px; color: var(--ink) !important; border-bottom: 1px solid var(--faint) !important; padding-bottom: 2px !important; }
.signin:hover { border-bottom-color: var(--ink) !important; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- the app: notes on the left, the open one beside them ---------- */

#app.notes-page { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100dvh; animation: fade var(--mid) var(--ease) both; }
#app.notes-page .sidebar { height: 100dvh; }
.tag { font: 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-left: -4px; }
/* The search box and the rows: a title, and the first words under it in grey. */
.find-row { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px; padding: 0 var(--side-pad); color: var(--muted); }
.find-row input[type="text"] { flex: 1; font-size: 13px; padding: 5px 0; }
.note-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 1px; }
.note-row .t { font-size: 14px; }
.note-row .t.untitled { color: var(--muted); }
.note-row .p { grid-column: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.note-row .badge { grid-column: 2; grid-row: 1; font: 10px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.note-row.archived .t { color: var(--muted); }
.nav .empty-line { color: var(--muted); font-size: 13px; padding: 4px var(--side-pad); margin: 0; }
.nav details summary { list-style: none; cursor: pointer; }
.nav details summary::-webkit-details-marker { display: none; }

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100dvh; padding: 16px 28px 0; }
.ne-act.back { display: none; }
.shared-logo { font-size: 22px !important; margin-right: 10px; }
.shared-logo .logo-sub { font-size: 10px !important; }
.editor-host { flex: 1; min-height: 0; }
.blank { margin: 26vh auto 0; text-align: center; color: var(--muted); font-size: 16px; animation: rise var(--slow) var(--ease) both; }
.blank button { margin-top: 14px; font-size: 15px; }

/* Share: the read link and the edit link, each on, off, copy, reset. */
dialog.share-note { width: min(480px, 92vw); }
dialog.share-note h2 { font-size: 20px; font-weight: 500; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--faint); }
.share-row b { display: block; font-weight: 500; font-size: 14px; }
.share-row .muted { font-size: 12px; }
.share-acts { display: flex; gap: 14px; flex-shrink: 0; font-size: 13px; }

/* Phones: the list, or the open note with a way back. */
@media (max-width: 760px) {
  #app.notes-page { grid-template-columns: minmax(0, 1fr); }
  #app.notes-page.has-note .sidebar { display: none; }
  #app.notes-page:not(.has-note) .pane { display: none; }
  #app.notes-page .sidebar { box-shadow: none; }
  .pane { padding: calc(10px + env(safe-area-inset-top)) 12px 0; }
  .ne-act.back { display: inline-flex; }
}
