/* css/style.css - the look of the page: fonts, colours (light and night mode), buttons, panels, tiles, windows. */
  /* ============ FONT: Helvetica Neue Regular ============
     Macs and iPhones have it. On other computers the page uses the font file in the folder  fonts/  if it is there
     (name it HelveticaNeue-Regular.woff2), otherwise Helvetica or Arial. */
  @font-face { font-family: "Helvetica Neue"; font-weight: 400; font-style: normal; font-display: swap;
    src: local("Helvetica Neue"), local("HelveticaNeue"), local("Helvetica Neue Regular"), local("HelveticaNeue-Regular"),
         url("fonts/HelveticaNeue-Regular.woff2") format("woff2"), url("fonts/HelveticaNeue-Regular.woff") format("woff"); }

  /* ============ SETTINGS: change these values to adjust the look ============ */
  :root {
    --font: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;
    --gap: 4px;            /* space between the media tiles */
    --veil-opacity: 0.6;   /* milky layer on hover: 0 = invisible, 1 = fully covered */
    --veil-blur: 8px;      /* blur of the milky layer (0px = no blur) */
    --dot: #FF232D;        /* colour of the cursor dot (and of the scrollbars: --sb below) */
    --dot-size: 8px;       /* size of the cursor dot */
    --sp-radius: 12px;     /* round corners of the scenario control panels (0px = square) */
  }

  /* Colours: light mode (black buttons, white panels) and night mode (white buttons, black panels).
     The item viewer on the right always uses the opposite colours. */
  :root { color-scheme: light;
    --bg: #ffffff; --fg: #000000; --ui-bg: #000000; --ui-fg: #ffffff; --panel-bg: #ffffff; --panel-fg: #000000; --panel-edge: transparent;
    --tile: #efefef; --tile-text: #4a4a4a; --text2: #555555; --muted: #777777; --line: #d6d6d6; --line2: #b5b5b5;
    --v-bg: #000000; --v-fg: #ffffff; --danger: #d0002a; --veil-rgb: 255,255,255; --sb: #FF232D; --sb-hover: #c8001a; }
  :root[data-theme="dark"] { color-scheme: dark;
    --bg: #000000; --fg: #ffffff; --ui-bg: #ffffff; --ui-fg: #000000; --panel-bg: #000000; --panel-fg: #ffffff; --panel-edge: transparent;
    --tile: #1b1b1b; --tile-text: #b4b4b4; --text2: #bdbdbd; --muted: #8c8c8c; --line: #333333; --line2: #555555;
    --v-bg: #ffffff; --v-fg: #000000; --danger: #ff4d6d; --veil-rgb: 0,0,0; --sb: #FF232D; --sb-hover: #ff6b72; }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  *, *::before, *::after { font-weight: 400 !important; }      /* Regular only, nothing bold */
  html, body { height: 100%; overflow: hidden; }
  body { font-family: var(--font); background: var(--bg); color: var(--fg); font-size: 12px; }
  button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
  a { color: inherit; }
  [hidden] { display: none !important; }
  /* every functional button and label is written in small letters */
  button, .btn, .ui, .kw, .mt, .kadd, .linkbtn, select, .fld > span, legend { text-transform: lowercase; }

  /* Rectangular buttons: black on white (light mode), white on black (night mode) */
  .ui { display: inline-block; padding: 2px 10px; border: 0; border-radius: 0; background: var(--ui-bg); color: var(--ui-fg);
    font-size: 12px; line-height: 16px; white-space: nowrap; text-decoration: none; cursor: pointer; }
  .ui:focus-visible { outline: 1px solid var(--ui-bg); outline-offset: 2px; }
  .ui.on, .ui.ghost { background: var(--ui-fg); color: var(--ui-bg); box-shadow: inset 0 0 0 1px var(--ui-bg); }

  /* Search (top left) and its filter panel */
  #search-wrap { position: fixed; top: 20px; left: 20px; z-index: 60; width: min(430px, calc(100vw - 110px)); transition: width .25s ease; }
  #search-measure { position: fixed; left: -9999px; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
  #search { text-overflow: clip; display: block; width: 100%; height: 20px; padding: 0 10px; border: 0; border-radius: 0; background: var(--ui-bg);
    color: var(--ui-fg); font-size: 12px; outline: none; }
  #search::placeholder { color: var(--ui-fg); opacity: .9; }
  #kw-panel { padding: 10px 8px 12px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 1px var(--panel-edge);
    max-height: calc(100vh - 100px); overflow: auto; }
  #kw-status { margin: 0 0 10px; font-size: 12px; line-height: 1.4; }
  #kw-types { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 18px; }
  .mt { padding: 1px 4px; border: 0; border-radius: 0; background: var(--ui-bg); color: var(--ui-fg); font-size: 12px; line-height: 15px; cursor: pointer; }
  .mt.on { background: var(--ui-fg); color: var(--ui-bg); box-shadow: inset 0 0 0 1px var(--ui-bg); }
  #kw-chips, #up-kw, #i-tags, .kwline { display: flex; flex-wrap: wrap; gap: 7px 9px; }
  .kw { padding: 1px 11px; border: 0; border-radius: 0; background: var(--c); color: #000; font-size: 12px; line-height: 15px; cursor: pointer; }
  .kw.on { background: #000; color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
  .kw:focus-visible, .mt:focus-visible { outline: 1px solid var(--panel-fg); outline-offset: 2px; }
  #kw-desc { margin-top: 16px; font-size: 12px; line-height: 1.3; }
  #kw-desc:empty { display: none; }
  .linkbtn { margin-top: 12px; padding: 0; border: 0; background: none; text-decoration: underline; cursor: pointer; font-size: 12px; }
  #status { display: none; gap: 6px; margin-top: 6px; width: max-content; }
  body.searching:not(.kw-open) #status { display: flex; }
  #count { padding: 2px 8px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 1px var(--panel-edge); }

  /* Info (top right) with the windows repository, scope and upload */
  #topright { position: fixed; top: 20px; right: 20px; z-index: 70; display: flex; gap: 6px; }
  #menu { display: flex; gap: 6px; }
  .win { position: fixed; top: 46px; right: 20px; z-index: 69; width: min(406px, calc(100vw - 40px)); max-height: calc(100vh - 96px); overflow: auto;
    padding: 8px 10px 14px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 1px var(--panel-edge); font-size: 12px; line-height: 1.3; }
  .win p + p { margin-top: 14px; }
  .win p.gap { margin-top: 40px; }
  .win-big { width: min(640px, calc(100vw - 40px)); padding: 12px 16px 18px; }

  #bl { position: fixed; left: 20px; bottom: 20px; z-index: 70; display: flex; gap: 6px; }   /* night mode and full / lite mode (in the repository; on the start page they stand top left) */
  #z-level { position: fixed; right: 20px; bottom: 20px; z-index: 70; }
  body[data-view="item"] :is(#search-wrap, #topright, .win, #z-level, #demo-note) { display: none !important; }

  /* Repository: grid / collage inside a zoomable world */
  #stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  #stage.dragging { cursor: grabbing; }
  #world { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; --z: 1; }
  #world.anim { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
  .item { position: absolute; overflow: hidden; background: var(--tile); cursor: pointer; outline: none; transform-origin: 0 0;
    transition: transform .9s cubic-bezier(.2,.7,.2,1), opacity .35s ease, filter .35s ease; }   /* moving: only the transform glides (js/tiles.js put) */
  .item { contain: layout paint style; content-visibility: auto; }       /* a tile outside the screen (zoomed in) is skipped: no styling, layout or painting until it comes near */                                  /* every tile is drawn on its own: moving one does not redraw the others */
  .item.hidden { opacity: 0; pointer-events: none; visibility: hidden;
    transition: transform .9s cubic-bezier(.2,.7,.2,1), opacity .35s ease, filter .35s ease, visibility 0s linear .35s; }   /* gone after fading out: not drawn any more */
  .item:focus-visible { box-shadow: inset 0 0 0 2px var(--fg); }
  .vis { position: absolute; inset: 0; pointer-events: none; }
  .vis img, .vis video, .rbox img, .rbox video { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }   /* fills the whole tile, no empty space */
  .v { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--tile-text); background: var(--tile); }
  .v.dark { background: #2b2b2b; color: #fff; }
  .wvbox canvas, .wvbox svg { width: 100%; height: 100%; display: block; }
  .rbox .wvbox { color: var(--tile-text); padding: 12px 6px; }   /* audio tile: the moving waveform line */
  :root[data-theme="dark"] .v[style] { filter: brightness(.6); }
  .txt { width: 100%; height: 100%; padding: 8px; font-size: 11px; line-height: 1.35; color: var(--tile-text); background: var(--tile); overflow: hidden; }
  .play { position: absolute; left: 50%; top: 50%; width: 2.2rem; height: 2.2rem; margin: -1.1rem 0 0 -1.1rem; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; display: flex; align-items: center; justify-content: center; padding-left: 2px; pointer-events: none; }
  .item::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .25s;
    background: rgba(var(--veil-rgb), var(--veil-opacity)); }
  .item:hover::after, .item:focus-visible::after { opacity: 1; -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur)); }   /* the blur only exists on the tile you point at: not one blur layer per tile */
  #stage.dragging .item::after, #stage.dragging .item .t { opacity: 0 !important; }
  .t { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: calc(.55rem / var(--z)) calc(.65rem / var(--z));
    color: var(--fg); opacity: 0; transition: opacity .25s; pointer-events: none; }
  .t b, .t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .t b { font-size: calc(12px / var(--z)); font-weight: 700; }
  .t span { font-size: calc(11px / var(--z)); color: var(--text2); text-transform: lowercase; }
  .item:hover .t, .item:focus-visible .t { opacity: 1; }
  .snip { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; display: none; max-height: 52%; overflow: hidden; padding: 4px 6px;
    background: var(--panel-bg); color: var(--panel-fg); font-size: calc(11px / var(--z)); line-height: 1.4; pointer-events: none; }
  .item.has-snip.snip-on .snip { display: block; }
  .item:hover .snip, .item:focus-visible .snip { opacity: 0; }
  mark { background: var(--fg); color: var(--bg); padding: 0 1px; }
  .viewer mark { background: var(--v-fg); color: var(--v-bg); }
  .txt mark.ex { background: var(--dot); color: #fff; }                    /* scenario: a word written exactly like the search word */
  #empty { position: fixed; left: 0; right: 0; top: 50%; text-align: center; color: var(--muted); }
  #demo-note { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; max-width: min(520px, 60vw); padding: 2px 8px;
    font-size: 11px; line-height: 1.4; background: var(--panel-bg); color: var(--danger); }

  /* Item view: details over the repository on the left, the medium on the right */
  #view-item { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
  #view-item .side, #view-item .viewer { pointer-events: auto; }
  .side { position: absolute; top: 20px; left: 20px; width: min(430px, calc(50vw - 40px)); max-height: calc(100vh - 70px); overflow: auto;
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
  #back-btn span + span { margin-left: 6px; }
  .ipanel { width: 100%; padding: 8px 10px 10px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 1px var(--panel-edge); line-height: 1.3; }
  .ipanel h1 { font-size: 12px; font-weight: 700; }
  #i-sub { margin-top: 12px; font-weight: 700; }
  #i-sub:empty { display: none; }
  #i-desc { margin-top: 12px; white-space: pre-wrap; line-height: 1.4; }
  #i-desc:empty { display: none; }
  #i-ai { margin-top: 10px; font-size: 11px; line-height: 1.4; color: var(--muted); }
  #i-ai:empty { display: none; }
  #i-meta { margin-top: 14px; }
  #i-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 14px; }
  .sharebtn { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font-size: 12px; }
  #i-links:empty { display: none; }
  #i-tags { padding: 10px 8px; }
  #i-tags .mt { min-width: 60px; cursor: default; }
  .ilabel { margin-bottom: 12px; font-weight: 700; }
  .rel3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 6px 4px; }
  .rbox { position: relative; display: block; aspect-ratio: 7 / 8; overflow: hidden; background: var(--ui-bg); text-decoration: none; }
  .rbox .txt { font-size: 8px; }
  .rbox:focus-visible, .rbox:hover { outline: 1px solid var(--panel-fg); outline-offset: 2px; }
  #manage { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  #del-form { width: 100%; }
  #edit-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
  .iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 0;
    background: transparent; color: var(--muted); cursor: pointer; }
  .iconbtn:hover, .iconbtn:focus-visible { color: var(--danger); outline: none; }
  #del-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  #del-form input { flex: 1; min-width: 120px; padding: 2px 6px; border: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--panel-fg); }
  #del-status { margin-top: 4px; color: var(--danger); }
  #del-status:empty { display: none; }
  .viewer { position: absolute; top: 0; right: 0; bottom: 0; width: 50%; overflow: auto; background: var(--v-bg); color: var(--v-fg); }
  .vtext { padding: 18px 22px 48px; font-size: 13px; line-height: 1.42; white-space: pre-wrap; text-align: justify; hyphens: auto; }
  .vdesc { border-top: 1px solid currentColor; }
  .vmedia { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
  .vmedia img, .vmedia video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
  .vmedia.vfill { padding: 0; }                                  /* a video fills the frame up to its edges: wide videos touch left and right, tall videos touch top and bottom */
  .vmedia.vfill video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; pointer-events: none; }
  .vmedia .v { width: 100%; height: 100%; }
  .vmedia audio { width: 90%; }
  .vaudio { position: relative; height: 100%; color: var(--v-fg); cursor: pointer; outline: none; }      /* audio: a moving waveform line instead of the music bar */
  .vaudio canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .vaudio audio { display: none; }
  .aud-st { position: absolute; left: 20px; bottom: 20px; font-size: 12px; text-transform: lowercase; opacity: .7; }
  .vaudio:hover .aud-st, .vaudio:focus-visible .aud-st { opacity: 1; text-decoration: underline; }
  .vpdf { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
  #reg-jump { position: absolute; right: 20px; bottom: 20px; z-index: 2; padding: 2px 10px; border: 0; border-radius: 0; background: var(--v-fg); color: var(--v-bg);
    font-size: 12px; line-height: 16px; cursor: pointer; pointer-events: auto; }
  @media (max-width: 800px) {
    .side { width: calc(100vw - 40px); max-height: 46vh; }
    .viewer { width: 100%; top: 50%; }
  }

  /* Upload window (same structure as before, square corners) */
  .lead { margin: 12px 0 14px; color: var(--muted); line-height: 1.5; }
  .tabs { display: inline-flex; box-shadow: inset 0 0 0 1px var(--panel-fg); }
  .tabs button { padding: 2px 12px; border: 0; background: transparent; cursor: pointer; }
  .tabs button.on { background: var(--panel-fg); color: var(--panel-bg); }
  .drop { display: block; padding: 22px 10px; border: 1px dashed var(--line2); text-align: center; color: var(--text2); cursor: pointer; }
  .drop:hover, .drop.over { border-color: var(--panel-fg); }
  .drop input { display: none; }
  .drop small { display: block; margin-top: 4px; color: var(--muted); }
  .flist { list-style: none; margin: 8px 0 12px; }
  .flist li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
  .flist button { border: 0; background: none; cursor: pointer; font-size: 1rem; }
  .th { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--line); font-size: 10px; }
  .th img { width: 100%; height: 100%; object-fit: cover; }
  .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fs { color: var(--muted); }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
  .full { grid-column: 1 / -1; }
  .fld > span, fieldset > legend { display: block; margin-bottom: 4px; padding: 0; font-weight: 700; }
  fieldset { border: 0; }
  .fld input, .fld select, .fld textarea, .kwform input, .kwform textarea { width: 100%; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 0;
    background: transparent; color: var(--panel-fg); font-size: 12px; }
  .fld select option { color: #000; }
  .fld input:focus, .fld select:focus, .fld textarea:focus, .kwform input:focus, .kwform textarea:focus { outline: none; border-color: var(--panel-fg); }
  .radio { display: inline-flex; align-items: center; gap: 6px; margin: 4px 16px 0 0; }
  .kwrap { display: inline-flex; align-items: stretch; }
  .kdel { display: inline-flex; align-items: center; justify-content: center; width: 20px; padding: 0; border: 0; border-radius: 0;
    background: var(--ui-bg); color: var(--ui-fg); cursor: pointer; }
  .kdel:hover, .kdel:focus-visible { background: var(--danger); color: #fff; outline: none; }
  .kadd { padding: 1px 10px; border: 1px dashed var(--panel-fg); border-radius: 0; background: transparent; cursor: pointer; }
  #up-kw-desc { margin: 8px 0; color: var(--muted); line-height: 1.4; }
  .kwform { margin: 8px 0; padding: 10px; border: 1px solid var(--line2); }
  .kwform p { margin-bottom: 8px; color: var(--text2); line-height: 1.4; }
  .kwform input, .kwform textarea { margin-bottom: 8px; }
  .kwform .row, .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .btn { display: inline-block; padding: 3px 12px; border: 0; border-radius: 0; background: var(--ui-bg); color: var(--ui-fg); cursor: pointer; text-decoration: none; line-height: 16px; }
  .btn.ghost { background: transparent; color: var(--panel-fg); box-shadow: inset 0 0 0 1px var(--panel-fg); }
  .btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
  .btn:disabled { opacity: .4; cursor: not-allowed; }
  #kw-msg, #upload-status, #bulk-status { margin-top: 8px; line-height: 1.5; }
  #kw-msg.err, #upload-status.err, #bulk-status.err { color: var(--danger); }
  .infobox { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line2); color: var(--text2); line-height: 1.5; }
  .infobox h3 { margin: 4px 0; color: var(--panel-fg); font-size: 12px; }
  .infobox ul { margin: 0 0 8px 16px; }
  .ptable-wrap { overflow: auto; max-height: 240px; margin: 10px 0; border: 1px solid var(--line2); }
  .ptable { width: 100%; border-collapse: collapse; font-size: 11px; }
  .ptable th, .ptable td { padding: 4px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
  .ptable th { position: sticky; top: 0; background: var(--panel-bg); color: var(--muted); }
  .ptable tr.bad td { background: color-mix(in srgb, var(--danger) 14%, transparent); }
  .perrors { margin: 8px 0 10px 16px; color: var(--danger); line-height: 1.5; }
  .muted { color: var(--muted); }
  h3 { font-size: 12px; }

  /* Cursor: a red dot instead of the arrow (only with a mouse; bigger over things you can click) */
  html.has-dot, html.has-dot * { cursor: none !important; }
  #dot { position: fixed; left: 0; top: 0; z-index: 10000; width: 0; height: 0; pointer-events: none; }
  #dot::after { content: ""; position: absolute; left: calc(var(--dot-size) / -2); top: calc(var(--dot-size) / -2); width: var(--dot-size); height: var(--dot-size);
    border-radius: 50%; background: var(--dot); opacity: 0; transform: scale(var(--ds, 1)); transition: transform .15s ease, opacity .2s ease; }
  #dot.on::after { opacity: 1; }
  /* Message on the repository after an upload */
  #toast { position: fixed; left: 50%; bottom: 20px; z-index: 75; transform: translateX(-50%); max-width: min(560px, calc(100vw - 260px)); padding: 3px 10px;
    background: var(--ui-bg); color: var(--ui-fg); line-height: 1.4; }
  #toast a { color: inherit; }

  /* Welcome screen: the GIF covers the page but lies below the search field and the info button (they stay on top).
     Night mode and the zoom percentage dissolve while it is shown. The red dot is always on top. */
  #welcome { position: fixed; inset: 0; z-index: 58; overflow: hidden; background: var(--bg); cursor: pointer; opacity: 1; outline: none; }
  #welcome.off { opacity: 0; pointer-events: none; }
  #welcome img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; pointer-events: none; }
  #bl, #z-level { transition: opacity var(--splash-t, .8s) ease-in-out; }
  body.splash-on #bl, body.splash-on #z-level { opacity: 0; pointer-events: none; }

  /* Similar search (appears when nothing is found) */
  #tr-note { margin: 0 0 12px; font-size: 11px; line-height: 1.4; color: var(--muted); }
  #sim-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; }
  #sim-toggle { padding: 1px 10px; }
  #sim-tune { display: flex; align-items: center; gap: 8px; }
  #sim-range { width: 140px; accent-color: var(--panel-fg); }
  #sim-note { width: 100%; font-size: 11px; line-height: 1.4; color: var(--muted); }
  #ai-state { line-height: 1.5; }
  #ai-msg { margin-top: 8px; line-height: 1.5; }
  #ai-msg.err { color: var(--danger); }

  /* Regulation documents (upload tab "regulation") */
  .reg-list { list-style: none; max-height: 360px; overflow: auto; margin: 6px 0 12px; padding: 4px 10px; border: 1px solid var(--line2); }
  .reg-sec { margin: 12px 0 4px; font-weight: 700; }
  .reg-law { margin: 8px 0 2px; color: var(--muted); }
  .reg-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .reg-row.off { opacity: .45; }
  .reg-row label { cursor: pointer; }
  .reg-snip { margin: 3px 0 5px 20px; color: var(--text2); font-size: 11px; line-height: 1.4; }
  .reg-kws, .reg-pal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-left: 20px; }
  .reg-pal { margin-top: 6px; }
  .reg-kws .linkbtn { margin: 0 0 0 4px; }
  .kw.mini { padding: 0 6px; font-size: 10px; cursor: default; }
  .hint { margin: 12px 0 4px; color: var(--muted); }
  #reg-editor { margin-top: 12px; }
  #reg-text { display: block; width: 100%; min-height: 240px; margin-top: 8px; padding: 8px; border: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--panel-fg);
    font: inherit; font-size: 12px; line-height: 1.45; resize: vertical; white-space: pre-wrap; }
  #reg-text:focus { outline: none; border-color: var(--panel-fg); }
  #reg-lost { color: var(--danger); line-height: 1.5; margin-bottom: 8px; }
  .reg-docs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 6px 0 14px; }
  .reg-doc { padding: 8px 10px; background: var(--tile); color: var(--panel-fg); line-height: 1.4; }
  .reg-doc b { display: block; }
  .reg-doc .actions { margin-top: 8px; }
  .reg-doc.editing { box-shadow: inset 0 0 0 1px var(--panel-fg); }
  .reg-delform { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .reg-delform input { flex: 1; min-width: 100px; padding: 2px 6px; border: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--panel-fg); }
  #reg-status { margin-top: 8px; line-height: 1.5; }
  #reg-status.err { color: var(--danger); }
  .viewer mark.reg mark { background: transparent; color: inherit; text-decoration: underline; }

  /* Slim scrollbars in the colours of the page (text areas only show theirs on hover) */
  * { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; }
  .txt, textarea, #kw-panel, .ptable-wrap { scrollbar-color: transparent transparent; }
  .txt:hover, textarea:hover, textarea:focus, #kw-panel:hover, .ptable-wrap:hover { scrollbar-color: var(--sb) transparent; }
  @supports not (scrollbar-width: thin) {
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
    ::-webkit-scrollbar-thumb { background-color: var(--sb); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }
    ::-webkit-scrollbar-thumb:hover { background-color: var(--sb-hover); }
    .txt::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb, #kw-panel::-webkit-scrollbar-thumb, .ptable-wrap::-webkit-scrollbar-thumb { background-color: transparent; }
    .txt:hover::-webkit-scrollbar-thumb, textarea:hover::-webkit-scrollbar-thumb, #kw-panel:hover::-webkit-scrollbar-thumb, .ptable-wrap:hover::-webkit-scrollbar-thumb { background-color: var(--sb); }
  }
  textarea { resize: vertical; }
  @media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } #kw-types { grid-template-columns: repeat(3, 1fr); } }
  @media (prefers-reduced-motion: reduce) { .item, #world.anim { transition: none !important; } }

  /* Phones: the same page, arranged for a small screen */
  html { -webkit-text-size-adjust: 100%; }
  button, a, label, .item { -webkit-tap-highlight-color: transparent; }
  @media (max-width: 600px) {
    #search-wrap { top: 12px; left: 12px; width: calc(100vw - 84px); }
    #topright { top: 12px; right: 12px; flex-direction: column; align-items: flex-end; }
    #menu { order: 2; flex-direction: column; align-items: flex-end; }
    .win, .win-big { top: 112px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 160px); }
    #bl { left: 12px; bottom: 12px; }
    #z-level { right: 12px; bottom: 12px; }
    #toast, #demo-note { bottom: 42px; max-width: calc(100vw - 24px); }
    #kw-panel { max-height: calc(100dvh - 90px); }
    .side { top: 12px; left: 12px; width: calc(100vw - 24px); max-height: 44dvh; }
    .viewer { width: 100%; top: 48dvh; }
    .vtext { padding: 14px 14px 60px; font-size: 12px; }
    .vmedia { padding: 12px; }
    #reg-jump { right: 12px; bottom: 12px; }
    .rel3 { gap: 8px; padding: 0; }
    body[data-view="item"] #bl { display: none; }
    .reg-docs { grid-template-columns: 1fr; }
  }

  /* ============ Scenario page (the start page): the wall, the controls like a synthesizer, the seed ============
     --fade (set from SCENARIO_FADE in settings.js) = how visible the media are that the controls leave out */
  body[data-mode="scenario"] :is(#search-wrap, #z-level) { display: none !important; }
  body[data-mode="repository"] :is(#synth, #tl), body[data-view="item"] :is(#synth, #tl) { display: none !important; }
  body[data-mode="scenario"] :is(#toast, #demo-note) { top: 20px; bottom: auto; }
  #tl { position: fixed; top: 20px; left: 20px; z-index: 70; display: flex; gap: 6px; transition: opacity var(--splash-t, .8s) ease-in-out; }
  #tl #theme-btn { position: static; }
  .item.dim { opacity: var(--fade, .1); filter: grayscale(1); }
  .item.enter { transition: opacity .5s ease !important; }
  /* without gaps, neighbouring text, audio and pdf tiles get slightly different greys so each stays its own tile */
  body[data-mode="scenario"] .item[data-mk="audio"] { --tile: #e3e3e3; }
  body[data-mode="scenario"] .item[data-mk="pdf"] { --tile: #f6f6f6; }
  :root[data-theme="dark"] body[data-mode="scenario"] .item[data-mk="audio"] { --tile: #272727; }
  :root[data-theme="dark"] body[data-mode="scenario"] .item[data-mk="pdf"] { --tile: #111111; }           /* scenario: a medium coming into the collage fades in at its place */
  .item.dim:hover, .item.dim:focus-visible { opacity: .85; filter: none; }     /* pointing at a left-out medium shows it */
  .pinb { position: absolute; top: calc(6px / var(--z)); right: calc(6px / var(--z)); z-index: 3; padding: 0 calc(6px / var(--z)); border: 0; border-radius: 0;
    background: var(--ui-bg); color: var(--ui-fg); font-size: calc(11px / var(--z)); line-height: 1.45; cursor: pointer; opacity: 0; transition: opacity .2s; }
  body[data-mode="scenario"] .item:hover .pinb, body[data-mode="scenario"] .item.pinned .pinb:focus-visible { opacity: 1; }
  body[data-mode="repository"] .pinb, #stage.dragging .pinb { display: none; }
  .item.pinned::before { content: ""; position: absolute; top: calc(6px / var(--z)); left: calc(6px / var(--z)); z-index: 3; width: calc(7px / var(--z)); height: calc(7px / var(--z)); background: var(--dot); }

  #synth { position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 60; pointer-events: none; transition: opacity var(--splash-t, .8s) ease-in-out; }
  body.splash-on :is(#synth, #tl) { opacity: 0; pointer-events: none !important; }
  body.splash-on #synth * { pointer-events: none !important; }
  #synth-toggle { display: none; }
  #synth-panels { display: grid; grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 1fr) minmax(200px, 1fr) auto minmax(250px, 290px); grid-template-rows: auto auto;
    gap: 6px; align-items: end; }
  #synth-panels > * { pointer-events: auto; }
  #sp-media { grid-column: 1; grid-row: 2; align-self: stretch; }
  #sp-tone { grid-column: 2; grid-row: 2; align-self: stretch; }
  #sp-year { grid-column: 3; grid-row: 2; align-self: stretch; }
  #sp-count { grid-column: 4; grid-row: 2; align-self: stretch; }
  :is(#sp-tone, #sp-year, #sp-count) { display: flex; flex-direction: column; }
  :is(#sp-tone, #sp-year, #sp-count) > .sp-b { flex: 1; display: flex; flex-direction: column; justify-content: center; }   /* the slider in the middle of the box */
  :is(#sp-tone, #sp-year) .rng { margin-top: 0; }
  #sp-loc { grid-column: 5; grid-row: 2; align-self: stretch; min-width: 150px; }
  .sp-col { grid-column: 6; grid-row: 1 / span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; pointer-events: none; }
  .sp-col > * { pointer-events: auto; }
  .sp { position: relative; min-width: 0; padding: 8px 10px 10px; background: var(--panel-bg); color: var(--panel-fg); box-shadow: 0 0 0 1px var(--panel-edge); line-height: 16px;
    border-radius: var(--sp-radius, 12px); }   /* the control panels have round corners (--sp-radius); buttons and fields stay square */
  .sp header { display: flex; align-items: center; gap: 10px; min-height: 18px; padding-right: 20px; }
  #sp-seed header { padding-right: 0; }
  #sp-seed { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-content: start; }
  #sp-seed > header { display: contents; }
  #sp-seed > .seedrow { grid-column: 2; }                             /* the buttons start where the seed field starts */
  #sp-seed > .sp-note { grid-column: 1 / -1; }
  .sp-l { white-space: nowrap; }
  .sp-v { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
  .sp-v small { font-size: 11px; color: var(--muted); }
  .sw { position: absolute; top: 11px; right: 10px; width: 10px; height: 10px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
  .sw.on { background: radial-gradient(circle, var(--panel-bg) 0 2px, currentColor 2.6px); }   /* on: filled with a small dark centre, the inverse of off */
  .sw:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
  .sp.off :is(.sp-b, .sp-v, .sp-l, input, .sp-all) { opacity: .3; filter: grayscale(1); }   /* switched off: grey, no influence */
  .sp-note { margin-top: 6px; font-size: 11px; line-height: 1.35; color: var(--muted); }
  .sp-note .linkbtn { margin: 0 0 0 4px; font-size: 11px; color: var(--panel-fg); }

  #sc-media { display: grid; grid-template-columns: repeat(2, minmax(56px, 1fr)); gap: 6px 8px; margin-top: 8px; }
  #sc-media .mt { padding: 1px 6px; }
  .mt.off { background: transparent; color: var(--panel-fg); box-shadow: inset 0 0 0 1px var(--line2); }

  .rng { position: relative; height: 26px; margin: 10px 7px 0; cursor: pointer; touch-action: none; }
  .rng .trk { position: absolute; left: -7px; right: -7px; top: 50%; height: 1px; background: currentColor; }
  .rng .h { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; padding: 0; border: 1px solid var(--panel-fg); border-radius: 50%;
    background: var(--panel-fg); cursor: grab; touch-action: none; }   /* a simple dot */
  .rng .h:focus-visible { outline: 1px solid var(--panel-fg); outline-offset: 3px; }
  .cnt { display: flex; align-items: flex-start; gap: 18px; }
  #sp-count > .sp-b.cnt { flex-direction: row; align-items: center; }
  #sp-count .cnt .rng { margin-top: 0; }
  .cnt .rng { flex: 1; }                                               /* same height as the tone line: the knob is centred on the line, not the line on the knob */
  .knob { position: relative; flex: none; width: 46px; height: 46px; margin-top: 0; border: 1px solid currentColor; border-radius: 50%; cursor: grab; touch-action: none; outline: none; }
  .knob i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: currentColor;
    transform: rotate(var(--a, 0deg)) translateY(-15px); }
  .knob.turning, .rng:active .h { cursor: grabbing; }
  .knob:focus-visible { box-shadow: 0 0 0 1px var(--panel-bg), 0 0 0 2px var(--panel-fg); }

  .sp-all { margin-left: auto; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; opacity: .5; }
  .sp-all.on { opacity: 1; }
  #sc-locs { display: flex; flex-direction: column; margin-top: 6px; }
  .lrow { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 1px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; line-height: 16px; }
  .lrow i { flex: none; width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; }
  .lrow.on i { background: currentColor; }
  .lrow:focus-visible { outline: 1px solid currentColor; outline-offset: 1px; }

  #sc-q, #sc-seed { flex: 1; min-width: 0; height: 18px; padding: 0 6px; border: 0; border-radius: 0; background: var(--ui-bg); color: var(--ui-fg); font-size: 12px; outline: none; }
  #sc-q::placeholder { color: var(--ui-fg); opacity: .9; }
  #sc-seed { letter-spacing: .06em; font-variant-numeric: tabular-nums; text-transform: uppercase; }
  .seedrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
  .seedrow .mt { padding: 1px 8px; }
  .sp-pins { margin: 0 12px 0 6px; flex: none; display: inline-flex; align-items: center; font-size: 11px; color: var(--muted); }
  .sp-pins::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: var(--dot); }

  /* Protected media: blurred with a lock until the members password; afterwards a small i sign and a note on the object page */
  img.blurred { filter: blur(3px); transform: scale(1.08); }
  .locked-v { background: var(--tile); }
  .item .rlock { position: absolute; right: calc(5px / var(--z)); bottom: calc(4px / var(--z)); z-index: 3; width: calc(13px / var(--z)); height: calc(13px / var(--z));
    color: var(--dot); pointer-events: none; filter: drop-shadow(0 0 calc(2px / var(--z)) rgba(0,0,0,.6)); }   /* locked: a small red lock in the corner, like the ! */
  .item .rlock svg { display: block; stroke-width: 2.2; }
  .item .rinfo { position: absolute; right: calc(5px / var(--z)); bottom: calc(2px / var(--z)); z-index: 3; color: var(--dot); font-size: calc(14px / var(--z)); line-height: 1;
    text-shadow: 0 0 calc(3px / var(--z)) rgba(0,0,0,.6); pointer-events: none; }   /* protected and unlocked: a small red ! in the corner */
  .item.locked .wvbox { filter: blur(2px); opacity: .6; }
  #i-legal { position: absolute; right: 20px; bottom: 20px; z-index: 2; margin: 0; color: var(--dot); font-size: 10px; line-height: 1.35; letter-spacing: .02em;
    text-transform: uppercase; white-space: nowrap; text-align: right; pointer-events: auto; }
  #dl-note { margin-top: 6px; color: var(--dot); font-size: 10px; line-height: 1.4; text-transform: uppercase; letter-spacing: .02em; }
  @media (max-width: 800px) { #i-legal { white-space: normal; left: 12px; right: 12px; bottom: 12px; } }   /* the note of a protected medium: small and red, bottom right next to the medium */
  #i-legal:not([hidden]) ~ #reg-jump { bottom: 64px; }
  .vlocked { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .vlocked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .vlocked .ui { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; }
  #lock-dlg { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
  .lockwin { width: min(360px, calc(100vw - 32px)); padding: 14px 16px 16px; background: var(--panel-bg); color: var(--panel-fg); line-height: 1.4; }
  .lockwin input { width: 100%; margin-top: 10px; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--panel-fg); font-size: 12px; }
  .lockwin input:focus { outline: none; border-color: var(--panel-fg); }
  #lock-msg { margin-top: 8px; color: var(--danger); }
  #lock-msg:empty { display: none; }
  .chk { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; line-height: 1.4; }
  .chk input { margin-top: 2px; }

  /* Upload: locations as chips */
  #up-loc { display: flex; flex-wrap: wrap; gap: 7px 9px; }
  /* modify / edit: the medium above the form */
  #edit-prev { margin: 4px 0 14px; height: 240px; display: flex; align-items: flex-start; }
  #edit-prev[hidden] { display: none; }
  #edit-prev > img, #edit-prev > video { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
  #edit-prev > .v { width: 340px; height: 100%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--line2); }
  #edit-prev .wvbox svg { width: 100%; height: 60%; }
  #edit-prev > .txt { width: 340px; height: 100%; overflow: auto; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line2); white-space: pre-wrap; line-height: 1.4; font-size: 12px; }
  .prevbox { display: flex; gap: 14px; align-items: flex-start; }
  #prev-img { flex: none; width: 110px; max-height: 156px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--line2); }
  .prevctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .pg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  #f-page { width: 64px; padding: 3px 6px; border: 1px solid var(--line2); border-radius: 0; background: transparent; color: var(--panel-fg); font-size: 12px; }
  .lc { padding: 1px 11px; border: 0; border-radius: 0; background: transparent; color: var(--panel-fg); box-shadow: inset 0 0 0 1px var(--panel-fg); font-size: 12px; line-height: 15px; cursor: pointer; }
  .lc.on { background: var(--panel-fg); color: var(--panel-bg); }
  #up-loc-desc { margin: 8px 0; line-height: 1.4; }
  #loc-msg, #tone-msg { margin-top: 8px; line-height: 1.5; }
  #loc-msg.err, #tone-msg.err { color: var(--danger); }

  /* Scenario on smaller screens: the controls are narrower; on phones they fold into one button */
  @media (max-width: 1180px) {
    #synth-panels { grid-template-columns: auto minmax(110px, 1fr) minmax(110px, 1fr) minmax(160px, 1fr) auto minmax(220px, 250px); }
    .lrow { gap: 10px; }
  }
  @media (max-width: 900px) {
    #tl { top: 12px; left: 12px; }
    body[data-mode="scenario"] :is(#toast, #demo-note) { top: 44px; }
    #synth { left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column-reverse; align-items: flex-start; }
    #synth-toggle { display: inline-block; pointer-events: auto; }
    #synth-panels { display: none; }
    #synth.open #synth-panels { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; max-height: calc(100dvh - 110px); overflow: auto; margin-bottom: 6px; overscroll-behavior: contain; }
    #synth-panels .sp { align-self: stretch; }
    .sp-col { display: contents; }
    #sc-media { grid-template-columns: repeat(3, minmax(56px, 1fr)); }
    .sp-note { max-width: none; }
  }

  /* info > upload > sort locations (temporary) and settings */
  #view-upload.sorting { width: min(1180px, calc(100vw - 40px)); }
  .lc.bld, .lc.her, #sort-who .lc { text-transform: none; }
  .herrow { display: flex; flex-wrap: wrap; gap: 6px; }
  #up-loc { display: flex; flex-wrap: wrap; gap: 4px; }
  .sort-top { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-end; margin-top: 14px; }
  .sort-top .fld, .sort-who { margin: 0; }
  .sort-who { margin-top: 12px; }
  .sort-top .fld input { width: 220px; }
  #sort-who, #sort-kind { display: flex; flex-wrap: wrap; gap: 6px; }
  #sort-kind .lc { padding: 3px 10px; font-size: 12px; line-height: 16px; }
  #sort-kind small { margin-left: 4px; opacity: .55; font-size: 11px; }
  #sort-who .lc, #sort-vals .lc { padding: 3px 10px; font-size: 12px; line-height: 16px; }
  #sort-who small { margin-left: 4px; opacity: .55; font-size: 11px; }
  #sort-set { position: sticky; top: -12px; z-index: 10; margin-top: 14px; padding: 10px 0 8px; background: var(--panel-bg); box-shadow: 0 1px 0 var(--line); }
  .sort-cols { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; }
  @media (max-width: 800px) { .sort-cols { grid-template-columns: 1fr; } #sort-set { position: static; } }
  .sort-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
  .sort-col .lc.her { font-weight: 700; }
  .sort-blds { display: flex; flex-wrap: wrap; gap: 4px; }
  #sort-vals .lc.bld { font-size: 11px; padding: 1px 7px; }
  .sort-save { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 12px; }
  .sort-save .fld { margin: 0; }
  .sort-save .fld input { width: 110px; }
  #sort-sel { color: var(--muted); }
  .sort-save .linkbtn { margin: 0 0 3px; }
  .sort-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
  #sort-msg:empty { display: none; }
  #sort-msg { margin-top: 6px; }
  #sort-grid, #pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin-top: 10px; }
  .st { position: relative; isolation: isolate; display: block; aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; background: var(--tile); color: var(--tile-text); cursor: pointer; text-transform: none; text-align: left; }
  .st img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .st img.blurred { filter: blur(6px); }
  .st-txt { height: 100%; padding: 24px 7px 6px; overflow: hidden; font-size: 10.5px; line-height: 1.3; }
  .st-txt b { display: block; margin-bottom: 3px; font-weight: 700; }
  .st-k { position: absolute; left: 4px; top: 4px; padding: 0 5px; background: var(--panel-bg); color: var(--panel-fg); font-size: 10px; line-height: 14px; }
  .st-tags { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
  .st-tags span { padding: 0 5px; background: var(--panel-fg); color: var(--panel-bg); font-size: 10px; line-height: 14px; }
  .st-tags .h1, .st-tags .h2, .st-tags .h3 { background: var(--panel-bg); color: var(--panel-fg); box-shadow: inset 0 0 0 1px var(--panel-fg); }
  .st:hover { box-shadow: inset 0 0 0 2px var(--panel-fg); }
  .st.done:not(.sel) > :first-child { opacity: .45; }
  .st.sel { box-shadow: inset 0 0 0 4px #E8202A; }
  .st.sel::before { content: ''; position: absolute; inset: 0; z-index: 2; border: 4px solid #E8202A; pointer-events: none; }   /* above pictures too */
  .st.sel::after { z-index: 3; content: ''; position: absolute; right: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #E8202A; }
  .sort-empty { grid-column: 1 / -1; padding: 30px 0; color: var(--muted); }
  #set-locs { margin: 12px 0 16px; }
  .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
  .set-name { flex: 1; }
  .set-row .tabs button { font-size: 11px; padding: 2px 8px; }
  .st.reg { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .st-reg { display: flex; flex-direction: column; gap: 3px; height: 100%; padding-bottom: 26px; font-size: 11px; }
  .st-reg i { font-style: normal; color: var(--muted); }
  .st-body { flex: 1; min-height: 0; overflow: auto; white-space: pre-wrap; overscroll-behavior: contain; }
  .yrow { display: flex; gap: 6px; align-items: stretch; }
  .yrow input { flex: 1; min-width: 0; }
  .yrow .lc { padding: 0 10px; text-transform: none; }
  .st-edit { position: absolute; right: 4px; top: 4px; z-index: 4; padding: 0 6px; background: var(--panel-fg); color: var(--panel-bg); font-size: 10px; line-height: 14px; opacity: 0; transition: opacity .15s; }
  .st:hover .st-edit, .st:focus-visible .st-edit, .st-edit:focus-visible { opacity: 1; }
  @media (hover: none) { .st-edit { opacity: 1; } }
  .st.sel .st-edit { right: 22px; }
  #i-date { margin-left: auto; font-size: .85em; color: var(--muted); white-space: nowrap; }

  /* remember password tickbox (js/pwmem.js) */
  .pwmem { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12px; font-weight: 400; cursor: pointer; text-transform: lowercase; }
  .pwmem input, .fld .pwmem input { width: auto !important; margin: 0; padding: 0; }
  .sort-save .srcfld input { width: 260px; }

  #i-code { margin: 0 0 6px; font-weight: 700; letter-spacing: .04em; }
  .flist .fid { font-weight: 700; letter-spacing: .03em; margin-right: 8px; white-space: nowrap; }
  #sp-search .sp-l, #sp-seed .sp-l { min-width: 3.6em; }             /* both fields start at the same place: the seed field below the search field */

  /* lite mode (js/state.js LITE): no gliding, no blur, no fading of the tiles: the browser draws much less */
  html.lite .item, html.lite .item.enter, html.lite #world.anim { transition: none !important; }
  html.lite .item:hover::after, html.lite .item:focus-visible::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
