:root {
  --bg: #0e0e10;
  --bg2: #16161a;
  --bg3: #1e1e24;
  --bg4: #26262e;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e8e8ee;
  --text2: #9090a0;
  --text3: #55556a;
  --accent: #7F77DD;
  --accent-dim: rgba(127,119,221,0.15);
  --accent-bright: #a09aee;
  --danger: #E24B4A;
  --success: #1D9E75;
  --warning: #EF9F27;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

/* ---- APP SHELL ---- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- TOPBAR ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-center { display: flex; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark { display: flex; }
.logo-text { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }

.divider-v { width: 1px; height: 18px; background: var(--border2); flex-shrink: 0; }

.scene-name {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 8px;
  outline: none;
  min-width: 0;
  max-width: 200px;
  transition: border-color 0.15s;
}
.scene-name:hover { border-color: var(--border2); }
.scene-name:focus { border-color: var(--accent); background: var(--bg3); }

/* tracking switcher */
.track-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.track-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--text2);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.track-btn .ti { font-size: 14px; }
.track-btn:hover { color: var(--text); }
.track-btn.active {
  background: var(--bg4);
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* top buttons */
.btn-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--sans);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
}
.btn-top:hover { background: var(--bg4); }

.btn-live { color: var(--danger); border-color: rgba(226,75,74,0.3); }
.btn-live:hover { background: rgba(226,75,74,0.1); }
.btn-live.cam-on { background: var(--danger); color: #fff; border-color: var(--danger); }

.live-indicator {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  display: none;
  animation: pulse 1.2s ease-in-out infinite;
}
.btn-live.cam-on .live-indicator { display: block; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }

.btn-publish {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 500;
}
.btn-publish:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* ---- MAIN LAYOUT ---- */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---- LEFT PANEL ---- */
.panel-left {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 6px;
}
.panel-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.icon-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.12s;
}
.icon-btn:hover { background: var(--bg4); color: var(--text); }

.upload-drop {
  margin: 0 10px 10px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.upload-drop:hover, .upload-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-drop .ti { font-size: 20px; color: var(--text3); margin-bottom: 2px; }
.upload-drop > span:not(.upload-hint) { font-size: 11px; color: var(--text2); }
.upload-hint { font-size: 10px; color: var(--text3); font-family: var(--mono); }

.asset-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius);
  cursor: grab;
  border: 1px solid transparent;
  transition: all 0.12s;
  user-select: none;
}
.asset-item:hover { background: var(--bg3); border-color: var(--border); }
.asset-item:active { cursor: grabbing; }
.asset-item.is-dragging { opacity: 0.4; }

.asset-thumb {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--bg4);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb .ti { font-size: 16px; }

.asset-info { flex: 1; min-width: 0; }
.asset-name { font-size: 11px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-badge { font-size: 9px; color: var(--text3); font-family: var(--mono); text-transform: uppercase; }

.panel-divider { height: 1px; background: var(--border); margin: 4px 0; }

.target-zone {
  margin: 0 10px 10px;
  border: 1px dashed rgba(127,119,221,0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
}
.target-zone:hover { border-color: var(--accent); }
.target-preview {
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center;
}
.target-preview .ti { font-size: 20px; color: var(--accent); opacity: 0.5; }
.target-preview > span:not(.upload-hint) { font-size: 11px; color: var(--text2); }
.target-preview img { width: 100%; border-radius: 6px; }

/* ---- CANVAS AREA ---- */
.canvas-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tool-group { display: flex; gap: 2px; }
.tool-btn {
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all 0.12s;
}
.tool-btn:hover { background: var(--bg3); border-color: var(--border); color: var(--text); }
.tool-btn.active-tool { background: var(--bg4); border-color: var(--border2); color: var(--text); }
.tool-btn.danger-btn { color: var(--danger) !important; }
.tool-btn.danger-btn:hover { background: rgba(226,75,74,0.1); }
.tool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.zoom-display { font-size: 11px; color: var(--text2); font-family: var(--mono); min-width: 36px; text-align: center; }

.mode-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent-bright);
  letter-spacing: 0.05em;
}

/* CANVAS SPLIT */
.canvas-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* EDITOR SIDE */
.editor-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: flex 0.3s ease;
}

