/* cc-fix-r11 (2026-12-01): Design Review P0+P1 plus a light-theme select-pill fix. Photo/camera bottom bar: right-aligned
   self-contained #mode-select pill with a custom chevron (light and dark cards), no dead
   gap above More options, and a visible rotating disclosure chevron. Site-wide: Close
   uses :focus-visible only, tighter mobile topbar pill spacing, Charts wrapped-link
   leading, Test plate header align-items:flex-start. Builds on cc-fix-r9 (Show-mode
   tuck-chevron removed; "Cones"/"My cones" labeled chip with RGB dots). Loads LAST on
   every Cone Check page.
   Rules: actions are pills; content cards are 1px solid var(--line), 18px radius, var(--raise); no dashed or dotted
   borders; no card inside a card; one 760px content column (the live camera stage keeps 1100px); form rows use an
   11rem label column with equal 22rem controls at 520px and up; spacing 8/12/16/24/40. Colors are theme variables,
   so everything follows a live OS theme switch. */
/* ---------- S1 no dashed borders, one card style ---------- */
.coming-note{border:1px solid var(--line);border-radius:18px;background:var(--raise)}
button:disabled,.btn[disabled],#begin,#begin[disabled]{border-style:solid}
.chip-icon{border-style:solid}

/* ---------- Header My cones chip: always labeled, RGB status dots ---------- */
.cones-chip{
  gap:6px;
  padding:0 10px;
  flex:0 0 auto;
}
.cones-chip .chip-dots{
  display:inline-flex;
  align-items:center;
  gap:2px;
  flex:0 0 auto;
  height:8px;
}
.cones-chip .dot{
  box-sizing:border-box;
  width:7px;
  height:7px;
  border-radius:50%;
  border:1.5px solid var(--dot-c, currentColor);
  background:transparent;
  opacity:.55;
}
.cones-chip .dot-r{--dot-c:var(--red)}
.cones-chip .dot-g{--dot-c:var(--green)}
.cones-chip .dot-b{--dot-c:var(--blue)}
.cones-chip[data-state="set"] .dot,
.cones-chip[data-state="typical"] .dot{
  opacity:1;
  background:color-mix(in srgb, var(--dot-c) var(--dot-fill, 100%), transparent);
}
.cones-chip[data-state="set"] .dot-r,
.cones-chip[data-state="typical"] .dot-r{--dot-fill:var(--cone-l, 100%)}
.cones-chip[data-state="set"] .dot-g,
.cones-chip[data-state="typical"] .dot-g{--dot-fill:var(--cone-m, 100%)}
.cones-chip[data-state="set"] .dot-b,
.cones-chip[data-state="typical"] .dot-b{--dot-fill:var(--cone-s, 100%)}
.cones-chip .chip-word{
  display:inline;
  min-width:0;
  font-weight:650;
  line-height:1.1;
}
.cones-chip .chip-word-short{display:inline}
.cones-chip .chip-word-full{display:none}
@media (min-width:521px){
  .cones-chip .chip-word-short{display:none}
  .cones-chip .chip-word-full{display:inline}
}
/* is-tighter used to hide the chip word; now it only tightens padding so the
   label and RGB dots always stay visible. */
.site-header.v2.is-tighter{gap:3px}
.site-header.v2.is-tighter .cones-chip{padding:0 5px;gap:4px}
.site-header.v2.is-tighter .job-btn{padding:0 9px}
@media (max-width:520px){
  .cones-chip{padding:0 7px;gap:4px}
}
/* On iPhone widths, keep the header a single row: 8px edge inset (content column
   stays 16px), slightly tighter gaps, and a compact chip so "Cones" + RGB dots
   never force a wrap or clip the theme switch. */
@media (max-width:399.98px){
  .site-header.v2{
    padding-left:max(8px, env(safe-area-inset-left));
    padding-right:max(8px, env(safe-area-inset-right));
    gap:3px;
  }
  .cones-chip{padding:0 6px;gap:4px;font-size:.82rem}
  .cones-chip .dot{width:6px;height:6px}
  .cones-chip .chip-dots{height:8px}
  .cones-chip .chip-word-short{display:inline}
  .cones-chip .chip-word-full{display:none}
}
/* Legacy inner nodes (pre / val / glyph / icon) stay unused in r5 markup. */
.cones-chip .chip-icon,
.cones-chip .chip-pre,
.cones-chip .chip-val,
.cones-chip .chip-glyph{display:none}

