/* ============================================================
   AFKCore — dashboard.css
   App shell + components for /dashboard/. Builds on site.css tokens.
   ============================================================ */

html, body.dash-body { height: 100%; }
body.dash-body { overflow: hidden; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100vh; }
.app-side {
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
  padding: 16px; overflow-y: auto; background: var(--bg);
}
.app-side .dash-brand { justify-content: flex-start; }
.app-side .dash-brand a { display: flex; }
.app-side .side-close { display: none; margin-left: auto; }
.app-side .dash-label .icon-btn { width: 22px; height: 22px; }

.dash-nav a {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 6px;
  background: var(--surface-2); font-size: 14px; font-weight: 500; transition: background 0.15s;
}
.dash-nav a:hover { background: var(--surface-3); }
.dash-nav a .ic { width: 16px; height: 16px; }
.dash-nav a.active { background: var(--accent); color: var(--accent-fg); }
.dash-nav a.dash-profile.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.dash-nav a.dash-profile .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-nav .empty-hint { color: var(--muted-2); font-size: 12px; padding: 6px 12px; }

.plan-alert {
  margin-top: auto; border: 1px solid rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.08);
  border-radius: 10px; padding: 14px;
}
.plan-alert b { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.plan-alert b .ic { width: 18px; height: 18px; }
.plan-alert p { color: #f7a9b6; font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.plan-alert .btn { width: 100%; height: 30px; font-size: 12px; background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.45); }
.plan-alert .btn:hover { background: rgba(244, 63, 94, 0.12); }
.plan-alert + .dash-user { margin-top: 8px; }
.app-side .dash-user { cursor: pointer; flex: none; }
.app-side .dash-user:hover { background: var(--surface-3); }

.app-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.app-head {
  height: 56px; padding: 0 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
  font-weight: 600; flex: none; background: var(--bg);
}
.app-head .side-toggle { display: none; }
.app-head .crumb { color: var(--muted); font-weight: 500; }
.app-head .crumb a:hover { color: var(--text); }
.app-head .sep { color: var(--muted-2); font-weight: 400; }
.app-head .srv { margin-right: 2px; }
.app-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.app-body { padding: 24px; overflow-y: auto; flex: 1; }
.app-body > .panel + .panel { margin-top: 16px; }

/* ---------- Generic bits ---------- */
.panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; }
.tbl tr[data-open] { cursor: pointer; }
.tbl tr[data-open]:hover td { background: rgba(255, 255, 255, 0.02); }
.tbl td.strong { color: var(--text); font-weight: 500; }
.tbl th button { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: inherit; }
.tbl th button .ic { margin: 0; }
.tbl th button.sorted .ic { color: var(--accent); }
.tbl .row-actions { display: inline-flex; gap: 4px; align-items: center; }
.tbl .icon-btn.pinned { color: var(--accent); }
.tbl input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; margin: 0; vertical-align: middle; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
/* Direct child only: this is the big illustration above the text. As a
   descendant selector it also matched the icon inside an action button
   nested here, blowing it up to 40px and breaking it onto its own line. */
.empty-state > .ic { width: 40px; height: 40px; color: var(--muted-2); margin: 0 auto 12px; display: block; }
.empty-state b { display: block; color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-state .btn { margin-top: 16px; }
.type-pill { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); letter-spacing: 0.02em; }
.type-pill.java { background: rgba(94, 168, 58, 0.18); color: #8fdc6a; }
.type-pill.bedrock { background: rgba(120, 120, 130, 0.25); color: #d4d4d8; }
.type-pill.cracked { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pill.warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pill.bad { background: rgba(244, 63, 94, 0.15); color: var(--danger); }
.pill .dot.dot-warn { background: #fbbf24; }
.pill .dot.dot-bad { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.pill .dot.pulse { animation: pulse 1s infinite; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.muted-2 { color: var(--muted-2); }
.mono { font-family: var(--mono); font-size: 13px; }
.kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-3); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; background: var(--surface); }
.stat span { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.stat small { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 500; }
.stat .bar-track { height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.stat .bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.45); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.12); }
.btn-danger.solid { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger.solid:hover { background: #ff5c78; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .field { margin: 0; }
.field .hint { color: var(--muted); font-size: 12px; }
.field .error { color: var(--danger); font-size: 12px; }
.input.invalid { border-color: var(--danger); }
.select {
  appearance: none; -webkit-appearance: none; height: 36px; border: 1px solid var(--border-2); border-radius: 6px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ababac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  color: var(--text); padding: 0 32px 0 12px; font: inherit; font-size: 14px; width: 100%; cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent); }
.select option { background: var(--surface-2); }
textarea.input { height: auto; padding: 10px 12px; min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.input[type="number"] { -moz-appearance: textfield; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-2); transition: background 0.15s; flex: none; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 18px; }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting:first-child { padding-top: 0; }
.setting b { display: block; font-weight: 600; font-size: 14px; }
.setting p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.setting .ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.setting .ctl .input, .setting .ctl .select { width: 120px; }
.setting .ctl .input.wide { width: 260px; }
.sub-settings { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); margin-bottom: 8px; display: grid; gap: 10px; }
.sub-settings .check { font-size: 13px; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.counter.inline { display: inline-flex; width: 150px; height: 36px; margin: 0; }

/* ---------- Modal / menu / confirm ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 60; display: grid; place-items: center; padding: 24px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow-md); max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.lg { max-width: 720px; }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot .left { margin-right: auto; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color 0.15s, background 0.15s; }
.choice:hover { border-color: var(--border-2); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice canvas { width: 40px; height: 40px; margin: 0 auto 10px; image-rendering: pixelated; border-radius: 4px; }
.choice b { display: block; font-size: 14px; font-weight: 600; }
.choice span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.device-code { text-align: center; padding: 20px; border: 1px dashed var(--border-2); border-radius: 10px; margin-bottom: 16px; }
.device-code .code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: 4px; color: var(--accent); margin: 6px 0; }
.device-code p { color: var(--muted); font-size: 13px; }
.pick-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); cursor: pointer; font-size: 14px; }
.pick-list label:hover { background: var(--surface-3); }
.pick-list canvas { width: 20px; height: 20px; border-radius: 3px; image-rendering: pixelated; }
.pick-list .meta { margin-left: auto; color: var(--muted); font-size: 12px; }

.menu { position: fixed; z-index: 70; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 4px; min-width: 190px; box-shadow: var(--shadow-md); animation: fade 0.12s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; font-size: 13px; text-align: left; }
.menu button .ic { width: 15px; height: 15px; color: var(--muted); }
.menu button:hover { background: var(--surface-3); }
.menu button.danger, .menu button.danger .ic { color: var(--danger); }
.menu hr { margin: 4px 0; }
.menu .menu-label { padding: 6px 10px 2px; font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Profile header + tabs ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.profile-head .srv { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
.profile-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.profile-head .meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.profile-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-head .meta .ic { width: 14px; height: 14px; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a .ic { width: 15px; height: 15px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 56px - 48px - 150px); min-height: 380px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.7; background: var(--surface-2); border-radius: 12px 12px 0 0; border: 1px solid var(--border); border-bottom: 0; }
.chat-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.chat-line time { color: var(--muted-2); flex: none; }
.chat-line .from { color: #9fd3ff; font-weight: 600; }
.chat-line.self .from { color: var(--accent); }
.chat-line.system { color: #f5d67a; }
.chat-line.macro { color: #c79bff; }
.chat-line.muted { color: var(--muted-2); }
.chat-input { display: flex; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 0 0 12px 12px; background: var(--surface); }
.chat-input .select { width: 170px; flex: none; }
.chat-input .input { flex: 1; }
.chat-empty { color: var(--muted-2); text-align: center; padding: 40px 0; }

/* ---------- POV ---------- */
.pov-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.pov-screen { position: relative; aspect-ratio: 16 / 10; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); user-select: none; }
.pov-screen canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.pov-screen.jump canvas { animation: jump 0.4s ease-out; }
@keyframes jump { 0% { transform: none; } 40% { transform: translateY(-4%); } 100% { transform: none; } }
.pov-screen .pov-offline { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(0, 0, 0, 0.7); text-align: center; padding: 24px; }
.pov-hud { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bars { display: flex; gap: 24px; }
.bar { display: flex; gap: 2px; }
.bar i { width: 10px; height: 10px; background: #e33; clip-path: polygon(50% 100%, 0 35%, 25% 0, 50% 25%, 75% 0, 100% 35%); }
.bar i.off { background: #3a1010; }
.bar.food i { background: #c78b3b; clip-path: none; border-radius: 2px; }
.bar.food i.off { background: #3a2a10; }
.hotbar-lg { display: flex; gap: 2px; padding: 2px; background: rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.4); }
.hotbar-lg span { width: 36px; height: 36px; background: rgba(139, 139, 139, 0.5); position: relative; cursor: pointer; }
.hotbar-lg span.sel { outline: 2px solid #fff; z-index: 1; }
.hotbar-lg span i { position: absolute; inset: 8px; background: var(--c); }
.hotbar-lg span em { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 10px; color: #fff; text-shadow: 1px 1px 0 #000; font-family: var(--mono); }
.pov-chat { position: absolute; left: 12px; bottom: 96px; font-family: var(--mono); font-size: 12px; color: #fff; text-shadow: 1px 1px 0 #000; max-width: 62%; }
.pov-chat div { background: rgba(0, 0, 0, 0.35); padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pov-topbar { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: #fff; text-shadow: 1px 1px 0 #000; }
.pov-topbar span { background: rgba(0, 0, 0, 0.35); padding: 2px 6px; }
.pov-inv { position: absolute; inset: 12% 22%; background: #c6c6c6; border: 3px solid; border-color: #fff #555 #555 #fff; padding: 8px; display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; align-content: start; }
.pov-inv span { aspect-ratio: 1; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; position: relative; }
.pov-inv span i { position: absolute; inset: 22%; background: var(--c); }
.pov-inv .inv-title { grid-column: 1 / -1; color: #3f3f3f; font-family: var(--mono); font-size: 12px; margin-bottom: 4px; }
.pov-side .panel { padding: 16px; }
.pov-side .panel + .panel { margin-top: 12px; }
.pov-side h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.dpad { display: grid; grid-template-columns: repeat(3, 46px); gap: 6px; justify-content: center; }
.dpad button { height: 42px; border-radius: 8px; background: var(--surface-3); font-weight: 600; font-size: 13px; }
.dpad button:hover { background: #333338; }
.dpad button.on { background: var(--accent); color: var(--accent-fg); }
.dpad button:disabled { opacity: 0.35; cursor: not-allowed; }
.dpad-row { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.dpad-row button { height: 36px; padding: 0 12px; border-radius: 8px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.dpad-row button.on { background: var(--accent); color: var(--accent-fg); }
.dpad-row button:disabled { opacity: 0.35; cursor: not-allowed; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; font-family: var(--mono); font-size: 12px; }

/* ---------- Proxies (drag & drop) ---------- */
.proxy-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.proxy-col { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px; min-height: 220px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.15s, background 0.15s; }
.proxy-col.over { border-color: var(--accent); background: var(--accent-soft); }
.proxy-col h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.proxy-col h4 .ic { width: 16px; height: 16px; color: var(--accent); }
.proxy-col h4 small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }
.proxy-col .ip { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.acct-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; cursor: grab; border: 1px solid transparent; }
.acct-chip:hover { border-color: var(--border-2); }
.acct-chip:active { cursor: grabbing; }
.acct-chip.dragging { opacity: 0.4; }
.acct-chip canvas { width: 18px; height: 18px; border-radius: 3px; image-rendering: pixelated; }
.acct-chip .dot { margin-left: auto; }
.drop-hint { color: var(--muted-2); font-size: 12px; text-align: center; padding: 18px 8px; border: 1px dashed var(--border-2); border-radius: 8px; margin-top: auto; }

/* ---------- Macros ---------- */
.macro-list { display: grid; gap: 12px; }
.macro-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); display: flex; align-items: center; gap: 14px; }
.macro-item.off { opacity: 0.6; }
.macro-item .mi { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.macro-item .mi .ic { width: 18px; height: 18px; }
.macro-item b { display: block; font-size: 15px; font-weight: 600; }
.macro-item p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.macro-item .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.actions-editor { display: grid; gap: 8px; }
.action-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.action-row .icon-btn { color: var(--muted); }
.action-row .icon-btn:hover { color: var(--danger); }
.action-add { justify-self: start; }

/* ---------- Billing ---------- */
.plan-current { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.plan-current .name { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; display: flex; align-items: center; gap: 10px; }
.plan-current .price { font-size: 15px; color: var(--muted); margin-top: 4px; }
.plan-current .price b { color: var(--text); font-weight: 600; }
.plan-current .meta { display: flex; gap: 20px; margin-top: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.plan-current .meta span { display: inline-flex; align-items: center; gap: 6px; }
.plan-current .meta .ic { width: 14px; height: 14px; }
.plan-current .plan-actions { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-mini { border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.plan-mini.current { border-color: var(--accent); }
.plan-mini .pn { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; }
.plan-mini .amt { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.plan-mini .amt small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.plan-mini ul { color: var(--muted); font-size: 13px; display: grid; gap: 4px; flex: 1; align-content: start; }
.plan-mini ul li { display: flex; gap: 6px; align-items: center; }
.plan-mini ul li .ic { width: 13px; height: 13px; color: var(--accent); }
.card-pm { display: flex; align-items: center; gap: 14px; }
.card-pm .pay { width: 56px; height: 36px; font-size: 12px; }
.card-pm b { display: block; font-weight: 600; font-size: 14px; }
.card-pm span { color: var(--muted); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pov-wrap { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-current { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 55; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-md); }
  .app.side-open .app-side { transform: none; }
  .app.side-open::before { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 54; }
  .app-side .dash-user { margin-top: auto; }
  .app-side .side-close { display: inline-grid; }
  .app-head .side-toggle { display: inline-grid; }
  .app-body { padding: 16px; }
  .app-head { padding: 0 16px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .setting { flex-direction: column; align-items: flex-start; gap: 10px; }
  .setting .ctl .input.wide { width: 100%; }
  .profile-head .actions { margin-left: 0; width: 100%; }
  .chat-input { flex-wrap: wrap; }
  .chat-input .select { width: 100%; }
  .action-row { grid-template-columns: minmax(0, 1fr) 32px; }
  .action-row .select { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Maps ---------- */
.wall-list { display: grid; gap: 20px; }
.wall { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.wall-img {
  background:
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.025) 75%) 0 0 / 24px 24px,
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.025) 75%) 12px 12px / 24px 24px,
    #0a0a0b;
  display: grid; place-items: center; padding: 16px; overflow: auto;
}
.wall-img img {
  image-rendering: pixelated; max-width: 100%; height: auto;
  /* Keeps a box even if the PNG is slow or fails, so the lazy loader fires
     and a broken wall doesn't collapse to an invisible strip. */
  min-width: 128px; min-height: 64px;
  box-shadow: 0 0 0 1px var(--border-2), var(--shadow-md);
}
.wall figcaption { padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.wall figcaption b { font-size: 15px; font-weight: 600; }
.wall-meta { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.wall-meta .ic { width: 14px; height: 14px; }
.wall-actions { margin-left: auto; display: flex; gap: 8px; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.map-tile { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.map-tile img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; }
.map-tile figcaption { padding: 6px 8px; font-size: 12px; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); }
.map-tile figcaption .ic { width: 11px; height: 11px; }

.pov-map { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; background: #0a0a0b; }
.pov-offline b { color: var(--text); font-weight: 600; }
.pov-offline a { color: var(--accent); }

/* ---------- Live indicator ---------- */
.ws-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 10px 12px 4px; }
.ws-state.off { color: #fbbf24; }
.chat-line .who { color: var(--muted-2); }

/* ---------- Settings: sessions ---------- */
.session-list { display: flex; flex-direction: column; }
.session {
  display: flex; align-items: center; gap: 14px; padding: 13px 0;
  border-top: 1px solid var(--border);
}
.session:first-child { border-top: 0; }
.session .s-main { min-width: 0; flex: 1; }
.session .s-main b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.session .s-meta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12.5px;
}
.session .s-meta .ic { width: 12px; height: 12px; flex: none; }
.session.is-current .s-main b { color: var(--accent); }
.session .btn { flex: none; }

/* A panel whose actions are destructive, so it reads differently. */
.danger-panel { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-panel h3 { color: var(--danger); }

/* Compact select, for the plan picker in the account list. */
.select-sm { height: 30px; padding: 0 28px 0 9px; font-size: 13px; flex: none; min-width: 104px; }

/* An account with no plan: make the sidebar say so rather than look normal. */
.dash-user .tier.tier-none { color: #fbbf24; }

/* ---------- POV: live top-down view ---------- */
.pov-world {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: pixelated; background: #111214;
}
/* The map in hand, tucked in a corner so it does not hide the world. */
.pov-held {
  position: absolute; right: 14px; bottom: 74px; width: 112px; height: 112px;
  image-rendering: pixelated; border-radius: 6px;
  border: 1px solid var(--border-2); box-shadow: var(--shadow-md); background: #0a0a0b;
}
@media (max-width: 760px) { .pov-held { width: 76px; height: 76px; bottom: 64px; } }
