:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #666666;
    --border: #d8d8d8;
    --rule: #efefef;
    --code-bg: #f8f8f8;
    --font-mono: SF Mono, Fira Code, Consolas, monospace;
    --hl-primary: rgba(59, 130, 246, 0.13);
    --hl-success: rgba(16, 185, 129, 0.13);
    --success-color: #10b981;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    font-size: 14px;
    padding: 2rem 1rem;
}

.container {
    max-width: 520px;
    margin: 0 auto;
}

.session-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label, .display-label, .section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
}

select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    outline: none;
    border-radius: 0;
}

select:focus-visible, input[type="number"]:focus-visible, input[type="text"]:focus-visible {
    border-color: var(--text);
    outline: 2px solid var(--text);
    outline-offset: -1px;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-primary:hover {
    background: #333333;
    border-color: #333333;
}

.confirm-btn {
    padding: 0.6rem 1rem;
    background: #f4f4f5;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.confirm-btn:hover {
    background: #e4e4e7;
    color: var(--text);
}

.confirm-btn.flash-success {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: var(--success-color) !important;
    color: var(--success-color) !important;
    transition: none !important;
}

.small-confirm-btn {
    min-height: 28px;
    padding: 0.2rem 0.6rem;
    background: #f4f4f5;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.small-confirm-btn:hover {
    background: #e4e4e7;
    color: var(--text);
}

.small-confirm-btn.flash-success {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: var(--success-color) !important;
    color: var(--success-color) !important;
    transition: none !important;
}

button:disabled, .btn-primary:disabled, .confirm-btn:disabled, .small-confirm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Chat Window Box */
.chat-window {
    height: 340px;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: var(--font-mono);
}

.chat-message {
    padding: 0.5rem 0.6rem;
    background: var(--code-bg);
    border-left: 3px solid var(--text);
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message.self {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.06);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 11px;
}

.msg-author {
    font-weight: 700;
    color: var(--text);
}

.msg-time {
    color: var(--muted);
    font-size: 10px;
}

.msg-body {
    color: var(--text);
    white-space: pre-wrap;
}

.empty-chat-notice {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    margin: auto 0;
    font-family: var(--font-mono);
}

/* Connection Status Badge */
.status-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.status-badge.connecting,
.status-badge.reconnecting {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --text: #eeeeee;
        --muted: #a0a0a0;
        --border: #333333;
        --rule: #222222;
        --code-bg: #1a1a1a;
    }

    select, input[type="number"], input[type="text"] {
        background: #181818;
    }

    .btn-primary {
        background: #eeeeee;
        color: #111111;
        border-color: #eeeeee;
    }

    .btn-primary:hover {
        background: #cccccc;
        border-color: #cccccc;
    }

    .confirm-btn, .small-confirm-btn {
        background: #222222;
        color: var(--muted);
        border-color: var(--border);
    }

    .confirm-btn:hover, .small-confirm-btn:hover {
        background: #333333;
        color: var(--text);
    }

    .chat-window {
        background: #141414;
    }

    .chat-message {
        background: #1e1e1e;
        border-left-color: #eeeeee;
    }

    .chat-message.self {
        border-left-color: #60a5fa;
        background: rgba(96, 165, 250, 0.12);
    }
}

/* ==========================================================================
   High-Accessibility Mode for Mom (Low Vision Optimizations)
   ========================================================================== */
body.accessible-mode {
    font-size: 18px;
}

body.accessible-mode .container {
    max-width: 680px;
}

body.accessible-mode select,
body.accessible-mode input[type="text"],
body.accessible-mode input[type="number"] {
    font-size: 18px;
    padding: 0.85rem 1rem;
    border-width: 2px;
}

body.accessible-mode .btn-primary {
    font-size: 16px;
    padding: 0.95rem 1.25rem;
    border-width: 2px;
    min-height: 50px;
}

body.accessible-mode .confirm-btn,
body.accessible-mode .small-confirm-btn {
    font-size: 15px;
    padding: 0.75rem 1.1rem;
    min-height: 44px;
    border-width: 2px;
}

body.accessible-mode .chat-window {
    height: 420px;
    padding: 1rem;
    border-width: 2px;
    gap: 0.85rem;
}

body.accessible-mode .chat-message {
    padding: 0.85rem 1rem;
    font-size: 18px;
    line-height: 1.5;
    border-left-width: 5px;
}

body.accessible-mode .msg-header {
    font-size: 14px;
    margin-bottom: 0.4rem;
}

body.accessible-mode .msg-author {
    font-size: 15px;
    font-weight: 800;
}

body.accessible-mode .msg-time {
    font-size: 13px;
    font-weight: 600;
}

body.accessible-mode .msg-body {
    font-size: 18px;
}

body.accessible-mode .status-badge {
    font-size: 13px;
    padding: 4px 10px;
    font-weight: 800;
}

body.accessible-mode label,
body.accessible-mode .display-label,
body.accessible-mode .section-title {
    font-size: 14px;
    letter-spacing: 0.08em;
}


