/* ========================================
   MINIMAL MONOCHROME DESIGN
   Inspired by wav.ninja - VT323 Retro Style
   ======================================== */

@font-face {
    font-family: 'VT323';
    src: url('fonts/VT323-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Initially hidden elements (no inline style attributes: the CSP forbids them).
   ui.js mirrors this into element.style on load, which is what the view code toggles. */
[data-hidden] {
    display: none;
}

/* Without scripting nothing leaves the start view (index.html): the main menu is shown instead,
   as before there was a start view */
@media (scripting: none) {
    #startView {
        display: none;
    }

    #mainMenu {
        display: block;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --fg: #000000;
    --border: #000000;
    --muted: #666666;
    --hover-bg: #000000;
    --hover-fg: #ffffff;
    /* One red for everything destructive or failed: deep enough to sit with the monochrome UI */
    --danger: #cc0000;
    --danger-bg: #fff5f5;
}

body {
    font-family: 'VT323', monospace;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    line-height: 1.4;
    font-size: 18px;
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
    width: 100%;
    max-width: 500px;
}

/* ========================================
   MAIN MENU
   ======================================== */

.main-menu {
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

/* The brand line alone while a stored identity is resumed: still, so a quick answer does not flicker */
.start-view {
    text-align: center;
}

.main-buttons {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-btn {
    width: 100%;
    max-width: 300px;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   LOGIN & REGISTER CONTAINERS
   ======================================== */

.login-container,
.register-container,
.robot-container {
    text-align: center;
    animation: slideInFromLeft 0.5s ease;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   LOGIN SECTION
   ======================================== */

.login-container {
    text-align: center;
}

.login-container h1 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: lowercase;
    margin-bottom: 16px;
}

.tagline {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 48px;
}

.login-info {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 20px;
    text-transform: lowercase;
}

.login-form,
.register-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-input-group {
    display: flex;
    gap: 32px; /* Increased gap to keep login button outside inner zone (18px) */
}

.login-input-group input {
    flex: 1;
}

.login-input-group button {
    min-width: 100px;
}

/* ========================================
   INPUTS & TEXTAREA
   ======================================== */

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 18px;
    outline: none;
    transition: border-color 0.2s ease;
    resize: none;
    box-sizing: border-box;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--fg);
}

/* Account Number Input with Eye Icon - NEVER changes size */
.account-number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.account-number-input-wrapper input,
.account-number-input-wrapper input[type="text"],
.account-number-input-wrapper input[type="password"] {
    width: 100%;
    height: 50px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 14px 45px 14px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.account-number-input-wrapper input:focus,
.account-number-input-wrapper input[type="text"]:focus,
.account-number-input-wrapper input[type="password"]:focus {
    border-color: var(--fg);
}

/* Eye icon base styles - zone animations in eye-hover-animation.css */

/* ========================================
   BUTTONS
   ======================================== */

button {
    padding: 14px 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.primary-btn {
    background: var(--fg);
    color: var(--bg);
}

.primary-btn:hover {
    background: var(--muted);
    border-color: var(--muted);
}

.secondary-btn {
    background: var(--bg);
    color: var(--fg);
}

.text-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--muted);
    margin-top: 16px;
    padding: 8px 12px;
    font-size: 14px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.text-btn:hover {
    color: var(--fg);
    background: rgba(0, 0, 0, 0.05);
    transform: none;
    box-shadow: none;
}

/* ========================================
   DIVIDER
   ======================================== */

.divider {
    font-size: 14px;
    color: var(--muted);
    margin: 8px 0;
    text-align: center;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
    opacity: 0.3;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* ========================================
   ACCOUNT NUMBER DISPLAY
   ======================================== */

.account-number-display {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    text-align: left;
}

.account-number-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: normal;
}

.account-number-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 16px;
}

.account-number-box code {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 2px;
    word-break: break-all;
    display: flex;
    align-items: center;
}

.copy-btn {
    min-width: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.copy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: none;
}

.account-number-warning {
    font-size: 14px;
    color: var(--danger);
    margin-bottom: 16px;
    line-height: 1.6;
    padding: 8px 12px;
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
}

.continue-btn {
    width: 100%;
    margin-top: 8px;
    background: var(--fg);
    color: var(--bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.continue-btn:hover:not(:disabled) {
    background: var(--muted);
    border-color: var(--muted);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.continue-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: none;
}

/* ========================================
   MESSAGES
   ======================================== */

.error {
    font-size: 14px;
    color: var(--danger);
    padding: 12px;
    border: 1px solid var(--danger);
    background: var(--danger-bg);
    margin: 0;
    text-align: center;
}

.error:empty {
    display: none;
}

.success {
    font-size: 14px;
    color: #008800;
    padding: 12px;
    border: 1px solid #008800;
    background: #f5fff5;
    margin: 0;
    text-align: center;
}

.success:empty {
    display: none;
}

/* ========================================
   APP CONTAINER
   ======================================== */

.app-container {
    text-align: center;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.brand-small {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: lowercase;
}

/* Header actions: plain text that takes a frame on hover, on one baseline */
#deleteIdentityBtn,
#logoutBtn {
    font-size: 16px;
    padding: 8px 16px;
    margin-top: 0;
    border: 1px solid transparent;
    box-shadow: none;
}

#deleteIdentityBtn {
    margin-right: 4px;
}

#logoutBtn:hover,
#logoutBtn:focus-visible {
    border-color: var(--border);
    color: var(--fg);
}

#deleteIdentityBtn:hover,
#deleteIdentityBtn:focus-visible {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}

/* ========================================
   COMPOSER
   ======================================== */

.composer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.composer textarea {
    flex: 1;
    padding: 16px;
    font-size: 18px;
    min-height: 54px;
    max-height: 140px;
}

.composer button {
    min-width: 54px;
    padding: 16px 24px;
    font-size: 24px;
}

/* ========================================
   LOGIN FOOTER
   ======================================== */

.login-footer {
    margin-top: 48px;
    font-size: 14px;
    color: var(--muted);
}

/* ========================================
   STATUS / ERROR PAGES
   ======================================== */

.status-page {
    text-align: center;
}

.status-content {
    margin-top: 40px;
}

.status-code {
    font-size: 64px;
    letter-spacing: 6px;
    margin-bottom: 8px;
}

.status-text {
    font-size: 22px;
    text-transform: lowercase;
    margin-bottom: 16px;
}

.status-description {
    font-size: 16px;
    color: var(--muted);
    max-width: 360px;
    margin: 0 auto 24px auto;
    line-height: 1.6;
}

.status-actions {
    margin-bottom: 32px;
}

.primary-link {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--fg);
    text-transform: lowercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.primary-link:hover {
    background: var(--hover-bg);
    color: var(--hover-fg);
}

/* ========================================
   LOADING & EMPTY
   ======================================== */

.loading {
    text-align: center;
    padding: 48px 0;
    color: var(--muted);
    font-size: 16px;
    text-transform: lowercase;
    letter-spacing: 1px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    body {
        padding: 24px 16px;
    }

    .login-container h1 {
        font-size: 36px;
    }

    .tagline {
        margin-bottom: 32px;
    }

    .login-info {
        font-size: 14px;
    }

    input[type="text"],
    button {
        font-size: 16px;
        padding: 12px 16px;
    }

    header {
        gap: 12px;
        padding-right: 48px; /* keep logout clear of the fixed logo */
    }

    /* The glyph alone identifies you on small screens; the name lives in its tooltip */
    .me-badge .aura-name {
        display: none;
    }

    .message-list {
        height: clamp(200px, calc(100vh - 360px), 560px);
    }

    .msg {
        max-width: 88%;
    }

    .composer-meta span:last-child {
        display: none;
    }

    .account-number-box {
        flex-direction: column;
    }

    .account-number-box code {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .copy-btn {
        width: 100%;
    }

    .account-number-warning {
        font-size: 13px;
    }
}

/* ========================================
   NOTIFICATION SYSTEM
   ======================================== */

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 15px 35px 15px 20px;
    margin-bottom: 10px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    position: relative;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.notification.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.notification.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.notification .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    color: inherit;
    opacity: 0.6;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}

.notification .close-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    transform: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        font-size: 14px;
        padding: 12px 15px;
    }
}
/* ========================================
   ADDITIONAL ENHANCEMENTS
   ======================================== */

