/* Idea Atlas on Helios: the house style (cream paper, ink, brick red for the target, blue for controls)
   around Helios' canvas and panels. Helios' own panel styles come from helios-web. */
:root {
  --paper: #FDFBF7;
  --hot: #B14434;   /* brick red: the target on the map and warnings, nothing else */
  --cool: #3959A6; --deep: #22336B;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --set-a: #123570; --set-b: #E4CF5B;   /* the ends of Helios' log-ratio colormap (cmasher prinsenvlag) */
  /* the UI is drawn in browns only: thin light-brown lines, brown inks, no black */
  --tan: #B49A7C; --tan-pale: #DCCDB8; --ui: #8A7258; --ui-dark: #5E4B39; --ui-pale: #A99A86;
  /* the older names, now browns too: text, secondary text, lines, hover fill */
  --ink: var(--ui-dark); --muted: var(--ui); --pale: var(--tan-pale); --faint: #F3EDE3;
  --head-h: 58px;   /* the name and the two help links at the top of the chat column */
  font: 12.5px/1.42 var(--serif); color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#body { flex: 1; min-height: 0; display: flex; }
input, select, button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input[type=checkbox]:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
a { color: var(--ui); }
.caption { font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); }

/* no top bar: the name, the help links and the progress line sit at the top of the chat column, on its
   left edge; the map and the conditions use the full height */
header, #jobs { position: absolute; left: 0; z-index: 30; width: clamp(320px, 27vw, 410px); }
header { top: 0; height: var(--head-h); display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 12px 0 32px; }
.help-links { display: flex; gap: 14px; }
.help-links button { border: 0; background: none; padding: 4px 0 0; cursor: pointer; font-size: 14px; color: var(--ui);
  border-bottom: 1px dotted var(--tan-pale); }
.help-links button:hover { color: var(--ui-dark); border-bottom-color: var(--tan); }
.brand { display: flex; gap: 14px; align-items: baseline; white-space: nowrap; }
.brand .name { font-size: 15px; font-weight: 700; }
.brand .field { color: var(--muted); }
.pop { position: absolute; top: 36px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: #fff;
  border: 1px solid var(--pale); box-shadow: 0 6px 22px rgba(0,0,0,.08); padding: 6px 0; z-index: 40; }
.pop .hit, .pop .res-h, .pop .caption, .pop .warnline { padding: 4px 10px; }
.pop .hit { cursor: pointer; }
.pop .hit:hover { background: var(--faint); }
.pop .res-h { border-bottom: 1px dotted var(--pale); color: var(--muted); }
.acts { float: right; display: inline-flex; gap: 8px; }
button.link { border: 0; border-bottom: 1px dotted var(--tan-pale); background: none; color: var(--ui); padding: 0; cursor: pointer; }
button.link:hover { color: var(--ui-dark); border-bottom-color: var(--tan); }

/* job strip (jobs.js) */
#jobs { top: calc(var(--head-h) - 2px); }
#jobs .jb-line { display: flex; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 3px 16px; cursor: pointer; text-align: left; font-size: 11.5px; }
#jobs .jb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#jobs .jb-count { color: var(--muted); }
#jobs .jb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pale); }
#jobs.running .jb-dot { background: var(--tan); }
#jobs.waiting .jb-dot { background: #C9A227; }
#jobs.error .jb-dot { background: var(--hot); }
#jobs .jb-bar { height: 2px; background: transparent; overflow: hidden; }
#jobs .jb-bar i { display: block; height: 100%; width: 0; background: var(--tan); transition: width .2s; }
#jobs .jb-bar i.indet { width: 30% !important; animation: jb-indet 1.2s linear infinite; }
@keyframes jb-indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
#jobs .jb-list { position: absolute; left: 8px; right: 8px; top: 100%; margin: 0; padding: 6px 10px; list-style: none; background: #fff;
  border: 1px solid var(--pale); box-shadow: 0 6px 22px rgba(0,0,0,.08); max-height: 50vh; overflow: auto; }
