/* Paperlamp for the web: the Mac app's look (Sources/Paperlamp/Look.swift, Workspace.swift, Sections.swift),
   in the theme's colours, which app.js sets on :root. */

:root {
  --background: #0D0E10; --surface: #131518; --raised: #1A1D21; --border: #272B31;
  --text: #E9EBEE; --muted: #868D97; --accent: #5B9DFF; --page: #131518; --ink: #D5D9DF;
  --radius: 5px; --on-accent: #0B0B0C;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  --serif: 'New York', ui-serif, 'Iowan Old Style', Charter, Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--background); color: var(--text); font: 13px/1.3 var(--sans);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
:root[data-dark="false"] { color-scheme: light; }
:root[data-dark="true"] { color-scheme: dark; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
input, textarea { font: inherit; color: inherit; }
.icon { display: block; flex: none; }
.hidden { display: none !important; }

#app {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  /* Clear of an iPhone's notch and rounded corners (index.html asks for the whole screen with viewport-fit=cover). */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.hairline { flex: none; height: 1px; background: var(--border); }
.vline { flex: none; width: 1px; background: var(--border); position: relative; }

.caps { font-size: 10.5px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; }
.digits { font-variant-numeric: tabular-nums; }

/* MARK: Buttons */

.icon-button {
  width: 26px; height: 24px; flex: none; display: grid; place-items: center; border-radius: var(--radius);
  color: var(--muted);
}
.icon-button:hover { color: var(--text); background: var(--raised); }
.icon-button.active { color: var(--accent); background: var(--raised); }
.icon-button:disabled { opacity: .35; pointer-events: none; }
.icon-button .icon { width: 13px; height: 13px; }

.text-button {
  height: 24px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11.5px; font-weight: 500; border-radius: var(--radius);
  background: var(--raised); border: 1px solid var(--border); color: var(--text); white-space: nowrap;
}
.text-button:hover { background: var(--border); }
.text-button .icon { width: 11px; height: 11px; stroke-width: 1.9; }
.text-button.prominent { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.text-button.prominent:hover { filter: brightness(1.08); }
.text-button:disabled { opacity: .45; }

/* MARK: Top bar */

.topbar { flex: none; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; background: var(--background); }
.topbar .spacer { flex: 1; }
/* The app's icon and name, where the Mac has its window buttons. */
.brand { display: flex; align-items: center; gap: 7px; flex: none; margin-right: 2px; user-select: none; }
.brand img { width: 22px; height: 22px; display: block; }
.brand .name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.1px; }
.topbar .chip.message { flex: 0 1 auto; min-width: 0; }
.toggles { display: flex; gap: 1px; padding: 2px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); }
.chip {
  height: 24px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border-radius: var(--radius);
  font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; max-width: 60vw;
}
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip.message { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.chip.status { color: var(--muted); padding: 0 8px; background: var(--raised); gap: 6px; }
.chip.status .label { font-size: 11.5px; }
.chip .icon { width: 11px; height: 11px; }
.chip button { display: grid; place-items: center; width: 14px; height: 14px; }
.chip button .icon { width: 9px; height: 9px; stroke-width: 2.2; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* MARK: Columns and sections */

.columns { flex: 1; display: flex; min-height: 0; }
.section { display: flex; flex-direction: column; background: var(--surface); min-width: 0; min-height: 0; }
.section.flexible { flex: 1; }
/* Stepped aside: hidden, or no room for it (fit() in app.js). Kept in the page, so the reader's frame never reloads. */
.section.off { display: none !important; }
.section-head {
  flex: none; height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 6px 0 11px; background: var(--raised);
  min-width: 0; overflow: hidden;
}
.section-head .grip { color: var(--muted); opacity: .45; }
.section-head:hover .grip { opacity: 1; }
.section-head .grip .icon { width: 11px; height: 11px; stroke-width: 1.8; }
.section-head .title { color: var(--text); flex: none; }
.section-head .subtitle { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.section-head .spacer { flex: 1; min-width: 6px; }
.section-head .label { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; min-width: 0; flex: 0 1 auto; }
.section-body { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }

.col-divider { flex: none; width: 1px; background: var(--border); position: relative; z-index: 2; touch-action: none; }
.col-divider::after { content: ''; position: absolute; inset: 0 -4px; cursor: col-resize; }

.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px;
}
.empty .icon { color: var(--muted); }
.empty .big { font-size: 12.5px; font-weight: 500; color: var(--text); }
.empty .small { font-size: 11.5px; color: var(--muted); white-space: pre-line; line-height: 1.35; }

/* MARK: Library */

.search { flex: none; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.search .icon { width: 11px; height: 11px; color: var(--muted); stroke-width: 1.8; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12.5px; color: var(--text); }
.search input::placeholder { color: var(--muted); opacity: .8; }
.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.row {
  height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 10px; position: relative; cursor: default;
}
.row.selected { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.row.selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.glyph {
  width: 24px; height: 30px; border-radius: 3px; display: grid; place-items: center; flex: none; color: rgba(255, 255, 255, .95);
}
.glyph .icon { width: 11px; height: 11px; }
.row .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .name { font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .detail { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* MARK: Reader */

/* The reader's toolbar folds up by the room the reader has, not the screen's: see the end of this file. */
.reader-section { container: reader / inline-size; }
.reader-surface { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--page); }
.reader-view { flex: 1; position: relative; min-height: 0; }
.flow-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--page); color-scheme: normal; }
.footer {
  flex: none; height: 22px; display: flex; align-items: center; gap: 10px; padding: 0 14px env(safe-area-inset-bottom); box-sizing: content-box;
  font-size: 10.5px; color: color-mix(in srgb, var(--ink) 55%, transparent); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.footer .spacer { flex: 1; }
.tools { display: flex; align-items: center; gap: 1px; flex: none; }
.dots { display: flex; gap: 5px; padding: 0 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; position: relative; }
.dot::after { content: ''; position: absolute; inset: -3px; }
.dot.selected { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--text); }
/* The colours folded into one button, for a narrow reader. */
.tools .pick { display: none; }
.pick .swatch-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--raised), 0 0 0 2.5px var(--muted); }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; background: var(--page); }
.spin { display: inline-grid; }
.empty .spin .icon, .loading .spin .icon { color: var(--muted); }

/* PDF pages */
.pdf-scroll { position: absolute; inset: 0; overflow: auto; background: var(--background); padding: 8px 0; outline: none; overscroll-behavior: contain; }
.pdf-page { position: relative; margin: 0 auto 8px; background: #fff; }
.pdf-page canvas { position: absolute; inset: 0; display: block; }
.pdf-marks { position: absolute; inset: 0; pointer-events: none; }
.pdf-mark { position: absolute; border-radius: 1px; }
.pdf-mark.multiply { mix-blend-mode: multiply; }
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }

/* MARK: Highlights */

.hl-row { display: flex; gap: 10px; padding: 11px 8px 5px 12px; border-bottom: 1px solid var(--border); }
.hl-row:hover { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.hl-bar { width: 3px; border-radius: 1px; flex: none; }
.hl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hl-text {
  font: 12.5px/1.32 var(--serif); color: var(--text); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer; overflow-wrap: anywhere;
}
.hl-note {
  border: 0; outline: 0; background: transparent; resize: none; font-size: 11.5px; color: var(--text); padding: 0; line-height: 1.35;
  field-sizing: content; min-height: 1.35em; max-height: calc(1.35em * 5);
}
.hl-note::placeholder { color: var(--muted); opacity: .8; }
.hl-foot { height: 24px; display: flex; align-items: center; gap: 2px; }
.hl-foot .where { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 1; }
.hl-row .hover { opacity: 0; }
.hl-row:hover .hover, .hl-row:focus-within .hover { opacity: 1; }

/* MARK: Popovers and menus */

.popover {
  position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32), 0 1px 3px rgba(0, 0, 0, .2); color: var(--text);
}
.menu { padding: 5px; max-height: min(70vh, 520px); overflow-y: auto; min-width: 200px; max-width: min(420px, 90vw); border-radius: 7px; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 4px 10px; border-radius: 4px; font-size: 13px; line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--on-accent); outline: 0; }
.menu-item.current { font-weight: 600; }

