/* Segment stylesheet: intake. Protein and water card (_intake_cards.html) on /log, strip (_intake_strip.html) on /plan.
   Colours only via var(--gw-*) tokens. Large text: the rows are size containers in em, so a 1.5x text size flips the
   layouts (chips 3 -> 2 columns, strip button under the text) without a viewport media query. */

/* ---- /log card ---- */
.in-card{gap:0}
.in-card>.lp-card-head{margin-bottom:2px}
.in-row{container-type:inline-size;font-size:16px;display:flex;flex-direction:column;gap:12px;min-width:0;padding:16px 0}
.in-row:last-child{padding-bottom:0}
.in-row+.in-row{border-top:1px solid var(--gw-line)}
/* head: tile | number (+ quiet range under it) | undo for this row */
.in-head{display:grid;grid-template-columns:var(--gw-metric-tile) minmax(0,1fr) auto;align-items:center;column-gap:12px;min-width:0}
.in-tile{width:var(--gw-metric-tile);height:var(--gw-metric-tile);flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:var(--gw-tint);color:var(--gw-accent-ink)}
.in-tile .gw-icon{width:20px;height:20px}
.in-head:not(:has(.in-undo)){grid-template-columns:var(--gw-metric-tile) minmax(0,1fr)}
.in-line{display:flex;flex-direction:column;gap:2px;min-width:0;margin:0;font-variant-numeric:tabular-nums}
.in-num{font:600 var(--gw-fs-stat)/var(--gw-lh-stat) var(--gw-font-ui);color:var(--gw-ink);letter-spacing:-.01em;text-wrap:pretty}
.in-sub{font:400 var(--gw-fs-stat-sub)/var(--gw-lh-stat-sub) var(--gw-font-ui);color:var(--gw-muted);white-space:nowrap}

/* bar: 10px, sand track, teal fill (also when over the range: never alarm colours) */
.in-meter{position:relative}
.in-bar{display:block;width:100%;height:var(--gw-bar-h);margin:0;border:0;border-radius:var(--gw-bar-r);overflow:hidden;background:var(--gw-sand-soft);box-shadow:inset 0 0 0 1px var(--gw-bar-edge);appearance:none;-webkit-appearance:none;color:var(--gw-accent)}
.in-bar::-webkit-progress-bar{background:var(--gw-sand-soft);border-radius:var(--gw-bar-r)}
.in-bar::-webkit-progress-value{background:var(--gw-accent);border-radius:var(--gw-bar-r);transition:width .4s var(--gw-ease)}
.in-bar::-moz-progress-bar{background:var(--gw-accent);border-radius:var(--gw-bar-r)}
/* band users: the bar is full where the range starts; a tick marks that point */
.in-meter--band::after{content:"";position:absolute;right:calc(var(--gw-bar-r) + 1px);top:0;width:2px;height:var(--gw-bar-h);border-radius:1px;background:var(--gw-ink);box-shadow:0 0 0 1px var(--gw-surface)}
/* no water goal: an empty dashed track (aria-hidden), same height as a real bar, so both rows keep one rhythm */
.in-meter--empty{height:var(--gw-bar-h);box-sizing:border-box;border:1.5px dashed var(--gw-control-ring);border-radius:var(--gw-bar-r)}

