body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    /* Prevent body scroll, handle in panes */
    max-width: none;
    /* Override style.css max-width */
    width: 100%;
    /* Ensure full width */
}

header {
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-bottom: 0;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100%;
}

.pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 200px;
    /* Minimum width for panes */
}

#editor-pane {
    width: 50%;
    /* Initial width */
}

#preview-pane {
    flex: 1;
    /* Take remaining space */
}

.resizer {
    width: 10px;
    background: #ddd;
    cursor: col-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    user-select: none;
    touch-action: none;
    transition: background 0.2s;
}

.resizer:hover,
.resizer.resizing {
    background: #ccc;
}

/* Optional: Add a handle icon or lines to resizer */
.resizer::after {
    content: "||";
    color: #999;
    font-size: 10px;
    letter-spacing: 1px;
}

.pane-header {
    background: #f0f0f0;
    padding: 10px;
    border-bottom: 1px solid #ccc;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pane-title {
    font-weight: bold;
}

textarea {
    flex: 1;
    resize: none;
    border: none;
    padding: 10px;
    font-family: monospace;
    font-size: 14px;
    outline: none;
}

#preview {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #fff;
}

/* Basic Markdown Styles for Preview */
#preview h1,
#preview h2,
#preview h3 {
    margin-top: 0;
}

#preview code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;
}

#preview pre {
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

#preview blockquote {
    border-left: 4px solid #ccc;
    margin: 0;
    padding-left: 10px;
    color: #666;
}

textarea.no-wrap {
    white-space: pre;
    overflow-x: auto;
}

.wrap-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-button {
    border: 1px solid #bbb;
    background: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.header-button:hover {
    background: #f5f5f5;
}

.copy-button {
    border: 1px solid #bbb;
    background: #fff;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.copy-button:hover {
    background: #f5f5f5;
}

.copy-button.copied {
    background: #e9f6ee;
    border-color: #9dd8ad;
    color: #1f7a3a;
}

.container.input-hidden #editor-pane {
    display: none;
}

.container.input-hidden #resizer {
    display: none;
}

.container.input-hidden #preview-pane {
    width: 100%;
}

.back-link {
    display: inline-block;
    text-decoration: none;
    color: #333;
}

.back-link:hover {
    text-decoration: underline;
}

/* Fix for list items not showing bullets/numbers due to reset */
#preview ul,
#preview ol {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

#preview ul {
    list-style-type: disc;
}

#preview ol {
    list-style-type: decimal;
}

#preview li {
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .resizer {
        width: 16px;
    }
}
