* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

h1 {
    color: #2c3e50;
    text-align: center;
}

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem max(1rem, calc((100% - 1100px) / 2));
    background: #2c3e50;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.site-brand, .site-nav a {
    color: #fff;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.site-brand:visited,
.site-brand:hover {
    color: #fff;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
}

.lang-switcher {
    margin-left: auto;
    flex-shrink: 0;
}

.video-page,
.home-page {
    width: min(100% - 2rem, 1000px);
    margin: 0 auto;
    padding: 7rem 0 3rem;
}

.home-welcome {
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    padding: 3rem;
}

.home-welcome h1 {
    text-align: left;
    margin: 0.5rem 0;
}

.home-search {
    display: flex;
    flex-direction: row;
    align-items: end;
    gap: 0.75rem;
    margin-top: 2rem;
}

.home-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.home-search input {
    flex: 1;
}

.home-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.home-link {
    display: block;
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    padding: 1.5rem;
}

.home-link h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.home-link p {
    color: #68737d;
}

.profile-page {
    width: min(100% - 2rem, 900px);
    margin: 0 auto;
    padding: 7rem 0 3rem;
}

.profile-hero,
.profile-section {
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.profile-avatar {
    display: grid;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    place-items: center;
    border-radius: 50%;
    background: #e8f2fb;
    color: #357abd;
    font-size: 1.8rem;
    font-weight: 700;
}

.profile-hero h1 {
    margin: 0.25rem 0;
    text-align: left;
}

.profile-role {
    color: #68737d;
    text-transform: capitalize;
}

.profile-edit {
    margin-left: auto;
    padding: 0.7rem 1rem;
    border: 1px solid #4a90e2;
    border-radius: 6px;
    font-weight: 700;
}

.profile-section {
    margin-top: 1rem;
    padding: 1.5rem 2rem;
}

.profile-section-heading {
    margin-bottom: 1.25rem;
}

.profile-section-heading h2 {
    margin-top: 0.25rem;
    color: #2c3e50;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.profile-detail {
    min-width: 0;
    padding: 1rem;
    border-left: 3px solid #4a90e2;
    background: #f7fafc;
}

.profile-detail span {
    display: block;
    margin-bottom: 0.35rem;
    color: #68737d;
    font-size: 0.85rem;
}

.profile-detail strong {
    display: block;
    overflow-wrap: anywhere;
    color: #2c3e50;
}

/* Example: styling a login form */
#auth-container {
    background: #fff;
    margin-top: 7rem;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 360px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

label {
    display: block;
    margin-bottom: -0.75rem;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: #4a90e2;
}

button {
    padding: 0.75rem;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #357abd;
}

a {
    color: #4a90e2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.announcement-page {
    width: min(100% - 2rem, 900px);
    margin: 0 auto;
    padding: 7rem 0 3rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-announcement-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #357abd;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.post-announcement-button:hover {
    background: #2868a8;
    color: #fff;
    text-decoration: none;
}

.page-header h1 {
    text-align: left;
    margin-top: 0.25rem;
}

.eyebrow {
    color: #4a90e2;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.intro, .announcement-meta {
    color: #68737d;
}

.announcement-composer, .announcement {
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

.announcement-composer {
    margin-bottom: 2rem;
}

.announcement-composer form {
    display: grid;
    gap: 0.75rem;
}

.announcement-composer input,
.announcement-composer textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.announcement-composer input[type="file"] {
    padding: 0.55rem;
}

.form-help {
    margin: 0;
    color: #68737d;
    font-size: 0.9rem;
}

.announcement-image {
    display: block;
    width: min(100%, 600px);
    max-height: 360px;
    margin: 1rem 0;
    border-radius: 8px;
    object-fit: cover;
}

.announcement-actions {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    width: fit-content;
}

.announcement-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.announcement-heading-row h2 {
    margin-bottom: 0;
}

.announcement-actions form {
    display: block;
    flex: 0 0 auto;
    margin: 0;
    width: fit-content;
}

.announcement-actions .edit-button,
.announcement-actions .delete-button {
    flex: 0 0 auto;
}

.announcement-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.announcement-filters label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.announcement-filters select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
}

.announcement-filters button,
.clear-filter {
    min-height: 48px;
}

.clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.announcement-composer h2 {
    color: #2c3e50;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.response-form {
    margin-top: 1.25rem;
}

.response-form label {
    margin-bottom: 0.4rem;
}

.response-form button {
    margin-top: 0.5rem;
}

.announcement-responses {
    border-top: 1px solid #e1e5e8;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.announcement-responses h3 {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.response {
    border-left: 3px solid #4a90e2;
    margin-top: 0.75rem;
    padding-left: 0.75rem;
}

.response-delete-form {
    display: inline;
    margin-left: 0.5rem;
}

.response-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.response-delete-link {
    border: 0;
    padding: 0.35rem 0.6rem;
    background: none;
    color: #c0392b;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;

}

.response-delete-link:hover {
    color: #962d22;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.response-delete {
    padding: 0.35rem 0.6rem;
    background: transparent;
    color: #c0392b;
    font-size: 0.8rem;
}

.response-delete:hover {
    background: #fbeaea;
}

.response p:last-child {
    margin-top: 0.25rem;
    white-space: pre-wrap;
}

.announcement-list {
    display: grid;
    gap: 1rem;
}

.announcement {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
}

.announcement-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.announcement-actions form {
    margin: 0;
}

.announcement h2 {
    color: #2c3e50;
    margin-bottom: 0.35rem;
}

.announcement p:last-child {
    margin-top: 0.9rem;
    white-space: pre-wrap;
}

.announcement-meta {
    font-size: 0.9rem;
}

.field-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: -8px;
}

