/* OutcomeFlows IMALL - virtual mall storefront + 3D visualizer styles. */
:root {
  --bg: #0b1020;
  --panel: #151b2e;
  --panel-2: #1e2740;
  --line: #2b3550;
  --text: #e6ebf5;
  --muted: #93a0bd;
  --brand: #0b6de0;
  --brand-2: #0a5cc0;
  --gold: #d4a029;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #16203a 0%, var(--bg) 60%);
  color: var(--text); min-height: 100vh;
}
a { color: #7dd3fc; text-decoration: none; }
header.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: rgba(21,27,46,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; }
.brand span { color: var(--gold); }
.topbar .spacer { flex: 1; }
.navlink { color: var(--muted); cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.navlink:hover, .navlink.active { color: var(--text); background: var(--panel-2); }
.who { color: var(--muted); font-size: .85rem; }
.wrap { max-width: 1220px; margin: 0 auto; padding: 20px; }
.hero { text-align: center; padding: 26px 12px 8px; }
.hero h1 { font-size: 2rem; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; }
.tag { font-size: .72rem; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { margin: 0 0 14px; font-size: 1.05rem; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
label { display: block; font-size: .8rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 15px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
button {
  font-size: 15px; font-weight: 650; padding: 11px 16px; border: none; border-radius: 10px;
  cursor: pointer; background: var(--brand); color: #fff; min-height: 44px;
}
button:hover { background: var(--brand-2); }
button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button.gold { background: var(--gold); color: #1a1400; }
button.good { background: var(--good); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { padding: 2px 9px; border-radius: 999px; font-size: .72rem; }
.pill.available { background: rgba(22,163,74,.2); color: #86efac; }
.pill.leased { background: rgba(220,38,38,.2); color: #fca5a5; }
.pill.reserved { background: rgba(217,119,6,.2); color: #fbbf24; }
.msg { margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: .9rem; display: none; }
.msg.show { display: block; }
.msg.err { background: rgba(220,38,38,.15); color: #fca5a5; border: 1px solid rgba(220,38,38,.4); }
.msg.ok { background: rgba(22,163,74,.15); color: #86efac; border: 1px solid rgba(22,163,74,.4); }
.hint { color: var(--muted); font-size: .82rem; }
.empty { color: var(--muted); text-align: center; padding: 30px; }

/* Shop + product cards */
.shop-card { cursor: pointer; transition: transform .12s, border-color .12s; }
.shop-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.shop-card .cat { font-size: .72rem; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; }
.prod-card { display: flex; flex-direction: column; gap: 8px; }
.prod-card .price { font-size: 1.25rem; font-weight: 700; }
.prod-card .cond { font-size: .74rem; color: var(--muted); }

/* ---- 3D mall visualizer ---- */
.mall-stage {
  perspective: 1100px; background:
    radial-gradient(600px 300px at 50% 20%, rgba(11,109,224,.12), transparent 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; overflow: auto; min-height: 340px;
}
.mall-floor {
  transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-45deg);
  margin: 40px auto; transition: transform .3s; position: relative;
}
.space-tile {
  position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; color: #06121f; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 14px rgba(0,0,0,.35); transition: filter .12s, transform .12s;
}
.space-tile:hover { filter: brightness(1.15); transform: translateZ(14px); }
.space-tile.kind-kiosk { background: linear-gradient(160deg,#8ecae6,#5fa8d3); }
.space-tile.kind-small_shop { background: linear-gradient(160deg,#a7e0a0,#69c266); }
.space-tile.kind-anchor_store { background: linear-gradient(160deg,#ffd27d,#f4a939); }
.space-tile.kind-exhibition_hall { background: linear-gradient(160deg,#e2a7f0,#b569c2); }
.space-tile.is-leased { filter: grayscale(.55) brightness(.8); }
.space-tile .code { font-size: 13px; }
.space-tile .dim { font-size: 9px; opacity: .8; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.legend b { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

/* Product 3D showroom */
.showroom { width: 100%; height: 340px; background: #0a1122; border-radius: 12px; border: 1px solid var(--line); }
model-viewer { width: 100%; height: 340px; background: #0a1122; border-radius: 12px; }
.showroom-fallback { display: flex; align-items: center; justify-content: center; height: 340px; color: var(--muted); }

/* Agent chat */
.agent-log { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bubble { padding: 9px 12px; border-radius: 12px; max-width: 85%; font-size: .9rem; }
.bubble.me { align-self: flex-end; background: var(--brand); }
.bubble.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }

.toast {
  position: fixed; inset-inline: 0; bottom: 22px; margin: 0 auto; width: max-content; max-width: 90%;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(12px); transition: .2s; z-index: 50; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-color: rgba(220,38,38,.5); }
.center-card { max-width: 380px; margin: 8vh auto; }
.total-line { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); margin-top: 8px; font-weight: 700; }
.list-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: .9rem; }
