/* The picture studio (studio.html). A desk: the picture on the left, the controls in a column on the right.
   A phone held upright: the picture on top, the controls under it. The same colours and faces as the rest of the site. */
:root { --bg: #0a0d13; --surface: #121722; --raised: #182030; --line: #283246; --ink: #eef2f7; --ink-2: #a8b3c3; --ink-3: #7f8a9c; --ember: #ff7b39; --mint: #5fe0b0; --gold: #f2c14e;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif; --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sidew: 400px; --top: 54px; --line-2: #3f4a63; --track: #313c52; color-scheme: dark; }          /* dark: the browser's own scroll bars and pop-up lists too */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-text-size-adjust: 100%; overflow: hidden; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* scroll bars thin and as dark as a line of the page (27 Nov 2026: on a desk the system's light grey ones "did not fit") */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #5a4f44; }

/* ------------------------------------------------------------------ the top line */
.top { flex: 0 0 var(--top); display: flex; align-items: center; gap: 12px; padding: 0 14px; padding-top: var(--sat, 0px); border-bottom: 1px solid var(--line); background: var(--bg, #0a0d13); min-width: 0; }
.logo { font: 24px/1 var(--serif); font-style: italic; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo i { width: 14px; height: 14px; border-radius: 50%; background: var(--ember); display: inline-block; }
.ttl { color: var(--ink-2); font: 500 14px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.grow { flex: 1; }
select { -webkit-appearance: none; appearance: none; max-width: 100%; min-height: 38px; padding: 7px 32px 7px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--ink); cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23b0a79a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
select:hover { border-color: var(--line-2); }
select option { background: var(--surface); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg.wrap { flex-wrap: wrap; border-radius: 14px; }
.seg button { border: 0; background: none; padding: 8px 14px; min-height: 38px; font: 500 14px var(--sans); color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface, #121722); }
.seg.wrap button { flex: 1 1 auto; }

.topbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 500 14px var(--sans); white-space: nowrap; }
.topbtn.icon { padding: 7px; width: 38px; justify-content: center; }
.topbtn svg { flex: none; }

/* ------------------------------------------------------------------ dialogs: the settings, the question before a large download */
.dlg { border: 1px solid var(--line); border-radius: 16px; background: var(--raised); color: var(--ink); padding: 18px 18px 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
.dlg::backdrop { background: #000a; }
.dlg h2 { font: 400 26px/1.15 var(--serif); margin: 0 0 8px; }
.dlg p { margin: 8px 0 0; font-size: 15px; }
.dlg p.warn { color: var(--gold); }
.dlg .rowbtns { justify-content: flex-end; margin-top: 16px; }
.dlghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dlghead .x { border: 0; background: none; color: var(--ink-2); font-size: 24px; line-height: 1; width: 38px; height: 38px; border-radius: 10px; margin: -6px -8px 0 0; }
.setrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin-top: 14px; }
.setrow label { font: 600 14.5px var(--sans); }
.setrow select { width: 100%; }
.setrow small { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.setrow.tick { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.setrow.tick input { grid-column: 1; grid-row: 1; }
.setrow.tick label { grid-column: 2; grid-row: 1; }
.setrow.tick small { grid-column: 2; }
.setnote { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px !important; font-size: 12.5px !important; }

/* ------------------------------------------------------------------ the two columns */
#app { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--sidew); }
#stage { position: relative; min-width: 0; min-height: 0; background: #050404; overflow: hidden; }
#side { --pad: 16px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); padding: 16px var(--pad) calc(28px + var(--sab, 0px)); background: var(--bg); }
#side h1 { font: 400 30px/1.1 var(--serif); margin: 2px 0 8px; }
#side h2 { font: 600 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 20px 0 8px; }
.lede { color: var(--ink-2); margin: 0 0 4px; font-size: 14.5px; }
.says { color: var(--ink); font-size: 14.5px; margin: 12px 0 0; min-height: 1.45em; }
.says.warn, .note.warn { color: var(--gold); }
.fine { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.linkopens { border: 1px solid var(--gold); border-radius: 10px; padding: 9px 11px; color: var(--ink); font-size: 14px; margin: 10px 0 0; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 22px; border-radius: 999px; border: 1px solid var(--ember); background: var(--ember); color: #1b0b02; font: 600 15px var(--sans); text-decoration: none; }
.cta[disabled] { opacity: .45; cursor: default; }
.ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--sans); text-decoration: none; text-align: center; }
.ghost.small, select.ghost.small { min-height: 36px; padding: 6px 13px; font-size: 13.5px; }
.ghost[disabled] { opacity: .45; cursor: default; }
#get { width: 100%; margin-top: 8px; }
.act { position: sticky; bottom: calc(-28px - var(--sab, 0px)); margin: 14px calc(-1 * var(--pad)) 0; padding: 4px var(--pad) calc(14px + var(--sab, 0px)); background: var(--bg); box-shadow: 0 -18px 16px -4px var(--bg); z-index: 3; }          /* solid, the fade above it: the words in it never run into what scrolls under */
.act .says { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); min-height: 0; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rowbtns.big > * { flex: 1 1 calc(50% - 4px); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.row2 label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.row2 select { width: 100%; }
/* Pro's own things at the first step (the frame by numbers, the free shape, wavelengths of one's own): out of sight in
   Simple, unless one of them is the choice in force (a frame typed in Pro stays what it is when the mode is changed) */
body:not([data-mode="pro"]) .proonly:not([aria-pressed="true"]):not([aria-checked="true"]) { display: none !important; }
#proplace { border: 1px solid var(--line-2, var(--line)); border-radius: 12px; padding: 0 12px 12px; margin: 12px 0 2px; }
#proplace h2 { margin-top: 13px; color: var(--ember); }
.nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px 10px; align-items: end; }
.nums label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; line-height: 1.25; color: var(--ink-3); min-width: 0; grid-column: span 2; }
.nums label:nth-child(-n+2) { grid-column: span 3; }
.nums input { width: 100%; min-width: 0; font: 400 14.5px var(--mono); padding: 8px 9px; color: var(--ink); }
.fine.hms { font-family: var(--mono); color: var(--ink-2); margin-top: 10px; }
#ownbox { margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; min-height: 36px; font: 500 13.5px var(--sans); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--ember); color: var(--ember); }

/* the three kinds of picture */
.cards { display: grid; gap: 8px; }
.cards button { display: grid; grid-template-columns: 54px 1fr; gap: 3px 11px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 11px; }
.cards button[aria-checked="true"] { border-color: var(--ember); background: #1d1410; }
.cards .sw { grid-row: 1 / 3; width: 54px; height: 54px; border-radius: 8px; background: #000; border: 1px solid var(--line); }
.cards b { font: 600 15px var(--sans); }
.cards span { color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.sw.gas { background: radial-gradient(circle at 42% 46%, #f4ffd0 0 8%, #49e07a 22%, #c8401a 52%, #170604 78%), #000; }
.sw.stars { background: radial-gradient(circle at 30% 28%, #fff 0 5%, transparent 7%), radial-gradient(circle at 72% 64%, #ffe9c8 0 4%, transparent 6%), radial-gradient(circle at 56% 30%, #cfe0ff 0 3%, transparent 5%), radial-gradient(ellipse at 50% 58%, #a3261c 0 18%, #050404 62%); }
.sw.dust { background: linear-gradient(#5fb7c9 0 31%, #000 31% 35%, #c9853c 35% 65%, #000 65% 69%, #a02e3f 69%); }
.sw.own { background: linear-gradient(90deg, #4a7dff 0 16%, #37d6ff 16% 33%, #5cf2a0 33% 50%, #f4f08a 50% 67%, #ff9a4a 67% 84%, #e0362c 84%); }          /* Pro: wavelengths of one's own, short to long */

/* ------------------------------------------------------------------ step one: the map and its frame */
#picker, #easel { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: #05070c; }
#map .aladin-logo-container, #map .aladin-location, #map .aladin-fov, #map .aladin-status-bar { display: none !important; }
#frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1.5px solid var(--ember); border-radius: 2px; box-shadow: 0 0 0 4000px #0009; pointer-events: none; }
/* the frame's corners: dragged, the frame grows or shrinks around its middle */
.fgrip { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: auto; touch-action: none; }
.fgrip::after { content: ""; position: absolute; left: 9px; top: 9px; width: 12px; height: 12px; border-radius: 3px; background: var(--ember); box-shadow: 0 0 0 2px #0009; }
.fgrip[data-c=nw] { left: 0; top: 0; cursor: nwse-resize; } .fgrip[data-c=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.fgrip[data-c=se] { left: 100%; top: 100%; cursor: nwse-resize; } .fgrip[data-c=sw] { left: 0; top: 100%; cursor: nesw-resize; }
@media (pointer: coarse) { .fgrip { width: 44px; height: 44px; margin: -22px 0 0 -22px; } .fgrip::after { left: 15px; top: 15px; width: 14px; height: 14px; } }
#framesize { position: absolute; left: 6px; bottom: 6px; font: 500 12.5px var(--mono); color: var(--ink); background: color-mix(in srgb, var(--bg, #0a0d13) 85%, transparent); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
#find { position: absolute; z-index: 5; left: 12px; top: 12px; display: flex; gap: 6px; width: min(360px, calc(100% - 76px)); }
#q { flex: 1; min-width: 0; background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 10px 15px; font-size: 15px; }
#q::placeholder { color: var(--ink-3); }
#go { border: 1px solid var(--line); background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); border-radius: 999px; padding: 0 16px; font: 600 14px var(--sans); }
#findmsg { position: absolute; z-index: 5; left: 14px; top: 58px; margin: 0; max-width: min(360px, calc(100% - 28px)); font-size: 13.5px; color: var(--gold); background: color-mix(in srgb, var(--bg, #0a0d13) 90%, transparent); border-radius: 8px; padding: 6px 10px; }
#findmsg:empty { display: none; }
.zoom { position: absolute; z-index: 5; right: 12px; top: 12px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); }
.zoom button { width: 44px; height: 44px; border: 0; background: none; font: 400 24px/1 var(--sans); }
.zoom button + button { border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ step two: the picture */
#scroll { position: absolute; inset: 0 0 var(--bar) 0; display: flex; align-items: center; justify-content: center; padding: 14px 14px 6px; overflow: hidden; }
#easel { --bar: 50px; }
.easelbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
#sheet { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
#pic { display: block; max-width: 100%; max-height: calc(100vh - var(--top) - 70px); image-rendering: auto; background: #000; }
#marks { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
body.fullsize #scroll { display: block; overflow: auto; padding: 0; }
body.fullsize #sheet, body.fullsize #pic { max-width: none; max-height: none; }
#fullbtn { background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); margin-left: auto; }
/* the picture's tools under it: undo, redo, crop, compare (held) */
.easelbar .tools { display: flex; gap: 6px; margin-left: auto; }
.easelbar .chip { display: inline-flex; align-items: center; gap: 6px; }
.easelbar .chip.icon { width: 38px; justify-content: center; padding: 0; background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); }
.easelbar .chip:disabled { opacity: .35; cursor: default; }
#cropbtn { background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); }
#cmpbtn:active, #cmpbtn.on { border-color: var(--ember); color: var(--ember); }
body.cropping .easelbar { visibility: hidden; }
body.cropping #sidestudio > :not(#cropbox) { display: none !important; }
/* the crop frame over the picture: the rest darkened, thirds drawn, handles at its corners and sides */
#cropper { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#cbox { position: absolute; box-shadow: 0 0 0 9999px #000a; outline: 1.5px solid #fff; cursor: move; }
#cbox i { position: absolute; background: #ffffff59; pointer-events: none; }
#cbox .gv1, #cbox .gv2 { top: 0; bottom: 0; width: 1px; } #cbox .gv1 { left: 33.33%; } #cbox .gv2 { left: 66.67%; }
#cbox .gh1, #cbox .gh2 { left: 0; right: 0; height: 1px; } #cbox .gh1 { top: 33.33%; } #cbox .gh2 { top: 66.67%; }
#cbox b { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; }
#cbox b::after { content: ""; position: absolute; left: 7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #0009; }
#cbox b[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; } #cbox b[data-h=n] { left: 50%; top: 0; cursor: ns-resize; } #cbox b[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
#cbox b[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; } #cbox b[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; } #cbox b[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
#cbox b[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; } #cbox b[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { #cbox b { width: 40px; height: 40px; margin: -20px 0 0 -20px; } #cbox b::after { left: 13px; top: 13px; width: 14px; height: 14px; } }
#cropbox h2 { margin-top: 4px; }
.croptools { margin-top: 10px; }
.croptools .ghost { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 420px) { #cropword { display: none; } #cropbtn { width: 38px; justify-content: center; padding: 0; } }
#tobox { background: color-mix(in srgb, var(--bg, #0a0d13) 93%, transparent); border-color: var(--ember); color: var(--ember); }
#tobox::after { content: " \2193"; }
#tobox.ic::after { content: none; }          /* the download icon says it */
#tobox { white-space: nowrap; }
/* a narrow phone: the bar under the picture holds "Export", undo, redo, crop, compare and full size in one row (it ran
   past the screen's edge, 27 Nov 2026): smaller round buttons, full size as its icon alone (its name stays for readers) */
@media (max-width: 420px) {
  .easelbar { gap: 6px; padding: 0 8px; }
  .easelbar .tools { gap: 4px; }
  .easelbar .chip.icon, #cropbtn { width: 36px; }
  #fullbtn { width: 36px; padding: 0; justify-content: center; font-size: 0; }
  #fullbtn.ic::before { margin: 0; width: 18px; height: 18px; }
  #tobox { padding: 0 12px; }
}
#easel:has(#busy:not([hidden])) #tobox { visibility: hidden; }
#busy { position: absolute; z-index: 6; left: 50%; bottom: 62px; transform: translateX(-50%); width: min(430px, calc(100% - 28px)); background: color-mix(in srgb, var(--bg, #0a0d13) 95%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
#busy b { font: 600 14.5px var(--sans); }
#busy span { grid-column: 1; color: var(--ink-2); font-size: 13px; }
#busy .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 5px; }
#busy .bar i { display: block; height: 100%; width: 0; background: var(--ember); transition: width .2s; }
body.guiding #busy { bottom: auto; top: 14px; }          /* the guide's card has the bottom */
#stop { grid-column: 2; grid-row: 1 / 3; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font: 500 13.5px var(--sans); }

/* ------------------------------------------------------------------ controls */
.note { font-size: 13.5px; color: var(--ink-2); border-left: 2px solid var(--line); padding: 2px 0 2px 10px; margin: 10px 0 0; }
.need { display: flex; align-items: center; gap: 10px; margin-top: 10px; border: 1px solid var(--gold); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 14px; }
.need span { flex: 1; }
.need button { border: 0; background: var(--gold); color: #1c1503; border-radius: 999px; padding: 8px 15px; font: 600 14px var(--sans); white-space: nowrap; }
#kind2 { width: 100%; }
#quality2 { margin-top: 8px; }
.ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; margin: 9px 0 0; }
.ctl label { font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.ctl output { font: 500 12.5px var(--mono); color: var(--ink-3); min-width: 44px; text-align: right; }
.ctl select, .ctl input[type=text] { grid-column: 1 / -1; width: 100%; }
/* A slider: its name, its value (which can be typed in) and ↺ on one line, the bar under them as wide as the panel.
   The bar is coloured only from where the picture started (a small mark) to the value: what was changed, and which
   way, shows at a glance. Until 27 Nov 2026 these were the browser's own sliders, orange end to end. */
.ctl.sl { grid-template-columns: minmax(0, 1fr) 5.4em 26px; grid-template-areas: "l v r" "b b b"; gap: 0 2px; margin: 8px 0 0; }
.ctl.sl label { grid-area: l; font-size: 13.5px; line-height: 1.25; color: var(--ink-2); }
.ctl.sl.moved label { color: var(--ink); }
.ctl.sl .val { grid-area: v; width: 100%; min-width: 0; padding: 3px 5px; border: 1px solid transparent; border-radius: 7px; background: none; text-align: right; font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.ctl.sl.moved .val { color: var(--ink); }
.ctl.sl .val:hover { border-color: var(--line); }
.ctl.sl .val:focus { border-color: var(--ember); background: var(--surface); color: var(--ink); outline: none; }
.ctl.sl .reset { grid-area: r; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--ember); font: 400 16px/1 var(--sans); visibility: hidden; }
.ctl.sl.moved .reset { visibility: visible; }
.ctl.sl .reset:hover { background: var(--surface); }
.ctl.sl input[type=range] { grid-area: b; }
.sl input[type=range] { --t: 16px; --h: 26px; --x: calc(var(--t) / 2); --w: calc(100% - var(--t)); --lo: min(var(--v, 0), var(--d, 0)); --hi: max(var(--v, 0), var(--d, 0));
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: var(--h); margin: 0; padding: 0; border: 0; cursor: pointer; touch-action: pan-y; background-color: transparent;
  background-image: linear-gradient(90deg, transparent calc(var(--x) + var(--d, 0) * var(--w) - 1px), var(--ink-3) 0 calc(var(--x) + var(--d, 0) * var(--w) + 1px), transparent 0),
    linear-gradient(90deg, var(--track) calc(var(--x) + var(--lo) * var(--w)), var(--ember) 0 calc(var(--x) + var(--hi) * var(--w)), var(--track) 0);
  background-size: 100% 12px, 100% 4px; background-position: center, center; background-repeat: no-repeat; }
.sl input[type=range]::-webkit-slider-runnable-track { height: var(--h); background: none; border: 0; }
.sl input[type=range]::-moz-range-track { height: var(--h); background: none; border: 0; }
.sl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--t); height: var(--t); margin-top: calc((var(--h) - var(--t)) / 2); border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--bg), 0 1px 6px #000; transition: transform .12s; }
.sl input[type=range]::-moz-range-thumb { width: var(--t); height: var(--t); border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--bg), 0 1px 6px #000; transition: transform .12s; }
.sl input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.sl input[type=range]:active::-moz-range-thumb { transform: scale(1.18); }
.sl input[type=range]:focus-visible { outline: none; }
.sl input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold); }
.sl input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold); }
.sl input[type=range]:disabled { opacity: .4; cursor: default; }
@media (pointer: coarse) { .sl input[type=range] { --t: 22px; --h: 38px; } .ctl.sl .val { font-size: 13px; } }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0 4px; }
.ctl.inline { grid-template-columns: auto minmax(0, 1fr); }
.ctl.inline select { grid-column: 2; }
input[type=text] { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14.5px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; min-height: 32px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ember); }
.small { margin-top: 12px; }

/* Pro: one card a layer */
.layer { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; background: var(--surface); }
.layer > header { display: flex; align-items: center; gap: 9px; padding: 8px 10px; }
.layer > header input[type=color] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; flex: none; }
.layer > header button.name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; font: 500 14px var(--sans); padding: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer > header button.name::after { content: " ▾"; color: var(--ink-3); }
.layer.open > header button.name::after { content: " ▴"; }
.layer > header button.x { border: 0; background: none; color: var(--ink-3); font-size: 18px; width: 32px; height: 32px; border-radius: 8px; }
.layer .body { display: none; padding: 0 10px 12px; border-top: 1px solid var(--line); }
.layer.open .body { display: block; }
.hist { display: block; width: 100%; height: 56px; margin-top: 10px; border-radius: 6px; background: var(--bg, #0a0d13); }
/* The 102 wavelengths as one bar as wide as the panel (until 27 Nov 2026 a strip 1,600 px long that scrolled sideways):
   marks above it show what is chosen (filled: used; hollow: the continuum of a line), a label follows the pointer or
   the finger, a mint line under it shows what is already downloaded, and the chosen ones are listed under it with ×. */
.spec { position: relative; margin-top: 12px; padding-top: 11px; user-select: none; -webkit-user-select: none; }
.specbar { display: grid; grid-template-columns: repeat(102, minmax(0, 1fr)); height: 30px; border-radius: 7px; overflow: hidden; background: #000; cursor: crosshair; touch-action: pan-y; }
.specbar:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.specbar span { opacity: .3; }
.specbar span.on { opacity: 1; }
.specbar span.off { opacity: .85; background-image: repeating-linear-gradient(135deg, #000b 0 2px, transparent 2px 4px); }
.specbar span.blank { background: #1d1a17; opacity: 1; cursor: not-allowed; }
.specbar span.cur { opacity: 1; box-shadow: inset 0 0 0 1px #fff; }
.specmarks { position: absolute; left: 0; right: 0; top: 0; height: 10px; pointer-events: none; }
.specmarks i { position: absolute; top: 1px; width: max(3px, calc(100% / 102)); height: 8px; border-radius: 2px; background: var(--ink); }
.specmarks i.off { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.spechave { position: relative; height: 3px; margin-top: 3px; }
.spechave i { position: absolute; top: 0; height: 3px; width: max(2px, calc(100% / 102)); background: var(--mint); }
.specticks { position: relative; height: 15px; margin-top: 2px; font: 400 10.5px/15px var(--mono); color: var(--ink-3); }
.specticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.specticks span:first-child { transform: none; }
.specticks span:last-child { transform: translateX(-100%); }
.speclens { position: absolute; z-index: 3; top: -24px; transform: translateX(-50%); padding: 3px 8px; border-radius: 7px; background: var(--ink); color: var(--surface, #121722); font: 600 12.5px/1.3 var(--mono); white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px #000a; }
.speclens::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); }
.specchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.specchips button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 3px 8px 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 500 12.5px var(--mono); color: var(--ink); }
.specchips button i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.specchips button.off i { background: none !important; box-shadow: inset 0 0 0 2px var(--ink-2); }
.specchips button::after { content: "\00d7"; font: 400 16px/1 var(--sans); color: var(--ink-3); }
.specchips button:hover::after { color: var(--ember); }
.specchips button:disabled { cursor: default; }
.specchips button:disabled::after { content: none; }
.pickhint { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; }
/* where the data come from, under the panel's last box */
.src { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); }
.src p { margin: 0; line-height: 1.5; }
.src details { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.src summary { cursor: pointer; padding: 6px 0; color: var(--ink-2); }
.src ul { margin: 4px 0 0; padding-left: 18px; font: 400 12px/1.7 var(--mono); }
.src a { color: var(--ink-2); }
#mapnote { margin-top: 8px; }

/* ------------------------------------------------------------------ the guide: a card with a few sentences, and a ring round what they are about */
.guide { position: fixed; z-index: 60; left: 16px; bottom: 16px; width: min(390px, calc(100vw - 32px)); background: #181512f7; border: 1px solid var(--ember); border-radius: 14px; padding: 11px 14px 12px; box-shadow: 0 18px 50px #000c; }
.guide.inpage { position: static; width: auto; box-shadow: none; margin: 0 0 14px; }
.guide header { display: flex; align-items: center; gap: 10px; }
.guide header b { flex: 1; min-width: 0; font: 600 12px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ember); }
.guide header span { font: 500 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.guide .x { border: 0; background: none; color: var(--ink-2); font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 9px; margin: -4px -8px -4px 0; }
.guide .gbody { display: flex; gap: 12px; align-items: flex-start; }
.guide img { width: 70px; height: auto; border-radius: 6px; flex: none; margin-top: 8px; border: 1px solid var(--line); }
.guide p { margin: 7px 0 0; font-size: 14.5px; line-height: 1.45; }
.guide .gtask { color: var(--ink-3); font-size: 13px; }
.guide .gtask.did { color: var(--mint); }
.guide .gtask.did::before { content: "✓ "; }
.guide footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.guide .gmenu { display: grid; gap: 7px; margin-top: 10px; }
.guide .gmenu button { justify-content: flex-start; text-align: left; }
.linkbtn { border: 0; background: none; color: var(--ink-3); text-decoration: underline; font-size: 13px; padding: 8px 4px; }
.cta.small { min-height: 38px; padding: 7px 16px; font-size: 14px; margin-top: 0; }
.guide .ghost.small { margin-top: 0; }
.gring { outline: 2px solid var(--ember) !important; outline-offset: 3px; animation: gring 1.4s ease-in-out infinite; }
#frame.gring, #pic.gring { outline-offset: -2px; }
@keyframes gring { 50% { outline-color: #ff7b3944; } }
@media (prefers-reduced-motion: reduce) { .gring { animation: none; } }

/* ------------------------------------------------------------------ a phone held upright, and narrow windows
   (a phone on its side keeps the desk's two columns: its screen is too low for a map above the controls) */
@media (max-width: 599px), (max-width: 899px) and (min-height: 501px) {
  body { overflow: auto; display: block; height: auto; }
  html, body { height: auto; min-height: 100%; }
  .top { position: sticky; top: 0; z-index: 20; height: calc(var(--top) + var(--sat, 0px)); }
  .ttl { display: none; }
  #app { display: block; }
  /* the map: under half of what the top bar and the app's bar of places leave (--tabs lives on body: counted here, where
     it is seen), never under 200 px; the choices and the button get the rest */
  #stage { height: clamp(200px, calc((100vh - var(--top) - var(--sat, 0px) - var(--tabs, 0px)) * .46), 520px); height: clamp(200px, calc((100svh - var(--top) - var(--sat, 0px) - var(--tabs, 0px)) * .46), 520px); position: sticky; top: calc(var(--top) + var(--sat, 0px)); z-index: 10; }
  body.studio #stage { height: min(46vh, 460px); height: min(46svh, 460px); }
  #side { overflow: visible; border-left: 0; padding-bottom: calc(40px + var(--sab, 0px)); position: relative; z-index: 1; background: var(--bg); }          /* the choices scroll away under the map, which stays in sight */
  #placehelp { display: none; }
  .act { bottom: var(--tabs, 0px); padding-bottom: 10px; }
  .act .says { margin-top: 4px; font-size: 12.5px; line-height: 1.35; }
  .act .cta { min-height: 46px; }
  /* while the guide is open its card lies along the bottom: the map or the picture gives up some height, and what
     stays in sight at the bottom stands above the card */
  .guide { left: 8px; right: 8px; width: auto; bottom: calc(8px + var(--tabs, 0px)); padding: 9px 12px 10px; }
  .guide p { font-size: 14px; }
  body.guiding #stage, body.guiding.studio #stage { height: min(32vh, 280px); height: min(32svh, 280px); }
  body.guiding #pic { max-height: calc(min(32svh, 280px) - 62px); }
  /* a field of the panel is being typed in: the keyboard has the lower half of the screen, so the map takes less of the upper */
  body.typing #stage, body.typing.studio #stage { height: min(30vh, 250px); height: min(30svh, 250px); }
  body.typing #pic { max-height: calc(min(30svh, 250px) - 62px); }
  body.guiding #side { padding-bottom: calc(var(--guideh, 0px) + 70px + var(--tabs, 0px)); }
  body.guiding .act { bottom: calc(var(--guideh, 0px) + 12px + var(--tabs, 0px)); }
  /* with the guide's card at the bottom, the button's bar stays fixed only while the guide points at that button: else
     the map above, the bar and the card left a strip of 50 px of the panel on a short phone (27 Nov 2026) */
  body.guiding:not(.ringact) .act { position: static; }
  /* what the page scrolls to (the guide's ring, "Take it with you", a field getting the keyboard) lands between the map
     that stands fixed at the top and the bars at the bottom, never under the map */
  :root { scroll-padding-top: calc(var(--top) + var(--sat, 0px) + clamp(200px, calc((100svh - var(--top) - var(--sat, 0px)) * .46), 520px) + 8px); scroll-padding-bottom: calc(120px + var(--tabs, 0px)); }
  :root:has(body.studio) { scroll-padding-top: calc(var(--top) + var(--sat, 0px) + min(46svh, 460px) + 8px); }
  :root:has(body.typing) { scroll-padding-top: calc(var(--top) + var(--sat, 0px) + min(30svh, 250px) + 8px); }
  :root:has(body.guiding) { scroll-padding-top: calc(var(--top) + var(--sat, 0px) + min(32svh, 280px) + 8px); scroll-padding-bottom: calc(var(--guideh, 0px) + 16px + var(--tabs, 0px)); }
  #pic { max-height: calc(min(46svh, 460px) - 62px); }
  #scroll { padding: 8px 10px 4px; }
  #side h1 { font-size: 27px; }
  .seg button { padding: 8px 12px; }
}
@media (max-width: 899px) { :root { --sidew: min(400px, 46vw); } }
@media (max-width: 599px), (max-width: 899px) and (min-height: 501px) { .top { gap: 7px; padding-left: 12px; padding-right: 10px; } .logo { font-size: 21px; gap: 7px; } #mode button { padding: 8px 11px; min-height: 36px; } #guideword { display: none; } #guidebtn { padding: 7px; width: 38px; justify-content: center; } }
@media (max-width: 380px) { .logo { font-size: 19px; gap: 6px; } .logo i { width: 11px; height: 11px; } .seg button { padding: 8px 9px; font-size: 13.5px; } #mode button { padding: 8px 8px; } .top { gap: 5px; padding-left: 9px; padding-right: 8px; } .topbtn.icon, #guidebtn { width: 36px; min-height: 36px; } #side { --pad: 12px; } }
@media (max-width: 335px) { .logo { font-size: 0; gap: 0; } .logo i { width: 16px; height: 16px; } }
/* inside the app the bar of places lies along the bottom */
html.in-app #side { padding-bottom: calc(40px + var(--tabs, 0px)); }
@media (max-height: 500px) { :root { --top: 46px; } #side h1 { font-size: 24px; } #side h2 { margin-top: 14px; } #placehelp { display: none; } }
@media (prefers-reduced-motion: reduce) { #busy .bar i { transition: none; } }

/* ------------------------------------------------------------------ a phone held upright, cropping
   The whole screen, as phone photo editors have it: the picture above, the shapes in one row that slides sideways,
   turn / mirror / reset, Cancel and Apply fixed along the bottom; the page does not move under it. Before, the picture
   kept its 46 % of the screen and the tools scrolled in the strip left below it (27 Nov 2026: "çok küçük"). */
@media (max-width: 599px), (max-width: 899px) and (min-height: 501px) {
  body.cropping { overflow: hidden; }
  body.cropping #stage, body.cropping.studio #stage, body.cropping.guiding #stage { position: fixed; left: 0; right: 0; top: calc(var(--top) + var(--sat, 0px)); bottom: calc(var(--croph, 210px) + var(--tabs, 0px)); height: auto; z-index: 30; }
  body.cropping #easel { --bar: 0px; }
  body.cropping .easelbar { display: none; }
  body.cropping #scroll { padding: 24px; }          /* room for the handles at the picture's edges, whole under a finger */
  body.cropping #pic, body.cropping.guiding #pic { max-height: calc(100vh - var(--top) - var(--sat, 0px) - var(--croph, 210px) - var(--tabs, 0px) - 48px); max-height: calc(100svh - var(--top) - var(--sat, 0px) - var(--croph, 210px) - var(--tabs, 0px) - 48px); }
  body.cropping #cropbox { position: fixed; left: 0; right: 0; bottom: var(--tabs, 0px); z-index: 31; background: var(--bg); border-top: 1px solid var(--line); padding: 10px 12px calc(12px + var(--sab, 0px)); }
  body.cropping #cropbox h2, body.cropping #crophint { display: none; }
  body.cropping #aspects { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 999px; max-width: 100%; touch-action: pan-x; }
  body.cropping #aspects::-webkit-scrollbar { display: none; }
  body.cropping #aspects button { flex: none; }
  body.cropping .croptools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  body.cropping .croptools .ghost { flex: 1 1 auto; justify-content: center; min-height: 42px; padding: 0 12px; white-space: nowrap; }          /* one line each: a word broken in two made the row twice as high */
  body.cropping #cropsays { margin: 8px 0 0; font-size: 13px; }
  body.cropping #cropbox .rowbtns.big { margin-top: 10px; }
}
