
  :root { --bg: #f1f1f1; --ink: #1d1d1f; --mute: #6e6e73; --line: rgba(0,0,0,.09); --shadow: .22; --tile: 150px; }
  * { box-sizing: border-box; }
  body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif; color: var(--ink); background: var(--bg); transition: background .25s; }
  header { position: sticky; top: 0; z-index: 5; background: rgba(250,250,250,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
    padding: 10px max(16px, env(safe-area-inset-left)); display: grid; gap: 8px; }
  .line { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
  h1 { font-size: 15px; margin: 0 6px 0 0; font-weight: 600; }
  .grp { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .lbl { color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
  .sw { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
  .sw[aria-pressed="true"] { outline: 2px solid #0a84ff; outline-offset: 2px; }
  input[type=color] { width: 32px; height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
  input.hex { width: 80px; font: 12px ui-monospace, Menlo, monospace; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
  button.t { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
  button.t[aria-pressed="true"] { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
  button.t:disabled { opacity: .4; cursor: default; }
  select, input.q { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
  input.q { width: 190px; }
  .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .seg button.t { border: 0; border-radius: 0; }
  .spacer { flex: 1; }
  .chip { display: none; align-items: center; gap: 6px; font-size: 13px; padding: 3px 6px 3px 10px; border-radius: 999px; background: #1d1d1f; color: #fff; }
  .chip.on { display: inline-flex; } .chip button { font: inherit; border: 0; background: rgba(255,255,255,.2); color: #fff; border-radius: 999px; width: 20px; height: 20px; cursor: pointer; padding: 0; }
  .brandlink { color: inherit; text-decoration: underline; text-decoration-color: rgba(0,0,0,.25); text-underline-offset: 2px; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
  .brandlink:hover { text-decoration-color: currentColor; }
  .panel { position: absolute; right: max(16px, env(safe-area-inset-right)); top: 100%; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 14px; display: none; gap: 12px; width: min(420px, calc(100vw - 32px)); }
  .panel.on { display: grid; }
  body.snap .bar, body.snap .panel { display: none !important; }
  .more { text-align: center; color: var(--mute); padding: 18px; font-size: 13px; }
  input[type=range] { width: 100px; }
  main { padding: 20px max(16px, env(safe-area-inset-left)) 90px; }
  .pic { position: relative; aspect-ratio: 3/4; }
  .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
  .floor { position: absolute; left: var(--fl, 18%); width: var(--fw, 64%); top: var(--fy, 94%); height: 4.5%; transform: translateY(-55%); border-radius: 50%; z-index: 0;
    background: radial-gradient(closest-side, rgba(0,0,0,var(--shadow)), rgba(0,0,0,0)); }
  body.noshadow .floor { display: none; }
  /* sheet */
  .sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 4px 2px; }
  .tile { position: relative; cursor: zoom-in; border-radius: 6px; }
  .tile:hover { background: rgba(127,127,127,.08); }
  .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; z-index: 2; display: none; }
  body.dots .dot { display: block; }
  .dot.approve { background: #2e9e5b; } .dot.fix { background: #e3a21a; } .dot.reject { background: #d0453a; } .dot.none { display: none !important; }
  .tip { position: fixed; z-index: 30; pointer-events: none; background: rgba(20,20,22,.92); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.35;
    max-width: 260px; display: none; }
  .tip b { font-size: 13px; } .tip .s { opacity: .7; }
  /* families */
  body.famview .sheet { display: grid; grid-template-columns: 1fr; gap: 0; }
  .famrow { border-bottom: 1px solid var(--line); padding: 10px 0 14px; }
  .famhead { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; font-size: 13px; }
  .famhead b { background: rgba(255,255,255,.75); padding: 1px 8px; border-radius: 6px; }
  .famhead .sub { background: rgba(255,255,255,.75); padding: 1px 6px; border-radius: 6px; }
  .famtiles { display: flex; gap: 2px; align-items: flex-end; overflow-x: auto; }
  .famtiles .tile { flex: none; width: var(--tile); }
  .tile .first { position: absolute; left: 6px; top: 6px; z-index: 2; font-size: 10px; padding: 0 6px; border-radius: 999px; background: rgba(29,29,31,.8); color: #fff; }
  .famok { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
  /* cards */
  .cards { display: none; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  body.cardview .cards { display: grid; } body.cardview .sheet { display: none; }
  .card { border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
  .card .pic { cursor: zoom-in; }
  .meta { background: #fff; padding: 10px 12px 12px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
  .name { font-weight: 600; line-height: 1.25; } .sub { color: var(--mute); font-size: 12px; }
  .acts { display: flex; gap: 6px; }
  .acts button { flex: 1; font: inherit; font-size: 13px; padding: 6px 0; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
  .acts button[data-v=approve][aria-pressed="true"] { background: #2e9e5b; color: #fff; border-color: #2e9e5b; }
  .acts button[data-v=fix][aria-pressed="true"] { background: #e3a21a; color: #fff; border-color: #e3a21a; }
  .acts button[data-v=reject][aria-pressed="true"] { background: #d0453a; color: #fff; border-color: #d0453a; }
  textarea { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; min-height: 34px; color: var(--ink); background: #fff; }
  .batchnote { display: grid; gap: 6px; max-width: 900px; margin-bottom: 18px; }
  .batchnote .h { font-size: 13px; color: var(--ink); background: rgba(255,255,255,.75); padding: 2px 8px; border-radius: 6px; width: max-content; max-width: 100%; }
  /* full-size view */
  .lb { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: none; transition: background .25s; }
  .lb.on { display: grid; grid-template-rows: auto 1fr; }
  .lb .top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: rgba(250,250,250,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .lb .ttl { font-weight: 600; color: inherit; text-decoration: none; } .lb .ttl:hover { text-decoration: underline; } .lb .top .sub { margin-right: auto; }
  .lb .body { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
  .lb .view { overflow: auto; min-height: 0; }
  .lb .wrap { position: relative; margin: 0 auto; width: max-content; padding: 24px; }
  .lb .wrap { display: flex; gap: 24px; align-items: center; }
  .lb.fit .wrap { width: auto; height: 100%; justify-content: center; }
  .lb .refp { margin: 0; display: grid; gap: 6px; justify-items: center; }
  .lb .refp img { display: block; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
  .lb .refp[hidden], .lb .refp img[hidden] { display: none; }
  .lb .refp figcaption b { color: var(--ink); font-weight: 500; }
  /* siblings under the bottle; the reference stays put on the right while you scroll */
  .lb .wrap { align-items: flex-start; }
  .lb.fit .wrap { height: auto; min-height: 100%; }
  .lb .mainc { display: grid; gap: 28px; justify-items: center; min-width: 0; }
  .lb.fit .mainc { flex: 1 1 0; }
  .lb .refp { position: sticky; top: 0; flex: none; }
  .lb .sibs { width: 100%; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
  .lb .sibs[hidden] { display: none; }
  .lb .sibs h3 { margin: 0; font-size: 13px; font-weight: 600; }
  .lb .sibs h3 span { font-weight: 400; color: var(--mute); }
  .lb .sibgrid { display: grid; gap: 40px; justify-items: center; }
  .lb .sib { display: grid; gap: 4px; justify-items: center; text-align: center; font: inherit; font-size: 11.5px; line-height: 1.3; color: var(--mute);
    border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
  .lb .sib b { color: var(--ink); font-weight: 500; }
  .lb .sib[disabled] { cursor: default; }
  .lb .sib .dot { display: block; top: 4px; right: 4px; }
  .lb .sib .pic2 img { cursor: pointer; }
  .lb .sib[disabled] .pic2 img { cursor: default; }
  .lb .sib > span:last-child { font-size: 12.5px; }
  .lb .refp figcaption { font-size: 12px; color: var(--mute); }
  .lb.fit .refp img { max-height: calc(100vh - 136px); max-width: calc((100vw - 360px - 72px) / 2); width: auto; height: auto; }
  .lb.fit.dual .pic2 img { max-width: calc((100vw - 360px - 72px) / 2); }
  .lb .pic2 { position: relative; }
  .lb .pic2 img { display: block; cursor: zoom-out; position: relative; z-index: 1; }
  .lb.fit .pic2 img { max-height: calc(100vh - 110px); max-width: calc(100vw - 360px); width: auto; height: auto; }
  .lb .side { background: rgba(250,250,250,.94); border-left: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; align-content: start; overflow: auto; }
  .lb .keys { color: var(--mute); font-size: 12px; }
  .lb .chk { border: 1px solid #f0c36d; background: #fff8e8; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.4; display: grid; gap: 6px; }
  .lb .chk[hidden] { display: none; }
  .lb .chk h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #9a6a00; }
  .lb .chk .row b { font-weight: 600; } .lb .chk .fx { color: var(--ink); }
  .lb .chk button { justify-self: start; font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
  .cflag { position: absolute; top: 5px; left: 5px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #e3a21a; z-index: 2; }
  @media (max-width: 760px) { .lb .body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .lb.fit .pic2 img { max-width: calc(100vw - 48px); max-height: 55vh; }
    .lb.fit.dual .pic2 img, .lb.fit .refp img { max-width: calc((100vw - 72px) / 2); max-height: 50vh; } .lb .wrap { gap: 12px; } }
  .left { position: fixed; z-index: 25; right: max(16px, env(safe-area-inset-right)); bottom: calc(58px + env(safe-area-inset-bottom, 0px)); background: rgba(29,29,31,.9);
    color: #fff; border-radius: 14px; padding: 9px 14px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); backdrop-filter: blur(8px); pointer-events: none; text-align: right; line-height: 1.2; }
  .left b { display: block; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
  .left span { font-size: 11.5px; opacity: .75; } .left .s2 { display: block; margin-top: 3px; }
  #undob { display: block; margin-top: 6px; font: inherit; font-size: 12px; color: #fff; background: rgba(255,255,255,.16); border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #undob[hidden] { display: none; }
  .lb.on ~ .left { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: calc(316px + env(safe-area-inset-right, 0px)); }
  @media (max-width: 760px) { .lb.on ~ .left { right: max(16px, env(safe-area-inset-right)); top: calc(60px + env(safe-area-inset-top, 0px)); bottom: auto; } }
  .upl { display: grid; gap: 6px; border: 1px dashed rgba(0,0,0,.2); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--mute); }
  .upl.drag { border-color: #0a84ff; background: rgba(10,132,255,.06); }
  .upl button { justify-self: start; font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
  .upl .ok { color: #2e7d4f; } .upl .err { color: #b3261e; }
  .bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(250,250,250,.95); border-top: 1px solid var(--line); padding: 9px max(16px, env(safe-area-inset-left));
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap; z-index: 5; }
  .bar .count { color: var(--mute); }
  .save { font: inherit; font-weight: 600; padding: 7px 16px; border-radius: 8px; border: 0; background: #0a84ff; color: #fff; cursor: pointer; }
  /* publish toast (2026-11-16): big, centred, with a spinner while it works */
  .toast { position: fixed; left: 50%; bottom: 72px; transform: translate(-50%, 16px); z-index: 50; display: flex; align-items: center; gap: 12px;
    max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: 14px; background: #1d1d1f; color: #fff; font-size: 15px; font-weight: 500;
    box-shadow: 0 10px 34px rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
  .toast.ok { background: #1f7a3a; } .toast.err { background: #b3261e; cursor: pointer; }
  .toast .spin { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: tspin .8s linear infinite; }
  .toast .ic { flex: none; font-size: 18px; line-height: 1; }
  .toast .sub2 { display: block; font-size: 12.5px; font-weight: 400; opacity: .8; margin-top: 2px; }
  @keyframes tspin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .toast .spin { animation-duration: 2.4s; } }

/* Local app: comfortable touch targets, phone-first review controls. */
*:focus { outline: none !important; }
button:focus-visible, [role=button]:focus-visible, a:focus-visible { background-color: #d9dfdb; color: #17251d; }
textarea:focus-visible, input:focus-visible, select:focus-visible { background-color: #f0f5f1; }
button, button.t, .acts button, .famok, select, input.q { min-height: 44px; }
button:disabled { opacity: .45; cursor: default; }
.left { pointer-events: auto; }
.sw[aria-pressed=true] { outline: none; box-shadow: inset 0 0 0 3px #0a84ff; }
.lb { height: 100dvh; }
.lb .top { min-width: 0; }
.lb .ttl { overflow-wrap: anywhere; }
.lb .side { min-height: 0; }
@media (max-width: 760px) {
 header .line { gap: 8px; }
 header h1 { flex: 1; }
 header .grp { flex: 1 1 42%; min-width: 0; }
 header select { width: 100%; min-width: 0; }
 header input.q { flex: 1; min-width: 150px; }
 header .lbl { font-size: 10px; }
 header .seg { flex: none; }
 main { padding: 12px 12px 160px; }
 .sheet { grid-template-columns: repeat(auto-fill,minmax(min(var(--tile),calc((100vw - 28px)/2)),1fr)); }
 .cards { grid-template-columns: 1fr; }
 .card .pic { max-height: 45dvh; }
 .bar { gap: 8px; padding-bottom: max(8px,env(safe-area-inset-bottom)); }
 .bar .count { flex-basis: 100%; font-size: 11px; }
 .bar .save { font-size: 12px; padding: 6px 10px; }
 .left { bottom: 122px; padding: 8px 10px; }
 .left b { font-size: 20px; }
 .lb.on ~ .left { display: none; }
 .lb .top { gap: 6px; padding: 8px 12px; }
 .lb .ttl { flex-basis: 100%; }
 .lb .top .sub { flex-basis: 100%; font-size: 11px; }
 .lb .top button { flex: 1; padding: 4px; font-size: 12px; }
 .lb .body { grid-template-rows: minmax(140px,1fr) auto; }
 .lb .wrap { padding: 12px; }
 .lb.fit .pic2 img { max-height: 42dvh; max-width: calc(100vw - 24px); }
 .lb.fit.dual .pic2 img,.lb.fit .refp img { max-width: calc((100vw - 36px)/2); max-height: 39dvh; }
 .lb .side { padding: 10px 12px max(12px,env(safe-area-inset-bottom)); gap: 8px; max-height: 36dvh; }
 .lb .acts { position: sticky; top: -10px; background: #fafafa; z-index: 2; padding: 4px 0; }
 .acts button { min-height: 48px; font-weight: 600; }
 .lb .keys, .lb .upl { display: none; }
 .famhead { flex-wrap: wrap; }
}

#mobileundo[hidden] { display: none; }
