:root { --bg: #eef1f6; --ink: #1d2433; --muted: #5b6475; --line: #d5dbe6; --card: #fff; --accent: #0d99ff; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#demo { display: flex; flex-direction: column; min-height: 100%; padding: 12px 16px 16px; gap: 12px; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: #1e1e1e; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.pill { background: #e3f6e8; color: #17692f; border: 1px solid #bfe6c9; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.grow { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.body { display: grid; grid-template-columns: 260px 1fr; gap: 14px; flex: 1; min-height: 0; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; align-self: start; }
.guide h2 { margin: 0 0 6px; font-size: 15px; }
.guide ol { margin: 0; padding-left: 20px; }
.guide li { margin: 6px 0; }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.editor { display: flex; flex-direction: column; background: #2c2c2c; border-radius: 12px; overflow: hidden; min-height: 680px; border: 1px solid #1e1e1e; box-shadow: 0 8px 30px rgba(20, 30, 60, .14); }
.ftop { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: #fff; background: #2c2c2c; }
.fname { font-size: 13px; flex: 1; }
.zoombar { display: flex; gap: 6px; }
.zoombar .btn { background: #3a3a3a; color: #fff; border-color: #4a4a4a; padding: 4px 9px; }
.samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; }
.samples .or { color: var(--muted); }
.fmain { position: relative; flex: 1; min-height: 560px; display: flex; }
.fcanvas { flex: 1; background: #f5f5f5; background-image: radial-gradient(#d9d9d9 1px, transparent 1px); background-size: 20px 20px; position: relative; min-height: 0; }
.fcanvas.empty::after { content: "The canvas is empty. Load a sample file into the plugin, then click its import button."; position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); color: #888; text-align: center; width: min(360px, 80%); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.pwin { position: absolute; top: 12px; right: 12px; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.28); overflow: hidden; z-index: 3; max-height: calc(100% - 24px); display: flex; flex-direction: column; }
.phead { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #e6e6e6; font-weight: 600; font-size: 12.5px; }
.pclose { border: 0; background: none; font-size: 18px; cursor: pointer; line-height: 1; }
.pbody { overflow: auto; }
.pframe { display: block; border: 0; max-width: 100%; }
.runagain { position: absolute; top: 14px; right: 14px; z-index: 3; }
.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 20; width: min(560px, calc(100% - 32px)); }
.toast { background: #1e1e1e; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 13.5px; }
.toast a { color: #9fd2ff; word-break: break-all; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 30; }
.mbox { background: #fff; border-radius: 14px; padding: 20px 22px; width: min(420px, calc(100% - 32px)); }
.mbox h3 { margin: 0 0 8px; }
.mbtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 900px) { .body { grid-template-columns: 1fr; } .guide { order: 2; } }
@media (max-width: 640px) {
  #demo { padding: 10px 12px 14px; }
  .fmain { flex-direction: column; min-height: 0; }
  .fcanvas { min-height: 380px; order: 2; }
  .pwin { position: relative; top: 0; right: 0; order: 1; border-radius: 0; box-shadow: none; max-height: none; }
  .pframe { width: 100% !important; }
  .runagain { position: static; margin: 8px; order: 1; }
}
