[hidden] { display: none !important; }
:root {
  --bg: #f6f5f3; --panel: #fff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e4e2de; --accent: #e8590c; --accent-ink: #fff;
  --ok: #2b8a3e; --warn: #c27c0e; --bad: #c92a2a; --info: #1c7ed6; --radius: 10px; --side: 232px;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 17px; margin: 24px 0 10px; } h3 { font-size: 15px; margin: 16px 0 8px; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: #c9c6c0; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); border-color: #f0c4c4; }
button.small, .btn.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; width: 100%; color: inherit; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); margin: 6px 0; }
label.inline input { width: auto; }
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); background: #1f1d1b; color: #ddd; padding: 16px 10px; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 20; }
.side .brand { font-weight: 800; font-size: 18px; color: #fff; padding: 4px 10px 14px; letter-spacing: .04em; }
.side .brand small { display: block; font-size: 11px; color: #999; font-weight: 400; letter-spacing: 0; }
.side a { display: flex; align-items: center; gap: 8px; color: #cfcac4; padding: 8px 10px; border-radius: 8px; }
.side a:hover { background: #2d2a27; text-decoration: none; }
.side a.active { background: var(--accent); color: #fff; }
.side .sec { font-size: 11px; color: #8a847d; margin: 14px 10px 4px; }
.side .badge { margin-left: auto; }
.main { margin-left: var(--side); flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1200px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: #eee; color: #444; white-space: nowrap; }
.badge.ok { background: #e6f4ea; color: var(--ok); } .badge.warn { background: #fdf3e1; color: var(--warn); } .badge.bad { background: #fde8e8; color: var(--bad); } .badge.info { background: #e7f1fb; color: var(--info); }
.badge.live { background: var(--bad); color: #fff; }
.badge.count { background: var(--accent); color: #fff; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: #eee; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #222; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.error { background: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal.wide { width: min(980px, 100%); }
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-box { width: min(440px, 100%); }
.auth-box .logo { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 16px; color: var(--accent); letter-spacing: .05em; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); transition: .15s; }
.dropzone.over { border-color: var(--accent); background: #fff4ec; color: var(--ink); }
.upload-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.video-wrap { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.video-wrap video { width: 100%; display: block; max-height: 70vh; background: #000; }
.player-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.comment { padding: 10px; border-bottom: 1px solid var(--line); }
.comment .tc { font-family: ui-monospace, monospace; background: #fff1e6; color: var(--accent); padding: 1px 6px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.comment.resolved .body { text-decoration: line-through; color: var(--muted); }
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - 57px); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--panel); }
.chat-list a { display: flex; gap: 8px; align-items: center; padding: 10px 12px; color: var(--ink); border-bottom: 1px solid #f0eeea; }
.chat-list a.active { background: #fff1e6; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; }
.msg { margin-bottom: 12px; max-width: 760px; }
.msg .who { font-size: 12px; color: var(--muted); }
.msg .text { white-space: pre-wrap; word-break: break-word; background: var(--panel); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; display: inline-block; }
.msg.mine { margin-left: auto; text-align: right; }
.msg.mine .text { background: #fff1e6; border-color: #ffd8bf; text-align: left; }
.chat-input { border-top: 1px solid var(--line); padding: 10px; background: var(--panel); }
.chat-input textarea { min-height: 44px; }
.attach { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; background: #f1efeb; border-radius: 6px; padding: 3px 8px; margin: 4px 4px 0 0; }
.preview-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.preview-frame { width: 100%; height: 70vh; border: 0; }
/* Live room */
.room { position: fixed; inset: 0; background: #111; color: #eee; display: flex; flex-direction: column; z-index: 100; }
.room-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #1b1b1b; }
.room-top .title { font-weight: 700; }
.rec-indicator { display: none; align-items: center; gap: 6px; background: var(--bad); color: #fff; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.rec-indicator.on { display: inline-flex; }
.rec-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.room-body { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 8px; gap: 8px; }
.stage-main { flex: 1; min-height: 0; background: #000; border-radius: 10px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage-main video { width: 100%; height: 100%; object-fit: contain; }
.tiles { display: flex; gap: 8px; overflow-x: auto; min-height: 110px; }
.tile { position: relative; width: 170px; height: 104px; flex: 0 0 auto; background: #222; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .name, .stage-main .name { position: absolute; left: 6px; bottom: 6px; font-size: 12px; background: rgba(0,0,0,.6); padding: 1px 8px; border-radius: 4px; }
.tile.speaking { outline: 3px solid #51cf66; }
.tile .avatar { font-size: 32px; font-weight: 700; color: #888; }
.room-side { width: 320px; background: #1b1b1b; display: flex; flex-direction: column; min-height: 0; }
.room-side .tabs a { color: #aaa; } .room-side .tabs a.active { color: #fff; }
.room-side .panel { flex: 1; overflow-y: auto; padding: 8px 12px; }
.room-side .p-item { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #2a2a2a; font-size: 13px; }
.room-side .p-item .grow { flex: 1; min-width: 0; }
.room-side button { background: #2a2a2a; color: #eee; border-color: #3a3a3a; }
.room-side input { background: #222; color: #eee; border-color: #3a3a3a; }
.room-controls { display: flex; justify-content: center; gap: 10px; padding: 10px; background: #1b1b1b; flex-wrap: wrap; }
.room-controls button { background: #2a2a2a; color: #eee; border-color: #3a3a3a; padding: 10px 16px; border-radius: 99px; }
.room-controls button.off { background: var(--bad); border-color: var(--bad); }
.room-controls button.on { background: var(--accent); border-color: var(--accent); }
.hand { color: #ffd43b; }
.room-msg { font-size: 13px; padding: 4px 0; } .room-msg b { color: #ffa94d; }
.consent-box { background: #fff; color: var(--ink); }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: .2s; } .side.open { transform: none; }
  .main { margin-left: 0; } .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
  .review-layout { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 220px; } .chat-msgs { height: 55vh; }
  .room-body { flex-direction: column; } .room-side { width: 100%; height: 38vh; }
  .tile { width: 120px; height: 76px; } .tiles { min-height: 80px; }
  .room-controls button { padding: 8px 12px; font-size: 12px; }
}
