/* Ubuntu (Ubuntu Font Licence 1.0), served from this site so every device renders the brand font. Latin subset. Licence: fonts/UFL.txt */
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ubuntu-regular.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ubuntu-medium.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ubuntu-bold.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu Viewizer"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ubuntu-italic.woff2") format("woff2"); }
/* Layout: one centered column; header, drop zone, then a two-pane workspace (image | color panels) that stacks on narrow screens. */
:root {
  --bg: #000000;          /* pitch-black, by brand requirement */
  --surface: #07090c;     /* panels, slight blue bias */
  --line: #1a2027;
  --line-strong: #2b343e;
  --fg: #eef4f8;
  --muted: #7f8b97;
  --brand-a: #8b66f4;     /* wordmark gradient start (violet), fitted from the logo files */
  --brand-b: #29c6e2;     /* wordmark gradient end (cyan) */
  --brand-gradient: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  --accent: #4aa2eb;      /* gradient midpoint, used for flat UI accents */
  --accent-dim: rgba(74, 162, 235, 0.08);
  --accent-dim: rgba(143, 212, 255, 0.08);
  --danger: #ff8f8f;
  --font-display: "Ubuntu Viewizer", "Ubuntu", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Ubuntu Viewizer", "Ubuntu", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace; /* system faces: no third-party font request */
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding-block: 56px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */
.brand { --wm-size: clamp(56px, 10vw, 96px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand-icon { width: 76px; height: 76px; margin-bottom: 18px; display: block; }
.brand .brand-icon { cursor: pointer; } /* in the top logo it reloads the page (script.js), like the word Viewizer */
.gradient-text {
  color: var(--accent);
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--wm-size);
  line-height: 1;
  letter-spacing: 0;
}
.wordmark a { color: inherit; text-decoration: none; } /* the word Viewizer reloads the page */
.wordmark .view { font-weight: 700; }
.wordmark .izer { font-weight: 400; }
.tagline { margin: 0; font-size: calc(var(--wm-size) * 0.333); font-weight: 400; line-height: 1.15; } /* same 3:1 ratio as the logo */
.slogan { margin: 10px 0 0; font-size: 15px; font-style: italic; font-weight: 400; }

/* Drop zone */
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-dim); }
.dropzone.is-over { border-style: solid; }
.dz-icon { width: 36px; height: 36px; color: var(--accent); }
.dz-title { margin: 0; font-size: 16px; font-weight: 500; }
.dz-title strong { color: var(--accent); font-weight: 700; }
.dz-folder { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 820px), (hover: none) { .dz-folder { display: none; } } /* phones: no folder dialog; several images can still be selected */
.dz-sub { margin: 0; font-size: 13px; color: var(--muted); }
.dz-privacy { margin: 4px 0 0; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dz-error { margin: 4px 0 0; font-size: 13px; color: var(--danger); }
/* The drop zone sits above the image, as wide as the image column. On desktop it is a compact two-line bar. */
@media (min-width: 821px) and (orientation: landscape), (min-width: 1200px) {
  .dropzone { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 10px; row-gap: 2px; padding: 12px 16px; }
  .dropzone::before { content: ""; flex-basis: 100%; order: 2; } /* line break between the title and the details */
  .dz-icon { width: 20px; height: 20px; order: 0; }
  .dz-title { font-size: 14px; order: 1; }
  .dz-folder { order: 1; font-size: 12px; }
  .dz-sub { font-size: 12px; order: 3; }
  .dz-privacy { margin: 0; order: 4; }
  .dz-sub { flex-basis: 100%; } /* the column is narrow now: formats and privacy note on their own lines */
  .dz-error { order: 5; flex-basis: 100%; margin: 2px 0 0; }
}

/* Workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 820px), (max-width: 1199px) and (orientation: portrait) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 821px) and (orientation: landscape), (min-width: 1200px) {
  .brand { --wm-size: clamp(48px, 5vw, 96px); } /* logo at the top of the right column */
}
@media (min-width: 1200px) { .workspace { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } } /* wide screens: bigger image */

