/* Face tab (BAB-0045). The page look follows ../style.css (light page, white cards, teal accent); this file adds only the face editor's own parts. */
select:focus-visible, summary:focus-visible, input[type="range"]:focus-visible, input[type="color"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.facepage .help.center { text-align: center; margin: 0; }

/* header: the five tabs of the bot's software */
.ftabs { flex-wrap: wrap; }
.ftabs .step { min-height: 44px; }
.ftabs .step em { border-left: 1px solid var(--line); }
.ftabs .step:not(.is-now) { opacity: 0.85; }

/* three columns on a big screen, one column on a phone */
.fgrid { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--side); gap: 14px; min-height: 0; }
.fgrid > * { min-height: 0; min-width: 0; }
.fcol { overflow: auto; }
.fright { display: flex; flex-direction: column; gap: 14px; background: none; border: 0; padding: 0; border-radius: 0; }
.fright .card { flex: none; }
.fstage { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; overflow: auto; }
.fstage h2 small { font-size: 14px; font-weight: 400; color: var(--ink2); }
@media (min-width: 901px) {
  .facepage { height: 100dvh; overflow: hidden; }
  :root { --side: 320px; }
}
@media (min-width: 901px) and (max-width: 1500px) { :root { --side: 290px; } }
@media (min-width: 901px) and (max-width: 1250px) { :root { --side: 262px; } .ftabs .step em { display: none; } }
@media (max-width: 900px) {
  .facepage { display: flex; flex-direction: column; }
  .fgrid { display: flex; flex-direction: column; gap: 10px; }
  .fstage { order: 1; } .fright { order: 2; } #p-controls { order: 3; }
  .fcol, .fstage { overflow: visible; }
  .ftabs { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); order: 3; }
  .ftabs .step { flex-wrap: wrap; gap: 0 6px; padding: 2px 8px; justify-content: center; }
  .ftabs .step em { flex-basis: 100%; text-align: center; border: 0; padding: 0; line-height: 1.1; }
}

/* the glass */
.glassbox { display: grid; place-items: center; background: #E9EDF2; border-radius: 12px; padding: 12px 4px; min-height: 120px; }
.glassbox canvas { display: block; max-width: 100%; }
.screens, .moodstrip { display: flex; flex-wrap: wrap; gap: 6px; }
.screens .btn { flex: 1 1 130px; flex-direction: column; gap: 0; align-items: center; text-align: center; }
.screens .btn small { font-size: 14px; font-weight: 400; color: var(--ink2); }
.moodstrip .btn { flex: 1 1 84px; text-transform: capitalize; }
.playrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.levelbox { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; flex: 1 1 240px; font-size: 14px; font-weight: 600; }
.levelbox .soft { font-weight: 400; color: var(--ink2); }
.levelbox input { flex: 1 1 120px; min-width: 100px; }
output { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink2); min-width: 4.5ch; text-align: right; }

/* controls */
.group { border-top: 1px solid var(--line); }
.group > summary { min-height: 44px; display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 16px; cursor: pointer; list-style-position: inside; }
.moodtag { color: var(--accent); font-weight: 600; text-transform: capitalize; }
.gbody { display: grid; gap: 6px; padding: 2px 0 12px; }
.ctl { display: grid; gap: 2px; }
.ctl label { font-size: 14px; font-weight: 600; }
.ctl.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.ctl.check { justify-content: flex-start; }
.ctl.check label { flex: 1; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.ctlin { display: flex; align-items: center; gap: 8px; }
.ctlin input[type="range"] { flex: 1; min-width: 0; }
input[type="range"] { height: 44px; margin: 0; accent-color: var(--accent); cursor: pointer; }
input[type="checkbox"] { width: 24px; height: 24px; margin: 0 10px 0 2px; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type="color"] { width: 64px; height: 44px; padding: 2px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--card); cursor: pointer; flex: none; }
select, #name { width: 100%; min-height: 44px; padding: 0 10px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--card); font-size: 14px; }
.ctl .btn { width: 100%; }

/* right column */
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.btnrow .btn { flex: 1 1 120px; }
.problems { margin: 8px 0; padding: 10px 12px; background: var(--need-bg); border: 1px solid var(--need-line); border-radius: 10px; color: var(--need); font-size: 14px; }
.problems ul { margin: 4px 0 0; padding-left: 18px; }
.stock { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stockbtn { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 8px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-btn); cursor: pointer; font-size: 14px; }
.stockbtn:hover { background: var(--raised); }
.stockbtn[aria-pressed="true"] { border-color: var(--accent); background: #E3F1F5; }
.stockbtn canvas { width: 56px; height: 56px; flex: none; border-radius: 50%; background: #000; }
.stockbtn b { display: block; font-size: 14px; }
.stockbtn small { display: block; font-size: 14px; line-height: 1.25; color: var(--ink2); }

/* contact sheet (sheet.html) */
.sheetpage { display: block; padding: 16px; height: auto; overflow: auto; }
.sheetpage h1 { margin: 0 0 4px; font-size: 22px; }
.sheetrow { margin: 14px 0; }
.sheetrow h2 { font-size: 18px; margin: 0 0 6px; }
.sheetrow h2 small { font-size: 14px; font-weight: 400; color: var(--ink2); margin-left: 8px; }
.strip { display: flex; flex-wrap: wrap; gap: 8px; }
.strip figure { margin: 0; text-align: center; }
.strip canvas { display: block; background: transparent; }
.strip figcaption { font-size: 14px; color: var(--ink2); }

/* the same face on all four screens */
.fourh { margin: 6px 0 0; font-size: 16px; }
.fourup { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fourbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 8px 6px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r-btn); cursor: pointer; font-size: 14px; color: var(--ink); }
.fourbtn:hover { background: var(--raised); }
.fourbtn[aria-pressed="true"] { border-color: var(--accent); background: #E3F1F5; }
.fourbtn canvas { width: 100%; max-width: 233px; height: auto; aspect-ratio: auto; display: block; }
.fstage > * { flex: none; }
.levelbox output { margin-left: auto; }
.playrow .levelbox { flex: 1 1 100%; order: 3; }
@media (max-width: 900px) {
  .facepage > .top nav { order: 3; flex: 1 1 100%; }
  .facepage > .top > .btn { order: 2; }
}

/* compact contact sheet: pack name on the left, 12 moods in a row, mood names once at the top */
.compact .sheetrow { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.compact .sheetrow h2 { width: 112px; flex: none; margin: 0; font-size: 14px; }
.compact .sheetrow h2 small { display: none; }
.compact .strip { gap: 6px; flex-wrap: nowrap; }
.compact figcaption { display: none; }
.compact .moodhead { display: flex; gap: 6px; margin-left: 120px; font-size: 14px; color: var(--ink2); }
.compact .moodhead span { text-align: center; }
.compact h1, .compact .help { display: none; }
.compact.sheetpage { padding: 8px; }
