body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background: #f4f4f9;
}
#header {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
}
.container {
    display: flex;
    height: 95vh;
    margin: 2.5vh auto;
    width: 95vw;
    box-sizing: border-box;
}
#sidebar {
    width: 250px;
    background: #34495e;
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #ccc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    flex: 0 0 auto;
}
#sidebar.hidden {
    width: 0;
    padding: 0;
    border-right: none;
}
#fileList {
    list-style: none;
    padding: 0;
    word-wrap: break-word;
}
#fileList li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
#fileList li a:hover {
    background: rgba(255, 255, 255, 0.2);
}
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}
.region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.region-header h2 {
    margin: 0;
    font-size: 16px;
}
.region-header .controls {
    display: flex;
    gap: 10px;
}
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}
textarea {
    flex-grow: 1;
    width: 100%;
    font-family: monospace;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: white;
}
button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
}
button:hover {
    background: #2980b9;
}
#toggleSidebarBtn {
    background: #e67e22;
}
#preview {
    width: 100%;
    flex-grow: 1;
    border: 1px solid #ccc;
    background: white;
}


/* Modal styles */
.modal.hidden { display: none; }
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: #fff;
    width: 70vw;
    max-width: 900px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-header h3 {
    margin: 0 0 8px 0;
}
.modal-body label { display: block; margin-top: 8px; font-weight: 600; }
.modal-body input { width: 100%; padding: 8px; margin-top: 4px; }
.modal-body textarea { width: 100%; margin-top: 4px; font-family: monospace; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.modal-actions .secondary { background: #aaa; }


/* Style builder UI */
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.tabs button { background: #bdc3c7; padding: 6px 10px; }
.tabs button.active { background: #3498db; color: #fff; }
.builder-actions { margin-top: 8px; display: flex; gap: 8px; }
.rule-card { border: 1px solid #ddd; border-radius: 6px; padding: 10px; margin: 8px 0; background: #fafafa; }
.rule-header { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rule-header input { flex: 1; padding: 6px; }
.decl-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin: 4px 0; align-items: center; }
.decl-row input { padding: 6px; }