#jobs .jb-list li { padding: 4px 0; border-bottom: 1px dotted var(--faint); }
#jobs .jb-list .jl { display: flex; justify-content: space-between; gap: 8px; }
#jobs .jb-list .jt { color: var(--muted); font-size: 11px; }
#jobs .jb-list li.error .jt { color: var(--hot); }

#stage { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#helios { position: absolute; inset: 0; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#tip { position: absolute; z-index: 5; max-width: 320px; background: #fff; border: 1px solid var(--pale); padding: 6px 8px;
  box-shadow: 0 6px 22px rgba(0,0,0,.08); pointer-events: none; font-size: 11.5px; }
#hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; font-size: 11px; color: var(--muted);
  background: rgba(253,251,247,.85); padding: 2px 8px; pointer-events: none; }

/* our panels inside Helios' panel chrome */
#cmp, #insp { font: 12px/1.45 var(--serif); color: var(--ui-dark); width: 300px; max-width: 100%; }
#cmp p { margin: 0 0 8px; }
.set { display: flex; gap: 6px; align-items: center; padding: 3px 0; }
.set .q { flex: 1; min-width: 0; border: 1px solid var(--pale); border-radius: 3px; background: #fff; padding: 4px 6px; }
.set .kind { flex: none; max-width: 78px; border: 1px solid var(--pale); border-radius: 3px; background: #fff; font-size: 11px; color: var(--muted); }
.vs { font-size: 12px; color: var(--ui-pale); padding-left: 18px; }
#custom-prompt, #chat-in { border: 1px solid var(--tan-pale); border-radius: 6px; background: transparent; padding: 3px 6px; outline: none; }
#custom-prompt:focus, #chat-in:focus { border-color: var(--tan); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.sw.a { background: var(--set-a); } .sw.b { background: var(--set-b); }
.cmp-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cmp-row > button, .chips button, #chat-form button { border: 1px solid var(--tan-pale); color: var(--ui); background: none; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.cmp-row > button:hover, .chips button:hover, #chat-form button:hover { border-color: var(--tan); color: var(--ui-dark); }
.cmp-row > button { padding: 4px 12px; }
#cmp-go, #cmp-go:hover, .chips button.on { background: var(--tan); border-color: var(--tan); color: var(--paper); }
.presets { font-size: 11px; }
#cmp-msg { margin-top: 6px; }

#insp.float { position: absolute; z-index: 6; width: 340px; max-height: calc(100% - 16px); overflow: auto;
  background: var(--paper); border: 1px solid var(--pale); box-shadow: 0 6px 22px rgba(0,0,0,.09), 0 1px 2px rgba(0,0,0,.05);
  padding: 0 12px 10px; }
.insp-head { display: flex; gap: 8px; align-items: baseline; margin: 0 -12px 6px; padding: 8px 12px 6px; cursor: move;
  position: sticky; top: 0; background: var(--paper); border-bottom: 1px dotted var(--pale); }
.insp-head .insp-title { flex: 1; }
#insp-x { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ui); padding: 0 2px; }
#insp-x:hover { color: var(--ui-dark); }
.badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ui); border: 1px solid var(--tan); padding: 0 4px; border-radius: 2px; }
.insp-title { font-weight: 700; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.out { min-height: 1.4em; margin: 6px 0; }
.stage-t { color: var(--muted); font-style: italic; }
.busy-cursor::after { content: "▍"; color: var(--hot); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.warnline { color: var(--hot); font-size: 11px; }
#mix ol { margin: 4px 0; padding-left: 0; list-style: none; max-height: 180px; overflow: auto; }
#mix li { display: flex; gap: 6px; cursor: pointer; font-size: 11px; padding: 1px 0; }
#mix li:hover { background: var(--faint); }
#mix .w { flex: none; width: 36px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
#mix .w.neg { color: var(--hot); }
#abs-text { font-size: 11.5px; }
#chat-log .msg { margin: 6px 0; }
#chat-log .msg.user { color: var(--ui); font-style: italic; }
#chat-form { display: flex; gap: 4px; margin-top: 6px; }
#chat-in { flex: 1; min-width: 0; }
details summary { cursor: pointer; color: var(--muted); font-size: 11px; }

/* choosing a package (package.js) */
#pkg-pick { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: var(--paper); }
#pkg-pick .pk-card { width: 440px; max-width: calc(100vw - 32px); }
#pkg-pick .pk-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--ui-dark); }
#pkg-pick p { color: var(--muted); margin: 0 0 14px; }
#pkg-pick .pk-item { display: flex; justify-content: space-between; width: 100%; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--pale); border-radius: 4px; background: none; cursor: pointer; text-align: left; }
#pkg-pick .pk-item:hover { border-color: var(--tan); }
#pkg-pick .pk-item span { color: var(--muted); }
#pkg-pick .pk-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
#pkg-pick .pk-row input:not([type=file]) { flex: 1; border: 1px solid var(--pale); border-radius: 4px; padding: 6px 8px; outline: 0; background: var(--paper); }
#pkg-pick .pk-row button { border: 1px solid var(--tan); background: var(--tan); color: var(--paper); border-radius: 4px; padding: 5px 12px; cursor: pointer; }
#pkg-pick .pk-err { color: var(--hot); margin-top: 10px; min-height: 1em; }

.seg { display: inline-flex; border: 1px solid var(--cool); border-radius: 3px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; color: var(--cool); padding: 3px 10px; cursor: pointer; }
.seg button.on { background: var(--cool); color: #fff; }

.cbar { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.cbar i { flex: 1; height: 8px; border-radius: 2px;
  background: linear-gradient(90deg, #00224E, #123570 12%, #3B496C 25%, #575D6D 37%, #7C7B78 50%, #A69D75 62%, #C4B56C 75%, #E4CF5B 88%, #FEE838); }
.cbar { margin: 2px 0; } .cbar.scale { margin-top: 6px; }
#cmp-msg { margin: 6px 0; }
.presets { margin-top: 4px; }

/* the left column: the chat with the map, then the controls that are always there. No frames:
   the column is set apart from the map by white space only. The past flows up and fades; the latest
   answer is in full ink. */
#side { flex: none; width: calc(clamp(320px, 27vw, 410px) + 150px); display: flex; flex-direction: column; min-height: 0;
  padding: calc(var(--head-h) + 32px) 28px 22px 32px; }
#stage { margin: 10px 14px 14px 0; }
#talk { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; font: 15px/1.6 var(--serif); }
#talk-log { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 40px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 90px); mask-image: linear-gradient(180deg, transparent 0, #000 90px); }
#talk-log::-webkit-scrollbar { display: none; }
#talk-log .hello { color: var(--muted); }
#talk-log .hello span { display: block; margin-top: 6px; font: 600 19px/1.25 Caveat, cursive; color: #8a847b; }
#talk-log .msg { color: var(--ink); }
#talk-log .msg.user { color: var(--muted); font-style: italic; }
#talk-log .msg.acts { font-size: 13.5px; color: var(--ui); }
#talk-log .msg.assistant { font-size: 15px; }
#talk-log .old, #talk-log .old.msg { color: #A39D94 !important; font-size: 13.5px; transition: color .4s, font-size .4s; }
#talk-log .old .caption { color: #B3ADA4; }
#talk-log .caption { font-size: 12.5px; }
#talk-form { margin-top: 16px; }
#talk-in { width: 100%; border: 0; border-radius: 10px; background: #EEEAE3; padding: 16px 18px; font: inherit; outline: none; }
#talk-in::placeholder { color: #8f897f; }
#talk-in:focus { background: #E8E3DA; }

/* the controls: a 2 x 2 grid under the chat, labels in the page's text, values in bold */
#bar { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-top: 22px; font-size: 13px; }
#bar .ctl { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#bar .cl { color: var(--muted); }
#bar .cl b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }
#bar .cr { display: flex; align-items: center; gap: 8px; }
#bar input[type=range] { flex: 1; min-width: 0; accent-color: var(--cool); }
#play { flex: none; border: 1px solid var(--cool); color: var(--cool); background: none; border-radius: 50%; width: 24px; height: 24px;
  cursor: pointer; font-size: 9px; padding: 0; }
#bar .seg { align-self: flex-start; }
.seg button { background: none; }
#manual-open { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--cool); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }

/* the windows over the page (how to use, how it works, compare): a sheet over a hatched veil; no
   frame, a soft shadow only. One is open at a time (helios-app.js: openVeil / closeVeil). */
.veil { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, rgba(253,251,247,.82) 0 7px, rgba(233,228,219,.82) 7px 8px); }
.veil .sheet { width: 640px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--paper); border-radius: 12px; padding: 0 28px 22px; box-shadow: 0 18px 50px rgba(60,50,40,.18), 0 2px 6px rgba(60,50,40,.06);
  font: 15px/1.6 var(--serif); color: var(--ui-dark); }
.m-head { display: flex; align-items: baseline; position: sticky; top: 0; z-index: 1; padding: 18px 0 4px; background: var(--paper); }
.m-title { flex: 1; font: 600 24px/1.2 Caveat, cursive; }
.veil-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ui); }
.veil-x:hover { color: var(--ui-dark); }
.veil i { color: var(--ui); }
/* how to use / how it works: one short statement per row, a small drawing to its right */
.rows { margin: 4px 0 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; gap: 18px; padding: 9px 0; border-bottom: 1px dotted var(--tan-pale); }
.rows li:last-child { border-bottom: 0; }
.rows li > div { flex: 1; min-width: 0; }
/* the drawings: line figures in the page's browns that play one short loop each (6 s). Stages 1, 2 and 3
   start at 10%, 35% and 60% of the loop: i = comes in, o = fades, t = takes the colour --c, w = a line
   is drawn (pathLength 1), sl = slides away, mv = moves in from --dx, --dy. Without the animation
   (prefers-reduced-motion) each figure shows its last frame. */
