/* Segment stylesheet: sites. Injection-site picker (_site_card.html) on /log and /plan.
   Colours only via var(--gw-*) tokens. */

.st-card{display:flex;flex-direction:column;gap:12px;min-width:0;container-type:inline-size}
.st-card--ask{padding:14px 12px;border:1px solid var(--gw-line);border-radius:var(--gw-r-box);background:var(--gw-sand-soft)}
.lp-card>.st-card--ask{padding:0;border:0;background:none}
/* The figure's fill tracks the card: sand on white cards, white on the sand ask card (always a quiet contrast). */
.st-card--ask:not(.lp-card>.st-card--ask) .st-body{--gw-fig-fill:var(--gw-surface)}
.st-set{margin:0;padding:0;border:0;min-width:0}
.st-legend{padding:0;margin:0 0 10px;font:700 15px/20px var(--gw-font-ui);color:var(--gw-ink)}

/* Map: Left column | body | Right column. Drawn as in a mirror: your left is on the left.
   Three equal rows (1fr in auto height = the tallest tile), 64px at default text. The figure is 60x230 units:
   a 22-unit head band, then 208 units = the three rows + two gaps at 1:1, so the dots (y=54 / 126 / 198) land
   on the row centres. The svg spans the tile rows and is lifted 22px into the caption row for the head. */
