// ─────────────────────────────────────────────────────────────────────────
//  screens-employee3.jsx — E-08 メッセージ伝達 / E-09 会議タイムキーパー /
//  E-10 パトロール依頼 / E-12 ログイン・認証
//  (EMP, EmpStatusBar, EmpNav, BackHeader, Pill, Icon, Waveform は window から)
// ─────────────────────────────────────────────────────────────────────────

// local helpers (unique names — script scopes don't share)
function E3Section({ label, children }) {
  return (
    <div>
      <div style={{ color: EMP.faint, fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', marginBottom: 10 }}>{label}</div>
      {children}
    </div>);

}
function E3Toggle({ on, onClick, label }) {
  return (
    <button onClick={onClick} style={{ display: 'flex', alignItems: 'center', gap: 12, cursor: 'pointer',
      background: EMP.surface2, border: `1px solid ${on ? EMP.blue : 'transparent'}`, borderRadius: 13,
      padding: '14px 16px', color: EMP.text, fontSize: 15, fontWeight: 600, width: '100%' }}>
      <span style={{ width: 44, height: 26, borderRadius: 99, background: on ? EMP.blue : 'rgba(31,42,51,0.15)',
        position: 'relative', transition: 'background .15s', flexShrink: 0 }}>
        <span style={{ position: 'absolute', top: 3, left: on ? 21 : 3, width: 20, height: 20, borderRadius: 99,
          background: '#fff', transition: 'left .15s' }}></span>
      </span>
      {label}
    </button>);

}

// ── E-08 メッセージ伝達 ──────────────────────────────────────────────────────
function E08_Message({ nav, back }) {
  const [aud, setAud] = useState('個人宛');
  const [voice, setVoice] = useState(true);
  const [media, setMedia] = useState(false);
  const [when, setWhen] = useState('今すぐ');
  const audiences = [
  { id: '個人宛', icon: 'person', sub: '感謝・資料受け渡し', approval: false },
  { id: 'チーム宛', icon: 'users', sub: 'お土産配布・備品連絡', approval: 'cond' },
  { id: '全体/エリア宛', icon: 'megaphone', sub: '経営層メッセージ・新メンバー紹介', approval: true }];

  const cur = audiences.find((a) => a.id === aud);
  const needApproval = cur.approval === true;
  const MSG_TEMPLATES = {
    '個人宛': '先日は資料のご対応ありがとうございました。\nお返しの資料をお届けにあがります。',
    'チーム宛': 'お疲れさまです。出張のお土産をお配りします。\nC島を巡回しますので、お好きなものをお取りください。',
    '全体/エリア宛': '今月の全社表彰、おめでとうございます！\n各フロアを巡回してお祝いをお届けします。'
  };
  const [msgs, setMsgs] = useState(MSG_TEMPLATES);
  return (
    <div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
      <EmpStatusBar onHome={() => nav('E-01')} />
      <BackHeader title="メッセージ伝達" sub="ロボットが移動しながらメッセージを届けます" back={back} />
      <div style={{ flex: 1, display: 'flex', gap: 20, padding: '0 28px 24px', minHeight: 0, overflowY: 'auto' }}>
        <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 20 }}>
          <E3Section label="宛先">
            <div style={{ display: 'flex', gap: 12 }}>
              {audiences.map((a) =>
              <button key={a.id} onClick={() => setAud(a.id)} style={{ flex: 1, cursor: 'pointer', textAlign: 'left',
                background: aud === a.id ? 'rgba(14,156,132,0.12)' : EMP.surface2, border: `1px solid ${aud === a.id ? EMP.blue : 'transparent'}`,
                borderRadius: 14, padding: '16px 16px', position: 'relative' }}>
                  <Icon name={a.icon} size={26} color={aud === a.id ? EMP.blue : EMP.sub} />
                  <div style={{ color: EMP.text, fontSize: 16, fontWeight: 700, marginTop: 10 }}>{a.id}</div>
                  <div style={{ color: EMP.faint, fontSize: 12.5, marginTop: 3 }}>{a.sub}</div>
                  {a.approval === true && <span style={{ position: 'absolute', top: 12, right: 12, fontSize: 10.5, fontWeight: 700,
                  color: '#9A5B00', background: 'rgba(245,158,11,0.16)', padding: '3px 8px', borderRadius: 99 }}>承認必須</span>}
                </button>
              )}
            </div>
          </E3Section>
          <E3Section label="メッセージ本文">
            <textarea value={msgs[aud]} onChange={(e) => setMsgs((m) => ({ ...m, [aud]: e.target.value }))}
            style={{ width: '100%', minHeight: 110, resize: 'none', background: EMP.surface2, border: `1px solid ${EMP.line}`,
              borderRadius: 13, padding: 16, color: EMP.text, fontSize: 16, lineHeight: 1.7, outline: 'none', fontFamily: 'inherit' }} />
            <div style={{ color: EMP.faint, fontSize: 12.5, marginTop: 8, display: 'flex', alignItems: 'center', gap: 6 }}>
              <Icon name="edit" size={13} />「{aud}」向けの文面です。宛先を切り替えるとそれぞれの文面を編集できます。</div>
          </E3Section>
          <div style={{ display: 'flex', gap: 14 }}>
            <div style={{ flex: 1 }}><E3Toggle on={voice} onClick={() => setVoice((v) => !v)} label="音声で読み上げる" /></div>
            <div style={{ flex: 1 }}><E3Toggle on={media} onClick={() => setMedia((v) => !v)} label="画像/動画を添付" /></div>
          </div>
          <E3Section label="巡回エリア">
            <div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}>
              {['14F 全体', '14F A〜C島', '12F 全体', '共用部', '会議室前'].map((e, i) =>
              <span key={e} style={{ padding: '11px 18px', borderRadius: 12, fontSize: 15, fontWeight: 600,
                background: i < 1 ? 'rgba(14,156,132,0.14)' : EMP.surface2, color: i < 1 ? '#0B7A6B' : EMP.sub,
                border: `1px solid ${i < 1 ? EMP.blue : 'transparent'}`, cursor: 'pointer' }}>{e}</span>
              )}
            </div>
          </E3Section>
        </div>
        {/* summary */}
        <div style={{ width: 320, background: EMP.surface, border: `1px solid ${EMP.line}`, borderRadius: 18, padding: 22, display: 'flex', flexDirection: 'column' }}>
          <div style={{ color: EMP.faint, fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', marginBottom: 16 }}>配信内容</div>
          {[['宛先', aud], ['読み上げ', voice ? 'あり' : 'なし'], ['添付', media ? 'あり' : 'なし'], ['巡回', '14F 全体'], ['開始', when]].map(([k, v]) =>
          <div key={k} style={{ display: 'flex', justifyContent: 'space-between', padding: '11px 0', borderBottom: `1px solid ${EMP.line}` }}>
              <span style={{ color: EMP.faint, fontSize: 14 }}>{k}</span><span style={{ color: EMP.text, fontSize: 15, fontWeight: 600 }}>{v}</span>
            </div>
          )}
          <div style={{ display: 'flex', gap: 8, marginTop: 16, marginBottom: 8 }}>
            {['今すぐ', '時刻指定'].map((w) =>
            <button key={w} onClick={() => setWhen(w)} style={{ flex: 1, height: 46, cursor: 'pointer', borderRadius: 11,
              background: when === w ? 'rgba(14,156,132,0.14)' : EMP.surface2, border: `1px solid ${when === w ? EMP.blue : 'transparent'}`,
              color: when === w ? '#0B7A6B' : EMP.text, fontSize: 14, fontWeight: 600 }}>{w}</button>
            )}
          </div>
          {needApproval &&
          <div style={{ display: 'flex', gap: 9, alignItems: 'center', background: 'rgba(245,158,11,0.1)', border: `1px solid ${EMP.amber}44`,
            borderRadius: 12, padding: '11px 14px', marginBottom: 12 }}>
              <Icon name="shield" size={18} color={EMP.amber} />
              <span style={{ color: '#9A5B00', fontSize: 13, lineHeight: 1.5 }}>全体/エリア宛は管理者承認が必要です</span>
            </div>
          }
          <div style={{ flex: 1 }}></div>
          <button onClick={() => nav('E-DONE', needApproval ?
          { title: '承認申請を送信しました', sub: '管理者の承認後に配信を開始します' } :
          { title: '配信を開始しました', sub: 'ロボットが14F全体を巡回しメッセージを届けます' })}
          style={{ height: 60, border: 'none', cursor: 'pointer', borderRadius: 15, background: needApproval ? EMP.amber : EMP.blue,
            color: needApproval ? '#fff' : '#fff', fontSize: 17, fontWeight: 700, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
            boxShadow: `0 8px 24px ${needApproval ? 'rgba(199,119,0,0.3)' : 'rgba(14,156,132,0.34)'}` }}>
            <Icon name={needApproval ? 'shield' : 'megaphone'} size={22} />{needApproval ? '承認を申請する' : '配信を開始'}
          </button>
        </div>
      </div>
      <EmpNav active="E-01" nav={nav} />
    </div>);

}

// ── E-09 会議タイムキーパー ──────────────────────────────────────────────────
function E09_Timekeeper({ nav, back }) {
  const [left, setLeft] = useState(8 * 60 + 32); // seconds
  const [running, setRunning] = useState(true);
  useEffect(() => {
    if (!running) return;
    const id = setInterval(() => setLeft((s) => Math.max(0, s - 1)), 1000);
    return () => clearInterval(id);
  }, [running]);
  const mm = String(Math.floor(left / 60)).padStart(2, '0');
  const ss = String(left % 60).padStart(2, '0');
  const total = 30 * 60,frac = left / total;
  const warn = left <= 5 * 60,crit = left <= 60;
  const ring = crit ? EMP.red : warn ? EMP.amber : EMP.blue;
  const R = 150,C = 2 * Math.PI * R;
  const agenda = [
  { t: '前回の振り返り', done: true }, { t: '14F移転の進捗共有', done: true },
  { t: 'ロボット導入PoC計画', done: false, now: true }, { t: '配送・所在検索の要件', done: false },
  { t: 'ネクストアクション', done: false }];

  return (
    <div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
      <div style={{ display: 'flex', alignItems: 'center', padding: '0 28px', height: 56, borderBottom: `1px solid ${EMP.line}`, flexShrink: 0 }}>
        <button onClick={() => nav('E-01')} style={{ width: 40, height: 40, borderRadius: 10, cursor: 'pointer', border: `1px solid ${EMP.line}`,
          background: EMP.surface, color: EMP.text, display: 'grid', placeItems: 'center', marginRight: 14 }}><Icon name="arrowLeft" size={20} /></button>
        <span style={{ color: EMP.text, fontSize: 17, fontWeight: 700 }}>会議タイムキーパー</span>
        <span style={{ color: EMP.faint, fontSize: 14, marginLeft: 12 }}>会議室 14-A・チーム定例</span>
        <Pill tone={warn ? crit ? 'red' : 'amber' : 'green'} style={{ marginLeft: 'auto' }}>
          {crit ? '残り1分' : warn ? '残り5分' : '進行中'}</Pill>
      </div>
      <div style={{ flex: 1, display: 'flex', minHeight: 0 }}>
        {/* countdown */}
        <div style={{ flex: 1.3, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 24, position: 'relative' }}>
          <svg width="340" height="340" style={{ transform: 'rotate(-90deg)' }}>
            <circle cx="170" cy="170" r={R} fill="none" stroke={EMP.surface2} strokeWidth="18" />
            <circle cx="170" cy="170" r={R} fill="none" stroke={ring} strokeWidth="18" strokeLinecap="round"
            strokeDasharray={C} strokeDashoffset={C * (1 - frac)} style={{ transition: 'stroke-dashoffset 1s linear, stroke .4s' }} />
          </svg>
          <div style={{ position: 'absolute', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
            <div style={{ color: EMP.faint, fontSize: 15, marginBottom: 4 }}>残り時間</div>
            <div style={{ color: ring, fontSize: 84, fontWeight: 800, fontVariantNumeric: 'tabular-nums', lineHeight: 1, letterSpacing: '-0.02em' }}>{mm}:{ss}</div>
            <div style={{ color: EMP.faint, fontSize: 15, marginTop: 8 }}>終了予定 15:00</div>
          </div>
        </div>
        {/* agenda */}
        <div style={{ flex: 1, borderLeft: `1px solid ${EMP.line}`, padding: '24px 28px', display: 'flex', flexDirection: 'column' }}>
          <div style={{ color: EMP.faint, fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', marginBottom: 16 }}>アジェンダ</div>
          <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 4 }}>
            {agenda.map((a, i) =>
            <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '12px 14px', borderRadius: 12,
              background: a.now ? 'rgba(14,156,132,0.12)' : 'transparent', border: a.now ? `1px solid ${EMP.blue}44` : '1px solid transparent' }}>
                <div style={{ width: 24, height: 24, borderRadius: 99, display: 'grid', placeItems: 'center', flexShrink: 0,
                background: a.done ? EMP.green : a.now ? EMP.blue : EMP.surface2 }}>
                  {a.done ? <Icon name="check" size={15} color="#fff" /> : a.now ? <span style={{ width: 8, height: 8, borderRadius: 99, background: '#fff' }}></span> : <span style={{ color: EMP.faint, fontSize: 12 }}>{i + 1}</span>}
                </div>
                <span style={{ color: a.now ? EMP.text : a.done ? EMP.faint : EMP.sub, fontSize: 16, fontWeight: a.now ? 700 : 500,
                textDecoration: a.done ? 'line-through' : 'none' }}>{a.t}</span>
                {a.now && <span style={{ marginLeft: 'auto', color: EMP.blue, fontSize: 12, fontWeight: 700 }}>進行中</span>}
              </div>
            )}
          </div>
        </div>
      </div>
      {/* controls */}
      <div style={{ display: 'flex', gap: 12, padding: '16px 28px', borderTop: `1px solid ${EMP.line}` }}>
        <button onClick={() => {setLeft((s) => s + 600);}} style={{ flex: 1, height: 60, cursor: 'pointer', borderRadius: 14,
          background: EMP.surface2, border: `1px solid ${EMP.line}`, color: EMP.text, fontSize: 17, fontWeight: 700, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 9 }}>
          <Icon name="plus" size={20} color={EMP.blue} />10分延長</button>
        <button onClick={() => setRunning((r) => !r)} style={{ flex: 1, height: 60, cursor: 'pointer', borderRadius: 14,
          background: EMP.surface2, border: `1px solid ${EMP.line}`, color: EMP.text, fontSize: 17, fontWeight: 700, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 9 }}>
          <Icon name={running ? 'pause' : 'play'} size={20} color={EMP.blue} />{running ? '一時停止' : '再開'}</button>
        <button onClick={() => nav('E-DONE', { title: '会議を終了しました', sub: '次の予定：14F定例（15:30〜）' })} style={{ flex: 1, height: 60, cursor: 'pointer', borderRadius: 14,
          background: EMP.red, border: 'none', color: '#fff', fontSize: 17, fontWeight: 700, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 9 }}>
          <Icon name="stop" size={19} />会議を終了</button>
      </div>
    </div>);

}

// ── E-10 パトロール依頼 ──────────────────────────────────────────────────────
function E10_Patrol({ nav, back }) {
  const [route, setRoute] = useState('通常巡回');
  const [cond, setCond] = useState('今すぐ');
  const routes = [
  { id: '通常巡回', icon: 'route', sub: '全フロアを一定間隔で巡回', dur: '約25分' },
  { id: '施錠確認', icon: 'shield', sub: 'ドア・キャビネットの施錠確認', dur: '約15分' },
  { id: '死角エリア', icon: 'search', sub: 'カメラ死角を重点的に確認', dur: '約18分' },
  { id: '異常検知', icon: 'alert', sub: '発熱・水漏れ・障害物を検知', dur: '約30分' }];

  return (
    <div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
      <EmpStatusBar onHome={() => nav('E-01')} />
      <BackHeader title="パトロール依頼" sub="夜間・低稼働時間帯の巡回点検" back={back} accent={EMP.amber} />
      <div style={{ flex: 1, display: 'flex', gap: 20, padding: '0 28px 24px', minHeight: 0, overflowY: 'auto' }}>
        <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 20 }}>
          <E3Section label="巡回ルート">
            <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }}>
              {routes.map((r) =>
              <button key={r.id} onClick={() => setRoute(r.id)} style={{ cursor: 'pointer', textAlign: 'left',
                background: route === r.id ? 'rgba(14,156,132,0.12)' : EMP.surface2, border: `1px solid ${route === r.id ? EMP.blue : 'transparent'}`,
                borderRadius: 14, padding: '16px 18px', display: 'flex', alignItems: 'center', gap: 14 }}>
                  <div style={{ width: 46, height: 46, borderRadius: 12, background: EMP.surface, display: 'grid', placeItems: 'center', flexShrink: 0 }}>
                    <Icon name={r.icon} size={24} color={route === r.id ? EMP.blue : EMP.sub} /></div>
                  <div style={{ flex: 1 }}>
                    <div style={{ color: EMP.text, fontSize: 16, fontWeight: 700 }}>{r.id}</div>
                    <div style={{ color: EMP.faint, fontSize: 13, marginTop: 2 }}>{r.sub}</div>
                  </div>
                  <span style={{ color: EMP.faint, fontSize: 13 }}>{r.dur}</span>
                </button>
              )}
            </div>
          </E3Section>
          <E3Section label="開始条件">
            <div style={{ display: 'flex', gap: 10 }}>
              {['今すぐ', '時刻を予約', '定期（毎日22:00）'].map((c) =>
              <button key={c} onClick={() => setCond(c)} style={{ flex: 1, height: 56, cursor: 'pointer', borderRadius: 13,
                background: cond === c ? 'rgba(14,156,132,0.14)' : EMP.surface2, border: `1px solid ${cond === c ? EMP.blue : 'transparent'}`,
                color: cond === c ? '#0B7A6B' : EMP.text, fontSize: 15, fontWeight: 600 }}>{c}</button>
              )}
            </div>
          </E3Section>
          <E3Section label="記録">
            <div style={{ display: 'flex', gap: 12 }}>
              {[['camera', '写真', true], ['play', '動画', true], ['doc', 'SharePoint保存', true]].map(([ic, l, on]) =>
              <div key={l} style={{ flex: 1, display: 'flex', alignItems: 'center', gap: 10, background: EMP.surface2, borderRadius: 13, padding: '14px 16px' }}>
                  <Icon name={ic} size={20} color={EMP.blue} />
                  <span style={{ color: EMP.text, fontSize: 14.5, fontWeight: 600, flex: 1 }}>{l}</span>
                  <Icon name="checkCircle" size={19} color={EMP.green} />
                </div>
              )}
            </div>
          </E3Section>
        </div>
        {/* summary */}
        <div style={{ width: 320, background: EMP.surface, border: `1px solid ${EMP.line}`, borderRadius: 18, padding: 22, display: 'flex', flexDirection: 'column' }}>
          <div style={{ color: EMP.faint, fontSize: 13, fontWeight: 600, letterSpacing: '0.06em', marginBottom: 16 }}>巡回内容</div>
          {[['ルート', route], ['開始', cond], ['記録', '写真・動画'], ['保存先', 'SharePoint'], ['通知', '施設管理・Teams']].map(([k, v]) =>
          <div key={k} style={{ display: 'flex', justifyContent: 'space-between', padding: '11px 0', borderBottom: `1px solid ${EMP.line}` }}>
              <span style={{ color: EMP.faint, fontSize: 14 }}>{k}</span><span style={{ color: EMP.text, fontSize: 15, fontWeight: 600 }}>{v}</span>
            </div>
          )}
          <div style={{ marginTop: 16, display: 'flex', gap: 9, alignItems: 'center', background: EMP.surface2, borderRadius: 12, padding: '12px 14px' }}>
            <Icon name="users" size={18} color={EMP.amber} />
            <span style={{ color: EMP.sub, fontSize: 13, lineHeight: 1.5 }}>施設管理・IT/セキュリティ権限が必要です</span>
          </div>
          <div style={{ flex: 1 }}></div>
          <button onClick={() => nav('E-DONE', cond === '今すぐ' ?
          { title: '巡回を開始しました', sub: `${route}・記録はSharePointに保存されます` } :
          { title: 'スケジュールを登録しました', sub: `${route}・${cond}` })}
          style={{ height: 60, border: 'none', cursor: 'pointer', borderRadius: 15, background: EMP.blue, color: '#fff', fontSize: 17, fontWeight: 700,
            display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10, marginBottom: 10, boxShadow: '0 8px 24px rgba(14,156,132,0.34)' }}>
            <Icon name="shield" size={22} />{cond === '今すぐ' ? '巡回開始' : 'スケジュール登録'}</button>
        </div>
      </div>
      <EmpNav active="E-01" nav={nav} />
    </div>);

}