.fig { flex: none; width: 172px; height: 112px; fill: none; stroke: var(--tan); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.fig .d, .fig .t2, .fig .t3 { fill: var(--tan); stroke: none; }
.fig .dk { fill: var(--ui); stroke: none; }
.fig .t2, .fig .t3 { fill: var(--c); }
.fig .t23 { fill: var(--c2); }
.fig .k { stroke: var(--ui-dark); }
.fig .loop, .fig .bad { stroke: var(--hot); }
.fig .card, .fig .cover { fill: var(--paper); }
.fig .cover { stroke: none; display: none; }
.fig .wk { fill: var(--tan); stroke: none; } .fig .wl { fill: var(--tan-pale); stroke: none; }
.fig .w1, .fig .w2 { stroke-dasharray: 1; }
.fig text { font: 600 17px Caveat, cursive; fill: var(--ui); stroke: none; text-anchor: middle; }
.fig text.lb { font-size: 15px; }
.fig text.ty { font: italic 11px var(--serif); fill: var(--ui-dark); text-anchor: start; }
@media (prefers-reduced-motion: no-preference) {
  .fig * { animation: 6s ease infinite; }
  .fig .cover { display: inline; }
  .fig .i1 { animation-name: fig-i1; } .fig .i2 { animation-name: fig-i2; } .fig .i3 { animation-name: fig-i3; }
  .fig .o2 { animation-name: fig-o2; } .fig .o3 { animation-name: fig-o3; }
  .fig .t2 { animation-name: fig-t2; } .fig .t3 { animation-name: fig-t3; } .fig .t23 { animation-name: fig-t23; }
  .fig .w1 { animation-name: fig-w1; } .fig .w2 { animation-name: fig-w2; }
  .fig .sl { animation-name: fig-sl; animation-timing-function: steps(8); }
  .fig .mv { animation-name: fig-mv; }
}
@keyframes fig-i1 { 0%, 10% { opacity: 0; } 18%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fig-i2 { 0%, 35% { opacity: 0; } 43%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fig-i3 { 0%, 60% { opacity: 0; } 68%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fig-o2 { 0%, 35% { opacity: 1; } 43%, 94% { opacity: .1; } 100% { opacity: 1; } }
@keyframes fig-o3 { 0%, 60% { opacity: 1; } 68%, 94% { opacity: .1; } 100% { opacity: 1; } }
@keyframes fig-t2 { 0%, 35% { fill: var(--tan); } 43%, 94% { fill: var(--c); } 100% { fill: var(--tan); } }
@keyframes fig-t3 { 0%, 60% { fill: var(--tan); } 68%, 94% { fill: var(--c); } 100% { fill: var(--tan); } }
@keyframes fig-t23 { 0%, 22% { fill: var(--tan); } 30%, 56% { fill: var(--c); } 64%, 94% { fill: var(--c2); } 100% { fill: var(--tan); } }
@keyframes fig-w1 { 0%, 10% { stroke-dashoffset: 1; opacity: 1; } 35%, 94% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes fig-w2 { 0%, 35% { stroke-dashoffset: 1; opacity: 1; } 60%, 94% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes fig-sl { 0%, 10% { transform: none; } 35%, 97% { transform: translateX(100px); } 100% { transform: none; } }
@keyframes fig-mv { 0%, 10% { transform: translate(var(--dx), var(--dy)); } 50%, 92% { transform: none; } 100% { transform: translate(var(--dx), var(--dy)); } }
.veil-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 13.5px; color: var(--ui); }
.veil-foot input { accent-color: var(--tan); vertical-align: -1px; }
.veil-foot a { text-decoration: none; border-bottom: 1px dotted var(--tan-pale); }
.veil-foot a:hover { color: var(--ui-dark); border-bottom-color: var(--tan); }
.veil-go { border: 1px solid var(--tan); background: var(--tan); color: var(--paper); border-radius: 6px; padding: 5px 18px; cursor: pointer; }
.veil-go:hover { background: var(--ui); border-color: var(--ui); }
/* the compare window's fields and buttons, in the same browns */
.veil .set .q, .veil .set .kind { border: 1px solid var(--tan-pale); border-radius: 6px; background: transparent; padding: 7px 9px; color: var(--ui-dark); outline: none; }
.veil .set .q:focus { border-color: var(--tan); }
.veil .set .kind { max-width: 150px; font-size: 12px; }
.veil .set .pick { flex: 1; min-width: 0; border: 1px solid var(--tan-pale); border-radius: 6px; background: transparent; padding: 7px 9px; color: var(--ui-dark); font: inherit; }
.veil .set .q[hidden], .veil .set .pick[hidden] { display: none; }
#manual .sheet { width: 540px; }
#cmp { width: auto; font: inherit; }
#cmp .caption { font-size: 12.5px; }
#hint { left: 16px; transform: none; white-space: nowrap; background: none; }

/* the filter: top right of the map, what the map is about now. Empty = all papers; once set it is in
   bold ink with a × to clear, so it is always clear which papers the map and the chat work on. */
#search-form.filter { position: absolute; top: 12px; right: 64px; z-index: 6; width: 400px; max-width: calc(100% - 90px);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(253,251,247,.92); font-size: 13px; }
#search-form.filter .f-l { color: var(--muted); }
#search-form.filter select, #search-form.filter input { border: 0; border-radius: 6px; background: #EEEAE3; padding: 6px 8px; outline: none; }
#search-form.filter input { flex: 1; min-width: 0; }
#search-form.filter.on input { font-weight: 700; background: #E6DFD3; }
#search-form.filter.on .f-l { color: var(--ink); }
#filter-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 2px; }
#filter-x:hover { color: var(--hot); }
#search-form.filter .pop { top: 44px; border: 0; border-radius: 8px; }

/* no border between chat and map: the map runs under the right part of the chat column, which fades
   from paper to see-through; Helios' empty side docks (the pale strips) are hidden */
.helios-ui-dock--left, .helios-ui-dock--right, .helios-ui-dock--side, .helios-ui-interface-dock-toggle { display: none !important; }
/* Helios' own buttons on the map (fit, full screen, pause, zoom): the page's browns instead of its blue-grey */
body .helios-ui[data-theme="light"] { --helios-ui-accent: var(--tan); --helios-ui-fg: var(--ui-dark); --helios-ui-bg-solid: var(--paper);
  --helios-ui-border: var(--tan-pale); }
body .helios-quick-controls[data-theme="light"] { --helios-quick-accent: var(--tan); --helios-quick-fg: var(--ui-dark); --helios-quick-bg-solid: var(--paper);
  --helios-quick-border: var(--tan-pale); --helios-quick-shadow: 0 6px 18px rgba(60,50,40,.10); }
#body { position: relative; }
#side { position: relative; z-index: 7; padding-right: 178px; margin-right: -150px; pointer-events: none;
  background: linear-gradient(90deg, var(--paper) 0, var(--paper) calc(100% - 165px), rgba(253,251,247,.7) calc(100% - 90px), rgba(253,251,247,0) 100%); }
#side > * { pointer-events: auto; }
#stage { margin: 0; }
#hint { left: 170px; }
.cbar.one i { background: linear-gradient(90deg, #00224E, #123570 25%, #3B496C 50%, #575D6D 75%, #7C7B78); }

/* warm controls: thin light-brown lines, no fills; the chat box is an outline only */
#talk-in, #talk-in:focus { background: transparent; border: 1px solid var(--tan-pale); }
#talk-in:focus { border-color: var(--tan); }
#bar input[type=range] { accent-color: var(--tan); }
#play { border-color: var(--tan); color: var(--ui); }
#bar .seg { border-color: var(--tan-pale); }
#bar .seg button { color: var(--ui); }
#bar .seg button.on { background: none; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--tan); text-underline-offset: 4px; }
#manual-open { color: var(--ui); text-decoration-color: var(--tan-pale); }
#search-form.filter select, #search-form.filter input { background: transparent; border: 1px solid var(--tan-pale); }
#search-form.filter.on input { background: transparent; border-color: var(--tan); }

/* minimal chrome: no black in the UI (brown inks only), thin lines, no boxes */
.brand .name { color: var(--ui-dark); }
.brand .field, #jobs .jb-line, #jobs .jb-count { color: var(--ui); }
#talk-in::placeholder { color: #BBAE9C; }
#talk-log .hello { color: var(--ui-pale); }
#bar { font-size: 12.5px; gap: 12px 24px; }
#bar .cl { color: var(--ui-pale); }
#bar .cl b { color: var(--ui-dark); font-weight: 400; }
#bar .seg { border: 0; gap: 12px; }
#bar .seg button { padding: 0; color: var(--ui-pale); }
#bar .seg button.on { color: var(--ui-dark); font-weight: 400; text-decoration: underline; text-decoration-color: var(--tan); text-underline-offset: 4px; }
#play { border: 0; width: 14px; height: 14px; font-size: 10px; color: var(--ui); }
#manual-open { color: var(--ui); text-decoration: none; border-bottom: 1px dotted var(--tan-pale); }
#bar input[type=range] { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; }
#bar input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--tan-pale); }
#bar input[type=range]::-moz-range-track { height: 1px; background: var(--tan-pale); }
#bar input[type=range]::-moz-range-progress { height: 1px; background: var(--tan); }
#bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--tan); cursor: pointer; }
#bar input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--tan); cursor: pointer; }
#search-form.filter .f-l { color: var(--ui-pale); }
#search-form.filter select, #search-form.filter input { color: var(--ui-dark); }
#search-form.filter.on .f-l { color: var(--ui); }
#search-form.filter.on input { font-weight: 400; }
#hint { color: #BBAE9C; }

/* larger UI text and larger targets: easy to read and to hit */
#bar { font-size: 15px; gap: 16px 28px; }
#bar .seg { gap: 4px; }
#bar .seg button { padding: 4px 8px; margin-left: -8px; font-size: 15px; }
#bar .seg button + button { margin-left: 0; }
#play { width: 28px; height: 28px; font-size: 14px; margin-left: -7px; }
#bar input[type=range] { height: 28px; cursor: pointer; }
#bar input[type=range]::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -7px; }
#bar input[type=range]::-moz-range-thumb { width: 15px; height: 15px; }
#manual-open { font-size: 15px; padding: 4px 0; }
#search-form.filter { font-size: 15px; width: 440px; }
#search-form.filter select, #search-form.filter input { padding: 8px 10px; font-size: 15px; }
#filter-x { font-size: 24px; padding: 0 6px; }
.brand .name { font-size: 17px; } .brand .field { font-size: 14px; }
#jobs .jb-line { font-size: 13px; padding: 5px 32px; }
#hint { font-size: 13px; }

/* colour switch: each choice in a thin light-brown box; the chosen one filled */
#bar .seg { gap: 6px; }
#bar .seg button, #bar .seg button + button { margin-left: 0; padding: 4px 12px; border: 1px solid var(--tan-pale); border-radius: 6px; background: none;
  color: var(--ui); text-decoration: none; }
#bar .seg button:hover { border-color: var(--tan); }
#bar .seg button.on { background: var(--tan); border-color: var(--tan); color: var(--paper); text-decoration: none; }

/* asking back: the choices as small outlined buttons under the question */
.ask-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-opt { border: 1px solid var(--tan-pale); border-radius: 6px; background: none; color: var(--ui); padding: 4px 10px; cursor: pointer; font-size: 14px; }
.ask-opt:hover { border-color: var(--tan); color: var(--ui-dark); }
.ask-opt:disabled { opacity: .5; cursor: default; }
/* pairing an agent: an outlined button under the chat box; its instructions open just above it */
#pair-box { position: relative; margin-top: 10px; }
#pair-tag { border: 1px solid var(--tan-pale); border-radius: 6px; background: none; padding: 5px 12px; color: var(--ui); font-size: 14px; cursor: pointer; }
#pair-tag:hover, #pair-tag[data-st="on"] { border-color: var(--tan); color: var(--ui-dark); }
#pair-tag[data-st="on"]::before { content: "● "; color: var(--tan); }
#pair-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 70; width: 100%; min-width: 300px; padding: 14px 16px; border-radius: 10px;
  background: var(--paper); box-shadow: 0 14px 40px rgba(60,50,40,.16); font-size: 14px; color: var(--ui-dark); }
#pair-pop p { margin: 0 0 10px; color: var(--ui); }
#pair-copy { display: block; padding: 8px 10px; border: 1px solid var(--tan-pale); border-radius: 6px; font: 13px/1.45 ui-monospace, Menlo, monospace; color: var(--ui-dark); user-select: all; }
.pair-row { display: flex; gap: 8px; margin-top: 10px; }
.pair-row button { border: 1px solid var(--tan-pale); border-radius: 6px; background: none; color: var(--ui); padding: 4px 12px; cursor: pointer; font-size: 14px; }
.pair-row button:hover { border-color: var(--tan); }
#talk-log .msg.agent::before { content: "agent · "; color: var(--tan); font: 600 17px Caveat, cursive; }

/* the loop being drawn (shift-drag) */
#lasso { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
#lasso path { fill: rgba(177,68,52,.06); stroke: var(--hot); stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linejoin: round; }
/* the small print under the chat box and in the paper window */
.disclaimer { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.4; color: #B3A694; font-style: italic; }
#insp .disclaimer { font-size: 11.5px; margin-top: 10px; }

/* colour choices and the compare link each on a row of their own: nothing overlaps */
#bar .ctl.wide { grid-column: 1 / -1; }
#lasso path { fill: rgba(177,68,52,.10); stroke-width: 2; }
#lasso text { font: 600 18px Caveat, cursive; fill: var(--hot); paint-order: stroke; stroke: rgba(253,251,247,.9); stroke-width: 4px; }

/* the conditions panel (top right): numbered steps in order, each with its own ×, then "+ add a condition" */
#search-form.filter { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 380px; padding: 10px 14px 12px;
  border-radius: 12px; background: rgba(253,251,247,.9); font-size: 15px; }
#search-form.filter .f-h { display: flex; align-items: baseline; justify-content: space-between; }
#search-form.filter .f-l { font: 600 20px/1.1 Caveat, cursive; color: var(--ui); }
#filter-x { font-size: 13px; padding: 0; color: var(--ui-pale); text-decoration: underline dotted; text-underline-offset: 3px; }
#chain { display: flex; flex-direction: column; gap: 2px; }
#chain:empty { display: none; }
#chain .step { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; color: var(--ui-dark); line-height: 1.35; }
#chain .step .n { flex: none; width: 16px; font: 600 19px/1 Caveat, cursive; color: var(--tan); }
#chain .step .t { flex: 1; min-width: 0; }
#chain .step .c { color: var(--ui-pale); font-size: 13px; margin-left: 4px; white-space: nowrap; }
#chain .step .x { flex: none; border: 0; background: none; color: var(--ui-pale); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
#chain .step .x:hover { color: var(--hot); }
#chain-empty { color: var(--ui-pale); font-style: italic; padding: 2px 0 2px 24px; }
#add-row { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
#add-row select { flex: none; }
#add-row input { flex: 1; min-width: 0; }
#add-x { border: 0; background: none; color: var(--ui-pale); font-size: 20px; cursor: pointer; padding: 0 2px; }
#add-cond { align-self: flex-start; margin-top: 4px; border: 1px solid var(--tan-pale); border-radius: 6px; background: none;
  color: var(--ui); padding: 4px 12px; cursor: pointer; font-size: 14px; }
#add-cond:hover { border-color: var(--tan); color: var(--ui-dark); }
#search-form.filter .pop { top: 100%; margin-top: 6px; }



#gh-link { display: inline-flex; align-items: center; padding: 4px 0 0; color: var(--ui); }
#gh-link:hover { color: var(--ui-dark); }
.help-links { align-items: center; }

/* night-science fork: the colour buttons include the contrast axes, so they wrap */
#colour { flex-wrap: wrap; height: auto; }
#colour button { white-space: nowrap; }
#proj .proj-body { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
#proj label { display: flex; gap: 5px; align-items: center; }
#proj .proj-now { font-style: italic; }

/* the transcript window (night-science map) */
#tr .sheet { width: 760px; }
#tr-body { font-size: 15px; line-height: 1.5; }
.tr-turn { margin: 0 0 10px; }
.tr-who { display: block; font-size: 12.5px; color: var(--ui); }
.tr-who.guest { color: var(--ui-dark); font-weight: 600; }
.tr-on { background: #F4E3A6; }
#search-form.filter #search-pick { flex: 1; min-width: 0; }
#search-form.filter #search[hidden], #search-form.filter #search-pick[hidden] { display: none; }
#search-form.filter #scope { flex: 0 0 auto; max-width: 150px; }