.dots-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* PHONE FRAME */
.phone-frame {
  position: relative;
  width: 280px;
  height: 480px;
  background: #0a0a0c;
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.1),
    0 0 0 10px rgba(0,0,0,0.4),
    0 0 0 11px rgba(255,255,255,0.05),
    0 40px 80px rgba(0,0,0,0.6);
  transition: transform 0.3s;
  cursor: default;
  flex-shrink: 0;
}

.phone-notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 18px;
  background: #0a0a0c;
  border-radius: 10px;
  z-index: 20;
  pointer-events: none;
}
.phone-border {
  position: absolute;
  inset: 0;
  border-radius: 36px;
  border: 1.5px solid rgba(255,255,255,0.08);
  pointer-events: none;
  z-index: 20;
}

.scene-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* IMAGE mode BG */
.tracker-ui {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1a1a2e 0%, #0f1020 60%, #0a0a14 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tracker-corners { position: relative; width: 130px; height: 90px; }
.tc { position: absolute; width: 14px; height: 14px; border-color: var(--accent); border-style: solid; }
.tl { top:0;left:0; border-width:2px 0 0 2px; }
.tr { top:0;right:0; border-width:2px 2px 0 0; }
.bl { bottom:0;left:0; border-width:0 0 2px 2px; }
.br { bottom:0;right:0; border-width:0 2px 2px 0; }
.tracker-img-preview {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tracker-img-preview img { width: 100%; height: 100%; object-fit: contain; }
.tracker-label { font-size: 9px; font-family: var(--mono); color: var(--accent); opacity: 0.6; }

/* FACE mode BG */
.face-ui {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #14101e 0%, #0e0a18 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.face-mesh-svg { width: 160px; height: 200px; }
.face-label { font-size: 9px; font-family: var(--mono); color: var(--accent); opacity: 0.5; }

/* PLANE mode BG */
.plane-ui {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a14 0%, #0e0e1c 40%, #12121e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding-bottom: 20px;
}
.plane-svg { width: 100%; max-width: 280px; }
.plane-label { font-size: 9px; font-family: var(--mono); color: var(--accent); opacity: 0.5; margin-top: -8px; }

/* AR STAGE */
.ar-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.ar-stage.interactive { pointer-events: auto; }

/* AR objects */
.ar-obj {
  position: absolute;
  cursor: move;
  user-select: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: outline 0.1s;
  pointer-events: auto;
}
.ar-obj:hover { outline: 1px dashed rgba(127,119,221,0.4); outline-offset: 2px; }
.ar-obj.selected {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}
.ar-obj .obj-icon { font-size: 24px; pointer-events: none; }
.ar-obj .resize-handle {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 2px;
  cursor: se-resize;
}

/* DROP HINT */
.drop-hint {
  position: absolute;
  inset: 0;
  background: rgba(127,119,221,0.12);
  border: 2px dashed var(--accent);
  border-radius: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  color: var(--accent);
  font-size: 14px;
}
.drop-hint .ti { font-size: 24px; }
.drop-hint.show { display: flex; }

/* ---- LIVE PANEL ---- */
.live-panel {
  width: 0;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1);
  background: #080808;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.live-panel.open { width: 300px; }

.live-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.live-title-row { display: flex; align-items: center; gap: 7px; }
.live-rec-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
  display: none;
}
.live-rec-dot.active { display: block; }
.live-title { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.6); }
.live-icon-btn {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.12s;
}
.live-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.live-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
}

#liveVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1);
}
#liveCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.live-ar-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.cam-off-state, .cam-denied-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
}
.cam-off-state .ti { font-size: 36px; color: rgba(255,255,255,0.12); }
.cam-off-state p { font-size: 12px; color: rgba(255,255,255,0.25); }
.cam-denied-state .ti { font-size: 36px; color: var(--danger); opacity: 0.6; }
.cam-denied-state p { font-size: 11px; color: rgba(255,255,255,0.35); line-height: 1.5; }
.cam-denied-state button {
  margin-top: 8px;
  padding: 6px 16px;
  font-size: 11px;
  font-family: var(--sans);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.12s;
}
.cam-denied-state button:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Tracking overlay */
.tracking-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tracking-frame {
  position: relative;
  width: 55%;
  height: 35%;
}
.tfc {
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--accent);
  border-style: solid;
}
.tfc-tl { top:-1px;left:-1px; border-width:2px 0 0 2px; }
.tfc-tr { top:-1px;right:-1px; border-width:2px 2px 0 0; }
.tfc-bl { bottom:-1px;left:-1px; border-width:0 0 2px 2px; }
.tfc-br { bottom:-1px;right:-1px; border-width:0 2px 2px 0; }

