body { min-height: 100dvh; }
main { padding: var(--s4); padding-bottom: var(--s7); max-width: 560px; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: var(--s4); }

.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-who { display: flex; flex-direction: column; min-width: 0; }
.bar-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { font-size: 12px; white-space: nowrap; }
.pill { flex: none; border: 0; border-radius: 999px; padding: var(--s1) var(--s3); font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.ng { background: var(--danger-bg); color: var(--danger); }

.logo { width: 96px; height: 96px; align-self: center; }
.stack { display: flex; flex-direction: column; gap: var(--s2); }
.lead { margin: 0; }
.name-field { display: flex; flex-direction: column; gap: var(--s2); }
.name-field input { min-height: 56px; padding: 0 var(--s4); border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); font-size: 24px; font-weight: 700; }
.name-field input:focus { outline: none; border-color: var(--primary); }
.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.role { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--s1); min-height: 64px;
  padding: var(--s2) var(--s3); border: 0; border-radius: var(--r-md); background: var(--surface-2); text-align: left; }
.role-name { font-size: 16px; font-weight: 700; }
.role-sub { font-size: 12px; color: var(--text-2); }
.role:disabled { background: var(--bg); border: 1px dashed var(--line-strong); color: var(--text-2); cursor: not-allowed; }
.role:disabled .role-name { color: var(--text-2); }
.h1 { font-size: 24px; margin: 0; }
.h2 { font-size: 16px; margin: var(--s2) 0 0; color: var(--text-2); }
.h3 { font-size: 14px; margin: 0; color: var(--text-2); }
.err { color: var(--danger); margin: 0; font-weight: 700; }
.hint { margin: 0; font-size: 14px; }

.display { font-size: 40px; font-weight: 700; text-align: right; padding: var(--s2) var(--s4); background: var(--surface-2);
  border-radius: var(--r-md); letter-spacing: 0.08em; min-height: 64px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.key { height: 64px; border: 0; border-radius: var(--r-md); background: var(--surface-2); font-size: 24px; font-weight: 700;
  touch-action: manipulation; }
.key:active { background: var(--surface-3); }
.key.sub { font-size: 16px; color: var(--text-2); }

.btn { min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  padding: 0 var(--s4); font-weight: 700; touch-action: manipulation; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.wide { width: 100%; }
.back { align-self: flex-start; padding: 0; min-height: 40px; }

.seg { display: flex; gap: var(--s2); overflow-x: auto; }
.seg button { flex: 1 0 auto; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  padding: 0 var(--s4); font-weight: 700; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: var(--s2); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); padding: var(--s3); border: 0;
  border-radius: var(--r-md); background: var(--surface-2); text-align: left; }
.tile-name { font-size: 16px; font-weight: 700; }
.tile-count { font-size: 14px; color: var(--text-2); }
.tile.done { background: var(--ok-bg); }
.tile.done .tile-count { color: var(--ok); }

.todo { display: flex; flex-direction: column; gap: var(--s2); }
.todo-title { font-size: 14px; font-weight: 700; color: var(--warn); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-width: 64px; min-height: 40px; border: 0; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn);
  font-weight: 700; font-size: 16px; padding: 0 var(--s3); }

.list { display: flex; flex-direction: column; gap: var(--s2); }
.row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: var(--s3); min-height: 56px;
  padding: var(--s2) var(--s3); border: 0; border-radius: var(--r-md); background: var(--surface-2); text-align: left; }
.row.done { background: var(--ok-bg); }
.row-bib { font-size: 24px; font-weight: 700; }
.row-val { display: flex; flex-direction: column; min-width: 0; }
.row-main { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12px; color: var(--text-2); }
.mark { font-size: 12px; font-weight: 700; border-radius: 999px; padding: var(--s1) var(--s2); white-space: nowrap; }
.mark.ok { background: var(--ok-bg); color: var(--ok); }
.mark.wait { background: var(--warn-bg); color: var(--warn); }
.mark.ng { background: var(--danger-bg); color: var(--danger); }
.mark.none { background: var(--surface-2); color: var(--text-2); }

.entry-head { display: flex; align-items: center; gap: var(--s4); }
.bib { font-size: 56px; font-weight: 700; line-height: 1; }
.e-div { font-size: 16px; font-weight: 700; }

.fields { display: flex; flex-direction: column; gap: var(--s2); }
.field { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4);
  border: 2px solid transparent; border-radius: var(--r-md); background: var(--surface-2); text-align: left; width: 100%; }
.field[aria-pressed="true"] { border-color: var(--primary); }
.field-label { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.field-value { font-size: 32px; font-weight: 700; white-space: nowrap; }
.field-unit { font-size: 16px; color: var(--text-2); margin-left: var(--s1); }

.demo-band { position: sticky; top: 0; z-index: 3; padding: var(--s1) var(--s4); background: #ac3e00; color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; }
.stack-lg { display: flex; flex-direction: column; gap: var(--s4); }
.demo-band.test { background: #ce0000; }
.doc-link { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }
.call-actions { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.call-actions .btn { min-height: 56px; font-size: 16px; }
.more { display: flex; flex-direction: column; gap: var(--s3); }
.more summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; color: var(--primary); cursor: pointer; }
.more[open] > nav, .more[open] > div { margin-top: var(--s3); }
.sections { display: flex; flex-direction: column; gap: var(--s4); }
.sec { display: flex; flex-direction: column; gap: var(--s2); }
.sec-head { display: flex; flex-direction: column; gap: var(--s1); }
.sec-title { font-size: 16px; font-weight: 700; white-space: nowrap; }
.sec-sub { font-size: 12px; color: var(--text-2); }
.st-code { font-size: 16px; font-weight: 700; }
.st-name { font-size: 12px; white-space: nowrap; }
.st.wait { color: var(--warn); }
.st.none { color: var(--text-2); }
.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin-top: var(--s2); }
.st { display: grid; grid-auto-flow: column; justify-content: start; align-content: center; align-items: baseline; gap: var(--s2); min-height: 48px; border: 2px solid transparent;
  border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; font-size: 14px; padding: 0 var(--s3); text-align: left; }
.st.ok { color: var(--ok); }
.st.dq { color: var(--danger); }
.st[aria-pressed="true"] { border-color: currentColor; }
.st.wide { grid-column: 1 / -1; min-height: 56px; font-size: 16px; }

.entry-nav { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s2); position: sticky; bottom: 0;
  padding: var(--s2) 0 var(--s4); background: var(--bg); }

.busy { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-weight: 700; }

/* 2回目の打ち上げ（1回目不点火などで打ち直したとき） */
.att-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--text-2); }
.att2-title { margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.add2 { margin-top: var(--s2); }

/* この端末の控え */
.log-box { display: flex; flex-direction: column; gap: var(--s2); }
.log-box summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; gap: var(--s2); color: var(--primary); }   /* 「組から選択」と同じく、押せる見た目に */
.log-box[open] { display: flex; }
.log-box .hint { margin: 0; }
.log-box .btn { margin-top: var(--s2); }