.delete-button {
    background-color: #c0392b;
    white-space: nowrap;
}

.delete-button:hover {
    background-color: #962d22;
}

.empty-state {
    color: #68737d;
    text-align: center;
    padding: 2rem;
}



.edit-button {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    background-color: #4a90e2;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    width: fit-content;
}

.edit-button:hover {
    text-decoration: none;
    background-color: #357abd;
}

.edit-button:hover {
    text-decoration: none;
    background-color: #357abd;
}

/* Addition for profile_setup.html / researcher_apply.html — select elements
   weren't covered by the existing input styling. Purely additive, doesn't
   change anything else in style.css. */
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

select:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Checkbox + label row for the researcher opt-in on profile_setup.html */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
}

.video-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 2rem;
}

.video-container video {
    display: block;
    width: 100%;
    max-width: 560px;
    height: clamp(180px, 56.25vw, 315px);
    aspect-ratio: 16 / 9;
    margin-top: 1rem;
    background: #111;
    object-fit: contain;
    object-position: center;
}

.announcement-status {
    padding: 0.65rem 0.8rem;
    margin: 0.75rem 0;
    border-radius: 6px;
    font-weight: 600;
}

.announcement-status-pending {
    background: #fff3cd;
    color: #856404;
}

.announcement-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Scheduler / Book & Manage pages */
.wrap {
    width: min(100% - 2rem, 900px);
    margin: 0 auto;
    padding: 7rem 0 3rem;
}

.manage-page h1 {
    font-size: 2rem;
}

.manage-page h2 {
    font-size: 1.5rem;
}

.manage-page .panel {
    max-width: 600px;
    padding: 1.5rem;
}

.manage-page .field-label,
.manage-page .slot-row .details {
    font-size: 0.95rem;
}

.manage-page .slot-row .title {
    font-size: 1.1rem;
}

