/* Colour price page. Quiet grey chrome so the colour chip reads true; the chip and the price are the only rich things.
   Two colour families only: neutral greys, and amber for "check on the Nirlat PC" notes. */
:root {
  color-scheme: light;
  --bg: #eceef1;
  --card: #ffffff;
  --soft: #f5f6f8;
  --ink: #15171a;
  --muted: #555c64;
  --line: #d6dae0;
  --note-bg: #fff2cc;
  --note-line: #e8cf85;
  --note-ink: #5e4100;
  --r: 14px;
  --font: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", "Heebo", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font);
  letter-spacing: normal; min-height: 100vh; min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.cp-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--ink); color: #fff;
}
.cp-title { margin: 0; font-size: 20px; font-weight: 700; }
.cp-fresh { margin: 0; font-size: 14px; color: #c9ced4; }
.cp-banner { margin: 0; padding: 10px 16px; font-size: 15px; background: var(--note-bg); color: var(--note-ink); border-bottom: 1px solid var(--note-line); }
.cp-banner-err { background: var(--ink); color: #fff; border-bottom: 0; }

/* layout: one column on a phone, inputs beside the result on a PC */
.cp-main { max-width: 1100px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .cp-main { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 24px; padding-top: 20px; align-items: start; }
}

.cp-label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 2px 6px; }
.cp-label + * { margin-bottom: 12px; }

.cp-paint {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-align: start;
}
.cp-paint-name { font-size: 19px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cp-paint.is-empty .cp-paint-name { color: var(--muted); font-weight: 400; }
.cp-chev { flex: none; color: var(--muted); }

.cp-codebox { position: relative; }
.cp-code {
  width: 100%; min-width: 0; height: 60px; padding: 0 52px 0 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); font-size: 26px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.cp-code::placeholder { color: #7d848c; font-weight: 400; text-transform: none; font-size: 20px; direction: rtl; text-align: right; }
/* short phone screens: the boxes say what they are, so the labels go (still read by screen readers) and the note fits */
@media (max-width: 899px) and (max-height: 700px) {
  .cp-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cp-paint { min-height: 52px; }
  .cp-code { height: 56px; }
}
.cp-code:disabled { background: var(--soft); }
.cp-clear {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}

/* matches to pick from: still typing, digits only, or a typo */
.cp-list { display: grid; gap: 8px; }
.cp-list:empty { display: none; }
.cp-list-title { margin: 2px 2px 0; font-size: 15px; color: var(--muted); }
.cp-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: start;
}
.cp-dot { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .14); }
.cp-dot.is-none { background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #e2e5e9 5px 10px); }
.cp-pick-code { font-size: 18px; font-weight: 600; }
.cp-pick-card { margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.cp-more { margin: 0 2px; font-size: 14px; color: var(--muted); }

/* the result */
.cp-hint { margin: 0; padding: 18px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); }
.cp-msg { margin: 0 0 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.cp-msg strong { font-weight: 700; }
.cp-msg p { margin: 0; }
.cp-msg p + p, .cp-msg p + .cp-list, .cp-msg .cp-list + p { margin-top: 10px; }

/* the fan-deck chip: the colour, then its white label strip */
.cp-chip { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cp-swatch { height: 64px; border-bottom: 1px solid rgba(0, 0, 0, .1); }
.cp-swatch.is-none {
  background: repeating-linear-gradient(135deg, #f3f4f6 0 10px, #e6e8ec 10px 20px);
  display: grid; place-items: center; color: var(--muted); font-size: 14px;
}
@media (min-width: 900px) { .cp-swatch { height: 150px; } }
.cp-strip { display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.cp-skel .cp-swatch { background: #e3e6ea; }
.cp-skel-line { display: block; width: 45%; height: 26px; border-radius: 8px; background: #e3e6ea; }
.cp-id { min-width: 0; }
.cp-code-big { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.cp-card { font-size: 14px; color: var(--muted); }
.cp-base { margin-inline-start: auto; flex: none; display: flex; align-items: center; gap: 8px; }
.cp-base-word { font-size: 15px; color: var(--muted); }
.cp-base-letter {
  min-width: 52px; height: 52px; padding: 0 10px; display: grid; place-items: center; border: 2px solid var(--ink);
  border-radius: 12px; font-size: 30px; font-weight: 800; line-height: 1;
}

.cp-cans { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.cp-can {
  min-width: 76px; min-height: 48px; padding: 6px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; font-size: 18px; font-weight: 600;
}
.cp-can[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.cp-price { margin-top: 12px; padding: 12px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.cp-price-for { margin: 0; font-size: 15px; color: var(--muted); }
.cp-price-row { margin: 2px 0 0; }
.cp-price-num { font-size: 44px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cp-price.is-wait .cp-price-num { display: block; font-size: 20px; font-weight: 400; color: var(--muted); }

.cp-note { margin: 10px 0 0; padding: 10px 14px; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; color: var(--note-ink); font-size: 15px; }
.cp-note-in { margin-top: 8px; }
.cp-note strong { font-weight: 700; }

/* paint picker */
.cp-sheet {
  width: min(560px, 100vw); max-width: 100vw; height: min(720px, 100dvh); max-height: 100dvh; margin: auto; padding: 0;
  border: 0; border-radius: var(--r); background: var(--bg); color: var(--ink);
}
.cp-sheet::backdrop { background: rgba(21, 23, 26, .55); }
@media (max-width: 599px) { .cp-sheet { width: 100vw; height: 100dvh; border-radius: 0; } }
.cp-sheet[open] { display: flex; flex-direction: column; }
.cp-sheet-top { display: flex; gap: 8px; padding: 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.cp-search {
  flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 18px;
}
.cp-close { flex: none; width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.cp-paints { list-style: none; margin: 0; padding: 8px 12px 16px; overflow-y: auto; flex: 1; }
.cp-paints li + li { margin-top: 6px; }
.cp-paint-opt {
  width: 100%; min-height: 54px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: start;
}
.cp-paint-opt[aria-current="true"] { border: 2px solid var(--ink); }
.cp-paint-opt .he { font-size: 18px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cp-paint-opt .en { flex: none; font-size: 13px; color: var(--muted); }
.cp-empty { padding: 16px; color: var(--muted); }

/* the lock (S4): until the office password opens the files, only this shows */
.cp-lock { display: none; }
.is-locked .cp-lock { display: block; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.is-locked .cp-main, .is-locked .cp-fresh { display: none; }
.cp-lock-box { max-width: 420px; margin: 0 auto; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.cp-lock-title { margin: 0; font-size: 22px; font-weight: 700; }
.cp-lock-sub { margin: 4px 0 16px; color: var(--muted); font-size: 15px; }
.cp-lock .cp-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.cp-pass {
  width: 100%; min-width: 0; height: 56px; padding: 0 16px; background: var(--soft); border: 1px solid var(--line);
  border-radius: var(--r); font-size: 22px; letter-spacing: .06em;
}
.cp-lock-err { margin: 10px 0 0; padding: 10px 14px; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; color: var(--note-ink); font-size: 15px; }
.cp-go {
  width: 100%; min-height: 54px; margin-top: 14px; border: 0; border-radius: var(--r); background: var(--ink); color: #fff;
  font-size: 19px; font-weight: 700;
}
.cp-go:disabled { opacity: .55; cursor: default; }

@media (prefers-reduced-motion: no-preference) {
  .cp-can, .cp-pick, .cp-paint-opt { transition: background-color .12s ease-out, border-color .12s ease-out; }
}
