/* Everyone, Bank, Data Stores, the All data tab, the entry editor and the field tree. */

/* ---------- stat tiles ---------- */
.dt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dt-tiles:empty { display: none; }
.dt-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: var(--lift); }
.dt-tile .label { font: 500 11px/1.3 var(--display); text-transform: uppercase; letter-spacing: .13em; color: var(--faint); }
.dt-tile b { font: 500 26px/1.15 var(--display); letter-spacing: .005em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-tile b .sk.line { margin: 8px 0 6px; height: 14px; }
.dt-tile.accent { border-color: rgba(232, 112, 26, .3); background: linear-gradient(180deg, rgba(232, 112, 26, .09), rgba(232, 112, 26, 0) 70%), var(--panel); }
.dt-tile.accent b { color: var(--accent-hi); }

.badge.amber { color: var(--amber); background: var(--amber-dim); border-color: rgba(235, 194, 79, .24); }
.badge.amber::before { background: var(--amber); }
.btn.danger-text { color: var(--red); }
.btn.danger-text:hover { background: var(--red-dim); }

/* ---------- Everyone / Bank tables ---------- */
.ev-tools { flex-wrap: wrap; gap: 10px; }
.ev-tools .input { max-width: 300px; flex: 1; min-width: 180px; height: 34px; }
table.t.ev tbody tr, table.t.bk tbody tr { cursor: default; }
table.t.ev tbody tr[data-row] { cursor: pointer; }
table.t.ev tbody tr:hover, table.t.bk tbody tr:hover { background: var(--panel-2); }
.ev-who { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 260px; }
.ev-who .av { width: 34px; height: 34px; flex: none; }
.ev-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ev-name .faint { font-size: 11px; }
.ev-chars { display: flex; flex-wrap: wrap; gap: 6px; max-width: 420px; }
.ev-char { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 3px 9px 3px 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); font-size: 12px; transition: border-color .15s, background .15s; }
.ev-char:hover { border-color: var(--accent); background: var(--raise); }
.ev-char b { font-weight: 600; color: var(--green); }
.ev-char.next { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.ev-slot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--raise); color: var(--sub); font: 600 10px/1 var(--mono); flex: none; }
.ev-acts { white-space: nowrap; width: 1%; }
.ev-acts .btn + .btn { margin-left: 2px; }
.ev-since { font-size: 11px; }
table.t.ev td:nth-child(2) { width: 1%; }
.ev-pager { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ev-pager:empty { display: none; }
.bk-bal { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 120px; }
.bk-bal i { display: block; height: 3px; border-radius: 2px; background: var(--green); opacity: .7; align-self: flex-end; }

/* ---------- staff roles, sign-in, chat, accounts ---------- */
.perm-hidden { display: none !important; }
.role-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-opt { position: relative; cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt span { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--field); color: var(--sub); font-weight: 600; transition: border-color .15s, background .15s, color .15s, transform .12s; }
.role-opt span svg { width: 16px; height: 16px; color: var(--faint); transition: color .15s; }
.role-opt:hover span { border-color: var(--line-3); color: var(--text); }
.role-opt:active span { transform: scale(.98); }
.role-opt input:checked + span { border-color: var(--accent); background: var(--accent-dim); color: var(--text); box-shadow: inset 0 0 0 1px rgba(232, 112, 26, .35); }
.role-opt input:checked + span svg { color: var(--accent-hi); }
.role-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }
.role-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font: 600 10.5px/1.6 var(--sans); text-transform: capitalize; background: var(--raise); color: var(--sub); vertical-align: 1px; white-space: nowrap; }
.role-chip.role-moderator, .role-moderator .role-chip { background: rgba(91, 197, 160, .13); color: #73D1AE; }
.role-chip.role-administrator, .role-administrator .role-chip { background: rgba(232, 112, 26, .15); color: #F29447; }
.role-chip.role-manager, .role-manager .role-chip { background: rgba(134, 175, 214, .14); color: #9CC0E2; }
.role-chip.role-owner, .role-owner .role-chip { background: rgba(235, 194, 79, .15); color: #EBC24F; }
.readonly form .btn, .readonly [data-quick], .readonly [data-zero], .readonly .btn[form], .readonly .btn.primary, .readonly .btn.danger { display: none !important; }
.readonly input, .readonly select, .readonly textarea { pointer-events: none; }
.readonly .money-form { display: none !important; }
.sc { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.sc-room { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 64px); min-height: 420px; }
.sc-list { flex: 1; overflow: auto; padding: 10px 16px; }
.sc-day { text-align: center; color: var(--faint); font-size: 11px; margin: 14px 0 6px; }
.sc-msg { position: relative; padding: 1px 34px 1px 0; }
.sc-msg.head { margin-top: 10px; }
.sc-who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.sc-who .faint { font-size: 11px; }
.sc-text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.sc-del { all: unset; cursor: pointer; position: absolute; right: 4px; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--faint); opacity: 0; }
.sc-msg:hover .sc-del { opacity: 1; }
.sc-del:hover { background: var(--red-dim); color: var(--red); }
.sc-send { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.sc-send textarea { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 9px 12px; font: inherit; line-height: 1.4; }
.sc-on { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-width: 0; }
.sc-on i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.st-form { display: grid; gap: 12px; }
.st-form .field { display: grid; gap: 4px; }
.st-me { display: grid; gap: 8px; }
.st-pw { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--field); border: 1px dashed var(--line-2); font-size: 16px; letter-spacing: .04em; user-select: all; }
table.t.st select.input { height: 30px; max-width: 170px; }
@media (max-width: 860px) { .sc { grid-template-columns: minmax(0, 1fr); } .sc-side { display: none; } }

/* ---------- Gram ---------- */
.gr-tick { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; flex: none; }
.gr-handle { font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.gr-acct { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.gr-acct .faint { font-size: 11.5px; }
.gr-sub { font-size: 11px; }
.gr-switch { all: unset; cursor: pointer; position: relative; display: inline-block; width: 36px; height: 21px; border-radius: 999px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .15s; flex: none; }
.gr-switch i { position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.gr-switch.on { background: var(--accent); box-shadow: none; }
.gr-switch.on i { transform: translateX(15px); }
.gr-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 24px; align-items: center; padding: 18px 20px; margin-bottom: 16px; }
.gr-big { font: 700 22px/1.2 var(--display, var(--sans)); }
.gr-big .gr-tick { width: 20px; height: 20px; margin-left: 6px; }
.gr-bio { margin-top: 6px; white-space: pre-line; color: var(--sub); max-width: 520px; }
.gr-stats { display: flex; gap: 22px; text-align: center; }
.gr-stats b { display: block; font: 700 18px/1.2 var(--display, var(--sans)); }
.gr-stats span { color: var(--faint); font-size: 11.5px; }
.gr-owner { display: flex; align-items: center; gap: 10px; }
.gr-form { display: grid; gap: 12px; }
.gr-form .field { display: grid; gap: 4px; }
.gr-form textarea.input { resize: vertical; min-height: 64px; padding: 8px 10px; font: inherit; }
.gr-toggles { display: flex; gap: 20px; }
.gr-tog { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.gr-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-add { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.gr-add .input { flex: 1; min-width: 0; height: 32px; }
.gr-list { max-height: 420px; overflow: auto; padding: 4px 6px; }
.gr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.gr-row:hover { background: var(--panel-2); }
.gr-more { padding: 8px; font-size: 11.5px; text-align: center; }
.gr-danger { margin-top: 16px; border-color: color-mix(in srgb, var(--red) 30%, var(--line)); }
@media (max-width: 860px) { .gr-head { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Data Stores ---------- */
.ds { display: grid; grid-template-columns: 230px 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ds-col { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 40px); display: flex; flex-direction: column; min-width: 0; }
.ds-filter { padding: 10px 12px 6px; }
.ds-filter .input { width: 100%; height: 32px; }
.ds-new { display: flex; gap: 6px; padding: 4px 12px 8px; }
.ds-new .input { flex: 1; height: 30px; min-width: 0; }
.ds-new[hidden] { display: none; }
.ds-list { overflow: auto; padding: 4px 6px 10px; display: flex; flex-direction: column; gap: 1px; min-height: 80px; }
.ds-list .empty { padding: 24px 10px; }
.ds-list .btn.block { margin-top: 8px; }
.ds-item { all: unset; box-sizing: border-box; display: flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 6px; color: var(--sub); cursor: pointer; font-size: 12.5px; min-width: 0; }
.ds-item.mono { font-family: var(--mono); font-size: 11.5px; }
.ds-item:hover { background: var(--panel-2); color: var(--text); }
.ds-item.on { background: var(--accent-dim, var(--blue-dim)); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.ds-edit { min-width: 0; }
.ds-edit > .empty, .ae-edit > .empty { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 60px 20px; }

/* ---------- All data tab ---------- */
.ae { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.ae-side { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 40px); display: flex; flex-direction: column; }
.ae-list { overflow: auto; padding: 6px 6px 12px; }
.ae-group + .ae-group { margin-top: 10px; }
.ae-gname { padding: 6px 10px 4px; font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.ae-item { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label size" "key key"; gap: 1px 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.ae-item:hover { background: var(--panel-2); }
.ae-item.on { background: var(--accent-dim, var(--blue-dim)); box-shadow: inset 2px 0 0 var(--accent); }
.ae-item.missing { opacity: .55; }
.ae-label { grid-area: label; font-weight: 600; font-size: 12.5px; }
.ae-key { grid-area: key; font-size: 10.5px; color: var(--faint); }
.ae-size { grid-area: size; font-size: 11px; }
.ae-notes { margin: 12px 8px 0; padding: 10px; border-radius: 6px; background: var(--amber-dim); color: var(--amber); font-size: 11.5px; display: grid; gap: 4px; }
.ae-slot { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; border-radius: 4px; background: var(--raise); color: var(--sub); font: 600 10px/1 var(--mono); vertical-align: 1px; }

/* ---------- entry editor ---------- */
.ee-head { gap: 10px; }
.ee-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ee-title b { font-size: 13.5px; }
.ee-title .faint { font-size: 11px; }
.ee-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ee-note { margin: 12px 14px 0; }
.ee-body { padding: 10px 6px 12px; max-height: calc(100vh - var(--top) - 220px); min-height: 220px; overflow: auto; }
.ee-raw { width: 100%; min-height: 460px; display: block; margin: 0; }
.ee-more { border-top: 1px solid var(--line); }
.ee-more > summary { cursor: pointer; padding: 10px 14px; color: var(--sub); font-size: 12px; list-style: none; }
.ee-more > summary::-webkit-details-marker { display: none; }
.ee-more > summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; vertical-align: 1px; }
.ee-more[open] > summary::before { transform: rotate(45deg); }
.ee-meta { padding: 0 14px 10px; display: grid; gap: 4px; }
.ee-meta .kv b { word-break: break-all; font-weight: 500; font-size: 11.5px; }

/* ---------- field tree ---------- */
.jt { font-size: 12.5px; }
.jt-row { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 8px 2px calc(8px + var(--d) * 18px); border-radius: 6px; position: relative; }
.jt-row:hover { background: var(--panel-2); }
.jt-row.box > .jt-key { cursor: pointer; }
.jt-caret { all: unset; flex: none; width: 16px; height: 16px; display: grid; place-items: center; cursor: pointer; color: var(--faint); }
.jt-caret::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .12s; }
.jt-caret.open::before { transform: rotate(45deg); }
.jt-caret.none::before { display: none; }
.jt-caret:hover { color: var(--text); }
.jt-key { flex: 0 1 auto; min-width: 60px; max-width: 40%; font-family: var(--mono); font-size: 11.5px; color: #D2B48C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jt-key.idx { color: var(--faint); min-width: 24px; }
.jt-val { flex: 1; min-width: 0; display: flex; align-items: center; }
.jt-in { width: 100%; height: 26px; padding: 0 8px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: var(--green); font: 12px/1 var(--mono); outline: none; transition: border-color .12s, background .12s; }
.jt-in.num { color: var(--amber); }
.jt-in:hover { border-color: var(--line-2); }
.jt-in:focus { border-color: var(--accent); background: var(--field); }
.jt-in.bad { border-color: var(--red); background: var(--red-dim); }
.jt-adding .jt-in { color: var(--text); max-width: 260px; border-color: var(--line-2); background: var(--field); }
.jt-bool { all: unset; cursor: pointer; padding: 2px 10px; border-radius: 999px; font: 600 11px/1.5 var(--mono); background: var(--raise); color: var(--sub); }
.jt-bool.on { background: var(--green-dim); color: var(--green); }
.jt-null { font: 11.5px var(--mono); color: var(--faint); padding: 0 8px; }
.jt-sum { font-size: 11.5px; color: var(--faint); padding: 0 8px; }
.jt-acts { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .12s; }
.jt-row:hover > .jt-acts, .jt-row:focus-within > .jt-acts { opacity: 1; }
.jt-act { all: unset; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--sub); font-size: 15px; line-height: 1; }
.jt-act:hover { background: var(--raise); color: var(--text); }
.jt-act.del:hover { background: var(--red-dim); color: var(--red); }
.jt-type { height: 22px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--field); color: var(--sub); font: 11px var(--sans); }
.jt-empty { min-height: 24px; font-size: 11.5px; }

@media (max-width: 1180px) {
  .ds { grid-template-columns: 200px minmax(0, 1fr); }
  .ds-edit { grid-column: 1 / -1; }
  .ds-col { position: static; max-height: 420px; }
}
/* ---------- the panel around the player's phone ---------- */
.page .ph-wrap { overflow-x: clip; }
.page .ph-side { top: calc(var(--top) + 14px); }
.ph-side .panel-head h3 { display: flex; align-items: center; gap: 8px; }

@media (max-width: 520px) {
  .page .ph-wrap > .ph-col { padding-left: 0; padding-right: 0; margin: 0 auto; }
  .page .ph-side { min-width: 0; max-width: none; }
  .dt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dt-tile { padding: 12px 13px; }
  .dt-tile b { font-size: 21px; }
}
@media (max-width: 860px) {
  .ds, .ae { grid-template-columns: minmax(0, 1fr); }
  .ae-side { position: static; max-height: 360px; }
  .jt-acts { opacity: 1; }
  .ev-tools .input { max-width: none; }
}
