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

/* Improve text selection */
::selection {
    background-color: #00ff0044;
    color: #ffffff;
}

::-moz-selection {
    background-color: #00ff0044;
    color: #ffffff;
}

/* Allow text selection on all content */
#output, .output-line, .response {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #1e1e1e;
    color: #00ff00;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

#terminal {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#output {
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: calc(100% - 30px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.output-line {
    margin-bottom: 5px;
}

.output-line .prompt {
    color: #00ff00;
}

.output-line .user-input {
    color: #ffffff;
}

.output-line .response {
    color: #cccccc;
}

/* Suggested questions styling */
.suggested-question {
    color: #00aaff;
    transition: all 0.2s ease;
    padding: 4px 0;
}

.suggested-question:hover {
    color: #00ff00;
    background-color: #00ff0011;
    padding-left: 8px;
}

.question-number {
    color: #00ff00;
    font-weight: bold;
    margin-right: 4px;
}

.question-text {
    color: inherit;
}

/* Article reference links styling */
.article-ref {
    color: #00aaff;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.article-ref:hover {
    color: #00ff00;
}

/* Language switcher links */
.lang-link {
    color: #00aaff;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 1px dotted #00aaff;
}

.lang-link:hover {
    color: #00ff00;
    border-bottom-color: #00ff00;
}

#input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #00ff00;
    margin-right: 8px;
    font-weight: bold;
}

#input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: inherit;
    caret-color: #00ff00;
}

/* Responsive typography - Desktop first */
@media (min-width: 1200px) {
    body {
        font-size: 13px; /* Smaller on large screens for more content */
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body {
        font-size: 14px; /* Medium screens (tablets, small laptops) */
    }
}

/* Mobile responsive */
@media (max-width: 767px) {
    body {
        font-size: 16px; /* Larger on mobile for readability */
        line-height: 1.7;
    }

    #terminal {
        padding: 12px;
    }

    #input-line {
        padding: 12px 0;
    }

    #input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 17px; /* Even larger on very small screens */
    }

    #terminal {
        padding: 10px;
    }
}

/* Ensure proper height on mobile browsers with address bar */
@supports (-webkit-touch-callout: none) {
    #terminal {
        height: -webkit-fill-available;
    }
}