.viewer { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.viewer-meta .name { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; max-width: 100%; } /* the whole file name, on as many lines as it needs (no "...") */
.viewer-meta .dims { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
  min-height: 240px;
}
/* The image fills the column width (small images are scaled up), limited to 68% of the window height; --ar = width / height, set by script.js */
.frame { position: relative; display: block; width: min(100%, calc(68vh * var(--ar, 1.5))); line-height: 0; }
#view {
  display: block;
  width: 100%; height: auto;
  border-radius: 6px;
  cursor: none;
  touch-action: none;
}
html.lens-drag, html.lens-drag * { cursor: none !important; } /* pointer dragging the lens past the image edge */
.hint { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }
/* Mouse and keyboard texts, or touch texts on touch screens */
.for-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .for-mouse { display: none; } .for-touch { display: inline; } }
/* Thumbnails of the opened images: two rows, scrolling sideways when there are more */
.thumbs { display: grid; grid-template-rows: repeat(2, 40px); grid-template-columns: repeat(var(--cols, 1), 40px); grid-auto-flow: row; gap: 6px; overflow-x: auto; padding: 3px; }
.side-logo[hidden], .thumbs[hidden] { display: none; } /* display: grid above would otherwise override the hidden attribute */
.thumb { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); opacity: .7; transition: opacity .12s; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* Loupe */
.loupe {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translate(-50%, -50%);
  z-index: 5;
  line-height: 1.2;
}
.loupe[hidden] { display: none; } /* the display: flex above would otherwise override the hidden attribute */
.loupe-lens {
  width: 150px; height: 150px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px #000, 0 12px 32px rgba(0,0,0,.6);
  background: #000;
}
.loupe-lens canvas { display: block; width: 150px; height: 150px; }
.loupe-label {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); /* inside the lens, so clipping keeps it with the circle */
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: rgba(0, 0, 0, .78); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px 10px 3px 6px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.loupe-label i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); display: block; }
/* Phones and tablets: lens at half size (75 px); the color label goes just under the circle, where it fits */
@media (max-width: 820px), (hover: none) {
  .loupe-lens, .loupe-lens canvas { width: 75px; height: 75px; }
  .loupe-label { top: calc(100% + 4px); bottom: auto; font-size: 10px; padding: 2px 8px 2px 5px; gap: 5px; }
  .loupe-label i { width: 10px; height: 10px; }
}

