/* Risorgi online. The look is the Mac app's (Risorgi/Views/Theme.swift, Brand): a grey
   page, white cards, dark ink. Every colour is one of the names below; nothing else is
   coloured, except a space, which has the colour it was given. */

:root {
  --ink: rgb(28 28 31);
  --body: rgb(60 60 66);
  --muted: rgb(118 118 126);
  --faint: rgb(166 166 174);
  --line: rgb(0 0 0 / 0.08);
  --canvas: rgb(246 246 247);
  --page: rgb(255 255 255);
  --card: rgb(255 255 255);
  --tile: rgb(234 234 237);
  --floating: rgb(255 255 255 / 0.86);
  --chosen: rgb(0 0 0 / 0.075);
  --hover: rgb(0 0 0 / 0.04);
  --glyph: rgb(140 140 148);
  --recording: rgb(226 62 52);
  --sidebar: rgb(238 238 240);
  --lift: 0 4px 12px rgb(0 0 0 / 0.10);
  --card-shadow: 0 0 0 1px rgb(0 0 0 / 0.05), 0 1px 2px rgb(0 0 0 / 0.04);
  --chip: rgb(92 108 196 / 0.13);
  --chip-ink: rgb(70 84 170);
  --wash: rgb(255 219 77 / 0.55);
  --selection: rgb(10 132 255 / 0.55);
  --ring: linear-gradient(135deg, rgb(86 196 240), rgb(113 140 230), rgb(180 140 240), rgb(236 130 200), rgb(246 196 120));
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: rgb(242 242 245);
    --body: rgb(214 214 220);
    --muted: rgb(152 152 160);
    --faint: rgb(106 106 114);
    --line: rgb(255 255 255 / 0.10);
    --canvas: rgb(24 24 26);
    --page: rgb(28 28 30);
    --card: rgb(40 40 43);
    --tile: rgb(48 48 52);
    --floating: rgb(46 46 50 / 0.80);
    --chosen: rgb(255 255 255 / 0.13);
    --hover: rgb(255 255 255 / 0.06);
    --glyph: rgb(164 164 172);
    --recording: rgb(244 86 74);
    --sidebar: rgb(32 32 35);
    --lift: 0 4px 12px rgb(0 0 0 / 0.40);
    --card-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
    --chip: rgb(130 146 240 / 0.20);
    --chip-ink: rgb(170 182 250);
    --wash: rgb(217 179 51 / 0.38);
    --selection: rgb(64 156 255 / 0.65);
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font: 14px/1.4 var(--sans);
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: default; }
a { color: inherit; text-decoration: none; }
.icon { display: block; flex: none; }
[hidden] { display: none !important; }

/* The window: sidebar, the library, the Info pane. */

