/* VB Platform — Safari-compatible CSS (iOS 9+) */
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  background: #0c0f14; color: #e8ecf4;
  line-height: 1.65; min-height: 100%;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
* { -webkit-box-sizing: border-box; box-sizing: border-box; }

/* Welcome */
#stage-welcome {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  padding: 24px;
  -webkit-transition: opacity 0.5s ease, -webkit-transform 0.5s ease;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#stage-welcome.is-leaving {
  opacity: 0;
  -webkit-transform: scale(1.04) translateY(-12px);
  transform: scale(1.04) translateY(-12px);
  pointer-events: none;
}
.welcome-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;
  background: #0c0f14;
  background: -webkit-radial-gradient(ellipse 80% 60% at 50% 0%, #1a1030 0%, #0c0f14 70%);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1a1030 0%, #0c0f14 70%);
}
.welcome-grid {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image: linear-gradient(rgba(124,77,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,77,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.welcome-orb { position: absolute; border-radius: 50%; pointer-events: none; opacity: 0.35; }
.welcome-orb-1 { width: 280px; height: 280px; background: #5c2d91; top: -60px; right: -30px; }
.welcome-orb-2 { width: 200px; height: 200px; background: #0e7490; bottom: 5%; left: -40px; opacity: 0.2; }
.welcome-inner { position: relative; z-index: 2; text-align: center; max-width: 420px; width: 100%; }
.vb-mark { margin: 0 auto 20px; width: 72px; height: 72px; }
.vb-mark-box {
  width: 72px; height: 72px; border-radius: 16px; background: #5c2d91;
  color: #fff; font-family: Arial Black, Arial, sans-serif; font-size: 26px; font-weight: 900;
  line-height: 72px; text-align: center;
  -webkit-box-shadow: 0 8px 24px rgba(92,45,145,0.4); box-shadow: 0 8px 24px rgba(92,45,145,0.4);
}
.welcome-title { font-size: 26px; font-weight: 800; line-height: 1.3; margin: 0 0 8px; }
@media (min-width: 480px) { .welcome-title { font-size: 34px; } }
.welcome-name { display: block; margin-top: 4px; color: #c4b5fd; }
.welcome-lead { color: #8b95a8; font-size: 16px; margin: 0 0 32px; }
.swipe { width: 100%; max-width: 300px; margin: 0 auto; }
.swipe-track {
  position: relative; height: 56px; background: #1a1f2a; border: 1px solid #2a3140;
  border-radius: 999px; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.swipe-progress {
  position: absolute; top: 0; right: 0; bottom: 0; width: 0%;
  background: rgba(124,77,255,0.25); border-radius: 999px; pointer-events: none;
}
.swipe-label {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  color: #8b95a8; font-size: 14px; font-weight: 500; pointer-events: none;
}
.swipe-thumb {
  position: absolute; top: 4px; right: 4px; width: 48px; height: 48px; border-radius: 50%;
  background: #6d28d9; color: #fff;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-shadow: 0 4px 16px rgba(109,40,217,0.5); box-shadow: 0 4px 16px rgba(109,40,217,0.5);
  cursor: pointer; z-index: 2;
  -webkit-transition: -webkit-box-shadow 0.2s; transition: box-shadow 0.2s;
}
.swipe-arrow { font-size: 20px; font-weight: bold; line-height: 1; }
.swipe-alt {
  display: block; margin: 16px auto 0; color: #8b95a8; font-size: 13px;
  text-decoration: underline; background: none; border: none; cursor: pointer;
}
.welcome-foot { position: absolute; bottom: 20px; color: #8b95a8; font-size: 12px; opacity: 0.6; }

/* Main */
.main-app {
  min-height: 100%; min-height: -webkit-fill-available;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
  padding-bottom: 64px;
}
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 40; height: 56px;
  background: rgba(12,15,20,0.92); border-bottom: 1px solid #2a3140;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  padding: 0 16px;
}
.topbar-brand {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  font-weight: 700;
}
.topbar-logo {
  width: 32px; height: 32px; background: #5c2d91; border-radius: 8px;
  text-align: center; line-height: 32px; font-size: 12px; font-weight: 800; margin-left: 8px;
}
.topbar-title { font-size: 14px; }
@media (max-width: 520px) { .topbar-title { display: none; } }
.topbar-steps {
  display: -webkit-box; display: -webkit-flex; display: flex;
  margin: 0 auto;
}
.step-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #2a3140; margin: 0 4px;
  border: none; padding: 0; cursor: pointer;
}
.step-dot.is-active { background: #7c4dff; -webkit-transform: scale(1.25); transform: scale(1.25); }
.step-dot.is-done { background: #3dd68c; }
.topbar-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #2a3140; }
.topbar-fill { height: 100%; width: 0%; background: #7c4dff; -webkit-transition: width 0.4s ease; transition: width 0.4s ease; }

.content { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 16px 24px; overflow-x: hidden; }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.panel-head p { color: #8b95a8; font-size: 14px; margin: 0; }

.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 64px;
  background: rgba(12,15,20,0.95); border-top: 1px solid #2a3140;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  padding: 0 16px;
}
.btn {
  display: inline-block; min-height: 44px; line-height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 700; font-size: 14px; text-align: center;
  border: none; cursor: pointer; min-width: 100px;
}
.btn-primary { background: #6d28d9; color: #fff; }
.btn-ghost { background: #1a1f2a; color: #e8ecf4; border: 1px solid #2a3140; }
.btn-sm {
  min-height: 32px; line-height: 32px; padding: 0 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: #1a1f2a; border: 1px solid #2a3140; color: #e8ecf4; cursor: pointer;
}

.prose { max-width: 38em; }
.prose h3 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; color: #c4b5fd; }
.prose h3:first-child { margin-top: 0; }
.prose p { color: #8b95a8; margin: 0 0 10px; font-size: 15px; }
.prose strong { color: #e8ecf4; font-weight: 600; }
.prose ul { margin: 6px 0 12px; padding-right: 18px; list-style: disc; }
.prose li { color: #8b95a8; margin-bottom: 4px; font-size: 14px; }
.timeline { margin: 10px 0 18px; border-right: 2px solid #2a3140; padding-right: 16px; }
.timeline-item { margin-bottom: 14px; position: relative; overflow: hidden; }
.timeline-item:before {
  content: ""; position: absolute; right: -21px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: #7c4dff;
}
.timeline-year { display: inline-block; width: 48px; font-size: 12px; font-weight: 700; color: #7c4dff; font-family: monospace; vertical-align: top; }
.timeline-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.timeline-item p { margin: 0; font-size: 13px; }

.example-tabs { margin-bottom: 14px; overflow: hidden; }
.example-tab {
  display: inline-block; min-height: 34px; line-height: 34px; padding: 0 14px;
  border-radius: 999px; background: #12161e; border: 1px solid #2a3140;
  font-size: 13px; font-weight: 600; margin: 0 0 6px 6px; cursor: pointer; color: #e8ecf4;
}
.example-tab.is-active { background: rgba(124,77,255,0.15); border-color: #7c4dff; color: #c4b5fd; }

/* Design: flex fallback for 2-col (tools | form) — always side by side */
.designer {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -webkit-flex-direction: row; flex-direction: row;
  min-height: 320px;
}
.designer-tools {
  width: 88px; -webkit-flex-shrink: 0; flex-shrink: 0;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 6px; margin-right: 8px;
  position: -webkit-sticky; position: sticky; top: 64px;
  max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.tool-list { }
.tool-item {
  display: block; min-height: 48px; padding: 6px 2px; margin-bottom: 4px;
  background: #1a1f2a; border: 1px solid transparent; border-radius: 8px;
  font-size: 11px; font-weight: 600; text-align: center; cursor: pointer;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none; color: #e8ecf4; line-height: 1.2;
}
.tool-item:active { opacity: 0.5; }
.tool-item .tool-icon { display: block; font-size: 14px; margin-bottom: 2px; }

.designer-main {
  -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0;
  background: #1e2430; border: 1px solid #2a3140; border-radius: 12px; overflow: hidden;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
  -webkit-flex-direction: column; flex-direction: column;
}
.form-chrome {
  padding: 6px 10px; background: #2a3344; border-bottom: 1px solid #3a4556;
  font-size: 12px; overflow: hidden;
}
.form-chrome-title { float: left; }
.form-chrome-btns { float: right; }
.form-chrome-btns i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; margin-left: 4px;
}
.form-chrome-btns i:first-child { background: #ef4444; }
.form-chrome-btns i:nth-child(2) { background: #f59e0b; }
.form-chrome-btns i:nth-child(3) { background: #22c55e; }
.form-surface {
  position: relative; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1;
  min-height: 240px; background: #f0f2f5; color: #1a1d23; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
}
.form-empty {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; color: #94a3b8; font-size: 13px; padding: 40px 16px; pointer-events: none;
}
.form-surface.has-items .form-empty { display: none; }
.designer-toolbar {
  padding: 6px 8px; border-top: 1px solid #3a4556; background: #1a2030; overflow: hidden;
}
.designer-toolbar .btn-sm { margin-left: 6px; }
.size-readout { float: right; font-size: 12px; color: #8b95a8; font-family: monospace; line-height: 32px; }

.c-item {
  position: absolute; font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px;
  cursor: move; border: 1px solid #94a3b8; background: #fff; min-width: 20px; min-height: 20px;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
  box-sizing: border-box;
}
.c-item.is-selected {
  outline: none;
  z-index: 5;
  box-shadow: 0 0 0 1.5px rgba(124, 77, 255, 0.9), 0 0 0 3px rgba(56, 189, 248, 0.25);
}
.c-item-label { background: transparent; border: none; color: #1a1d23; padding: 2px 4px; }
.c-item-button {
  background: #e2e8f0; text-align: center; padding: 4px 10px; border-radius: 3px;
}
.c-item-textbox, .c-item-combobox, .c-item-numeric {
  background: #fff; border: 1px solid #64748b; padding: 2px 6px; min-width: 80px;
}
.c-item-listbox {
  background: #fff; border: 1px solid #64748b; padding: 4px; min-width: 100px; min-height: 50px;
  color: #64748b; font-size: 11px;
}
.c-item-checkbox { background: transparent; border: none; padding: 2px 4px; }

/* Resize handles — elegant small circles outside the element */
.c-handle {
  position: absolute;
  width: 10px; height: 10px;
  margin: 0;
  background: linear-gradient(135deg, #7c4dff 0%, #38bdf8 100%);
  border: 1.5px solid #fff;
  border-radius: 50%;
  z-index: 8;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  -ms-touch-action: none; touch-action: none;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.15s ease;
  pointer-events: auto;
}
.c-item.is-selected ~ .c-handle,
.form-surface.has-selection .c-handle { opacity: 1; transform: scale(1); }
.c-handle.is-visible { opacity: 1; transform: scale(1); }
.c-handle:hover, .c-handle:active {
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.35), 0 2px 8px rgba(0,0,0,0.4);
}
/* Larger invisible hit area */
.c-handle::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
}
.c-handle-nw { cursor: nwse-resize; }
.c-handle-n  { cursor: ns-resize; }
.c-handle-ne { cursor: nesw-resize; }
.c-handle-e  { cursor: ew-resize; }
.c-handle-se { cursor: nwse-resize; }
.c-handle-s  { cursor: ns-resize; }
.c-handle-sw { cursor: nesw-resize; }
.c-handle-w  { cursor: ew-resize; }
.c-handle.is-mid.hidden-mid { display: none !important; }

/* Live size badge during resize */
.size-float {
  position: absolute;
  z-index: 20;
  background: rgba(12, 15, 20, 0.92);
  color: #e8ecf4;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(124, 77, 255, 0.5);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.snap-guide {
  position: absolute;
  background: rgba(56, 189, 248, 0.45);
  pointer-events: none;
  z-index: 15;
}
.snap-guide-h { height: 1px; left: 0; right: 0; }
.snap-guide-v { width: 1px; top: 0; bottom: 0; }

.designer-props {
  margin-top: 12px; background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 12px;
}
.designer-label { font-size: 11px; font-weight: 700; color: #8b95a8; margin: 0 0 8px; text-transform: uppercase; }
.empty-state { color: #8b95a8; font-size: 13px; margin: 0; }
.prop-row { padding: 6px 0; border-bottom: 1px solid #2a3140; font-size: 13px; overflow: hidden; }
.prop-row span { color: #8b95a8; }
.prop-row .prop-val { float: left; color: #e8ecf4; }
.prop-actions { margin-top: 10px; overflow: hidden; }
.prop-actions .btn-sm { margin: 0 0 6px 6px; }
.prop-edit-input, .prop-num-input {
  width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #2a3140; background: #1a1f2a; color: #e8ecf4; font: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.prop-nums { margin-top: 8px; overflow: hidden; }
.prop-nums > div { width: 48%; float: right; }
.prop-nums > div:first-child { float: left; }
.prop-nums label { font-size: 12px; color: #8b95a8; display: block; margin-bottom: 2px; }

.target-details {
  margin-top: 14px; background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 12px 14px;
}
.target-details-title { font-size: 14px; font-weight: 600; color: #8b95a8; margin-bottom: 10px; }
.target-card {
  position: relative; overflow: hidden; background: #f0f2f5; color: #1a1d23;
  border-radius: 8px; border: 1px solid #cbd5e1; padding: 16px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 13px;
}
.target-row { margin-bottom: 12px; }
.target-row:last-child { margin-bottom: 0; }
.target-label { display: block; font-weight: 600; color: #334155; margin-bottom: 6px; }
.target-field {
  display: block; width: 100%; min-height: 28px; background: #fff;
  border: 1px solid #94a3b8; border-radius: 3px; padding: 4px 8px;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
.target-list {
  display: block; width: 100%; min-height: 72px; background: #fff;
  border: 1px solid #94a3b8; border-radius: 3px; padding: 8px; color: #64748b; font-size: 12px;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
.target-actions { overflow: hidden; margin-top: 4px; }
.target-btn {
  display: inline-block; background: #e2e8f0; border: 1px solid #94a3b8; border-radius: 3px;
  padding: 6px 14px; font-size: 13px; margin: 0 0 6px 6px; white-space: nowrap;
}
.target-row-search { overflow: hidden; }
.target-row-search .target-label { display: inline-block; margin-left: 8px; vertical-align: middle; }
.target-row-search .target-field { display: inline-block; width: 50%; vertical-align: middle; min-width: 100px; }
.target-row-search .target-btn { vertical-align: middle; }

/* Code */
.code-lab { background: #12161e; border: 1px solid #2a3140; border-radius: 12px; padding: 16px; }
.code-lab-head { margin-bottom: 14px; }
.code-lab-head h3 { font-size: 16px; margin: 0 0 4px; }
.code-lab-head p { color: #8b95a8; font-size: 13px; margin: 0; }
.code-board {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: horizontal; -webkit-box-direction: normal;
  -webkit-flex-direction: row; flex-direction: row;
}
@media (max-width: 560px) {
  .code-board {
    -webkit-box-orient: vertical; -webkit-box-direction: normal;
    -webkit-flex-direction: column; flex-direction: column;
  }
  .code-bank, .code-assembly { width: 100% !important; margin-bottom: 12px; }
}
.code-bank, .code-assembly { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; margin-left: 8px; }
.code-bank { margin-left: 0; margin-right: 8px; }
.code-board-label { font-size: 11px; font-weight: 700; color: #8b95a8; margin: 0 0 8px; text-transform: uppercase; }
.code-pieces, .code-slots {
  min-height: 200px; border-radius: 10px; padding: 8px;
}
.code-pieces { background: #1a1f2a; border: 1px solid #2a3140; }
.code-slots { background: #0d1117; border: 1px solid #30363d; }
.piece, .slot-piece {
  background: #12161e; border: 1px solid #2a3140; border-radius: 6px;
  padding: 8px 10px; margin-bottom: 6px; font-family: monospace; font-size: 12px;
  direction: ltr; text-align: left; cursor: pointer;
  white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; color: #e8ecf4;
  -ms-touch-action: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.piece.is-used { display: none; }
.slot-piece { background: rgba(56,139,253,0.1); border-color: #388bfd; }
.slot {
  min-height: 36px; border: 1px dashed #30363d; border-radius: 6px; margin-bottom: 6px; padding: 2px;
}
.slot.is-filled { border-style: solid; border-color: #388bfd; }
.slot.is-ok { border-color: #3dd68c; background: rgba(61,214,140,0.08); }
.slot.is-bad { border-color: #f07178; background: rgba(240,113,120,0.08); }
.code-actions { margin-top: 14px; overflow: hidden; }
.code-actions .btn { margin: 0 0 8px 8px; }
.code-feedback {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.code-feedback.is-ok { background: rgba(61,214,140,0.12); color: #3dd68c; border: 1px solid rgba(61,214,140,0.3); }
.code-feedback.is-bad { background: rgba(240,113,120,0.1); color: #f07178; border: 1px solid rgba(240,113,120,0.25); }
.code-result {
  margin-top: 14px; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 14px;
}
.code-result h4 { font-size: 14px; margin: 0 0 8px; }
.code-result pre {
  direction: ltr; text-align: left; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-family: monospace; font-size: 12px; line-height: 1.55; color: #e6edf3; margin: 0;
}
.code-explain { margin-top: 10px; font-size: 13px; color: #8b95a8; line-height: 1.65; }
.code-explain p { margin: 0 0 6px; }
.code-explain strong { color: #e8ecf4; }

/* Team */
.team-list { overflow: hidden; }
.team-card {
  width: 46%; float: right; margin: 0 0 12px 2%;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 16px; text-align: center;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
@media (min-width: 600px) {
  .team-card { width: 31%; margin-left: 2%; }
}
.team-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: #5c2d91;
  margin: 0 auto 10px; line-height: 56px; font-size: 18px; font-weight: 800; color: #fff;
}
.team-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.team-role { color: #8b95a8; font-size: 12px; margin: 0 0 12px; }
.tt-swipe {
  width: 100%; height: 44px; background: #1a1f2a; border: 1px solid #2a3140;
  border-radius: 999px; position: relative; overflow: hidden;
  -ms-touch-action: none; touch-action: none;
}
.tt-swipe.is-disabled { opacity: 0.5; }
.tt-label {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; line-height: 44px; font-size: 12px; color: #8b95a8; pointer-events: none;
}
.tt-thumb {
  position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; border-radius: 50%;
  background: #000; color: #fff; text-align: center; line-height: 40px; font-size: 11px; font-weight: bold;
  cursor: pointer; z-index: 2;
}
.tt-note { margin-top: 6px; font-size: 11px; color: #8b95a8; }

.drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none; opacity: 0.9;
  max-width: 80%; -webkit-box-shadow: 0 8px 24px rgba(0,0,0,0.4); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@media (max-width: 390px) {
  .content { padding: 14px 10px 20px; }
  .designer-tools { width: 72px; }
  .tool-item { min-height: 44px; font-size: 10px; }
  .bottom-bar .btn { min-width: 80px; padding: 0 12px; font-size: 13px; }
  .team-card { width: 100%; float: none; margin: 0 0 12px; }
}

/* ── Team photos ── */
.team-list { overflow: hidden; margin: 0 -1%; }
.team-card {
  width: 48%; float: right; margin: 0 1% 16px;
  background: #12161e; border: 1px solid #2a3140; border-radius: 12px;
  padding: 16px 12px; text-align: center;
  -webkit-box-sizing: border-box; box-sizing: border-box;
}
@media (min-width: 640px) {
  .team-card { width: 31.33%; margin: 0 1% 16px; }
}
.team-photo-wrap {
  width: 88px; height: 88px; margin: 0 auto 12px;
  border-radius: 50%; overflow: hidden; background: #2a3140;
  position: relative;
}
.team-photo {
  width: 88px; height: 88px;
  object-fit: cover;
  -o-object-fit: cover;
  display: block;
  border-radius: 50%;
}
.team-photo-fallback:after {
  content: attr(data-initial);
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  text-align: center; line-height: 88px;
  font-size: 28px; font-weight: 800; color: #c4b5fd;
  background: #2a3140; border-radius: 50%;
}
.team-name { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: #e8ecf4; }
.team-role { color: #8b95a8; font-size: 12px; margin: 0 0 12px; }
.team-tiktok-btn {
  display: inline-block; min-height: 36px; line-height: 36px; padding: 0 14px;
  border-radius: 999px; background: #000; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; border: 1px solid #333;
  direction: ltr; unicode-bidi: embed;
}
.team-tiktok-btn .tt-icon {
  display: inline-block; width: 18px; height: 18px; line-height: 18px;
  background: #fe2c55; border-radius: 4px; font-size: 9px; font-weight: 800;
  text-align: center; vertical-align: middle; margin-left: 4px;
}
.team-tiktok-btn.is-disabled {
  background: #1a1f2a; color: #8b95a8; border-color: #2a3140; cursor: default;
}
@media (max-width: 390px) {
  .team-card { width: 48%; padding: 12px 8px; }
  .team-photo-wrap, .team-photo { width: 72px; height: 72px; }
  .team-photo-fallback:after { line-height: 72px; font-size: 22px; }
  .team-name { font-size: 12px; }
}

/* Team intro + TikTok logo buttons */
.team-intro {
  width: 100%; float: none; clear: both;
  text-align: center; color: #c4b5fd; font-size: 14px; font-weight: 600;
  margin: 0 0 18px; line-height: 1.5; padding: 0 8px;
}
.team-tiktok-btn {
  display: inline-block; min-height: 38px; line-height: 38px; padding: 0 16px;
  border-radius: 999px; background: #010101; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; border: 1px solid #333;
  direction: ltr; unicode-bidi: embed;
  -webkit-transition: background 0.2s, -webkit-transform 0.15s;
  transition: background 0.2s, transform 0.15s;
}
.team-tiktok-btn:hover, .team-tiktok-btn:focus {
  background: #fe2c55; border-color: #fe2c55; color: #fff;
  -webkit-transform: translateY(-1px); transform: translateY(-1px);
}
.team-tiktok-btn .tt-logo {
  display: inline-block; vertical-align: middle; margin-right: 6px;
  width: 16px; height: 16px;
}
.team-tiktok-btn .tt-handle {
  display: inline-block; vertical-align: middle;
}
.team-tiktok-btn.is-disabled {
  background: #1a1f2a; color: #8b95a8; border-color: #2a3140; cursor: default;
}
.team-role { display: none !important; }

/* Code pieces drag fix */
.piece {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  z-index: 1;
}
.piece:active { cursor: grabbing; }
.code-pieces { position: relative; z-index: 2; }
.code-slots .slot { min-height: 40px; }
.drag-ghost {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* Code system tabs (login / db / shop) */
.code-system-tabs { margin-bottom: 12px; overflow: hidden; }
.code-system-tab {
  display: inline-block; min-height: 34px; line-height: 34px; padding: 0 14px;
  border-radius: 999px; background: #12161e; border: 1px solid #2a3140;
  font-size: 13px; font-weight: 600; margin: 0 0 6px 6px; cursor: pointer; color: #e8ecf4;
}
.code-system-tab.is-active {
  background: rgba(124,77,255,0.15); border-color: #7c4dff; color: #c4b5fd;
}


/* Save design button */
.btn-save-design {
  background: linear-gradient(135deg, #7c4dff, #38bdf8) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  margin-right: 6px;
}
.btn-save-design:hover { filter: brightness(1.1); }

/* Save success overlay */
.save-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(8, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
}
.save-overlay.is-open { opacity: 1; pointer-events: auto; }
.save-card {
  width: min(92vw, 380px);
  background: linear-gradient(160deg, #161b27 0%, #12161e 100%);
  border: 1px solid rgba(124, 77, 255, 0.35);
  border-radius: 20px;
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.save-overlay.is-open .save-card { transform: translateY(0) scale(1); }
.save-close {
  position: absolute; top: 12px; left: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: #1a1f2a; color: #8b95a8; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid #2a3140;
}
.save-close:hover { color: #e8ecf4; background: #222833; }
.save-check {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3dd68c, #22c55e);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(61, 214, 140, 0.35);
}
.save-check svg { width: 32px; height: 32px; stroke: #0c0f14; stroke-width: 3; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: checkDraw 0.55s ease 0.15s forwards;
}
@keyframes checkDraw { to { stroke-dashoffset: 0; } }
.save-card h3 { margin: 0 0 8px; font-size: 18px; color: #e8ecf4; }
.save-card p { margin: 0 0 20px; color: #8b95a8; font-size: 14px; line-height: 1.55; }
.save-actions { display: flex; flex-direction: column; gap: 10px; }
.save-actions .btn { width: 100%; min-height: 44px; border-radius: 12px; font-weight: 700; }
.save-actions .btn-primary {
  background: linear-gradient(135deg, #7c4dff, #38bdf8);
  border: none; color: #fff;
}
.save-actions .btn-ghost {
  background: #1a1f2a; border: 1px solid #2a3140; color: #c4b5fd;
}
@media (prefers-reduced-motion: reduce) {
  .save-overlay, .save-card, .save-check svg { transition: none !important; animation: none !important; }
  .save-check svg { stroke-dashoffset: 0; }
}

/* Collapsible learn sections */
.learn-acc { margin: 0 0 10px; border: 1px solid #2a3140; border-radius: 12px; overflow: hidden; background: #12161e; }
.learn-acc-btn {
  width: 100%; text-align: right; padding: 14px 16px;
  background: transparent; color: #e8ecf4; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.learn-acc-btn span.chev { color: #8b95a8; font-size: 12px; transition: transform 0.2s; }
.learn-acc.is-open .learn-acc-btn span.chev { transform: rotate(180deg); }
.learn-acc-body { display: none; padding: 0 16px 16px; color: #c4b5fd; font-size: 13.5px; line-height: 1.7; }
.learn-acc.is-open .learn-acc-body { display: block; }
.learn-acc-body h4 { margin: 12px 0 6px; color: #e8ecf4; font-size: 13px; }
.learn-acc-body pre, .code-snippet {
  direction: ltr; text-align: left; background: #0c0f14; border: 1px solid #2a3140;
  border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12px; margin: 8px 0;
  position: relative; font-family: ui-monospace, Consolas, monospace; color: #e2e8f0;
}
.code-snippet .kw { color: #c4b5fd; }
.code-snippet .str { color: #86efac; }
.code-snippet .cm { color: #64748b; }
.copy-code-btn {
  position: absolute; top: 6px; left: 6px;
  font-size: 11px; padding: 4px 8px; border-radius: 6px;
  background: #1a1f2a; border: 1px solid #2a3140; color: #8b95a8; cursor: pointer;
}
.copy-code-btn:hover { color: #e8ecf4; }

/* Team glass redesign */
.team-section-lead {
  text-align: center; color: #94a3b8; font-size: 14px; margin: 0 0 20px; line-height: 1.5;
}
.team-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin: 0; overflow: visible;
}
.team-card {
  float: none !important; width: min(100%, 200px) !important; margin: 0 !important;
  background: rgba(18, 22, 30, 0.65) !important;
  border: 1px solid rgba(124, 77, 255, 0.22) !important;
  border-radius: 18px !important;
  padding: 20px 14px !important;
  text-align: center;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  opacity: 0; transform: translateY(18px);
}
.team-card.is-in {
  opacity: 1; transform: translateY(0);
}
.team-card:hover {
  transform: translateY(-6px) rotateX(2deg);
  border-color: rgba(124, 77, 255, 0.5) !important;
  box-shadow: 0 16px 40px rgba(124, 77, 255, 0.18), 0 8px 24px rgba(0,0,0,0.35);
}
.team-photo-wrap {
  width: 92px; height: 92px; margin: 0 auto 12px;
  border-radius: 50%; overflow: hidden; background: #2a3140;
  position: relative;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.45), 0 0 20px rgba(56, 189, 248, 0.25);
}
.team-photo { width: 92px; height: 92px; object-fit: cover; border-radius: 50%; display: block; }
.team-role { color: #94a3b8; font-size: 12px; margin: 0 0 12px; }
.team-tiktok-btn {
  display: inline-flex !important; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 16px;
  border-radius: 999px; background: #010101; color: #fff; font-size: 12px; font-weight: 600;
  text-decoration: none; border: 1px solid #333;
}
.team-tiktok-btn:hover { background: #fe2c55; border-color: #fe2c55; }
.team-bg-glow {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
@media (max-width: 480px) {
  .team-card { width: calc(50% - 10px) !important; padding: 14px 8px !important; }
  .team-photo-wrap, .team-photo { width: 72px; height: 72px; }
}

/* Topbar logo image */
.topbar-logo-img {
  width: 28px; height: 28px; border-radius: 6px; display: block;
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.4);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.vb-mark img, .welcome-logo {
  width: 88px; height: 88px; border-radius: 20px;
  box-shadow: 0 8px 32px rgba(124, 77, 255, 0.45), 0 0 0 1px rgba(255,255,255,0.08);
}
@media (prefers-reduced-motion: no-preference) {
  .welcome-logo {
    animation: logoFloat 4.5s ease-in-out infinite;
  }
  @keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }
}
