:root {
    --bg-color: #0000A8;
    --text-color: #C0C0C0;
    --status-bg-color: #000080;
    --status-text-color: #FFFF00;
    --font-family: 'IBM Plex Mono', monospace;
    --font-size: 16px;
    --letter-spacing: 0px;
    --line-spacing: 1.5;
}
body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}
.ws-container {
    border: 3px solid var(--status-bg-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}
.ws-status-bar, .ws-menu-bar, .ws-ruler {
    background-color: var(--status-bg-color);
    flex-shrink: 0;
    padding: 2px 8px;
    white-space: pre;
}
.ws-status-bar {
    color: var(--status-text-color);
    font-weight: 500;
}
.ws-menu-bar, .ws-ruler {
    color: var(--text-color);
}
.ws-editor {
    flex-grow: 1;
    padding: 0;
    overflow: hidden;
}
.ws-editor textarea {
    background-color: transparent;
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
    resize: none;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    letter-spacing: var(--letter-spacing);
    line-height: var(--line-spacing);
    caret-color: var(--status-text-color);
    padding: 0 8px;
}
.ws-modal {
    background-color: var(--bg-color); /* MODIFIED: Uses theme variable */
    border: 2px solid var(--status-text-color);
    color: var(--text-color);
}
.ws-modal:focus {
    outline: none;
}
.ws-modal-title {
    color: var(--status-text-color);
}
.ws-modal th {
    text-align: left;
    padding-right: 2rem;
    color: var(--status-text-color);
}
.ws-modal td, .ws-modal li {
     color: var(--text-color);
}
.ws-input {
    background-color: var(--text-color); /* MODIFIED: Uses theme variable */
    color: var(--bg-color); /* MODIFIED: Uses theme variable */
    border: 1px solid var(--status-text-color);
    font-family: 'IBM Plex Mono', monospace;
    padding: 4px;
}
.ws-button {
    color: var(--status-text-color);
    padding: 10px 16px; /* MODIFIED: Increased padding */
    min-height: 44px; /* ADDED: Minimum touch target size */
    border: 1px solid transparent;
}
.ws-button:focus, .ws-input:focus, input[type=checkbox]:focus {
    outline: 2px solid var(--status-text-color);
    background-color: var(--status-text-color);
    color: var(--status-bg-color);
}

/* CRT Effect */
@keyframes flicker { 0% { opacity: 0.25; } 50% { opacity: 0.5; } 100% { opacity: 0.25; } }
.crt-effect::after {
    content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(18, 16, 16, 0.1); opacity: 0; z-index: 100; pointer-events: none;
    animation: flicker 0.15s infinite;
}
.crt-effect::before {
    content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100; background-size: 100% 2px, 3px 100%; pointer-events: none;
}

/* Print-specific styles */
@media print {
    body * { visibility: hidden; }
    #print-area, #print-area * { visibility: visible; }
    #print-area {
        position: absolute; left: 0; top: 0; width: 100%; font-family: 'Times New Roman', serif;
        color: black; padding: 1in; white-space: pre-wrap;
    }
    .print-page-break { page-break-after: always; }
}

/* ADDED: Mobile & Tablet Responsiveness */
@media (max-width: 768px) {
    .ws-menu-bar { display: none; }
    .ws-status-bar { flex-wrap: wrap; font-size: 12px; }
    #cursor-pos { order: 1; }
    #message-area { width: 100%; order: 2; text-align: left; }
    .ws-modal .grid { grid-template-columns: 1fr; }
}