:root {
  --bg: #1e1a1d;
  --fg: #ffffff;
  --dim: #808080;
  --accent: #8abeb7;
  --bar: #2d2d30;
  --bar-key: #3a3a3e;
  --bar-key-on: var(--accent);
  /* A phone fits about 56 columns; Text size in /settings scales from here. */
  --font-auto: clamp(9px, calc((100vw - 16px) / 56 / 0.6), 12px);
  --font-size: var(--font-auto);
  /* Issues beside an open issue: about 44 columns, at most about a third of the screen. */
  --sidebar-width: min(36vw, calc(var(--font-size) * 0.6 * 44 + 16px));
  color-scheme: dark;
}
/* An iPad or a computer: the text keeps growing past a phone's 12px. A phone
   on its side is wide but short, so it keeps the phone's size. */
@media (min-width: 700px) and (min-height: 500px) {
  :root { --font-auto: 15px; }
}
/* Appearance in /settings: each choice is set on <html> as a data attribute. */
:root {
  /* The grid is always the system font's, so spacing is the same in every font.
     Only the words take the chosen font (--text-family). */
  --font-family: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace;
  --text-family: var(--font-family);
  --cell: 0.6em;
  --line-height: 1.32;
  --letter-spacing: normal;
  --margin: 8px;
}
:root[data-font="menlo"] { --text-family: Menlo, Monaco, monospace; }
:root[data-font="courier"] { --text-family: "Courier New", Courier, monospace; }
:root[data-font="helvetica"] { --text-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
:root[data-font="sf"] { --text-family: system-ui, -apple-system, sans-serif; }
:root[data-font="avenir"] { --text-family: "Avenir Next", Avenir, sans-serif; }
:root[data-font="gill"] { --text-family: "Gill Sans", sans-serif; }
:root[data-font="futura"] { --text-family: Futura, sans-serif; }
:root[data-font="georgia"] { --text-family: Georgia, serif; }
:root[data-font="palatino"] { --text-family: Palatino, "Palatino Linotype", serif; }
:root[data-text-size="smaller"] { --font-size: calc(var(--font-auto) * 0.75); }
:root[data-text-size="small"] { --font-size: calc(var(--font-auto) * 0.87); }
:root[data-text-size="large"] { --font-size: calc(var(--font-auto) * 1.15); }
:root[data-text-size="larger"] { --font-size: calc(var(--font-auto) * 1.3); }
:root[data-line-spacing="compact"] { --line-height: 1.15; }
:root[data-line-spacing="relaxed"] { --line-height: 1.5; }
:root[data-line-spacing="loose"] { --line-height: 1.7; }
:root[data-letter-spacing="wide"] { --letter-spacing: 0.05em; }
:root[data-letter-spacing="wider"] { --letter-spacing: 0.1em; }
:root[data-margins="narrow"] { --margin: 2px; }
:root[data-margins="wide"] { --margin: 16px; }
:root[data-margins="wider"] { --margin: 32px; }
* { box-sizing: border-box; }
html, body.page { margin: 0; height: 100%; background: var(--bg); overflow: hidden; overscroll-behavior: none; }
body.page { position: fixed; inset: 0; -webkit-text-size-adjust: 100%; }
.app {
  display: flex; flex-direction: column; height: 100dvh; width: 100%;
  padding: env(safe-area-inset-top) 0 0;
  background: var(--bg); color: var(--fg);
}
.screen, .measure {
  font-family: var(--font-family);
  font-size: var(--font-size); line-height: var(--line-height); letter-spacing: var(--letter-spacing); font-variant-ligatures: none;
}
.screen {
  flex: 1; min-height: 0; overflow: hidden; padding: 4px var(--margin) 0;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: default;
  display: flex; flex-direction: column;
}
/* Menu swipes belong to the terminal, including over a natively scrolling log. */
.screen.menu-open { touch-action: none; }
.line { white-space: pre; overflow: hidden; }
/* Any font but system: a line is cut into runs, each as wide as its cells in
   the grid, so columns keep their place. Words take the chosen font; arrows,
   boxes and rules keep the system font's. */
.cells { display: inline-block; vertical-align: top; font-family: var(--text-family); }
.cells .glyph { font-family: var(--font-family); }
/* The grid's own type and row height, so the lines under the input read like the rest. */
.status-line {
  display: flex; justify-content: space-between; gap: 1ch;
  font-family: var(--text-family);
  font-size: var(--font-size); line-height: calc(var(--font-size) * var(--line-height));
  /* A line with nothing on it yet keeps its row, so the screen does not jump when usage arrives. */
  min-height: calc(var(--font-size) * var(--line-height));
}
.status-left, .status-right { overflow: hidden; text-overflow: ellipsis; }
.status-right { flex: none; max-width: 100%; }
/* Status ‹ Assistant › Notes: the pages either side, named under the input
   as the web's landing page names its own (.landing-row). The row is always
   there, so the grid keeps its height whichever screen is open. */
.page-nav {
  flex: none; display: flex; gap: 2ch; min-height: calc(var(--font-size) * var(--line-height) + 4px);
  padding: 4px var(--margin) calc(4px + env(safe-area-inset-bottom));
  font-family: var(--text-family);
  font-size: var(--font-size); line-height: var(--line-height); letter-spacing: var(--letter-spacing);
}
.app.with-keybar .page-nav, .app.typing .page-nav { padding-bottom: 4px; }
.page-nav.away { display: none; }
/* Navigation at the top in /settings: the row sits above the screen, and the
   screen keeps clear of the home indicator in its place. */
:root[data-nav-position="top"] .page-nav { order: -1; padding-bottom: 4px; }
:root[data-nav-position="top"] .screen { padding-bottom: env(safe-area-inset-bottom); }
:root[data-nav-position="top"] .app.with-keybar .screen, :root[data-nav-position="top"] .app.typing .screen { padding-bottom: 0; }
.page-go { flex: none; padding: 0; border: 0; background: none; font: inherit; color: var(--dim); cursor: pointer; }
/* The pages above and below sit together at the right, next first when alone,
   and the page to the right after them. */
.page-go-up, .page-go-up[hidden] + .page-go-next, .page-go-up[hidden] + .page-go-next[hidden] + .page-exts,
.page-go-up[hidden] + .page-go-next[hidden] + .page-exts[hidden] + .page-go-forward { margin-left: auto; }
/* The links extensions add on a note or an issue, before edit. */
.page-exts { display: flex; gap: 2ch; }
.page-exts[hidden] { display: none; }
.page-ext { color: var(--accent); }
.page-ext.on { color: var(--fg); font-weight: 700; }
/* An extension's page over the lines it works on; the input stays free. */
.extension-frame { position: absolute; z-index: 4; border: 0; background: transparent; color-scheme: normal; }
.extension-frame[hidden] { display: none; }
/* A resting page shows what it keeps on the note and lets every touch through; one opened to rest is unseen until it says it does. */
.extension-frame.resting { pointer-events: none; }
.extension-frame.waiting { visibility: hidden; }
/* Pulled far enough past the edge: letting go turns to this page. */
.page-go.ready { color: var(--accent); }
.page-go:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.measure { position: absolute; visibility: hidden; white-space: pre; top: 0; left: 0; display: block; }
.keys-input {
  position: absolute; margin: 0; border: 0; padding: 0; resize: none; outline: none;
  background: var(--bg); color: var(--fg); caret-color: var(--accent);
  font-family: var(--font-family);
  font-size: var(--font-size); line-height: var(--line-height); letter-spacing: var(--letter-spacing); font-variant-ligatures: none;
  white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden;
  -webkit-user-select: text; user-select: text; -webkit-text-size-adjust: 100%; -webkit-touch-callout: none;
}
.keys-input.hidden { display: none; }
/* Focused for the keyboard, with nothing to show: a settings submenu. */
/* iOS still draws a caret in a transparent field; the screen shows its own cursor. */
.keys-input.parked { opacity: 0; caret-color: transparent; }
.plain { color: inherit; }
.bold { font-weight: 700; }
.dim { opacity: 0.55; }
.inv { background: var(--fg); color: var(--bg); }
.app.typing .app { position: relative; }
/* Holding the input opens this, in place of iOS's own edit menu. */
.edit-menu {
  position: absolute; z-index: 15; display: flex; align-items: stretch; max-width: calc(100% - 16px);
  transform: translateY(calc(-100% - 6px)); border-radius: 999px; overflow: hidden;
  background: #2d2d30; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.edit-menu[hidden] { display: none; }
/* It springs open from under the finger and fades away, as iOS's own menu does. */
.edit-menu { animation: edit-menu-open 0.34s cubic-bezier(0.3, 1.45, 0.55, 1); }
.edit-menu.closing { animation: edit-menu-close 0.16s ease-out forwards; pointer-events: none; }
@keyframes edit-menu-open {
  from { scale: 0.4; opacity: 0; }
  40% { opacity: 1; }
  to { scale: 1; opacity: 1; }
}
@keyframes edit-menu-close {
  from { scale: 1; opacity: 1; }
  to { scale: 0.92; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .edit-menu { animation-name: edit-menu-fade-in; animation-timing-function: ease-out; animation-duration: 0.2s; }
  .edit-menu.closing { animation-name: edit-menu-fade-out; }
  @keyframes edit-menu-fade-in { from { opacity: 0; } }
  @keyframes edit-menu-fade-out { to { opacity: 0; } }
}
.edit-item {
  flex: none; border: 0; padding: 9px 14px; background: none; color: var(--fg);
  font: 500 15px -apple-system, system-ui, sans-serif; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.edit-item + .edit-item { border-left: 1px solid #3c3c40; }
.edit-item:active { background: #3a3a3e; }
/* While dictating, in the edit menu's place. Touches pass through it: the
   gesture that started listening stops it. */
.dictation {
  position: absolute; z-index: 15; display: flex; align-items: center; gap: 8px; left: 8px;
  transform: translateY(calc(-100% - 6px)); border: 0; border-radius: 999px; padding: 9px 14px;
  background: #2d2d30; color: var(--fg); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  font: 500 15px -apple-system, system-ui, sans-serif; white-space: nowrap;
  pointer-events: none;
}
.dictation[hidden] { display: none; }
.dictation::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e06c6c;
  animation: dictation-pulse 1.2s ease-in-out infinite;
}
@keyframes dictation-pulse { 50% { opacity: 0.3; } }
.image-picker { display: none; }
.scroller { flex: 1; min-height: 0; overflow: hidden; }
.scroller.log { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
/* An open log is read, so its text selects as any page's does: hold to select, drag the handles, Copy. */
.scroller.log { -webkit-user-select: text; user-select: text; cursor: text; }
/* What a hold selects in the log while the keyboard is up, drawn by the page itself as iOS draws its own. */
.log-selection { position: absolute; z-index: 3; overflow: hidden; pointer-events: none; }
.log-selection[hidden] { display: none; }
.log-band { position: absolute; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.log-handle { position: absolute; background: var(--accent); }
.log-handle::after { content: ""; position: absolute; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.log-handle-start::after { top: -9px; }
.log-handle-end::after { bottom: -9px; }
/* A finger that shifted during the hold may have started iOS's scroll; the drag selects instead. */
.scroller.log.selecting-log { overflow: hidden; }
/* The timeline drawn whole is still a list: a tap picks a row, not text. */
.scroller.log.list { -webkit-user-select: none; user-select: none; cursor: default; }
/* A swipe on the timeline moves its selection, so WebKit must not take it for panning. */
.scroller.log.list.stepped { touch-action: none; }
/* Each step redraws the rows it passes. A row under the finger would leave the
   page mid-swipe and take the rest of the swipe with it, so a list's rows are
   never a touch's target; the scroller, which stays, is. */
.scroller:not(.log) > .line, .scroller.log.list > .line { pointer-events: none; }
/* A note's photo is not redrawn by a step, and a tap on it opens it. */
.scroller.log.list > .note-photo-line { pointer-events: auto; }
.pinned { flex: none; }
.media-line { white-space: normal; overflow: visible; padding: 2px 0 6px; }
.media-open {
  display: block; margin: 0; padding: 0; border: 0; background: none; color: var(--accent);
  font: inherit; text-align: left; -webkit-tap-highlight-color: transparent;
}
.media-body { margin-top: 4px; color: #8a8a8a; }
.media-image { display: block; max-width: 100%; max-height: 60vh; border-radius: 4px; background: #2d2d30; }
/* A note's photos are kept small, so the note around them still reads as a note. */
.note-photo { max-height: 40vh; }
/* Under the note's text, which starts one column in. */
.note-photo-line { padding-left: 1ch; }
.media-frame { display: block; width: 100%; height: 50vh; border: 1px solid var(--bar-key); border-radius: 4px; background: #ffffff; }
.media-frame.loading, .viewer-frame.loading { visibility: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: #000000; color: var(--fg);
}
.viewer.hidden { display: none; }
.viewer-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 13px;
}
.viewer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-close { border: 0; padding: 6px 4px; background: none; color: var(--accent); font: inherit; font-weight: 700; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: center; justify-content: center; }
.viewer-body.zoomed { display: block; }
.viewer-image { max-width: 100%; max-height: 100%; }
.viewer-body.zoomed .viewer-image { max-width: none; max-height: none; }
.viewer-frame { width: 100%; height: 100%; border: 0; background: #ffffff; }
.actions {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end;
  padding: 0 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.35);
}
.actions[hidden] { display: none; }
.actions-panel { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.actions-list { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: #2d2d30; }
.action {
  border: 0; background: #2d2d30; color: var(--accent); padding: 16px; font: 500 17px -apple-system, system-ui, sans-serif;
  text-align: center; -webkit-tap-highlight-color: transparent;
}
.actions-list .action + .action { border-top: 1px solid #3c3c40; }
.action:active { background: #3a3a3e; }
.action.destructive { color: #e06c6c; }
.actions-cancel { border-radius: 14px; color: #d4d4d4; font-weight: 600; }
/* The web app's settings and mockup sheets; the iOS app shows its own. */
.settings, .mockup {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column;
  background: #18181a; color: var(--fg); font: 15px -apple-system, system-ui, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.settings[hidden], .mockup[hidden] { display: none; }
.sheet-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #2d2d30;
}
.sheet-title { margin: 0; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-done { border: 0; padding: 4px 0; background: none; color: var(--accent); font: 600 17px -apple-system, system-ui, sans-serif; cursor: pointer; }
.settings-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 32px; width: 100%; max-width: 640px; margin: 0 auto; }
.settings-heading { margin: 20px 4px 6px; font-size: 13px; font-weight: 400; text-transform: uppercase; color: #8a8a8a; }
.settings-group { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: #2d2d30; }
.settings-group:empty { display: none; }
.settings-row { margin: 0; padding: 11px 14px; }
.settings-row + .settings-row { border-top: 1px solid #3c3c40; }
.settings-row[hidden] { display: none; }
.settings-note { color: #b8b8b8; font-size: 14px; line-height: 1.35; }
.settings-note:empty { display: none; }
.settings-origin, .settings-code, .settings-word { font-family: "SF Mono", ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.settings-code { font-size: 20px; }
.settings-action {
  border: 0; background: #2d2d30; color: var(--accent); text-align: left; font: 15px -apple-system, system-ui, sans-serif; cursor: pointer;
}
.settings-action:active { background: #3a3a3e; }
.settings-action:disabled { color: #6a6a6a; cursor: default; }
.settings-action.destructive { color: #e06c6c; }
.settings-input, .settings-word, .settings-select {
  border: 0; outline: none; resize: none; width: 100%; background: #2d2d30; color: #ffffff; font-size: 15px;
}
.settings-select { font-family: -apple-system, system-ui, sans-serif; }
.settings-device { display: flex; flex-direction: column; gap: 6px; }
.settings-device-line { display: flex; justify-content: space-between; gap: 12px; }
.settings-device-status { color: #8a8a8a; font-size: 13px; }
.settings-word { padding: 0; }
.settings-request { display: flex; flex-direction: column; gap: 6px; }
.settings-request-meta { color: #8a8a8a; font-size: 12px; }
.settings-request-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.settings-request-actions { display: flex; gap: 18px; }
.settings-request-actions .settings-action { padding: 0; }
.settings-footer { margin: 6px 4px 0; color: #8a8a8a; font-size: 13px; line-height: 1.35; }
.settings-pending-heading[hidden], .settings-pending[hidden] { display: none; }
.mockup-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #ffffff; }
/* /theme: the colours file from the vault's computer, with a preview under it. */
.theme {
  position: absolute; inset: 0; z-index: 25; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: var(--bg); color: var(--fg);
  animation: theme-up 0.24s ease-out;
}
.theme[hidden] { display: none; }
.theme.closing { transition: transform 0.2s ease-in; transform: translateY(100%); }
@keyframes theme-up { from { transform: translateY(100%); } }
.theme-grabber {
  flex: none; align-self: center; width: 36px; height: 5px; margin: 8px 0 6px; border: 0; padding: 0;
  border-radius: 3px; background: var(--dim); opacity: 0.6; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.theme-code { flex: 1; min-height: 0; display: grid; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.theme-highlight, .theme-source {
  grid-area: 1 / 1; margin: 0; padding: 8px 12px; tab-size: 2; white-space: pre;
  font: 13px/1.5 "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace; font-variant-ligatures: none;
}
.theme-highlight { pointer-events: none; color: var(--fg); }
.theme-source {
  width: 100%; height: 100%; min-height: 100%; border: 0; outline: none; resize: none; overflow: hidden;
  background: transparent; color: transparent; caret-color: var(--accent);
  -webkit-user-select: text; user-select: text; -webkit-text-size-adjust: 100%;
}
.theme-key { color: var(--accent); }
.theme-string { color: #e5c07b; }
.theme-number { color: #d19a66; }
.theme-punct { color: var(--dim); }
.theme-bad { text-decoration: underline wavy #e06c6c; }
.theme-error { flex: none; margin: 8px; color: #e06c6c; font: 12px/1.4 "SF Mono", ui-monospace, Menlo, monospace; }
.theme-error[hidden] { display: none; }
.theme-preview {
  flex: none; margin: 8px; border-radius: 8px; padding: 8px 10px; background: var(--bg); color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font: 11px/1.4 "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace;
}
.theme-preview[hidden] { display: none; }
.theme-preview-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-preview-dim { color: var(--dim); }
.theme-preview-accent { color: var(--accent); }

/* Moving between pages, as /settings chooses: in from the right when going
   deeper, from the left when going back or sideways. */
.scroller.page-slide-in { animation: page-slide-in 180ms ease-out; }
.scroller.page-slide-back { animation: page-slide-back 180ms ease-out; }
.scroller.page-fade { animation: page-fade 160ms ease-out; }
@keyframes page-slide-in { from { transform: translateX(28px); opacity: 0.35; } to { transform: none; opacity: 1; } }
@keyframes page-slide-back { from { transform: translateX(-28px); opacity: 0.35; } to { transform: none; opacity: 1; } }
@keyframes page-fade { from { opacity: 0.2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .scroller.page-slide-in, .scroller.page-slide-back, .scroller.page-fade { animation: none; }
}

/* The keys a phone's keyboard lacks, in a black bar that sits on top of it.
   With the keyboard down it rests above the home indicator. */
.keybar {
  flex: none; position: relative; z-index: 5; display: flex; align-items: center;
  height: calc(48px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
  border-radius: 14px 14px 0 0; background: #000000;
  font-family: -apple-system, system-ui, sans-serif;
}
.keybar[hidden] { display: none; }
.app.typing .keybar { height: 48px; padding-bottom: 0; }
.app.with-keybar .screen { padding-bottom: 0; }
.keybar-keys {
  flex: 1; min-width: 0; height: 100%; display: flex; align-items: center;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x;
  -webkit-mask-image: linear-gradient(to right, #000000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000000 calc(100% - 28px), transparent);
}
.keybar-keys::-webkit-scrollbar { display: none; }
.bar-key {
  flex: 1 0 auto; min-width: 42px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0; border: 0; border-radius: 8px; padding: 0 6px; background: none; color: #ffffff;
  font: 400 15px -apple-system, system-ui, sans-serif; white-space: nowrap;
  touch-action: pan-x; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.bar-key.two-line { font-size: 13px; line-height: 1.08; }
.bar-key.arrow { font-size: 11px; }
.key-line { display: block; }
.bar-key.pressed { background: #2c2c2e; }
.bar-key.on { background: #ffffff; color: #000000; }

/* /keys: a panel drawn as the terminal draws its own, over the screen. */
.screen { position: relative; }
.keys-panel {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 4px 8px 6px; background: var(--bg); color: var(--fg); overflow: hidden;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.keys-panel[hidden] { display: none; }
.app.keys-open .keys-input { visibility: hidden; }
.keys-lines { display: flex; flex-direction: column; }
.keys-line { min-height: calc(var(--font-size) * var(--line-height)); white-space: pre; overflow: hidden; }
.keys-row { cursor: pointer; }
.keys-plain { color: inherit; }
.keys-rule { display: flex; align-items: center; gap: 1ch; color: #4a4448; }
.keys-rule::after { content: ""; flex: 1; height: 0; border-top: 1px solid #4a4448; }
.keys-rule-label { color: var(--dim); }
.keys-rule-label.moving { color: var(--accent); }
.keys-title { color: var(--accent); font-weight: 700; }
.keys-muted { color: #b0b0b0; }
.keys-dim { color: var(--dim); }
.keys-accent { color: var(--accent); }
.keys-chips { display: inline-flex; gap: 0.5ch; vertical-align: top; }
.keys-chip { display: inline-block; min-width: 4.5ch; padding: 0 0.4ch; text-align: center; border: 1px solid #3a3438; border-radius: 3px; color: var(--fg); }
.keys-row.selected .keys-chip { border-color: var(--accent); }
.keys-chip.empty { border-style: dashed; color: transparent; }
.keys-row.lifted { background: rgba(138, 190, 183, 0.12); }
.keys-preview { display: flex; align-items: center; margin: 2px 0 4px; padding: 4px 4px 4px 6px; border-radius: 8px; background: #000000; overflow: hidden; }
.keys-preview-keys {
  flex: 1; min-width: 0; display: flex; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(to right, #000000 calc(100% - 18px), transparent);
}
.keys-preview-key { flex: none; min-width: 28px; padding: 0 3px; text-align: center; color: #ffffff; font: 400 12px -apple-system, system-ui, sans-serif; }
.keys-preview-key.arrow { font-size: 9px; }

/* The web app's landing page (src/landing.mjs): the diver, and a waitlist
   drawn as the terminal's own input along the bottom. The about page is a
   swipe right, and only the space above the input changes for it; Notes is a
   swipe left. Pages change as the app's do: at once, then the app's page
   animation, from the side the swipe came from. */
.landing {
  position: fixed; top: 0; left: 0; right: 0; height: 100dvh; z-index: 40; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 0; background: var(--bg); color: var(--fg);
  font-family: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace;
  font-size: var(--font-size); line-height: 1.32; font-variant-ligatures: none;
  touch-action: pan-y;
}
html.landing-seen .landing { display: none; }
.landing-pages { flex: 1; position: relative; overflow: hidden; }
.landing-hero { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px 8px; }
.about { position: absolute; inset: 0; display: none; overflow: auto; padding: 4px 8px 0; }
html.landing-about .about { display: block; }
html.landing-about .landing-hero { display: none; }
/* The app's page animations (.scroller.page-slide-in and the rest), on the page that arrives. */
.landing-slide-in { animation: page-slide-in 180ms ease-out; }
.landing-slide-back { animation: page-slide-back 180ms ease-out; }
.landing-fade { animation: page-fade 160ms ease-out; }

.landing-diver {
  display: block; width: 112px; height: 94px; margin: 0; background: var(--accent);
  -webkit-mask: url("/diver/diver-mark.png") center / contain no-repeat; mask: url("/diver/diver-mark.png") center / contain no-repeat;
  animation: landing-float 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes landing-float { 50% { transform: translateY(-6px) rotate(-3deg); } }

/* About: headings dim like Notes' day labels, then a line or two each. */
.about-heading { margin: calc(var(--font-size) * 1.32) 0 0; font: inherit; color: var(--dim); }
.about-heading:first-child { margin-top: 0; }
.about-text { margin: 0; padding-left: 2ch; }
.about-link { color: var(--accent); text-decoration: none; }

.landing-waitlist { flex: none; padding: 0 8px; }
/* The input's top rule carries its label and status: ─ your email ────── */
.landing-rule { display: flex; align-items: center; gap: 1ch; line-height: 1; }
.landing-rule::before, .landing-rule::after { content: ""; border-top: 1px solid #505050; }
.landing-rule::before { flex: none; width: 1ch; }
.landing-rule::after { flex: 1; }
.landing-status { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.landing-status-error { color: #cc6666; }
.landing-status-done { color: var(--accent); }
.landing-composer { display: block; position: relative; padding: 6px 0 7px; border-bottom: 1px solid #505050; cursor: text; }
.landing-email {
  display: block; width: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent;
  font: inherit; color: transparent; caret-color: transparent; -webkit-text-fill-color: transparent;
}
/* Left empty by people; a script that fills every field fills this one too. */
.landing-website { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.landing-mirror { position: absolute; inset: 6px 0 7px; white-space: pre; overflow: hidden; pointer-events: none; color: var(--fg); }
.landing-cursor { background: var(--fg); color: var(--bg); }
.landing-placeholder { color: var(--dim); }
/* Where each swipe goes, at the side it comes in from. */
.landing-row { display: flex; gap: 2ch; margin: 6px 0 0; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
.landing-go { flex: none; padding: 0; border: 0; background: none; font: inherit; color: var(--dim); cursor: pointer; }
.landing-go-notes, .landing-go-back { margin-left: auto; }
.landing-go-back, html.landing-about .landing-go-about, html.landing-about .landing-go-notes { display: none; }
html.landing-about .landing-go-back { display: block; }
.landing-go:focus-visible, .about-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .landing-slide-in, .landing-slide-back, .landing-fade, .landing-diver { animation: none; }
}

/* Two panes: Issues at the left while an issue is open at the right. */
.app.two-panes { position: relative; padding-left: var(--sidebar-width); }
.sidebar {
  position: absolute; top: env(safe-area-inset-top); bottom: 0; left: 0; width: var(--sidebar-width);
  overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 0;
  border-right: 1px solid var(--bar);
  font-family: var(--font-family);
  font-size: var(--font-size); line-height: var(--line-height); letter-spacing: var(--letter-spacing); font-variant-ligatures: none;
  user-select: none; -webkit-user-select: none;
}
.sidebar[hidden] { display: none; }
.sidebar-lines > .line { cursor: pointer; }