/* ---------- S2 one 760 column on camera pages; the live stage keeps 1100 ---------- */
body:has(main .cam),body[data-job="name"],body[data-job="same"],body[data-job="wardrobe"],body[data-job="wire"],body[data-job="show"],body[data-job="leds"],body[data-job="resistor"],body[data-job="strips"],body[data-job="paint"],body[data-job="cables"]{--cc-w:760px}
main.cam{width:min(1100px,calc(100% - 2rem))}
main.cam #cam-setup{max-width:760px;margin-inline:auto}
.cam-dock{padding-left:max(1rem,calc((100% - 760px) / 2));padding-right:max(1rem,calc((100% - 760px) / 2))}

/* ---------- S3 form rows: one label column, equal controls ---------- */
.outfit-form label,.wardrobe-tools label:not(.file-btn),.wire-tools label,
.mode-panel label:not(.file-btn):not(:has(input[type=checkbox],input[type=radio])):has(select,input,textarea){
  display:grid;grid-template-columns:1fr;gap:.375rem;align-items:center;min-height:44px;font-weight:650}
.outfit-form :is(input,select),.wardrobe-tools select,.wire-tools select,.mode-panel :is(select,input[type=text]){width:100%;min-width:0;max-width:none;font-weight:400}
/* the mode picker uses the same column */
.cam-v2 .mode-row-v2{display:grid;grid-template-columns:1fr;gap:.375rem;align-items:center}
.cam-v2 .mode-row-v2 label{font-weight:650}
.cam-v2 .mode-row-v2 select{width:100%;min-width:0;max-width:none}
@media (min-width:520px){
  .outfit-form label,.wardrobe-tools label:not(.file-btn),.wire-tools label,
  .mode-panel label:not(.file-btn):not(:has(input[type=checkbox],input[type=radio])):has(select,input,textarea),
  .cam-v2 .mode-row-v2{grid-template-columns:11rem minmax(0,22rem);column-gap:.75rem}
}
/* primary form button: same width as the controls, aligned to the control column */
#save-outfit{width:100%;max-width:100%}
@media (min-width:520px){#save-outfit{justify-self:start;width:22rem;max-width:calc(100% - 11.75rem);margin-left:11.75rem}}
#save-outfit[disabled]{opacity:.55;cursor:not-allowed}
.outfit-form select:disabled{opacity:1;color:var(--muted);cursor:not-allowed}

/* ---------- S4 "Why the camera?": one card, no card inside it ---------- */
.cam .controls.cam-common{border:1px solid var(--line);border-radius:18px;background:var(--raise);box-shadow:none;padding:1rem 1.25rem;gap:.75rem}
.cam-common .perm-note{border:0;border-radius:0;background:none;box-shadow:none;padding:0;margin:0;color:var(--muted)}
.cam-common .perm-note strong{color:var(--ink);margin-bottom:.25rem}
#screen-chip{justify-self:start}

/* ---------- 2. Wardrobe ---------- */
.wardrobe-tools .wardrobe-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}
.wardrobe-tools .wardrobe-actions>*{width:100%;margin:0;justify-content:center;text-align:center}
@media (max-width:399.98px){
  .wardrobe-tools .wardrobe-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wardrobe-tools .wardrobe-actions>:first-child{grid-column:1/-1}
}
.cam h2{margin:2.5rem 0 .5rem}
.cam .mode-panel>h2:first-of-type{margin-top:1.5rem}
.cam .match-box h2{margin-top:0}

/* ---------- 3. Wire color ---------- */
.wire-tools button{justify-self:start;min-width:12rem}
.safety{border:1px solid var(--line);border-left:4px solid var(--acc);border-radius:18px;background:var(--raise);padding:1rem 1.25rem}

/* ---------- 4. LEDs, resistor, strips, paint, cables ---------- */
.mode-panel>button{margin-top:.75rem;justify-self:start}
.site-footer .foot-note{font-size:.875rem;line-height:1.5;margin:0 0 .75rem}

