header {
    margin-bottom: 2rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-list-item {
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.file-list-item.active {
    border-left-color: var(--accent-success);
    background: var(--bg-secondary);
}

.file-list-item:hover:not(.active) {
    background: var(--bg-tertiary);
}

.file-title {
    font-weight: 500;
}

.xml-preview {
    width: 100%;
    min-height: 725px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--accent-success);
    background: var(--bg-input);
    resize: vertical;
}

.xml-form.hidden {
    display: none;
}

@media (max-width: 1200px) {
    .file-list {
        flex-direction: row;
    }
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section-flat {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section-flat section {
    margin-bottom: 1rem;
}

form > section {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

form > section section {
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-top: 1rem;
}

form h2, form h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

form > section > h2 {
    background: var(--border-light);
    font-size: 1.2rem;
}

form > section > h2:hover {
    background: var(--border);
}

form section section > h3,
.form-section-flat section > h3 {
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    padding: 0 0 0.5rem 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    justify-content: flex-start;
    gap: 0.5rem;
}

.form-section-flat section:not(.expanded) > h3 + div {
    display: none;
}

form h2 button, form h3 button {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    order: -1;
}

form h2 + div, form h3 + div {
    padding: 1.5rem;
    display: none;
}

section.expanded > h2 + div,
section.expanded > h3 + div {
    display: block;
}

.form-section-flat section:not(.expanded) > h3 {
    margin-bottom: 0;
}

.form-section-flat section > h3 + div {
    padding: 0;
}

form > section > div > div:not(.repeatable-items):not(.checkbox-inline),
form section section > div > div:not(.repeatable-items):not(.checkbox-inline),
.form-section-flat section > div > div:not(.repeatable-items):not(.checkbox-inline) {
    margin-bottom: 1.25rem;
}

.form-section-flat section > div > div:last-child {
    margin-bottom: 0;
}

textarea {
    min-height: 111px;
}

input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.sub-option {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border);
}

.locale-list {
    margin-top: 1rem;
}

.locale-item {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.locale-item label {
    margin: 0;
}

.locale-item input[type="text"] {
    width: 100%;
}

.locale-item select {
    width: 100%;
}

[data-section="hours"] > div > div:last-child {
    margin-top: 1rem;
}

[data-section="hours"] > div > div:last-child > div {
    display: grid;
    grid-template-columns: 150px 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

[data-section="hours"] > div > div:last-child > div label {
    margin: 0;
}

[data-section="hours"] > div > div:last-child > div span {
    text-align: center;
    color: var(--text-secondary);
}

[data-section="hours"] > div > div:last-child > div input[type="time"] {
    width: auto;
    min-width: 120px;
}

.repeatable-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.repeatable-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.repeatable-item input,
.repeatable-item textarea {
    flex: 1;
}

.address-item {
    flex-direction: column;
    background: var(--bg-input);
    padding: 1rem;
    border-radius: 4px;
}

.address-item > div {
    margin-bottom: 0.75rem;
}

.address-item input {
    width: 100%;
}

.address-item > .btn-remove {
    width: auto;
    align-self: flex-start;
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
}

.country-item,
.channel-item {
    flex-direction: row;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button[data-target] {
    background: var(--accent-primary);
    color: #fff;
}

button[data-target]:hover {
    background: var(--accent-primary-hover);
}

details {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 4px;
}

summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--accent-primary);
    user-select: none;
}

details ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

details li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

details code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    form h2, form h3 {
        padding: 0.75rem 1rem;
    }

    form h2 + div, form h3 + div {
        padding: 1rem;
    }
}
