
:root{
  --bg:#f7fbff; --fg:#0b1220; --muted:#64748b; --card:#ffffff; --accent:#2563eb; --soft:#e5effa;
  --ok:#10b981; --warn:#f59e0b; --err:#ef4444;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--fg);font:14.5px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,sans-serif}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
header,footer{background:var(--card);border-bottom:1px solid var(--soft)}
header .wrap, footer .wrap, main .wrap{max-width:1120px;margin:0 auto;padding:12px 16px}
nav a{margin-right:14px}
.btn{display:inline-block;background:var(--accent);color:#fff;padding:10px 14px;border-radius:10px;border:0;font-weight:600}
.btn.secondary{background:#1f2937}
.btn.small{padding:6px 10px;font-size:12.5px;border-radius:8px}
.card{background:var(--card);border:1px solid var(--soft);border-radius:14px;padding:16px;margin-bottom:16px;box-shadow:0 8px 24px rgba(13,42,88,0.04)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
.thumb{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:12px;border:1px solid var(--soft);background:#fff}
.meta{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12.5px;margin-top:6px}
.form-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.form-row label{display:block;font-weight:600;margin-bottom:4px}
input[type=text],input[type=email],input[type=password],textarea,select{
  width:100%;padding:12px;border:1px solid var(--soft);border-radius:12px;background:#fff
}
table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid var(--soft);padding:10px;text-align:left}
.badge{padding:3px 8px;border-radius:999px;background:#eaf2ff;border:1px solid var(--soft);font-size:12px}
.rating{display:flex;gap:4px}
.star{cursor:pointer;font-size:20px;color:#d1d5db}
.star.active{color:#f59e0b}
.tag{font-size:12px;color:#334155;background:#e2e8f0;padding:4px 8px;border-radius:999px;margin-right:6px}
.notice{padding:12px;border-radius:12px;border:1px solid var(--soft);background:#fffbea}
.editor-wrap{display:grid;grid-template-columns:280px 1fr 260px;gap:12px}
.sidebar{position:sticky;top:10px;align-self:start}
canvas.editor{width:100%;height:calc(100vh - 220px);border:1px solid var(--soft);background:#fff;image-rendering:pixelated;touch-action:none;border-radius:12px}
.toolbtn{display:inline-block;padding:8px 10px;border:1px solid var(--soft);border-radius:10px;background:#fff;margin:3px;cursor:pointer;font-weight:600}
.toolbtn.active{background:#e6efff;border-color:#c7d2fe}
.layer-list,.frame-list{list-style:none;margin:0;padding:0}
.layer-list li,.frame-list li{display:flex;align-items:center;justify-content:space-between;padding:8px;border:1px dashed var(--soft);border-radius:10px;margin-bottom:8px;background:#fff}
small.muted{color:var(--muted)}
footer{border-top:1px solid var(--soft)}
/* Mobile optimizations */
@media (max-width: 980px){
  .editor-wrap{grid-template-columns:1fr}
  .sidebar{position:static}
  canvas.editor{height:64vh}
  header .wrap, main .wrap{padding:10px 12px}
  .btn{padding:10px 12px}
}

.star-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;background:#fff3d4;border:1px solid #fde68a;padding:2px 6px;border-radius:999px}
.star-chip .s{color:#f59e0b}

/* Avatar styles */
.avatar{width:24px;height:24px;border-radius:50%;object-fit:cover;vertical-align:middle;}
.avatar.lg{width:96px;height:96px;border-radius:50%;}
.avatar.md{width:48px;height:48px;border-radius:50%;}
.avatar.sm{width:20px;height:20px;border-radius:50%;}

.editor-wrap .sidebar .form-row input[type=text]{width:100%;}

#filterControls .form-row{margin:6px 0}
#filterControls label{display:block;margin-bottom:2px}
#filterControls input[type='range']{width:100%}

#palCountRow{display:block}

/* Selection rectangle overlay */
.canvas-select { outline: 1px dashed #2563eb; outline-offset: -1px; }
.selection-hint { font-size:12px; color:#6b7280 }