.live-ar-object {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.live-stats {
  display: flex;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.live-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.25);
}
.live-stat .ti { font-size: 11px; }
.live-stat.ok { color: var(--success); }
.live-stat.warn { color: var(--warning); }

.live-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.live-action-btn {
  flex: 1;
  padding: 6px;
  font-size: 11px;
  font-family: var(--sans);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all 0.12s;
}
.live-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.live-action-btn.recording { color: var(--danger); border-color: rgba(226,75,74,0.3); }

/* ---- RIGHT PANEL ---- */
.panel-right {
  width: 210px;
  flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}

.no-sel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}
.no-sel .ti { font-size: 28px; color: var(--text3); }
.no-sel p { font-size: 11px; color: var(--text3); line-height: 1.6; }

.prop-object-name {
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.prop-group {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prop-group-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.prop-row-2 { display: flex; gap: 6px; }
.prop-row-1 { display: flex; }
.prop-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.prop-field label { font-size: 10px; color: var(--text3); }
.prop-field input[type="number"] {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--mono);
  padding: 4px 6px;
  outline: none;
  text-align: right;
  transition: border-color 0.12s;
}
.prop-field input[type="number"]:focus { border-color: var(--accent); }

.prop-row-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
}
.toggle {
  width: 30px; height: 17px;
  background: var(--bg4);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border2);
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle-knob {
  position: absolute;
  width: 13px; height: 13px;
  background: #fff;
  border-radius: 50%;
  top: 1px; left: 1px;
  transition: transform 0.2s;
}
.toggle.on .toggle-knob { transform: translateX(13px); }

.prop-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-family: var(--sans);
  padding: 5px 6px;
  outline: none;
}
.prop-select:focus { border-color: var(--accent); }

.prop-input-text {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
}
.prop-input-text:focus { border-color: var(--accent); }

.prop-row-2.btns { gap: 6px; }
.prop-btn {
  flex: 1;
  padding: 5px;
  font-size: 11px;
  font-family: var(--sans);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: all 0.12s;
}
.prop-btn:hover { background: var(--bg4); color: var(--text); }

/* ---- STATUS BAR ---- */
.statusbar {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}
.stat-item .ti { font-size: 11px; }
.stat-item.ok { color: var(--success); }
.stat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 360px;
  padding: 24px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-title { font-size: 15px; font-weight: 500; color: var(--text); }
.modal-desc { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 16px; }

.publish-url-row { display: flex; gap: 8px; margin-bottom: 16px; }
.publish-url-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text2);
  overflow: hidden;
}
.publish-url-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publish-url-box .ti { color: var(--text3); flex-shrink: 0; }
.btn-copy {
  width: 36px; height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all 0.12s;
  flex-shrink: 0;
}
.btn-copy:hover { background: var(--bg4); color: var(--text); }

.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
#qrCanvas {
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
}
.qr-caption { font-size: 11px; color: var(--text3); }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-cancel {
  padding: 7px 16px;
  font-size: 12px;
  font-family: var(--sans);
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.12s;
}
.btn-cancel:hover { background: var(--bg3); color: var(--text); }
.btn-do-publish {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-do-publish:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

.btn-phone {
  color: #1D9E75;
  border-color: rgba(29,158,117,0.35);
  font-weight: 500;
}
.btn-phone:hover { background: rgba(29,158,117,0.1); }

/* Phone test modal extras */
.phone-test-mode-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.phone-mode-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
}
.phone-mode-chip.active {
  background: var(--accent-dim);
  border-color: rgba(127,119,221,0.4);
  color: var(--accent-bright);
}

.phone-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.phone-qr-frame {
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: inline-block;
}
#phoneQrCanvas { display: block; border-radius: 4px; }
.phone-qr-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text3);
}
.phone-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.phone-test-notes {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.phone-test-notes strong { color: var(--text2); }

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text);
  opacity: 0;
  transition: all 0.25s;
  pointer-events: none;
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