/* buttons: equal chips edge to edge; undo lives in the row head (submits the row form via form=) */
.in-btns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:center}
.in-btns--one{grid-template-columns:minmax(0,1fr)}
.in-btn{min-width:44px;min-height:48px;padding:0 8px;white-space:nowrap}
.in-btns .in-btn{width:100%;font:600 17px/22px var(--gw-font-ui)}
.in-undo{grid-column:3;align-self:center;display:inline-flex;align-items:center;min-height:44px;min-width:44px;margin:0 -4px 0 0;padding:0 4px;border:0;border-radius:var(--gw-r-chip);background:none;font:500 15px/20px var(--gw-font-ui);color:var(--gw-accent-ink);text-decoration:underline;text-underline-offset:3px;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
.in-undo:hover{text-decoration-thickness:2px}
.in-undo:focus-visible,.in-btn:focus-visible{outline:2px solid var(--gw-accent);outline-offset:2px}
/* 3 chips stay in one row down to ~11em; below that 2+1 with the third chip spanning the row (no hole) */
@container (max-width:11em){.in-btns{grid-template-columns:repeat(2,minmax(0,1fr))}.in-btns--one{grid-template-columns:minmax(0,1fr)}.in-btns>.in-btn:nth-of-type(3):last-of-type{grid-column:1/-1}}
@container (max-width:15em){.in-btns .in-btn{padding:0 4px}.in-sub{white-space:normal}.in-head{grid-template-columns:var(--gw-metric-tile) minmax(0,1fr)}.in-undo{grid-column:2;justify-self:start;margin:-6px 0 -10px -4px}}

/* protein tick (/log/protein) inside the protein row: question, then Yes / Not today, under the gram buttons */
.in-tick{display:flex;flex-direction:column;gap:4px;padding-top:12px;border-top:1px dashed var(--gw-line)}
.in-tick-q{margin:0;font:500 15px/20px var(--gw-font-ui);color:var(--gw-ink);text-wrap:pretty}
.in-tick-save{margin:0;font:400 var(--gw-fs-caption)/18px var(--gw-font-ui);color:var(--gw-muted)}
.in-tick>.in-tick-seg{flex:none;width:100%;max-width:none;margin-top:6px}

/* safety notes: always fully visible, read as a calm footnote (no box), quieter than the controls */
.in-note{display:flex;gap:6px;align-items:flex-start;margin:0;padding:0;font:400 var(--gw-fs-caption)/17px var(--gw-font-ui);color:var(--gw-muted);background:none;border:0;text-wrap:pretty}
.in-note>span{min-width:0}
.in-note>.gw-icon{flex:none;width:14px;height:14px;margin-top:1.5px;color:var(--gw-subtle)}
.in-btns+.in-note,.in-tick+.in-note{margin-top:-2px}

/* water goal disclosure: same pattern as the other .lp-extra summaries + current goal chip */
.in-goal{margin-top:2px}
.in-goal-chip{flex:none;display:inline-flex;align-items:center;min-height:26px;padding:3px 10px;border-radius:999px;background:var(--gw-tint);color:var(--gw-accent-ink);font:700 13px/18px var(--gw-font-ui);white-space:nowrap}
.lp-extra.in-goal>summary>span.in-goal-chip{flex:none}
.in-goal-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end}
.in-goal-form>.lp-hint{grid-column:1/-1}
.in-goal-form .gw-input{min-height:48px;padding-top:12px;padding-bottom:12px;background-position:calc(100% - 22px) 21px,calc(100% - 16px) 21px}
.in-goal-form .gw-btn{min-height:48px;padding:0 20px;box-shadow:none}
@container (max-width:17em){.in-goal-form{grid-template-columns:minmax(0,1fr)}}

@media (prefers-reduced-motion:reduce){.in-bar::-webkit-progress-value{transition:none}}

/* ---- /plan strip ---- */
.in-strip{container-type:inline-size;font-size:15px;display:flex;flex-direction:column;margin-top:10px;padding:4px 16px;background:var(--gw-surface);border:1px solid var(--gw-line);border-radius:var(--gw-r-box);box-shadow:var(--gw-shadow-card)}
.in-strip-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:60px;padding:8px 0}
.in-strip-row+.in-strip-row{border-top:1px solid var(--gw-line)}
.in-tile--sm{width:32px;height:32px;border-radius:9px}
.in-tile--sm .gw-icon{width:18px;height:18px}
.in-strip-main{display:flex;flex-direction:column;gap:6px;min-width:0}
.in-strip-t{display:flex;flex-direction:column;gap:1px;margin:0;min-width:0;font:600 15px/20px var(--gw-font-ui);color:var(--gw-ink);font-variant-numeric:tabular-nums;text-wrap:pretty}
.in-strip-t>.in-sub{font:400 13px/18px var(--gw-font-ui);white-space:normal}
.in-bar--mini{height:4px;border-radius:2px;box-shadow:none}
.in-bar--mini::-webkit-progress-bar,.in-bar--mini::-webkit-progress-value,.in-bar--mini::-moz-progress-bar{border-radius:2px}
.in-strip-row .in-btn{min-height:44px;min-width:5.5em;padding:0 12px;justify-content:center}
/* plain count line ("30 g logged today"): one line beside the button */
.in-strip-one{white-space:nowrap}
@container (max-width:15em){
  .in-strip-row{grid-template-columns:32px minmax(0,1fr);align-items:start}
  .in-strip-row .in-tile{margin-top:-2px}
  .in-strip-row .in-btn{grid-column:2;justify-self:start}
}
