/* 顔追従カメラ: 見た目（shinotools のサイトに合わせる: 白・紫 #6953a9・細い線・角丸。フォントは同梱しない）
   見た目はあとで作り込む前提。ここは仕組みを使うための、いちばん簡単な形 */
:root {
  --bg: #fff;
  --ink: #292d40;
  --sub: #62687c;
  --line: #e7e9ef;
  --field: #aeb4c3;
  --accent: #6953a9;
  --accent-pale: #f3f0fc;
  --warn: #a84c70;
  --warn-pale: #fff1f5;
  --ok: #2f7d5b;
  --stage: #2b2e3a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic', 'YuGothic', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
input, select { min-height: 38px; border: 1px solid var(--field); border-radius: 4px; background: #fff; padding: 4px 10px; max-width: 100%; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
input[type=range] { min-height: 0; border: 0; padding: 0; accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; line-height: 1.5; }
[hidden] { display: none !important; }
code { font-size: 13px; background: #f6f6f9; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
pre { font-size: 12px; background: #f6f6f9; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; overflow-x: auto; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 6px 16px;
  border: 1px solid var(--accent); border-radius: 4px;
  background: var(--accent); color: #fff; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(.94); }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.secondary[aria-pressed=true] { background: var(--accent); color: #fff; }
.btn.small { min-height: 32px; padding: 3px 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--warn); border-color: var(--warn); }
.btn.danger[aria-pressed=true] { background: var(--warn); color: #fff; }
.btn.wide { width: 100%; }
.btn.big { min-height: 54px; font-size: 18px; }
.btn.big[aria-pressed=true] { background: var(--warn); border-color: var(--warn); }

.note { font-size: 13px; color: var(--sub); line-height: 1.8; margin: 6px 0; }
.warn { font-size: 13px; color: var(--warn); background: var(--warn-pale); border-radius: 4px; padding: 8px 10px; margin: 8px 0; }
.paid { font-size: 13px; color: var(--ink); background: var(--accent-pale); border-radius: 4px; padding: 8px 10px; margin: 8px 0; border-left: 3px solid var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-bars { display: inline-flex; gap: 3px; }
.brand-bars i { display: block; width: 4px; height: 15px; background: #d2c8eb; }
.brand-bars i:nth-child(2) { background: #f0c6d6; }
.brand-bars i:nth-child(3) { background: #bfd4ee; }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 6px;
  background: var(--ink); color: #fff; font-size: 14px; z-index: 50;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18); pointer-events: none;
}

/* ===== トップ ===== */
.top { max-width: 760px; margin: 0 auto; padding: 0 24px 60px; }
.top header { padding: 26px 0; border-bottom: 1px solid var(--line); }
.top .brand { font-size: 22px; }
.top h1 { font-size: 28px; margin: 36px 0 10px; }
.top .lead { color: var(--sub); font-size: 16px; margin: 0 0 26px; }
.top h2 { font-size: 19px; margin: 40px 0 12px; }
.steps { padding-left: 1.5em; margin: 8px 0; }
.steps li { margin: 10px 0; padding-left: 4px; }
.steps li::marker { color: var(--accent); font-weight: 500; }
.copy-row { display: flex; gap: 6px; margin: 8px 0; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; color: var(--sub); }

/* ===== ドック ===== */
.bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 48px; flex-wrap: wrap; position: sticky; top: 0; background: #fff; z-index: 5; }
.bar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #c9ccd6; }
.pill.on::before { background: var(--ok); }
.pill.bad::before { background: var(--warn); }
.pill.wait::before { background: #e0b44a; }
.dock { padding: 10px 12px 30px; max-width: 640px; margin: 0 auto; }
.now { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.face-line { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.face-line .tag { font-size: 12px; padding: 1px 10px; border-radius: 999px; background: var(--accent-pale); color: var(--accent); }
.face-line .tag.bad { background: var(--warn-pale); color: var(--warn); }
.preset-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.preset-btns .btn { white-space: normal; line-height: 1.4; }
.row { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; font-size: 14px; line-height: 1.6; }
.check input { margin-top: 2px; }

.tabs { display: flex; gap: 0; margin: 12px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: none; border: 0; background: none; padding: 8px 10px; font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent; }
.tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab { padding: 6px 0; }
.tab section { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.tab section:last-child { border-bottom: 0; }
.tab h3 { font-size: 16px; margin: 2px 0 6px; }
.field { display: block; margin: 8px 0; font-size: 13px; color: var(--sub); }
.field input:not([type=range]):not([type=checkbox]), .field select { display: block; width: 100%; margin-top: 3px; color: var(--ink); font-size: 15px; }
.field.inline { margin: 0; }
.field.inline input.port, .field.inline input.num { display: inline-block; width: 7em; margin: 0 0 0 4px; }
.field.inline input.num { width: 8.5em; }
.slider { display: grid; grid-template-columns: 7.5em 1fr 4.2em; gap: 8px; align-items: center; font-size: 13px; color: var(--sub); margin: 4px 0; }
.slider output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.status-line { font-size: 14px; margin: 6px 0; }
.status-line.ok { color: var(--ok); }
.status-line.bad { color: var(--warn); }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.card-head { display: flex; gap: 8px; align-items: center; }
.card-head input[type=text] { flex: 1; min-width: 0; }
.sub-label { font-size: 13px; color: var(--ink); margin: 8px 0 0; font-weight: 500; }
.found { font-size: 13px; color: var(--sub); margin: 4px 0; padding-left: 1.2em; }
.found li { margin: 2px 0; }
.meter { height: 8px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--warn); }
.list-plain { list-style: none; padding: 0; margin: 6px 0; }
.list-plain li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 10px; }

/* 基準合わせ */
.calib-stage { position: relative; background: var(--stage); border-radius: 6px; overflow: hidden; margin: 8px 0; aspect-ratio: 16 / 9; }
.calib-stage img, .calib-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.calib-stage img { object-fit: fill; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.calib-stage canvas { cursor: crosshair; touch-action: none; }
.calib-stage .bg-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: #c8cbd6; font-size: 14px; pointer-events: none; }

/* 細いドック（OBS で足したばかりのドックは細いことがある） */
.cam-page { min-width: 220px; }
.btn.big { white-space: normal; line-height: 1.4; }
@media (max-width: 380px) {
  .bar { padding: 6px 8px; gap: 6px; }
  .bar .brand-text { display: none; }
  .dock { padding: 8px 8px 24px; }
  .slider { grid-template-columns: 5.5em 1fr 3.8em; gap: 6px; }
  .btn.big { font-size: 16px; min-height: 48px; }
  .preset-btns { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .tabs button { padding: 8px 7px; }
}

/* 今の様子（画面ごと）・止めているとき */
.paused-note { font-size: 13px; color: var(--warn); background: var(--warn-pale); border-radius: 4px; padding: 8px 10px; line-height: 1.7; }
.follow-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.follow-row .follow-label { color: var(--sub); margin-right: 2px; }
.group-status { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.group-status li { display: flex; gap: 8px; align-items: baseline; }
.group-status b { font-weight: 500; min-width: 2.5em; }
.group-status .st-zoom { color: var(--accent); }
.group-status .st-follow { color: var(--ok); }
.group-status .st-bad { color: var(--warn); }
.group-status .st-rest, .group-status .st-out { color: var(--sub); }
.row.end { justify-content: flex-end; margin: 0; }
