:root {
  --bg: rgba(18, 22, 34, 0.86);
  --bg2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --text: #eef1f8;
  --muted: #9aa3b8;
  --accent: #4f7cff;
  --ok: #2fbf71;
  --err: #e5484d;
  --gold: #f5c542;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9fc6e6; font: 14px/1.4 system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); }
canvas { display: block; touch-action: none; }
button { font: inherit; color: inherit; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button:hover { background: rgba(255,255,255,0.15); }
button.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.active { background: var(--accent); border-color: transparent; color: #fff; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
input[type=color] { padding: 2px; width: 44px; height: 32px; }
input[type=range] { padding: 0; accent-color: var(--accent); }
code { background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.err { color: #ff8a8d; min-height: 1em; margin: 0; font-size: 13px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 999px; font-size: 13px; }
.tag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 4px; background: rgba(229,72,77,.25); color: #ffb3b5; margin-left: 3px; }
.tag.code { background: rgba(79,124,255,.3); color: #c4d3ff; }

/* ---------- auth ---------- */
#auth { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,14,28,.35); backdrop-filter: blur(3px); z-index: 10; padding: 16px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(400px, 100%); display: grid; gap: 12px; }
.card h1 { margin: 0; font-size: 32px; letter-spacing: -0.5px; }
.card .sub { margin: -6px 0 2px; color: var(--muted); }
.card label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
#regFields { display: grid; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#genderPick .chip { flex: 1; padding: 8px; }

/* ---------- HUD (Firestorm-style) ---------- */
#hud > * { position: fixed; z-index: 2; }
#topBar { top: 0; left: 0; right: 0; height: 30px; display: flex; justify-content: space-between; align-items: center; background: rgba(14,17,27,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); z-index: 25; padding: 0 6px; }
#menuBar { display: flex; align-items: center; gap: 2px; }
#menuBar .brand { font-weight: 800; color: var(--gold); margin-right: 8px; font-size: 13px; letter-spacing: .3px; }
#menuBar .mb { background: none; border: 0; padding: 4px 9px; font-size: 13px; border-radius: 5px; }
#menuBar .mb:hover, #menuBar .mb.open { background: var(--accent); }
#statusBar { display: flex; align-items: center; gap: 4px; font-size: 12px; }
#statusBar .sb { background: none; border: 0; padding: 3px 8px; border-radius: 5px; color: var(--text); white-space: nowrap; }
#statusBar button.sb:hover { background: rgba(255,255,255,.12); }
#statusBar .buyable { color: var(--gold); }
#toolbar { bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; padding: 4px 6px; background: rgba(14,17,27,.85); border-top: 1px solid var(--line); flex-wrap: wrap; backdrop-filter: blur(6px); z-index: 24; }
#toolbar .tb { display: grid; justify-items: center; gap: 1px; background: none; border: 1px solid transparent; padding: 3px 7px; font-size: 17px; line-height: 1.1; border-radius: 7px; position: relative; min-width: 54px; }
#toolbar .tb span { font-size: 10px; color: var(--muted); }
#toolbar .tb:hover { background: rgba(255,255,255,.1); }
#toolbar .tb.on { background: rgba(79,124,255,.35); border-color: rgba(79,124,255,.7); }
#toolbar .tb.on span { color: #fff; }
#toolbar .tb.stand { background: var(--accent); }
#toolbar .tb.stand span { color: #fff; }
#toolbar .tb.talking { box-shadow: 0 0 0 2px #3cff8a inset; }
#toolbar .badge { position: absolute; top: 0; right: 4px; font-style: normal; }
#chatBar { left: 10px; bottom: 62px; width: min(380px, calc(100vw - 20px)); }
#chatIn { width: 100%; background: rgba(14,17,27,.8); }
#chatLog { left: 10px; bottom: 100px; width: min(420px, calc(100vw - 20px)); display: grid; gap: 2px; font-size: 13px; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.6); pointer-events: none; }
#chatLog > div { transition: opacity 2s; }
#chatLog > div.fade { opacity: 0; }
#chatLog .sys { color: #d6dcea; font-style: italic; }
#chatLog .objname, .objname { color: #ffd84a; }
#miniBox { top: 40px; right: 10px; width: 200px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
#miniBox[hidden] { display: none; }
.miniHead { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; font-size: 11px; color: var(--muted); }
.miniHead > span:first-child { color: var(--text, #e8ecf6); font-weight: 600; }
.miniHead button { padding: 0 6px; min-width: 0; height: 20px; font-size: 12px; line-height: 1; background: transparent; border: 0; }
.miniHead button:hover { background: rgba(255,255,255,.12); }
#minimap { position: static; display: block; width: 200px; height: 200px; cursor: pointer; border-top: 1px solid var(--line); }
/* profiles, groups, land */
.pfHead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.pfHead h3 { margin: 0 0 4px; }
.pfPic { width: 112px; height: 112px; border-radius: 8px; object-fit: cover; flex: none; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.pfPic.none { display: grid; place-items: center; font-size: 52px; opacity: .6; }
.pfMini { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; flex: none; }
.pfMini.none { display: inline-grid; place-items: center; font-size: 14px; background: rgba(255,255,255,.06); }
.pfTag { color: #ffe9a8; margin: 0 0 4px; font-size: 12px; }
.pfPicks { display: flex; flex-wrap: wrap; gap: 6px; }
.pfPicks button { padding: 2px; width: 60px; height: 60px; }
.pfPicks button.active { outline: 2px solid var(--accent); }
.pfPicks img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.chatTop { display: flex; align-items: center; gap: 8px; padding: 4px 2px 6px; }
.tag.gold { background: rgba(255,216,74,.25); color: #ffe48a; }
.tag.rent, .buyable.rent { color: #6ff0c0; }
.tag.rent { background: rgba(63,214,160,.22); }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.parcelRow { align-items: center; }
.estateMap { cursor: crosshair; touch-action: none; }
.selInfo { margin-top: 6px; }
#toasts { top: 40px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; width: min(480px, calc(100vw - 32px)); z-index: 40 !important; }
.toast { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 12px; animation: pop .2s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } }
#interact { bottom: 70px; left: 50%; transform: translateX(-50%); background: var(--bg); border-radius: 999px; padding: 8px 16px; border: 1px solid var(--line); }
#interact kbd { background: #fff; color: #111; border-radius: 4px; padding: 0 6px; font-weight: 700; }
#crosshair { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 26px; color: #fff; text-shadow: 0 0 4px #000; pointer-events: none; }
#windows { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
/* floating windows */
.win { position: fixed; pointer-events: auto; background: rgba(20,24,36,.94); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; min-width: 220px; min-height: 120px; box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(8px); }
.win.focused { border-color: rgba(79,124,255,.6); }
.win.min { height: 32px !important; min-height: 0; resize: none; }
.win.min .winBody { display: none; }
.winHead { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 12px; background: rgba(255,255,255,.05); border-bottom: 1px solid var(--line); cursor: move; user-select: none; flex: none; }
.winTitle { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winBtns { display: flex; gap: 2px; }
.winBtns button { background: none; border: 0; padding: 2px 8px; font-size: 13px; border-radius: 5px; }
.winBtns button:hover { background: rgba(255,255,255,.15); }
.winBtns .winClose:hover { background: var(--err); }
.winBody { padding: 12px; overflow: auto; display: grid; gap: 10px; align-content: start; flex: 1; }
.tabs.scroll { overflow-x: auto; }
.tabs.scroll button { flex: none; }
.bigmap { width: 100%; aspect-ratio: 1; border-radius: 8px; cursor: crosshair; }
.imLog.nearby > div { padding: 2px 0; }
.imLog small { color: var(--muted); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad button { font-size: 20px; padding: 10px 0; user-select: none; touch-action: none; }
.pad button:active, .hold:active { background: var(--accent); }
.prefs { display: grid; gap: 4px; }
.prefRow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.prefRow b { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.meter { height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #3cff8a; }
.snap { width: 100%; border-radius: 8px; }
a.btn { display: inline-block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: #fff; }
a.btn.primary { background: var(--accent); font-weight: 600; }
img.mini { width: 32px; height: 32px; border-radius: 4px; background: #1c2233; }
.gold { color: var(--gold); }
.searchIn { width: 100%; }
.results { display: grid; }
.menu kbd { margin-left: 18px; float: right; color: var(--muted); font-size: 11px; font-family: inherit; }
.menu .arrow { float: right; margin-left: 12px; color: var(--muted); }
.skinList { display: grid; gap: 6px; }
.skinOpt { display: grid; text-align: left; gap: 2px; padding: 8px 10px; }
.skinOpt small { color: var(--muted); font-size: 11px; }
.skinOpt.active small { color: #dfe6ff; }
@media (max-width: 760px) {
  #toolbar .tb { min-width: 40px; padding: 3px 4px; }
  #toolbar .tb span { display: none; }
  #miniBox { width: 130px; } #minimap { width: 130px; height: 130px; }
  #statusBar .sb:nth-child(3), #statusBar .sb:nth-child(4) { display: none; }
  #chatBar { bottom: 48px; } #chatLog { bottom: 84px; }
}
.menu { position: fixed; z-index: 30; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px; display: grid; min-width: 190px; backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.menu button { background: none; border: 0; text-align: left; padding: 7px 10px; border-radius: 6px; }
.menu button:hover:not(:disabled) { background: var(--accent); }
.menu button:disabled { opacity: 1; cursor: default; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; width: 100%; }
.badge { background: var(--err); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; margin-left: 4px; }
.badge:empty { display: none; }
.tag.wear { background: rgba(47,191,113,.3); color: #b6f0cf; }
h4.sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.personRow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.personRow a, .imHead a { color: var(--text); cursor: pointer; font-weight: 600; }
.personRow a:hover, .imHead a:hover { text-decoration: underline; }
.personRow button { padding: 3px 8px; }
.spacer { flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #666; display: inline-block; }
.dot.on { background: #3cff8a; box-shadow: 0 0 6px #3cff8a; }
.imHead { display: flex; align-items: center; gap: 8px; }
.imLog { background: rgba(0,0,0,.25); border-radius: 10px; padding: 10px; min-height: 260px; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.msg { align-self: flex-start; max-width: 80%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 6px 10px; display: grid; }
.msg.me { align-self: flex-end; background: var(--accent); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.msg small { opacity: .6; font-size: 10px; justify-self: end; }
.imForm, .inline { display: flex; gap: 6px; }
.imForm input, .inline input, .inline select { flex: 1; }
textarea { width: 100%; resize: vertical; }
#bigmap { width: 100%; aspect-ratio: 1; border-radius: 10px; cursor: crosshair; }
.wornRow { gap: 6px; }
.wornHead { display: flex; align-items: center; gap: 8px; }
.wornHead img { width: 40px; height: 40px; border-radius: 6px; background: radial-gradient(#3a4562, #1c2233); }
.wornHead b { flex: 1; }
details.sect summary { list-style: none; cursor: pointer; }
details.sect summary h4 { display: inline; }
details.sect summary::before { content: '▸ '; color: var(--muted); }
details.sect[open] summary::before { content: '▾ '; }
.itemCard select { width: 100%; padding: 4px; font-size: 12px; }
#parcelBar { pointer-events: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 14px; display: flex; gap: 10px; align-items: center; }
#parcelBar:empty { display: none; }
#parcelBar button { border-radius: 999px; padding: 4px 12px; }
#parcelBar .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
#chat { left: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); display: grid; gap: 6px; }
#chatLog { max-height: 190px; overflow-y: auto; display: grid; gap: 2px; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
#chatLog .sys { color: #d6dcea; font-style: italic; }
#chatLog .objname { color: #ffd84a; }
#chatIn { background: var(--bg); width: 100%; }
#offline { position: fixed; top: 0; left: 0; right: 0; background: var(--err); color: #fff; text-align: center; padding: 6px; z-index: 20; }

/* ---------- side panel ---------- */
#panel { top: 60px; right: 12px; bottom: 12px; width: min(400px, calc(100vw - 24px)); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; backdrop-filter: blur(8px); z-index: 3; }
#panel.wide { width: min(620px, calc(100vw - 24px)); }
.panelHead { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panelHead h2 { margin: 0; font-size: 17px; }
#panelBody { padding: 14px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.itemCard { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 4px; font-size: 12px; align-content: start; }
.itemCard img { width: 100%; aspect-ratio: 1; background: radial-gradient(#3a4562, #1c2233); border-radius: 6px; }
.itemCard .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itemCard .meta { color: var(--muted); }
.itemCard .price { color: var(--gold); font-weight: 700; }
.itemCard .row { display: flex; gap: 4px; }
.itemCard .row > * { flex: 1; min-width: 0; padding: 4px; }
.box { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.box h3 { margin: 0; font-size: 14px; }
.box p { margin: 0; color: var(--muted); }
table.keys { border-collapse: collapse; width: 100%; }
table.keys td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.keys td:first-child { color: var(--gold); font-weight: 600; width: 40%; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* ---------- build ---------- */
.shapeGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shapeGrid button { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; text-transform: capitalize; font-size: 12px; }
.shapeGrid button span { font-size: 22px; line-height: 1; }
.objHead { display: grid; gap: 4px; }
.objHead input { font-weight: 600; font-size: 15px; }
.objHead .meta { color: var(--muted); font-size: 12px; }
.toolbar2 { display: flex; gap: 4px; flex-wrap: wrap; }
.toolbar2 button, .toolbar2 select { padding: 5px 8px; font-size: 12px; }
.sect { display: grid; gap: 6px; }
.sect h4 { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.vec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vec label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.vec input { width: 100%; padding: 5px 6px; }
.lookRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lookRow label, .field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.lookRow input[type=color] { width: 100%; }
.range { display: grid; grid-template-columns: 90px 1fr; align-items: center; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- script ---------- */
.scriptHead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#code { width: 100%; min-height: 300px; resize: vertical; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #0d1020; tab-size: 2; white-space: pre; }
.console { background: #0b0d18; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 12px/1.45 ui-monospace, Menlo, monospace; max-height: 140px; overflow-y: auto; }
.console .err { color: #ff8a8d; }
details summary { cursor: pointer; color: var(--muted); }
table.api { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
table.api td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.api td:first-child { white-space: nowrap; }

/* ---------- appearance editor ---------- */
#lookEditor { position: fixed; inset: 0; z-index: 15; display: grid; grid-template-columns: 1fr 400px; background: #1b2131; }
.leView { position: relative; min-height: 0; }
.leView canvas { width: 100%; height: 100%; }
.leHint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.leSide { background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 0; }
.leSide h2 { margin: 0; }
.leTabs { display: flex; flex-wrap: wrap; gap: 4px; }
.leTabs button { padding: 5px 10px; font-size: 13px; }
.leControls { flex: 1; overflow-y: auto; display: grid; gap: 14px; align-content: start; padding-right: 4px; }
.leRow { display: grid; gap: 6px; }
.leRow > label { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.leRow > label span { color: var(--text); font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid transparent; }
.sw.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.leFoot { display: flex; gap: 8px; }
.leFoot .primary { flex: 1; }

@media (max-width: 900px) {
  #bottomBar { left: 12px; bottom: 150px; }
  #miniBox { width: 130px; } #minimap { width: 130px; height: 130px; }
  #lookEditor { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  .leSide { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  #toolbar { max-width: calc(100vw - 24px); top: 56px; }
  #toolbar button { padding: 6px 8px; font-size: 12px; }
  #chatLog { max-height: 90px; }
  #panel { top: 110px; }
}

.skinGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.skinCard { display: grid; gap: 3px; padding: 4px; text-align: center; font-size: 12px; }
.skinCard img, .skinCard .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: #2a3348; display: grid; place-items: center; font-size: 28px; }
.skinCard.active { outline: 2px solid var(--accent); }
.askBack{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;z-index:10000}
.askBox{background:#23262e;color:#eee;border:1px solid #444a57;border-radius:10px;padding:16px 18px;min-width:280px;max-width:420px;box-shadow:0 12px 40px rgba(0,0,0,.5);font:14px system-ui,sans-serif}
.askBox p{margin:0 0 12px;line-height:1.4;white-space:pre-line}
.askBox .askIn{width:100%;box-sizing:border-box;margin-bottom:12px;padding:6px 8px;background:#15171c;color:#eee;border:1px solid #444a57;border-radius:6px}
.askBtns{display:flex;justify-content:flex-end;gap:8px}
.askBtns button{padding:6px 14px;border-radius:6px;border:1px solid #444a57;background:#2f333d;color:#eee;cursor:pointer}
.askBtns .primary{background:#5b7cfa;border-color:#5b7cfa;color:#fff}
.leLoading { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; padding: 4px 12px; border-radius: 12px; font-size: 13px; }
.leSide .sub { margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.skinCard small { color: var(--muted); font-size: 10px; }
.skinCard.active small { color: #dfe6ff; }
.leModes .chip { flex: 1; }
.meter { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; margin: 6px 0; }
.meter > div { height: 100%; background: #4fbf7f; }
.meter > div.hot { background: #e0574f; }
button.danger { background: #5a2626; border-color: #8a3a3a; color: #ffd7d7; }
.landHead h3 { margin-bottom: 2px; }
.winBody .row input { flex: 1; min-width: 0; }
.winBody .box .row { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.texBox { display: grid; gap: 4px; margin-top: 6px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.texRange { display: grid; grid-template-columns: 1fr 64px; gap: 2px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.texRange .tl { grid-column: 1 / -1; }
.texRange input[type=number] { width: 64px; }
.texBox .inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.texPick { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 6px; text-align: left; }
.texPick img, .texPick .ph { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; background: #2a3348; flex: none; }
.texPick span:not(.ph) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.texPicker { margin: 6px 0; padding: 8px; border-radius: 8px; background: rgba(0,0,0,.25); max-height: 340px; overflow-y: auto; }
.texPicker h5 { margin: 8px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.texGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
.texTile { display: grid; gap: 2px; padding: 3px; font-size: 10px; line-height: 1.15; text-align: center; }
.texTile img, .texTile .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #2a3348; display: grid; place-items: center; }
.texTile span:not(.ph) { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.texTile.active { outline: 2px solid var(--accent); }
.invTop { display: flex; gap: 6px; margin-bottom: 8px; }
.invTop .invSearch { flex: 1; min-width: 0; }
.invWrap { display: grid; grid-template-columns: 160px 1fr; gap: 10px; min-height: 0; height: calc(100% - 44px); }
.invNav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; border-right: 1px solid var(--line); padding-right: 8px; }
.invNav .invHead { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 4px; }
.invNav .invHead:first-child { margin-top: 0; }
.invNav button { display: flex; justify-content: space-between; text-align: left; padding: 5px 8px; font-size: 13px; background: transparent; border-color: transparent; }
.invNav button span { color: var(--muted); font-size: 11px; }
.invNav button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.invNav button.active span { color: #dfe6ff; }
.invList { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.invRow { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; background: rgba(255,255,255,.03); }
.invRow:hover { background: rgba(255,255,255,.07); }
.invRow img, .invRow .invIcon { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #2a3348; display: grid; place-items: center; font-size: 20px; }
.invName { display: grid; min-width: 0; }
.invName b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invName .hint { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invAct { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.invAct button { padding: 3px 8px; font-size: 12px; }
.invSub { margin: 10px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.itemText { width: 100%; box-sizing: border-box; height: calc(100% - 90px); min-height: 220px; resize: none; }
.itemText.note { font: 14px/1.5 system-ui, sans-serif; }
.faceBar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.faceBar .faceName { font-weight: 600; font-size: 12px; }
.faceBar button { padding: 2px 8px; font-size: 12px; }
@media (max-width: 640px) { .invWrap { grid-template-columns: 1fr; } .invNav { flex-direction: row; flex-wrap: wrap; border-right: 0; } }

.winGrip { position: absolute; z-index: 3; }
.winGrip.e { top: 30px; right: 0; bottom: 10px; width: 7px; cursor: ew-resize; }
.winGrip.w { top: 30px; left: 0; bottom: 10px; width: 7px; cursor: ew-resize; }
.winGrip.s { left: 10px; right: 10px; bottom: 0; height: 7px; cursor: ns-resize; }
.winGrip.se { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 55%, rgba(255,255,255,.35) 55%, rgba(255,255,255,.35) 62%, transparent 62%, transparent 72%, rgba(255,255,255,.35) 72%, rgba(255,255,255,.35) 79%, transparent 79%); }
.winGrip.sw { left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.win.min .winGrip { display: none; }
.win[data-id="inventory"] .winBody, .win[data-id^="item:"] .winBody { display: flex; flex-direction: column; overflow: hidden; }
.win[data-id="inventory"] .invWrap { flex: 1; height: auto; min-height: 0; }
.win[data-id^="item:"] .itemText { flex: 1; height: auto; }

/* ---------- Marketplace (Second Life style) ---------- */
.mk { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mkTop { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mkTop .mkQ { flex: 1 1 200px; min-width: 120px; }
.mkTop .mkCat { max-width: 190px; }
.mkLogo { font-weight: 800; background: none; border: none; font-size: 16px; padding: 4px 6px; }
button.gold { background: var(--gold); color: #222; border-color: transparent; font-weight: 700; }
button.link { background: none; border: none; padding: 0 2px; color: var(--accent); cursor: pointer; }
.mkBody { flex: 1; overflow: auto; padding: 10px 2px; min-height: 0; }
.mkHero { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px; border-radius: 12px; background: linear-gradient(120deg, #2b3f78, #5a2f6e); margin-bottom: 12px; }
.mkHero h2 { margin: 0 0 6px; } .mkHero p { margin: 0; color: #dfe4f5; max-width: 560px; }
.mkCats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.mkCats button { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 12px; }
.mkCats button span { font-size: 18px; } .mkCats button small { margin-left: auto; color: var(--muted); }
.mkH { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 15px; } .mkH .link { font-size: 12px; font-weight: 400; }
.mkGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mkCard { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 6px; border-radius: 10px; background: var(--bg2); }
.mkCard:hover { border-color: var(--accent); }
.mkCard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: radial-gradient(#3a4562, #1c2233); }
.mkCard .mkT { font-weight: 600; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkCard .mkS { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkCard .mkR { font-size: 11px; } .mkCard .mkP { color: var(--gold); font-weight: 700; }
.mkStars { color: var(--gold); letter-spacing: 1px; }
.mkStores { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mkStoreCard { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px; }
.mkStoreCard img, .mkNoLogo { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; font-size: 30px; background: var(--bg2); }
.mkStoreCard small { color: var(--muted); font-size: 11px; }
.mkSearch { display: grid; grid-template-columns: 190px 1fr; gap: 12px; }
.mkSearch aside { display: flex; flex-direction: column; gap: 3px; } .mkSearch aside h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.mkFilt { text-align: left; background: none; border-color: transparent; padding: 4px 8px; font-size: 13px; display: flex; } .mkFilt small { margin-left: auto; color: var(--muted); }
.mkFilt.active small { color: #dfe6ff; }
.mkResHead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mkBack { margin-bottom: 8px; }
.mkItem { display: grid; grid-template-columns: minmax(240px, 1.1fr) 1fr; gap: 16px; }
.mkGallery .mkMain { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: radial-gradient(#3a4562, #1c2233); }
.mkThumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .mkThumbs button { padding: 2px; } .mkThumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; display: block; }
.mkInfo h2 { margin: 0 0 6px; }
.mkStoreLink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; } .mkStoreLink img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.mkPrice { font-size: 26px; font-weight: 800; color: var(--gold); margin: 8px 0; }
.mkPerms { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 10px; } .mkPerms td { padding: 4px 6px; border-top: 1px solid var(--line); } .mkPerms td:first-child { color: var(--muted); width: 38%; }
.mkTab { padding: 10px 2px; } .mkDesc { white-space: pre-wrap; line-height: 1.5; }
.mkRate button { font-size: 20px; padding: 0 4px; background: none; border: none; color: var(--muted); } .mkRate button.on { color: var(--gold); }
.mkReview { padding: 8px 0; border-top: 1px solid var(--line); } .mkReview p { margin: 4px 0; }
.mkReply { margin: 4px 0 0 14px; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--bg2); border-radius: 4px; font-size: 13px; }
.mkBanner { height: 150px; border-radius: 12px; background: linear-gradient(120deg, #2b3f78, #5a2f6e) center / cover; }
.mkStoreHead { display: flex; align-items: center; gap: 12px; margin: -30px 0 10px 14px; } .mkStoreHead h2 { margin: 26px 0 2px; } .mkStoreHead p { margin: 0; }
.mkLogoImg { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; border: 3px solid #1b2030; background: var(--bg2); display: grid; place-items: center; font-size: 40px; }
.mkMine { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mkRow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.mkRow img, .mkRow .mkNoLogo { width: 52px; height: 52px; border-radius: 7px; object-fit: cover; font-size: 22px; }
.mkPicRow { display: flex; gap: 14px; margin: 8px 0; } .mkPicRow .grow { flex: 1; }
.mkPicBox { position: relative; width: 110px; height: 110px; border-radius: 10px; background: var(--bg2) center / cover; display: grid; place-items: center; font-size: 40px; overflow: hidden; margin: 4px 0; border: 1px solid var(--line); }
.mkPicBox.wide { width: 100%; height: 90px; } .mkPicBox img { width: 100%; height: 100%; object-fit: cover; }
.mkPics { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.mkPics .mkPicBox button { position: absolute; top: 4px; padding: 1px 6px; font-size: 12px; } .mkPics .mkPicBox button:last-child { right: 4px; } .mkPics .mkPicBox button:first-of-type:not(:last-child) { left: 4px; }
.mkPics .mkPicBox .tag { position: absolute; top: 4px; left: 4px; font-size: 10px; }
.mkAddPic { width: 110px; height: 110px; margin: 4px 0; }
@media (max-width: 700px) { .mkSearch, .mkItem { grid-template-columns: 1fr; } .mkSearch aside { flex-direction: row; flex-wrap: wrap; } }

/* ---------- OpenBucks ---------- */
.walletTop { display: grid; gap: 2px; text-align: center; padding: 14px; border-radius: 12px; background: linear-gradient(120deg, #3d5a1f, #6b5a12); margin-bottom: 10px; }
.walletTop b { font-size: 30px; color: var(--gold); }
.ecoCards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ecoCards > div { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.ecoCards small { color: var(--muted); } .ecoCards b { font-size: 18px; color: var(--gold); } .ecoCards .hint { font-size: 11px; }
.ecoChart { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding: 4px 0; }
.ecoChart div { flex: 1; min-width: 3px; background: var(--gold); border-radius: 2px 2px 0 0; opacity: 0.85; }
.lockRow { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0; }
.hollowBox { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.hollowBox summary { cursor: pointer; font-weight: 600; }

/* ---------- lights, media, events, photos, picks, reactions ---------- */
.mediaFrame { width: 100%; height: calc(100% - 40px); min-height: 300px; border: 0; border-radius: 8px; background: #000; }
.photoGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.photoCard { display: flex; flex-direction: column; gap: 2px; padding: 4px; text-align: left; font-size: 12px; }
.photoCard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.photoCard small { color: var(--muted); }
.photoBig { width: 100%; border-radius: 10px; }
.picks { display: grid; gap: 6px; } .pickCard { display: flex; gap: 8px; align-items: center; }
.pickCard img, .pickCard .mkNoLogo { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; font-size: 24px; }
.evDate { display: grid; text-align: center; min-width: 54px; padding: 4px; border-radius: 8px; background: var(--bg2); } .evDate small { color: var(--muted); }
.alignRow { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 3px 0; } .alignRow b { min-width: 110px; font-size: 12px; } .alignRow button { font-size: 12px; padding: 4px 6px; }
.landExtra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; } .landPic { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }
#ctx.emoteMenu { display: grid; grid-template-columns: repeat(4, 1fr); width: 220px; } #ctx.emoteMenu > *:first-child { grid-column: 1 / -1; }
.emoteBig { font-size: 24px; }
/* menus (right-click, upload type, menu bar) always sit above windows */
#hud > .menu { z-index: 60; }
.sb.rules:empty { display: none; }
.sb.rules span { margin: 0 1px; }
.landRules .tag { margin-right: 4px; }
.abTable { width: 100%; border-collapse: collapse; margin: 6px 0; }
.abTable th, .abTable td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.abTable td:first-child { text-align: left; }

/* ---------- phones and tablets (body.touch: Preferences → Interface → Touch controls) ---------- */
html, body { overscroll-behavior: none; }
canvas { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#joy, #touchBtns { display: none; }
body.touch #joy { display: block; position: fixed; left: calc(18px + env(safe-area-inset-left)); bottom: calc(76px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; background: rgba(14,17,27,.35); border: 2px solid rgba(255,255,255,.28); touch-action: none; z-index: 5; backdrop-filter: blur(2px); }
body.touch #joy.on { background: rgba(79,124,255,.25); border-color: rgba(79,124,255,.8); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
body.touch #touchBtns { display: grid; gap: 10px; position: fixed; right: calc(14px + env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5; }
#touchBtns button { width: 56px; height: 56px; border-radius: 50%; font-size: 24px; padding: 0; background: rgba(14,17,27,.55); border: 2px solid rgba(255,255,255,.28); touch-action: none; -webkit-user-select: none; user-select: none; }
#touchBtns button:active, #touchBtns button.on { background: rgba(79,124,255,.55); border-color: rgba(79,124,255,.9); }
body.touch #touchBtns [data-tbtn="down"] { display: none; }
body.touch.flying #touchBtns [data-tbtn="down"] { display: block; }
body.touch #toolbar { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; top: auto; max-width: none; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
body.touch #toolbar::-webkit-scrollbar { display: none; }
body.touch #toolbar .tb { flex: none; min-width: 52px; padding: 5px 6px; font-size: 20px; }
body.touch #topBar { overflow-x: auto; scrollbar-width: none; }
body.touch #menuBar .mb { padding: 6px 10px; }
body.touch .menu button { padding: 10px 14px; font-size: 15px; }
body.touch #chatBar { left: calc(152px + env(safe-area-inset-left)); right: 84px; width: auto; bottom: calc(66px + env(safe-area-inset-bottom)); }
body.touch #chatIn { font-size: 16px; } /* 16px stops iPhones zooming in on the box */
body.touch #chatLog { bottom: calc(210px + env(safe-area-inset-bottom)); max-height: 30vh; overflow: hidden; }
body.touch input, body.touch select, body.touch textarea { font-size: 16px; }
body.touch .winHead { min-height: 38px; }
body.touch .winBtns button { min-width: 38px; min-height: 32px; font-size: 16px; }
body.touch #interact { bottom: calc(220px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) {
  body.touch .win { left: 0 !important; top: 30px !important; width: 100vw !important; height: calc(100dvh - 30px - 58px - env(safe-area-inset-bottom)) !important; border-radius: 0; min-width: 0; }
  body.touch .winGrip { display: none; }
  body.touch #statusBar .sb:not([data-sb="balance"]):not([data-sb="land"]):not(.rules):not([data-sb="prefs"]) { display: none; }
  body.touch #statusBar [data-sb="land"] { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
  body.touch #miniBox { width: 110px; } body.touch #minimap { width: 110px; height: 110px; }
  body.touch #menuBar .brand { display: none; }
}
#authErr.ok { color: var(--ok); }
