:root {
  --accent: #2f6bff;
  --bg: #0f1012; --panel: #17191d; --border: rgba(255,255,255,0.09);
  --ink: #e9ebf0; --muted: #9aa0ab;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 ui-sans-serif, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; }

/* ── top bar ── */
.bar { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--border); flex: none; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand img { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; }
.brand .initials { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.brand .who { display: flex; flex-direction: column; min-width: 0; }
.brand .who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .who span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mid { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.page-sel { background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; max-width: 280px; }
.devices { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.devices button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.devices button + button { border-left: 1px solid var(--border); }
.devices button.active { background: var(--accent); color: #fff; }
.actions { display: flex; gap: 8px; }
.btn { background: rgba(255,255,255,0.08); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.btn.ghost.active { background: var(--accent); border-color: transparent; color: #fff; }
.btn.mini { padding: 4px 9px; font-size: 12px; }

/* ── stage: iframe + panel ── */
.stage { flex: 1; display: flex; min-height: 0; }
.frame-wrap { flex: 1; margin: 0 auto; width: 100%; background: #fff; overflow: hidden; transition: max-width .18s cubic-bezier(.22,1,.36,1); }
iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.panel { width: 320px; flex: none; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.panel-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.panel-empty { color: var(--muted); font-size: 13px; padding: 18px 8px; text-align: center; }
.cm-approved { display: flex; align-items: center; gap: 6px; color: #2bd07a; font-size: 13px; padding: 8px 10px; background: rgba(43,208,122,0.1); border-radius: 8px; }

/* ── comment card ── */
.cm { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; }
.cm:hover { border-color: rgba(255,255,255,0.2); }
.cm.done { opacity: 0.6; }
.cm.flash { outline: 2px solid var(--accent); }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cm-anchor { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-badge { display: inline-flex; align-items: center; gap: 3px; color: #2bd07a; font-size: 11px; flex: none; }
.cm-note { margin: 6px 0 2px; white-space: pre-wrap; word-break: break-word; }
.cm-w { display: inline-block; font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.cm-by { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.cm-row { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cm-btn { background: rgba(255,255,255,0.08); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 11.5px; cursor: pointer; }
.cm-btn:hover { filter: brightness(1.15); }
.cm-btn.danger:hover { background: rgba(255,80,80,0.2); }

/* ── composer (floating) ── */
.composer { position: fixed; right: 18px; bottom: 18px; width: 300px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,0.5); padding: 12px; z-index: 20; }
.composer[hidden] { display: none; }
.composer-anchor { color: var(--muted); font-size: 11px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-name, .composer textarea { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px; margin-bottom: 8px; resize: vertical; }
.composer-name:focus, .composer textarea:focus { border-color: var(--accent); outline: none; }
.composer-row { display: flex; justify-content: flex-end; gap: 8px; }

/* ── toast ── */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #111318; color: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font-size: 13px; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.toast[hidden] { display: none; }

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; height: auto; padding: 8px; }
  .panel { width: 260px; }
}
