:root { --vh:1vh; --safe-bottom: env(safe-area-inset-bottom,0px); }  
html, body { background: #fff; font-family: Arial, sans-serif; margin: 0; overflow-x: hidden; padding: 0; }
.outer-wrapper { margin: 0 auto; max-width: 1200px; padding: 18px; }
.upload-box { background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.08); font: inherit; margin: 20px auto; max-width: 700px; padding: 12px; }
.upload-box input[type=file], .upload-box input[type=text] { box-sizing: border-box; font: inherit; margin: 8px 0; padding: 8px; width: 100%; }
.container-text-wrapper { background: #fff; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.05); margin: 20px auto; max-width: 900px; padding: 12px; }
.container-text-wrapper input[type=text] { box-sizing: border-box; font: inherit; padding: 8px; width: 100%; }
.sections-container { display: flex; flex-direction: column; gap: 20px; margin: 0 auto; max-width: 900px; }
.section-block { background: #fff; border: 1px solid #e6e6e6; border-radius: 10px; padding: 14px; position: relative; }
.section-h2 { font-size: 18px; margin: 0 0 8px; outline: none; }
.section-text { border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font: inherit; min-height: 140px; padding: 10px; width: 100%; }
.section-photo img { border-radius: 8px; cursor: pointer; height: auto; object-fit: cover; width: 100%; }
.section-caption { margin-top: 8px; }
.section-caption input { border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font: inherit; padding: 8px; width: 100%; }
.section-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.section-controls button { background: #333; border: 0; border-radius: 6px; color: #fff; cursor: pointer; padding: 8px 10px; }
.add-section-btn { background: #06c; border: 0; border-radius: 6px; color: #fff; cursor: pointer; display: inline-block; padding: 10px 14px; }
.text-center { text-align: center; }
.pagination { margin: 20px 0; text-align: center; }
.pagination a { background: #eee; border-radius: 4px; color: #333; display: inline-block; margin: 0 5px; padding: 6px 12px; text-decoration: none; }
.pagination a.active { background: #06c; color: #fff; }
.section-h2-wrapper { margin-bottom: 15px; }
.lightbox { align-items: center; background: #000; display: none; inset: 0; justify-content: center; overflow: hidden; position: fixed; touch-action: pan-y; z-index: 9999; }
.lightbox.active { display: flex; }
.lightbox-content { align-items: center; display: flex; height: 100%; justify-content: center; position: relative; width: 100%; }
.lightbox-content img { display: block; margin: auto; max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .caption { background: rgba(0, 0, 0, .45); border-radius: 6px; bottom: 10px; box-sizing: border-box; color: #fff; font-size: 16px; left: 50%; max-width: 90%; padding: 6px 12px; position: absolute; text-align: center; transform: translateX(-50%); }
.lightbox-controls { align-items: center; background: rgba(0, 0, 0, .5); color: #fff; display: flex; gap: 20px; padding: 0 5px; position: absolute; right: 20px; top: 15px; z-index: 10001; }
.lightbox-controls .counter { font-size: 20px; }
.lightbox-controls .close { cursor: pointer; font-size: 40px; line-height: 1; margin-top: -5px; }
.lightbox .arrow { background: rgba(0, 0, 0, .25); border-radius: 50%; color: #fff; cursor: pointer; display: none; font-size: 22px; padding: 8px 16px; position: absolute; top: 50%; transform: translateY(-50%); user-select: none; z-index: 10000; }
.lightbox .arrow.prev { left: 18px; }
.lightbox .arrow.next { right: 18px; }
@media (hover: hover) and (pointer: fine) { .lightbox .arrow { display: block; } }
.open-qtb { background-color: #eee; border-radius: 0 0 5px 5px; color: #333; cursor: pointer; display: block; font-size: 16px; margin: 0 auto; max-width: 300px; padding: 10px 20px; text-align: center; text-decoration: none; transition: background .3s; width: 100%; }
.open-qtb:hover { background: #ccc; text-decoration: none; }
.section-photo img { border-radius: 5px; display: block; height: auto; margin-left: auto; margin-right: auto; max-height: 600px; max-width: 100%; object-fit: contain; width: auto; }
.section-photo { background: #transparent; border-radius: 5px; padding: 5px; }
hr.separator { background: #ccc; border: 0; color: #ccc; font-size: 0; height: 1px; margin: 30px 0 20px; padding: 0; width: 100%; }
h2.page-title { background: #ddd; font-size: 18px; margin: 0 auto; padding: 10px 0; text-align: center; width: 300px; }
label { font-weight: 600; line-height: 2; }
button.main { background: #2d89ef; border: 0; border-radius: 5px; color: #fff; cursor: pointer; font-weight: normal; }
button.main:hover { background: #02376b; border: 0; border-radius: 5px; color: #fff; cursor: pointer; font-weight: normal; }
input.section-h2-input { font: inherit; }
#uploading-message { display: none; margin-top: 8px; }
.add-section-btn { margin-top: 10px; }
.page-title { margin-bottom: 10px; width: 100%; }
.section-photo { margin-top: 10px; }
.save-all { margin: 20px auto 0; max-width: 900px; text-align: center; }