// ── E-12 ログイン・認証 ──────────────────────────────────────────────────────
function E12_Login({ nav, back }) {
  const now = useClock();
  const [busy, setBusy] = useState(null);
  const methods = [
  { id: 'badge', icon: 'shield', t: '社員証をかざす', sub: 'NFC社員証をタッチ', tone: EMP.blue },
  { id: 'qr', icon: 'qr', t: 'QRコード', sub: 'モバイル社員証を表示', tone: EMP.green },
  { id: 'sso', icon: 'globe', t: 'SSOでログイン', sub: 'Microsoft アカウント', tone: EMP.amber }];

  const doAuth = (id) => {
    if (busy) return;
    setBusy(id);
    setTimeout(() => nav('E-01'), 1600);
  };
  return (
    <div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
      <div style={{ display: 'flex', alignItems: 'center', padding: '0 28px', height: 56, flexShrink: 0 }}>
        <button onClick={() => nav('E-01')} style={{ width: 40, height: 40, borderRadius: 10, cursor: 'pointer', border: `1px solid ${EMP.line}`,
          background: EMP.surface, color: EMP.text, display: 'grid', placeItems: 'center' }}><Icon name="arrowLeft" size={20} /></button>
        <span style={{ marginLeft: 'auto', color: EMP.faint, fontSize: 14, fontVariantNumeric: 'tabular-nums' }}>{fmtDate(now)} {fmtTime(now)}</span>
      </div>
      <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', padding: 40 }}>
        <div style={{ width: 64, height: 64, borderRadius: 16, background: EMP.blue, display: 'grid', placeItems: 'center', marginBottom: 20 }}>
          <Icon name="robot" size={38} color="#fff" /></div>
        <div style={{ color: EMP.text, fontSize: 28, fontWeight: 700, marginBottom: 6 }}>Office Partner</div>
        <div style={{ color: EMP.sub, fontSize: 16, marginBottom: 40 }}>社員認証を行ってください</div>

        <div style={{ display: 'flex', gap: 16, width: '100%', maxWidth: 760 }}>
          {methods.map((m) => {
            const loading = busy === m.id;
            return (
              <button key={m.id} onClick={() => doAuth(m.id)} disabled={!!busy} style={{ flex: 1, cursor: busy ? 'default' : 'pointer',
                background: EMP.surface, border: `1px solid ${loading ? m.tone : EMP.line}`, borderRadius: 20, padding: '32px 20px',
                display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14, opacity: busy && !loading ? 0.4 : 1, transition: 'opacity .2s' }}>
                <div style={{ width: 76, height: 76, borderRadius: 20, background: `${m.tone}1F`, display: 'grid', placeItems: 'center', position: 'relative' }}>
                  {loading && <span style={{ position: 'absolute', inset: -6, borderRadius: 24, border: `2px solid ${m.tone}`, opacity: 0.4, animation: 'ripple 1.4s ease-out infinite' }}></span>}
                  <Icon name={m.icon} size={40} color={m.tone} /></div>
                <div style={{ color: EMP.text, fontSize: 19, fontWeight: 700 }}>{m.t}</div>
                <div style={{ color: EMP.faint, fontSize: 13.5 }}>{loading ? '認証中…' : m.sub}</div>
              </button>);

          })}
        </div>
        <div style={{ marginTop: 28, display: 'flex', alignItems: 'center', gap: 8, color: EMP.faint, fontSize: 13 }}>
          <Icon name="shield" size={16} />認証情報はこの端末に保存されません
        </div>
      </div>
    </div>);

}

Object.assign(window, { E08_Message, E09_Timekeeper, E10_Patrol, E12_Login });