.appearance { width: min(320px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.appearance .line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.appearance .line > .what { width: 66px; flex: none; font-size: 12px; color: var(--muted); }
.step { width: 30px; height: 24px; display: grid; place-items: center; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--border); color: var(--text); }
.step .icon { width: 11px; height: 11px; stroke-width: 2; }
.step:hover { background: var(--border); }
.value { width: 44px; text-align: center; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.segmented { display: flex; padding: 2px; gap: 2px; border-radius: calc(var(--radius) + 1px); background: var(--raised); border: 1px solid var(--border); }
.segmented button { height: 20px; padding: 0 10px; font-size: 11.5px; border-radius: var(--radius); color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); font-weight: 500; }
.rule { height: 1px; background: var(--border); }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); cursor: default; }
.check input { accent-color: var(--accent); margin: 0; }
input[type="range"] { accent-color: var(--accent); width: 150px; }
.presets { display: flex; gap: 7px; flex-wrap: wrap; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.preset .swatch {
  width: 38px; height: 26px; border-radius: var(--radius); display: grid; place-items: center; border: 1px solid var(--border);
  font: 600 11.5px var(--serif);
}
.preset.on .swatch { border: 2px solid var(--accent); }
.preset .name { font-size: 9.5px; color: var(--muted); }
.preset.on .name { color: var(--text); }
.colours { display: flex; align-items: center; gap: 14px; }
.colours label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
input[type="color"] { width: 44px; height: 22px; padding: 0 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--raised); }