/* ---------- 5. Name / same / show ---------- */
#presets.pills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
@media (min-width:520px){#presets.pills{grid-template-columns:repeat(4,minmax(0,1fr))}}
#presets.pills .pill{width:100%;justify-content:center;text-align:center}
#set-my-cones:not([hidden]){display:inline-flex;align-items:center;width:fit-content;min-height:44px;margin:0 0 1rem;font-weight:650}
.show-actions:not(:has(>:not([hidden]))){display:none}

/* ---------- 6. Charts ---------- */
#charts-form{display:grid;gap:.75rem;justify-items:start}
#charts-form .file-btn{min-width:14rem;justify-content:center;background:var(--acc);color:var(--acc-ink);border-color:transparent}
#charts-form .file-btn:is(:hover,:active){background:var(--acc2);color:var(--acc-ink)}
.chart-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
.chart-presets .sample-btn{width:100%;grid-template-columns:minmax(0,1fr);justify-content:stretch;justify-items:stretch}
.chart-presets .sample-thumb{width:100%}
#region-list:empty{display:none}
h2:has(+ #region-list:empty){display:none}
#screenshot,.palette-block,h2:has(+ #region-list){margin-top:2.5rem}
#screenshot h2,.palette-block h2,h2:has(+ #region-list){margin-bottom:.5rem}
#palette-form button{min-height:44px}

/* ---------- 7. Test ---------- */
#begin[disabled]{opacity:1;background:var(--line);color:var(--muted)}
.intro{border-radius:18px}
details.cc-details{border-radius:12px}

/* ---------- 8. All tools ---------- */
.pair-form{display:grid;grid-template-columns:repeat(2,minmax(0,10rem));gap:.75rem}
.pair-form input[type=color]{width:100%;height:48px}


/* ---------- 9. UX copy 2026-11-30: screen-chip checked + empty-state disabled ---------- */
button.screen-chip[aria-pressed="true"],
#id-stage .id-actions button.screen-chip[aria-pressed="true"] {
  background: var(--acc);
  color: var(--acc-ink);
  border-color: transparent;
}
button.screen-chip[aria-pressed="true"]::before {
  content: "✓ ";
  font-weight: 700;
}
#save-swatch-card:disabled,
#export-wardrobe:disabled,
#save-chart:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--line);
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}
#id-more .job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: 0 0 .75rem;
}
#id-more .job-actions:not(:has(:not([hidden]))) { display: none; }
#id-more .job-actions button,
#id-more .job-actions .strip-target-live {
  min-height: 44px;
}
#id-more .job-actions .strip-target-live {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}


/* ---------- Show-mode hide-controls: both photos stay fully visible ---------- */
/* Override phase23 "hand them the phone" which hid the top pane and showed a
   large Back pill over the photo. One unified chrome-hidden state now: header,
   live bar, bottom card, corner labels, and save hint all leave the frame so
   100% of both comparison photos stay unobstructed. Tap the photo to restore. */
.id-stage.is-hand .split{
  position:fixed;
  inset:0;
  z-index:40;
  grid-template-rows:1fr 1fr;
}
.id-stage.is-hand .split .pane:first-child{display:block}
body.hand-phone .save-note,
body.hand-phone #hand-back{display:none !important}
#hand-back{display:none !important}

/* Tappable, dismissible Save Image hint */
.id-stage .save-note{
  z-index:8;
  pointer-events:auto;
  cursor:pointer;
}

