/* School Card Interactive Elements */
.school-open {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 4px;
}
.school-open:focus-visible {
  outline: 3px solid #153528;
  outline-offset: 4px;
}
.school-card > .school-open {
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 4px;
}
.school-card > .school-open:hover {
  box-shadow: none;
}
.edit-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: #153528;
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 0.2s ease, color 0.15s ease;
}
.school-card:hover .edit-hint {
  transform: translateX(4px);
  color: #0f271d;
}
.school-log {
  width: 100%;
  margin-top: 14px;
  background: #f3f7f0;
  border: 1.5px solid #cad7c5;
  color: #153528;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.school-log:hover:not(:disabled) {
  background: #153528;
  color: #ffffff;
  border-color: #153528;
  box-shadow: 0 2px 6px rgba(21, 53, 40, 0.2);
}
.school-log:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal Dialog */
#school-editor {
  width: min(700px, calc(100% - 32px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  border: 1px solid #cad5c6;
  border-radius: 16px;
  color: #14201a;
  background: #fafaf7;
  box-shadow: 0 24px 64px -12px rgba(18, 34, 27, 0.38), 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
#school-editor::backdrop {
  background: rgba(14, 30, 23, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#editor-form {
  padding: 26px 30px 14px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Modal Header */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.editor-header .eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
  text-transform: uppercase;
  color: #385945;
  background: #eaf1e7;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.editor-header h2 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.5px;
  font-weight: 750;
  color: #14201a;
}
#editor-meta {
  font-size: 12.5px;
  color: #55645b;
  margin: 8px 0 0;
  font-weight: 500;
}
#editor-close {
  border: 1px solid #cad5c5;
  background: #ffffff;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #244633;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#editor-close:hover:not(:disabled) {
  background: #edf3e9;
  border-color: #153528;
  color: #0f271d;
}

/* Status Banners */
#editor-status {
  padding: 12px 16px;
  background: #eef4ea;
  border: 1px solid #d0dfcc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin: 14px 0 18px;
  color: #244633;
  font-weight: 500;
  display: block;
}
#editor-status:empty {
  display: none;
}

/* Outreach Form Section */
#outreach-fields {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #dce4d5;
}
#outreach-fields .quiet-note {
  margin: 6px 0 0;
  line-height: 1.55;
  font-size: 12px;
  color: #55645b;
  background: #edf4e8;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3.5px solid #5a8a4e;
}

/* Grid & Form Fields */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.editor-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: #28392d;
}
.editor-grid input,
.editor-grid select,
.editor-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 13px;
  border: 1.5px solid #cad5c3;
  border-radius: 8px;
  background: #ffffff;
  color: #14201a;
  font: inherit;
  font-size: 16px; /* 16px prevents mobile browser zoom */
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.editor-grid input:focus,
.editor-grid select:focus,
.editor-grid textarea:focus {
  outline: 0;
  border-color: #153528;
  box-shadow: 0 0 0 3px rgba(21, 53, 40, 0.14);
}
.editor-grid textarea {
  resize: vertical;
  line-height: 1.55;
  min-height: 105px;
}
.editor-grid :disabled {
  background: #f0f3eb;
  color: #727e73;
  border-color: #dbe2d6;
  cursor: not-allowed;
}
.editor-wide {
  grid-column: 1 / -1;
}
#cold-warning {
  margin: 6px 0 0;
  line-height: 1.5;
  font-size: 11.5px;
  color: #73531b;
  background: #fef9eb;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #fde7b7;
  display: block;
}
#cold-warning:empty {
  display: none;
}

/* Sticky Action Bar */
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: #fafaf7;
  padding: 16px 0 6px;
  margin-top: 14px;
  border-top: 1px solid #dce3d5;
  z-index: 10;
}
.editor-feedback {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #153528;
  font-weight: 600;
  min-height: 20px;
}
.editor-feedback[data-kind=error] {
  color: #b42318;
  font-weight: 700;
}
#editor-reload {
  background: #ffffff;
  border: 1.5px solid #cad5c3;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #244633;
  min-height: 44px;
  transition: all 0.15s ease;
}
#editor-reload:hover:not(:disabled) {
  background: #edf3e8;
  border-color: #153528;
  color: #0f271d;
}
#editor-save {
  background: #153528;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  min-height: 44px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(21, 53, 40, 0.25);
}
#editor-save:hover:not(:disabled) {
  background: #0f271d;
  box-shadow: 0 4px 14px rgba(21, 53, 40, 0.35);
  transform: translateY(-1px);
}
#editor-save:disabled {
  background: #cad5c3;
  color: #6e7a6d;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Save Toast */
.save-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1000;
  max-width: calc(100vw - 48px);
  padding: 14px 22px;
  background: #12281e;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(18, 34, 27, 0.35);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  #school-editor {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }
  #editor-form {
    padding: 20px 18px 12px;
    max-height: calc(100dvh - 24px);
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .editor-header h2 {
    font-size: 21px;
  }
  .editor-actions {
    position: sticky;
    bottom: 0;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0 4px;
  }
  .editor-actions button {
    flex: 1;
    min-height: 48px;
  }
}
