/* ===================== appearance, per device =====================

   The switches set classes on <html> from appearance.js, before the page is
   drawn: atx-plain (the plain skin), atx-blur (the privacy screen, with atx-idle and
   atx-away while it hides everything), atx-decoy-armed and atx-covered (the
   cover). Loaded after shell.css so the skin wins over the frame. */

/* ------------------------------------------------------------ the switch */

.atx-look-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--bg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease;
}
.atx-look-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s ease, background .15s ease;
}
.atx-look-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.atx-look-switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--bg); }
.atx-look-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .atx-look-switch, .atx-look-switch::after { transition: none; }
}
.atx-look-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 14px; }
.atx-look-row > span { font-size: 14px; color: var(--fg); }
/* The page: the privacy screen across the top, the three switches in an
   even row under it, one column on a phone. */
.atx-look { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.atx-look-wide { grid-column: 1 / -1; }
.atx-look-card { display: flex; flex-direction: column; min-width: 0; }
.atx-look-card .atx-card-bar { flex-wrap: wrap; align-items: baseline; }
.atx-look-card .atx-panel-note { max-width: 72ch; }
@media (max-width: 900px) { .atx-look { grid-template-columns: minmax(0, 1fr); } }
.atx-panel-note[hidden] { display: none; }

/* Three choices in one bar, the chosen one filled. */
.atx-look-seg {
  display: flex;
  width: 100%;
  max-width: 420px;
  margin-top: 16px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--bg);
}
.atx-look-seg button {
  flex: 1;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 600 13px var(--sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.atx-look-seg button:hover { color: var(--fg); }
.atx-look-seg button[aria-checked="true"] { background: var(--accent); color: var(--bg); }
.atx-look-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.atx-rail-plain { display: none; }

/* The classification strip, off by itself. */
html.atx-nobanner { --strip-h: 0px; }
html.atx-nobanner .atx-strip { display: none !important; }

/* ============================================================ plain skin

   A light, ordinary chat app: white pages, a dark rail, system type, no
   banner or emblems. The tokens carry most of it; the rest overrides the
   colours athex.css and shell.css write out by hand for a dark page. */

html.atx-plain {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #ffffff;
  --code-bg: #f6f6f6;
  --rule: #e3e3e5;
  --border: #d6d6d9;
  --fg: #1d1c1d;
  --muted: #616061;
  --accent: #1264a3;
  --stamp: #e01e5a;
  --stamp-dim: rgba(224, 30, 90, 0.4);
  --rail-bg: #3f0e40;
  --hover: rgba(29, 28, 29, 0.04);
  --lit: rgba(18, 100, 163, 0.1);
  --mono: var(--sans);
  --strip-h: 0px;
  --plain-side: #f8f8f8;
  --plain-go: #007a5a;
  --plain-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
html.atx-plain body { background: var(--bg); color: var(--fg); }
/* The ground under the notch: the status bar draws white over it. */
html.atx-plain body:has(> .page-list > .atx-strip)::before { background: var(--rail-bg); }
html.atx-plain *,
html.atx-plain *::before,
html.atx-plain *::after { letter-spacing: normal !important; text-transform: none !important; }

/* What made it look like somewhere else. */
html.atx-plain .atx-strip,
html.atx-plain .atx-foot,
html.atx-plain .atx-emblem,
html.atx-plain .atx-hero-sealed::after,
html.atx-plain .atx-hero-kicker,
html.atx-plain .atx-comms-side-title .atx-comms-kicker,
html.atx-plain .atx-veil-mark,
html.atx-plain .atx-page-veil img,
html.atx-plain .atx-you-tier,
html.atx-plain .atx-session,
html.atx-plain .atx-clsbar,
html.atx-plain .atx-rail-sigil,
html.atx-plain img[src*="/static/app/icon-"] { display: none !important; }
html.atx-plain .atx-hero-sealed > :not(.atx-emblem) { max-width: none; }

/* Loading: an ordinary spinner where the app's mark was. Its words stay
   for a screen reader, and come back when loading is slow. */
html.atx-plain :is(.atx-page-veil, .atx-comms-veil, .atx-updating)::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid var(--rule);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: atx-plain-spin 0.8s linear infinite;
}
@keyframes atx-plain-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html.atx-plain :is(.atx-page-veil, .atx-comms-veil, .atx-updating)::before { animation-duration: 2.4s; }
}
html.atx-plain .atx-page-veil:not(.atx-page-slow) [role=status],
html.atx-plain .atx-comms-veil span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
html.atx-plain .atx-updating::before { display: block; margin: 0 auto 16px; }

/* Type: the monospace labels become ordinary sans at a size that reads. */
html.atx-plain .atx-name,
html.atx-plain .atx-crumbs ol,
html.atx-plain .atx-field-label,
html.atx-plain .atx-table th,
html.atx-plain .atx-foot,
html.atx-plain .atx-clsbar,
html.atx-plain .atx-subtitle,
html.atx-plain .atx-council-day,
html.atx-plain .atx-council-rowtime,
html.atx-plain .atx-council-who,
html.atx-plain .atx-council-time,
html.atx-plain .atx-council-reply-label,
html.atx-plain .atx-council-jump,
html.atx-plain .atx-council-staged-file,
html.atx-plain .atx-caveat-label,
html.atx-plain .atx-caveat,
html.atx-plain .atx-tier,
html.atx-plain .atx-denied-table th,
html.atx-plain .atx-ok,
html.atx-plain .atx-deny,
html.atx-plain .atx-logtarget,
html.atx-plain .atx-signout,
html.atx-plain .atx-self,
html.atx-plain .atx-fp,
html.atx-plain .atx-reading-label,
html.atx-plain .atx-msg-who,
html.atx-plain .atx-msg-at,
html.atx-plain .atx-tool-label,
html.atx-plain .atx-msg-attach,
html.atx-plain .atx-message-new,
html.atx-plain .atx-message-add,
html.atx-plain .atx-message-contact-preview,
html.atx-plain .atx-dialog-head,
html.atx-plain .atx-pins-handle,
html.atx-plain .atx-pins-title,
html.atx-plain .atx-pins-jump,
html.atx-plain .atx-council-sheet-who,
html.atx-plain .atx-file-head,
html.atx-plain .atx-file-kind,
html.atx-plain .atx-file-note,
html.atx-plain .atx-file-save,
html.atx-plain .atx-lightbox-tools .atx-lightbox-fit,
html.atx-plain .atx-lightbox-level,
html.atx-plain .atx-lightbox-shut,
html.atx-plain .vt-at,
html.atx-plain .vt-tag,
html.atx-plain .vt-facts,
html.atx-plain .vt-osint-label,
html.atx-plain .vt-platform,
html.atx-plain .vt-meta,
html.atx-plain .vt-osint-title,
html.atx-plain .vt-messages-title,
html.atx-plain .vt-export,
html.atx-plain .vt-msg-attach,
html.atx-plain .atx-spoiler-do,
html.atx-plain .atx-hero-kicker,
html.atx-plain .atx-hero-stats dt,
html.atx-plain .atx-brief-door-name,
html.atx-plain .atx-card-head,
html.atx-plain .atx-pager,
html.atx-plain .atx-filters > summary,
html.atx-plain .atx-filter-head,
html.atx-plain .atx-filters-actions a,
html.atx-plain .atx-hit-date,
html.atx-plain .atx-holding-go,
html.atx-plain .atx-holding-doors a,
html.atx-plain .atx-tag,
html.atx-plain .atx-months-axis,
html.atx-plain .atx-compare-head,
html.atx-plain .atx-heat-hour,
html.atx-plain .atx-heat-day,
html.atx-plain .atx-atlas-side-head,
html.atx-plain .atx-atlas-back,
html.atx-plain .atx-atlas-sub,
html.atx-plain .atx-atlas-ex-meta,
html.atx-plain .atx-atlas-all,
html.atx-plain .atx-facet-name small,
html.atx-plain .atx-hit-model,
html.atx-plain .atx-hit-num,
html.atx-plain .atx-check-state,
html.atx-plain .atx-seek-opt-hint,
html.atx-plain .atx-seek-go .atx-seek-opt-hint,
html.atx-plain .atx-seek-note,
html.atx-plain .atx-seek-day,
html.atx-plain .atx-seek-tag,
html.atx-plain .atx-lock-kicker,
html.atx-plain .atx-lock-links .atx-lock-link,
html.atx-plain .atx-term-tab,
html.atx-plain .atx-term-seg a,
html.atx-plain .atx-term-card-head h2,
html.atx-plain .atx-term-field label,
html.atx-plain .atx-term-issued-grid dt,
html.atx-plain .atx-term-you,
html.atx-plain .atx-term-flag,
html.atx-plain .atx-term-fp,
html.atx-plain .atx-term-pick.is-busy,
html.atx-plain .atx-term-result,
html.atx-plain .atx-term-state,
html.atx-plain .atx-term-more summary,
html.atx-plain .atx-page-veil,
html.atx-plain .atx-strip,
html.atx-plain .atx-you-tier,
html.atx-plain .atx-you-links a,
html.atx-plain .atx-you .atx-signout,
html.atx-plain .atx-switch-hint,
html.atx-plain .atx-switch-kind,
html.atx-plain .atx-switch-foot,
html.atx-plain .atx-comms-veil,
html.atx-plain .atx-comms-kicker,
html.atx-plain .atx-comms-group-head,
html.atx-plain .atx-addpeople-head,
html.atx-plain .atx-message-event .atx-council-time,
html.atx-plain .atx-comms-toast,
html.atx-plain .atx-embed-top,
html.atx-plain .atx-embed-meta,
html.atx-plain .atx-embed-wait .atx-embed-title,
html.atx-plain .atx-embed-none .atx-embed-title,
html.atx-plain .atx-share,
html.atx-plain .atx-device-pick,
html.atx-plain .atx-tabbar > a,
html.atx-plain .atx-install-head { font-size: 12px; }
html.atx-plain .atx-hero-title { font-size: 26px !important; font-weight: 800; }
html.atx-plain .atx-card-head { font-size: 15px !important; font-weight: 700; color: var(--fg); }
html.atx-plain .atx-card-count { font-size: 12.5px !important; }
html.atx-plain .atx-panel-note,
html.atx-plain .atx-hero-hint,
html.atx-plain .atx-hero-blurb { font-size: 14px !important; color: var(--muted); }
html.atx-plain .atx-comms-side-title h1 { font-size: 18px !important; font-weight: 800; }
html.atx-plain .atx-council-who { font-size: 15px !important; font-weight: 800; color: var(--fg); }
html.atx-plain .atx-council-said { font-size: 15px !important; line-height: 1.46; color: var(--fg); }

/* Shapes: rounded, quiet borders, light shadows. */
html.atx-plain .atx-hero { background: var(--paper); border: 0; border-bottom: 1px solid var(--rule); padding-left: 0; padding-right: 0; }
html.atx-plain :is(.atx-card, .atx-notice, .atx-empty, .atx-archives-empty) { border-radius: 10px; background: var(--paper); }
html.atx-plain :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) { border-radius: 6px; }
html.atx-plain .atx-message-compose textarea { border-radius: 8px; }
html.atx-plain .atx-btn {
  border-radius: 6px;
  background: var(--plain-go);
  border-color: var(--plain-go);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
}
html.atx-plain .atx-btn-quiet { background: #fff; color: var(--fg); border-color: var(--border); }
html.atx-plain .atx-btn-quiet:hover { background: var(--code-bg); border-color: var(--border); }
html.atx-plain :is(.atx-msg-actions, .atx-incin-menu, .atx-pins, .atx-seek-pop, .atx-mention-pop, .atx-you-card,
  .atx-switch, .atx-addpeople, .atx-react-pick, .atx-install, .atx-term-menu, .atx-atlas-tip) {
  box-shadow: var(--plain-shadow);
  border-radius: 10px;
}
html.atx-plain :is(.atx-comms-side-head, .atx-comms .atx-comms-bar) { box-shadow: 0 1px 0 var(--rule); }

/* The rail: dark, with light icons, the way most chat apps draw it. */
html.atx-plain .atx-rail { border-right: 0; }
html.atx-plain :is(.atx-rail-item, .atx-rail-you) {
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}
html.atx-plain .atx-rail-item:is(:hover, :focus-visible) { border-color: transparent; border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: #fff; }
html.atx-plain .atx-rail-item.is-active { border-color: transparent; border-radius: 8px; background: rgba(255, 255, 255, 0.24); color: #fff; }
html.atx-plain .atx-rail-home { border-color: transparent; }
html.atx-plain .atx-rail-item::before { background: #fff; }
html.atx-plain .atx-rail-sep { background: rgba(255, 255, 255, 0.2); }
html.atx-plain .atx-rail-plain { display: grid; place-items: center; }
html.atx-plain .atx-rail-plain svg { width: 20px; height: 20px; }
html.atx-plain .atx-tabbar { background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--rule); }

/* Comms: a grey list beside a white conversation. */
html.atx-plain .atx-comms-side { background: var(--plain-side); }
html.atx-plain .atx-council-row:hover { background: var(--hover); }
html.atx-plain .atx-message-contact:hover { background: var(--hover); }
html.atx-plain .atx-message-contact.active { background: var(--accent); }
html.atx-plain .atx-message-contact.active :is(.atx-message-contact-name, .atx-message-contact-preview) { color: #fff; }
html.atx-plain :is(.atx-council-sheet-opt:active, .atx-council-held) { background: var(--lit); }
html.atx-plain .atx-council-row.atx-council-mentioned { background: #fef8e7; }
html.atx-plain .atx-council-row.atx-council-mentioned:hover { background: #fdf2d3; }
html.atx-plain .atx-mention { background: rgba(29, 155, 209, 0.1); color: var(--accent); }
html.atx-plain .atx-mention:hover { background: var(--accent); color: #fff; }
html.atx-plain .atx-react { background: var(--code-bg); }
html.atx-plain .atx-react.is-mine { background: var(--lit); border-color: var(--accent); }
html.atx-plain .atx-msg-user { background: none; }

/* People: a coloured square with a person in it. */
html.atx-plain :is(.atx-council-seal, .atx-pin-seal, .atx-seal-slot, .atx-mention-seal) { background: transparent; box-shadow: none; }
html.atx-plain .atx-ink-a { color: #1264a3; }
html.atx-plain .atx-ink-b { color: #2bac76; }
html.atx-plain .atx-ink-c { color: #e01e5a; }
html.atx-plain .atx-ink-d { color: #e8912d; }

/* Tooltips and toasts stay dark, with light words on them. */
html.atx-plain :is(.atx-tip, .atx-rail-tip, .atx-comms-toast) { background: #1d1c1d; color: #fff; border-color: #1d1c1d; }
html.atx-plain .atx-rail-tip::before { background: #1d1c1d; border-color: #1d1c1d; }
html.atx-plain :is(.atx-msg-act[data-tip], .atx-pins-off[data-tip], .atx-react[data-tip]:hover)::after { background: #1d1c1d; color: #fff; }

/* Everything else written out for a dark page. */
html.atx-plain :is(.atx-hit:hover, a.atx-bar-row:hover, .atx-atlas-item:hover, .atx-atlas-subitem:hover, .atx-facet:hover,
  a.atx-brief-door:hover, .atx-holding-doors a:hover) { background: var(--hover); }
html.atx-plain .atx-atlas-subitem.is-on { background: var(--lit); }
html.atx-plain :is(.atx-hit + .atx-hit, .atx-compare > *, .atx-atlas-examples li, .vt-meta, .vt-msg) { border-color: var(--rule); }
html.atx-plain :is(.vt-person, .vt-account, .vt-osint, .vt-messages, .atx-pin-key, .atx-atlas-stage) { background: var(--code-bg); }
html.atx-plain .atx-atlas-time { background: rgba(255, 255, 255, 0.94); }
html.atx-plain :is(.atx-lock, .atx-archives-empty) { background: var(--bg); }
html.atx-plain .atx-chip { background: var(--lit); border-color: rgba(18, 100, 163, 0.4); }
html.atx-plain .atx-bar-track { background: var(--rule); }
html.atx-plain .atx-month span { background: linear-gradient(to top, rgba(18, 100, 163, 0.7), rgba(18, 100, 163, 0.35)); }
html.atx-plain .atx-heat-cell { background: rgba(18, 100, 163, calc(0.06 + var(--v) * 0.85)); }
html.atx-plain .atx-mark { background: rgba(236, 178, 46, 0.25); }
html.atx-plain .atx-finding-count { background: var(--code-bg); }
html.atx-plain .atx-finding-active { background: rgba(236, 178, 46, 0.4); }
html.atx-plain .atx-seek-said mark { background: rgba(236, 178, 46, 0.4); }
html.atx-plain .atx-seek-field:focus-within { box-shadow: 0 0 0 3px var(--lit); }
html.atx-plain :is(.atx-login-face-go, .atx-archives-empty-mark) { background: var(--lit); border-color: rgba(18, 100, 163, 0.3); }

/* ----------------------------------------------------------- the privacy

   A message nobody is reading is drawn as grey bars, the way an app draws
   something still loading: each line of words a bar as long as the line,
   pictures, quotes and cards a grey box, the sender a bar and the seal a
   grey circle. appearance.js lights (atx-lit) the ones being read; the
   rest go faint (atx-far) further from them. */

html { --skel: rgba(255, 255, 255, 0.09); }
html.atx-plain { --skel: rgba(0, 0, 0, 0.075); }

/* Bars: words, the sender and the time, a file's name. */
html.atx-blur .atx-council-row:not(.atx-lit) :is(.atx-skel, .atx-council-who, .atx-council-time, .atx-message-content > a) {
  color: transparent !important;
  background: var(--skel);
  border-radius: 4px;
  text-decoration: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
html.atx-blur .atx-council-row:not(.atx-lit) .atx-skel * {
  color: transparent !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  text-decoration: none;
}
html.atx-blur .atx-council-row:not(.atx-lit) .atx-skel-emoji { opacity: 0; }
html.atx-blur .atx-council-row:not(.atx-lit) .atx-council-said::after { visibility: hidden; }

/* Boxes: pictures, quotes and cards; the seal keeps its own shape. */
html.atx-blur .atx-council-row:not(.atx-lit) :is(.atx-council-pic, .atx-council-reply, .atx-message-content-wrap > :not(.atx-council-said), .atx-council-seal) {
  background: var(--skel) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html.atx-blur .atx-council-row:not(.atx-lit) :is(.atx-council-pic, .atx-council-reply, .atx-message-content-wrap > :not(.atx-council-said)) { border-radius: 8px; }
html.atx-blur .atx-council-row:not(.atx-lit) :is(.atx-council-pic, .atx-council-reply, .atx-message-content-wrap > :not(.atx-council-said), .atx-council-seal) > * {
  visibility: hidden;
}
html.atx-blur .atx-council-row:not(.atx-lit) :is(.atx-reacts, .atx-pinmark, .atx-council-rowtime) { visibility: hidden; }

/* Further from what is being read, fainter. */
html.atx-blur .atx-council-row.atx-far .atx-council-gutter,
html.atx-blur .atx-council-row.atx-far .atx-council-body { opacity: 0.5; }

/* Coming clear, and going back, is a short fade rather than a jump. */
html.atx-blur .atx-council-row :is(.atx-skel, .atx-council-who, .atx-council-time, .atx-council-pic, .atx-council-seal) {
  transition: color 0.16s ease, background-color 0.16s ease;
}
html.atx-blur .atx-council-row :is(.atx-council-gutter, .atx-council-body) { transition: opacity 0.16s ease; }
@media (prefers-reduced-motion: reduce) {
  html.atx-blur .atx-council-row :is(.atx-skel, .atx-council-who, .atx-council-time, .atx-council-pic, .atx-council-seal,
    .atx-council-gutter, .atx-council-body) { transition: none; }
}

/* The list: names as they are, what was said last as a bar. */
html.atx-blur .atx-message-contact-preview {
  width: fit-content;
  max-width: 100%;
  color: transparent !important;
  background: var(--skel);
  border-radius: 4px;
}
@media (hover: hover) and (pointer: fine) {
  html.atx-blur:not(.atx-idle):not(.atx-away) .atx-message-contact:hover .atx-message-contact-preview {
    color: inherit !important;
    background: transparent;
  }
}

/* A draft: only its last lines while it is written, a bar while it waits. */
html.atx-blur .atx-message-compose textarea.atx-draft-long:focus {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06) calc(100% - 2.8em), #000 calc(100% - 1.9em));
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06) calc(100% - 2.8em), #000 calc(100% - 1.9em));
}
html.atx-blur .atx-message-compose textarea.atx-draft:not(:focus),
html.atx-blur.atx-idle .atx-message-compose textarea.atx-draft,
html.atx-blur.atx-away .atx-message-compose textarea.atx-draft {
  color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  background-image: linear-gradient(var(--skel), var(--skel));
  background-repeat: no-repeat;
  background-size: min(60%, 240px) 0.9em;
  background-position: 0 50%;
}

/* Away from the page: who as well as what. */
html.atx-blur.atx-away :is(.atx-message-contact-name, .atx-comms-title-words h2, .atx-message-reply-tray, .atx-council-reply-preview) {
  color: transparent !important;
  background: var(--skel);
  border-radius: 4px;
}
html.atx-blur.atx-away :is(.atx-message-contact-open, .atx-message-thread-seal) { opacity: 0; }

/* ------------------------------------------------------------- the cover

   On a phone, a notes app drawn the way the Notes app is: yellow for what
   can be tapped, one screen at a time. On a wide screen, a tech blog. Their
   own colours and type throughout, so neither skin reaches into them. */

html.atx-decoy-armed { touch-action: manipulation; }
html.atx-covered,
html.atx-covered body { overflow: hidden; }
html.atx-covered body > :not(.atx-cover) { visibility: hidden !important; }

.atx-cover {
  --n-bg: #f2f2f7;
  --n-card: #ffffff;
  --n-page: #ffffff;
  --n-fg: #000000;
  --n-dim: #8a8a8e;
  --n-sep: rgba(60, 60, 67, 0.22);
  --n-tint: #d69e00;
  --n-tick: #f5c000;
  --n-fill: rgba(118, 118, 128, 0.12);
  --n-bar: rgba(249, 249, 249, 0.94);
  --n-menu: #ffffff;
  --n-danger: #ff3b30;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow: hidden;
  background: var(--n-bg);
  color: var(--n-fg);
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
/* Dark on the dark registry; with the system in the plain skin, the way
   the real app follows the phone. */
html:not(.atx-plain) .atx-cover {
  --n-bg: #000000;
  --n-card: #1c1c1e;
  --n-page: #000000;
  --n-fg: #ffffff;
  --n-dim: #8d8d93;
  --n-sep: rgba(84, 84, 88, 0.6);
  --n-tint: #ffd60a;
  --n-tick: #ffd60a;
  --n-fill: rgba(118, 118, 128, 0.24);
  --n-bar: rgba(22, 22, 23, 0.94);
  --n-menu: #2c2c2e;
  --n-danger: #ff453a;
}
@media (prefers-color-scheme: dark) {
  .atx-cover {
    --n-bg: #000000;
    --n-card: #1c1c1e;
    --n-page: #000000;
    --n-fg: #ffffff;
    --n-dim: #8d8d93;
    --n-sep: rgba(84, 84, 88, 0.6);
    --n-tint: #ffd60a;
    --n-tick: #ffd60a;
    --n-fill: rgba(118, 118, 128, 0.24);
    --n-bar: rgba(22, 22, 23, 0.94);
    --n-menu: #2c2c2e;
    --n-danger: #ff453a;
  }
}
/* Plain resets that weigh nothing, so every rule below wins over them. */
:where(.atx-cover) * { box-sizing: border-box; letter-spacing: normal; text-transform: none; }
:where(.atx-cover) button {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:where(.atx-cover) input {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--n-fg);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
:where(.atx-cover) input::placeholder { color: var(--n-dim); }
:where(.atx-cover) input::-webkit-search-cancel-button { -webkit-appearance: none; }

.atx-nt-ico { display: inline-flex; flex: none; }
.atx-nt-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ----- one pane at a time on a phone */

.atx-nt-pane {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--n-bg);
}
.atx-cover[data-screen="folders"] .atx-nt-folders,
.atx-cover[data-screen="list"] .atx-nt-list,
.atx-cover[data-screen="note"] .atx-nt-note { display: flex; }
.atx-nt-note { background: var(--n-page); }

.atx-nt-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
}
.atx-nt-grow { flex: 1; }
.atx-nt-slot { width: 44px; height: 44px; flex: none; }
.atx-nt-back {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 44px;
  padding-right: 8px;
  color: var(--n-tint);
  font-size: 17px;
}
.atx-nt-back .atx-nt-ico svg { width: 26px; height: 26px; stroke-width: 2.2; }
.atx-nt-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--n-tint); }
.atx-nt-text { min-height: 44px; padding: 0 8px; color: var(--n-tint); font-size: 17px; }
.atx-nt-strong { font-weight: 600; }
.atx-nt-done { display: none; }
.atx-cover.is-writing .atx-nt-done { display: inline-block; }

.atx-nt-large { margin: 2px 0 10px; padding: 0 20px; font-size: 34px; font-weight: 700; line-height: 1.15; }

.atx-nt-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin: 0 16px 6px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--n-fill);
  color: var(--n-dim);
}
.atx-nt-search .atx-nt-ico svg { width: 19px; height: 19px; stroke-width: 2; }
.atx-nt-search input { flex: 1; min-width: 0; height: 100%; font-size: 17px; }

.atx-nt-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
.atx-nt-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 22px 4px 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.atx-nt-section .atx-nt-ico { color: var(--n-tint); }
.atx-nt-section .atx-nt-ico svg { width: 20px; height: 20px; }
.atx-nt-group { overflow: hidden; border-radius: 10px; background: var(--n-card); }
.atx-nt-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 11px 16px 12px;
}
.atx-nt-row + .atx-nt-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  border-top: 0.5px solid var(--n-sep);
}
.atx-nt-row:active { background: var(--n-fill); }
.atx-nt-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 17px; font-weight: 600; }
.atx-nt-meta { display: flex; gap: 8px; min-width: 0; font-size: 15px; color: var(--n-dim); }
.atx-nt-when { flex: none; color: var(--n-fg); opacity: 0.6; }
.atx-nt-snip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.atx-nt-empty { margin: 40px 0; text-align: center; color: var(--n-dim); font-size: 17px; }
.atx-nt-none { margin: auto; }

.atx-nt-foot {
  flex: none;
  display: flex;
  align-items: center;
  min-height: calc(49px + env(safe-area-inset-bottom));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  border-top: 0.5px solid var(--n-sep);
  background: var(--n-bar);
}
.atx-nt-count { flex: 1; text-align: center; font-size: 11px; color: var(--n-fg); }
.atx-nt-note .atx-nt-foot { border-top: 0; background: transparent; }

.atx-nt-folder {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 16px;
}
.atx-nt-folder + .atx-nt-folder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 52px;
  right: 0;
  border-top: 0.5px solid var(--n-sep);
}
.atx-nt-folder > .atx-nt-ico:first-child { color: var(--n-tint); }
.atx-nt-folder-name { flex: 1; }
.atx-nt-folder-count { color: var(--n-dim); }
.atx-nt-folder > .atx-nt-ico:last-child { color: var(--n-dim); opacity: 0.6; }
.atx-nt-folder > .atx-nt-ico:last-child svg { width: 16px; height: 16px; stroke-width: 2.4; }
.atx-nt-folders .atx-nt-group { margin: 0 16px; }

/* ----- the note */

.atx-nt-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  -webkit-overflow-scrolling: touch;
}
.atx-nt-stamp { margin: 2px 0 14px; text-align: center; font-size: 13px; color: var(--n-dim); }
.atx-nt-body {
  min-height: 60vh;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.38;
  caret-color: var(--n-tint);
  -webkit-user-select: text;
  user-select: text;
}
.atx-nt-body::first-line { font-size: 28px; font-weight: 700; line-height: 1.25; }
.atx-nt-body.is-read { min-height: 0; }
.atx-nt-head { display: block; width: 100%; font-size: 28px; font-weight: 700; line-height: 1.25; caret-color: var(--n-tint); }
.atx-nt-checks { margin-top: 6px; }
.atx-nt-check { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.atx-nt-tick {
  flex: none;
  width: 23px;
  height: 23px;
  border: 1.5px solid var(--n-dim);
  border-radius: 50%;
}
.atx-nt-check.is-done .atx-nt-tick {
  border-color: var(--n-tick);
  background: var(--n-tick) center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.atx-nt-item { flex: 1; min-width: 0; min-height: 38px; font-size: 17px; caret-color: var(--n-tint); }
.atx-nt-check.is-done .atx-nt-item { color: var(--n-dim); }

.atx-nt-menu {
  position: absolute;
  z-index: 2;
  min-width: 230px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--n-menu);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}
.atx-nt-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  font-size: 17px;
}
.atx-nt-menu-item + .atx-nt-menu-item { border-top: 0.5px solid var(--n-sep); }
.atx-nt-menu-item .atx-nt-ico svg { width: 20px; height: 20px; }
.atx-nt-menu-item.is-danger { color: var(--n-danger); }

/* ----- the blog, on a wide screen

   Dark on the dark registry, light in the plain skin, like the notes. */

.atx-blog {
  --b-bg: #12141a;
  --b-fg: #e4e6eb;
  --b-dim: #9aa1ac;
  --b-rule: #262a33;
  --b-link: #7aa2f7;
  --b-code: #1a1d25;
  --b-chip: #1e222b;
  display: flex;
  flex-direction: column;
  background: var(--b-bg);
  color: var(--b-fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}
html.atx-plain .atx-blog {
  --b-bg: #ffffff;
  --b-fg: #1f2328;
  --b-dim: #59636e;
  --b-rule: #e5e7eb;
  --b-link: #0969da;
  --b-code: #f6f8fa;
  --b-chip: #f1f3f5;
}
.atx-bl-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 2px;
  background: var(--b-link);
  transform: scaleX(0);
  transform-origin: left;
}
.atx-bl-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  padding: 0 max(32px, calc((100% - 1160px) / 2));
  border-bottom: 1px solid var(--b-rule);
}
.atx-bl-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.atx-bl-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--b-link);
  color: var(--b-bg);
  font: 700 12px ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.atx-bl-nav { display: flex; gap: 22px; }
.atx-bl-link { color: var(--b-dim); font-size: 15px; }
.atx-bl-link:hover { color: var(--b-fg); }
.atx-bl-sub {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--b-rule);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.atx-bl-sub:hover { border-color: var(--b-link); }
.atx-bl-sub:disabled { color: var(--b-dim); cursor: default; }

.atx-bl-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.atx-bl-page {
  display: grid;
  grid-template-columns: minmax(0, 680px) 260px;
  justify-content: center;
  gap: 64px;
  padding: 48px 32px 96px;
}
.atx-bl-page > .atx-bl-index,
.atx-bl-page > .atx-bl-article:only-child { grid-column: 1 / -1; width: 100%; max-width: 760px; justify-self: center; }

.atx-bl-kicker { display: block; margin: 0 0 10px; font-size: 13px; color: var(--b-dim); }
.atx-bl-tag { color: var(--b-link); font-weight: 600; }
.atx-bl-h1 { margin: 0 0 12px; font-size: 36px; line-height: 1.2; font-weight: 750; letter-spacing: -0.01em; }
.atx-bl-byline { display: block; margin: 0 0 32px; font-size: 14px; color: var(--b-dim); }
.atx-bl-h2 { margin: 36px 0 10px; font-size: 22px; line-height: 1.3; font-weight: 700; }
.atx-bl-p { margin: 0 0 18px; font-size: 17px; line-height: 1.7; }
.atx-bl-code {
  margin: 0 0 22px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--b-rule);
  border-radius: 8px;
  background: var(--b-code);
  font: 13.5px/1.6 ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  white-space: pre;
}
.atx-bl-quote { margin: 0 0 22px; padding: 2px 0 2px 18px; border-left: 3px solid var(--b-link); color: var(--b-dim); font-size: 18px; font-style: italic; }
.atx-bl-next { display: flex; flex-direction: column; gap: 4px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--b-rule); }
.atx-bl-next-label { font-size: 13px; color: var(--b-dim); }
.atx-bl-next-link { color: var(--b-link); font-size: 18px; font-weight: 600; }

.atx-bl-aside { position: sticky; top: 0; align-self: start; padding-top: 6px; }
.atx-bl-aside-head { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--b-dim); }
.atx-bl-aside-head:not(:first-child) { margin-top: 30px; }
.atx-bl-recent { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 0; border-top: 1px solid var(--b-rule); }
.atx-bl-recent-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.atx-bl-recent:hover .atx-bl-recent-title { color: var(--b-link); }
.atx-bl-recent-meta { font-size: 13px; color: var(--b-dim); }
.atx-bl-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.atx-bl-chip { padding: 4px 12px; border-radius: 999px; background: var(--b-chip); font-size: 13px; }
.atx-bl-chip:hover, .atx-bl-chip.is-on { color: var(--b-bg); background: var(--b-link); }

.atx-bl-index .atx-bl-tags { margin-bottom: 18px; }
.atx-bl-card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 22px 0; border-top: 1px solid var(--b-rule); }
.atx-bl-card .atx-bl-kicker, .atx-bl-card .atx-bl-byline { margin: 0; }
.atx-bl-card-title { font-size: 22px; font-weight: 700; line-height: 1.3; }
.atx-bl-card:hover .atx-bl-card-title { color: var(--b-link); }
.atx-bl-card-blurb { font-size: 16px; color: var(--b-dim); }

@media (max-width: 1060px) {
  .atx-bl-page { grid-template-columns: minmax(0, 680px); }
  .atx-bl-aside { position: static; }
}