/* Compact job select + r10 pill layout are at the end of this file (P0-1). */
.picker-compact .id-mini{
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Slimmer collapsed Show-mode bottom bar on mobile */
@media (max-width:520px){
  .picker-compact.is-show .id-card.is-min{
    width:min(25rem, calc(100% - 0.8rem));
    padding:0.25rem 0.35rem 0.25rem 0.85rem;
    bottom:max(0.35rem, env(safe-area-inset-bottom));
    gap:0.15rem;
  }
  .picker-compact.is-show .id-card.is-min .id-head{
    min-height:44px;
    gap:0.28rem;
  }
  .picker-compact.is-show .id-card.is-min .id-mini{
    font-size:0.92rem;
  }
  .picker-compact.is-show .live-bar{
    padding:max(0.3rem, env(safe-area-inset-top)) 0.4rem 0.3rem;
    gap:0.35rem;
    flex-wrap:nowrap;
  }
  .picker-compact.is-show .live-bar button{
    padding:0.28rem 0.7rem;
    font-size:0.9rem;
    white-space:nowrap;
  }
}

@media (prefers-reduced-motion:reduce){
  .picker-compact .live-bar,
  .picker-compact .id-card,
  .picker-compact .split .tag{transition:none}
}

/* ---------- r10 P0-1: .id-head alignment + self-contained #mode-select pill ---------- */
.picker-compact .id-head {
  align-items: center;
  gap: 0.5rem;
}
.picker-compact .id-text {
  flex: 1 1 auto;
  min-width: 0;
}
.picker-compact .id-kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-compact .id-head .mode-pick {
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 11.5rem;
}
.picker-compact .id-head .mode-pick select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  max-width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 1.85rem 0 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: inherit;
  /* Default / unset data-theme follows the light card (:root --card-glass). */
  background-color: rgba(28, 23, 18, 0.06);
  border: 1px solid rgba(28, 23, 18, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%231c1712' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px 12px;
}
html[data-theme="light"] .picker-compact .id-head .mode-pick select {
  background-color: rgba(28, 23, 18, 0.06);
  border: 1px solid rgba(28, 23, 18, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%231c1712' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px 12px;
}
html[data-theme="dark"] .picker-compact .id-head .mode-pick select {
  background-color: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23f6efe4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px 12px;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .picker-compact .id-head .mode-pick select {
    background-color: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23f6efe4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 12px 12px;
  }
}
.picker-compact .id-card.is-min {
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
}

/* ---------- r10 P0-2: remove dead gap above More options; tighten expanded drawer ---------- */
.picker-compact .job-actions:empty,
.picker-compact .job-actions:not(:has(> :not([hidden]))),
.picker-compact #id-more.job-actions:empty,
.picker-compact #id-more.job-actions:not(:has(> :not([hidden]))) {
  display: none;
}
#id-more .job-actions {
  margin: 0;
}
.picker-compact .id-card:not(.is-min) {
  padding: 0.75rem 0.85rem 0.45rem;
  gap: 0.5rem;
}
.picker-compact .id-more {
  gap: 0.5rem;
}
.picker-compact .id-details {
  margin-top: 0.15rem;
  padding-top: 0.1rem;
  border-top: 1px solid rgba(127, 127, 127, 0.28);
}

/* ---------- r10 P0-3: visible rotating disclosure chevron on More options ---------- */
.picker-compact .id-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}
.picker-compact .id-details summary::-webkit-details-marker,
.picker-compact .id-details summary::marker {
  display: none;
  content: none;
}
.picker-compact .id-details summary::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 14px 14px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 14px 14px;
  transition: transform 0.2s ease;
}
.picker-compact .id-details[open] summary::after {
  transform: rotate(180deg);
}

/* ---------- r10 P1-4: no unsolicited Close focus ring on open; keyboard keeps :focus-visible ---------- */
.live-bar button:focus:not(:focus-visible),
.picker-compact .live-bar button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.live-bar button:focus-visible,
.picker-compact .live-bar button:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 3px;
}

/* ---------- r10 P1-5: mobile topbar pill spacing (<=420px) ---------- */
@media (max-width: 420px) {
  .site-header.v2 {
    gap: 0.35rem;
  }
  .cones-chip,
  .job-btn {
    padding-inline: 0.55rem;
  }
}

/* ---------- r10 P1-6: Charts wrapped link line-height (do not restyle button links) ---------- */
main p a:not(.btn) {
  display: inline;
  min-height: 0;
  line-height: inherit;
  padding: 0.2rem 0;
}

/* ---------- r10 P1-7: Test active plate header alignment ---------- */
body.test-app .progress,
.progress {
  align-items: flex-start;
}

@media (prefers-reduced-motion: reduce) {
  .picker-compact .id-details summary::after {
    transition: none;
  }
}
