/* POXI Studio — the same Lovable-style design as poxi.guru (the King's design, 11.11.2026):
 * white, a soft aurora at the bottom, Plus Jakarta Sans, black pills, the floating omnibar.
 * Home = the landing hero + omnibar + my events; workshop = the Lovable editor: chat left, live preview right. */

:root {
  --bg: #ffffff;
  --ink: #09090b;
  --text: #0f172a;
  --muted: #64748b;
  --soft: #475569;
  --faint: #94a3b8;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --chip: #f1f5f9;
  --chip-hover: #e2e8f0;
  --card: rgba(255, 255, 255, 0.86);
  --violet: #8b5cf6;
  --green: #10b981;
  --rose: #e11d48;
  --shadow-card: 0 20px 50px -10px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.06);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --topbar: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 99px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- aurora: the same mesh as poxi.guru ---------- */
.aurora-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #fff; }
.aurora-mesh {
  position: absolute; width: 140vw; height: 75vh; bottom: -20vh; left: -20vw;
  background:
    radial-gradient(35% 50% at 20% 70%, rgba(56, 189, 248, 0.65) 0%, transparent 80%),
    radial-gradient(40% 60% at 50% 65%, rgba(168, 85, 247, 0.75) 0%, transparent 80%),
    radial-gradient(45% 65% at 80% 70%, rgba(244, 63, 94, 0.75) 0%, transparent 80%),
    radial-gradient(30% 50% at 35% 85%, rgba(236, 72, 153, 0.7) 0%, transparent 75%),
    radial-gradient(35% 55% at 65% 80%, rgba(129, 140, 248, 0.75) 0%, transparent 80%);
  filter: blur(80px); opacity: 0.85;
  animation: auroraBreathe 18s ease-in-out infinite alternate;
}
/* inside one event the aurora steps back: the hall is the star */
body[data-view="workshop"] .aurora-mesh { opacity: 0.35; bottom: -40vh; }
@keyframes auroraBreathe {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: translateY(-4vh) scale(1.06) rotate(1deg); opacity: 0.95; }
  100% { transform: translateY(2vh) scale(0.98) rotate(-1deg); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) { .aurora-mesh { animation: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 9999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.btn-dark:not(:disabled):hover { background: #18181b; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }
.btn-soft { background: var(--chip); color: var(--soft); }
.btn-soft:not(:disabled):hover { background: var(--chip-hover); color: var(--ink); }
.btn-text { background: transparent; color: #334155; font-weight: 500; padding: 0 12px; }
.btn-text:hover { color: var(--ink); }
.btn-round {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: inline-grid; place-items: center;
  background: var(--ink); color: #fff; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-round:not(:disabled):hover { background: #18181b; transform: scale(1.06); }
.btn-round:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-round-sm { width: 30px; height: 30px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff;
  color: var(--muted); display: inline-grid; place-items: center;
}
.icon-btn:hover { color: var(--ink); border-color: #cbd5e1; background: #f8fafc; }

/* ---------- top bar (the landing header) ---------- */
.topbar {
  position: relative; z-index: 20; height: var(--topbar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 28px;
}
body[data-view="workshop"] .topbar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 28px; width: auto; display: block; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.crumb-sep { color: #cbd5e1; font-size: 18px; }
.crumb-title { font-weight: 700; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-status {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 9999px;
  background: var(--chip); color: var(--soft);
}
.chip-status.is-live { background: #dcfce7; color: #15803d; }
.capacity-badge { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tb-nav { display: flex; gap: 28px; }
.tb-link { font-size: 14.5px; font-weight: 500; color: var(--soft); text-decoration: none; white-space: nowrap; padding: 4px 0; }
.tb-link:hover, .tb-link.is-active { color: var(--ink); }
body[data-view="workshop"] .tb-nav { visibility: hidden; }
body[data-view="home"] #header-publish-btn { display: none; }
.org-name { font-size: 13.5px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { position: relative; z-index: 10; height: calc(100% - var(--topbar)); }
/* until boot knows whether a saved event opens, show neither view (no flash of the list before the workshop) */
body[data-view="loading"] #view-home, body[data-view="loading"] #view-workshop { visibility: hidden; }

/* ---------- home ---------- */
.home { height: 100%; overflow-y: auto; padding: 8vh 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 48px; }
.hero { width: 100%; max-width: 780px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-title { margin: 0 0 14px; font-size: clamp(40px, 5.4vw, 64px); font-weight: 800; letter-spacing: -2.2px; line-height: 1.05; color: var(--ink); }
.hero-lede { margin: 0 0 36px; font-size: clamp(16px, 1.5vw, 18px); color: var(--muted); letter-spacing: -0.2px; }
.omnibar {
  width: 100%; text-align: left; background: #fff; border-radius: 26px;
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  padding: 20px 22px 14px; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.omnibar:focus-within { border-color: rgba(0, 0, 0, 0.25); box-shadow: 0 30px 70px -12px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.1); }
.omnibar-input { width: 100%; min-height: 52px; resize: none; border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.45; color: var(--ink); }
.omnibar-input::placeholder { color: var(--faint); }
.omnibar-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.omnibar-hint { font-size: 12.5px; color: var(--faint); }
.omnibar-right { display: flex; align-items: center; gap: 10px; }
.mode-pill { padding: 6px 14px; border-radius: 9999px; font-size: 13.5px; font-weight: 500; color: var(--soft); background: var(--chip); }

.dock {
  width: 100%; max-width: 1180px; padding: 18px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px);
}
.dock-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.dock-tabs { display: flex; gap: 6px; }
.dock-links { display: none; gap: 16px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.dock-links a { color: var(--soft); text-decoration: none; }
.dock-links a:hover { color: var(--ink); }
.dock-tab { white-space: nowrap; padding: 7px 14px; border-radius: 9999px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.dock-tab:hover { color: var(--ink); }
.dock-tab.is-active { background: var(--chip); color: var(--ink); }
.dock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ev-card {
  display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 14px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); text-align: left; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.ev-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08); }
.ev-thumb {
  position: relative; height: 140px; border-radius: 11px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 100%, #1e1b4b 0%, #0b0b14 70%);
}
.ev-thumb svg { width: 84%; height: 84%; }
.ev-status { position: absolute; top: 8px; right: 8px; }
.ev-thumb .chip-status { background: rgba(255, 255, 255, 0.92); }
.ev-thumb .chip-status.is-live { background: #dcfce7; }
.ev-name { margin: 0 4px; font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--ink); }
.ev-meta { display: flex; justify-content: space-between; gap: 8px; margin: 0 4px; font-size: 12.5px; color: var(--muted); }
.ev-meta strong { color: var(--soft); font-weight: 600; }
.ev-new { align-items: center; justify-content: center; min-height: 212px; color: var(--muted); border-style: dashed; background: rgba(255, 255, 255, 0.6); }
.ev-new span { font-size: 26px; line-height: 1; }
.ev-new:hover { color: var(--ink); }
.dock-empty { grid-column: 1 / -1; margin: 0; padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- workshop: the Lovable editor ---------- */
.workshop { height: 100%; display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 12px; padding: 12px; }
.chat {
  display: flex; flex-direction: column; min-height: 0; border-radius: 18px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.chat-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; animation: fadein 0.25s ease; }
.msg .bubble { max-width: 100%; font-size: 14.5px; line-height: 1.6; }
.msg .bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-user { justify-content: flex-end; }
.msg-user .bubble { max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--chip); color: var(--ink); }
.msg-agent .bubble { width: 100%; color: var(--text); }
.msg-meta { margin-top: 4px !important; font-size: 12px; color: var(--faint); }
.msg-meta:empty { display: none; }
/* an agent step: a quiet status row ("✓ Hall built") */
.msg.is-step .bubble { display: inline-flex; width: auto; padding: 6px 12px; border-radius: 9999px; background: #ecfdf5; }
.msg.is-step .msg-meta { margin: 0 !important; font-size: 13px; font-weight: 600; color: #047857; }
.msg.is-step.is-running .bubble { background: #f5f3ff; }
.msg.is-step.is-running .msg-meta { color: #6d28d9; }
.msg.is-step.is-failed .bubble { background: #fff1f2; }
.msg.is-step.is-failed .msg-meta { color: #be123c; }
.msg.is-typing .bubble { display: inline-flex; align-items: center; gap: 8px; width: auto; color: var(--muted); }
.msg.is-typing .bubble::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip {
  padding: 6px 12px; border-radius: 9999px; font-size: 12.5px; font-weight: 500; text-align: left;
  color: var(--soft); background: #fff; border: 1px solid var(--line);
}
.chip:hover { color: var(--ink); border-color: rgba(0, 0, 0, 0.2); transform: translateY(-1px); }

.ask {
  margin: 0 12px 12px; padding: 12px 14px 10px; border-radius: 20px; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.08); transition: all 0.2s ease;
}
.ask:focus-within { border-color: rgba(0, 0, 0, 0.25); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.14); }
.ask-input { width: 100%; min-height: 44px; resize: none; border: 0; outline: 0; background: transparent; font-size: 14.5px; color: var(--ink); }
.ask-input::placeholder { color: var(--faint); }
.ask-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-note { font-size: 11.5px; color: var(--faint); line-height: 1.3; }

.preview {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 18px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px);
}
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.view-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 9999px; background: var(--chip); }
.view-tab { padding: 6px 14px; border: 0; border-radius: 9999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.view-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.slug { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 5px 12px; border-radius: 9999px; border: 1px solid var(--line); background: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.slug:empty { display: none; }
.preview-actions { margin-left: auto; display: flex; gap: 8px; }
/* one Publish, top right — like Lovable */
.preview-actions #publish { display: none; }
.preview-frame { position: relative; flex: 1; min-height: 0; margin: 0 12px 12px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 100%, #1e1b4b 0%, #0b0b14 62%); }
.view-3d, .view-lp { position: absolute; inset: 0; }
.studio-3d-canvas { position: absolute; inset: 0; }
.studio-3d-canvas canvas { display: block; width: 100%; height: 100%; }
.preview-empty { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #a5b4fc; text-align: center; padding: 24px; pointer-events: none; }
.preview-empty-title { font-size: 20px; font-weight: 700; color: #fff; }
.sector-rail { position: absolute; top: 12px; left: 12px; z-index: 5; width: 240px; max-height: calc(100% - 80px); overflow-y: auto; }
.sector-cards { display: flex; flex-direction: column; gap: 6px; }
.sector-chip {
  display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink);
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.sector-dot { width: 10px; height: 10px; border-radius: 50%; }
.gross {
  position: absolute; left: 12px; bottom: 12px; z-index: 5; display: flex; align-items: baseline; gap: 8px;
  padding: 8px 14px; border-radius: 9999px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.gross-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.gross-val { font-size: 16px; color: var(--ink); }
.orbit-hint { position: absolute; right: 14px; bottom: 14px; z-index: 5; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.frame { width: 100%; height: 100%; border: 0; background: #fff; }

/* the six hall themes: round swatches under the preview (the .dock-tab pill, made round) */
.theme-row { display: flex; align-items: center; gap: 8px; padding: 0 14px 12px; }
.theme-swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
button.sector-chip { border: 0; text-align: left; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; }
button.sector-chip[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--violet), 0 4px 14px rgba(0, 0, 0, 0.18); }
.wedge-row { display: flex; flex-wrap: wrap; gap: 4px; }
button.sector-chip.is-wedge { display: inline-block; width: auto; min-width: 30px; padding: 4px 9px; border-radius: 9999px; font-size: 12px; text-align: center; }

/* ---------- sign-in ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(16px); }
.login-card { width: 100%; max-width: 420px; padding: 26px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18); }
.login-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.login-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); }
.btn-close-modal { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; }
.btn-close-modal:hover { color: var(--ink); background: var(--chip); }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--chip); margin-bottom: 14px; }
.login-tab { height: 34px; border-radius: 9999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.login-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.login-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; outline: 0; }
.input:focus { border-color: rgba(0, 0, 0, 0.3); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12); }
.login-error { margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; font-size: 13px; color: #be123c; background: #fff1f2; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 9999px; font-size: 14px; font-weight: 500; background: var(--ink); color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
.toast.is-error { background: var(--rose); }

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .tb-nav { display: none; }
  .dock-links { display: flex; }
  .topbar { grid-template-columns: 1fr auto; }
  .workshop { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 46vh) minmax(0, 1fr); }
  .preview { order: -1; }
}
@media (max-width: 640px) {
  body { overflow: auto; }
  .topbar { padding: 0 14px; }
  .org-name, .capacity-badge { display: none; }
  .crumb-title { max-width: 130px; }
  .home { padding: 36px 16px 24px; gap: 32px; }
  .omnibar-hint, .mode-pill { display: none; }
  .sector-rail, .orbit-hint { display: none; }
  .preview-actions .btn-soft { display: none; }
  .workshop { height: auto; grid-template-rows: 44vh auto; padding: 8px; }
  main { height: auto; min-height: calc(100% - var(--topbar)); }
  .chat { min-height: 460px; }
}
