body {
    max-width: 640px;
    margin: 0 auto;
    padding: 5px;
    background-color: #f0f0f0;
    color: #333;
}

header,
nav,
.post-form,
.threads,
.thread-view {
    background: #fff;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
}

h1 {
    margin: 0;
    color: #000;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

input[type=text],
input[type=email],
input[type=password],
textarea {
    width: 95%;
    padding: 5px;
    margin: 2px 0;
    border: 1px solid #999;
}

button {
    padding: 5px 15px;
    background: #ddd;
    border: 1px solid #999;
    cursor: pointer;
}

.thread-title {
    margin: 5px 0;
    cursor: pointer;
    user-select: none;
    /* Prevent text selection on long press */
    -webkit-user-select: none;
}

/* Preview Popup */
#preview-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #000;
    padding: 15px;
    width: 80%;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: none;
}

#preview-popup.show {
    display: block;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.show {
    display: block;
}