.mark-menu, .colour-menu { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-radius: 8px; }
.mark-menu .dots, .colour-menu .dots { padding: 0 6px 0 4px; gap: 9px; }
.colour-menu .dots { padding: 6px 8px; gap: 14px; }
.mark-menu .dot, .colour-menu .dot { width: 14px; height: 14px; cursor: pointer; }
.mark-menu .sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }

/* MARK: Settings and connecting: laid out as Settings on the Mac (SettingsView.swift), groups of a title over a hairline */

.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 16px; }
.sheet {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.sheet-head { height: 44px; display: flex; align-items: center; padding: 0 8px 0 18px; background: var(--raised); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.sheet-head .caps { flex: 1; }
.sheet-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 26px; }
.group { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.group > .caps { color: var(--text); }
.setting { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.setting > .what { width: 96px; flex: none; font-size: 12px; color: var(--muted); }
.setting .grow { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.theme-card { border-radius: 7px; border: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 5px; font-size: 11px; text-align: left; }
.theme-card.on { border: 2px solid var(--accent); padding: 5px; }
.theme-card .look { height: 34px; border-radius: 4px; display: flex; overflow: hidden; }
.theme-card .look i { flex: 1; }
.note { margin: 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
.note.warning { color: #FF6B5E; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sync with GitHub: GitHubSyncSettings in GitHubSync.swift */
.sync-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.howtos { display: flex; flex-direction: column; gap: 6px; }
.howto { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 3px; align-items: baseline; }
.howto .n { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.howto .t { font-size: 12px; line-height: 1.35; color: var(--text); }
.howto a { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.howto a:hover { text-decoration: underline; }
.token-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input.token {
  flex: 1 1 220px; max-width: 330px; min-width: 0; height: 24px; padding: 0 7px; outline: 0;
  font: 12px var(--mono); color: var(--text); background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius);
}
input.token:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent); }
input.token::placeholder { color: var(--muted); opacity: .8; }
.sync-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sync-icon { display: grid; color: var(--muted); }
.sync-icon.warning { color: #FF6B5E; }
.sync-icon .icon { width: 14px; height: 14px; }
.sync-state .repo { font: 11.5px var(--mono); color: var(--text); user-select: text; overflow-wrap: anywhere; }
.sync-state .when { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* The first screen: Settings' Sync with GitHub, in a card. */
.connect { flex: 1; display: flex; overflow-y: auto; padding: 16px; }
.connect-card { margin: auto; width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.connect-card .head { padding: 22px 24px 0; display: flex; gap: 14px; align-items: center; }
.connect-card .head img { width: 44px; height: 44px; flex: none; }
.connect-card h1 { margin: 0; font-size: 17px; font-weight: 600; }
.connect-card .head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* MARK: Adding and deleting books */

.row .row-delete { opacity: 0; margin-right: -4px; }
.row:hover .row-delete, .row:focus-within .row-delete { opacity: 1; }
.row .row-delete:hover { color: #FF6B5E; }
.row.importing { opacity: .75; }
.row.importing .glyph { background: var(--raised); color: var(--muted); border: 1px solid var(--border); }
.text-button.prominent.danger { background: #FF453A; color: #fff; }
.ask-back { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 16px; }
.ask {
  width: min(400px, 100%); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.ask-title { font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ask .buttons { justify-content: flex-end; margin-top: 4px; }
/* Books being dragged over the window: it takes them. */
body.dropping::after {
  content: ''; position: fixed; inset: 6px; z-index: 60; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* MARK: Focus: the book alone, in the middle of a black screen */

body.focusing { background: #000; }
body.focusing .topbar, body.focusing .topbar + .hairline, body.focusing .section:not(.reader-section), body.focusing .col-divider { display: none; }
body.focusing .columns { background: #000; justify-content: center; }
body.focusing .reader-section { flex: 0 1 var(--focus-width, 760px); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

/* MARK: Narrow screens: a phone, or a window as narrow. One section at a time, picked in the top bar. */

@media (max-width: 600px) {
  .topbar { padding-left: 10px; }
  .topbar { gap: 8px; }
  /* Room is short: the spinning icon says enough (its tooltip says the rest). */
  .chip.status .label { display: none; }
  .columns > .section { width: 100% !important; flex: 1; }
  .col-divider { display: none; }
  /* Nothing to drag, and each section is closed by showing another. */
  .section-head .grip, .section-head > .close { display: none; }
  .section-head { padding-left: 12px; }
  .sheet-back { padding: 0; place-items: stretch; }
  .sheet { width: 100%; max-height: none; height: 100%; border: 0; border-radius: 0; }
  .sheet-body { padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); }
  .connect { padding: 0; }
  .connect-card { width: 100%; min-height: 100%; border: 0; border-radius: 0; }
  .connect-card .head { padding: 22px 16px 0; }
  /* The link goes under its step rather than squeezing it. */
  .howto a { grid-column: 2; }
  body.focusing .reader-section { flex: 1; border: 0; }
}

/* The reader's toolbar, by the width the reader has. */
@container reader (max-width: 640px) {
  .section-head .label { display: none; }
}
@container reader (max-width: 560px) {
  .section-head .grip, .section-head .title { display: none; }
  .tools .dots.full { display: none; }
  .tools .pick { display: grid; }
}
@container reader (max-width: 400px) {
  .tools .icon-button { width: 32px; }
}

/* MARK: Touch: a finger needs more room than a pointer */

@media (pointer: coarse) {
  .topbar { height: 52px; }
  .brand img { width: 26px; height: 26px; }
  .brand .name { font-size: 15px; }
  .toggles { gap: 2px; }
  .icon-button { width: 36px; height: 34px; }
  .toggles .icon-button { width: 40px; }
  .icon-button .icon { width: 15px; height: 15px; }
  .text-button { height: 32px; padding: 0 12px; gap: 6px; font-size: 13px; }
  .text-button .icon { width: 12px; height: 12px; }
  .chip { height: 30px; font-size: 12.5px; }
  .chip button { width: 24px; height: 24px; }
  .section-head { height: 44px; }
  .section-head .subtitle, .section-head .label { font-size: 12px; }
  .search { height: 44px; padding: 0 14px; }
  .search .icon { width: 13px; height: 13px; }
  .row { height: 60px; padding: 0 14px; gap: 12px; }
  .row .name { font-size: 14px; }
  .row .detail { font-size: 11.5px; }
  .glyph { width: 28px; height: 36px; }
  .dots { gap: 11px; padding: 0 9px; }
  .dot { width: 15px; height: 15px; }
  .dot::after { inset: -6px; }
  .pick .swatch-dot { width: 15px; height: 15px; }
  .col-divider::after { inset: 0 -10px; }
  .hl-row .hover { opacity: 1; }
  .row .row-delete { opacity: .55; }
  .hl-text { font-size: 14px; }
  .hl-foot { height: 34px; }
  .hl-foot .where { font-size: 11.5px; }
  .footer { height: 26px; font-size: 11.5px; }
  .menu-item { padding: 10px 12px; font-size: 15px; line-height: 20px; }
  .step { width: 40px; height: 34px; }
  .segmented button { height: 30px; padding: 0 12px; font-size: 13px; }
  .check { font-size: 13.5px; gap: 8px; }
  .check input { width: 20px; height: 20px; }
  input[type="range"] { width: 170px; }
  input[type="color"] { width: 52px; height: 32px; }
  .appearance .line > .what, .colours label { font-size: 13px; }
  .setting { min-height: 40px; }
  .setting > .what, .setting .grow { font-size: 13.5px; }
  .note { font-size: 12.5px; }
  .howto .n { font-size: 12.5px; }
  .howto .t, .howto a { font-size: 14px; }
  .sync-state .repo { font-size: 13px; }
  .sync-state .when { font-size: 12.5px; }
  .theme-card { font-size: 12.5px; }
  input.token { height: 38px; padding: 0 10px; max-width: none; }
  /* Safari on iPhone and iPad zooms the page into any field with smaller text. */
  input, textarea, select, input.token { font-size: 16px !important; }
}

/* The narrowest phones: the icon alone, so the section buttons keep their room. */
@media (max-width: 360px) {
  .brand .name { display: none; }
}

/* A phone on its side: little height, so less of it for the bars. */
@media (pointer: coarse) and (max-height: 500px) {
  .topbar { height: 42px; }
  .section-head { height: 38px; }
  .footer { height: 22px; }
}

@media (hover: none) {
  .hl-row .hover { opacity: 1; }
}
