:root {
  /* Brand palette pulled from michiganrefs.org: navy header/surfaces, blue accent for links. */
  --navy-900: #3a435e;
  --navy-800: #454f6d;
  --blue-600: #2892d7;
  --blue-700: #1f74ad;
  --blue-50: #eaf5fc;
  --gray-900: #221f1b;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-200: #e5e7eb;
  --gray-100: #f4f5f7;
  --red-600: #dc2626;
  --red-50: #fef2f2;
  --unread-600: #e11d48;
  --green-600: #16a34a;
  --green-50: #f0fdf4;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gray-100);
  color: var(--gray-900);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--blue-700); }

h1, h2, h3, .brand {
  font-family: "Titillium Web", "Lato", -apple-system, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--navy-900);
  color: white;
  position: sticky;
  top: 0;
  /* Leaflet's own panes/controls (Nearby Games' map) go up to z-index 1000
     and aren't isolated in their own stacking context, so this has to clear
     that or the nav/account dropdowns render underneath the map. */
  z-index: 2000;
}

.topbar .brand {
  display: flex;
  align-items: center;
  color: white;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
  margin-right: auto;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  margin-right: 8px;
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

/* Always a hamburger-triggered drawer, on every screen size — a horizontal
   row of links across the top bar got hard to scan once we had 5+ items,
   even on a laptop-width window. */
.topnav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--navy-900);
  padding: 4px 16px 12px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  overflow-x: visible;
}

.topnav.open {
  display: flex;
}

.topnav a {
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-disabled {
  color: white;
  opacity: 0.55;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: default;
}

.logout-form {
  margin: 4px 0 0;
}

.link-button {
  background: none;
  border: none;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.logout-form .link-button {
  display: block;
  padding: 10px 0 4px;
}

/* On wider viewports the drawer anchors under the hamburger button as a
   compact panel instead of stretching edge to edge — reads like a proper
   dropdown menu rather than a scaled-up mobile sheet. */
@media (min-width: 640px) {
  .topnav {
    left: auto;
    width: 280px;
    border-radius: 0 0 0 var(--radius);
  }
}

.account {
  position: relative;
}

.avatar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-600);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  padding: 0;
}

.account-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: white;
  color: var(--gray-900);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  padding: 14px 16px;
  z-index: 20;
}

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

.account-menu .account-name {
  font-weight: 700;
  margin: 0;
}

.account-menu .account-email {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin: 2px 0 10px;
  word-break: break-word;
}

.account-location {
  padding: 10px 0;
  border-top: 1px solid var(--gray-200);
}

.account-location p {
  margin: 0 0 4px;
}

.account-location .link-button-quiet {
  padding: 0;
}

.account-menu a,
.account-menu .link-button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--gray-900);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 0;
  border-top: 1px solid var(--gray-200);
}

