:root { --bg: #fff; --fg: #111; --muted: #666; --line: #e5e5e5; --accent: #111; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; border: 2px solid var(--fg); border-radius: 8px; display: grid; place-items: center; font-weight: 700; }
.titles h1 { margin: 0; font-size: 18px; }
.titles p { margin: 0; color: var(--muted); font-size: 12px; }
.user-info { display: flex; align-items: center; gap: 10px; color: var(--muted); }

.app-main { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.video-section { position: relative; display: grid; grid-template-columns: 1fr; gap: 10px; }
.video-wrapper { position: relative; background: #000; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.video-wrapper.remote { aspect-ratio: 16 / 9; }
.video-wrapper.local { width: 280px; aspect-ratio: 16 / 9; position: absolute; right: 10px; bottom: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.status-badge { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,0.9); color: #000; padding: 4px 8px; border-radius: 6px; font-size: 12px; }

.controls-section { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); padding: 10px; border-radius: 10px; }
.left-controls, .middle-controls, .right-controls { display: flex; align-items: center; gap: 8px; }
button { border: 1px solid var(--line); background: #fff; color: var(--fg); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.secondary { }
button.icon-btn { min-width: 70px; }
button:disabled { opacity: 0.5; cursor: default; }

.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.chat-section { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chat-header { padding: 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.chat-log { height: 220px; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: #fafafa; }
.msg { display: inline-flex; max-width: 80%; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.msg.self { align-self: flex-end; background: #f0f0f0; }
.msg.sys { align-self: center; font-size: 12px; color: var(--muted); border: none; background: transparent; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.chat-form button { padding: 10px 16px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: grid; place-items: center; }
.overlay.hidden { display: none; }
.modal { background: #fff; color: #111; width: min(800px, 92vw); max-height: 80vh; overflow: auto; padding: 20px; border-radius: 12px; }
.tos-body { color: #333; display: grid; gap: 10px; margin-bottom: 14px; }
.tos-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 840px) {
  .video-wrapper.local { position: static; width: 100%; box-shadow: none; }
  .video-section { grid-template-columns: 1fr; }
}