/* App container animation */
.app-container {
    animation: fadeInUp 0.6s ease !important;
}

/* Enhanced composer styling */
.composer {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    gap: 0 !important;
    border: 1px solid var(--border) !important;
}

.composer:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

.composer textarea {
    border: none !important;
    background: transparent !important;
}

.composer textarea:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Action Buttons */
.action-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.action-btn:hover {
    color: var(--fg);
}

.action-btn.burn-btn:hover {
    color: var(--danger);
}

/* ========================================
   INLINE OPTIONS
   ======================================== */

.menu-opt {
    flex: 1;
    padding: 4px 8px;
    font-family: 'VT323', monospace;
    font-size: 13px;
    border: 1px solid var(--muted);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-opt:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.menu-opt.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* Empty Message */
.empty-message {
    text-align: center;
    color: var(--muted);
    padding: 40px;
    font-style: italic;
    list-style: none;
}
/* ========================================
   ELYRN — IDENTITY (AURA)
   ======================================== */

/* Key-derived 5x5 glyph: drawn at 5px, scaled up crisp */
.aura-glyph {
    width: 20px;
    height: 20px;
    padding: 2px;
    box-sizing: content-box;
    border: 1px solid var(--border);
    background: var(--bg);
    image-rendering: pixelated;
    flex-shrink: 0;
}

.aura-name {
    font-size: 18px;
    letter-spacing: 1px;
}

.aura-code {
    font-size: 14px;
    color: var(--muted);
}

.me-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
    color: var(--muted);
    cursor: default;
}