.account-menu .logout-form {
  margin: 0;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Opt-in for table/dashboard-style pages (Nearby Games) that benefit from
   using more of a wide desktop viewport — prose pages stay at the narrower
   default width, which reads better at long line lengths. */
@media (min-width: 900px) {
  .container-wide {
    max-width: 1200px;
  }

  .split-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
  }

  .split-layout .sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

.card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.subtitle { color: var(--gray-500); margin-top: 0; }
.fine-print { font-size: 0.85rem; color: var(--gray-500); }

.badge {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-600);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success {
  background: var(--green-50);
  color: #15803d;
  border-color: var(--green-600);
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #d97706;
}

.badge-error {
  background: var(--red-50);
  color: var(--red-600);
  border-color: var(--red-600);
}

.badge-muted {
  background: var(--gray-100);
  color: var(--gray-500);
  border-color: var(--gray-200);
}

.integration-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.log-viewer {
  background: var(--gray-900);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 70vh;
  overflow-y: auto;
}

.feedback-card h2 { margin-bottom: 0; }

.feedback-prior {
  margin: 10px 0 4px;
}

.feedback-prior summary {
  cursor: pointer;
  list-style: none;
}

.feedback-prior summary::-webkit-details-marker { display: none; }

.feedback-prior-entry {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: 8px;
}

.feedback-prior-entry p { margin: 4px 0; }

.score-badge {
  display: inline-block;
  background: var(--navy-900);
  color: white;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.score-badge-none {
  display: inline-block;
  color: var(--gray-500);
  font-size: 0.85rem;
}

.mentor-score-badge {
  display: inline-block;
  min-width: 2.2em;
  text-align: center;
  background: var(--gray-500);
  color: white;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mentor-score-badge.score-medium {
  background: var(--blue-600);
}

.mentor-score-badge.score-high {
  background: var(--green-600);
}

.range-slider {
  position: relative;
  height: 28px;
  margin: 10px 2px 4px;
}

.range-slider-track {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
}

.range-slider-range {
  position: absolute;
  top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--navy-900);
}

.range-slider input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

.range-slider input[type="range"]#scoreMinInput {
  z-index: 2;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: transparent;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: all;
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.range-slider input[type="range"]::-moz-range-track {
  background: transparent;
}

.range-slider-labels {
  text-align: center;
  margin: 0;
}

.inline-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-fields input {
  flex: 1;
}

.weight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.weight-grid label {
  margin: 10px 0 2px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 14px 0 4px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  color: var(--gray-900);
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  color: var(--gray-900);
  resize: vertical;
  box-sizing: border-box;
}

.button {
  display: inline-block;
  width: 100%;
  text-align: center;
  margin-top: 18px;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--navy-900);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.button-secondary {
  background: var(--gray-700);
}

.button-danger {
  background: var(--red-600);
}

.button-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.button-google .google-icon {
  flex: none;
}

.divider {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.85rem;
  margin: 14px 0;
}

.auth-card {
  margin-top: 40px;
}

.auth-logo {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin: 0 auto 16px;
}

.auth-card h1,
.auth-card h2,
.auth-card .subtitle {
  text-align: center;
}

.auth-forgot {
  margin: 6px 0 0;
}

.auth-new-here {
  background: var(--gray-100);
}

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.location-banner {
  margin: 0 0 10px;
}

.flash-error {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid #fecaca;
}

.flash-success {
  background: var(--green-50);
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.flash-info {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-600);
}

.flash-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.table-scroll {
  overflow-x: auto;
}

.expense-items {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}

.expense-items-header {
  display: grid;
  grid-template-columns: 84px 100px 1fr 90px;
  column-gap: 12px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gray-500);
}

.expense-items-header span:last-child {
  text-align: right;
}

.expense-item-card {
  display: grid;
  grid-template-columns: 84px 100px 1fr 90px;
  grid-template-areas:
    "date type desc amount"
    "meta meta meta actions";
  column-gap: 12px;
  row-gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  align-items: start;
}

.expense-item-card:last-child {
  border-bottom: none;
}

.expense-item-card .ei-date { grid-area: date; color: var(--gray-500); }
.expense-item-card .ei-type { grid-area: type; }
.expense-item-card .ei-desc { grid-area: desc; min-width: 0; overflow-wrap: anywhere; }
.expense-item-card .ei-amount { grid-area: amount; text-align: right; font-weight: 600; white-space: nowrap; }
.expense-item-card .ei-meta { grid-area: meta; font-size: 0.8rem; color: var(--gray-500); }

.expense-item-card .ei-actions {
  grid-area: actions;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.85rem;
}

.expense-item-card .ei-actions form {
  margin: 0;
}

@media (max-width: 640px) {
  .expense-items-header {
    display: none;
  }

  .expense-item-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "type amount"
      "desc desc"
      "date date"
      "meta actions";
    padding: 12px 10px;
  }

  .expense-item-card .ei-type {
    font-weight: 600;
  }

  .expense-item-card .ei-amount {
    font-size: 1rem;
  }

  .expense-item-card .ei-actions {
    justify-content: flex-start;
  }
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.user-table th, .user-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.integrations-table {
  table-layout: fixed;
  width: 100%;
}

.integrations-table th:nth-child(1), .integrations-table td:nth-child(1) { width: 150px; }
.integrations-table th:nth-child(2), .integrations-table td:nth-child(2) { width: 90px; }
.integrations-table th:nth-child(3), .integrations-table td:nth-child(3) { width: 180px; }
.integrations-table th:nth-child(5), .integrations-table td:nth-child(5) { width: 90px; }

.integrations-table td:nth-child(4) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.venues-table {
  table-layout: fixed;
  width: 100%;
}

.venues-table th:nth-child(2), .venues-table td:nth-child(2) { width: 110px; }
.venues-table th:nth-child(3), .venues-table td:nth-child(3) { width: 90px; }
.venues-table th:nth-child(4), .venues-table td:nth-child(4) { width: 90px; }
.venues-table th:nth-child(5), .venues-table td:nth-child(5) { width: 130px; }
.venues-table th:nth-child(6), .venues-table td:nth-child(6) { width: 70px; }

.venues-table td:nth-child(1) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.officials-table {
  table-layout: fixed;
  width: 100%;
}

.officials-table th:nth-child(1), .officials-table td:nth-child(1) { width: 140px; }
.officials-table th:nth-child(2), .officials-table td:nth-child(2) { width: 110px; }
.officials-table th:nth-child(3), .officials-table td:nth-child(3) { width: 180px; }
.officials-table th:nth-child(4), .officials-table td:nth-child(4) { width: 110px; }
.officials-table th:nth-child(5), .officials-table td:nth-child(5) { width: 65px; }
.officials-table th:nth-child(7), .officials-table td:nth-child(7) { width: 80px; }
.officials-table th:nth-child(8), .officials-table td:nth-child(8) { width: 120px; }

.officials-table td:nth-child(1),
.officials-table td:nth-child(3),
.officials-table td:nth-child(6) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.permissions-matrix th {
  text-align: center;
}

.permissions-matrix th:first-child {
  text-align: left;
}

.permissions-matrix-group td {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.permissions-matrix-checkbox {
  text-align: center;
}

.permissions-matrix-checkbox input {
  margin: 0;
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.matches-table th, .matches-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.matches-table th {
  background: var(--blue-50);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gray-700);
  white-space: nowrap;
}

.matches-table th a {
  color: var(--gray-700);
}

.matches-table th a.sort-active {
  color: var(--blue-700);
  font-weight: 700;
}

.matches-table tbody tr:hover {
  background: var(--blue-50);
}

.ms-dropdown {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
}

.ms-dropdown-toggle {
  padding: 12px;
  font-size: 1rem;
  color: var(--gray-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ms-dropdown-toggle::-webkit-details-marker {
  display: none;
}

.ms-dropdown-toggle::after {
  content: '\25BE';
  color: var(--gray-500);
  margin-left: 8px;
}

.ms-dropdown[open] .ms-dropdown-toggle::after {
  content: '\25B4';
}

.ms-dropdown-panel {
  border-top: 1px solid var(--gray-200);
  padding: 10px;
}

.ms-dropdown-search {
  margin-bottom: 8px;
}

.table-search {
  margin: 14px 0;
}

.ms-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
}

.ms-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: normal;
  cursor: pointer;
  border-radius: 6px;
}

.ms-dropdown-item:hover {
  background: var(--blue-50);
}

.ms-dropdown-item input {
  margin: 0;
}

.ms-dropdown-select-all {
  font-weight: 600;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
  padding-bottom: 8px;
}

.ms-dropdown-item.ms-hidden {
  display: none;
}

.pagination {
  text-align: center;
  margin: -8px 0 20px;
}

.pagination-disabled {
  color: var(--gray-200);
}

.suggestion-diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 8px 0;
}

.suggestion-diff th, .suggestion-diff td {
  text-align: left;
  padding: 6px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.post-body {
  margin-top: 14px;
  line-height: 1.6;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-body p, .post-body ul, .post-body ol, .post-body blockquote {
  margin: 0 0 14px;
}

.post-body blockquote {
  border-left: 3px solid var(--blue-600);
  padding-left: 12px;
  color: var(--gray-700);
}

.perm-group-heading {
  font-size: 0.95rem;
  margin: 20px 0 8px;
  color: var(--gray-700);
}

.perm-group-heading:first-of-type {
  margin-top: 4px;
}

.perm-fieldset {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

.perm-fieldset-overridden {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.perm-fieldset legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 4px;
}

.install-steps {
  padding-left: 20px;
  line-height: 1.8;
}

.perm-fieldset legend .badge {
  vertical-align: middle;
  margin-left: 4px;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  margin: 4px 14px 4px 0;
  font-size: 0.9rem;
}

.radio-inline input { margin: 0; }

@media (min-width: 640px) {
  .container { padding: 24px; }
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 2px;
  background: var(--unread-600);
  color: white;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--navy-900);
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-600);
  margin-right: 6px;
  vertical-align: middle;
}

.whats-new-heading {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gray-500);
  margin: 18px 0 6px;
}

.whats-new-heading:first-of-type {
  margin-top: 4px;
}

.whats-new-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.whats-new-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.whats-new-list li:last-child {
  border-bottom: none;
}

.whats-new-list a {
  text-decoration: none;
  color: var(--gray-900);
  font-weight: 600;
}

.live-badge {
  display: inline-block;
  background: var(--unread-600);
  color: white;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#map {
  height: 320px;
  width: 100%;
  border-radius: 8px;
}

#venues-map,
#licensed-officials-map {
  height: 480px;
  width: 100%;
  border-radius: 8px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.inline-form label {
  margin: 0;
}

.inline-form input[type="number"] {
  width: 100px;
}

.inline-form input[type="search"] {
  width: 240px;
}

.venue-merge-actions {
  white-space: nowrap;
}

.venue-merge-actions form {
  margin: 0 0 6px;
}

.venue-merge-actions form:last-child {
  margin-bottom: 0;
}

#custom-range-fields {
  display: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 4px 12px 12px;
  margin: 10px 0;
}

.post-read h2 a {
  color: var(--gray-700);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.card-actions form {
  margin: 0;
}

.link-button-quiet {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.videos-heading {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.video-embed-wrapper {
  position: relative;
  width: 100%;
  /* Box's own embed code defaults to 500x400 (~4:3) — its player controls
     appear to be laid out around that shape, not a wide 16:9 frame. */
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
  scroll-margin-top: 70px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.video-embed-wrapper:last-child {
  margin-bottom: 0;
}

.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.clip-video {
  width: 100%;
  border-radius: 8px;
  margin: 14px 0;
  background: #000;
}

.response-item {
  border-top: 1px solid var(--gray-200);
  padding-top: 10px;
  margin-top: 10px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  max-width: 100%;
  max-height: 100%;
  width: 700px;
  position: relative;
  padding: 40px 16px 16px;
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-content img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.modal-content iframe {
  width: 100%;
  height: 75vh;
  border: none;
}

.autocomplete-results {
  display: none;
  position: relative;
  z-index: 10;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: white;
  max-height: 260px;
  overflow-y: auto;
  margin-top: -5px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.autocomplete-results.open {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-100);
}

.autocomplete-item::before {
  content: '\1F4CD';
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 1px;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--blue-50);
}
