:root {
  --glass: rgba(22, 22, 26, 0.62);
  --glass-strong: rgba(18, 18, 22, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f1f1f3;
  --sub: #a6a7ad;
  --dim: #74757c;
  --ok: #57d68d;
  --warn: #f2b544;
  --err: #ff6b6b;
  --accent: #3b82f6;
  --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0c0f; color: var(--text); overflow: hidden;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }

.panel { position: fixed; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
body.hide-ui .panel, body.hide-ui .card { opacity: 0; pointer-events: none; }
.panel, .card { transition: opacity .25s ease; }

/* ヘッダー */
#hdr { top: 16px; left: 16px; width: 340px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
#hdr .t { flex: 1; min-width: 0; }
#hdr h1 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
#hdr .live { font-size: 10px; font-weight: 700; color: #0b0c0f; background: var(--ok); border-radius: 999px; padding: 2px 7px 2px 16px; position: relative; }
#hdr .live::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #0b0c0f; animation: blink 1.6s infinite; }
#hdr .live.off { background: var(--warn); }
@keyframes blink { 50% { opacity: .25; } }
#hdr p { margin: 4px 0 0; font-size: 11px; color: var(--sub); line-height: 1.5; }
#clock { font-size: 30px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* メンバー */
#members { top: var(--hdrb, 154px); left: 16px; width: 340px; bottom: 96px; display: flex; flex-direction: column; overflow: hidden; }
.ph { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px 8px; font-size: 12px; color: var(--sub); font-weight: 700; }
.ph b { color: var(--text); font-weight: 700; }
#mlist { overflow-y: auto; padding: 0 8px 10px; }
.m { display: flex; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.m:hover { background: rgba(255, 255, 255, 0.05); }
.m.sel { background: rgba(255, 255, 255, 0.07); border-color: var(--line); }
.av { width: 42px; height: 42px; border-radius: 50%; flex: none; padding: 2px; background: var(--c, #888); position: relative; }
.av img, .av span { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; object-position: 50% 18%; background: #2a2b31; }
.av span { display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff; }
.m .nm { font-size: 14px; font-weight: 700; }
.m .rl { font-size: 11px; color: var(--sub); margin-top: 1px; }
.m .st { font-size: 11px; color: var(--dim); margin-top: 2px; }
.m .st.busy, .m .st.asking { color: var(--ok); }
.m .st.asking { color: var(--warn); }
.m .st.working { color: #9fd9b5; }

/* ライブフィード */
#feed { top: 16px; right: 16px; width: 330px; bottom: 290px; display: flex; flex-direction: column; overflow: hidden; }
#flist { overflow-y: auto; padding: 0 10px 12px; mask-image: linear-gradient(#000 88%, transparent); }
.f { display: grid; grid-template-columns: 3px 38px 1fr; gap: 0 9px; padding: 7px 4px; border-radius: 8px; }
.f.new { animation: fin .6s ease; }
@keyframes fin { from { background: rgba(255, 255, 255, .09); } to { background: transparent; } }
.f i { grid-row: span 3; border-radius: 2px; background: var(--c, #666); }
.f .tm { grid-row: span 3; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 1px; }
.f .vb { font-size: 13px; font-weight: 700; }
.f .dt { font-size: 11px; color: var(--sub); line-height: 1.45; word-break: break-all; }
.f .who { font-size: 10px; color: var(--dim); }
.f.err .vb { color: var(--err); }
.f.n8n .vb::after { content: "自動"; margin-left: 6px; font-size: 9px; font-weight: 700; color: var(--sub); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; vertical-align: 2px; }

/* 発注 */
#order { right: 16px; bottom: 96px; width: 330px; padding: 12px 14px 12px; }
#order .ph { padding: 0 0 8px; }
#order .dry { color: var(--sub); letter-spacing: .06em; }
#order textarea { width: 100%; height: 64px; resize: none; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 9px 11px; font: inherit; font-size: 12.5px; line-height: 1.5; }
#order .row { display: flex; gap: 8px; margin-top: 8px; }
#order select { flex: 1; min-width: 0; background: rgba(0, 0, 0, .28); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 38px; font: inherit; font-size: 12.5px; }
#order button { height: 38px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font: inherit; font-size: 13px; cursor: pointer; }
#order button:disabled { opacity: .5; }
#order .note { margin: 8px 0 0; font-size: 10.5px; color: var(--dim); line-height: 1.5; }
#order .res { margin-top: 6px; font-size: 11.5px; color: var(--ok); min-height: 0; }
body.masked:not(.kiosk) #order { display: none; }   /* Mac mini の画面（?kiosk=1）だけは出す */

/* 下のバー */
#bar { left: 50%; transform: translateX(-50%); bottom: 16px; padding: 7px; display: flex; gap: 6px; align-items: center; white-space: nowrap; max-width: calc(100vw - 32px); overflow-x: auto; }
.seg { display: flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .22); border-radius: 11px; }
.seg button { border: 0; background: transparent; color: var(--sub); font: inherit; font-size: 12.5px; padding: 0 12px; height: 34px; min-width: 44px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: rgba(255, 255, 255, .12); color: var(--text); font-weight: 700; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sub); padding: 0 8px; height: 40px; cursor: pointer; }
.chk input { width: 15px; height: 15px; accent-color: var(--accent); }
#quality { background: rgba(0, 0, 0, .22); color: var(--text); border: 0; border-radius: 10px; height: 40px; padding: 0 10px; font: inherit; font-size: 12.5px; }
.lnk { display: block; min-height: 28px; margin: 2px 0 -6px; padding: 4px 0; border: 0; background: none; color: var(--sub); font: inherit; font-size: 11.5px; text-decoration: underline; cursor: pointer; text-align: left; }
#credit { left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 7; width: min(460px, calc(100vw - 32px)); padding: 14px 16px; font-size: 12.5px; line-height: 1.7; }
#credit[hidden] { display: none; }
#credit p { margin: 0 0 6px; }
#credit ul { margin: 0 0 6px; padding-left: 1.2em; }
#credit a { color: inherit; text-decoration: underline; word-break: break-word; }
#creditx { height: 40px; padding: 0 14px; margin-top: 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
#hideui { position: fixed; right: 16px; bottom: 16px; z-index: 6; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-strong); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }

/* 人物カード */
.card { position: fixed; z-index: 5; top: 118px; left: 372px; width: 320px; max-height: calc(100vh - 230px); overflow: hidden auto;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5); }
.card[hidden] { display: none; }
.card .ph2 { height: 150px; background: #1d1e23 center 22% / cover no-repeat; position: relative; }
.card .ph2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(18, 18, 22, .95)); }
.card .x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; cursor: pointer; }
.card .bd { padding: 4px 18px 16px; }
.card h2 { margin: 0; font-size: 20px; font-weight: 800; }
.card h2 small { font-size: 11px; color: var(--sub); font-weight: 400; margin-left: 8px; }
.card .role { color: #7fb2ff; font-size: 12px; font-weight: 700; margin-top: 4px; }
.card .bio { font-size: 12.5px; color: #d4d5d9; line-height: 1.7; margin: 10px 0; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card .tags span { font-size: 11px; color: var(--sub); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.card .now { margin: 12px 0 8px; padding: 9px 12px; border-radius: 10px; background: rgba(87, 214, 141, .12); color: var(--ok); font-size: 12.5px; font-weight: 700; }
.card .now.idle { background: rgba(255, 255, 255, .05); color: var(--sub); }
.card .cnt { font-size: 11px; color: var(--sub); margin-bottom: 6px; }
.card .acts { display: flex; gap: 8px; margin-top: 12px; }
.card .acts button { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }

.tag3d { position: fixed; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 999px;
  background: rgba(14, 15, 18, 0.72); border: 1px solid var(--line); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag3d small { font-weight: 500; color: var(--sub); margin-left: 6px; }
body.hide-ui .tag3d { display: none; }
#toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 9; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 12.5px; color: var(--warn); }
#toast[hidden] { display: none; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; background: #0b0c0f; color: var(--sub); font-size: 13px; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }

@media (max-width: 900px) {
  #feed, #order { display: none; }
  #hdr { width: calc(100vw - 32px); }
  /* スマホ：メンバーは顔の横並び（押すとカード） */
  #members { top: var(--hdrb, 136px); left: 16px; right: 16px; width: auto; bottom: auto; }
  #members .ph { display: none; }
  #mlist { display: flex; gap: 2px; overflow-x: auto; padding: 8px; }
  #members .m { flex-direction: column; gap: 4px; padding: 4px 6px; min-width: 64px; text-align: center; }
  #members .m .rl, #members .m .st { display: none; }
  #members .m .nm { font-size: 11px; white-space: nowrap; }
  .card { left: 16px; top: 214px; width: calc(100vw - 32px); max-height: calc(100vh - 300px); }
  #hideui { bottom: 76px; }
  #credit { bottom: 128px; }
}

/* トップページのヒーローに埋め込む表示（?embed=1・2026-10-07）＝枠・ボタン・読み込み中の文字を出さない */
body.embed .panel, body.embed .card, body.embed #hideui, body.embed #loading, body.embed .tag3d { display: none !important; }
/* 見出しが「休止中（最終 ◯:◯）」の札と並ぶと「AI社員オフ／ィス」と折れていた（2026-10-07） */
#hdr h1 .nw { white-space: nowrap; }
#hdr h1 { flex-wrap: wrap; row-gap: 4px; }
#hdr h1 .live { white-space: nowrap; }