/* Panels */
.panels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg); }
.panel-note { font-size: 12px; color: var(--muted); }
.text-btn { background: none; border: 0; padding: 2px 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.text-btn:hover { color: var(--accent); }

.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.swatch {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
}
.swatch .fill { display: block; width: 56px; max-width: 100%; align-self: center; aspect-ratio: 1; border-radius: 12px; /* same size as the detail chip (56×56) */ box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .12s; }
.swatch:hover .fill { transform: translateY(-2px); }
.swatch[aria-pressed="true"] .fill { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.swatch .hex { font-family: var(--font-mono); font-size: 11px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.swatch .share { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }

.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 8px; }
.pick { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.pick.is-new { animation: pop .35s ease-out; }
.pick-item { position: relative; min-width: 0; }
.pick-item .pick { display: block; width: 100%; }
.pick-del {
  position: absolute; top: -5px; right: -5px;
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #000; color: var(--fg);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1;
  opacity: 0; pointer-events: none; /* hidden but still reachable with Tab */
}
.pick-del::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; } /* larger touch target */
.pick-del svg { width: 10px; height: 10px; }
.pick-del:hover, .pick-del:focus-visible { border-color: var(--accent); color: var(--accent); }
.pick[aria-pressed="true"] + .pick-del, .pick:focus-visible + .pick-del, .pick-del:focus-visible { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .pick-item:hover .pick-del { opacity: 1; pointer-events: auto; } }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
.empty { margin: 0; font-size: 13px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; text-align: center; }

/* Color data */
.detail-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-chip { width: 56px; height: 56px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.detail-title { min-width: 0; }
.detail-title .big { font-family: var(--font-mono); font-size: 20px; font-weight: 500; }
.detail-title .src { font-size: 12px; color: var(--muted); }
.values { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.value-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; background: #000;
}
.value-row dt { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin: 0; }
.value-row dd { margin: 0; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; user-select: all; }
/* RGB / CMYK: a copy icon under each number copies that number alone */
.value-row.has-parts { padding-block: 6px; } /* keeps the panel almost as short as before */
.value-row.has-parts dd { display: flex; align-items: flex-start; }
.part { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.part-btn { display: flex; align-items: center; justify-content: center; width: 18px; height: 16px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: none; color: var(--muted); cursor: pointer; user-select: none; }
.part-btn svg { width: 10px; height: 10px; }
.part-btn:hover, .part-btn:focus-visible { color: var(--accent); border-color: var(--accent); }
.copy-btn {
  background: none; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--fg);
  display: inline-flex; align-items: center; gap: 6px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Narrow panels (phones, tablets): the Copy buttons show only their icon so the whole RGB/CMYK value fits;
   very narrow (iPhone SE): the HEX/RGB/CMYK label goes on its own line above the value */
.values { container-type: inline-size; }
@container (max-width: 350px) {
  .copy-btn { padding: 6px 8px; }
  .copy-btn .copy-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .value-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
}
@container (max-width: 300px) {
  .value-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-left: 10px; }
  .value-row dt { grid-column: 1 / -1; }
  .value-row dd { grid-column: 1; }
  .value-row .copy-btn { grid-column: 2; grid-row: 2; }
}
.copy-btn svg { width: 13px; height: 13px; }
.detail-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.detail-foot .text-btn { white-space: nowrap; flex: none; }

.main { display: flex; flex-direction: column; gap: 28px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px); opacity: 0;
  background: var(--brand-gradient); color: #000; font-weight: 500; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  transition: opacity .18s, transform .18s; pointer-events: none; z-index: 20;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Copy confirmation shown next to the pointer (left/top set by script.js) */
.toast.at-pointer { bottom: auto; transform: translateY(6px); max-width: min(320px, calc(100% - 16px)); transition: opacity .15s, transform .15s; }
.toast.at-pointer.show { transform: none; }

/* Footer, like qunnum.com: "How does Viewizer work?" and "Privacy" open and close on click */
footer { margin-top: auto; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-block: 20px 0; }
footer p { margin: 0; }
.foot > * { width: 100%; max-width: 680px; margin-inline: auto; }
.foot > .foot-bot { max-width: none; } /* bottom line spans the whole design: © at the left edge, X | Privacy at the right edge */
.how-btn::before, .foot-privbtn::before { content: "\25B8"; display: inline-block; margin-right: 6px; transition: transform .15s; }
.how-btn[aria-expanded="true"]::before, .foot-privbtn[aria-expanded="true"]::before { transform: rotate(90deg); }
.how-btn:hover, .foot-privbtn:hover { color: var(--fg); }
/* "How does Viewizer work?": under the HEX/RGB/CMYK panel, level with the eyedropper bar; its text opens in the footer */
.how-wrap { display: flex; align-items: center; justify-content: center; }
.how-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.foot ul { margin: 10px 0 0; padding-left: 18px; text-align: left; }
.foot li { margin: 0 0 4px; line-height: 1.45; }
.foot-howbox { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
/* Bottom line: © on the left, the tagline exactly in the middle, X | Privacy on the right */
.foot-bot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; }
.foot-tag { text-align: center; }
.foot-r { display: inline-flex; align-items: center; justify-self: end; }
@media (max-width: 480px) { /* too narrow for one line: the tagline goes centred just above */
  .foot-bot { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .foot-tag { grid-column: 1 / -1; grid-row: 1; }
}
.foot-sep { margin: 0 8px; }
.foot-privbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
/* Language: EN · ES · CA in the top right corner of the logo block; it takes no height. The current one is white */
.brand { position: relative; }
.lang { position: absolute; top: -6px; right: -6px; display: flex; font-size: 13px; z-index: 1; }
.lang button { background: none; border: 0; padding: 6px 6px; font: inherit; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 6px; }
.lang button:hover { color: var(--fg); }
.lang button[aria-pressed="true"] { color: var(--fg); font-weight: 700; cursor: default; }
.foot-privbox { margin-top: 10px; }
.foot-hintro, .foot-pintro, .foot-contact { margin: 10px 0 0; text-align: left; }
.foot-hintro { margin-top: 0; }
.foot-pintro { font-weight: 600; }
.foot-upd { margin: 8px 0 0; text-align: left; }
.foot-x { display: inline-flex; vertical-align: -2px; color: var(--muted); }
.foot-x:hover, .foot-x:focus-visible { color: #fff; }

@media (max-width: 480px) {
  .page { padding-block: 36px 24px; gap: 28px; }
  .swatches { gap: 4px; }
  .swatch .share { display: none; }
  .viewer > .panel:not(.picks-panel) { padding-inline: 12px; } /* room for the full HEX under each dominant color (iPhone SE: 320 px) */
}
@media (max-width: 360px) {
  .swatch .hex { font-size: 10px; letter-spacing: -0.02em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* Mobile: the HTML puts the logo, drop zone, file name and hint in the right column (.panels);
   here both columns dissolve so everything keeps the single-column order: logo, drop zone, name, Eyedropper, image, hint, colors. */
@media (max-width: 820px), (max-width: 1199px) and (orientation: portrait) {
  .viewer, .panels { display: contents; }
  .brand { order: 1; }
  .dropzone { order: 2; }
  .viewer-meta { order: 3; }
  .viewer > .picks-panel { order: 4; } /* Eyedropper just above the image, so the picked colors stay in view while tapping */
  .stage { order: 5; }
  .hint, .thumbs { order: 6; }
  .panels > .panel, .viewer > .panel:not(.picks-panel) { order: 7; }
  .how-wrap { order: 8; margin-top: -12px; }
  .viewer-meta, .stage, .hint, .thumbs, .viewer > .panel { margin-top: -12px; } /* same 12px spacing as before inside the image column */
}
@media (min-width: 1200px) { .swatches { grid-template-columns: repeat(10, minmax(0, 1fr)); } } /* dominant colors in one row under the image */
/* Desktop: the page fits the window (no scrollbars). The image takes all the height left by the dominant colors and the
   eyedropper bar under it (the stage is a size container); if the right column is taller than the window, the page scrolls as before. */
@media (min-width: 821px) and (orientation: landscape), (min-width: 1200px) {
  .page { height: calc(100vh - 16px); height: calc(100dvh - 16px); min-height: 0; padding-block: 12px 4px; gap: 8px; } /* 16px = body margin */
  .main { flex: 1 0 auto; }
  .workspace { flex: 1 0 auto; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .viewer { gap: 10px; }
  .stage { flex: 1 1 0; min-height: 240px; container-type: size; padding: 8px; }
  .frame { width: min(100cqw, calc(100cqh * var(--ar, 1.5))); }
  .viewer > .panel { padding: 12px 18px; gap: 8px; }
  /* Footer text open: the page grows and scrolls, the image keeps the size it had */
  .panels { position: relative; padding-bottom: calc(var(--bar-h, 38px) + 10px); } /* room for "How does Viewizer work?" */
  .how-wrap { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h, 38px); } /* centred on the "Dominant Colors Detected" title line (height set by script.js) */
  .side-logo { position: absolute; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; } /* logo icon moved under the HEX/RGB/CMYK panel (script.js) */
  .side-logo .brand-icon { margin: 0; }
  .page.foot-open { height: auto; padding-bottom: 24px; }
  .page.foot-open .stage { flex: none; height: var(--stage-h, auto); }
  footer { padding-top: 8px; }
  .panels { gap: 10px; } /* room for the thumbnails without scrolling */
  /* Custom Color Eyedropper: one compact bar under the dominant colors (title, picks, Clear) */
  .viewer > .picks-panel { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 18px; }
  .picks-panel .panel-head { display: contents; }
  .picks-panel h2 { white-space: nowrap; }
  .picks-panel .picks { order: 1; flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .picks-panel .picks:empty { display: none; }
  .picks-panel .pick-item { width: 32px; flex: none; }
  .picks-panel .pick-del { top: -4px; right: -4px; width: 16px; height: 16px; } /* smaller ×, so it never covers the centre of the circle */
  .picks-panel .pick-del::before { inset: -2px; }
  .picks-panel .pick-del svg { width: 8px; height: 8px; }
  .picks-panel .empty { order: 1; flex: 1 1 0; border: 0; padding: 0; text-align: left; }
  .picks-panel .text-btn { order: 2; }
}
/* Wide desktop: the drop zone (square, left) and the logo (right) share the top of the right column, half each;
   the space saved holds up to 5 rows of thumbnails (more scroll inside the strip). */
@media (min-width: 1200px) {
  .panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .panels > * { grid-column: 1 / -1; }
  .panels > .dropzone { grid-column: 1; grid-row: 1; aspect-ratio: 1; }
  .panels > .brand { grid-column: 2; grid-row: 1; align-self: stretch; justify-content: center; container-type: inline-size; } /* full row height: the logo stays centred and the language buttons sit at the top, level with the drop zone */
  .brand { --wm-size: 23cqi; } /* the wordmark fits the half column */
  .brand-icon { width: calc(var(--wm-size) * 0.8); height: calc(var(--wm-size) * 0.8); margin-bottom: 10px; }
  .slogan { margin-top: 6px; font-size: 13px; }
  .dropzone { flex-direction: column; flex-wrap: nowrap; justify-content: center; row-gap: 6px; padding: 16px; }
  .dropzone::before { display: none; }
  .dz-icon { width: 32px; height: 32px; }
  .dz-sub, .dz-privacy { flex-basis: auto; }
  .dz-privacy { display: block; } /* lock icon and text centred together */
  .dz-privacy svg { vertical-align: -1px; margin-right: 4px; }
  .thumbs { grid-template-columns: repeat(auto-fill, 40px); grid-template-rows: none; grid-auto-rows: 40px; overflow: hidden auto; max-height: calc(5 * 40px + 4 * 6px + 6px); }
}
/* Phones and tablets in portrait: smaller logo, compact drop zone and Eyedropper bar, so the image shows on the first screen */
@media (max-width: 820px), (max-width: 1199px) and (orientation: portrait) {
  .page { padding-block: 20px 24px; gap: 28px; }
  .workspace { gap: 20px; }
  .brand { --wm-size: clamp(40px, 11vw, 64px); }
  .brand-icon { width: 48px; height: 48px; margin-bottom: 8px; }
  .slogan { margin-top: 4px; font-size: 13px; }
  .dropzone { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 10px; row-gap: 4px; padding: 12px 16px; }
  .dropzone::before { content: ""; flex-basis: 100%; order: 2; }
  .dz-icon { width: 20px; height: 20px; order: 0; }
  .dz-title { font-size: 14px; order: 1; }
  .dz-folder { order: 1; font-size: 12px; } /* narrow desktop windows only; hidden on touch screens */
  .dz-sub { font-size: 12px; order: 3; flex-basis: 100%; }
  .dz-privacy { margin: 0; order: 4; flex-basis: 100%; display: block; } /* lock icon and text centred together, also on two lines */
  .dz-privacy svg { vertical-align: -1px; margin-right: 4px; }
  .dz-error { order: 5; flex-basis: 100%; margin: 2px 0 0; }
  .viewer > .picks-panel { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; }
  .picks-panel .panel-head { display: contents; }
  .picks-panel h2 { white-space: normal; min-width: 0; } /* the Catalan and Spanish titles are longer: two lines on narrow phones */
  .picks-panel .picks { order: 1; flex: 1 1 100%; min-width: 0; }
  .picks-panel .picks:empty { display: none; }
  .picks-panel .empty { order: 1; flex: 1 1 160px; min-width: 0; border: 0; padding: 0; text-align: left; } /* goes under the title when the line is too short */
  .picks-panel .text-btn { order: 0; margin-left: auto; } /* Clear stays on the title line, at the right, as in V048 */
  .stage { min-height: 0; padding: 8px; } /* no empty band around a short (landscape) image */
  /* HEX/RGB/CMYK rows: value (15 px) on the left with the per-number copy icons under it; on the right, the label
     right-aligned above the copy-all button. Copy icons twice the desktop size (all 26 px, per number 20 px). */
  .value-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 10px; padding: 8px 8px 8px 12px; }
  .value-row.has-parts { padding-block: 8px; }
  .value-row dt { grid-column: 2; grid-row: 1; justify-self: center; text-align: center; padding-left: 0.12em; } /* centred over its copy-all button; the padding balances the letter-spacing after the last letter */
  .value-row dd { grid-column: 1; grid-row: 2; align-self: center; font-size: 15px; overflow: visible; } /* value centred on its copy-all button */
  .value-row .copy-btn { grid-column: 2; grid-row: 2; justify-self: center; padding: 9px; border-radius: 10px; }
  .copy-btn svg { width: 26px; height: 26px; }
  .copy-btn .copy-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .part { gap: 2px; } /* number and its icon close together, so the block is about as tall as the copy-all button */
  .value-row .part + span { margin-right: -4px; } /* tighter ", " between the numbers */
  .part-btn { width: 36px; height: 32px; border-radius: 8px; }
  .part-btn svg { width: 20px; height: 20px; }
  @media (max-width: 480px) { .part-btn { width: 27px; height: 24px; border-radius: 6px; } .part-btn svg { width: 15px; height: 15px; } } /* phones: per-number icons at 1.5x, so "cmyk( ... )" fits on one line */
  @media (max-width: 360px) { .value-row.has-parts dd { grid-column: 1 / -1; grid-row: 3; } .value-row { row-gap: 6px; } } /* iPhone SE: RGB/CMYK value on its own full-width line under the label and copy-all button */
  @media (max-width: 389px) { .panels > .panel { padding-inline: 12px; } .value-row { padding-left: 8px; } .value-row dd { letter-spacing: -0.03em; } } /* iPhone SE: room for the widest CMYK, e.g. cmyk(100%, 100%, 0%, 0%) (also iPhone 8, 375 px) */
  .page.detail-up .panels > .panel { order: 4; } /* HEX/RGB/CMYK panel just under the Eyedropper after tapping one of its colors (script.js) */
}
