:root { font-size:16px; }
[hidden] { display:none!important; }
.admin-page { max-width:none; background:#f0f3f2; color:#163e40; }
.admin-header { min-height:86px; padding:1rem max(1.25rem,5vw); display:flex; align-items:center; justify-content:space-between; gap:1rem; background:var(--teal); color:#fff; }
.admin-header>a:last-child { font-size:.9rem; }
.admin-main { max-width:1100px; margin:auto; padding:3rem 1.5rem 5rem; }
.login-card { max-width:480px; margin:4vh auto; }
.admin-eyebrow { font-size:.72rem; font-weight:700; letter-spacing:.15em; margin-bottom:.8rem; }
.admin-page h1 { font-size:2.5rem; line-height:1.2; margin-bottom:1rem; letter-spacing:-.04em; }
.login-card>p { margin-bottom:1.5rem; }
.admin-page label { display:block; font-size:.9rem; font-weight:600; margin-bottom:.5rem; }
.admin-page input:not([type=file]),.admin-page textarea { display:block; width:100%; background:#fff; color:#173e40; border:1px solid #a1b7b6; border-radius:5px; padding:.8rem; font:inherit; }
.admin-page textarea { resize:vertical; line-height:1.5; min-height:90px; }
.login-card input { margin-bottom:1.2rem; }
.login-card .button { width:100%; min-height:48px; border-radius:5px; }
.admin-page button:disabled { opacity:.5; cursor:not-allowed; }
.admin-status { min-height:1.5rem; margin:1rem 0; font-size:.9rem; overflow-wrap:anywhere; }
.admin-status.error { color:#a32626; }
.notice { background:#fff0cb; color:#634b14; padding:1rem; border-left:4px solid #c69b42; }
#local-test-controls p { margin-bottom:1rem; }
#local-test-controls .secondary-button { display:inline-block; margin:0 .5rem .5rem 0; }
.editor-title,.editor-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.editor-title { margin-bottom:2rem; }
.editor-title h1 { margin-bottom:.3rem; }
#signed-in-user { font-size:.85rem; }
.editor-toolbar { position:sticky; top:0; z-index:2; background:#f0f3f2f5; padding:1rem 0; border-block:1px solid #c5d1cd; }
.editor-toolbar>div { display:flex; gap:.6rem; flex-wrap:wrap; }
#draft-state { font-size:.85rem; }
.secondary-button { border:1px solid #7b9996; background:transparent; color:#163e40; padding:.6rem 1rem; border-radius:4px; font-size:.9rem; }
.secondary-button:hover { background:#dce8e4; }
.admin-page .button { border-radius:4px; }
.editor-help { margin-bottom:2rem; font-size:.95rem; }
.editor-language { padding:1.25rem; margin-bottom:1.5rem; background:#e0ebe6; border-radius:6px; }
.editor-language select { width:min(100%,300px); padding:.7rem; color:#163e40; background:white; border:1px solid #7b9996; border-radius:4px; font:inherit; }
.editor-language p { margin-top:.8rem; font-size:.85rem; }
.image-controls { padding:1.25rem; margin-bottom:1.5rem; border:1px solid #cad8d2; border-radius:6px; }
.image-controls select { width:min(100%,300px); padding:.7rem; color:#163e40; background:white; border:1px solid #7b9996; border-radius:4px; font:inherit; }
.image-controls p { margin:.8rem 0; font-size:.85rem; }
.image-controls a { text-decoration:underline; font-size:.9rem; }
#gallery-editor-section { scroll-margin-top:9rem; }
#editor-fields { border:0; padding:0; margin:0; min-width:0; }
.editor-section { border:1px solid #cad8d2; border-radius:8px; background:#fff; margin-bottom:1rem; overflow:hidden; }
.editor-section summary { padding:1.3rem; cursor:pointer; font-family:var(--display); font-size:1.1rem; }
.editor-section[open] summary { border-bottom:1px solid #dae2de; }
.section-fields { padding:1.3rem; display:grid; gap:1.5rem; }
.field-help { font-size:.8rem; color:#526b66; margin:.7rem 1.3rem 1.3rem; }
.image-editor { display:grid; grid-template-columns:150px 1fr; gap:1.2rem; align-items:start; padding-top:1rem; border-top:1px solid #e1e8e4; }
.image-editor img,.gallery-item img { width:100%; height:130px; object-fit:contain; background:#e7edeb; border-radius:4px; }
.image-editor input[type=file] { margin:1rem 0; width:100%; }
.image-editor label { margin-top:.6rem; }
.gallery-editor { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.4rem; padding:1.3rem; }
.gallery-item { padding:1rem; border:1px solid #d6e0dc; border-radius:5px; min-width:0; }
.gallery-item img { height:180px; object-fit:cover; margin-bottom:1rem; }
.gallery-item input { margin-bottom:1rem; }
.gallery-item input[type=file] { max-width:100%; font-size:.8rem; }
.gallery-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:1rem; }
.upload-button { width:fit-content; margin:0 1.3rem!important; padding:.8rem; border:1px dashed #779f94; cursor:pointer; }
.upload-button input { display:block; max-width:100%; margin-top:.5rem; font-size:.8rem; }
.preview-dialog { width:95vw; max-width:1500px; height:94vh; max-height:94vh; padding:0; background:#f0f3f2; color:#163e40; }
.preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem 1rem; height:70px; }
.preview-toolbar h2 { font-family:var(--sans); font-size:.9rem; margin:0; }
#preview-frame { width:100%; height:calc(100% - 70px); display:block; border:0; background:var(--teal); }
.admin-page :focus-visible { outline-color:#256d62; }
@media(max-width:650px) {
  .admin-header .brand { font-size:.65rem; }
  .admin-header .brand img { width:2.4rem; }
  .admin-header>a:last-child { font-size:.75rem; }
  .admin-main { padding:2rem 1rem; }
  .admin-page h1 { font-size:2rem; }
  .editor-title,.editor-toolbar { align-items:flex-start; flex-direction:column; }
  .editor-toolbar { padding:.7rem 0; }
  .editor-toolbar button { padding:.6rem; font-size:.78rem; }
  .gallery-editor { grid-template-columns:1fr; }
  .image-editor { grid-template-columns:1fr; }
  .image-editor img { max-width:220px; }
}

.admin-page .crop-preview { object-fit:cover; }
.crop-draggable { cursor:grab; touch-action:none; user-select:none; }
.crop-draggable:active { cursor:grabbing; }
.crop-controls { margin:1rem 0; font-size:.85rem; }
.crop-controls input[type=range] { padding:0; margin:.5rem 0; }
