:root {
  --primary: #0b6b63;
  --accent: #9a3412;
  --sea: #2563eb;
  --sand: #fff7ed;
  --ink: #17262d;
  --muted: #566973;
  --line: #d7e0e4;
  --surface: #ffffff;
  --page: #edf2f3;
  --soft: #e8f3f1;
  --danger: #b42318;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  transform: translate(-50%, -150%);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

main:focus,
[tabindex="-1"]:focus {
  outline: none;
}

.app-shell {
  position: relative;
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 88px;
  background: #f8fafb;
  box-shadow: 0 0 0 1px rgba(23, 38, 45, 0.1), 0 20px 60px rgba(23, 38, 45, 0.12);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 42px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.preview-banner {
  position: sticky;
  top: 77px;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  color: #854d0e;
  font-size: 13px;
}

.preview-banner a {
  font-weight: 650;
}

.connection-banner {
  padding: 9px 16px;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.preview-state {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.preview-state.archived {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.preview-state.published {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px white, 0 8px 18px rgba(17, 24, 39, 0.14);
}

.app-header.has-back-button {
  grid-template-columns: 42px 42px minmax(0, 1fr);
}

.app-header.has-back-button .header-logo {
  display: none;
}

.brand-block span,
.page-title span,
.section-heading span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-block h1 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.1;
}

.icon-button,
.admin-link {
  width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  font-size: 22px;
}

.admin-link {
  width: auto;
  padding: 0 11px;
  font-size: 12px;
}

.side-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(15, 23, 42, 0.35);
}

.side-menu.open {
  display: block;
}

.side-menu-panel {
  width: min(82vw, 340px);
  min-height: 100%;
  max-height: 100vh;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafb;
  box-shadow: 18px 0 60px rgba(23, 49, 58, 0.18);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px white, 0 8px 18px rgba(17, 24, 39, 0.14);
}

.side-nav-items {
  display: grid;
  gap: 16px;
}

.side-nav-group {
  display: grid;
  gap: 8px;
}

.side-nav-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.side-menu button:not(.icon-button) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 650;
  text-align: left;
}

.menu-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.notification-menu {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.notification-menu-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notification-menu-copy strong,
.notification-menu-copy small {
  overflow-wrap: anywhere;
}

.notification-menu-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.view {
  display: none;
  animation: fadeIn 160ms ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 14px 18px;
  color: white;
  background-color: #315f64;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(13, 45, 48, 0.62);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-logo {
  display: none;
}

.hero h2 {
  max-width: 430px;
  margin: 0;
  font-size: 22px;
  line-height: 1.02;
}

.hero p {
  max-width: 460px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.35;
}

.hero #tagline,
.hero p:first-child {
  display: none;
}

.section,
.page-title {
  padding: 22px 16px 0;
}

.page-title {
  padding-top: 28px;
}

.page-title h2,
.section-heading h2 {
  margin: 3px 0 0;
  font-size: 25px;
  line-height: 1.12;
}

.page-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.text-button {
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  padding: 9px 12px;
  font-weight: 650;
}

.content-list,
.calendar-list {
  display: grid;
  gap: 14px;
  padding: 0 16px 24px;
}

.section .content-list,
.section .calendar-list {
  padding: 0 0 24px;
}

.content-card,
.event-card,
.contact-card,
.submission-form {
  border: 1px solid rgba(14, 116, 144, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 35, 42, 0.08);
}

.content-card {
  overflow: hidden;
}

.content-card.featured {
  border-color: rgba(249, 115, 22, 0.36);
}

.card-body {
  padding: 15px;
}

.detail-text {
  display: grid;
  gap: 12px;
}

.detail-text p {
  white-space: pre-line;
}

.detail-text .lead {
  color: var(--ink);
  font-weight: 650;
}

.content-card h3,
.event-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.22;
}

.content-card p,
.event-card p,
.alert-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.meta span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3f5;
  color: #334e5b;
  font-size: 12px;
  font-weight: 650;
}

.image-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #edf2f3;
}

.image-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}

.image-frame.large img {
  max-height: 420px;
}

