:root {
    color-scheme: light;
    --px-bg: #cce0eb;
    --px-window: #fffaf0;
    --px-border: #625555;
    --px-primary: #93bbf4;
    --px-primary-hover: #7ba8e8;
    --px-error: #e78282;
    --px-error-hover: #d26a6a;
    --px-success: #a7d995;
    --px-warning: #fce28b;
    --px-shadow: #c5baba;
    --px-muted: #817373;
    font-family: 'Zpix', 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 20px;
    background: var(--px-bg);
    color: var(--px-border);
    font-size: 12px;
    image-rendering: pixelated;
}
button, input, select, textarea { font: inherit; }

.hall-shell {
    width: min(1120px, 100%);
    margin: 0 auto 28px;
    padding: 4px;
    background: var(--px-window);
    border: 4px solid var(--px-border);
    box-shadow: -4px 0 var(--px-border), 0 -4px var(--px-border),
        4px 0 var(--px-border), 0 4px var(--px-border),
        inset -4px -4px var(--px-shadow);
}
.embedded-view {
    padding: 0;
    background: var(--px-bg);
}
.embedded-view .hall-shell {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: var(--px-bg);
}
.embedded-view .hall-shell > .window-header { display: none; }

.window-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: -4px -4px 10px;
    padding: 5px 10px;
    background: var(--px-border);
    color: var(--px-window);
    font-size: 10px;
    line-height: 1.5;
}
.hall-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 12px 12px;
    border-bottom: 4px solid var(--px-border);
}
.hall-header h1, h2, p { margin-top: 0; }
.hall-header h1 { margin-bottom: 6px; font-size: 18px; }
h2 { margin-bottom: 5px; font-size: 13px; }
.muted { color: var(--px-muted); font-size: 10px; line-height: 1.6; }
.eyebrow {
    margin-bottom: 5px;
    color: #5d8aa8;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}
.header-actions, .form-actions, .copy-row { display: flex; align-items: center; gap: 8px; }

.button {
    padding: 5px 8px;
    border: 3px solid var(--px-border);
    background: white;
    box-shadow: inset -4px -4px var(--px-shadow);
    color: var(--px-border);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.button:hover { filter: brightness(.98); }
.button:active { transform: translate(2px, 2px); box-shadow: inset 4px 4px var(--px-shadow); }
.button.primary { background: var(--px-primary); color: white; box-shadow: inset -4px -4px var(--px-primary-hover); }
.button.secondary { background: #fff; }
.button.danger { background: var(--px-error); color: white; box-shadow: inset -4px -4px var(--px-error-hover); }

.panel {
    margin: 10px 8px 0;
    padding: 10px;
    background: var(--px-window);
    border: 3px solid var(--px-border);
    box-shadow: inset -4px -4px var(--px-shadow);
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.path-label { max-width: 50%; overflow: hidden; color: var(--px-muted); font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.inline-form, .form-grid { display: grid; gap: 8px; }
.inline-form { grid-template-columns: minmax(180px, 1fr) 150px auto; align-items: end; }
.invite-form { grid-template-columns: minmax(180px, 1fr) 150px auto; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 4px; color: var(--px-border); font-size: 9px; font-weight: 800; }
label.full, .full { grid-column: 1 / -1; }
input, select, textarea {
    width: 100%;
    padding: 5px 7px;
    border: 3px solid var(--px-border);
    border-radius: 0;
    background: white;
    color: var(--px-border);
    outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { background: #fdf5e6; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.credential {
    margin-top: 10px;
    padding: 9px;
    border: 3px dashed #8064a8;
    background: #f8f3ff;
}
.credential input { flex: 1; min-width: 0; }
.warning { color: #9a5c18; font-size: 9px; font-weight: 800; line-height: 1.55; }
.count-badge { min-width: 24px; padding: 3px 6px; border: 3px solid var(--px-border); background: white; text-align: center; font-size: 10px; font-weight: 800; }
.records { display: grid; gap: 7px; }
.records.empty { color: var(--px-muted); font-size: 10px; }
.record {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border: 3px solid var(--px-border);
    background: white;
    box-shadow: inset -4px -4px var(--px-shadow);
}
.record-main { min-width: 180px; flex: 1; }
.record-title { margin-bottom: 4px; font-size: 10px; font-weight: 900; }
.record-meta { color: var(--px-muted); font-size: 9px; line-height: 1.55; }
.record-actions { display: flex; gap: 8px; }
.status { display: inline-block; padding: 2px 5px; border: 2px solid var(--px-border); background: white; color: var(--px-border); font-size: 8px; font-weight: 900; }
.status.pending { border-color: #a57922; background: var(--px-warning); color: #704e16; }
.status.bound { border-color: #628b55; background: var(--px-success); color: #31562a; }
.status.disabled, .status.rejected { border-color: #a85858; background: #f8caca; color: #7d2929; }
.notice { margin: 10px 8px 0; padding: 8px 10px; border: 3px solid #a57922; background: #fff7cf; color: #704e16; font-size: 9px; font-weight: 800; line-height: 1.55; }
.notice.error { border-color: #a85858; background: #f8caca; color: #7d2929; }
.result { margin: 10px 0 0; padding: 8px; border: 3px solid #628b55; background: #e6f5df; color: #31562a; font-size: 9px; font-weight: 800; line-height: 1.55; }
.connected-table-wrap { overflow-x: auto; border: 3px solid var(--px-border); background: white; }
.connected-table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; font-size: 9px; }
.connected-table th { padding: 7px; border-right: 3px solid var(--px-border); border-bottom: 3px solid var(--px-border); background: #fdf5e6; font-weight: 900; white-space: nowrap; }
.connected-table th:last-child { border-right: 0; }
.connected-table td { padding: 7px; border-right: 2px dashed var(--px-shadow); border-bottom: 2px dashed var(--px-shadow); vertical-align: middle; }
.connected-table td:last-child { border-right: 0; }
.connected-table tr:last-child td { border-bottom: 0; }
.connected-node-name { font-size: 10px; font-weight: 900; }
.connected-node-id { margin-top: 3px; color: var(--px-muted); font-size: 8px; overflow-wrap: anywhere; }
.connected-meta { color: var(--px-muted); line-height: 1.55; overflow-wrap: anywhere; }
.connected-actions { width: 72px; text-align: center; white-space: nowrap; }
.connected-actions .button { padding: 4px 6px; font-size: 9px; }
.connected-empty { padding: 18px !important; border: 0 !important; color: var(--px-muted); text-align: center; font-size: 10px; font-weight: 800; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
    body { padding: 10px; }
    .hall-shell { width: 100%; }
    .window-header { font-size: 9px; }
    .hall-header { display: block; padding: 9px 10px 11px; }
    .header-actions { margin-top: 15px; }
    .form-grid, .inline-form, .invite-form { grid-template-columns: 1fr; }
    label.full, .full { grid-column: auto; }
    .path-label { max-width: 100%; }
    .copy-row { align-items: stretch; flex-direction: column; }
    .panel, .notice { margin-left: 4px; margin-right: 4px; }
}