.app { display: flex; height: 100%; }
.sidebar {
  width: var(--side-width, 230px); flex: none; display: flex; flex-direction: column; position: relative;
  background: var(--sidebar); border-right: 1px solid var(--line);
}
.app.no-sidebar .sidebar { display: none; }
.side-top { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.side-rows { flex: 1; overflow-y: auto; padding: 6px 10px 10px; scrollbar-width: thin; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 4px; padding: 0 9px; height: 26px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.side-head button { color: var(--body); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.side-head button:hover { background: var(--hover); }
.row {
  display: flex; align-items: center; gap: 10px; height: 34px; margin: 2px 0; padding: 0 9px; position: relative;
  border-radius: 9px; color: var(--body); font-weight: 500; white-space: nowrap;
}
.row:hover { background: var(--hover); }
.row.chosen { background: var(--chosen); color: var(--ink); }
.row .glyph { width: 22px; display: grid; place-items: center; flex: none; }
.row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.row .count { font-size: 11.5px; color: var(--faint); font-weight: 500; }
.side-foot { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 12px 4px 14px; }
.side-foot img { width: 30px; height: 30px; object-fit: contain; }
.side-foot .word { flex: 1; font-size: 16px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }

.pill {
  display: inline-flex; align-items: center; height: 36px; padding: 0 4px; border-radius: 18px;
  background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgb(0 0 0 / 0.06);
  backdrop-filter: blur(20px);
}
.pill button, .round {
  width: 34px; height: 28px; display: grid; place-items: center; border-radius: 14px; color: var(--muted);
}
.pill button:hover, .round:hover { background: var(--hover); color: var(--ink); }
.pill button:disabled { color: var(--faint); background: none; }
.pill button.on { color: var(--ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
/* The toolbar: what is on the left, the title in the middle whatever the sides hold (the Mac's
   principal item), the tools on the right. */
.bar {
  height: 52px; flex: none; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  align-items: center; gap: 10px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--canvas);
}
.bar-start { display: flex; align-items: center; gap: 8px; justify-self: start; }
.bar > .pill:last-child { justify-self: end; }
.bar .title {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; max-width: 420px; justify-self: center;
  font-size: 13px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink);
}
.bar .title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 6px; border-radius: 6px; }
.bar .title .name.renamable:hover { background: var(--hover); }
.bar .title .count {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; flex: none;
  font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--muted); background: var(--tile);
}
.title-field {
  height: 24px; border: 0; outline: 0; border-radius: 6px; padding: 0 8px; background: var(--tile);
  font: 600 13px/1 var(--sans); letter-spacing: -0.2px; color: var(--ink); text-align: left;
}
.bar .show-side { display: none; }
.app.no-sidebar .bar .show-side { display: grid; }

.content { flex: 1; overflow-y: auto; position: relative; }
.content.reading { background: var(--page); }
.grid { position: relative; margin: 22px 22px 78px; }
.grid .card { position: absolute; display: block; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px; }
.empty .big { color: var(--glyph); margin: 0 auto 14px; width: 40px; }

/* Cards. Sizes are CardMetrics' in the Mac app. */

.tile {
  position: relative; border-radius: 10px; overflow: hidden; background: var(--tile);
  box-shadow: var(--card-shadow);
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.18s; }
.tile img.in { opacity: 1; }
img.at-once { transition: none !important; }
.tile.paper { display: grid; place-items: center; }
.tile.paper.pdf { padding: 14px; }
.tile.paper.pdf img { object-fit: contain; box-shadow: 0 1px 4px rgb(0 0 0 / 0.18); height: auto; max-height: 100%; }
.tile.paper .glyph { color: var(--glyph); }
.card:hover .tile { box-shadow: 0 0 0 1px rgb(0 0 0 / 0.10), 0 3px 10px rgb(0 0 0 / 0.08); }
.card.picked .tile { box-shadow: 0 0 0 2px transparent; background-clip: padding-box; outline: 2px solid transparent; }
.card.picked .tile::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px; padding: 2px; background: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.sheet .title {
  font-size: 14px; line-height: 17px; font-weight: 600; color: var(--ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.sheet .excerpt {
  margin-top: 6px; font-size: 12.5px; line-height: 15px; color: var(--muted); white-space: pre-line;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden;
}
.sheet.link .excerpt { -webkit-line-clamp: 4; }
.sheet .site { height: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.sheet.starred .title { padding-right: 22px; }
.sheet.quote .mark { height: 12px; color: var(--faint); }
.sheet.quote .words {
  margin-top: 8px; font: 14.5px/19px var(--serif); color: var(--ink); white-space: pre-line;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 9; overflow: hidden;
}
.sheet.quote .source { margin-top: 8px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.sound { padding: 10px; }
.tile.sound .inner { background: var(--card); border-radius: 7px; padding: 12px 12px 24px; min-height: 68px; font-size: 13px; line-height: 16px; color: var(--body); }
.tile.sound .inner .words { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.badge.play { right: 8px; bottom: 8px; }
.caption { padding: 8px 2px 0; }
.caption .sub { margin-top: 2px; font-size: 10.5px; line-height: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }

/* An item, open. */

.reader { max-width: 760px; margin: 0 auto; padding: 34px 40px 120px; color: var(--ink); font-size: 16px; line-height: 1.5; }
.reader h1 { font-size: 26px; line-height: 1.2; margin: 0 0 22px; letter-spacing: -0.01em; }
.reader h2 { font-size: 20px; line-height: 1.25; margin: 30px 0 8px; }
.reader h3, .reader h4 { font-size: 17px; margin: 24px 0 6px; }
.reader p { margin: 0 0 16px; }
.reader a { color: var(--chip-ink); }
.reader a:hover { text-decoration: underline; }
.reader a.item-link { background: var(--chip); border-radius: 5px; padding: 1px 6px; text-decoration: none; white-space: nowrap; }
.reader code { font: 0.88em var(--mono); background: var(--tile); border-radius: 4px; padding: 1px 5px; }
.reader pre { background: var(--tile); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0 0 16px; }
.reader pre code { background: none; padding: 0; }
.reader mark { background: var(--wash); color: inherit; border-radius: 2px; }
.reader hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.reader .bullet, .reader .task { display: flex; gap: 8px; margin: 3px 0; }
.reader .bullet .dot { color: var(--muted); flex: none; min-width: 10px; }
.reader .bullet + p, .reader .task + p, .reader .bullet + h2, .reader .task + h2 { margin-top: 16px; }
.reader .task .box { width: 15px; height: 15px; margin-top: 4px; border: 1.5px solid var(--faint); border-radius: 4px; flex: none; }
.reader .task.done .box {
  border-color: var(--ink); background: var(--ink) center / 11px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  .reader .task.done .box { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E"); }
}
.reader .task.done > span:last-child { color: var(--muted); text-decoration: line-through; }
.reader .formula { font: italic 18px/1.5 var(--serif); text-align: center; margin: 22px 0; white-space: pre-wrap; }
.reader .table-wrap { overflow-x: auto; margin: 18px 0; }
.reader table { border-collapse: collapse; font-size: 15px; }
.reader th, .reader td { border: 1px solid var(--line); padding: 4px 10px; text-align: left; }
.reader th { background: var(--hover); font-weight: 650; }
.reader img.note-picture { max-width: 100%; max-height: 520px; border-radius: 8px; display: block; margin: 8px 0 16px; }
.reader .quote-source { color: var(--muted); font-size: 15px; }
/* The note editor (js/editor.js, CodeMirror): the reader's own type, marks out of sight away from the caret. */
.reader.writing { padding-top: 28px; }
.note-editor { min-height: 60vh; }
.note-editor .cm-editor { font: 16px/1.55 var(--sans); color: var(--ink); background: none; }
.note-editor .cm-editor.cm-focused { outline: none; }
.note-editor .cm-scroller { font: inherit; overflow: visible; }
.note-editor .cm-content { padding: 0 0 40vh; caret-color: var(--ink); min-height: 60vh; }
.note-editor .cm-line { padding: 0; }
.note-editor .cm-cursor { border-left: 2px solid var(--ink); }
.note-editor .cm-selectionBackground, .note-editor .cm-focused .cm-selectionBackground { background: rgb(10 132 255 / 0.18) !important; }
.note-editor .cm-placeholder { color: var(--faint); }
.note-editor .cm-title { font-size: 22px; line-height: 1.32; font-weight: 650; letter-spacing: -0.012em; padding-bottom: 8px; }
.note-editor .cm-strong { font-weight: 700; }
.note-editor .cm-em { font-style: italic; }
.note-editor .cm-strike { text-decoration: line-through; color: var(--muted); }
.note-editor .cm-link { color: var(--chip-ink); }
.note-editor .cm-mono { font: 0.88em var(--mono); background: var(--tile); border-radius: 4px; padding: 1px 4px; }
.note-editor .cm-code-line .cm-mono { background: none; padding: 0; }
.note-editor .cm-mark { color: var(--faint); font-weight: 400; font-style: normal; }
.note-editor .cm-code-line { font: 14px/1.5 var(--mono); background: var(--tile); padding: 0 14px; }
.note-editor .cm-bullet { display: inline-block; width: 1.1em; color: var(--muted); }
.note-editor .cm-task {
  display: inline-block; width: 15px; height: 15px; margin: 0 8px -2px 0; border: 1.5px solid var(--faint); border-radius: 4px; cursor: default; vertical-align: baseline;
}
.note-editor .cm-task.done { background: var(--ink); border-color: var(--ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E"); background-size: 11px; background-position: center; background-repeat: no-repeat; }
/* In the dark the box is near white, so its tick is black, as in the reader (the theme chosen in Settings follows below). */
@media (prefers-color-scheme: dark) {
  .note-editor .cm-task.done { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E"); }
}
.note-editor .cm-rule { display: inline-block; width: 100%; height: 1px; background: var(--line); vertical-align: middle; }
/* A picture or any file a note holds, on a line of its own: picked out whole, never written in. */
.note-editor .cm-attachment-line { padding: 6px 0 10px; }
.note-editor .cm-attachment { display: inline-block; vertical-align: top; max-width: 100%; border-radius: 8px; cursor: default; }
.note-editor .cm-attachment.picked { box-shadow: 0 0 0 3px var(--selection); }
.note-editor .cm-filecard {
  display: inline-flex; align-items: center; gap: 12px; min-width: 260px; max-width: min(420px, 100%); padding: 10px 14px 10px 10px;
  background: var(--card); box-shadow: var(--card-shadow); border-radius: 10px; font-size: 13px; line-height: 1.3;
}
.note-editor .cm-filecard .glyph { width: 40px; height: 40px; border-radius: 8px; background: var(--tile); color: var(--glyph); display: grid; place-items: center; flex: none; }
.note-editor .cm-filecard .texts { display: flex; flex-direction: column; min-width: 0; }
.note-editor .cm-filecard b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-editor .cm-filecard .texts > span { color: var(--muted); font-size: 12px; }
.note-editor .cm-attachment.missing { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--tile); border-radius: 6px; padding: 2px 8px; }
/* ==Highlighted words==, and a link to something in the library: a chip with the item's icon. */
.note-editor .cm-highlight { background: var(--wash); border-radius: 2px; }
.note-editor .cm-chip {
  padding: 1px 6px 2px 4px; border-radius: 5px; background: var(--chip); color: var(--chip-ink); font-weight: 550; cursor: pointer;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.note-editor .cm-chip .icon { display: inline-block; vertical-align: -1.5px; margin-right: 4px; }
.note-editor .cm-chip:hover { background: color-mix(in srgb, var(--chip-ink) 20%, transparent); }
.note-editor .cm-chip.gone { background: var(--hover); color: var(--muted); }
/* A code block is one panel; its fences are out of sight away from the caret and take hardly any room. */
.note-editor .cm-code-first { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.note-editor .cm-code-last { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.note-editor .cm-fence-line { font-size: 1px; line-height: 8px; }

/* What floats over the note: the format bar over selected words, the menus behind "/" and "[[". */
.note-floats { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 40; }
.format-bar, .note-menu {
  position: fixed; background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 4px 16px rgb(0 0 0 / 0.10);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.format-bar { display: flex; align-items: center; gap: 1px; height: 36px; padding: 0 4px; border-radius: 18px; }
.format-bar .fbutton { width: 30px; height: 28px; border-radius: 14px; display: grid; place-items: center; color: var(--body); }
.format-bar .fbutton:hover { background: var(--hover); color: var(--ink); }
.format-bar .fgap { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.note-menu { display: flex; flex-direction: column; gap: 1px; padding: 5px; border-radius: 12px; }
.slash-menu { width: 236px; max-height: min(460px, calc(100vh - 140px)); overflow-y: auto; }
.link-menu { width: 300px; }
.note-menu .nhead { padding: 3px 9px 4px; font-size: 11px; font-weight: 650; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-menu .nnone { padding: 0 9px; height: 28px; line-height: 28px; font-size: 12px; color: var(--muted); }
.note-menu .nrow { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border-radius: 7px; text-align: left; color: var(--ink); }
.link-menu .nrow { height: 38px; }
.note-menu .nrow.on { background: var(--chosen); }
.note-menu .nglyph { width: 20px; flex: none; display: grid; place-items: center; color: var(--muted); }
.note-menu .nh { font: 700 10.5px/1 ui-rounded, var(--sans); }
.note-menu .nlabel { font-size: 12.5px; font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slash-menu .nlabel { flex: 1; }
.note-menu .nsyntax { margin-left: auto; font: 11px var(--mono); color: var(--faint); }
.note-menu .ntexts { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.note-menu .ndetail { font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-menu .nrule { height: 1px; background: var(--line); margin: 3px 6px; flex: none; }
.note-menu .nfoot { display: flex; align-items: center; height: 24px; padding: 0 8px; font-size: 12px; color: var(--muted); text-align: left; }
.note-menu .nfoot .nsyntax { color: var(--muted); }

.reader textarea.source {
  width: 100%; min-height: 62vh; border: 0; outline: 0; resize: none; background: none;
  font: 16px/1.5 var(--sans); color: var(--ink); padding: 0;
}
.stage { height: 100%; display: grid; place-items: center; padding: 22px; }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: var(--card-shadow); }
.stage iframe, .stage embed { width: 100%; height: 100%; border: 0; border-radius: 8px; background: var(--tile); }
.stage.flush { padding: 0; }
.stage .holder { text-align: center; color: var(--muted); }
.stage .holder .glyph { color: var(--glyph); margin: 0 auto 12px; width: 44px; }
.stage audio { width: min(520px, 90vw); }
.stage video { max-width: 100%; max-height: 100%; border-radius: 8px; }
/* The corner of a note: how long it is, the paperclip and every shortcut. It stays in the corner of
   the window while the note scrolls under it (sticky at the foot of what scrolls, taking no room). */
.content.reading > .reader { min-height: 100%; }
.foot-pill {
  position: sticky; bottom: 14px; z-index: 6; height: 0; margin-right: 16px;
  display: flex; justify-content: flex-end; align-items: flex-end; gap: 10px; pointer-events: none;
}
.foot-pill > * { pointer-events: auto; }
.foot-pill .words {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--muted); background: var(--floating); box-shadow: 0 0 0 1px var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); pointer-events: none;
}
.corner-button {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--body); flex: none;
  background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgb(0 0 0 / 0.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.corner-button:hover { color: var(--ink); }
.corner-button.on { background: var(--ink); color: var(--page); }
.shortcuts-panel {
  position: absolute; right: 0; bottom: 40px; width: 318px; max-width: calc(100vw - 32px); max-height: min(470px, calc(100vh - 160px));
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 8px 28px rgb(0 0 0 / 0.14); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.shortcuts-panel .shead { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.shortcuts-panel .shead b { font-size: 13px; font-weight: 650; color: var(--ink); }
.shortcuts-panel .shead .round { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; color: var(--muted); }
.shortcuts-panel .sbody { overflow-y: auto; padding: 10px; }
.shortcuts-panel .stitle { padding: 14px 8px 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.shortcuts-panel .stitle:first-child { padding-top: 4px; }
.shortcuts-panel .srow { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: 7px; text-align: left; }
.shortcuts-panel button.srow:hover { background: var(--hover); }
.shortcuts-panel .sname { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortcuts-panel .sgap { flex: 1; min-width: 10px; }
.shortcuts-panel .ssyntax { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 9px;
  background: var(--tile); color: var(--ink); font-weight: 550; font-size: 13px;
}
.button:hover { filter: brightness(0.96); }
.button.strong { background: var(--ink); color: var(--page); }
.button.wide { width: 100%; height: 38px; font-size: 14px; }
.button:disabled { opacity: 0.5; }

/* The Info pane. */

.info { width: var(--info-width, 300px); flex: none; border-left: 1px solid var(--line); background: var(--canvas); overflow-y: auto; padding: 16px; }
.app.no-info .info { display: none; }
.info h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.info .kind { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.info .label { font-size: 11.5px; font-weight: 650; color: var(--muted); margin: 16px 0 6px; }
.info .facts { font-size: 12.5px; color: var(--body); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; overflow-wrap: anywhere; }
.info .facts span:nth-child(odd) { color: var(--muted); }
.info .facts a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chip-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px;
  background: var(--tile); font-size: 12px; color: var(--ink); max-width: 100%;
}
.chip .x { color: var(--muted); display: grid; place-items: center; margin-right: -3px; border-radius: 8px; }
.chip .x:hover { color: var(--ink); }
.chip.add { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chip input { border: 0; outline: 0; background: none; width: 88px; font-size: 12px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.info textarea, .field {
  width: 100%; border: 0; outline: 0; border-radius: 9px; background: var(--tile); padding: 8px 10px; font-size: 13px; resize: vertical; color: var(--ink);
}
.field { height: 36px; }
.field:focus, .info textarea:focus { box-shadow: 0 0 0 2px var(--chosen); }
.info .actions { display: grid; gap: 6px; margin-top: 18px; }
.info .actions .button { justify-content: flex-start; }

/* What floats: search, the menu, messages. */

.veil { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0.14); display: grid; justify-items: center; align-items: start; padding-top: 130px; }
.panel {
  width: min(600px, calc(100vw - 32px)); border-radius: 16px; background: var(--floating); backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgb(0 0 0 / 0.22); overflow: hidden;
}
.panel .ask { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; color: var(--muted); }
.panel .ask input, .panel .ask textarea { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); min-width: 0; }
.panel .ask .esc { font-size: 10.5px; background: var(--tile); border-radius: 5px; padding: 2px 6px; }
.panel .results { border-top: 1px solid var(--line); padding: 8px; max-height: 50vh; overflow-y: auto; }
.panel .result { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: 9px; color: var(--ink); }
.panel .result.on { background: var(--chosen); }
.panel .result .thumb { width: 26px; height: 26px; border-radius: 6px; background: var(--tile); display: grid; place-items: center; color: var(--glyph); overflow: hidden; flex: none; }
.panel .result .thumb img { width: 100%; height: 100%; object-fit: cover; }
.panel .result .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.panel .result .kind { font-size: 12px; color: var(--muted); }
.panel.capture textarea { height: 120px; resize: none; padding: 16px 18px; width: 100%; border: 0; outline: 0; background: none; font-size: 16px; line-height: 1.45; color: var(--ink); display: block; }
.panel .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 10px 14px; font-size: 12px; color: var(--muted); }

.menu {
  position: fixed; z-index: 30; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--floating); backdrop-filter: blur(30px);
  box-shadow: 0 0 0 1px var(--line), var(--lift);
}
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 9px; border-radius: 7px; font-size: 13px; color: var(--ink); text-align: left; }
.menu button:hover { background: var(--chosen); }
.menu button .tick { margin-left: auto; color: var(--muted); }
.menu .rule { height: 1px; background: var(--line); margin: 5px 8px; }

/* Settings, and the screens before the library. */

.sheet-veil { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / 0.22); display: grid; place-items: center; padding: 16px; }
.settings { width: min(560px, 100%); max-height: min(680px, 100%); overflow-y: auto; border-radius: 16px; background: var(--canvas); box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgb(0 0 0 / 0.3); padding: 20px 22px 22px; }
.settings h2 { margin: 0; font-size: 17px; color: var(--ink); }
.settings .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.settings h3 { margin: 20px 0 8px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.settings .box { background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); }
.settings .line { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px; border-top: 1px solid var(--line); }
.settings .line:first-child { border-top: 0; }
.settings .line .what { flex: 1; min-width: 0; }
.settings .line .what b { display: block; font-weight: 550; color: var(--ink); font-size: 13.5px; }
.settings .line .what span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 1px; overflow-wrap: anywhere; }
.settings .note { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 8px 2px 0; }
.switch { width: 38px; height: 22px; border-radius: 11px; background: var(--tile); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.15s; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(16px); }
@media (prefers-color-scheme: dark) { .switch.on::after { background: rgb(28 28 30); } }
.meter { height: 6px; border-radius: 3px; background: var(--tile); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* Before the library: signing up, signing in, the code. One card in the middle with room to breathe, over
   the brand's soft light (as the welcome has it), a line of the spectrum along its top (the owner, 1 December:
   "a little small … somewhat bleak, maybe put some slight rainbow touch"). */
.door { position: relative; height: 100%; display: grid; place-items: center; padding: 32px 20px; overflow-y: auto; isolation: isolate; background: var(--canvas); }
.door::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(42% 52% at 12% 14%, rgb(86 196 240 / 0.18), transparent 70%), radial-gradient(44% 54% at 90% 20%, rgb(236 130 200 / 0.15), transparent 70%), radial-gradient(52% 48% at 50% 106%, rgb(180 140 240 / 0.16), transparent 70%); }
.door .card-box { position: relative; width: min(440px, 100%); padding: 44px 40px 34px; overflow: hidden; border-radius: 26px; text-align: center; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 40px 100px -40px rgb(0 0 0 / 0.3), 0 12px 30px -16px rgb(0 0 0 / 0.14); }
.door .card-box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--ring); }
.door img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 14px; }
.door h1 { margin: 0 0 8px; font-size: 27px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; }
.door p { margin: 0 0 26px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.door form { display: grid; gap: 12px; text-align: left; }
.door .field { height: 46px; padding: 0 14px; border-radius: 12px; font-size: 15px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); }
.door .field:focus { box-shadow: inset 0 0 0 1.5px var(--ink); outline: none; }
.door .button.wide { height: 46px; margin-top: 4px; border-radius: 12px; font-size: 15px; }
.door .problem { color: var(--recording); font-size: 13px; min-height: 18px; }
.door .small { margin-top: 18px; font-size: 13px; color: var(--muted); }
.door .small + .small { margin-top: 8px; }
.door .small a { color: var(--body); text-decoration: underline; text-underline-offset: 2px; }
.progress { width: 180px; height: 4px; border-radius: 2px; background: var(--tile); overflow: hidden; margin: 14px auto 0; }
.progress i { display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--muted); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* A narrow window: the sidebar and the Info pane slide over the library. */

@media (max-width: 760px) {
  .bar .show-side { display: grid; }
  .sidebar .side-top .side-toggle { display: none; }
  .sidebar .side-top { justify-content: flex-end; }
  .sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; box-shadow: var(--lift); width: 260px; }
  .app:not(.show-sidebar) .sidebar { display: none; }
  .info { position: fixed; z-index: 15; inset: 0 0 0 auto; box-shadow: var(--lift); width: min(300px, 88vw); }
  /* Room at the foot for the bar that floats over it, as in a wide window. */
  .grid { margin: 14px 14px 78px; }
  .reader { padding: 24px 20px 100px; }
  .veil { padding-top: 70px; }
}

/* Above the library: the Inbox's lists and the filters. */

.content-top:empty { display: none; }
.content-top { flex: none; border-bottom: 1px solid var(--line); background: var(--canvas); }
/* The Inbox (inbox.js, the Mac's InboxView): its lists as words in a capsule, a list of rows with the
   item picked out beside it, and one bar of actions floating at the foot. */
.inbox-lists { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.content-top .inbox-lists { padding: 9px 18px; }
.inbox-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 16px; background: var(--tile); min-width: 0; }
.inbox-tab { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 550; color: var(--muted); white-space: nowrap; }
.inbox-tab:hover { color: var(--ink); }
.inbox-tab.on { background: var(--card); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.inbox-tab .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.inbox-tab.on .n { color: var(--muted); }
.inbox-switch { margin-left: auto; flex: none; width: 30px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.inbox-switch:hover { background: var(--hover); color: var(--ink); }
.content.inbox-mode { overflow: hidden; }
.inbox { display: flex; height: 100%; min-height: 0; }
.inbox-queue { position: relative; flex: none; width: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
.inbox.beside .inbox-queue { border-right: 1px solid var(--line); }
.inbox:not(.beside) .inbox-reader { display: none; }
.inbox:not(.beside) .inbox-rows { padding-bottom: 80px; }
.inbox-day { display: flex; gap: 6px; padding: 14px 22px 5px; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.inbox-day .n { color: var(--faint); }
.irow { position: relative; display: flex; align-items: center; gap: 11px; height: 58px; margin: 0 10px 2px; padding: 0 12px; border-radius: 12px; color: var(--ink); outline: none; }
.irow:hover { background: var(--hover); }
.irow.picked { background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 2px 4px rgb(0 0 0 / 0.06); }
.irow:focus-visible { box-shadow: 0 0 0 2px var(--chip-ink); }
.irow.picked:focus-visible { box-shadow: 0 0 0 1px var(--line), 0 2px 4px rgb(0 0 0 / 0.06); }
.ithumb { flex: none; width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: var(--tile); display: grid; place-items: center; color: var(--glyph); }
.ithumb.small { width: 22px; height: 22px; border-radius: 5px; }
.ithumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.18s; }
.ithumb img.in { opacity: 1; }
.itexts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ititle { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 13px; font-weight: 500; }
.irow.picked .ititle { font-weight: 650; }
.iname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ikept { flex: none; display: inline-flex; color: var(--faint); }
.isub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iage { flex: none; font-size: 11px; font-weight: 550; color: var(--faint); font-variant-numeric: tabular-nums; }
.iquick { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; padding: 0 2px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.iquick button { width: 27px; height: 26px; border-radius: 13px; display: grid; place-items: center; color: var(--body); }
.iquick button:hover { background: var(--hover); color: var(--ink); }
@media (hover: hover) {
  .irow:hover .iquick { display: flex; }
  .irow:hover .iage { visibility: hidden; }
  .irow:hover .itexts { padding-right: 84px; }
}
.inbox-more { display: block; margin: 10px auto; }
.inbox-reader { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--page); }
.inbox-reader-head { flex: none; padding: 14px 22px 12px 28px; border-bottom: 1px solid var(--line); }
.inbox-facts { display: flex; align-items: center; gap: 8px; }
.inbox-facts .words { flex: 1; min-width: 0; font-size: 12px; font-weight: 550; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-facts button { flex: none; width: 30px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.inbox-facts button:hover { background: var(--hover); color: var(--ink); }
.inbox-reader-head h1 {
  margin: 10px 0 2px; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.inbox-body { flex: 1; min-height: 0; }
.inbox-body .reader { padding-top: 26px; padding-bottom: 120px; }
.inbox-body .foot-pill, .inbox-body .zoom-bar { bottom: 74px; }
.inbox-reader-empty { flex: 1; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 12.5px; }
.inbox-reader-empty .big { color: var(--faint); margin: 0 auto 8px; width: 26px; }
.inbox-empty { flex: 1; display: grid; place-content: center; text-align: center; padding: 0 30px 60px; }
.content > .inbox-empty { height: 100%; }
.inbox-empty .big { color: var(--glyph); margin: 0 auto 10px; width: 26px; }
.inbox-empty h2 { font-size: 15px; margin: 0 0 6px; color: var(--ink); font-weight: 650; }
.inbox-empty p { margin: 0 auto; max-width: 280px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.inbox-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 5px; border-radius: 20px; }
.inbox-bar button { width: 36px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--body); }
.inbox-bar button:hover { background: var(--hover); color: var(--ink); }
.inbox-bar-count { font-size: 12px; font-weight: 650; color: var(--ink); padding: 0 4px 0 10px; white-space: nowrap; }
.foot-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 6; }
.fgroup { display: flex; gap: 4px; }
.fdot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.fwords { height: 26px; width: 130px; border: 0; outline: 0; border-radius: 13px; padding: 0 11px; font-size: 12.5px; background: var(--tile); color: var(--ink); }
.button.small { height: 26px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

/* The list. */

.line { display: grid; grid-template-columns: 30px 1fr auto auto auto; align-items: center; gap: 12px; height: 44px; padding: 0 10px; border-radius: 9px; color: var(--ink); position: relative; }
.line:hover { background: var(--hover); }
.line .thumb { width: 30px; height: 30px; border-radius: 6px; background: var(--tile); display: grid; place-items: center; color: var(--glyph); overflow: hidden; }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.18s; }
.line .thumb img.in { opacity: 1; }
.line .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.line .sub, .line .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.line .kept-mark { color: var(--muted); }
.line.picked { background: var(--chosen); }
.line.picked::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px; padding: 1.5px; background: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.sheet .site .favicon img { width: 100%; height: 100%; object-fit: contain; }
.side-hint { display: block; width: 100%; height: 28px; padding: 0 9px; border-radius: 8px; text-align: left; font-size: 12.5px; color: var(--faint); }
button.side-hint:hover { background: var(--hover); color: var(--muted); }
/* A space's fold arrow, in the margin before its icon (so that icons line up): pointing right while
   folded, and on an unfolded space only under the pointer (SidebarView). */
.row .fold {
  position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; display: grid; place-items: center;
  color: var(--muted); border-radius: 4px;
}
.row .fold .icon { transition: transform 0.15s; }
.row .fold.folded .icon { transform: rotate(-90deg); }
.row .fold:not(.folded) { opacity: 0; }
.row:hover .fold, .row .fold:focus-visible { opacity: 1; }
.row .fold:hover { color: var(--ink); }
/* A space while items are dragged over it: the logo's ring, as the selected card's. */
.row.target { background: var(--chosen); }
.row.target::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px; padding: 1.5px; background: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.row .count.tag-shown { color: var(--muted); max-width: 96px; overflow: hidden; text-overflow: ellipsis; }

/* Risorgi's own menus. */

.afield { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13.5px; color: var(--ink); }
.arow.on { background: var(--chosen); }
.arow.red { color: var(--recording); }
.arow.off { color: var(--faint); }
.arow.red .aglyph { color: var(--recording); }
.atitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.apath { color: var(--muted); }
.keycap {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; flex: none;
  font: 600 10.5px/1 var(--sans); color: var(--muted); background: var(--hover); box-shadow: inset 0 0 0 1px var(--line);
}
.cfoot { padding: 8px 14px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* Tooltips and the message in the corner. */

@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Questions and small sheets. */

/* One column no wider than the sheet: an address that cannot wrap scrolls inside its line instead of
   widening the column, which pushed the words and the Copy button past the sheet's edge. */
.asking { width: min(400px, 100%); border-radius: 16px; background: var(--canvas); box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgb(0 0 0 / 0.3); padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.asking.wide { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.asking h2 { margin: 0; font-size: 16px; color: var(--ink); }
.asking p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.asking-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.sheet-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -4px; }
select.field { appearance: auto; padding: 0 8px; }
.button.danger { background: var(--recording); color: #fff; }
.danger-text { color: var(--recording) !important; }

/* Settings. */

.settings-veil { align-items: center; }
.settings-pane .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.settings-pane .line:first-child { border-top: 0; }
.settings-pane .line:hover { background: none; }
.settings-pane .what { flex: 1; min-width: 0; }
.settings-pane .note a { text-decoration: underline; text-underline-offset: 2px; }
.field.narrow { width: 200px; height: 32px; }
.pair { display: flex; gap: 6px; }
.meter.wide { width: 150px; }

/* The Info pane. */

.info-top { display: flex; align-items: flex-start; gap: 8px; }
.info-top h3 { flex: 1; }
.info .label { display: flex; align-items: center; justify-content: space-between; }
.info .about { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--body); }
.info .seen-words { margin-top: 8px; font-size: 12px; color: var(--muted); }
.info .seen-words summary { cursor: default; }
.info .seen-words p { white-space: pre-line; margin: 6px 0 0; color: var(--body); }
.links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.link-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.link-row a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.link-row a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a .icon { color: var(--glyph); }
.link-row .x { color: var(--muted); display: grid; place-items: center; }
.links .chip.add { justify-self: start; margin-top: 2px; }
.info-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.meter-line { font-size: 12.5px; color: var(--body); }
.info .note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.info .actions .button { gap: 8px; }
.info .actions .keycap { margin-left: auto; }
.chip a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* An item, open. */

.reader .nothing { color: var(--faint); }
.reader .excerpt-line { color: var(--body); }
.reader .quote-origin { margin-top: 18px; color: var(--muted); font-size: 14px; }
.reader .quote-origin a { color: var(--chip-ink); }
.quote-fields { margin-top: 16px; }
.player { display: grid; place-items: center; padding: 40px 22px 20px; }
.player video { max-width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }
.player audio { width: min(520px, 90vw); }
.reader.transcript { padding-top: 0; }
.reader.transcript h3 { font-size: 13px; color: var(--muted); }
.holder-name { color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.holder-words { margin-bottom: 14px; font-size: 13px; }
.file-top { padding: 30px 0 0; display: grid; place-items: center; }
.reader pre.document { white-space: pre-wrap; font: 14px/1.5 var(--mono); background: none; padding: 0; }
.stage.actual { place-items: start center; overflow: auto; }
.stage.actual img { max-width: none; max-height: none; }
.content.flush { overflow: hidden; }

/* While something is dragged over the window: a dashed edge in the logo's spectrum. */

/* While something is dragged over the window, as the Mac's DropHighlight: the page over the library,
   the spectrum's dashed line, the bird and "Drop to save". */
.drop-edge {
  position: fixed; inset: 0; z-index: 35; pointer-events: none; display: none;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
}
.app.dropping .drop-edge { display: grid; place-items: center; }
.drop-edge svg { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); display: block; overflow: visible; }
.drop-words { display: grid; justify-items: center; gap: 14px; font-size: 22px; font-weight: 500; letter-spacing: -0.6px; color: var(--ink); }
.drop-words img { width: 56px; height: 56px; object-fit: contain; }

/* Serendipity. */

.spicture { max-height: 52vh; display: grid; place-items: center; background: var(--tile); }
.spicture img { max-width: 100%; max-height: 52vh; object-fit: contain; display: block; opacity: 0; transition: opacity 0.2s; }
.spicture[style*="aspect-ratio"] img { width: 100%; height: 100%; }
.spicture img.in { opacity: 1; }
.spaper { padding: 26px 26px 30px; max-height: 52vh; overflow: hidden; }
.spaper .stitle { font-size: 19px; font-weight: 650; color: var(--ink); line-height: 1.25; }
.spaper .swords { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--body); white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 12; overflow: hidden; }
.spaper.quote .stitle { font: 22px/1.4 var(--serif); font-weight: 400; }
.scaption { padding: 12px 4px 0; text-align: center; }
.sname { font-weight: 600; color: var(--ink); }

/* Signing up. */

/* A field with its verdict at its end: a check when the username can be had, a cross when not, a small ring while asking. */
.door .field-box { position: relative; display: grid; }
.door .field-box .field { padding-right: 44px; }
.door .field-mark {
  position: absolute; right: 8px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none; transition: opacity .15s;
}
.door .field-mark:empty { opacity: 0; }
.door .field-mark.good, .door .field-mark.bad { pointer-events: auto; cursor: default; animation: mark-in .22s cubic-bezier(.2, .9, .3, 1.3); }
.door .field-mark.good { color: rgb(66 97 197); }
.door .field-mark.bad { color: var(--recording); }
.door .field-mark.good .icon path { stroke-width: 2.6; }
.door .field-mark.bad .icon path { stroke-width: 2.4; }
.door .field-mark.checking i {
  width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--line); border-top-color: var(--muted);
  animation: mark-turn .8s linear infinite;
}
@keyframes mark-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes mark-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .door .field-mark.good, .door .field-mark.bad { animation: none; } .door .field-mark.checking i { animation-duration: 2.4s; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .door .field-mark.good { color: rgb(150 172 245); } }
:root[data-theme="dark"] .door .field-mark.good { color: rgb(150 172 245); }
.door .agree { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--body); line-height: 1.4; margin: 2px 0; }
.door .agree input { margin-top: 2px; }
.door .agree a { text-decoration: underline; text-underline-offset: 2px; }
.door .field.code { letter-spacing: 0.2em; font-variant-numeric: tabular-nums; text-align: center; font-size: 18px; }
/* The one door (door.js): whose email a step is for, with Change; the email riding along unseen for password
   managers; Supabase's password rules under the field; and the box under the button where Turnstile asks for a click
   when it is unsure (empty otherwise). */
.door p.who { overflow-wrap: anywhere; }
.door p.who span { color: var(--body); font-weight: 600; }
.door p.who a { color: var(--body); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.door .quiet-field { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.door .field-hint { margin: -6px 2px 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.door .turnstile-box { display: flex; justify-content: center; }
.door .turnstile-box:has(iframe) { margin-top: 14px; }

@media (max-width: 520px) {
  /* On a phone Back is the way out of an item (there is no Esc): New gives it room, and Forward and a Back with nowhere to go are left out. */
  .bar:has(.trail .back:not(:disabled)) .pill.lead .show-side[aria-label="New"] { display: none; }
  .bar .trail .forward { display: none; }
  .bar .trail:has(.back:disabled) { display: none; }
  .bar { gap: 6px; padding: 0 6px; }
  .filter-bar .fgroup:nth-of-type(2) { display: none; }
}

/* Risorgi Freedom: the offer (plan.js). */
/* The offer of Risorgi Freedom (plan.js): everything in the middle, the spectrum as light along its top,
   round the bird, in its line and round the way to pay that is chosen; one strong button. */
.asking.offer { position: relative; width: min(460px, 100%); padding: 34px 30px 20px; gap: 0; justify-items: center; text-align: center; overflow: hidden; border-radius: 26px; background: var(--card); }
.asking.offer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--ring); }
.asking.offer::after { content: ""; position: absolute; left: -10%; right: -10%; top: -140px; height: 260px; z-index: 0; pointer-events: none; background: radial-gradient(40% 60% at 25% 50%, rgb(86 196 240 / 0.18), transparent 70%), radial-gradient(40% 60% at 75% 50%, rgb(236 130 200 / 0.16), transparent 70%), radial-gradient(30% 50% at 50% 60%, rgb(180 140 240 / 0.16), transparent 70%); }
.asking.offer > * { position: relative; z-index: 1; }
.offer-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.offer-bird { width: 40px; height: 40px; object-fit: contain; }
.asking.offer h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.offer-joy { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0 !important; font-size: 14px !important; font-weight: 650; }
.offer-joy .icon { color: rgb(180 140 240); }
.offer-joy span { background: linear-gradient(90deg, rgb(63 174 224), rgb(106 127 224), rgb(165 123 232), rgb(224 112 184), rgb(233 166 79)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.offer-words { max-width: 360px; margin: 10px auto 0 !important; font-size: 14px !important; line-height: 1.5; color: var(--muted) !important; }
.offer-points { list-style: none; margin: 20px auto 0; padding: 0; display: grid; gap: 10px; text-align: left; font-size: 13.5px; color: var(--body); }
.offer-points li { display: flex; align-items: center; gap: 10px; }
.offer-check { flex: none; width: 18px; height: 18px; fill: none; stroke: rgb(66 97 197); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .offer-check { stroke: rgb(147 168 246); } }
:root[data-theme="dark"] .offer-check { stroke: rgb(147 168 246); }
.plan-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 22px; }
.plan-choice { position: relative; display: grid; gap: 3px; justify-items: center; padding: 14px 12px 12px; border-radius: 16px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); color: var(--body); transition: transform .2s, box-shadow .2s; }
.plan-choice:hover { transform: translateY(-1px); }
.plan-choice.on { box-shadow: 0 14px 30px -20px rgb(113 100 220 / 0.6); }
.plan-choice.on::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: var(--ring); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.plan-choice-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.plan-choice-price { display: flex; align-items: baseline; gap: 3px; font-size: 13px; color: var(--muted); }
.plan-choice-price b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.plan-choice-note { font-size: 12px; color: var(--muted); }
.plan-choice-note.save { font-weight: 650; background: linear-gradient(90deg, rgb(63 174 224), rgb(106 127 224), rgb(165 123 232), rgb(224 112 184), rgb(233 166 79)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.offer-go { width: 100%; height: 46px; margin-top: 18px; border-radius: 14px; background: var(--ink); color: var(--page); font-size: 15px; font-weight: 650; box-shadow: 0 14px 30px -14px rgb(113 140 230 / 0.75), 0 8px 20px -12px rgb(236 130 200 / 0.6); }
.offer-go:hover { filter: brightness(1.08); }
.offer-later { margin-top: 10px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--muted); }
.offer-later:hover { background: var(--hover); color: var(--ink); }
.offer-small { margin: 8px 0 0 !important; font-size: 11.5px !important; color: var(--faint) !important; text-align: center; }
.side-plan { font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 8px; }
.side-plan:hover { background: var(--hover); color: var(--ink); }
.side-plan { white-space: nowrap; }

/* Bars that float over what they control (PDFs, pictures). */
.glass {
  background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 4px 16px rgb(0 0 0 / 0.10);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

/* PDFs (pdf.js): the pages on the page's own grey, nothing around them. */
.content.pdf-mode { background: var(--canvas); overflow: auto; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 24px 140px; min-width: min-content; }
.pdf-page {
  position: relative; flex: none; background: #fff; border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 10px rgb(0 0 0 / 0.08);
  --user-unit: 1; --total-scale-factor: calc(var(--scale-factor) * var(--user-unit)); --scale-round-x: 1px; --scale-round-y: 1px;
}
@media (prefers-color-scheme: dark) { .pdf-page { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 2px 12px rgb(0 0 0 / 0.5); } }
.pdf-page canvas { position: absolute; left: 0; top: 0; display: block; }
/* A highlight's colour goes on the paper, under the words, which stay black; lines, pen strokes and comments lie over them. */
/* The layer multiplies, not each wash in it: a layer with a z-index of its own is a group, and what is
   inside it would only multiply with the layer's own clear background, covering the words. */
.pdf-washes, .pdf-found-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: multiply; }
.pdf-wash { position: absolute; border-radius: 2px; }
.pdf-wash.lit { box-shadow: 0 0 0 1.5px rgb(0 0 0 / 0.35); }
.pdf-marks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.pdf-lines { position: absolute; left: 0; top: 0; overflow: hidden; }
.pdf-lines .lit { filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.45)); }
.pdf-live { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; z-index: 4; }
.pdf-bubble { position: absolute; display: grid; place-items: center; pointer-events: auto; padding: 0; border-radius: 6px; }
.pdf-bubble svg { display: block; filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.3)); }
.pdf-bubble:hover svg { transform: scale(1.12); }
.pdf-found { position: absolute; border-radius: 3px; background: rgb(255 212 41 / 0.45); }
.pdf-found.current { background: rgb(255 149 0 / 0.65); box-shadow: 0 0 0 1.5px rgb(230 120 0); }
/* The tools change what the pointer does over the pages. */
.pdf-pages.tool-draw, .pdf-pages.tool-comment, .pdf-pages.tool-erase { cursor: crosshair; touch-action: none; }
.pdf-pages.tool-draw .textLayer, .pdf-pages.tool-comment .textLayer, .pdf-pages.tool-erase .textLayer { pointer-events: none; user-select: none; -webkit-user-select: none; }
.pdf-pages.tool-draw .textLayer span, .pdf-pages.tool-comment .textLayer span, .pdf-pages.tool-erase .textLayer span { cursor: crosshair; }
.pdf-eraser { position: fixed; z-index: 35; pointer-events: none; border-radius: 50%; border: 1px solid rgb(0 0 0 / 0.45); background: rgb(255 255 255 / 0.35); }

/* Along the foot of the window: the bar for moving through the pages (or finding in them), and the tools. */
.pdf-bars { position: fixed; z-index: 20; display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none; }
.pdf-bars.stacked { flex-direction: column-reverse; gap: 8px; }
.pdf-bar { display: flex; align-items: center; gap: 1px; height: 38px; padding: 0 5px; border-radius: 19px; pointer-events: auto; flex: none; }
.pbutton { width: 32px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--body); flex: none; }
.pbutton:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.pbutton.on, .pbutton.on:hover { background: var(--ink); color: var(--page); }
.pbutton:disabled { opacity: 0.35; }
.pdivider { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }
.pdot { width: 24px; height: 28px; display: grid; place-items: center; flex: none; }
.pdot > span { width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12); }
.pdot.on > span { box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12), 0 0 0 3px var(--floating), 0 0 0 4.5px color-mix(in srgb, var(--ink) 70%, transparent); }
.pdot:hover > span { transform: scale(1.1); }
.pthick { width: 32px; height: 28px; display: grid; place-items: center; flex: none; }
.pthick > span { width: 16px; border-radius: 4px; background: var(--body); }
.psize { width: 26px; height: 28px; display: grid; place-items: center; flex: none; }
.psize > span { border-radius: 50%; box-shadow: inset 0 0 0 1.2px var(--muted); }
.psize.on > span { box-shadow: inset 0 0 0 2px var(--ink); }
.pcount { display: inline-flex; align-items: center; gap: 4px; padding: 0 2px; font-size: 11.5px; font-weight: 550; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ppage {
  height: 22px; border: 0; outline: 0; border-radius: 6px; background: var(--chosen); text-align: center;
  font: 550 11.5px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); padding: 0;
}
.ppage:focus { box-shadow: 0 0 0 2px var(--selection); }
.ppercent { min-width: 40px; height: 28px; padding: 0 4px; border-radius: 8px; font-size: 11.5px; font-weight: 550; color: var(--body); font-variant-numeric: tabular-nums; }
.ppercent:hover { background: var(--hover); color: var(--ink); }
.pfind-glyph { display: grid; place-items: center; color: var(--muted); padding: 0 2px 0 8px; }
.pfind { width: 170px; height: 28px; border: 0; outline: 0; background: none; font-size: 12.5px; color: var(--ink); }
.psummary { min-width: 68px; text-align: right; padding: 0 4px; font-size: 11.5px; font-weight: 550; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Over selected words, or a mark that was clicked. */
.pdf-float { position: fixed; z-index: 30; display: flex; align-items: center; gap: 1px; height: 38px; padding: 0 4px 0 6px; border-radius: 19px; }
.pdf-float .pbutton { border-radius: 14px; }
.zoom-percent { min-width: 48px; height: 28px; border-radius: 14px; font-size: 12.5px; color: var(--body); font-variant-numeric: tabular-nums; }
.zoom-percent:hover { background: var(--hover); color: var(--ink); }

/* Text that can be selected over a PDF page: PDF.js's own rules (pdf_viewer.css), the part used here. */
.textLayer {
  color-scheme: only light; position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1;
  letter-spacing: normal; word-spacing: normal; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none;
  transform-origin: 0 0; caret-color: CanvasText; z-index: 2;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; -webkit-user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) {
  z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { user-select: none; -webkit-user-select: none; cursor: default; }
.textLayer ::selection { background: rgb(0 90 255 / 0.25); color: transparent; }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; -webkit-user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }

/* Pictures to come nearer to (viewer.js). */
/* The usual pointer over a picture, zoomed or not (the owner found the hand ugly); a zoomed picture still moves with a drag. */
.zoom-stage { position: relative; display: block; padding: 0; overflow: hidden; touch-action: none; cursor: default; user-select: none; -webkit-user-select: none; }
.zoom-stage img.zoom-picture.in { opacity: 1; }

/* A PDF's card: its first page, as a page. */
.tile.doc { background: #fff; display: block; }
.tile.doc img { object-fit: cover; object-position: top; }

/* A backdrop behind the drawers on a narrow window. */
.bar .pill[hidden] { display: none !important; }
.drawer-veil { display: none; }
@media (max-width: 760px) {
  .app.show-sidebar .drawer-veil, .app:not(.no-info) .drawer-veil { display: block; position: fixed; inset: 0; z-index: 14; background: rgb(0 0 0 / 0.2); }
  .settings-window { flex-direction: column; height: 100%; border-radius: 14px; }
  .settings-side { display: flex; overflow-x: auto; flex: none; width: auto !important; padding: 8px !important; gap: 2px; border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .settings-side .row { flex: none; width: auto; }
  .settings-pane { padding: 14px 16px 24px !important; }
  .settings-pane .line { flex-wrap: wrap; }
}
/* A finger held down brings up Risorgi's menu, not the browser's own for a link (an Inbox row is a link). */
.card, .line, .row, .irow { -webkit-touch-callout: none; }
/* Things in the library are links (a middle click opens one in a tab), but show the plain arrow, as on the Mac: the
   owner found the hand over pictures ugly (30 November). */
a.card, a.card *, .lines > a.line, .lines > a.line *, a.irow, a.irow * { cursor: default; }
@media (hover: none) { .card, .row, .irow { user-select: none; -webkit-user-select: none; } }

/* Settings › Connector (connect.js). */
.connect-lead { margin: 6px 0 0; font-size: 13px; color: var(--body); line-height: 1.45; }
.asking.connect-sheet { width: min(560px, 100%); }
.connect-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--body); line-height: 1.45; }
.code-line { display: flex; align-items: center; gap: 8px; background: var(--page); border-radius: 10px; padding: 8px 8px 8px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.code-line code { flex: 1; min-width: 0; font: 12px var(--mono); color: var(--ink); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.code-block { margin: 0; background: var(--page); border-radius: 10px; padding: 12px; box-shadow: inset 0 0 0 1px var(--line); font: 12px/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-all; }
.connect-key { display: grid; gap: 10px; justify-items: start; }
.connect-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.connect-note { font-size: 12px !important; color: var(--muted) !important; }
.connect-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.connect-alt { margin: 6px 0 0; font-size: 13px; font-weight: 650; color: var(--ink); }

/* The graph (graph.js). */
.content.graph-mode { overflow: hidden; }
.graph { position: relative; height: 100%; min-height: 360px; }
.graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }

/* Import (importers.js). */
.import-sheet { width: min(520px, 100%); }
.import-list { display: grid; gap: 6px; }
.import-source { display: grid; gap: 2px; text-align: left; padding: 11px 13px; border-radius: 12px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); }
.import-source:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.import-title { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.import-words { font-size: 12.5px; color: var(--muted); }
.import-found { display: grid; gap: 4px; font-size: 13px; color: var(--body); background: var(--page); border-radius: 12px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.import-found b { color: var(--ink); }
.import-warning { color: var(--recording); }
.import-status { font-size: 13px; color: var(--muted); }

/* Ask your library (ask.js). */
.ask-panel {
  position: fixed; right: 16px; top: 64px; bottom: 16px; width: min(420px, calc(100vw - 32px)); z-index: 24;
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--canvas);
}
.ask-top { display: flex; align-items: center; gap: 4px; padding: 10px 10px 8px 16px; color: var(--ink); font-size: 14px; }
.ask-gap { flex: 1; }
.ask-log { flex: 1; overflow-y: auto; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 16px; }
.ask-empty { margin: auto 0; text-align: center; color: var(--muted); font-size: 13px; display: grid; gap: 10px; justify-items: center; }
.ask-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--page); color: var(--ink); box-shadow: var(--card-shadow); }
.ask-examples { display: grid; gap: 6px; width: 100%; }
.ask-example { text-align: left; padding: 9px 12px; border-radius: 10px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); color: var(--body); font-size: 12.5px; }
.ask-example:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.ask-turn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ask-question { justify-self: end; max-width: 88%; background: var(--ink); color: var(--page); padding: 8px 12px; border-radius: 14px 14px 4px 14px; font-size: 13.5px; white-space: pre-wrap; }
.ask-answer { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.ask-answer p { margin: 0 0 8px; }
.ask-answer.pending { color: var(--muted); }
.ask-answer.error { color: var(--recording); }
.ask-cite { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px; border-radius: 6px; background: var(--chip); color: var(--chip-ink); font-size: 10.5px; font-weight: 650; vertical-align: 1px; }
.ask-sources { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-top: 4px; }
.ask-more summary { cursor: default; list-style: none; font-size: 12px; color: var(--muted); padding: 4px 2px; }
.ask-more summary::-webkit-details-marker { display: none; }
.ask-more summary:hover { color: var(--ink); }
.ask-more[open] summary { margin-bottom: 2px; }
.ask-source { min-width: 0; display: flex; align-items: center; gap: 7px; text-align: left; padding: 6px 9px; border-radius: 9px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); color: var(--body); font-size: 12.5px; }
.ask-source:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.ask-n { color: var(--chip-ink); font-weight: 650; font-size: 11px; min-width: 12px; }
.ask-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ask-field { flex: 1; resize: none; border: 0; outline: 0; background: var(--page); border-radius: 12px; padding: 9px 12px; font: 13.5px/1.4 var(--sans); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); max-height: 140px; }
.ask-field:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ask-send { width: 36px; height: 36px; padding: 0; border-radius: 12px; }
.ask-left { font-size: 11.5px; color: var(--muted); text-align: center; padding: 0 0 8px; }
.ask-left:empty { display: none; }
@media (max-width: 520px) { .ask-panel { inset: 8px; width: auto; top: 56px; } }

/* Voice notes (voice.js). */
.voice-sheet { width: min(380px, 100%); }
.voice-stage { display: grid; justify-items: center; gap: 10px; padding: 8px 0 4px; }
.voice-button { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--recording); box-shadow: 0 4px 16px rgb(226 62 52 / 0.35); transition: transform 0.15s; }
.voice-button:hover { transform: scale(1.04); }
.voice-button.on { animation: voice-pulse 1.4s ease-in-out infinite; }
.voice-button:disabled { opacity: 0.5; animation: none; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(226 62 52 / 0.45); } 50% { box-shadow: 0 0 0 14px rgb(226 62 52 / 0); } }
@media (prefers-reduced-motion: reduce) { .voice-button.on { animation: none; } }
.voice-time { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.voice-meter { width: 280px; height: 48px; color: var(--muted); }
.voice-words { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

/* The Info pane's Similar list: the label's "See all" is a quiet link. */
.info .label .label-action { font-weight: 550; color: var(--muted); text-decoration: none; font-size: 11.5px; }
.info .label .label-action:hover { color: var(--ink); text-decoration: underline; }
.info .similar:empty { display: none; }

/* The Info pane's Highlights: one row a mark, its colour, its words and comment, its page. */
.info .marks-list:empty { display: none; }
/* A document's marks, as the Mac's MarksList: a colour bar, the words in the serif, the comment, where it is. */
.info .marks-list { display: flex; flex-direction: column; gap: 8px; }
.info .marks-list > .label { margin-bottom: -2px; }
.info .mark-row, .info .comment-editor {
  position: relative; display: flex; align-items: stretch; gap: 9px; width: 100%; padding: 9px; border-radius: 9px; text-align: left;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: inherit; cursor: default;
}
.info .mark-row:hover { background: var(--hover); }
.info .mark-row:focus-visible { outline: 2px solid var(--selection); outline-offset: 1px; }
.info .comment-editor { box-shadow: inset 0 0 0 1.5px var(--selection); }
.info .mark-bar { flex: none; width: 3px; border-radius: 1.5px; }
.info .mark-words, .info .comment-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.info .mark-text { font: italic 12.5px/1.45 var(--serif); color: var(--body); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.info .mark-text.struck { text-decoration: line-through; }
.info .mark-text.under { text-decoration: underline; text-underline-offset: 2px; }
.info .mark-drawn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--body); }
.info .mark-drawn .icon { display: inline-block; }
.info .mark-comment { font-size: 12.5px; line-height: 1.45; color: var(--ink); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.info .mark-empty { font-size: 12.5px; color: var(--faint); }
.info .mark-place { font-size: 11px; color: var(--muted); }
.info .mark-write {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 12px; display: none; place-items: center;
  color: var(--body); background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.info .mark-row:hover .mark-write, .info .mark-row:focus-within .mark-write { display: grid; }
.info .comment-editor textarea { width: 100%; min-height: 54px; border: 0; outline: 0; resize: vertical; background: none; padding: 0; font: 13px/1.45 var(--sans); color: var(--ink); }
.info .comment-foot { display: flex; align-items: center; gap: 6px; }
.info .comment-foot .gap { flex: 1; }

/* Books (book.js): one long page of chapters, set in the reader's serif; the book's own look left out. */
.content.book-mode { background: var(--page); }
.book-a { font: 600 16px/1 var(--serif); }
.book-a.small { font-size: 12.5px; }
.reader.book { font-family: var(--serif); font-size: calc(18px * var(--book-size, 1)); line-height: 1.62; padding-top: 28px; overflow-wrap: break-word; }
.reader.book h1, .reader.book h2, .reader.book h3, .reader.book h4 { font-family: var(--serif); line-height: 1.25; }
.reader.book h1 { font-size: 1.65em; margin: 0.6em 0 0.8em; }
.reader.book h2 { font-size: 1.35em; margin: 1.4em 0 0.6em; }
.reader.book h3, .reader.book h4 { font-size: 1.12em; margin: 1.2em 0 0.5em; }
.reader.book p { margin: 0 0 0.85em; }
.reader.book section.chapter + section.chapter { margin-top: 3em; padding-top: 3em; border-top: 1px solid var(--line); }
.reader.book img.book-picture { display: block; width: auto; height: auto; max-width: 100%; max-height: 85vh; margin: 1.2em auto; border-radius: 3px; }
.reader.book figure { margin: 1.2em 0; text-align: center; }
.reader.book figcaption { font-size: 0.85em; color: var(--muted); margin-top: 0.4em; }
.reader.book blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--line); color: var(--body); }
.reader.book table { border-collapse: collapse; margin: 1em 0; font-size: 0.88em; }
.reader.book td, .reader.book th { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }
.reader.book sup, .reader.book sub { line-height: 0; }
.reader.book hr { border: 0; border-top: 1px solid var(--line); margin: 2em 20%; }
.bmark-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; margin: 0 2px; border-radius: 9px; vertical-align: 0.1em; background: rgb(255 204 0); color: rgb(60 45 0); }

/* The Info pane, as the Mac's InspectorView: its parts named at the top (Info, Highlights, Connections)
   and always in reach, then the picture, the title and a note, and sections under small headings. */
.info.tabbed { padding: 0; display: flex; flex-direction: column; overflow: hidden; width: var(--info-width, 300px); }
.pane-bar .gap { flex: 1; }
.pane-tab { display: inline-flex; align-items: baseline; gap: 4px; height: 32px; font-size: 13px; font-weight: 650; color: var(--faint); white-space: nowrap; }
.pane-tab:hover { color: var(--muted); }
.pane-tab.on { color: var(--ink); }
.pane-tab.on .count { color: var(--muted); }
.pane-close { width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); background: var(--tile); flex: none; }
.pane-close:hover { color: var(--ink); }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 22px; display: flex; flex-direction: column; gap: 20px; }
.pane-top { display: flex; flex-direction: column; gap: 12px; }
.pane-picture { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pane-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pane-picture::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.swatches .swatch { cursor: default; }
.pane-title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -0.3px; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
textarea.pane-title.editable {
  display: block; width: 100%; border: 0; outline: 0; resize: none; background: none; padding: 0; overflow: hidden;
  font: 650 17px/1.3 var(--sans); letter-spacing: -0.3px; color: var(--ink); -webkit-line-clamp: unset;
}
textarea.pane-title.editable::placeholder { color: var(--faint); }
.info textarea.pane-note {
  display: block; width: 100%; min-height: 62px; max-height: 170px; resize: vertical; border: 0; outline: 0; border-radius: 10px; padding: 9px 10px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font: 13px/1.45 var(--sans); color: var(--body);
}
.info textarea.pane-note:focus { box-shadow: inset 0 0 0 1.5px var(--selection); }
.info textarea.pane-note::placeholder { color: var(--faint); }
.pane-section { display: flex; flex-direction: column; gap: 8px; }
.pane-section:empty, .ai-found:empty, .pane-section.similar:empty { display: none; }
.pane-section-head { display: flex; align-items: center; gap: 6px; min-height: 20px; width: 100%; text-align: left; }
.pane-section-head .gap { flex: 1; }
.pane-heading { font-size: 10.5px; font-weight: 650; letter-spacing: 0.7px; text-transform: uppercase; color: var(--faint); }
.pane-hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.pane-icon { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); flex: none; }
.pane-icon:hover { background: var(--hover); color: var(--ink); }
.pane-icons { display: inline-flex; }
.pane-link { font-size: 11.5px; font-weight: 550; color: var(--muted); text-decoration: none; }
.pane-link:hover { color: var(--ink); text-decoration: underline; }
.info .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.place-chip, .tag-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; max-width: 100%;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 11.5px; font-weight: 550; color: var(--body);
}
.place-chip .place-glyph { display: grid; place-items: center; color: var(--muted); flex: none; }
.place-chip .place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip a:hover { color: var(--ink); }
.place-chip .x, .tag-chip .x { display: grid; place-items: center; color: var(--muted); flex: none; width: 14px; height: 14px; border-radius: 7px; }
.place-chip .x:hover, .tag-chip .x:hover { color: var(--ink); background: var(--hover); }
.info input.pane-field {
  width: 100%; height: 28px; border: 0; outline: 0; border-radius: 8px; padding: 0 10px; font-size: 12.5px; color: var(--ink);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.info input.pane-field:focus { box-shadow: inset 0 0 0 1.5px var(--selection); }
.chips.suggestions:empty { display: none; }
.suggestion { height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 550; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.suggestion:hover { color: var(--ink); background: var(--hover); }
.pane-address { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; user-select: text; }
.info .ai-found .about { margin: 0; }
.pane-section.details .fold .chevron { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); transition: transform 0.15s ease-out; }
.pane-section.details.folded .fold .chevron { transform: rotate(-90deg); }
.detail-rows { display: flex; flex-direction: column; gap: 8px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.detail-row > span:first-child { color: var(--muted); flex: none; }
.detail-row > span:last-child { color: var(--ink); text-align: right; overflow-wrap: anywhere; min-width: 0; }
.detail-row .format { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 650; color: var(--body); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pane-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pane-actions:empty { display: none; }
.button.danger-text { color: var(--recording); }
.connect-button { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--tile); font-size: 12px; font-weight: 550; color: var(--body); }
.connect-button:hover { color: var(--ink); }
.connection-rows { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.connection-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 9px; }
.connection-row:hover { background: var(--hover); }
.connection-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.connection-thumb { width: 34px; height: 34px; border-radius: 7px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--tile); color: var(--glyph); }
.connection-thumb img { width: 100%; height: 100%; object-fit: cover; }
.connection-texts { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.connection-texts b { font-size: 12.5px; font-weight: 550; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.connection-texts span { font-size: 11px; color: var(--muted); }
.connection-action { width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; background: var(--tile); color: var(--body); flex: none; opacity: 0; }
.connection-action.plus, .connection-row:hover .connection-action, .connection-action:focus-visible { opacity: 1; }
/* The space editor's icons, as the Mac's grid of eight. */
.symbol-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px 2px; }
.symbol-choice { height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.symbol-choice:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 720px) { .info.tabbed { width: min(320px, 92vw); } }

/* The bar over the library's foot (footbar.js), as the Mac's ViewControls and SelectionBar:
   a glass capsule 38 points tall, 16 points over the foot; buttons 32 by 28 that light up under
   the pointer, the graph's switch dark while the graph shows. */
.view-bar, .sel-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 5px; border-radius: 19px; white-space: nowrap;
}
.view-bar button { width: 32px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--body); }
.view-bar button:hover { background: var(--hover); color: var(--ink); }
.view-bar button:active { background: var(--chosen); }
.view-bar button.on, .view-bar button.on:hover { background: var(--ink); color: var(--page); }
.view-rule { width: 1px; height: 16px; background: var(--line); margin: 0 3px; flex: none; }
.graph-words { display: flex; gap: 2px; }
.view-bar .graph-word { width: auto; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 500; color: var(--muted); }
.view-bar .graph-word:hover { background: none; color: var(--ink); }
.view-bar .graph-word.on { background: var(--card); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.sel-bar { gap: 14px; padding: 0 16px; font-size: 12px; font-weight: 500; }
.sel-count { font-weight: 650; color: var(--ink); }
.sel-action { display: inline-flex; align-items: center; gap: 5px; height: 28px; color: var(--body); }
.sel-action:hover { color: var(--ink); }
.sel-action.red, .sel-action.red:hover { color: var(--recording); }
@media (max-width: 520px) {
  .sel-bar { gap: 10px; padding: 0 12px; max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
  .sel-bar .keycap { display: none; }
  /* The graph's bar is wider than a phone: it keeps inside the screen, its buttons narrower, and scrolls only when even that is not enough. */
  .view-bar { max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
}

/* Display: a panel standing on its button (the Mac's DisplayOptions, 304 points wide). */
.popover {
  position: fixed; z-index: 31; width: 304px; padding: 16px; display: grid; gap: 14px; border-radius: 12px;
  background: var(--floating); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgb(0 0 0 / 0.18); font-size: 12.5px; color: var(--ink);
}
.pop-head { font-size: 11px; font-weight: 650; color: var(--muted); margin-bottom: -4px; }
.pop-layouts { display: flex; gap: 8px; }
.pop-layout { display: grid; justify-items: center; gap: 6px; }
.pop-layout .tile { width: 82px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--tile); color: var(--glyph); }
.pop-layout:hover .tile { color: var(--ink); }
.pop-layout.on .tile { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pop-layout .words { font-size: 11px; color: var(--muted); }
.pop-layout.on .words { color: var(--ink); font-weight: 650; }
.pop-rule { height: 1px; background: var(--line); }
.pop-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pop-line input[type=range] { width: 150px; accent-color: var(--ink); }

/* The edges of the sidebar and of the Info pane, dragged to make them wider or narrower. */
.resizer { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 8; cursor: col-resize; touch-action: none; }
.resizer.side-edge { right: -4px; }
.resizer.info-edge { right: -4px; }
.app.no-info .resizer.info-edge { display: none; }
.app.resizing, .app.resizing * { cursor: col-resize !important; user-select: none; }
@media (max-width: 760px) { .resizer { display: none; } }

/* The tags panel (the Mac's TagPicker): a field, then every tag a chip. It stands over the drawers and
   the Ask panel, and under the questions its chips ask (Rename…, Delete tag), which dim it as the rest. */
.tags-panel {
  position: fixed; z-index: 24; width: 320px; max-height: min(480px, calc(100vh - 16px)); display: flex; flex-direction: column;
  border-radius: 12px; background: var(--floating); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgb(0 0 0 / 0.18); overflow: hidden;
}
.tags-ask { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; color: var(--muted); border-bottom: 1px solid var(--line); flex: none; }
.tags-find { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13.5px; color: var(--ink); }
.tag-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 10px; overflow-y: auto; scrollbar-width: thin; }
/* The panel's own chips: the Info pane's tags are chips too (.place-chip, .tag-chip), and keep their look.
   The gap and the hairline those have are taken off here. */
.tags-panel .tag-chip {
  display: inline-flex; align-items: center; gap: 0; height: 26px; padding: 0 9px; border-radius: 7px; background: var(--tile); box-shadow: none;
  font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.tags-panel .tag-chip:hover { background: var(--chosen); }
.tags-panel .tag-chip .hash { color: var(--muted); margin-right: 1px; }
.tags-panel .tag-chip.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.tags-panel .tag-chip.make { background: none; border: 1px dashed var(--faint); color: var(--muted); }
.tags-panel .tag-chip.make:hover { color: var(--ink); border-color: var(--muted); }
.tags-none { padding: 6px 4px; font-size: 12.5px; color: var(--muted); }

/* ---- Cards, list rows, the filter bar and empty places (as the Mac's ItemCard, ItemRow, FilterBar) ---- */

/* The library's cards, the list, the filter bar and the empty places, as the Mac app draws them
   (Views/ItemCard.swift, Views/LibraryView.swift, Views/Theme.swift). Read after app.css: a rule
   here with the same selector as one there takes its place. */

/* Cards. */

/* A few words sit in the middle of their sheet; a full one fills it (ItemCard.textTile). */
/* replaces app.css: .tile.sheet */
.tile.sheet {
  background: var(--card); padding: 14px; min-height: 88px;
  display: flex; flex-direction: column; justify-content: center; justify-content: safe center;
}
.tile.sheet > * { flex: none; }
.tile.sheet > .excerpt, .tile.sheet.quote > .words { flex: 0 1 auto; min-height: 0; }
/* The bookmark of a Keeper sits in the far corner: a note's title stops short of it, a link's site line does. */
.sheet.link.starred .title { padding-right: 0; }
.sheet.link.starred .site { padding-right: 22px; }
.sheet .site .site-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* replaces app.css: .sheet .site .favicon */
.sheet .site .favicon { flex: none; border-radius: 3px; overflow: hidden; display: inline-grid; place-items: center; color: var(--muted); }
.sheet.quote .words.empty { color: var(--faint); }

/* A note with pictures: the first one on top, its words under it. */
.tile.picture-note { background: var(--card); }
.tile.picture-note .note-picture { overflow: hidden; background: var(--tile); }
.tile.picture-note > .sheet { padding: 14px; }

/* A recording: what was said reads in ink; one nobody has written down yet says its name, quieter. */
/* replaces app.css: .tile.sound .inner .wave */
.tile.sound .inner .wave { color: var(--glyph); height: 22px; }
.tile.sound .inner .words { color: var(--ink); }
.tile.sound .inner .words.untold { color: var(--muted); }

/* The corner of a sound's card that plays it where it is (CardMetrics.playCorner: 74 by 36). */
.play-corner { position: absolute; right: 0; bottom: 0; width: 74px; height: 36px; padding: 0; border-radius: 0 0 10px 0; outline: none; }
.play-corner .badge.play { pointer-events: none; }
.play-corner:focus-visible .badge.play { box-shadow: 0 0 0 2px var(--chip-ink); }

/* Badges are the Mac's: a 17-point capsule, black at 52%, a small bold symbol, small semibold words. */
/* replaces app.css: .badge */
.badge {
  position: absolute; display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 6px; border-radius: 8.5px;
  background: rgb(0 0 0 / 0.52); color: #fff; font-size: 9.5px; font-weight: 600; line-height: 1;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* replaces app.css: .badge.kept */
.badge.kept { left: 8px; top: 8px; width: auto; padding: 0 6px; justify-content: center; }
/* replaces app.css: .sheet .badge.kept, .tile.sound .badge.kept */
.sheet .badge.kept, .tile.sound .badge.kept { left: auto; right: 11px; top: 11px; background: rgb(0 0 0 / 0.52); }
.badge.kept.far { left: auto; right: 11px; top: 11px; }

/* The name under a picture, and where a link is from with its site's icon. */
/* replaces app.css: .caption .name */
.caption .name {
  font-size: 12px; line-height: 15px; color: var(--body); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.card.uniform .caption .name { -webkit-line-clamp: 1; }
.caption .sub .favicon { flex: none; border-radius: 2.5px; overflow: hidden; display: inline-grid; place-items: center; color: var(--muted); }
.caption .sub .favicon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.caption .sub .sub-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* What is in the Trash is drawn a little faded. */
.card.trashed, .lines .line.trashed { opacity: 0.7; }

/* The list (the Mac's ItemRow): a 36-point picture, the name over what it is, the first tags, when it came. */

/* replaces app.css: .lines */
.lines { margin: 8px 14px 78px; }
.lines .line {
  grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 11px; height: auto; min-height: 50px; padding: 6px 10px;
}
/* Hairlines between the rows, from where the words start; none around the row picked out or pointed at. */
.lines .line + .line::before {
  content: ""; position: absolute; top: 0; left: 57px; right: 10px; border-top: 1px solid var(--line); pointer-events: none;
}
.lines .line:hover::before, .lines .line:hover + .line::before,
.lines .line.picked::before, .lines .line.picked + .line::before { border-top-color: transparent; }
/* The spectrum ring is for a card and the graph's dot: a row picked out is simply shaded. */
.lines .line.picked::after { content: none; }
.lines .line .thumb { position: relative; width: 36px; height: 36px; border-radius: 8px; }
.lines .line .thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.lines .line .thumb .favicon { border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.lines .line .thumb .favicon img { object-fit: contain; }
.lines .line .texts { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lines .line .title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lines .line .name { font-size: 13px; font-weight: 500; color: var(--ink); }
.lines .line .kept-mark { flex: none; display: inline-flex; color: var(--muted); }
.lines .line .sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.lines .line .tags { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.lines .line .when { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
@media (max-width: 520px) {
  .lines .line { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .lines .line .tags { display: none; }
}

/* The filter bar (the Mac's FilterBar): chips with a symbol, a name and a chevron, grey when off and
   white with a fine ink edge when on; words in force with a cross; the bar's own words at the end. */

/* replaces app.css: .filter-bar */
.filter-bar {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; height: 42px; padding: 0 20px;
  overflow-x: auto; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
/* replaces app.css: .fchip */
.fchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 12px; font-weight: 500; color: var(--body); background: var(--tile); box-shadow: none; white-space: nowrap;
}
/* replaces app.css: .fchip:hover */
.fchip:hover { background: var(--chosen); }
/* replaces app.css: .fchip.on */
.fchip.on, .fchip.on:hover {
  background: var(--card); color: var(--ink); font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--faint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent);
}
.fchip:focus-visible { outline: 2px solid var(--chip-ink); outline-offset: 1px; }
.fchip .fword { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.fchip .fchev { display: inline-flex; color: var(--faint); }
.fchip .fswatch { flex: none; width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.fchip .fswatch.on { box-shadow: inset 0 0 0 1px var(--line); }
.fchip.removable { padding: 0 7px 0 10px; }
.fremove { width: 14px; height: 14px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.fremove:hover { color: var(--ink); background: var(--hover); }
/* replaces app.css: .fend */
.fend { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; padding-left: 8px; }
.fbutton { height: 26px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.fbutton:hover { color: var(--ink); }
.fbutton.strong { font-weight: 600; color: var(--ink); }
.fbutton:focus-visible { outline: 2px solid var(--chip-ink); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 520px) {
  .filter-bar { padding: 0 14px; }
}

/* The panels that hang from a chip: Colour's swatches and Tags' chips. */
.fpanel {
  position: fixed; z-index: 31; border-radius: 12px; color: var(--ink); font-size: 12.5px;
  background: var(--floating); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgb(0 0 0 / 0.18);
}
.fpanel.colours { width: 228px; padding: 14px; display: grid; gap: 10px; }
.fpanel-head { font-size: 11px; font-weight: 600; color: var(--muted); }
.fswatches { display: grid; grid-template-columns: repeat(6, 26px); gap: 8px; }
.fswatch-choice { width: 26px; height: 26px; padding: 2px; border-radius: 50%; display: grid; place-items: center; }
.fswatch-choice > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.fswatch-choice.on { box-shadow: inset 0 0 0 1.5px var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 70%, transparent); }
.fswatch-choice.any > span { background: var(--tile); color: var(--muted); box-shadow: none; }
.fswatch-choice:focus-visible { outline: 2px solid var(--chip-ink); outline-offset: 1px; }
.fpanel-foot { font-size: 10.5px; line-height: 1.35; color: var(--faint); }
.fpanel.tags { width: 320px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; overflow: hidden; }
.fpanel-ask { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.fpanel-field { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13.5px; color: var(--ink); }
.ftags { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.ftag {
  max-width: 100%; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 7px;
  background: var(--tile); font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.ftag .hash { color: var(--muted); }
.ftag .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftag.on { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 55%, transparent); }
.ftag.on .hash { color: var(--ink); }
.ftag:focus-visible { outline: 2px solid var(--chip-ink); outline-offset: 1px; }
.ftags-none { width: 100%; padding: 18px 6px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* Nothing to show (the Mac's EmptyLibraryView): the bird, a title, a few words, the buttons. */
.empty-bird { display: block; width: 64px; height: 64px; object-fit: contain; margin: 0 auto 14px; -webkit-user-drag: none; user-select: none; }
/* replaces app.css: .empty h2 */
.empty h2 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.4px; margin: 0 0 10px; color: var(--ink); }
/* replaces app.css: .empty p */
.empty p { margin: 0 auto; max-width: 380px; font-size: 13px; line-height: 1.45; color: var(--muted); }
/* replaces app.css: .empty-actions */
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
/* The Mac's GlassButtonStyle: white with a fine edge, or filled with ink for the one action most wanted. */
.empty-actions .button {
  height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  background: var(--card); color: var(--body); box-shadow: inset 0 0 0 1px var(--line);
}
.empty-actions .button.strong { background: var(--ink); color: var(--page); box-shadow: none; }
.inbox-queue > .empty { flex: 1; height: auto; min-height: 0; padding: 24px; }

/* ---- The Info pane and the Inbox (as the Mac's InspectorView and InboxView) ---- */

/* The Info pane and the Inbox's list (js/info.js, js/inbox.js), as the Mac's InspectorView and
   InboxView. Read after app.css: a rule here with the same selector as one there wins. */

/* The pane has one shape whatever it shows: the same bar on top (the item's parts as tabs, or what
   it shows in words) and a body that scrolls under it. */

/* replaces app.css: .pane-bar */
.pane-bar { flex: none; display: flex; align-items: center; gap: 12px; height: 40px; padding: 4px 14px 0 16px; min-width: 0; }
.pane-tabs { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden; }
.pane-name { margin: 0; min-width: 0; font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* In a narrow pane the tabs lose their counts before they lose their words (the Mac's ViewThatFits).
   The pane has a width of its own, so measuring it as a container changes nothing else. */
.app > .info { container-type: inline-size; }
/* replaces app.css: .pane-tab .count (in a pane narrower than 290px only, where it is hidden) */
@container (max-width: 289px) { .pane-tab .count { display: none; } }

/* The library at a glance: two figures, the kinds as tiles, how it is organised, what came lately, its room. */
.figure-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.figure-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.figure-tile b { font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -0.4px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-tile span { font-size: 11.5px; color: var(--muted); }
.kind-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.kind-tile {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border-radius: 10px; text-align: left; color: inherit;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.kind-tile:hover { background: linear-gradient(var(--hover), var(--hover)), var(--card); }
.kind-tile:active { opacity: 0.65; }
.kind-tile:focus-visible { outline: 2px solid var(--selection); outline-offset: 1px; }
.kind-tile .glyph { width: 18px; flex: none; display: grid; place-items: center; color: var(--muted); }
.kind-texts { display: flex; flex-direction: column; min-width: 0; }
.kind-texts b { font-size: 14px; font-weight: 650; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.kind-texts span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lately-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.lately-bar { flex: 1; min-width: 0; border-radius: 2.5px; background: var(--tile); }
.lately-bar.on { background: var(--ink); opacity: 0.7; }
.lately-ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10px; color: var(--faint); }
.pane-section > .meter { margin-top: -2px; }
.info p.note { margin: 0; }

/* A fact in words: two lines at most, and it can be selected and copied (the Mac's DetailText). */
.detail-row .detail-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; user-select: text; -webkit-user-select: text; }

/* The colours of a picture: circles that grow a little under the pointer (the Mac's PaletteSwatch). */
/* replaces app.css: .swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
/* replaces app.css: .swatch */
.swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.12s ease-out; }
.swatch:hover, .swatch:focus-visible { transform: scale(1.14); }
.swatch:focus-visible { outline: 2px solid var(--selection); outline-offset: 2px; }

/* The field for a new tag and its suggestions, which go together. */
.tag-adder { display: flex; flex-direction: column; gap: 8px; }

/* Quiet buttons, as the Mac's GlassButtonStyle: white, with a hairline; the Info pane's own are compact. */
.button.quiet { background: var(--card); color: var(--body); box-shadow: inset 0 0 0 1px var(--line); font-weight: 550; white-space: nowrap; }
.button.small.quiet { height: 24px; padding: 0 9px; gap: 4px; border-radius: 7px; font-size: 11.5px; }
/* replaces app.css: .info .marks-copy */
.info .marks-copy {
  align-self: flex-start; margin-top: 4px; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 550; white-space: nowrap;
  background: var(--card); color: var(--body); box-shadow: inset 0 0 0 1px var(--line);
}
.button.quiet:hover, .info .marks-copy:hover { filter: none; background: linear-gradient(var(--hover), var(--hover)), var(--card); }
.button.quiet:active, .info .marks-copy:active { opacity: 0.65; }

/* The Inbox's list: rows that move, and rows that can be dragged onto a space. */

/* replaces app.css: .inbox-rows */
.inbox-rows { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; }
/* A row that left, seen where it was while it slides out to the left. */
.inbox-rows > .leaving { position: absolute; margin: 0; pointer-events: none; }
/* A row being dragged is pictured without its quick actions. */
.irow.dragging .iquick { display: none; }
.irow.dragging .iage { visibility: visible; }
.irow.dragging .itexts { padding-right: 0; }
/* Several rows dragged at once: how many, beside the pointer. */
.irow-drag {
  position: fixed; z-index: 60; pointer-events: none; display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 15px;
  background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 650; white-space: nowrap; box-shadow: 0 0 0 1px var(--line), var(--lift);
}
/* The bar of actions at the foot slides up when something is picked out; drawn again in its place, it stays still. */
@keyframes inbox-bar-in {
  from { transform: translate(-50%, 14px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.foot-bar > .inbox-bar:not(.steady) { animation: inbox-bar-in 0.18s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .swatch { transition: none; }
  .swatch:hover, .swatch:focus-visible { transform: none; }
  .foot-bar > .inbox-bar { animation: none; }
}

/* ---- An item open in the middle: notes, quotes, pages, pictures, sounds (as the Mac's ItemDetailView) ---- */

/* An item, open in the middle of the window, as the Mac's ItemDetailView: notes (headings, ticked
   tasks, quotes, pictures), quotes written in place, a saved page's header, the sound player, the
   picture pane. Appended after app.css: a rule with an app.css selector replaces what it sets there. */

/* Notes: the first line is written as any other (no title style); headings as the Mac's editor sets
   them, 26 bold, 21, 18 and 16 semibold. */
/* replaces app.css: .note-editor .cm-heading-line */
.note-editor .cm-heading-line { font-weight: 600; line-height: 1.3; }
/* replaces app.css: .note-editor .cm-heading-1 */
.note-editor .cm-heading-1 { font-size: 26px; font-weight: 700; line-height: 1.25; padding: 10px 0 4px; letter-spacing: -0.01em; }
/* replaces app.css: .note-editor .cm-heading-2 */
.note-editor .cm-heading-2 { font-size: 21px; padding: 10px 0 4px; }
/* replaces app.css: .note-editor .cm-heading-3, .note-editor .cm-heading-4, .note-editor .cm-heading-5, .note-editor .cm-heading-6 */
.note-editor .cm-heading-3 { font-size: 18px; padding: 6px 0 4px; }
.note-editor .cm-heading-4, .note-editor .cm-heading-5, .note-editor .cm-heading-6 { font-size: 16px; padding: 6px 0 4px; }
/* replaces app.css: .note-editor .cm-h */
.note-editor .cm-h { font-weight: inherit; }

/* A ticked task's words are grey and struck through; a quote is grey beside a bar in the marks'
   grey; a bare web address is in the links' colour. */
.note-editor .cm-done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
/* replaces app.css: .note-editor .cm-quote-line */
.note-editor .cm-quote-line { border-left: 3px solid var(--faint); padding-left: 14px; color: var(--muted); }
/* replaces app.css: .note-editor .cm-url */
.note-editor .cm-url { color: var(--chip-ink); }
/* replaces app.css: .reader blockquote */
.reader blockquote { margin: 0 0 16px; padding: 2px 0 2px 14px; border-left: 3px solid var(--faint); color: var(--muted); }
/* In the reader a quotation is italic too, as the Mac's MarkdownView sets it (a book keeps its own). */
.reader:not(.book) blockquote { font-style: italic; }

/* A picture in a note: at half its pixels, as wide as the column at most (and 630 points), never
   taller than 440 (editor.js sets its width). */
/* replaces app.css: .note-editor .cm-picture img */
.note-editor .cm-picture img { display: block; max-width: min(100%, 630px); max-height: 440px; height: auto; border-radius: 8px; object-fit: contain; }

/* A table in a note (editor.js), as the Mac draws one: away from the caret its cells on the table's
   columns, between hairlines, the names bold on a grey band, the row of dashes a line under them; the
   row being written shows its Markdown. */
.note-editor .cm-table-cells {
  display: inline-grid; vertical-align: top; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-top: 0;
}
.note-editor .cm-table-first .cm-table-cells { border-top: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.note-editor .cm-table-cells.head { background: var(--hover); font-weight: 600; border-bottom: 0; }
.note-editor .cm-table-cells.last { border-radius: 0 0 6px 6px; }
.note-editor .cm-cell { min-width: 0; padding: 4px 10px; overflow-wrap: anywhere; }
.note-editor .cm-cell + .cm-cell { border-left: 1px solid var(--line); }
.note-editor .cm-cell code { font: 0.88em var(--mono); background: var(--tile); border-radius: 4px; padding: 1px 4px; }
.note-editor .cm-cell mark { background: var(--wash); color: inherit; border-radius: 2px; }
.note-editor .cm-cell s { color: var(--muted); }
.note-editor .cm-table-rule { display: inline-block; vertical-align: top; max-width: 100%; height: 1px; background: var(--line); }
.note-editor .cm-table-rule-line:not(.cm-table-open) { font-size: 1px; line-height: 1px; }
.note-editor .cm-line.cm-table-open { padding: 4px 10px; }
.note-editor .cm-table-head.cm-table-open { font-weight: 600; }

/* A quote, as the Mac's QuoteDetail: a faint quotation mark, the words large in the serif and always
   written in, who said them after a dash, buttons for where they came from, the comment in a box. */
.reader.quoting { max-width: 720px; padding: 52px 36px 90px; }
.quote-glyph { color: var(--faint); margin: 0 0 20px; }
/* replaces app.css: .reader textarea.quote-source-box */
.reader textarea.quote-source-box {
  display: block; width: 100%; min-height: 0; margin: 0 0 20px; padding: 0; overflow: hidden;
  font: 24px/1.5 var(--serif); color: var(--ink);
}
.reader textarea.quote-source-box::placeholder, .reader input.quote-who::placeholder { color: var(--faint); }
/* replaces app.css: .reader .quote-words */
.reader .quote-words { font: 24px/1.5 var(--serif); color: var(--ink); margin: 0 0 20px; white-space: pre-line; }
.quote-from { display: flex; align-items: baseline; gap: 8px; margin: 0 0 20px; font-size: 15px; color: var(--body); }
.quote-from .dash { flex: none; color: var(--faint); }
.quote-from .who { min-width: 0; overflow-wrap: anywhere; }
/* replaces app.css: .quote-who */
.reader input.quote-who {
  flex: 1; min-width: 0; max-width: none; height: auto; padding: 0; border: 0; outline: 0; border-radius: 0;
  background: none; box-shadow: none; font: inherit; color: var(--body);
}
.quote-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.glass-button {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 12px; border-radius: 8px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--body); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.glass-button span { overflow: hidden; text-overflow: ellipsis; }
.glass-button .icon { flex: none; }
.reader a.glass-button { color: var(--body); }
.reader a.glass-button:hover { color: var(--ink); text-decoration: none; }
.glass-button:active { opacity: 0.65; }
@media (max-width: 760px) {
  .reader.quoting { padding: 30px 20px 100px; }
}
.inbox-body .reader.quoting { padding-top: 34px; padding-bottom: 120px; }

/* A bar floating at the foot of an item (a quote's Copy), as the Mac's FloatingBar: a glass capsule
   38 points tall, 16 over the foot, staying there while the item scrolls under it. */
.item-foot { position: sticky; bottom: 0; z-index: 6; height: 0; pointer-events: none; }
.item-float {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 5px; border-radius: 19px; pointer-events: auto; white-space: nowrap;
}
.item-float .float-word { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 14px; font-size: 12px; font-weight: 500; color: var(--body); }
.item-float .float-word:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.item-float .float-word:disabled { color: var(--faint); }
/* Toasts stand clear of it, as of the other bars at the foot (menus-keys-toasts.css lifts them to the same height). */
body:has(.item-float) .toast { bottom: 68px; }

/* What was written about an item, in a box with a speech bubble (pages and quotes). */
/* replaces app.css: .reader .comment */
.reader .comment {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; padding: 12px; border-radius: 10px;
  background: var(--tile); color: var(--body); font-size: 13px; line-height: 1.45; white-space: pre-line;
}
.reader .comment .icon { flex: none; margin-top: 1px; color: var(--muted); }
.reader .comment span { min-width: 0; overflow-wrap: anywhere; }

/* A saved page, as the Mac's reader: its picture first, 280 points tall; its name large and light;
   where it is from and when it was saved; its description; a rule; the article. */
/* replaces app.css: .reader .hero */
.reader .hero {
  display: block; width: 100%; height: 280px; object-fit: cover; margin: 0 0 18px; border-radius: 16px;
  background: var(--tile); box-shadow: 0 0 0 1px var(--line);
}
.reader.page > h1 { font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -1.2px; color: var(--ink); margin: 0 0 14px; overflow-wrap: break-word; }
/* replaces app.css: .reader .lead */
.reader .lead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
/* replaces app.css: .reader .lead a */
.reader .lead a { color: var(--muted); }
.reader .lead a:hover { color: var(--ink); text-decoration: underline; }
.reader .lead .dot { color: var(--faint); }
.reader .lead .site-icon { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; flex: none; }
.reader .standfirst { font-size: 18px; font-weight: 500; line-height: 1.45; letter-spacing: -0.3px; color: var(--body); margin: 0 0 18px; }
.reader.page > hr.rule { margin: 0 0 18px; }
.reader.page .article { font-size: 16.5px; }
.reader .page-waiting { text-align: center; color: var(--muted); padding: 30px 0; margin: 0; }
.reader .page-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 0; }
.reader .page-empty-title { font-size: 15px; font-weight: 500; color: var(--ink); }
.reader .page-empty-words { font-size: 13px; color: var(--muted); }
.reader .page-empty .button { margin-top: 4px; }
.reader .page-empty a.button.strong, .reader .page-empty a.button.strong:hover { color: var(--page); text-decoration: none; }
@media (max-width: 760px) {
  .reader .hero { height: min(280px, 56vw); }
  .reader.page > h1 { font-size: 26px; letter-spacing: -0.8px; }
}

/* A passage that can be saved as a quote: a small round mark in the margin under the pointer. The
   margin counts as part of the passage, so the mark does not vanish on the way to it. */
.reader .quotable { position: relative; }
.reader .quotable::before { content: ""; position: absolute; top: 0; bottom: 0; left: -32px; width: 32px; }
.reader .quote-this {
  position: absolute; left: -30px; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: var(--body); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0; transition: opacity 0.12s ease-out; user-select: none; -webkit-user-select: none; font-style: normal;
}
.reader .quotable:hover > .quote-this, .reader .quote-this:focus-visible { opacity: 1; }
.reader .quote-this:hover { color: var(--ink); }
@media (hover: none), (max-width: 760px) {
  .reader .quote-this, .reader .quotable::before { display: none; }
}

/* A sound, as the Mac's AudioDetail: back 15, play, ahead 15, where it is, its shape, how long it
   is, how fast; then Transcript and Notes. */
.reader.sound { padding-top: 26px; }
.sound-player { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.sound-skip { position: relative; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 15px; color: var(--body); }
.sound-skip > span { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 2px; font-size: 7.5px; font-weight: 700; line-height: 1; pointer-events: none; }
.sound-skip:hover:not(:disabled) { color: var(--ink); }
.sound-play { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--page); }
.sound-play:hover:not(:disabled) { filter: brightness(1.15); }
.sound-skip:disabled, .sound-play:disabled { opacity: 0.4; }
.sound-time { flex: none; min-width: 30px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sound-time.now { text-align: right; }
/* The shape: what has been heard in ink, the rest pale (drawn on the canvas in these two colours). */
.sound-wave { position: relative; flex: 1; min-width: 60px; height: 36px; color: var(--ink); touch-action: pan-y; border-radius: 4px; }
.sound-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--faint); }
.sound-wave:focus-visible { outline: 2px solid var(--selection); outline-offset: 3px; }
.sound-speed {
  flex: none; min-width: 40px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--tile);
  color: var(--body); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sound-speed:hover { color: var(--ink); }
.sound-tabs-row { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.sound-tabs-row .gap { flex: 1; min-width: 8px; }
.sound-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 16px; background: var(--tile); }
.sound-tab { height: 26px; padding: 0 14px; border-radius: 13px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sound-tab:hover { color: var(--ink); }
.sound-tab[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0.5px 1.5px rgb(0 0 0 / 0.08); }
.sound-copy { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tile); color: var(--body); }
.sound-copy:hover { color: var(--ink); }
.sound-summary { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.sound-said { font-size: 17px; }
.sound-none { margin: 0; font-size: 13px; color: var(--muted); }
.sound-cannot { margin: 0 0 18px; padding: 22px 0; display: grid; place-items: center; }
.sound-notes {
  display: block; width: 100%; min-height: 220px; padding: 0; border: 0; outline: 0; resize: none; overflow: hidden;
  background: none; font: 16px/1.5 var(--sans); color: var(--ink);
}
.sound-notes::placeholder { color: var(--faint); }
@media (max-width: 520px) {
  .sound-player { flex-wrap: wrap; row-gap: 10px; }
  .sound-wave { order: 10; flex-basis: 100%; }
}

/* A picture, on the Mac's grey, with 6-point corners and a soft shadow under it; the bar under it
   says how near it is and fits it to the window again. */
/* replaces app.css: .content.picture-mode */
.content.picture-mode { overflow: hidden; background: var(--tile); }
/* replaces app.css: .zoom-stage img.zoom-picture */
.zoom-stage img.zoom-picture {
  position: absolute; left: 0; top: 0; max-width: none; max-height: none; transform-origin: 0 0; border-radius: 6px;
  box-shadow: 0 6px 28px rgb(0 0 0 / 0.14); opacity: 0; transition: opacity 0.18s; will-change: transform;
}
/* replaces app.css: .zoom-bar */
.zoom-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 5px; border-radius: 19px;
}
.zoom-bar .round { width: 32px; height: 28px; border-radius: 8px; color: var(--body); }
.zoom-bar .round:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.zoom-bar .round:disabled { color: var(--faint); background: none; }
.zoom-bar .zoom-percent, .zoom-bar .zoom-percent:hover {
  display: inline-grid; place-items: center; min-width: 44px; height: 28px; background: none;
  font-size: 11.5px; font-weight: 500; color: var(--body); font-variant-numeric: tabular-nums;
}

/* ---- The PDF and book readers (as the Mac's PDFDetail and BookDetail) ---- */

/* PDFs and books (pdf.js, book.js), as the Mac's PDFDetail and BookDetail: what is added to
   app.css's rules for them, and the rules this file takes the place of, each said above it. This
   file comes after app.css. Colours are app.css's names; a mark's own colour comes with the mark,
   set on it by the reader. */

/* A PDF's own links, invisible over the words they cover and out of the pointer's way (pdf.js): a
   drag from linked words selects them, a click on a highlight over a link brings up its card, and a
   plain click follows the link under it, with the hand over it as on the Mac. The keyboard reaches
   them as links. Not there while another tool is in hand. */
.pdf-links { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pdf-link { position: absolute; border-radius: 2px; }
.pdf-pages.tool-read.over-link, .pdf-pages.tool-read.over-link * { cursor: pointer; }
.pdf-link:focus-visible { outline: 2px solid var(--selection); outline-offset: 1px; }
.pdf-pages:not(.tool-read) .pdf-links { display: none; }

/* A document's table of contents, standing on its button in the bar at the foot (the Mac's
   ContentsList): 320 points wide, two lines at most for an entry, the parts in the ink and what
   is under them in the body's colour, the page on the right, the entry being read marked. */
.amenu.contents-list .alist { flex: 1; min-height: 0; padding: 8px; }
.amenu.contents-list .arow {
  height: auto; min-height: 30px; padding-top: 6px; padding-bottom: 6px; padding-right: 10px;
  align-items: flex-start; gap: 8px; border-radius: 7px; white-space: normal; font-size: 12.5px; color: var(--body);
}
.amenu.contents-list .atitle {
  flex: 1; min-width: 0; overflow: hidden; line-height: 1.32;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.amenu.contents-list .atitle.top { font-weight: 550; color: var(--ink); }
.amenu.contents-list .ahint { font-size: 11px; color: var(--muted); padding-top: 1px; }
.amenu.contents-list .arow.on { background: var(--hover); }
.amenu.contents-list .arow.current, .amenu.contents-list .arow.current.on { background: var(--chosen); }
.amenu.contents-list .arow.off, .amenu.contents-list .arow.off .atitle { color: var(--faint); }
@media (pointer: coarse) { .amenu.contents-list .arow { min-height: 40px; } }

/* A book's bar floats over the foot of the page, as a PDF's does (the Mac's FloatingBar): back,
   the contents under the chapter's name, on; how far through; the text's size; find. */
/* replaces app.css: .book-bar */
.book-bar {
  position: static; top: auto; z-index: auto; margin: 0; width: auto; max-width: 100%; min-width: 0; flex: 0 1 auto;
  display: flex; align-items: center; gap: 1px; height: 38px; padding: 0 5px; border-radius: 19px;
}
/* replaces app.css: .book-bar button */
.book-bar button { height: 28px; min-width: 0; border-radius: 8px; display: grid; place-items: center; color: var(--body); }
/* replaces app.css: .book-bar button:hover */
.book-bar button:hover { background: var(--hover); color: var(--ink); }
.book-bar button:disabled, .book-bar button:disabled:hover { background: none; color: var(--body); }
/* replaces app.css: .book-bar .book-where */
.book-bar .book-where {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: none; padding: 0 8px;
  font-size: 12px; font-weight: 500; color: var(--body);
}
/* replaces app.css: .book-where span */
.book-where span { min-width: 0; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-percent { flex: none; min-width: 34px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.psummary.book-summary { min-width: 84px; }
/* On a phone the bar keeps its buttons and leaves out how far through. */
@media (max-width: 520px) {
  .book-percent, .book-percent-rule { display: none; }
  .book-where span { max-width: 38vw; }
}

/* A book's highlights, as the Mac's reader paints them: the mark's colour see-through under words
   that keep their own colour, a little stronger or weaker in the dark (both strengths come with
   the mark); a line under or through the words in the mark's colour; a dotted line under words
   that carry a comment. The dark strength follows the theme as app.css's colours do: the
   system's, or the one chosen in Settings. */
/* replaces app.css: mark.bmark */
mark.bmark {
  color: inherit; cursor: pointer; background: none; border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
mark.bmark.highlight, mark.bmark.comment { background: rgb(var(--tint) / var(--tint-light)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) mark.bmark.highlight, :root:not([data-theme="light"]) mark.bmark.comment { background: rgb(var(--tint) / var(--tint-dark)); }
}
:root[data-theme="dark"] mark.bmark.highlight, :root[data-theme="dark"] mark.bmark.comment { background: rgb(var(--tint) / var(--tint-dark)); }
/* replaces app.css: mark.bmark.underline */
mark.bmark.underline { background: none; text-decoration: underline 2px rgb(var(--tint) / 0.9); text-underline-offset: 3px; }
/* replaces app.css: mark.bmark.strikethrough */
mark.bmark.strikethrough { background: none; text-decoration: line-through 2px rgb(var(--tint) / 0.9); }
mark.bmark.commented { border-bottom: 2px dotted color-mix(in srgb, var(--ink) 50%, transparent); }
/* The highlight whose card is up. */
mark.bmark.lit { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 35%, transparent); }

/* The message in the corner stands clear of a PDF's or a book's bars at the foot, as the Mac's
   ToastView.lift (two bars stacked lift it further: menus-keys-toasts.css). */
body:has(.pdf-bars) .toast { bottom: 68px; }

/* The match shown when finding in a book, as a PDF's current match is picked out. */
::highlight(risorgi-found) { background-color: rgb(255 149 0 / 0.65); color: inherit; }

/* ---- Menus, the capture menu, the command bar, toasts and tooltips (as the Mac's ActionMenu, ToastView, Tooltip) ---- */

/* Menus, the capture menu, the command bar, tooltips and the message in the corner, as the Mac
   draws them (Views/ActionMenu.swift, CaptureMenu.swift, CommandBar.swift, Tooltip.swift,
   Components.swift's ToastView). Appended after app.css: a rule here with the same selector as
   one there takes its place. */

/* The message in the corner: a dark capsule 68 points over the foot of the window, clear of the
   bars that float there and of a note's corner (ToastView.lift); its symbol in a white disc that
   bounces, its words on up to two lines, Undo in a capsule of its own. */

/* replaces app.css: .toast */
.toast {
  position: fixed; right: 20px; bottom: 68px; z-index: 40; display: flex; align-items: center; gap: 10px;
  min-height: 38px; height: auto; max-width: min(420px, calc(100vw - 40px)); padding: 7px 16px 7px 7px;
  border-radius: 999px; background: rgb(30 30 33 / 0.94); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09), var(--lift);
  transform-origin: 100% 100%; animation: toast-in 0.4s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.toast.undoable { padding-right: 7px; }
.toast.leaving { animation: toast-out 0.18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: scale(0.96); } }

/* replaces app.css: body:has(.inbox-bar, .zoom-bar, .view-bar, .sel-bar) .toast */
body:has(.inbox-bar, .zoom-bar, .view-bar, .sel-bar) .toast { bottom: 68px; }
/* replaces app.css: body:has(.note-corner) .toast */
body:has(.note-corner) .toast { bottom: 68px; }
/* replaces app.css: body:has(.inbox-bar, .zoom-bar, .view-bar, .sel-bar):has(.note-corner) .toast */
body:has(.inbox-bar, .zoom-bar, .view-bar, .sel-bar):has(.note-corner) .toast { bottom: 118px; }
/* Beside the Inbox's list, a note's corner, a quote's bar and a picture's zoom stand over the Inbox's bar. */
body:has(.inbox-body .foot-pill, .inbox-body .item-foot, .inbox-body .zoom-bar) .toast { bottom: 118px; }
/* A PDF's two bars stacked in a narrow window. */
body:has(.pdf-bars.stacked) .toast { bottom: 112px; }

/* replaces app.css: .toast-symbol */
.toast-symbol {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #fff; color: rgb(30 30 33);
}
.toast-symbol .icon { animation: toast-bounce 0.5s 0.08s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes toast-bounce { 0% { transform: scale(1); } 30% { transform: scale(0.7); } 65% { transform: scale(1.15); } 100% { transform: scale(1); } }
.toast-words {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* replaces app.css: .toast button */
.toast button { color: #fff; font-weight: 600; }
/* replaces app.css: .toast button:hover */
.toast button:hover { color: #fff; }
.toast .toast-undo {
  flex: none; height: 25px; padding: 0 11px; border-radius: 13px; white-space: nowrap;
  font-size: 12px; font-weight: 600; background: rgb(255 255 255 / 0.16);
}
.toast .toast-undo:hover { background: rgb(255 255 255 / 0.24); }
.toast .toast-undo:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Tooltips: over what they belong to, 11.5-point words, wrapped at 264 points, fading in. */

/* replaces app.css: .tipbubble */
.tipbubble {
  position: fixed; z-index: 50; pointer-events: none; max-width: 264px; padding: 5px 9px; border-radius: 8px;
  white-space: normal; text-align: center; overflow-wrap: break-word;
  background: rgb(30 30 33 / 0.94); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.3; box-shadow: var(--lift);
  animation: tip-in 0.12s ease-out;
}
@keyframes tip-in { from { opacity: 0; } }

/* Risorgi's own menus: 292 points wide (submenus 262), corners of 14, lines 32 tall with
   13.5-point words, icons in the body's ink, the key in faint letters before the chevron. */

/* Over everything in the window, the message in the corner included, as the Mac's menus are panels of their own. */
/* replaces app.css: .amenu-layer */
.amenu-layer { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
/* replaces app.css: .amenu */
.amenu {
  position: fixed; pointer-events: auto; max-height: min(620px, calc(100vh - 16px)); display: flex; flex-direction: column;
  border-radius: 14px; background: var(--floating); backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgb(0 0 0 / 0.18); overflow: hidden; outline: none;
}
/* replaces app.css: .aask */
.aask { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 14px; color: var(--muted); border-bottom: 1px solid var(--line); flex: none; }
/* replaces app.css: .alist */
.alist { padding: 6px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
/* replaces app.css: .arow */
.arow { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
/* replaces app.css: .aglyph */
.aglyph { width: 20px; display: grid; place-items: center; color: var(--body); flex: none; }
/* replaces app.css: .adot */
.adot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.apath-sep { color: var(--faint); }
/* replaces app.css: .ahint */
.ahint { font-size: 11.5px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
/* replaces app.css: .atick */
.atick { color: var(--body); display: grid; place-items: center; flex: none; }
.akey { font-size: 12px; font-weight: 500; color: var(--faint); flex: none; }
/* replaces app.css: .achev */
.achev { color: var(--faint); display: grid; place-items: center; flex: none; margin-right: -3px; }
/* replaces app.css: .arule */
.arule { height: 1px; background: var(--line); margin: 4px; flex: none; }
/* replaces app.css: .ahead */
.ahead { height: 26px; display: flex; align-items: flex-end; padding: 0 10px 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.aempty { display: flex; align-items: center; height: 32px; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
/* A finger needs taller lines than a pointer. */
@media (pointer: coarse) {
  .arow, .aempty { height: 40px; }
}

/* The capture menu: one panel 78 points from the top over the window dimmed a little, 320 wide
   (400 for media), its lines 38 tall with the icon in a tile of 26. */

.veil.capture-veil { padding: 78px 16px 16px; }
/* replaces app.css: .capture-menu */
.capture-menu {
  width: min(320px, 100%); border-radius: 16px; background: var(--floating);
  backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgb(0 0 0 / 0.22); overflow: hidden; outline: none;
}
.capture-menu.wide { width: min(400px, 100%); }
/* replaces app.css: .chead */
.chead {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.chead .keycap { color: var(--faint); }
.ctitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cback { width: 18px; height: 18px; margin-left: -4px; border-radius: 5px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cback:hover { color: var(--ink); background: var(--hover); }
.clist { display: grid; gap: 2px; padding: 8px; }
.crow { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 9px; border-radius: 10px; font-size: 13.5px; color: var(--ink); }
.crow.on { background: var(--chosen); }
.crow.on .cname { font-weight: 500; }
.cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctile { width: 26px; height: 26px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--tile); color: var(--glyph); }
.clink { display: flex; align-items: center; gap: 11px; height: 54px; padding: 0 17px; }
.cfield { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.cmedia { display: grid; gap: 12px; padding: 12px; }
.cdrop {
  display: grid; justify-items: center; align-content: center; gap: 4px; width: 100%; height: 138px; padding: 0 16px;
  border-radius: 12px; background: var(--tile); border: 1.2px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  color: var(--ink); text-align: center;
}
.cdrop b { font-size: 13.5px; font-weight: 600; }
.cdrop > span:last-child { font-size: 12px; color: var(--muted); }
.cdrop-glyph { color: var(--glyph); margin-bottom: 3px; }
.cdrop:hover .cdrop-glyph, .cdrop.over .cdrop-glyph { color: var(--ink); }
.cdrop.over { background: var(--chosen); border-color: color-mix(in srgb, var(--ink) 50%, transparent); }
.cdrop:focus-visible { outline: 2px solid var(--selection); outline-offset: 2px; }
.cstaged { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cfile {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 5px 0 7px; border-radius: 14px; flex: none;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--glyph);
}
.cfile-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.cfile-x { width: 14px; height: 14px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cfile-x:hover { color: var(--ink); background: var(--hover); }
.cbuttons { display: flex; align-items: center; gap: 8px; }
.cgap { flex: 1; }
.creturn { opacity: 0.6; }

/* The command bar: 78 points from the top, as the Mac's, rows of 40 with 13.5-point names. */

.veil.searching { padding-top: 78px; }
.veil.searching .panel { border-radius: 18px; }
.veil.searching .panel .result { height: 40px; }
.veil.searching .panel .result .name { font-size: 13.5px; font-weight: 400; }
.veil.searching .panel .result.on .name { font-weight: 500; }
.veil.searching .panel .result .kind { font-size: 11.5px; flex: none; }

/* The search in force, over what it found: its words in the filter bar's chip with a cross (the
   Mac's RemovableChip; .fchip, .fword and .fremove are cards-filters.css's), on a row as tall as
   the filter bar. */

.search-scope { display: flex; align-items: center; height: 42px; padding: 0 20px; }
@media (max-width: 520px) {
  .search-scope { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.leaving, .toast-symbol .icon, .tipbubble { animation: none; }
}

/* ---- Settings, the theme, and the space editors (as the Mac's SettingsView) ---- */

/* Settings (settings.js), the space and smart-space sheets (spaces.js), and the theme chosen in
   Settings › Appearance. This file comes after app.css; a rule that takes the place of one there
   says so above it. */

/* The theme: Light or Dark as chosen, or the system's when neither is (no data-theme on <html>).
   :root[data-theme] outweighs app.css's :root, inside its @media (prefers-color-scheme: dark) or not,
   so the choice holds whichever way the system points. */

:root[data-theme="light"] {
  --ink: rgb(28 28 31);
  --body: rgb(60 60 66);
  --muted: rgb(118 118 126);
  --faint: rgb(166 166 174);
  --line: rgb(0 0 0 / 0.08);
  --canvas: rgb(246 246 247);
  --page: rgb(255 255 255);
  --card: rgb(255 255 255);
  --tile: rgb(234 234 237);
  --floating: rgb(255 255 255 / 0.86);
  --chosen: rgb(0 0 0 / 0.075);
  --hover: rgb(0 0 0 / 0.04);
  --glyph: rgb(140 140 148);
  --recording: rgb(226 62 52);
  --sidebar: rgb(238 238 240);
  --lift: 0 4px 12px rgb(0 0 0 / 0.10);
  --card-shadow: 0 0 0 1px rgb(0 0 0 / 0.05), 0 1px 2px rgb(0 0 0 / 0.04);
  --chip: rgb(92 108 196 / 0.13);
  --chip-ink: rgb(70 84 170);
  --wash: rgb(255 219 77 / 0.55);
  --selection: rgb(10 132 255 / 0.55);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: rgb(242 242 245);
  --body: rgb(214 214 220);
  --muted: rgb(152 152 160);
  --faint: rgb(106 106 114);
  --line: rgb(255 255 255 / 0.10);
  --canvas: rgb(24 24 26);
  --page: rgb(28 28 30);
  --card: rgb(40 40 43);
  --tile: rgb(48 48 52);
  --floating: rgb(46 46 50 / 0.80);
  --chosen: rgb(255 255 255 / 0.13);
  --hover: rgb(255 255 255 / 0.06);
  --glyph: rgb(164 164 172);
  --recording: rgb(244 86 74);
  --sidebar: rgb(32 32 35);
  --lift: 0 4px 12px rgb(0 0 0 / 0.40);
  --card-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
  --chip: rgb(130 146 240 / 0.20);
  --chip-ink: rgb(170 182 250);
  --wash: rgb(217 179 51 / 0.38);
  --selection: rgb(64 156 255 / 0.65);
  color-scheme: dark;
}

/* The three things app.css draws for dark mode outside its colours (a done task's tick, in the reader
   and in the note editor, a switch's knob, a PDF page's shadow), made to follow the choice too. */
:root[data-theme="light"] .reader .task.done .box,
:root[data-theme="light"] .note-editor .cm-task.done {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .reader .task.done .box,
:root[data-theme="dark"] .note-editor .cm-task.done {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500 10 17.500 19.500 7'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .switch.on::after { background: #fff; }
:root[data-theme="dark"] .switch.on::after { background: rgb(28 28 30); }
:root[data-theme="light"] .pdf-page { box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 10px rgb(0 0 0 / 0.08); }
:root[data-theme="dark"] .pdf-page { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 2px 12px rgb(0 0 0 / 0.5); }

/* Settings, as the Mac's SettingsView: 720 by 600, the panes down a side 204 points wide with a
   search field over them, the pane's name in a band 50 points tall over what scrolls under it. */

/* replaces app.css: .settings-window */
.settings-window {
  width: min(720px, 100%); height: min(600px, 100%); display: flex; overflow: hidden; border-radius: 16px;
  background: var(--canvas); box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgb(0 0 0 / 0.3);
}
/* replaces app.css: .settings-side */
.settings-side {
  width: 204px; flex: none; min-height: 0; display: flex; flex-direction: column; padding: 0;
  background: color-mix(in srgb, var(--tile) 45%, transparent); border-right: 1px solid var(--line);
}
.settings-search {
  flex: none; display: flex; align-items: center; gap: 6px; height: 30px; margin: 14px 12px 10px; padding: 0 9px;
  border-radius: 9px; background: var(--tile); color: var(--muted);
}
.settings-search:focus-within { box-shadow: 0 0 0 2px var(--chosen); }
.settings-find { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; font-size: 12.5px; color: var(--ink); }
.settings-find::placeholder { color: var(--muted); }
.settings-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 10px 12px; scrollbar-width: thin; }
.settings-group { padding: 14px 10px 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.settings-none { padding: 10px; font-size: 12px; color: var(--muted); }
/* replaces app.css: .settings-side .row */
.settings-side .row {
  width: 100%; height: 32px; flex: none; margin: 0; padding: 0 9px; gap: 9px; border-radius: 8px;
  font-size: 13px; font-weight: 400; color: var(--body); text-align: left;
}
.settings-side .row .glyph { width: 20px; color: var(--muted); }
.settings-side .row.chosen { background: var(--chosen); color: var(--ink); font-weight: 500; }
.settings-side .row.chosen .glyph { color: var(--ink); }

/* replaces app.css: .settings-pane */
.settings-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.settings-head {
  height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 26px; border-bottom: 1px solid var(--line);
}
/* replaces app.css: .settings-pane h2 */
.settings-pane h2 { margin: 0; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 26px; }
/* replaces app.css: .settings-pane h3 */
.settings-pane h3 { margin: 22px 6px 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.settings-scroll > h3:first-child { margin-top: 0; }
/* replaces app.css: .settings-pane .box */
.settings-pane .box { background: var(--card); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.settings-pane .box > * { position: relative; }
/* Between two rows a hairline that starts 16 points in, as on the Mac. */
.settings-pane .box > * + *::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
/* replaces app.css: .settings-pane .line */
.settings-pane .line {
  display: flex; align-items: center; gap: 12px; min-height: 46px; height: auto; padding: 8px 16px;
  border-top: 0; border-radius: 0; grid-template-columns: none;
}
/* replaces app.css: .settings-pane .what b */
.settings-pane .what b { display: block; font-size: 13px; font-weight: 400; color: var(--ink); }
/* replaces app.css: .settings-pane .what span */
.settings-pane .what span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
/* replaces app.css: .settings-pane .note */
.settings-pane .note { margin: 8px 6px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* A shortcut's keys, as the Mac's ShortcutLine: a rounded box 26 points tall. */
.settings-keys {
  flex: none; display: inline-grid; place-items: center; min-width: 64px; height: 26px; padding: 0 10px; border-radius: 7px;
  background: var(--tile); color: var(--body); font: 500 12px/1 ui-rounded, var(--sans); white-space: pre;
}

/* A choice of tiles (the Mac's TileChoice): faces 54 points tall, the one in force filled and edged
   in ink, its name in bold under it. */
.choice-tiles { display: grid; gap: 10px; padding: 14px 16px; }
.choice-title { font-size: 13px; color: var(--ink); }
.choice-row { display: flex; gap: 10px; }
.choice-tile { flex: 1; min-width: 0; display: grid; gap: 7px; border-radius: 10px; text-align: center; }
.choice-face {
  height: 54px; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--tile) 60%, transparent); color: var(--glyph);
}
.choice-tile:hover .choice-face { color: var(--ink); }
.choice-tile.on .choice-face { background: var(--chosen); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 55%, transparent); }
.choice-name { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-tile.on .choice-name { font-weight: 600; color: var(--ink); }

/* The space and smart-space sheets (spaces.js), 380 points wide as the Mac's SpaceEditor and
   SmartSpaceEditor: the icon beside the name, Delete on the left of the foot. */

.asking.space-sheet, .asking.smart-sheet { width: min(380px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; gap: 12px; }
.asking-foot .sheet-delete { margin-right: auto; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head .field { flex: 1; min-width: 0; }
.sheet-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; }
.space-preview { color: var(--tint); background: color-mix(in srgb, var(--tint) 15%, transparent); }
.smart-icon { color: var(--body); background: var(--tile); }
.space-fields { display: grid; gap: 10px; }
.space-fields .sheet-label { margin: 6px 0 -4px; }
/* replaces app.css: .swatch-pick */
.swatch-pick { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0; }
/* replaces app.css: .swatch-choice */
.swatch-choice { width: auto; height: 28px; display: grid; place-items: center; border-radius: 8px; box-shadow: none; }
/* replaces app.css: .swatch-choice.on */
.swatch-choice.on { box-shadow: none; }
.swatch-dot { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.swatch-dot .icon { visibility: hidden; }
.swatch-choice.on .swatch-dot .icon { visibility: visible; }
.symbol-choice.on, .symbol-choice.on:hover { color: var(--tint); background: color-mix(in srgb, var(--tint) 22%, transparent); }
.smart-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 12px; font-size: 13px; }
.smart-grid > label { justify-self: end; color: var(--body); }
.smart-grid select.field, .smart-grid .tag-pick { justify-self: start; width: auto; min-width: 160px; max-width: 100%; height: 32px; }
.tag-pick { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.tag-pick-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-pick .icon { color: var(--muted); }

/* A narrow window: the panes are a row of their own over the pane, without the search field. */
@media (max-width: 760px) {
  /* replaces app.css: .settings-window (in a narrow window) */
  .settings-window { height: 100%; border-radius: 14px; }
  /* replaces app.css: .settings-side (in a narrow window) */
  .settings-side { overflow: visible; padding: 0 !important; }
  .settings-search, .settings-group { display: none; }
  .settings-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; }
  /* replaces app.css: .settings-side .row (in a narrow window) */
  .settings-side .row { width: auto; }
  /* replaces app.css: .settings-pane (in a narrow window) */
  .settings-pane { padding: 0 !important; }
  .settings-head { padding-left: 16px; }
  .settings-scroll { padding: 14px 16px 24px; }
}

/* ---- The graph and Serendipity (as the Mac's GraphView and SerendipityView) ---- */

/* The graph (graph.js) and Serendipity (serendipity.js), as the Mac's GraphView and SerendipityView.
   This file comes after app.css: a rule here for one of app.css's selectors takes its place. Every
   colour is one of app.css's names, so dark mode follows by itself. */

/* The graph. */

.graph-canvas.turning { cursor: grabbing; }

/* replaces app.css: .graph-caption */
.graph-caption {
  position: absolute; left: 20px; right: auto; bottom: 66px; transform: none; max-width: calc(100% - 40px);
  display: grid; gap: 3px; font-size: 11px; line-height: 1.35; color: var(--muted); text-align: left;
  white-space: normal; font-variant-numeric: tabular-nums; pointer-events: none;
}
.graph-caption .graph-hint { color: var(--faint); }

/* The card of the dot picked out (the Mac's GraphCard): 268 points wide, at the top left, on glass. */
.graph-card { position: absolute; top: 16px; left: 16px; z-index: 2; width: 268px; max-width: calc(100% - 32px); border-radius: 14px; overflow: hidden; color: var(--ink); }
.gcard-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px; }
.gcard-thumb { width: 38px; height: 38px; flex: none; border-radius: 9px; display: grid; place-items: center; overflow: hidden; background: var(--tile); color: var(--glyph); }
.gcard-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.18s; }
.gcard-thumb img.in { opacity: 1; }
.gcard-words { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.gcard-title {
  max-width: 100%; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.gcard-sub { max-width: 100%; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-open {
  margin-top: 5px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px;
  background: var(--ink); color: var(--page); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.gcard-open:hover { opacity: 0.88; }
.gcard-key { opacity: 0.6; }
.gcard-rule { height: 1px; background: var(--line); }
.gcard-ties { display: grid; gap: 1px; padding: 6px; max-height: 238px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.gtie { display: flex; align-items: center; gap: 8px; min-width: 0; height: 28px; padding: 0 7px; border-radius: 7px; text-align: left; }
.gtie:hover, .gtie:focus-visible { background: var(--hover); outline: none; }
.gtie-glyph { width: 18px; flex: none; display: grid; place-items: center; color: var(--glyph); }
.gtie-name { flex: 1; min-width: 0; font-size: 12px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtie-why { flex: none; font-size: 10.5px; color: var(--faint); }

/* Serendipity: the line on why it came up at the top, the card in the room left, then the controls and the tally. */

/* replaces app.css: .serendipity */
.serendipity {
  height: 100%; min-height: 360px; display: flex; flex-direction: column; place-items: normal; align-items: stretch; align-content: normal;
  gap: 0; padding: 0 48px; overflow: hidden;
}
/* replaces app.css: .sreason */
.sreason {
  flex: none; margin: 0; padding: 26px 0 18px; min-height: 64px; font-size: 15px; font-weight: 500; line-height: 20px;
  color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sroom { flex: 1 1 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.sroom > * { grid-area: 1 / 1; }

/* replaces app.css: .scard */
.scard {
  position: relative; display: flex; flex-direction: column; width: auto; min-height: 0; max-width: var(--card-w, 600px); max-height: var(--card-h, 520px);
  transform-origin: 50% 100%; transition: transform 0.42s cubic-bezier(0.32, 0.72, 0.24, 1), opacity 0.32s ease;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.scard.arriving { animation: scard-arrive 0.42s cubic-bezier(0.3, 1.25, 0.5, 1) both; }
@keyframes scard-arrive { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
.scard.leaving { z-index: 1; pointer-events: none; }
/* replaces app.css: .scard.away-right */
.scard.away-right { transform: translateX(var(--away, 120%)) rotate(7deg); opacity: 0; }
/* replaces app.css: .scard.away-left */
.scard.away-left { transform: translateX(var(--away, -120%)) rotate(-7deg); opacity: 0; }
.scard.away-down { transform: translateY(var(--away, 120%)); opacity: 0; }
/* The card's name is said, not shown: what it is shows on the card itself. Replaces app.css's .sname for the card. */
.scard .sname { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* replaces app.css: .sface */
.sface {
  display: block; position: relative; min-height: 0; width: auto; text-align: left; border-radius: 18px; overflow: hidden;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 8px 30px rgb(0 0 0 / 0.08);
}
.scard img { opacity: 0; transition: opacity 0.2s; }
.scard img.in { opacity: 1; }
.scard img.at-once { transition: none; }
.sicon { width: 96px; height: 96px; flex: none; border-radius: 22px; display: grid; place-items: center; background: var(--tile); color: var(--glyph); }

/* A picture, as large as its room allows (its size is worked out in serendipity.js). */
.scard.picture .sface { display: grid; place-items: center; background: var(--tile); }
.scard.picture .sface img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scard.picture .sicon { background: none; }

/* A note's or a quote's words, cut at the last line that fits. */
.scard.words .sface {
  display: flex; flex-direction: column; gap: 14px; padding: 34px;
  width: min(560px, var(--card-w, 560px)); max-height: var(--card-h, 520px);
}
.snote-picture { flex: none; border-radius: 10px; overflow: hidden; background: var(--tile); }
.snote-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.squote-mark { flex: none; display: block; color: var(--faint); }
.swords {
  flex: 0 1 auto; min-height: 0; font-size: 17px; line-height: 25px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.swords.quote { font-size: 21px; line-height: 29px; font-weight: 500; }
.ssource { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A page: its picture, where it is from, its title and the start of its words. */
.scard.page .sface { display: flex; flex-direction: column; width: min(560px, var(--card-w, 560px)); max-height: var(--card-h, 520px); }
.spage-picture { flex: 0 1 auto; min-height: 60px; max-height: calc(var(--card-h, 520px) - 150px); overflow: hidden; background: var(--tile); }
.spage-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.spage-words { flex: none; display: grid; gap: 8px; padding: 22px; }
.spage-site { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.spage-site > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfavicon { width: 14px; height: 14px; flex: none; border-radius: 3px; overflow: hidden; display: grid; place-items: center; }
.sfavicon img { width: 100%; height: 100%; object-fit: cover; }
.spage-title {
  font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.spage-excerpt {
  font-size: 13.5px; line-height: 1.45; color: var(--body);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}

/* A file: its cover (a book's, a PDF's first page) or its icon, its name and what kind of file it is. */
.scard.file .sface {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px;
  width: min(520px, var(--card-w, 520px)); max-height: var(--card-h, 520px);
}
.sfile-cover { flex: none; border-radius: 10px; overflow: hidden; background: var(--tile); box-shadow: 0 0 0 1px var(--line); }
.sfile-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sfile-words { display: grid; gap: 4px; min-width: 0; max-width: 100%; text-align: center; }
.sfile-title {
  font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.sfile-kind { font-size: 12.5px; color: var(--muted); }

/* replaces app.css: .schoices */
.schoices { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 22px; min-height: 64px; }
/* Forget and Keep: large capsules with their keys inside; Keep is the dark one. */
.sbig {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 21px; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--body); background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgb(0 0 0 / 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.sbig:hover { background: var(--hover); box-shadow: 0 0 0 1px var(--line), var(--lift); transform: scale(1.03); }
.sbig.strong { background: var(--ink); color: var(--page); box-shadow: 0 1px 3px rgb(0 0 0 / 0.06); }
.sbig.strong:hover { background: var(--ink); box-shadow: var(--lift); }
.sbig .skey { color: var(--faint); }
.sbig.strong .skey { color: var(--page); opacity: 0.6; }
/* What else can be done with it: round buttons on a glass pill. */
.spill { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 4px; border-radius: 19px; }
.sround { width: 34px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--body); }
.sround:hover { background: var(--hover); color: var(--ink); }
.sround[aria-pressed="true"] { color: var(--ink); }

/* replaces app.css: .scount */
.scount {
  flex: none; padding: 18px 0 20px; font-size: 11.5px; font-weight: 500; color: var(--faint); text-align: center;
  font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.2s ease;
}
.scount.on { opacity: 1; }

/* When the sitting is over, or everything came up. */
.send { display: grid; justify-items: center; gap: 10px; padding: 20px; text-align: center; animation: send-in 0.3s ease both; }
@keyframes send-in { from { opacity: 0; } }
.send-glyph { color: var(--glyph); }
.send h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.send p { margin: 0; max-width: 320px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.send .button { margin-top: 6px; border-radius: 15px; background: var(--floating); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgb(0 0 0 / 0.06); }

@media (prefers-reduced-motion: reduce) {
  .scard, .sbig { transition: opacity 0.2s ease; }
  .scard.arriving { animation: send-in 0.2s ease both; }
  .scard.away-right, .scard.away-left, .scard.away-down, .sbig:hover { transform: none; }
}

@media (max-width: 760px) {
  .graph-caption { left: 16px; max-width: calc(100% - 32px); }
  .serendipity { padding: 0 16px; }
  .sreason { padding: 18px 0 12px; min-height: 50px; }
  .schoices { gap: 10px; padding-top: 16px; }
  .scount { padding: 12px 0 14px; }
}

@media (max-width: 520px) {
  .graph-card { top: 10px; left: 10px; max-width: calc(100% - 20px); }
  .gcard-ties { max-height: 150px; }
  /* On a phone the pill goes on a line of its own, over Forget and Keep, which lose their keys. */
  .schoices { display: grid; grid-template-columns: auto auto; justify-content: center; }
  .spill { grid-column: 1 / -1; justify-self: center; order: -1; }
  .sbig { justify-content: center; padding: 0 16px; }
  .sbig .skey { display: none; }
  .scard.words .sface { padding: 24px; }
}

/* ---- The rail and the search field front and centre: the sidebar hidden in a wide window
   (the owner, 30 November: today's layout with the sidebar open; with it closed, layout 5's rail
   of icons and layout 1's search field) ---- */

.rail { display: none; }
.app.rail-mode .rail {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; position: relative; z-index: 3;
  width: 56px; box-sizing: border-box; margin: 10px 0 10px 10px; padding: 6px 0 8px; border-radius: 22px;
  background: var(--floating); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 22px rgb(0 0 0 / 0.09);
  overflow-y: auto; scrollbar-width: none;
}
.rail > a, .rail > button {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; position: relative;
  border-radius: 13px; color: var(--muted);
}
.rail > a:hover, .rail > button:hover { background: var(--hover); color: var(--ink); }
.rail > .chosen { background: var(--chosen); color: var(--ink); }
.rail-count {
  position: absolute; top: 5px; right: 2px; min-width: 17px; height: 15px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; font-size: 9.5px; line-height: 15px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--page); background: var(--body); box-shadow: 0 0 0 1.5px var(--canvas);
}
.rail-gap { width: 24px; height: 1px; margin: 6px 0; flex: none; background: var(--line); }
.rail-fill { flex: 1; min-height: 8px; }
.rail img { width: 28px; height: 28px; margin-top: 6px; object-fit: contain; flex: none; }

.hero { display: none; }
.hero.on { display: flex; justify-content: center; flex: none; padding: 22px 16px 10px; background: var(--canvas); }
.hero-field {
  display: flex; align-items: center; gap: 10px; width: min(720px, 100%); height: 56px; box-sizing: border-box;
  padding: 0 14px 0 20px; border-radius: 28px; color: var(--muted); cursor: text;
  background: var(--floating); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / 0.06), 0 10px 30px rgb(0 0 0 / 0.10);
}
.hero-field:focus-within { color: var(--body); box-shadow: 0 0 0 1.5px var(--line), 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 34px rgb(0 0 0 / 0.14); }
.hero-input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; padding: 0; background: transparent; font: 400 17px/1.2 var(--sans); color: var(--ink); }
.hero-input::placeholder { color: var(--muted); }
.hero-key { flex: none; }

/* The filters in force, as tokens in the field (layout 1), and Ask inside it. */
.hero-tokens { display: contents; }
.hero-token {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px 0 10px; flex: none; max-width: 180px;
  border-radius: 14px; background: var(--tile); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.hero-token > span:not(.hero-swatch) { overflow: hidden; text-overflow: ellipsis; }
.hero-swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12); }
.hero-token-x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
.hero-token-x:hover { background: var(--hover); color: var(--ink); }
.hero-ask { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 17px; color: var(--muted); }
.hero-ask:hover { background: var(--hover); color: var(--ink); }

/* The filters' panel on the foot bar: the filter bar's chips, wrapped, with its words at the end. */
.popover.filters { width: auto; max-width: min(560px, calc(100vw - 16px)); padding: 10px; }
.popover.filters .filter-bar { height: auto; padding: 0; flex-wrap: wrap; overflow: visible; row-gap: 8px; }

@media (max-width: 760px) {
  .app.rail-mode .rail { display: none; }
  .hero.on { padding: 10px 12px 4px; }
  .hero-field { height: 48px; padding: 0 8px 0 14px; }
  .hero-input { font-size: 16px; }
  .hero-key { display: none; }
}

/* ---- The style (Settings › Appearance › Style; board E of the design canvas): Neutral is the quiet
   look as it is; Prism draws a thin spectrum on the edges of the glass, brightest where the light
   falls, and a soft halo round what is picked out; Daylight lets soft coloured light fall across the
   page behind the cards. --strength (0 to 1) says how much. The dark theme takes the same style. ---- */

:root { --strength: 0.8; }
:root[data-style="prism"] .pill, :root[data-style="prism"] .hero-field { position: relative; }
:root[data-style="prism"] :is(.pill, .rail, .hero-field, .view-bar, .sel-bar, .popover, .amenu, .tags-panel)::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from 225deg at 30% 30%, rgb(86 196 240), rgb(113 140 230) 40deg, rgb(180 140 240) 90deg,
    rgb(236 130 200) 150deg, rgb(246 196 120) 210deg, rgb(236 130 200) 260deg, rgb(180 140 240) 300deg, rgb(86 196 240) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: calc(var(--strength) * 0.9);
}
:root[data-style="prism"] .card.picked .tile {
  box-shadow: 0 0 0 2px transparent, -8px -6px 22px -8px rgb(86 196 240 / calc(var(--strength) * 0.7)),
    8px 8px 22px -8px rgb(236 130 200 / calc(var(--strength) * 0.7));
}

:root[data-style="daylight"] .app::before {
  /* The whole window, behind the floating sidebar and the Info pane too: on .main alone, the light
     stopped at the sidebar's edge (the owner's screenshot, 30 November). */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--strength);
  background:
    radial-gradient(1100px 900px at 0% 0%, rgb(64 150 255 / 0.30) 0%, rgb(64 150 255 / 0.22) 22%, rgb(64 150 255 / 0.09) 44%, rgb(64 150 255 / 0) 60%),
    radial-gradient(1000px 1000px at 100% 52%, rgb(150 104 255 / 0.28) 0%, rgb(150 104 255 / 0.20) 22%, rgb(150 104 255 / 0.08) 44%, rgb(150 104 255 / 0) 60%),
    radial-gradient(1100px 820px at 80% 100%, rgb(255 152 100 / 0.28) 0%, rgb(255 152 100 / 0.20) 22%, rgb(255 152 100 / 0.08) 44%, rgb(255 152 100 / 0) 60%),
    radial-gradient(900px 760px at 0% 100%, rgb(60 204 160 / 0.22) 0%, rgb(60 204 160 / 0.16) 22%, rgb(60 204 160 / 0.06) 44%, rgb(60 204 160 / 0) 60%);
}
/* The light reaches the page through what stands over it; cards and an open note stay white. */
:root[data-style="daylight"] :is(.bar, .hero.on, .content-top) { background: transparent; }
/* An open note, book or PDF takes the light too (the owner, 1 December): the words sit on the window's
   own light, as a PDF's white pages float on it; beside the Inbox's list the reader lets some of it through. */
:root[data-style="daylight"] .inbox-reader { background: color-mix(in srgb, var(--page) 58%, transparent); }
:root[data-style="daylight"] .content:is(.reading, .book-mode, .pdf-mode) { background: transparent; }
/* A note, a quote, a page's article or a book is the page of the whole window, toolbar and all, as on
   the Mac, never a white box set in the grey round it (the owner, 1 December, of a note). */
body:has(.main > .content:is(.reading, .book-mode)) { background: var(--page); }
body:has(.main > .content:is(.reading, .book-mode)) .main > .bar { background: transparent; }
:root[data-theme="dark"][data-style="daylight"] .app::before { opacity: calc(var(--strength) * 0.55); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-style="daylight"] .app::before { opacity: calc(var(--strength) * 0.55); }
}

/* With the search field front and centre, the toolbar has no line under it: one open space above the cards. */
.app:has(.hero.on) .bar { border-bottom-color: transparent; }

/* ---- One rhythm for the window (the owner, 30 November: "coherent everywhere"). The sidebar, the rail
   and the Info pane float as panels 10 points in from the window's edges, the same glass and shadow
   each; every top row is centred 36 points down: the sidebar's and the rail's first buttons, the
   search field, the toolbar over an open item and the Info pane's tabs. Over the library there is no
   toolbar at all: the search field is at the top, and a question's answer comes under it. ---- */

.sidebar, .app > .info {
  background: var(--floating); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 22px rgb(0 0 0 / 0.09);
  border-radius: 22px;
}
.sidebar { margin: 10px 0 10px 10px; border-right: 0; }
.app > .info { margin: 10px 10px 10px 0; border-left: 0; }
.app.rail-mode .rail { padding: 4px 0 8px; }
.bar { height: 62px; padding-top: 10px; border-bottom: 0; }
.bar > .pill:empty { display: none; }
.app:has(.hero.on) .bar { display: none; }
.hero.on { padding: 20px 16px 12px; flex-direction: column; align-items: center; gap: 10px; }

/* The Info pane's bar: as tall as the toolbar, its tabs and its close button on one line. */
.pane-bar { height: 52px; padding: 0 12px 0 18px; }
.pane-tab { align-items: center; height: 28px; }
.pane-close { width: 26px; height: 26px; border-radius: 13px; }

/* A search's answer (Return in the field): part of the page under the field, at reading width, the
   search's results under it; the page scrolls as one. */
.answer-page:empty { display: none; }
.answer-page { width: min(760px, calc(100% - 44px)); margin: 18px auto 8px; display: grid; gap: 12px; }
.answer-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.answer-page .ask-answer { font-size: 16px; line-height: 1.6; color: var(--ink); }
.answer-page .ask-answer p { margin: 0 0 10px; }
.answer-page .ask-answer p:last-child { margin-bottom: 0; }
.answer-error { margin: 0; font-size: 14px; color: var(--muted); }
.answer-wait { margin: 0; font-size: 15px; color: var(--muted); }
.answer-demo { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink); }
.answer-demo a, .ask-answer .answer-demo a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.answer-page + .grid, .answer-page + .lines { margin-top: 26px; }
.answer-rule { height: 1px; background: var(--line); margin-top: 6px; }

@media (max-width: 760px) {
  /* A phone keeps the toolbar for the drawer's buttons; over the library it holds only those. */
  .app:has(.hero.on) .bar { display: grid; }
  .app:has(.hero.on) .bar .trail { display: none; }
  .bar { height: 52px; padding-top: 0; }
  .sidebar { margin: 0; inset: 10px auto 10px 10px; }
  .app > .info { margin: 0; inset: 10px 10px 10px auto; }
  .hero.on { padding: 6px 12px 4px; }
}

/* A saved link as the live site, inside the item: a slim bar over it, the site as a card of its own. */
.content.web-mode { overflow: hidden; display: flex; flex-direction: column; }
.web-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.web-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 18px; font-size: 12.5px; color: var(--muted); }
.web-bar .site-icon { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
.web-site { font-weight: 600; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.web-gap { flex: 1; }
.web-hint { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.web-frame { flex: 1; min-height: 0; margin: 0 10px 10px; border: 0; border-radius: 16px; background: var(--page); box-shadow: 0 0 0 1px var(--line); }
.reader .lead .lead-web {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 3px 9px; border-radius: 11px;
  font-size: 12px; color: var(--body); background: var(--tile);
}
.reader .lead .lead-web:hover { color: var(--ink); }
@media (max-width: 760px) { .web-hint { display: none; } }

/* ---------- The welcome (welcome.js) ----------
   One card over the library, softly blurred, with the brand's light at its corners: a line of progress
   along the top, the step's title and words, its chips, tiles or film, and Back and Next at the foot.
   It wears the app's own tokens, so it is light or dark as the device (or the theme chosen in it) is. */
.welcome { position: fixed; inset: 0; z-index: 22; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--canvas) 74%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3); animation: welcome-in .35s ease both; }
.welcome::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(38% 48% at 10% 14%, rgb(86 196 240 / 0.16), transparent 70%), radial-gradient(40% 50% at 92% 18%, rgb(236 130 200 / 0.13), transparent 70%), radial-gradient(50% 46% at 50% 104%, rgb(180 140 240 / 0.14), transparent 70%); }
.welcome.going { animation: welcome-out .26s ease both; }
@keyframes welcome-in { from { opacity: 0; } }
.welcome.instant, .welcome.instant .welcome-card { animation: none; }
@keyframes welcome-out { to { opacity: 0; } }
.welcome-card { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); height: min(690px, calc(100vh - 48px)); overflow: hidden; border-radius: 26px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 40px 100px -40px rgb(0 0 0 / 0.35), 0 12px 30px -16px rgb(0 0 0 / 0.18); animation: welcome-rise .55s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes welcome-rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.welcome-progress { flex: none; height: 3px; background: var(--hover); }
.welcome-progress i { display: block; width: 0; height: 100%; border-radius: 0 3px 3px 0; background: var(--ink); transition: width .5s cubic-bezier(.22, 1, .36, 1); }
.welcome-scroll { flex: 1 1 auto; overflow-y: auto; padding: 42px 48px 6px; }
.welcome-page { animation: welcome-slide .45s cubic-bezier(.22, 1, .36, 1) both; }
.welcome-page.from-left { animation-name: welcome-slide-back; }
@keyframes welcome-slide { from { opacity: 0; transform: translateX(28px); } }
@keyframes welcome-slide-back { from { opacity: 0; transform: translateX(-28px); } }
.welcome-title { margin: 0; font-size: 29px; line-height: 1.15; font-weight: 650; letter-spacing: -0.025em; color: var(--ink); }
.welcome-words { max-width: 560px; margin: 10px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.welcome-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 48px 26px; }
.welcome-gap { flex: 1; }
.welcome-foot .button { height: 38px; padding: 0 18px; border-radius: 11px; font-size: 14px; }
.welcome-back { background: transparent; }
.welcome-back:hover { background: var(--hover); filter: none; }
.welcome-next { min-width: 112px; }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.welcome-chip { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); color: var(--body); font: 550 14.5px/1 var(--sans); transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.welcome-chip:hover { transform: translateY(-1px); }
.welcome-chip.on { background: var(--ink); color: var(--page); box-shadow: none; }
.welcome-chips.small { gap: 8px; margin-top: 12px; }
.welcome-chips.small .welcome-chip { gap: 7px; height: 34px; padding: 0 12px; font-size: 13.5px; }
.welcome-chip.space.on { background: var(--chip); color: var(--chip-ink); }
span.welcome-chip:hover { transform: none; }
.welcome-spaces { margin-top: 30px; }
.welcome-label { margin-top: 26px; font: 600 11.5px/1 var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.welcome-spaces .welcome-label { margin-top: 0; }
.welcome-note { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
/* The film: the app itself, 960 points wide, scaled to the card (welcome.js fitFrame). */
.welcome-film { display: none; position: relative; aspect-ratio: 16 / 10; margin: 26px 0 6px; overflow: hidden; border-radius: 16px; background: var(--canvas); box-shadow: 0 0 0 1px var(--line), 0 22px 50px -30px rgb(0 0 0 / 0.4); }
.welcome-card.filmed .welcome-film { display: block; }
.welcome-frame { position: absolute; left: 0; top: 0; width: 960px; height: 600px; border: 0; transform-origin: 0 0; pointer-events: none; }
.welcome-keys { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.welcome-key { display: inline-flex; align-items: center; gap: 9px; }
.welcome-key .keycap { min-width: 26px; height: 24px; font-size: 12px; }
.welcome-keys.list { flex-direction: column; gap: 12px; margin-top: 14px; font-size: 14.5px; color: var(--body); }
.welcome-key-words { padding: 6px 8px; border-radius: 6px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); font: 600 11.5px/1 var(--sans); color: var(--muted); }
.welcome-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.welcome-tiles.apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.welcome-tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; text-align: left; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s, background .2s; }
.welcome-tile:hover { transform: translateY(-1px); background: var(--chosen); }
.welcome-tile-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--card); box-shadow: var(--card-shadow); color: var(--ink); }
.welcome-tile-words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.welcome-tile-words b { font-size: 14px; font-weight: 600; color: var(--ink); }
.welcome-tile-words span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.welcome-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.welcome-look { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 10px 12px; border-radius: 14px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); font: 550 13.5px/1 var(--sans); color: var(--body); transition: box-shadow .2s; }
.welcome-look.on { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.welcome-look-preview { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); }
.welcome-look-preview i { position: absolute; display: block; border-radius: 4px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.welcome-look-preview i:nth-child(1) { left: 9%; top: 16%; width: 34%; height: 68%; }
.welcome-look-preview i:nth-child(2) { left: 50%; top: 16%; width: 41%; height: 30%; }
.welcome-look-preview i:nth-child(3) { left: 50%; top: 54%; width: 41%; height: 30%; }
.welcome-look-preview.light { background: #F2F2F4; }
.welcome-look-preview.light i { background: #FFFFFF; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }
.welcome-look-preview.dark { background: #19191C; }
.welcome-look-preview.dark i { background: #2C2C31; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06); }
.welcome-look-preview.split { background: linear-gradient(90deg, #F2F2F4 50%, #19191C 50%); }
.welcome-look-preview.split i:nth-child(1) { background: #FFFFFF; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }
.welcome-look-preview.split i:nth-child(n + 2) { background: #2C2C31; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06); }
.welcome-look-preview.prism i { border: 1px solid transparent; box-shadow: none; background: linear-gradient(var(--card), var(--card)) padding-box, var(--ring) border-box; }
.welcome-look-preview.daylight { background: radial-gradient(60% 70% at 12% 18%, rgb(86 196 240 / 0.32), transparent 70%), radial-gradient(60% 70% at 88% 28%, rgb(236 130 200 / 0.26), transparent 70%), radial-gradient(60% 60% at 50% 108%, rgb(246 196 120 / 0.32), transparent 70%), var(--canvas); }
@media (max-width: 640px) {
  .welcome { padding: 0; }
  .welcome-card { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .welcome-scroll { padding: 30px 20px 6px; }
  .welcome-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
  .welcome-title { font-size: 25px; }
  .welcome-tiles, .welcome-tiles.apps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .welcome, .welcome-card, .welcome-page { animation: none; } .welcome-progress i { transition: none; } }

/* The pointer of the welcome's films (main.js, ?film): it moves and presses; the app does the rest. */
.film-pointer { position: fixed; left: 0; top: 0; z-index: 2147483000; width: 26px; height: 26px; margin: -3px 0 0 -6px; pointer-events: none; opacity: 0; transition-property: transform, opacity; transition-timing-function: cubic-bezier(.45, .05, .25, 1); }
.film-pointer.on { opacity: 1; }
.film-pointer svg { width: 100%; height: 100%; fill: #FFFFFF; stroke: #111114; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.3)); transition: transform .15s; transform-origin: 22% 12%; }
.film-pointer::after { content: ""; position: absolute; left: 6px; top: 3px; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgb(113 140 230 / 0.35); opacity: 0; transform: scale(0); transition: transform .25s, opacity .25s; }
.film-pointer.press::after { opacity: 1; transform: scale(1); }
.film-pointer.press svg { transform: scale(.86); }
.filming .toast { display: none; }
.filming .film-pressed { transform: scale(.9); filter: brightness(.94); transition: transform .12s ease, filter .12s ease; }

/* The welcome: the apps' own marks on white tiles (assets/logos), the connector's switches, the two plans. */
.welcome-tile-logos { flex: none; display: flex; }
.welcome-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #FFFFFF; color: #111114; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 2px 6px -3px rgb(0 0 0 / 0.3); }
.welcome-logo + .welcome-logo { margin-left: -9px; }
.welcome-logo img { display: block; width: 20px; height: 20px; object-fit: contain; }
.welcome-logo i { display: block; width: 20px; height: 20px; background: #111114; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.logo-obsidian i { -webkit-mask-image: url(assets/logos/obsidian.svg); mask-image: url(assets/logos/obsidian.svg); background: #7C3AED; }
.logo-notion i { -webkit-mask-image: url(assets/logos/notion.svg); mask-image: url(assets/logos/notion.svg); }
.logo-instapaper i { -webkit-mask-image: url(assets/logos/instapaper.svg); mask-image: url(assets/logos/instapaper.svg); }
.logo-googlechrome i { -webkit-mask-image: url(assets/logos/googlechrome.svg); mask-image: url(assets/logos/googlechrome.svg); background: #4285F4; }
.logo-safari i { -webkit-mask-image: url(assets/logos/safari.svg); mask-image: url(assets/logos/safari.svg); background: #006CFF; }
.logo-firefoxbrowser i { -webkit-mask-image: url(assets/logos/firefoxbrowser.svg); mask-image: url(assets/logos/firefoxbrowser.svg); background: #FF7139; }
.logo-openai i { -webkit-mask-image: url(assets/logos/openai.svg); mask-image: url(assets/logos/openai.svg); }
.welcome-switches { margin-top: 10px; border-radius: 14px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.welcome-switch { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.welcome-switch + .welcome-switch { box-shadow: inset 0 1px 0 var(--line); }
.welcome-switch-words { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.welcome-switch-words b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.welcome-switch-words span { font-size: 12.5px; color: var(--muted); }
.welcome-toggle { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--tile); transition: background .2s; }
.welcome-toggle i { position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform .2s; }
.welcome-toggle.on { background: var(--ink); }
.welcome-toggle.on i { transform: translateX(16px); }
.welcome-always { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.welcome-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.welcome-plan { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.welcome-plan.freedom { background: var(--card); box-shadow: 0 18px 40px -26px rgb(40 34 92 / 0.5); }
.welcome-plan.freedom::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--ring); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.welcome-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.welcome-plan-head b { font-size: 15px; font-weight: 650; color: var(--ink); }
.welcome-badge { padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-size: 11px; font-weight: 600; }
.welcome-price { display: flex; align-items: baseline; gap: 6px; }
.welcome-price b { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; color: var(--ink); }
.welcome-price span { font-size: 13.5px; color: var(--muted); }
.welcome-plan ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--body); }
.welcome-plan li { display: flex; align-items: center; gap: 8px; }
.welcome-plan li .icon { flex: none; color: var(--muted); }
.welcome-plan.freedom li .icon { color: rgb(113 140 230); }
.welcome-period { display: flex; width: max-content; padding: 3px; border-radius: 999px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.welcome-period button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font: 600 12.5px/1 var(--sans); color: var(--muted); }
.welcome-period button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 4px 10px -6px rgb(0 0 0 / 0.2); }
.welcome-save { font-size: 11px; background: linear-gradient(90deg, rgb(63 174 224), rgb(106 127 224), rgb(165 123 232), rgb(224 112 184), rgb(233 166 79)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-upgrade { height: 40px; border-radius: 12px; background: var(--ink); color: var(--page); font-size: 14px; box-shadow: 0 12px 26px -14px rgb(113 140 230 / 0.75), 0 8px 18px -12px rgb(236 130 200 / 0.6); }
.welcome-upgrade:hover { filter: brightness(1.08); }
@media (max-width: 640px) { .welcome-plans { grid-template-columns: minmax(0, 1fr); } }

/* ---- Posts on X: a card that reads as a post, and the post open (items.js xPost) ---- */

.tile.sheet.post { justify-content: flex-start; gap: 0; }
.post-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sheet.post.starred .post-head { padding-right: 22px; }
.post-face {
  flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--tile);
  display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--muted);
}
.tile .post-face img, .post-face img { width: 100%; height: 100%; object-fit: cover; }
.post-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.post-name { font-size: 13px; line-height: 16px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.post-handle { font-size: 11.5px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-head .favicon { flex: none; align-self: flex-start; margin-top: 1px; border-radius: 3px; overflow: hidden; display: inline-grid; place-items: center; color: var(--muted); }
.post-words {
  margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 9; overflow: hidden;
}
.card.uniform .post-words { -webkit-line-clamp: 3; }
.post-media { margin-top: 10px; border-radius: 9px; overflow: hidden; background: var(--tile); }

/* Open, on the library's own page: one sheet, as wide as a post reads well. */
.content.post-mode { background: transparent; }
.post-reader { max-width: 640px; padding-top: 40px; }
.post-page {
  padding: 22px 24px 18px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow), 0 18px 40px -28px rgb(0 0 0 / 0.35);
}
.post-top { display: flex; align-items: center; gap: 12px; }
.post-top .post-face { width: 48px; height: 48px; font-size: 19px; }
.post-top .post-name, .reader .post-top a.post-name { font-size: 16px; line-height: 20px; color: var(--ink); text-decoration: none; }
.post-top .post-name:hover { text-decoration: underline; }
.post-top .post-handle { font-size: 14px; line-height: 18px; }
.post-top .button { flex: none; align-self: flex-start; }
.post-body { margin-top: 16px; font-size: 18px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.post-body p { margin: 0 0 14px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body a { color: rgb(29 125 210); text-decoration: none; }
.post-body a:hover { text-decoration: underline; }
.post-body .post-none { color: var(--muted); font-size: 15px; }
.post-picture { margin-top: 16px; border-radius: 14px; overflow: hidden; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); }
.post-picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-when { margin-top: 16px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); font-size: 13px; color: var(--muted); }
.post-reader > .comment { margin-top: 16px; }
@media (max-width: 520px) {
  .post-reader { padding: 16px 12px 100px; }
  .post-page { padding: 16px 16px 14px; border-radius: 14px; }
  .post-body { font-size: 16.5px; }
}

/* ---- Settings › Plan: the Upgrade button and the meters (plan.js upgradeButton) ---- */

@property --upgrade-turn { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.button.upgrade {
  position: relative; isolation: isolate; overflow: hidden;
  height: 34px; padding: 0 16px 0 13px; gap: 7px; border-radius: 11px;
  background: var(--ink); color: var(--page); font-size: 13.5px; font-weight: 650; letter-spacing: -0.005em;
  box-shadow: 0 10px 22px -12px rgb(113 140 230 / 0.85), 0 6px 18px -10px rgb(236 130 200 / 0.7);
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.25), box-shadow .25s, filter .25s;
}
/* The spectrum, turning slowly round the edge. */
.button.upgrade::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--upgrade-turn), rgb(86 196 240), rgb(113 140 230), rgb(180 140 240), rgb(236 130 200), rgb(246 196 120), rgb(86 196 240));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: upgrade-turn 5s linear infinite;
}
/* A light passing over it now and then. */
.button.upgrade::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 46%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgb(180 140 240 / 0.38) 38%, rgb(236 130 200 / 0.34) 62%, transparent);
  transform: translateX(-140%) skewX(-18deg); animation: upgrade-shine 4.2s cubic-bezier(.45, 0, .2, 1) infinite;
}
.button.upgrade .icon { color: rgb(246 196 120); animation: upgrade-twinkle 4.2s ease-in-out infinite; }
.button.upgrade:hover { filter: none; transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgb(113 140 230 / 0.95), 0 8px 22px -10px rgb(236 130 200 / 0.8); }
.button.upgrade:active { transform: translateY(0) scale(.98); }
@keyframes upgrade-turn { to { --upgrade-turn: 360deg; } }
@keyframes upgrade-shine { 0%, 58% { transform: translateX(-140%) skewX(-18deg); } 92%, 100% { transform: translateX(260%) skewX(-18deg); } }
@keyframes upgrade-twinkle { 0%, 60%, 100% { transform: none; } 75% { transform: scale(1.18) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) {
  .button.upgrade::before, .button.upgrade::after, .button.upgrade .icon { animation: none; }
  .button.upgrade::after { display: none; }
}
/* A meter nearly full says so in the spectrum's warm end. */
.meter.full i { background: linear-gradient(90deg, rgb(236 130 200), rgb(246 160 90)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .button.upgrade .icon { color: rgb(196 120 40); } }
:root[data-theme="dark"] .button.upgrade .icon { color: rgb(196 120 40); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .post-body a { color: rgb(120 178 244); } }
:root[data-theme="dark"] .post-body a { color: rgb(120 178 244); }

/* Update (actions.js updateItems): beside Open on X, in a reader's lead line, and in the item's menu. */
.post-actions { flex: none; align-self: flex-start; display: flex; gap: 6px; }
button.working .icon { animation: mark-turn .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { button.working .icon { animation: none; } }
/* On a phone the post's header has room for the face, the name and Open on X: Update keeps only its arrow. */
@media (max-width: 520px) { .post-actions .button-words { display: none; } }

/* ===== Files on their way to the store (uploads.js) ===== */
/* A thin bar that fills as a file's bytes go, on its card and where it is opened; a word on the card when they are not being sent from here. */
.upload-meter { display: block; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 12%, transparent); overflow: hidden; }
.upload-meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width .25s ease; }
.upload-meter.on-card { position: absolute; left: 10px; right: 10px; bottom: 10px; background: rgb(0 0 0 / 0.3); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.3); }
.upload-meter.on-card > i { background: #fff; }
.upload-meter.wide { width: min(320px, 70%); margin: 2px auto 16px; }
.badge.waiting { left: 8px; bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .upload-meter > i { transition: none; } }