.manage-page .btn-edit,
.manage-page .btn-remove {
    font-size: 1rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #357abd;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-btn,
.filter-btn,
.btn,
.btn-reserve,
.btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    background: #fff;
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nav-btn,
.filter-btn,
.btn {
    padding: 0.55rem 0.9rem;
}

.nav-btn.active,
.filter-btn.active,
.btn.primary {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    border-radius: 999px;
    color: #68737d;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.card {
    position: relative;
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    padding: 1.25rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.card.full {
    opacity: 0.7;
    background: #f9fafb;
}

.pin {
    position: absolute;
    top: -0.6rem;
    left: 50%;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid #fff;
}

.pin.interview { background: #4a90e2; }
.pin.workshop { background: #f0ad4e; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
}

.tag.interview { background: #4a90e2; }
.tag.workshop { background: #f0ad4e; }

.full-label {
    color: #c0392b;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card h3 {
    margin: 0 0 0.5rem;
    color: #2c3e50;
    font-size: 1.25rem;
}

.card .meta,
.card .spots,
.empty,
.slot-row .details {
    color: #68737d;
    font-size: 0.85rem;
}

.card form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-reserve {
    width: 100%;
    padding: 0.75rem;
    border: none;
    color: #fff;
}

.btn-reserve.interview { background: #4a90e2; }
.btn-reserve.workshop { background: #f0ad4e; }

.flash {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash.success {
    background: #eaf7ee;
    color: #1f7a4d;
    border-color: #bfe5cf;
}

.flash.error {
    background: #fbeaea;
    color: #b33a3a;
    border-color: #f0c7c7;
}

.panel {
    max-width: 480px;
    margin-bottom: 1.5rem;
    padding: 1.2rem 1.25rem;
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.type-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.type-toggle label {
    flex: 1;
}

.type-toggle input {
    display: none;
}

.type-toggle span {
    display: block;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    background: #fff;
    color: #2c3e50;
    cursor: pointer;
}

.type-toggle input:checked + span.interview {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}

.type-toggle input:checked + span.workshop {
    background: #f0ad4e;
    border-color: #f0ad4e;
    color: #fff;
}

.row {
    display: flex;
    gap: 0.5rem;
}

.field-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #68737d;
    font-size: 0.8rem;
}

.slot-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 8px;
}

.slot-row .title {
    font-weight: 700;
    color: #2c3e50;
}

.slot-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-edit {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    border: 1px solid #4a90e2;
    border-radius: 4px;
    background: #fff;
    color: #2f6fae;
    text-decoration: none;
}

.btn-edit:hover {
    background: #edf5fc;
}

.btn-remove {
    padding: 0.5rem 0.8rem;
    border-color: #c0392b;
    background: #fff;
    color: #c0392b;
}

.btn-remove:hover {
    background: #fbeaea;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.site-brand span {
    font-weight: 600;
}

@media (max-width: 600px) {
    .site-header {
        flex-wrap: wrap;
        gap: 0.65rem;
        padding: 0.7rem 1rem;
    }

    .nav-back {
        width: 1.8rem;
        height: 1.8rem;
    }

    .site-brand {
        min-width: 0;
        font-size: 1rem;
    }

    .brand-logo {
        height: 32px;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }


    .site-nav a {
        padding: 0.7rem 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .lang-switcher {
        margin-left: 0;
    }

    .topbar,
    .slot-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* home page tabs */
:root {
  --ink: #1B2A38;
  --paper: #EDF1EF;
  --card: #FFFFFF;
  --line: #D8DEDA;
  --muted: #65727A;
 
  --emergency: #B23A3A;
  --education: #E0A526;
  --safety: #2F6F5E;
  --connect: #3E5C82;
}
 
* { box-sizing: border-box; }
 
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--paper);
  color: var(--ink);
}
 
 
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
 
h1 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 36px;
  margin: 4px 0 8px;
}
 
.intro {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 32px;
  max-width: 520px;
}
 
.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
 
@media (max-width: 640px) {
  .tabs { grid-template-columns: 1fr; }
}
 
.tab {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(27,42,56,0.06);
}
 
.tab:hover, .tab:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27,42,56,0.12);
}
 
.tab::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 6px;
  height: 100%;
}
 
.tab.emergency::before { background: var(--emergency); }
.tab.education::before { background: var(--education); }
.tab.safety::before { background: var(--safety); }
.tab.connect::before { background: var(--connect); }
 
.tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  color: #fff;
}
 
.tab.emergency .tab-icon { background: var(--emergency); }
.tab.education .tab-icon { background: var(--education); }
.tab.safety .tab-icon { background: var(--safety); }
.tab.connect .tab-icon { background: var(--connect); }
 
.tab h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 8px;
}
 
.tab p.desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
 
.tab ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
 
.tab ul li {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  padding: 3px 0;
  border-top: 1px dashed var(--line);
}
 
.tab ul li:first-child { border-top: none; }
 
.arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--muted);
  font-size: 16px;
}

/* Education page: sections, school cards, programs, CTA */