.st-map{display:grid;grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr);grid-template-rows:auto repeat(3,minmax(64px,1fr));gap:8px;max-width:400px;margin:0 auto;width:100%}
/* Caption anchored to its column by a short accent bar underneath. */
.st-side{grid-row:1;position:relative;padding-bottom:6px;font:800 11px/14px var(--gw-font-ui);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;color:var(--gw-subtle);text-align:center}
.st-side::after{content:"";position:absolute;left:50%;bottom:0;width:16px;height:2px;margin-left:-8px;border-radius:1px;background:var(--gw-accent)}
.st-side.st-left{grid-column:1}
.st-side.st-right{grid-column:3}
.st-body{grid-column:2;grid-row:2/span 3;align-self:start;width:100%;height:calc(100% + 22px);min-height:230px;margin-top:-22px;overflow:visible}
.st-fig{fill:none;stroke:var(--gw-control-ring);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.st-fig .st-torso,.st-fig .st-limb,.st-fig .st-head{fill:var(--gw-sand-soft)}
.st-dot{fill:var(--gw-surface);stroke:var(--gw-accent);stroke-width:1.5}
/* Last used: a thicker accent ring around a seaglass core (shape + colour, not colour alone). */
.st-dot.is-last,
.st-map[data-last="arm_left"] .st-dot-arm_left,.st-map[data-last="arm_right"] .st-dot-arm_right,
.st-map[data-last="abdomen_left"] .st-dot-abdomen_left,.st-map[data-last="abdomen_right"] .st-dot-abdomen_right,
.st-map[data-last="thigh_left"] .st-dot-thigh_left,.st-map[data-last="thigh_right"] .st-dot-thigh_right{fill:var(--gw-seaglass);stroke:var(--gw-accent-ink);stroke-width:2.5}

/* One tile per site: centred text, whole tile is the target, every tile the same height. Picked = tint +
   accent edge + a round check inside the top corner (shape, not colour alone). */
.st-site{grid-column:1;justify-content:center;min-height:64px;padding:6px 8px;text-align:center;font-size:14px;line-height:18px}
.st-site.st-right{grid-column:3}
.st-site.st-r1{grid-row:2}.st-site.st-r2{grid-row:3}.st-site.st-r3{grid-row:4}
.st-site::before{display:none}
.st-site:has(:checked){border-width:2px;border-color:var(--gw-accent);padding:5px 7px}
/* The check sits ON the tile's top corner (a pip), so a one-line label never runs under it. */
.st-site:has(:checked)::before{display:block;position:absolute;top:-7px;right:-7px;width:20px;height:20px;border:0;border-radius:50%;box-shadow:0 0 0 2px var(--gw-surface);-webkit-mask:none;mask:none;background:var(--gw-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.6 10.3l2.9 2.9 5.9-6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat}
.gw-chip-toggle.st-site>span{overflow-wrap:normal;word-break:normal;hyphens:manual}
.st-site-t{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;width:100%}
.st-badge{display:block;max-width:100%;font:700 12px/16px var(--gw-font-ui);color:var(--gw-accent-ink);white-space:normal;text-wrap:balance;overflow-wrap:normal}
.st-badge:not(.is-last){color:var(--gw-muted)}

/* The drawing follows the choice (no JS): the picked place's dot fills. */
.st-map:has(input[value="arm_left"]:checked) .st-dot-arm_left,
.st-map:has(input[value="arm_right"]:checked) .st-dot-arm_right,
.st-map:has(input[value="abdomen_left"]:checked) .st-dot-abdomen_left,
.st-map:has(input[value="abdomen_right"]:checked) .st-dot-abdomen_right,
.st-map:has(input[value="thigh_left"]:checked) .st-dot-thigh_left,
.st-map:has(input[value="thigh_right"]:checked) .st-dot-thigh_right{fill:var(--gw-accent);stroke:var(--gw-accent-ink);stroke-width:2.5}

/* Ask mode sits inside other cards (/plan): rows fixed to the figure's geometry (3 x 64px), 72px figure
   column at 1:1, so the dots stay on the row centres. Enlarged text is handled by the stacked layout below. */
.st-card--ask .st-map{grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr);grid-template-rows:auto repeat(3,64px);column-gap:6px}
.st-card--ask .st-site{min-height:64px;padding:6px 4px}
.st-card--ask .st-site:has(:checked){padding:5.5px 3.5px}
/* "Stomach area" is 87px at 14px text; the 99px ask tile keeps 89px of line, so it stays on one line at 390. */

.st-own{margin:10px 0 0;font-size:13px;line-height:18px;color:var(--gw-muted);text-align:center}
.st-error{margin-top:10px;font-size:14px;line-height:20px}
.st-save{min-height:48px}
/* Nothing chosen yet: the save reads as waiting (outline), still enabled and focusable; a choice makes it primary. */
.st-card:not(:has(input[name=site]:checked)) .st-save{background:var(--gw-surface);color:var(--gw-accent-ink)!important;border:1px solid var(--gw-line);box-shadow:none}
@media (prefers-reduced-motion:no-preference){.st-save{transition:background-color .16s var(--gw-ease),box-shadow .16s var(--gw-ease),color .16s var(--gw-ease)}}
@media (prefers-reduced-motion:reduce){.st-save{transition:none}}

/* History: a quiet secondary disclosure under a hairline, clearly below Taken/Save in weight. */
.lp-extra.st-more{margin-top:4px;padding-top:4px;border-top:1px solid var(--gw-line)}
.lp-extra.st-more>summary{min-height:44px;margin:0;font-size:14px;line-height:20px;font-weight:600;color:var(--gw-muted)}
.lp-extra.st-more>summary>.gw-icon{width:16px;height:16px;color:var(--gw-muted)}
.lp-extra.st-more>summary:hover{color:var(--gw-ink)}
.st-list{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:0;font-size:14px;line-height:20px;color:var(--gw-muted);font-variant-numeric:tabular-nums}
.st-list li{padding:10px 0;border-bottom:1px solid var(--gw-line)}
.st-list li:last-child{border-bottom:0}
.st-list b{display:inline-block;min-width:9.75em;color:var(--gw-ink);font-weight:700}
.st-list li.is-none b{color:var(--gw-muted);font-weight:600}
.st-guide{margin:0;padding:12px;border-radius:var(--gw-r-box);background:var(--gw-sand-soft);font-size:14px;line-height:20px;color:var(--gw-muted)}

/* Enlarged text (or a very narrow card): the three columns can't hold the words, so the figure moves on top as a
   small mirrored legend and the two columns take the full width. em follows the card's text size. Measured card
   content widths at 390px: /log 308px, /plan ask 282px (17.6em at 16px) -> 15em (240px) never fires at default
   text; at 1.5x text the same cards are 12.8em / 11.7em, so it does. DOM order and radios unchanged. */
@container (max-width:15em){
  .st-map,.st-card--ask .st-map{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto repeat(3,auto);gap:8px 6px}
  .st-card--ask .st-map{width:calc(100% + 12px);max-width:none;margin:0 -6px}
  .st-map .st-body{grid-column:1/-1;grid-row:1;justify-self:center;align-self:center;width:auto;height:150px;min-height:0;margin:0 0 4px}
  /* r 5 -> 6.5 units at 150/230 scale = 8.5px dots (>= 8px), the picked/last rings stay visible. */
  .st-map .st-dot{r:6.5px}
  .st-side{grid-row:2}
  .st-side.st-right{grid-column:2}
  .st-site.st-right{grid-column:2}
  .st-site.st-r1{grid-row:3}.st-site.st-r2{grid-row:4}.st-site.st-r3{grid-row:5}
  .st-site,.st-card--ask .st-site{min-height:64px;padding:8px 4px}
  .st-site:has(:checked),.st-card--ask .st-site:has(:checked){padding:7px 3px}
}
