:root { --bg: #111014; --panel: #1b1a21; --line: #2e2c38; --text: #ece9f1; --dim: #9d98ab; --accent: #ff5c8a; --danger: #ff7a59; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* A quick second tap on a phone is a second tap, not "zoom in" (the founder, November 30,
   2026: Next and the category buttons invite tapping fast). Pinching to zoom still works. */
html { touch-action: manipulation; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); }
h1 { font-size: 1.8rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--dim); }
[hidden] { display: none !important; }

.bar { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; border-bottom: 1px solid var(--line); gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.bar nav { display: flex; gap: .4rem; align-items: center; }
main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 1rem; }
.foot { text-align: center; padding: 1rem; border-top: 1px solid var(--line); }
.fine { color: var(--dim); font-size: .85rem; }
.warn { color: var(--danger); }
.center { text-align: center; max-width: 34rem; margin: 12vh auto 0; }

button, .btn { font: inherit; cursor: pointer; }
.btn, button.ghost { display: inline-block; padding: .55rem 1rem; border-radius: .6rem; border: 1px solid var(--accent); background: var(--accent); color: #1a0710; font-weight: 650; text-decoration: none; }
.btn.big { padding: .8rem 2.2rem; font-size: 1.15rem; }
#btn-next { border-radius: 999px; } /* a pill, on every screen size */
#btn-back { border: 1px solid var(--line); border-radius: 999px; font-weight: 600; } /* its outlined partner, on every screen size */
/* Secondary buttons are plain text: no box. They show a soft background on hover and focus. */
.btn.ghost, button.ghost { background: transparent; color: var(--text); border-color: transparent; font-weight: 500; }
.btn.ghost:hover, button.ghost:hover { background: var(--line); }
.btn.ghost.on { color: var(--accent); }
/* The heart is drawn as an outline, and filled in the accent colour once liked. */
#btn-like .ico { width: 1.45rem; height: 1.45rem; }
#btn-like.on .ico { fill: var(--accent); stroke: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn.danger:hover { background: var(--line); }
.btn:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: .6rem; overflow: hidden; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* A source whose player sits at the top of a tall frame (see "frame" in config/sites.json): its
   frame is as tall as a widescreen picture of this width, plus the player page's own margin,
   and is centred in the black space. Never taller than the space there is. */
.frame-wrap.boxed { container-type: size; } /* so the frame can be sized from this box's own width (cqw) */
.frame-wrap.boxed iframe { inset: 50% 0 auto 0; height: min(100cqh, calc((100cqw - 2 * var(--box-margin, 0px)) * 0.5625 + 2 * var(--box-margin, 0px))); transform: translateY(-50%); }
.under { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-top: .8rem; }
.meta { flex: 1 1 20rem; min-width: 0; }
.meta h2 { overflow-wrap: anywhere; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.partners { flex-basis: 100%; }
.notice { margin: 0; padding: .5rem 1rem; text-align: center; background: var(--panel); border-bottom: 1px solid var(--line); }
/* The same message as a toast: a pill floating at the bottom, used when there is something to undo. */
.notice.toast { position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: .7rem; width: max-content; max-width: calc(100vw - 1.5rem); padding: .5rem .55rem .5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
.notice.toast[hidden] { display: none; }
.notice.toast .chip { margin: 0; }
.creator { color: var(--text); }
/* Theater: while a video is up it fills the window, with one slim bar of controls beneath it.
   The same layout serves full screen, where the whole page (not the player) takes the screen,
   so Back and Next stay within reach. Nothing is ever laid over the player itself. */
body.playing { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.playing .bar { padding: .3rem .8rem; }
body.playing main { max-width: none; padding: 0; min-height: 0; display: flex; flex-direction: column; }
body.playing #screen-player { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.playing .frame-wrap { flex: 1; min-height: 0; aspect-ratio: auto; border-radius: 0; }
body.playing .foot { display: none; }
body.playing .under { margin: 0; padding: .45rem .8rem; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
body.playing .under .meta h2 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.playing .under .meta .fine { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tapping the title or the line under it shows all of both; tapping again shortens them. */
.under .meta { -webkit-tap-highlight-color: transparent; }
.under .meta.can-open { cursor: pointer; } /* only when something is cut off */
/* Desktop: the button out to the source stands out a little from the other plain buttons. */
#btn-open { color: var(--accent); border-color: var(--accent); }
/* Phones: the source's name is the link out to it. */
.src-link, .under .meta.can-open:not(.open) a.src-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.keep { white-space: nowrap; } /* a piece of text that is never split across two lines */
/* While names are cut off they read as plain text, not links; opening the line makes them links. */
.under .meta.can-open:not(.open) a { text-decoration: none; }
body.playing .under .meta.open h2, body.playing .under .meta.open .fine { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
body.playing .under { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .3rem; }
body.playing .under .meta { flex: none; }
.row2 { display: flex; align-items: center; gap: .8rem; }
.row2 .chips { flex: 1; min-width: 0; margin: 0; }
.row2 .actions { flex: none; margin-left: auto; }
/* "Open on <site>" changes width with the site's name. This group is pinned to the right, so anything
   left of that button used to shift with it and Next jumped about (the founder, November 30, 2026).
   Here it goes first: only its own left edge moves, and Back, Next and the rest stay put. On phones
   the button is not in this row at all. */
.row2 .actions #btn-open { order: -1; }
/* One line of tags; the rest are folded away (see fitTags in app.js). No sideways scrolling. */
body.playing .row2 .chips { flex-wrap: nowrap; overflow: hidden; }
body.playing .row2 .chips.open { flex-wrap: wrap; }
body.playing .row2:has(.chips.open) { align-items: flex-end; }
body.playing .under .chip { white-space: nowrap; flex: none; }
.chip.more { border-style: dashed; color: var(--text); }
body.playing .partners:empty { display: none; }
body.playing .offramp { margin: 0; padding: .3rem .8rem; }
body.playing .under .btn.big { padding: .55rem 1.8rem; font-size: 1rem; }
:fullscreen .bar { display: none; } /* in full screen the header goes; the bottom bar stays */
/* ---- Phones --------------------------------------------------------------------------
   What a phone shows at all times: the video, Back, Like, a wide Next, and More.
   Everything else (tags, Share, Open on site, Report) opens from More, in the free space
   under the video, so nothing ever covers the player. Desktop is untouched by these rules. */
.phone-only { display: none !important; }
.ico { width: 1.4rem; height: 1.4rem; display: block; }
/* Desktop: one line under the video. The title and its details sit on the left and shorten
   with "…" if they must; the buttons sit on the right. (Tags used to need a second line.) */
@media (min-width: 821px) and (min-height: 501px), (min-width: 821px) and (pointer: fine) {
  body.playing .under { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; }
  body.playing .under .meta { flex: 1 1 0; min-width: 12rem; display: flex; align-items: baseline; gap: .7rem; }
  body.playing .under .meta h2 { flex: 0 1 auto; min-width: 0; margin: 0; }
  body.playing .under .meta .fine { flex: 1 1 0; min-width: 0; }
  body.playing .under .row2 { flex: none; margin-left: auto; }
  body.playing .under .partners { flex: 1 0 100%; }
  /* Opened: the title and the details each take a full line of their own, as long as they need. */
  body.playing .under .meta.open { flex-wrap: wrap; row-gap: .1rem; }
  body.playing .under .meta.open h2, body.playing .under .meta.open .fine { flex: 1 0 100%; }
}

@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .ico.phone-only, .phone-block.phone-only { display: block !important; }
  .swipe-zone.phone-only { display: flex !important; }
  #btn-more.phone-only, #btn-expand.phone-only { display: grid !important; place-items: center; } /* grid, so the icon sits in the exact middle of its touch area */
  #btn-expand .ico { width: 1.3rem; height: 1.3rem; }
  /* A quiet arrow: up to open the extras, turning to point down while they are open. */
  #btn-more { color: var(--dim); }
  #btn-more .ico { width: 1.3rem; height: 1.3rem; transition: transform .15s; }
  #btn-expand .in, body.immersive #btn-expand .out { display: none; }
  body.immersive #btn-expand .in { display: inline; }

  /* Expanded: everything but the video and one thin strip of buttons is put away, so the
     video gets the whole screen and Next is still under the thumb. Nothing sits on the video. */
  body.immersive.playing .bar, body.immersive.playing .under .meta, body.immersive.playing .swipe-zone,
  body.immersive.playing #likesbar, body.immersive.playing .actions #btn-more { display: none !important; }
  body.immersive.playing #screen-player::before { display: none; }
  body.immersive.playing .frame-wrap, body.immersive.playing .frame-wrap.vertical { flex: 1 1 0; aspect-ratio: auto; height: auto; min-height: 0; }
  body.immersive.playing .under, body.immersive.playing #screen-player.sheet-open .under { flex: none; padding: .2rem .5rem; }
  .bar, body.playing .bar { padding: .1rem .6rem; }
  .bar nav button.ghost { padding: .25rem; }
  .profile svg { width: 1.45rem; height: 1.45rem; }
  .brand { font-size: 1.05rem; }
  .bar nav { gap: .1rem; }
  #summary-text { display: none; }
  #btn-cats .phone-word { display: inline; } /* by id: the rule that hides the word on a computer comes later in this file and would otherwise win here too */
  .summary { max-width: none; padding: .3rem .7rem; border-radius: 999px; position: relative; font-size: .9rem; }
  .summary.filtered::after { content: ""; position: absolute; top: .2rem; right: .15rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }

  /* The video sits in the middle of the screen, not pinned under the header: equal free
     space above it and below its title. Opening More uses up the space above first, so the
     video slides up to make room and is still never covered. */
  body.playing #screen-player::before { content: ""; flex: 1 1 0; min-height: 0; }
  body.playing #screen-player.sheet-open::before { flex: 0 0 0; }
  body.playing .frame-wrap { flex: none; aspect-ratio: 16 / 9; width: 100%; }
  /* Before the first touch: the player's frame is as wide as a widescreen video of this height,
     centred, so the middle of its preview picture fills the tall frame (see setPreviewZoom). */
  /* While zoomed, the frame is also 46px taller at the top and at the bottom than the space it
     sits in. The player's own title strip is 45px tall at every size (measured), so it falls
     just outside the top edge: a title cut off at the left would look like a fault of ours.
     It is back, whole, the moment the frame returns to its real size on the first touch. */
  body.playing .frame-wrap.vertical.zoom iframe { inset: -46px auto auto 50%; height: calc(100% + 92px); width: auto; aspect-ratio: 16 / 9; max-width: none; transform: translateX(-50%); }
  /* Every video takes all the room there is, upright or wide: no gap above it, and the bar hugs
     its content. A wide video used to sit in a 16:9 box with our gray above and below, which is
     what made wide videos look poor on a phone; in the expanded view, where the player had the
     whole height, the same videos looked fine (the founder, November 30, 2026: "We can make our
     non-full screen mode adopt that"). The player fills the space and draws its own picture in it. */
  body.playing .frame-wrap, body.playing .frame-wrap.vertical { aspect-ratio: auto; flex: 1 1 0; min-height: 0; }
  body.playing #screen-player::before { display: none; }
  body.playing #screen-player .under { flex: none; }
  body.playing #screen-player:has(.frame-wrap.vertical) .swipe-zone { flex: none; }
  body.playing #screen-player.sheet-open:has(.frame-wrap.vertical) .sheet { max-height: 40vh; }
  body.playing .under { flex: 1 1 0; min-height: 0; border-top: 0; padding: .45rem .7rem .55rem; gap: .2rem; }
  body.playing #screen-player.sheet-open .under { flex: 1 1 auto; }
  /* With the extras open, the title and credit line are shown in full instead of cut to one line. */
  body.playing #screen-player.sheet-open .under .meta h2,
  body.playing #screen-player.sheet-open .under .meta .fine { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  body.playing .under .meta h2 { font-size: .98rem; }
  .swipe-zone { flex: 1; min-height: 0; flex-direction: column; justify-content: center; touch-action: pan-y; }
  #turn-hint { text-align: center; opacity: .7; margin: .3rem 0; }
  .sheet { flex: 1; min-height: 0; overflow-y: auto; padding-top: .3rem; }
  .sheet .fine { margin: 0 0 .2rem; }
  .sheet .chips { flex-wrap: wrap; margin: 0 0 .6rem; }
  .sheet-actions { display: flex; flex-wrap: wrap; gap: .2rem; margin-left: -.6rem; }
  .row2 { gap: 0; }
  .row2 > #v-tags { display: none; } /* on phones the tags live in More */
  /* The phone bar (layout C, chosen by the founder on his phone, November 28, 2026):
     Back, Next and the heart are three solid shapes that fill the row. Back and Next are a
     matched pair of pills; the heart is a circle under the thumb. The expand button and the
     three dots sit at the top right, beside the title. */
  body.playing .row2 .actions { display: grid; grid-template-columns: 1fr 2fr auto; gap: .5rem; width: 100%; align-items: center; justify-items: center; margin: 0; }
  body.playing .actions #btn-open, body.playing .actions #btn-share, body.playing .actions #btn-report, body.playing .actions #btn-full { display: none; }
  body.playing .under { position: relative; }
  body.playing .under .meta { padding-right: 5.9rem; }
  /* Icons: the same size, the same colour, the same size of touch area. */
  body.playing .actions .btn.ghost { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 999px; color: var(--text); }
  body.playing .actions .btn.ghost .ico { width: 1.45rem; height: 1.45rem; }
  body.playing .actions #btn-back { grid-column: 1; grid-row: 1; justify-self: stretch; width: 100%; height: auto; padding: .62rem 1rem; border: 1px solid var(--line); font-size: 1.05rem; font-weight: 600; }
  body.playing .actions #btn-back .ico { display: none !important; }
  body.playing .actions #btn-back:disabled { opacity: .4; }
  body.playing .actions #btn-next { grid-column: 2; grid-row: 1; width: 100%; padding: .62rem 1rem; font-size: 1.05rem; text-align: center; }
  /* The heart is just the heart: no circle round it, and nothing lights up behind it when tapped. */
  body.playing .actions #btn-like { grid-column: 3; grid-row: 1; width: 2.95rem; height: 2.95rem; border: 0; background: transparent !important; -webkit-tap-highlight-color: transparent; }
  body.playing .actions #btn-like .ico { width: 1.8rem; height: 1.8rem; }
  body.playing .actions #btn-expand { position: absolute; top: .25rem; right: 2.95rem; }
  body.playing .actions #btn-more { position: absolute; top: .25rem; right: .35rem; color: var(--text); }
  /* Expanded: the title row is put away, so the expand button joins the row as a fourth shape. */
  body.immersive.playing .row2 .actions { grid-template-columns: 1fr 2fr auto auto; }
  body.immersive.playing .actions #btn-expand { position: static; grid-column: 4; grid-row: 1; }
  body.immersive.playing .actions #btn-back, body.immersive.playing .actions #btn-next { padding: .5rem 1rem; font-size: 1rem; }

  body.playing .partners { display: none; }
}
/* A phone on its side: the video takes the screen, with one thin strip of buttons. Only for
   touch screens: a desktop window that happens to be short keeps the desktop layout. */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  body.playing .bar { display: none; }
  body.playing #screen-player::before { display: none; }
  body.playing .under, body.playing #screen-player.sheet-open .under { flex: none; }
  body.playing .frame-wrap, body.playing .frame-wrap.vertical { flex: 1; aspect-ratio: auto; height: auto; min-height: 0; }
  body.playing .under { flex: none; padding: .2rem .6rem; }
  body.playing .under .meta, #turn-hint { display: none; }
  .swipe-zone { flex: none; }
  .sheet { max-height: 45vh; }
  body.playing .row2 .actions, body.immersive.playing .row2 .actions { grid-template-columns: 1fr 2fr auto auto auto; }
  body.playing .actions #btn-back, body.playing .actions #btn-next { padding: .35rem 1rem; }
  body.playing .actions #btn-like, body.playing .actions #btn-expand, body.playing .actions #btn-more { position: static; width: 2.3rem; height: 2.3rem; }
  body.playing .actions #btn-expand { grid-column: 4; grid-row: 1; }
  body.playing .actions #btn-more { grid-column: 5; grid-row: 1; }
  #sheet { right: .6rem; bottom: 3.2rem; }
}
/* Phones: the three dots open a small menu inside the bar, anchored beside them. */
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .swipe-zone { flex: none; }
  #sheet { position: absolute; right: 3.1rem; bottom: .3rem; z-index: 6; min-width: 11.5rem; max-height: none; overflow: visible; flex: none;
           background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: .25rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
  .sheet-actions { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 0; }
  .sheet-actions .btn { display: block; width: 100%; text-align: left; padding: .42rem .8rem; border-radius: .5rem; font-size: 1rem; }
}
.profile { position: relative; }
.profile > button { display: flex; align-items: center; padding: .2rem; border-radius: 999px; }
.profile svg { width: 1.6rem; height: 1.6rem; display: block; }
.menu { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 5; min-width: 13rem; background: var(--panel); border: 1px solid var(--line); border-radius: .6rem; padding: .3rem; display: flex; flex-direction: column; }
.menu a, .menu button { text-align: left; padding: .55rem .7rem; border: 0; border-radius: .4rem; background: transparent; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--line); }
/* My likes. The heading and count, then search, then the two ways to play them; below that
   a tight grid of thumbnails with the title under each and a pink heart to un-like. */
.likes-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .7rem 1rem; margin-bottom: 1rem; }
.likes-head h1 { font-size: 1.5rem; margin: 0; grid-column: 1; }
#likes-count { grid-column: 2; grid-row: 1; justify-self: end; }
.search { grid-column: 1 / -1; width: 100%; padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.search::placeholder { color: var(--dim); }
.likes-play { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.likes-play .btn { border-radius: 999px; padding: .62rem 1rem; text-align: center; font-weight: 600; }
.likes-play .btn.ghost { border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem .8rem; }
.card { position: relative; }
.card a { display: block; color: var(--text); text-decoration: none; }
.card .thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: .6rem; }
.card .thumb.blank { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: .8rem; background: var(--panel); }
/* Two lines of title at most, cut cleanly: no sliver of a third line. */
.card .t { margin: .4rem .15rem 0; font-size: .85rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .rm { position: absolute; top: .35rem; right: .35rem; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: var(--accent); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.card .rm .ico { width: 1.15rem; height: 1.15rem; fill: var(--accent); stroke: var(--accent); }
.likes-note { margin: 1.4rem 0 0; text-align: center; }
@media (min-width: 821px) {
  .likes-head { grid-template-columns: auto auto 1fr auto; }
  .likes-head h1 { grid-column: 1; }
  #likes-count { grid-column: 2; justify-self: start; }
  .search { grid-column: 3; grid-row: 1; justify-self: end; max-width: 20rem; }
  .likes-play { grid-column: 4; grid-row: 1; grid-template-columns: auto auto; }
}
@media (max-width: 820px) {
  /* Phones: two thumbnails across, so a screen shows eight or so and not one and a half. */
  .grid { grid-template-columns: 1fr 1fr; gap: .9rem .6rem; }
}
.card.gone { opacity: .55; }
.summary { max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary .phone-word { display: none; }
.offramp { margin: .6rem 0 0; display: flex; gap: .5rem; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.chip { padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: .85rem; }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.off { border-color: var(--danger); color: var(--danger); text-decoration: line-through; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: .8rem; padding: 1.2rem; width: min(40rem, 92vw); max-height: 88vh; overflow: auto; }
/* A dialog sits in the middle of the screen, wherever the page is scrolled to. It used to be
   "position: relative", which put it in the page's own flow: opened from the bottom of a long
   page (Settings, "Forget what I've seen") it appeared up at the top (the founder, November 30,
   2026). Fixed keeps it on the screen, and is still what the close button is placed against. */
dialog { position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog .x { position: sticky; float: right; top: 0; margin: -.4rem -.4rem 0 .5rem; border: 0; background: transparent; color: var(--dim); font-size: 1.2rem; line-height: 1; padding: .3rem .5rem; border-radius: .4rem; }
dialog .x:hover { color: var(--text); background: var(--line); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog label { display: block; margin: .45rem 0; }
fieldset { border: 1px solid var(--line); border-radius: .5rem; margin: 0 0 .6rem; }
legend { color: var(--dim); font-size: .85rem; padding: 0 .3rem; }
textarea, select, input[type="text"], input[type="email"], input[type="password"] { font: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: .4rem; padding: .4rem; }
textarea, input[type="text"], input[type="email"], input[type="password"] { display: block; width: 100%; margin-top: .25rem; }
.list { padding-left: 1.1rem; margin: .4rem 0; }
.list li { margin: .3rem 0; overflow-wrap: anywhere; }

.doc { max-width: 44rem; margin: 0 auto; padding: 1rem; }
.doc h2 { margin-top: 1.6rem; font-size: 1.2rem; }
.doc li { margin: .35rem 0; }
.doc .box { background: var(--panel); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin: 1rem 0; }

/* Settings: one page of short cards. A heading, the controls, at most one line of help. */
#screen-settings { max-width: 40rem; margin: 0 auto; width: 100%; }
/* A plain back arrow, then the heading, on one line. The arrow's left edge lines up with the cards'. */
.set-head { display: flex; align-items: center; gap: .35rem; margin-bottom: 1rem; }
.set-head h1 { font-size: 1.5rem; margin: 0; }
.set-head .btn { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; margin-left: -.55rem; border: 0; border-radius: 999px; color: var(--text); }
.set-head .btn .ico { width: 1.5rem; height: 1.5rem; }
.set-card { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem 1.1rem; margin-bottom: .8rem; }
.set-card h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.set-card h3 { margin: .8rem 0 .35rem; }
.set-card > .fine { margin: -.3rem 0 .7rem; }
.set-card .list { margin: .8rem 0 0; padding: 0; list-style: none; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.set-row + .set-row { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .7rem; }
.set-pair { display: flex; align-items: center; gap: .5rem; }
.set-card select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem; }
.btn.line { border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; }
.set-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.set-buttons .btn { text-align: center; }
.set-card .warn { margin: .8rem 0 0; }
@media (max-width: 480px) { .set-buttons { grid-template-columns: 1fr; } }
.set-card > .set-after { margin: .6rem 0 0; }
/* Accounts. The menu shows who is signed in on a quiet first line. */
.menu .fine { margin: 0; padding: .45rem .7rem .35rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--line); }
/* The sign-in panel is narrower than the others: two fields and a button. */
#dlg-account, #dlg-ask { width: min(26rem, 92vw); }
#dlg-account input[type="email"], #dlg-account input[type="password"] { padding: .55rem .6rem; }
.acct-links { margin: 0 0 0 -1rem; }
.acct-links .btn { color: var(--dim); font-size: .9rem; }
#acct-bot:not(:empty) { margin: .6rem 0; }
/* A long email address in Settings wraps inside its row and never pushes the button out. */
.set-long { min-width: 0; overflow-wrap: anywhere; }
/* History has one button where My likes has two. */
.likes-play.one { grid-template-columns: 1fr; }
#screen-history .warn { margin: 0 0 1rem; }
.card .when { margin: .1rem .15rem 0; font-size: .75rem; color: var(--dim); }
@media (min-width: 821px) { .likes-play.one { grid-template-columns: auto; } }
/* The way to Settings from the categories panel is a quiet line, not an offer. */
#cats-more { color: var(--dim); }

/* Development only: the marker shown while a not-yet-open source is being previewed. */
.preview-pill { position: fixed; left: .6rem; top: 3.4rem; z-index: 50; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--accent); background: var(--bg); color: var(--accent); font: 600 .78rem system-ui, sans-serif; cursor: pointer; }