/* ========================================
   ELYRN — PAIRING
   ======================================== */

.pair-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.pair-actions button {
    flex: 1;
}

.pair-panel {
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
    animation: fadeInUp 0.3s ease;
}

.pair-panel .account-number-box code {
    font-size: 14px;
    letter-spacing: 1px;
}

.pair-hint {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.pair-panel .text-btn {
    margin-top: 4px;
    padding-left: 0;
}

/* Robot entrance: the explanation sits apart from the command below it */
.robot-gap {
    margin-bottom: 16px;
}

.join-input-group {
    display: flex;
    gap: 12px;
}

.join-input-group input {
    flex: 1;
    font-size: 16px;
    letter-spacing: 1px;
}

/* ========================================
   ELYRN — CONVERSATION LIST
   ======================================== */

.conversation-list {
    list-style: none;
    text-align: left;
    margin-bottom: 16px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.conversation-item:first-child {
    border-top: 1px solid var(--border);
}

.conversation-item:hover,
.conversation-item:focus {
    background: rgba(0, 0, 0, 0.04);
    padding-left: 10px;
    outline: none;
}

.unread-marker {
    margin-left: auto;
    font-size: 14px;
    color: var(--muted);
}

.conversation-item.unread .aura-name {
    font-weight: bold;
}

.conversation-item.unread .unread-marker {
    background: var(--fg);
    color: var(--bg);
    padding: 0 6px;
    letter-spacing: 1px;
}

/* ========================================
   ELYRN — CONVERSATION
   ======================================== */

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-view {
    text-align: left;
    animation: slideInFromRight 0.35s ease;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.chat-header .action-btn {
    font-size: 16px;
}

/* The actions stay together: on narrow screens they wrap as one group, right-aligned */
.chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.safety-number {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    font-size: 22px;
    letter-spacing: 3px;
    text-align: center;
}

.safety-number span {
    border: 1px solid var(--border);
    padding: 6px 0;
}

.burn-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--danger);
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
}

.burn-confirm span {
    flex: 1;
}

.burn-confirm .menu-opt {
    flex: 0 0 auto;
}

.menu-opt.burn-yes {
    border-color: var(--danger);
    color: var(--danger);
}

.menu-opt.burn-yes:hover {
    background: var(--danger);
    color: #ffffff;
}

.message-list {
    list-style: none;
    /* Header + chat header + composer stay on screen at any viewport height */
    height: clamp(200px, calc(100vh - 330px), 560px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 2px;
    scrollbar-width: thin;
}

/* Pages back through history; sits above the list so loading a page never moves it */
.earlier-opt {
    width: 100%;
    margin-bottom: 8px;
}

.earlier-opt:disabled {
    cursor: wait;
    opacity: 0.6;
}

.message-list .empty-message {
    margin: auto;
    padding: 0;
}

.msg {
    max-width: 78%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    font-size: 17px;
    line-height: 1.35;
    animation: messageIn 0.2s ease;
}

.msg.mine {
    align-self: flex-end;
    background: var(--fg);
    color: var(--bg);
}

.msg.theirs {
    align-self: flex-start;
    background: var(--bg);
}

.msg.broken {
    border-style: dashed;
    background: var(--danger-bg);
    color: var(--danger);
}

.msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-time {
    margin-top: 2px;
    font-size: 12px;
    text-align: right;
    opacity: 0.6;
}

.composer-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

/* ========================================
   ELYRN — VERIFICATION & INTEGRITY
   ======================================== */

.verified-mark {
    font-size: 14px;
    padding: 0 4px;
    border: 1px solid var(--border);
    line-height: 1.2;
}

.conversation-item .verified-mark {
    margin-left: 4px;
}

.verify-opt {
    margin-top: 12px;
}

.verify-opt.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.msg-gap {
    align-self: center;
    padding: 4px 10px;
    font-size: 13px;
    color: var(--danger);
    border: 1px dashed var(--danger);
    background: var(--danger-bg);
}

/* ========================================
   ELYRN — ROOMS
   ======================================== */

.pair-actions button {
    min-width: 0;
}

.room-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.room-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: var(--muted);
}

.room-form select {
    font-family: inherit;
    font-size: 16px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
}

.room-form button {
    margin-left: auto;
}

/* On narrow screens the actions move to their own line instead of squeezing the room's name */
.chat-header {
    flex-wrap: wrap;
    row-gap: 4px;
}

.chat-header .aura-name,
.room-meta {
    white-space: nowrap;
}

.member-list {
    list-style: none;
    margin-bottom: 12px;
}

.member-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.member-tag {
    font-size: 13px;
    color: var(--muted);
    border: 1px solid var(--muted);
    padding: 0 6px;
}

.member-item .menu-opt {
    flex: 0 0 auto;
}

.member-item .member-action {
    margin-left: auto;
}

.member-item .menu-opt:disabled {
    opacity: 0.6;
    cursor: default;
}

.member-broken {
    color: var(--danger);
    font-size: 14px;
}

/* Glyph, name and code on one line; wraps rather than widening the bubble */
.msg-sender {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    margin-bottom: 2px;
    font-size: 13px;
    letter-spacing: 1px;
    opacity: 0.7;
}

.msg-sender .aura-glyph {
    width: 10px;
    height: 10px;
    padding: 1px;
}

.msg-sender .aura-name,
.msg-sender .aura-code {
    font-size: inherit;
    letter-spacing: inherit;
}

/* Two keys under one name: one may be a ground lookalike */
.member-tag.lookalike-tag {
    color: var(--danger);
    border-color: var(--danger);
}

/* ========================================
   THE OTHER DOOR (robot side)
   Theatre in front of the robot entrance, not a gate (js/robot-door.js). One class on <body>
   swaps the palette; every view of the robot side then reads its colours from the same tokens.
   ======================================== */

body {
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.robot-side {
    --bg: #000000;
    --fg: #ffffff;
    --border: #ffffff;
    --muted: #b3b3b3;
    --hover-bg: #ffffff;
    --hover-fg: #000000;
    --danger: #ff6b6b;
    --danger-bg: #1a0000;
}

@media (prefers-reduced-motion: reduce) {
    body {
        transition: none;
    }
}

/* Thin ornaments: a hand-drawn line on the human side, a circuit trace on the robot side */
.door-ornament {
    display: block;
    max-width: 100%;
    height: auto;
    margin: -24px auto 8px auto;
    color: var(--fg);
}

/* Main menu: the robot door is the inverted slab, stitched in the page's colour */
.door-slot {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.door-btn {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
    outline: 1px dashed var(--bg);
    outline-offset: -6px;
}

.door-btn:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
}

.door-caption {
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--muted);
}

/* Robot side panels carry the same stitching, in white */
.robot-side .door-panel {
    outline: 1px dashed var(--fg);
    outline-offset: -6px;
}

.door-line {
    font-size: 20px;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.door-measurements {
    list-style: none;
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 8px;
}

.door-measurements li::before {
    content: '· ';
}

.door-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.door-task {
    display: block;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.door-aside {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    color: var(--fg);
}

/* Legible on black: a white focus ring everywhere (inputs drop theirs above), no dark shadows,
   and a hover tint that shows on black */
.robot-side :focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
}

.robot-side button,
.robot-side button:hover,
.robot-side button:active {
    box-shadow: none;
}

.robot-side .text-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* The circuit trace's <symbol> lives in a zero-size svg that takes no room */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Headings that take focus when a door screen opens (tabindex="-1"): no ring around text */
#doorVerdictHeading:focus,
#robotGreeting:focus {
    outline: none;
}

/* Code boxes on black: white text in a white 2px frame (account-number-animation.css gives the
   revealed code dark shadows) */
.robot-side .account-number-box code {
    color: var(--fg);
    background: transparent;
    border: 2px solid var(--fg);
    box-shadow: none;
}

/* The copy button reads as a button on black: a 2px frame that fills white on hover */
.robot-side .copy-btn {
    border: 2px solid var(--fg);
}

.robot-side .copy-btn:hover:not(:disabled) {
    background: var(--fg);
    color: var(--bg);
}

/* Toasts keep their place (top right, as on the white side) but take the robot side's colours:
   black, white text, a frame in the toast's own colour */
.robot-side .notification,
.robot-side .notification.success,
.robot-side .notification.error,
.robot-side .notification.warning {
    background: var(--bg);
    color: var(--fg);
    box-shadow: none;
}

.robot-side .notification.success {
    border-color: #5fd37a;
}

.robot-side .notification.error {
    border-color: var(--danger);
}

.robot-side .notification.warning {
    border-color: #ffd34d;
}

.robot-side .notification .close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}