.image-frame.small {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.image-frame.small img {
  max-height: 220px;
}

.image-frame.event-thumb {
  width: 104px;
  height: 78px;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
}

.image-frame.event-thumb img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.item-link {
  display: inline-flex;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.item-link.as-button {
  border: 0;
}

.alert-strip {
  display: grid;
  gap: 10px;
  padding: 14px 16px 0;
}

.alert-card {
  padding: 13px;
  border: 1px solid rgba(14, 116, 144, 0.2);
  border-left: 5px solid var(--sea);
  border-radius: 8px;
  background: #f8fffd;
}

.alert-card.warning {
  border-left-color: var(--accent);
}

.alert-card.urgent {
  border-left-color: var(--danger);
}

.event-strip {
  display: grid;
  gap: 10px;
}

.event-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 14px;
}

.event-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: start;
}

.event-copy {
  min-width: 0;
}

.date-tile {
  width: 58px;
  height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 8px;
  background: #24555b;
  color: white;
}

.date-tile strong {
  font-size: 24px;
  line-height: 1;
}

.date-tile span {
  color: #cffafe;
  font-size: 13px;
  font-weight: 650;
}

.contact-card {
  display: grid;
  gap: 6px;
  margin: 18px 16px;
  padding: 16px;
}

.contact-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  background: #edf2f3;
}

.contact-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.contact-card a {
  color: var(--primary);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.page-body {
  display: grid;
  gap: 14px;
}

.page-body > p {
  margin: 0;
  color: var(--ink);
  line-height: 1.58;
}

.page-body > h3 {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}

.embedded-public-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.embedded-form-heading span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.embedded-form-heading h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.embedded-form-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.embedded-public-form .submission-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.form-unavailable {
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: #fff7ed;
  color: var(--muted);
}

.submission-form {
  position: relative;
  display: grid;
  gap: 13px;
  margin: 18px 16px 24px;
  padding: 16px;
}

.form-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.submission-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 10px;
}

.submission-field.full {
  grid-column: 1 / -1;
}

.submission-field.half {
  grid-column: auto;
}

.submission-form label,
.upload-box label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.submission-field small,
.upload-box small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.submission-form input,
.submission-form textarea,
.submission-form select {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-box {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.upload-preview {
  overflow: hidden;
  border-radius: 8px;
  background: #eef5f6;
}

.upload-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.upload-box p,
.privacy-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.privacy-note {
  display: grid;
  gap: 5px;
}

.privacy-note p {
  margin: 0;
}

.privacy-note button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 650;
  text-decoration: underline;
}

.submission-form button[type="submit"] {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 650;
}

.result-box {
  padding: 13px;
  border-radius: 8px;
  background: #ecfeff;
  color: var(--ink);
}

.result-box strong,
.result-box p {
  margin: 0;
}

.result-box p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
}

.hidden {
  display: none !important;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: min(100%, 540px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(14, 116, 144, 0.14);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  min-width: 0;
  padding: 9px 4px 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  margin: 0 auto 3px;
  border-radius: 8px;
  background: transparent;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.bottom-nav button.active {
  color: var(--primary);
}

.bottom-nav button.active .nav-icon {
  background: #fff7ed;
}

.settings-dialog {
  width: min(92vw, 460px);
  max-height: 90vh;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.settings-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-dialog-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.settings-dialog-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.settings-dialog form {
  padding: 0 18px 18px;
}

.settings-status {
  min-height: 24px;
  margin: 0;
  padding: 14px 18px 4px;
  color: var(--muted);
  line-height: 1.45;
}

.settings-dialog fieldset {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-dialog legend {
  padding: 0 6px;
  font-weight: 600;
}

.topic-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5fafb;
  font-weight: 650;
}

.topic-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

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

.settings-actions button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.settings-actions .primary-action {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.settings-actions .danger-action {
  border-color: #fecaca;
  color: var(--danger);
}

.image-dialog {
  width: min(94vw, 900px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #0f172a;
}

.image-dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.image-dialog button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
}

@media (min-width: 760px) {
  .app-shell {
    margin-top: 26px;
    margin-bottom: 26px;
    min-height: calc(100vh - 52px);
    border-radius: 18px;
    overflow: hidden;
  }

  .bottom-nav {
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 380px) {
  .brand-block h1 {
    font-size: 18px;
  }

  .brand-block span {
    font-size: 10px;
  }

  .form-row,
  .submission-fields {
    grid-template-columns: 1fr;
  }

  .event-content {
    grid-template-columns: 1fr;
  }

  .image-frame.event-thumb {
    width: 140px;
    height: 105px;
  }

  .hero h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
