.m3d-wrap { --m3d-blue: #1d4ed8; --m3d-blue-dark:#173fb0; --m3d-bg:#0f172a; --m3d-panel:#111827;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; box-sizing: border-box; }
.m3d-wrap *, .m3d-wrap *::before, .m3d-wrap *::after { box-sizing: border-box; }

/* ---------- Auth ---------- */
.m3d-auth-wrap { display:flex; justify-content:center; padding:40px 16px; }
.m3d-auth-card { width:100%; max-width:420px; background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:28px; box-shadow:0 10px 30px rgba(0,0,0,.06); }
.m3d-tabs { display:flex; gap:8px; margin-bottom:18px; }
.m3d-tab { flex:1; padding:10px; border:1px solid #e5e7eb; background:#f8fafc; border-radius:8px; cursor:pointer; font-weight:600; color:#334155; }
.m3d-tab.active { background: var(--m3d-blue); color:#fff; border-color:var(--m3d-blue); }
.m3d-form label { display:block; font-size:13px; font-weight:600; color:#334155; margin:10px 0 4px; }
.m3d-form input[type=text], .m3d-form input[type=email], .m3d-form input[type=password] {
  width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; }
.m3d-note { font-size:12.5px; color:#64748b; margin-top:16px; line-height:1.5; }
.m3d-msg { min-height:0; font-size:13.5px; }
.m3d-msg:not(:empty){ padding:8px 10px; border-radius:8px; margin-bottom:8px; }
.m3d-msg.m3d-error { background:#fee2e2; color:#991b1b; }
.m3d-msg.m3d-success { background:#dcfce7; color:#166534; }

/* ---------- Pricing ---------- */
.m3d-pricing-wrap { text-align:center; padding:36px 16px; }
.m3d-heading { font-size:26px; margin-bottom:6px; color:#0f172a; }
.m3d-sub { color:#64748b; max-width:640px; margin:0 auto 26px; }
.m3d-plans-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; max-width:1100px; margin:0 auto; }
.m3d-plan-card { background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:24px 16px; box-shadow:0 8px 20px rgba(0,0,0,.05); }
.m3d-plan-card h3 { margin:0 0 10px; color:#0f172a; }
.m3d-price { font-size:30px; font-weight:800; color:var(--m3d-blue); }
.m3d-duration { color:#64748b; font-size:13px; margin-bottom:16px; }

/* ---------- Buttons ---------- */
.m3d-btn { background:#fff; border:1px solid #cbd5e1; color:#1e293b; padding:9px 14px; border-radius:8px; cursor:pointer; font-size:13.5px; font-weight:600; }
.m3d-btn:hover { background:#f1f5f9; }
.m3d-btn-primary { background: var(--m3d-blue); color:#fff; border-color:var(--m3d-blue); }
.m3d-btn-primary:hover { background: var(--m3d-blue-dark); }
.m3d-btn-block { width:100%; margin-top:8px; }
.m3d-btn:disabled { opacity:.5; cursor:not-allowed; }
.m3d-btn-row { display:flex; gap:8px; margin:8px 0; }

/* ---------- App shell ---------- */
.m3d-app-wrap { position:relative; background:#0b1224; border-radius:14px; overflow:hidden; border:1px solid #1e293b; }
.m3d-toolbar { display:flex; flex-wrap:wrap; gap:14px; align-items:center; background:#0f172a; padding:10px 14px; border-bottom:1px solid #1e293b; }
.m3d-toolbar-group { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.m3d-brand { color:#fff; font-weight:800; margin-right:6px; letter-spacing:.3px; }
.m3d-toolbar select, .m3d-toolbar input[type=text] { padding:6px 8px; border-radius:6px; border:1px solid #334155; background:#1e293b; color:#e2e8f0; font-size:12.5px; }
.m3d-file-btn { background:#1e293b; color:#e2e8f0; padding:6px 10px; border-radius:6px; font-size:12.5px; cursor:pointer; border:1px solid #334155; }
.m3d-file-btn input { display:none; }
.m3d-icon-btn { background:#1e293b; color:#e2e8f0; border:1px solid #334155; padding:6px 10px; border-radius:6px; font-size:12.5px; cursor:pointer; }
.m3d-icon-btn:hover { background:#334155; }
.m3d-icon-btn.active { background: var(--m3d-blue); border-color:var(--m3d-blue); }
.m3d-icon-btn.m3d-danger:hover { background:#7f1d1d; }

.m3d-body { display:flex; height:640px; max-height:78vh; }
.m3d-canvas-holder { position:relative; flex:1; background:#0b1224; }
#m3d-canvas { width:100%; height:100%; display:block; }
.m3d-coords { position:absolute; bottom:10px; left:10px; background:rgba(15,23,42,.75); color:#e2e8f0; padding:6px 10px; border-radius:8px; font-size:12px; }
.m3d-hint { position:absolute; top:10px; left:10px; right:10px; background:rgba(15,23,42,.7); color:#cbd5e1; padding:8px 12px; border-radius:8px; font-size:12px; max-width:520px; }

.m3d-right-panel { width:280px; background:#0f172a; border-left:1px solid #1e293b; padding:14px; overflow-y:auto; color:#e2e8f0; }
.m3d-panel-section { border-bottom:1px solid #1e293b; padding-bottom:14px; margin-bottom:14px; }
.m3d-panel-section h4 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.5px; color:#94a3b8; }
.m3d-panel-section select, .m3d-panel-section input[type=text] { width:100%; padding:7px 9px; border-radius:6px; border:1px solid #334155; background:#1e293b; color:#e2e8f0; font-size:12.5px; margin-bottom:6px; }
.m3d-timer { font-size:12px; color:#f87171; min-height:16px; }
.m3d-sub-info { font-size:12.5px; color:#cbd5e1; margin:4px 0; }
.m3d-design-list { list-style:none; margin:8px 0 0; padding:0; max-height:180px; overflow-y:auto; }
.m3d-design-list li { display:flex; justify-content:space-between; align-items:center; gap:6px; background:#1e293b; padding:6px 8px; border-radius:6px; margin-bottom:6px; font-size:12px; }
.m3d-design-list button { background:none; border:none; color:#93c5fd; cursor:pointer; font-size:12px; }
.m3d-design-list button.m3d-del { color:#f87171; }

/* ---------- AI assistant ---------- */
.m3d-ai-fab { position:absolute; right:20px; bottom:20px; background:var(--m3d-blue); color:#fff; border:none; border-radius:999px; padding:12px 18px; font-weight:700; cursor:pointer; box-shadow:0 8px 20px rgba(0,0,0,.35); z-index:20; }
.m3d-ai-panel { display:none; position:absolute; right:20px; bottom:74px; width:300px; max-height:420px; background:#0f172a; border:1px solid #334155; border-radius:12px; overflow:hidden; z-index:21; flex-direction:column; }
.m3d-ai-panel.open { display:flex; }
.m3d-ai-header { display:flex; justify-content:space-between; align-items:center; background:#1e293b; color:#fff; padding:10px 12px; font-weight:700; font-size:13px; }
.m3d-ai-header button { background:none; border:none; color:#fff; font-size:18px; cursor:pointer; }
.m3d-ai-messages { flex:1; overflow-y:auto; padding:10px; font-size:12.5px; color:#e2e8f0; }
.m3d-ai-messages .m3d-msg-user { background:#1e40af; padding:6px 9px; border-radius:8px; margin:6px 0; align-self:flex-end; }
.m3d-ai-messages .m3d-msg-bot { background:#1e293b; padding:6px 9px; border-radius:8px; margin:6px 0; }
.m3d-ai-form { display:flex; border-top:1px solid #334155; }
.m3d-ai-form input { flex:1; border:none; padding:10px; background:#0f172a; color:#fff; font-size:12.5px; }
.m3d-ai-form button { border:none; background:var(--m3d-blue); color:#fff; padding:0 14px; cursor:pointer; }

@media (max-width: 900px) {
  .m3d-body { flex-direction:column; height:auto; }
  .m3d-right-panel { width:100%; border-left:none; border-top:1px solid #1e293b; }
  .m3d-canvas-holder { height:420px; }
}
