/* Scan coin, the weight question and the Label step (docs/plans/cloud-studio-2026-10-24/design/SCAN-COIN.md).
   Tokens only from studio.css (--ink, --panel, --rule, --soft, --chip, --ok, --warn, --focus ...), so dark mode follows. */

/* the nav's Scan coin: a small filled button after the links */
nav .navscan { margin-left: 8px; padding: 5px 12px; font-size: 13.5px; border-radius: 7px; white-space: nowrap; }
@media (max-width: 640px) { nav .navscan { margin-left: auto; } }
@media (max-width: 480px) { nav .navscan { padding: 5px 10px; } }

/* the Coins page: the one filled button, its remembered scanner, the chooser and the notices under it */
.scan-start { display: grid; justify-items: end; gap: 4px; }
.scan-start .scan-on { margin: 0; display: flex; gap: 4px; align-items: baseline; }
.scan-start .scan-on button.link { font-size: inherit; padding: 0; }
#scan-under:empty { display: none; }
#scan-under { margin: 0 0 16px; }
#scan-under .notice { margin: 0; }
.scan-choose { padding: 14px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.scan-choose .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 640px) { .scan-start { justify-items: stretch; width: 100%; } .scan-start #quickcoin { width: 100%; } }

/* the temporary name, wherever it shows */
.chip.tmp-name { border: 1px dashed var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); color: var(--ink2); }
.journey .title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.journey .title-row .chip[hidden] { display: none; }
.coin-text .chip.tmp-name { justify-self: start; margin-top: 2px; font-size: 11px; }

/* the weight question, under the steps while side A scans */
#while-scan:empty { display: none; }
.while-scan { margin-top: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
              box-shadow: var(--shadow-sm); }
.while-scan h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.while-scan > p { margin: 0 0 10px; color: var(--ink2); }
.while-scan.saved { border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.while-scan.saved p { margin: 0; color: var(--ink); }
.ws-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px 14px; align-items: start; }
.ws-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink2); min-width: 0; }
.ws-form input { width: 100%; min-width: 0; }
.w-pair { display: flex; gap: 6px; min-width: 0; }
.w-pair input { flex: 1 1 6em; min-width: 0; }
.w-pair select { flex: 0 1 auto; min-width: 0; max-width: 60%; }
.ws-grams { color: var(--ink); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.ws-acts { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ws-bad { color: var(--bad); }
@media (max-width: 560px) { .ws-form { grid-template-columns: minmax(0, 1fr); } }
.grid-form .w-pair select { max-width: 55%; }

/* the label card: the reading on its way, the AI's proposal beside what was measured and entered */
.lc-reading { margin: 12px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--focus) 40%, var(--rule));
              background: color-mix(in srgb, var(--focus) 5%, var(--panel)); }
.lc-reading p { margin: 6px 0 0; color: var(--ink2); }
.bar-track.wait i { width: 30%; animation: lc-wait 1.6s ease-in-out infinite; }
@keyframes lc-wait { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .bar-track.wait i { animation: none; width: 100%; opacity: .4; } }

.lc-groups { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 14px 0 6px; }
.lc-groups h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lc-groups .parts { margin: 8px 0; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
/* a tile is its name, its value, then whose it is, stacked at every width (a long relief line never squeezes the value) */
.lc-groups .parts li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.lc-groups .parts .v { font-size: 15px; margin-bottom: 6px; }
.lc-groups .parts .chip { margin-top: auto; }
.lc-ai { padding: 14px 16px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--warn) 70%, var(--rule));
         background: color-mix(in srgb, var(--warn) 5%, var(--panel)); min-width: 0; }
.lc-ai-label { margin: 0 0 4px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.lc-have { min-width: 0; }
.lc-conf, .lc-grade, .lc-conflict { margin: 6px 0 0; color: var(--ink2); }
.lc-grade { padding-top: 8px; border-top: 1px solid var(--rule); }
.lc-conflict { color: var(--ink); }
.chip.src-ai { border: 1px dashed var(--warn); background: var(--panel); }
.lc-acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0 6px; }
.lc-acts button:not(.ghost):not(.link) { padding: 9px 18px; }
.label-card .why { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.lc-msg:empty { display: none; }
.lc-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--soft); color: var(--ink); }
@media (max-width: 760px) { .lc-groups { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .lc-groups .parts { grid-template-columns: minmax(0, 1fr); }
                            .lc-groups .parts .v { margin-bottom: 4px; } .lc-groups .parts .chip { margin-top: 2px; }
                            .lc-ai { padding: 12px; } .lc-ai-label { font-size: 18px; } }

/* the label card's own tiles (the label in use, no reader, used up): name, value, then whose it is, stacked at phone
   width as in the proposal view, so a long source chip never squeezes the value to a letter a line */
@media (max-width: 560px) {
  .label-card .parts li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .label-card .parts .v { margin-bottom: 2px; }
  .label-card .parts .chip { margin-top: 2px; }
}
.lc-waits { margin: 4px 0 0; color: var(--ink2); }
.lc-improve { margin: 12px 0 0; color: var(--ink2); }
.lc-improve > p { margin: 0 0 2px; color: var(--ink); }
.lc-improve > ul { margin: 0 0 4px; padding-left: 18px; }
.lc-improve details ul { margin: 4px 0 0; padding-left: 18px; }
.lc-improve summary { cursor: pointer; }

/* the facts form: the name has room for a temporary or an AI name; the weight's unit stays readable */
.grid-form label.f-name { grid-column: span 2; }
@media (max-width: 560px) { .grid-form label.f-name { grid-column: 1 / -1; } }
.grid-form .w-pair select { min-width: 4.5em; }

/* at phone width the weight question comes first in the rail, where the owner looks while side A sweeps */
@media (max-width: 560px) {
  .rail-wrap { display: flex; flex-direction: column; }
  .rail-wrap > #j-error { order: -2; }
  .rail-wrap > #while-scan { order: -1; }
  .rail-wrap > #while-scan .while-scan { margin: 0 0 12px; }
}
@media (max-width: 640px) { .scan-start { margin-bottom: 12px; } }