.edu-section {
  margin-bottom: 36px;
}

.edu-section h2 {
  text-align: left;
  font-size: 20px;
  margin: 0 0 4px;
}

.edu-section-desc {
  color: var(--muted, #68737d);
  font-size: 14px;
  margin: 0 0 16px;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.school-card {
  background: #fff;
  border: 1px solid #e1e5e8;
  border-radius: 8px;
  padding: 16px 18px;
  position: relative;
}

.school-level {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--education, #E0A526);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.school-card h3 {
  font-size: 16px;
  margin: 0 0 6px;
  text-align: left;
}

.school-address {
  font-size: 13px;
  color: var(--muted, #68737d);
  margin: 0 0 14px;
}

.school-actions {
  display: flex;
  gap: 8px;
}

.resource-action-outline {
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #e1e5e8;
  color: #2c3e50;
}

.edu-cta {
  display: inline-block;
  background: var(--education, #E0A526);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 6px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted, #68737d);
  text-decoration: none;
  margin-bottom: 14px;
}

.back-link:hover { color: #2c3e50; }

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.category-header h1 {
  text-align: left;
  margin: 0;
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.category-icon.emergency { background: var(--emergency); }
.category-icon.education { background: var(--education); }
.category-icon.safety { background: var(--safety); }
.category-icon.connect { background: var(--connect); }

.category-intro {
  color: var(--muted, #68737d);
  font-size: 14px;
  margin: 12px 0 28px;
  max-width: 560px;
}
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #e1e5e8;
  border-radius: 8px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.resource-item .title {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px;
}

.resource-item .detail {
  font-size: 13px;
  color: var(--muted, #68737d);
  margin: 0;
  max-width: 420px;
}

.resource-action {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
}

.resource-action.emergency { background: var(--emergency); }
.resource-action.education { background: var(--education); }
.resource-action.safety { background: var(--safety); }
.resource-action.connect { background: var(--connect); }

/*wrap for most pages*/
@media (max-width: 600px) {
    .site-header {
        align-items: center;
        flex-direction: row;
    }

    #auth-container {
        margin-top: 15rem;
    }

    .wrap {
        padding-top: 6rem;
    }

    .wrap h1 {
        font-size: 2rem;
        line-height: 1.15;
        text-align: left;
    }

    .wrap h2 {
        font-size: 1.35rem;
    }

    .topbar {
        align-items: stretch;
        margin-bottom: 1.25rem;
    }

    .topbar > div:last-child {
        display: flex;
        width: 100%;
    }

    .topbar .nav-btn {
        flex: 1;
        min-height: 44px;
        padding: 0.7rem 0.5rem;
    }

    .panel {
        max-width: none;
        padding: 1rem;
    }

    .panel h2 {
        margin-bottom: 1rem;
    }

    .panel input,
    .panel select,
    .panel button {
        min-height: 46px;
        font-size: 1rem;
    }

    .panel .row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .type-toggle span {
        min-height: 46px;
        padding: 0.75rem 0.5rem;
    }

    .slot-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.9rem;
        padding: 1rem;
    }

    .slot-row .title {
        font-size: 1.1rem;
    }

    .slot-row .details {
        margin-top: 0.35rem;
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .slot-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .slot-row form,
    .slot-row .btn-edit,
    .slot-row .btn-remove {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .slot-row .btn-edit,
    .slot-row .btn-remove {
        min-height: 46px;
        font-size: 1rem;
    }

    .home-page {
        padding-top: 15rem;
    }

    .home-welcome {
        padding: 1.5rem;
    }

    .home-search {
        flex-direction: column;
        align-items: stretch;
    }

    .home-links {
        grid-template-columns: 1fr;
    }

    .profile-page {
        padding-top: 10rem;
    }

    .profile-hero {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 1.5rem;
    }

    .profile-edit {
        flex-basis: 100%;
        margin-left: 0;
        text-align: center;
    }

    .profile-section {
        padding: 1.5rem;
    }

    .manage-page h1 {
        font-size: 2rem !important;
    }

    .manage-page h2 {
        font-size: 1.5rem !important;
    }

    .profile-details {
        grid-template-columns: 1fr;
    }

    .announcement-page {
        padding: 10rem 0 1.5rem;
    }

    .page-header, .announcement {
        flex-direction: column;
    }

    .announcement-filters {
        grid-template-columns: 1fr;
    }
}
/* Ruveneko: fixes for two overlap bugs, both caused by the same thing —
   the global `label { margin-bottom: -0.75rem }` rule is designed to pair
   with a flex column that has `gap: 1rem` (like <form> itself), so the
   label sits snugly above the next field. Anywhere that pattern is missing
   the flex/gap wrapper, the negative margin instead pulls the next element
   up on top of the label. */

/* Dynamically-added survey questions (surveys.html's "+ Add question") sit
   in a plain, unstyled div, so their "Question"/"Answer type" labels were
   overlapping the input/select right below them. */
.question-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Survey audience-targeting checkboxes (_survey_criteria_fields.html),
   included on surveys.html and edit_survey.html. Same missing flex/gap
   issue was overlapping the "Everyone" checkbox with the hint text below
   it, and cramming each criteria group's heading against the row above. */
.survey-audience {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid #e1e5e8;
    border-radius: 6px;
    padding: 1rem;
    margin: 0;
}

.survey-audience legend {
    font-weight: 600;
    padding: 0 0.25rem;
}

.criteria-groups {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* A checkbox-row label wraps its own checkbox + text on one line — it
   isn't "a label sitting above a separate field" like the global rule
   assumes, so it shouldn't inherit that negative margin at all. */
label.checkbox-row {
    margin-bottom: 0;
}

/* The dropdown-options sub-block (shown only when a question's answer type
   is "Dropdown") is a grandchild of .question-block, not a direct child, so
   it didn't inherit the flex/gap fix above and had the same label-overlap
   bug. Its `display` is toggled by JS between 'none' and 'flex' (see
   surveys.html / edit_survey.html) — only `display` is set inline, so
   flex-direction/gap here still apply on top of that. */
.dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========================================
   MOBILE RESPONSIVE FIXES
   ========================================= */
   @media screen and (max-width: 768px) {
    
    /* 1. General Layout & Padding */
    body { font-size: 16px; }
    .wrap, .audit-container, .admin-home, .moderation-page, .consent-page, .video-page, #auth-container {
        padding: 10rem 15px 15px !important;
        margin: 10px auto !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    h1 { font-size: 1.5em !important; }
    h2 { font-size: 1.2em !important; }

    /* 2. Navigation Bar */
    .site-header {
        flex-wrap: wrap;
        gap: 0.65rem;
        padding: 0.7rem 1rem;
    }
    .site-brand {
        min-width: 0;
        font-size: 1rem;
    }
    .brand-logo {
        height: 32px;
    }
    .nav-toggle {
        display: inline-flex;
        width: auto !important;
        margin: 0 0 0 auto !important;
    }
    .site-nav {
    display: none;
    }

    .site-nav.is-open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        background: #2c3e50;
        padding: 0.35rem 0 0.2rem;
        z-index: 20;
        box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    }
    .site-nav a {
        font-size: 0.9em;
        padding: 0.7rem 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        background: transparent;
        border-radius: 0;
    }
    .lang-switcher {
        margin-left: 0;
    }
    .lang-switcher select {
        width: auto !important;
    }

    /* 3. The Table Fix (Crucial for Audit Logs & User Consent) */
    /* This allows tables to scroll horizontally instead of breaking the page */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    th, td {
        padding: 8px !important;
        font-size: 0.85em !important;
    }

    /* 4. Admin Dashboard & Stats (Stack cards vertically) */
    .admin-grid, .quick-stats, .stats-container {
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    .stat-card, .admin-card {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 5. Forms and Inputs (Make them full width) */
    input, select, textarea, button {
        width: 100% !important;
        box-sizing: border-box;
        margin-bottom: 10px;
        font-size: 16px; /* Prevents iOS from zooming in on inputs */
    }
    
    /* 6. Action Buttons in Moderation */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .btn-approve, .btn-reject {
        width: 100% !important;
    }

    /* 7. Announcement Cards */
    .announcement {
        padding: 15px !important;
    }
    .announcement-heading-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .announcement-actions {
        margin-top: 10px;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
}