:root {
  --ink: #151719;
  --muted: #6b7280;
  --line: #d9dee5;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --accent: #f15a24;
  --accent-dark: #c74318;
  --primary: #151719;
  --primary-soft: #eef0f3;
  --steel: #6b7280;
  --success: #276749;
  --danger: #9f2d2d;
  --shadow: 0 12px 28px rgba(17, 17, 17, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: #b33e15;
  overflow-wrap: anywhere;
}

img,
svg,
video {
  max-width: 100%;
}

main,
section,
article,
form,
fieldset,
dl,
.panel,
.post-card,
.tile {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 28px;
  background: var(--primary);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.14);
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand img {
  display: block;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  width: clamp(170px, 19vw, 205px);
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  min-width: 0;
}

.topbar nav a {
  color: #f9fafb;
  font-weight: 700;
  text-decoration: none;
  position: relative;
}

.topbar nav a:hover,
.topbar nav a:focus {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.topbar nav .current-user-name {
  color: #ff9a72;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(241, 90, 36, 0.8);
  text-underline-offset: 3px;
}

.topbar nav .current-user-name:hover,
.topbar nav .current-user-name:focus {
  color: #ffffff;
  text-decoration-thickness: 2px;
}

.nav-dot {
  position: absolute;
  right: -8px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.message-toast {
  align-items: flex-start;
  background: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  bottom: 20px;
  box-shadow: 0 16px 36px rgba(17, 17, 17, 0.24);
  color: #ffffff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  max-width: calc(100vw - 32px);
  padding: 13px 14px;
  position: fixed;
  right: 20px;
  width: 330px;
  z-index: 1000;
}

.message-toast div {
  display: grid;
  gap: 4px;
}

.message-toast a {
  color: #ffb697;
  font-weight: 700;
}

.message-toast-close {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  min-height: 32px;
  padding: 2px 6px;
}

.message-toast-close:hover,
.message-toast-close:focus {
  background: rgba(255, 255, 255, 0.12);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.app-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  margin: 36px auto 0;
  padding: 16px;
  text-align: center;
  width: min(1180px, calc(100% - 32px));
}

.app-footer a {
  color: var(--accent-dark);
  font-weight: 700;
}

.panel,
.post-card,
.tile,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.auth-login-card {
  padding-top: 14px;
}

.auth-login-card .public-brand {
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.public-brand {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: -2px 0 18px;
  padding-bottom: 18px;
  text-align: center;
}

.public-brand img {
  display: block;
  max-width: min(360px, 100%);
  width: min(78%, 360px);
}

.public-brand p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.public-brand-standalone {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 0 18px;
  padding: 18px;
}

.page-heading {
  margin-bottom: 18px;
}

.back-link {
  margin-bottom: 12px;
}

.page-heading h1,
.panel h1,
.panel h2 {
  color: var(--primary);
  letter-spacing: 0;
  margin-top: 0;
}

.page-heading p {
  color: var(--muted);
  margin-bottom: 0;
}

.panel h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.split,
.post-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}

.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}

.opportunity-feed {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  max-width: 980px;
}

.opportunity-feed-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--steel);
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(17, 17, 17, 0.05);
  display: grid;
  gap: 7px;
  padding: 12px 15px;
}

.opportunity-feed-card.type-steel-for-sale {
  border-left-color: var(--success);
  border-top: 1px solid var(--line);
}

.opportunity-feed-card.type-steel-wanted {
  border-left-color: #4b647f;
  border-top: 1px solid var(--line);
}

.opportunity-feed-card.type-production-request {
  border-left-color: var(--accent);
  border-top: 1px solid var(--line);
}

.opportunity-feed-top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.opportunity-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opportunity-type-badge {
  border: 1px solid transparent;
  font-size: 0.82rem;
  padding: 4px 8px;
}

.opportunity-type-steel-for-sale {
  background: #e8f1ed;
  border-color: #bdd4c8;
  color: #22543d;
}

.opportunity-type-steel-wanted {
  background: #edf1f5;
  border-color: #cbd5df;
  color: #354c63;
}

.opportunity-type-production-request {
  background: #fff2eb;
  border-color: #f3c4b2;
  color: #8b3516;
}

.opportunity-status {
  background: #f4f5f6;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 3px 7px;
}

.opportunity-status.status-open {
  color: var(--success);
}

.opportunity-status.status-pending {
  color: #7c5b18;
}

.opportunity-posted {
  flex: 0 0 auto;
  font-size: 0.84rem;
  white-space: nowrap;
}

.opportunity-feed-title {
  font-size: 1.08rem;
  line-height: 1.3;
  margin: 0;
}

.opportunity-feed-title a {
  color: var(--primary);
  text-decoration-color: rgba(241, 90, 36, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.opportunity-feed-title a:hover,
.opportunity-feed-title a:focus {
  color: var(--accent-dark);
}

.opportunity-metadata {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 3px 0;
  line-height: 1.45;
}

.opportunity-metadata span {
  min-width: 0;
}

.opportunity-metadata span:not(:last-child)::after {
  color: #a4aab2;
  content: " · ";
  margin: 0 7px;
}

.opportunity-metadata strong {
  color: #4a515b;
}

.opportunity-feed-actions {
  align-items: center;
  border-top: 1px solid #eceff2;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 6px 12px;
  padding-top: 7px;
}

.opportunity-feed-actions a {
  font-weight: 700;
}

.responded-indicator {
  color: var(--success);
  font-weight: 700;
}

.tile {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tile:hover,
.tile:focus {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.11);
  transform: translateY(-1px);
}

.tile span,
.muted {
  color: var(--muted);
}

.stack,
.grid-form {
  display: grid;
  gap: 16px;
}

.grid-form {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.compact-stack {
  gap: 6px;
}

.admin-filter-bar label {
  min-width: 180px;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  font-weight: 400;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.16);
  outline: none;
}

.input-error {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.turnstile-field {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 100%;
  overflow: hidden;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}

.check input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 5px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 42px;
  text-align: center;
}

button:hover,
.button:hover,
button:focus,
.button:focus {
  background: #252a30;
}

.secondary {
  background: var(--steel);
}

.danger {
  background: var(--danger);
}

.topbar button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 8px 12px;
}

.topbar button:hover,
.topbar button:focus {
  background: rgba(255, 255, 255, 0.12);
}

.mini-form {
  margin-top: 8px;
}

.mini-form input {
  width: 180px;
}

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

.inline select {
  min-width: 120px;
}

.status-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tabs,
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.post-type-help {
  background: var(--primary-soft);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin: -4px 0 18px;
  padding: 10px 12px;
}

.post-type-help p {
  color: var(--muted);
  margin: 3px 0 0;
}

.account-actions {
  justify-content: flex-start;
  margin-bottom: 0;
}

.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-menu {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
}

.filter-options {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  min-width: min(680px, calc(100vw - 48px));
  margin-top: 10px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.state-region {
  padding: 10px;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px 10px;
}

.active-filters {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.required {
  color: var(--danger);
}

.tooltip {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: help;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.saved-profile {
  background: #f8fafc;
}

.profile-draft-hidden {
  display: none !important;
}

.location-draft-hidden {
  display: none !important;
}

[data-location-manager] [data-repeatable-items] {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

[data-location-manager] [data-add-location] {
  margin-top: 4px;
}

.location-summary {
  align-self: center;
  margin: 0;
  font-weight: 700;
}

.profile-summary {
  align-self: center;
  margin: 0;
  font-weight: 700;
}

.saved-entry-row {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.saved-entry-row .location-summary,
.saved-entry-row .profile-summary {
  grid-column: auto;
  min-width: 0;
}

.saved-entry-row .profile-actions {
  grid-column: auto;
  justify-content: flex-end;
}

.profile-actions {
  align-self: end;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

[data-location-manager] .profile-actions {
  align-items: center;
  gap: 10px;
}

.tabs a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  padding: 8px 12px;
  text-decoration: none;
}

.tabs a:hover,
.tabs a:focus {
  border-color: var(--accent);
  background: #fff7f2;
  color: var(--primary);
}

.tabs .active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.tabs .active:hover,
.tabs .active:focus {
  color: #ffffff;
  background: var(--accent-dark);
}

.list {
  display: grid;
  gap: 16px;
}

.tag,
.status,
.notice {
  display: inline-flex;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--primary-soft);
  color: #2f3742;
  font-size: 0.85rem;
  font-weight: 700;
}

.notice.small {
  font-size: 0.9rem;
}

.type-steel-for-sale {
  border-top: 5px solid var(--success);
}

.type-steel-wanted {
  border-top: 5px solid #4b647f;
}

.type-production-request {
  border-top: 5px solid var(--accent);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

legend {
  font-weight: 700;
}

.repeatable-item {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
}

.location-grid,
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  align-items: end;
}

.profile-grid label > span,
.grid-form label > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 1.4em;
}

.profile-grid label > span {
  white-space: nowrap;
}

.profile-grid .tooltip {
  flex: 0 0 auto;
}

.help {
  color: var(--muted);
}

.notice {
  display: block;
  margin-bottom: 16px;
  background: #fff2eb;
  border-left: 4px solid var(--accent);
  color: #7a2c10;
}

.details {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 8px 18px;
}

.details dt {
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact {
  grid-template-columns: minmax(160px, 220px) 1fr;
}

.response {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.compact-response {
  display: grid;
  gap: 6px;
}

.compact-response p {
  margin: 0;
}

.response-meta {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.response-meta > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.messages {
  background: #f0f2f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(62vh, 680px);
  min-height: 280px;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.message {
  align-self: flex-start;
  display: flex;
  max-width: min(78%, 720px);
  width: fit-content;
}

.message-bubble {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 3px 10px rgba(17, 17, 17, 0.05);
  min-width: 180px;
  padding: 8px 11px;
}

.message p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-meta {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  gap: 16px;
  justify-content: space-between;
}

.message-meta span {
  color: var(--muted);
  white-space: nowrap;
}

.message.mine {
  align-self: flex-end;
}

.message.mine .message-bubble {
  background: #fff3ec;
  border-color: rgba(241, 90, 36, 0.3);
  border-radius: 14px 4px 14px 14px;
}

.unread-thread {
  border-left: 5px solid var(--accent);
}

.unread-label {
  display: inline-flex;
  border-radius: 6px;
  padding: 3px 7px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.compact-unread-label {
  margin-left: 6px;
  padding: 2px 6px;
}

.unread-response-link {
  font-weight: 800;
}

.message-type-badge {
  flex: 0 0 auto;
  font-size: 0.82rem;
  padding: 4px 7px;
}

.message-inbox,
.respondent-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.message-inbox-row,
.respondent-row {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 14px;
}

.message-inbox-row:last-child,
.respondent-row:last-child {
  border-bottom: 0;
}

.message-inbox-row:hover,
.message-inbox-row:focus-within,
.respondent-row:hover,
.respondent-row:focus-within {
  background: #fafafa;
  box-shadow: inset 3px 0 0 rgba(241, 90, 36, 0.45);
}

.message-row-link {
  color: inherit;
  display: block;
  min-width: 0;
  text-decoration: none;
}

.message-row-link:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.message-inbox-main,
.respondent-row-main {
  min-width: 0;
}

.message-inbox-heading,
.respondent-row-heading,
.message-inbox-detail,
.respondent-row-detail {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.message-inbox-title {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.message-inbox-title strong,
.respondent-row-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-inbox-detail,
.respondent-row-detail {
  color: var(--muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  margin-top: 5px;
}

.message-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-activity {
  flex: 0 0 auto;
  font-size: 0.84rem;
  white-space: nowrap;
}

.message-row-action {
  align-self: center;
  margin: 0;
}

.link-button {
  background: transparent;
  color: var(--muted);
  min-height: 0;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover,
.link-button:focus {
  background: transparent;
  color: var(--accent-dark);
}

.conversation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.compact-button {
  min-height: 36px;
  padding: 7px 10px;
}

.your-post-card {
  background: #fafbfb;
  border-left: 5px solid var(--primary);
}

.your-post-card:hover,
.your-post-card:focus-within {
  background: #f6f7f8;
}

.your-post-badge {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.post-hub-heading,
.thread-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.post-hub-heading h1,
.thread-title-row h1 {
  margin: 0;
}

.post-hub-meta,
.thread-participant {
  margin: 6px 0 0;
}

.chat-panel {
  padding: 14px;
}

.message-composer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
}

.message-composer-row {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.message-composer textarea {
  min-height: 76px;
  resize: vertical;
}

.message-composer button {
  align-self: stretch;
  min-width: 92px;
}

.message-composer-help {
  font-size: 0.8rem;
}

.danger-zone {
  border-color: #d69a9a;
}

.archived-post {
  background: #f0f2f4;
}

.compact-post-list {
  gap: 10px;
}

.compact-post-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.compact-post-top {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.compact-post-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.compact-post-title h3,
.message-card h2,
.post-card h2 {
  overflow-wrap: anywhere;
}

.compact-post-title h3,
.compact-post-meta,
.compact-post-note {
  margin: 0;
}

.compact-post-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.compact-post-bottom {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

.compact-post-status {
  margin-left: auto;
}

.compact-post-meta {
  color: var(--muted);
}

.table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

table {
  min-width: 760px;
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.compact-table th,
.compact-table td {
  padding: 8px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #fff7f2;
}

@media (max-width: 1023px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-inline: 20px;
  }

  .topbar nav {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .container,
  .app-footer {
    width: min(100% - 28px, 1180px);
  }

  .filter-options {
    max-height: 360px;
  }

  .admin-filter-bar label {
    flex: 1 1 210px;
    min-width: min(210px, 100%);
  }

  .compact-post-top,
  .compact-post-bottom,
  .response-meta {
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .topbar,
  .split,
  .post-card-head {
    display: grid;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .container {
    width: min(100% - 24px, 1180px);
    margin: 20px auto;
  }

  .app-footer {
    width: min(100% - 24px, 1180px);
  }

  .panel,
  .post-card,
  .tile,
  .empty {
    padding: 16px;
  }

  .topbar {
    gap: 14px;
    padding: 10px 16px;
  }

  .brand img {
    max-height: 53px;
    width: clamp(148px, 50vw, 174px);
  }

  .topbar nav {
    display: grid;
    gap: 6px 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .topbar nav a,
  .topbar nav form,
  .topbar nav button {
    min-width: 0;
    width: 100%;
  }

  .topbar nav a {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    min-height: 42px;
    padding: 7px 8px;
    text-align: center;
  }

  .topbar .inline {
    display: flex;
  }

  .page-heading h1,
  .panel h1 {
    font-size: 1.55rem;
  }

  .panel h2,
  .post-card h2,
  .message-card h2 {
    font-size: 1.15rem;
  }

  .tabs,
  .toolbar,
  .filters,
  .actions {
    align-items: stretch;
  }

  .grid-form,
  .location-grid,
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-form > *,
  .location-grid > *,
  .profile-grid > * {
    grid-column: 1;
  }

  .tabs a,
  .toolbar label,
  .filters label,
  .filter-menu {
    width: 100%;
  }

  .filter-options {
    min-width: 0;
    width: 100%;
  }

  .state-grid {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  }

  .details {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .details dt {
    margin-top: 9px;
  }

  .details dd {
    padding-bottom: 4px;
  }

  .response-meta,
  .message-card-top,
  .compact-post-top,
  .compact-post-bottom {
    display: grid;
    justify-content: stretch;
  }

  .response-meta .muted {
    justify-self: start;
  }

  .compact-post-actions,
  .compact-post-status,
  .profile-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .saved-entry-row {
    grid-template-columns: 1fr;
  }

  .saved-entry-row .profile-actions {
    justify-content: flex-start;
  }

  .compact-post-title {
    align-items: flex-start;
  }

  .compact-post-title h3 {
    flex: 1 1 100%;
  }

  .compact-post-status {
    align-items: stretch;
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr);
    width: 100%;
  }

  .compact-post-status select {
    width: 100%;
  }

  .public-brand img {
    width: min(78%, 280px);
  }

  .public-brand {
    gap: 7px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .public-brand p {
    font-size: 0.93rem;
  }

  .auth-login-card {
    padding-top: 12px;
  }

  fieldset {
    min-width: 0;
    padding: 14px;
  }

  .profile-grid label > span {
    white-space: normal;
  }

  input[type="file"] {
    overflow: hidden;
  }

  .opportunity-feed-top {
    align-items: flex-start;
  }

  .opportunity-metadata span:not(:last-child)::after {
    margin: 0 5px;
  }

  .message-inbox-row,
  .respondent-row {
    align-items: stretch;
    gap: 5px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .message-inbox-heading,
  .respondent-row-heading {
    align-items: flex-start;
    display: grid;
  }

  .message-inbox-title {
    flex-wrap: wrap;
  }

  .message-inbox-title strong,
  .respondent-row-heading strong,
  .message-preview {
    white-space: normal;
  }

  .message-activity {
    justify-self: start;
  }

  .message {
    max-width: 88%;
  }

  .message-composer-row {
    grid-template-columns: 1fr;
  }

  .message-composer button {
    justify-self: end;
    min-height: 42px;
    min-width: 110px;
  }

  .message-row-action .link-button {
    min-height: 40px;
    padding: 8px;
  }

  .conversation-actions {
    justify-content: flex-start;
  }

  .conversation-actions form {
    flex: 1 1 180px;
  }

  .conversation-actions button {
    width: 100%;
  }

  .toolbar.admin-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar.admin-filter-bar > * {
    width: 100%;
  }

  .table-wrap {
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  ul {
    padding-left: 22px;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 16px, 1180px);
    margin: 16px auto;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand img {
    max-height: 46px;
    width: clamp(136px, 56vw, 164px);
  }

  .topbar nav {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar nav a,
  .topbar button,
  button,
  .button {
    font-size: 0.95rem;
  }

  .panel,
  .post-card,
  .tile,
  .empty {
    padding: 14px;
  }

  .page-heading {
    margin-bottom: 14px;
  }

  .page-heading .button,
  .split > .button {
    width: 100%;
  }

  .opportunity-feed-card {
    padding: 11px 12px;
  }

  .opportunity-feed-top {
    display: grid;
    gap: 5px;
  }

  .opportunity-posted {
    white-space: normal;
  }

  .opportunity-metadata {
    display: grid;
    gap: 3px;
  }

  .opportunity-metadata span:not(:last-child)::after {
    content: "";
    margin: 0;
  }

  .grid-form,
  .stack {
    gap: 12px;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .tabs a {
    text-align: center;
    width: 100%;
  }

  .inline {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .inline select,
  .inline button,
  .inline .button {
    min-width: 0;
  }

  .filter-actions,
  .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-actions button,
  .profile-actions button,
  .actions button,
  .actions .button,
  [data-add-location],
  [data-add-profile] {
    width: 100%;
  }

  .filter-menu {
    width: 100%;
  }

  .filter-options {
    max-height: 56vh;
  }

  .state-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .check {
    min-width: 0;
  }

  .check span {
    overflow-wrap: anywhere;
  }

  .messages {
    max-height: 58vh;
    min-height: 240px;
    padding: 10px;
  }

  .message {
    max-width: 94%;
  }

  .message-bubble {
    min-width: 0;
  }

  .message-meta {
    align-items: flex-start;
    gap: 8px;
  }

  .message-meta span {
    white-space: normal;
  }

  .message-inbox-row,
  .respondent-row {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .message-row-action {
    justify-self: end;
  }

  .message-inbox-detail,
  .respondent-row-detail {
    align-items: flex-start;
    display: grid;
    justify-content: stretch;
  }

  .conversation-actions {
    justify-content: flex-start;
  }

  .message-toast {
    bottom: max(72px, env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
    padding: 10px 11px;
    right: 12px;
    width: auto;
  }

  .message-composer button {
    justify-self: stretch;
    width: 100%;
  }

  .message-composer-help {
    line-height: 1.35;
  }

  .narrow .stack > button,
  .narrow form > button {
    width: 100%;
  }

  .compact-post-status {
    grid-template-columns: 1fr;
  }

  .compact-post-status .status-label {
    margin-bottom: -2px;
  }

  .details dt {
    margin-top: 6px;
  }

  .mini-form,
  .mini-form input,
  .mini-form select,
  .mini-form button {
    width: 100%;
  }

  .notice,
  .field-error,
  .help,
  .location-summary,
  .profile-summary {
    overflow-wrap: anywhere;
  }

  legend {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 390px) {
  .container,
  .app-footer {
    width: min(100% - 12px, 1180px);
  }

  .topbar {
    padding-inline: 10px;
  }

  .brand img {
    width: min(158px, 52vw);
  }

  .topbar nav a,
  .topbar nav button {
    font-size: 0.9rem;
    padding-inline: 6px;
  }

  .panel,
  .post-card,
  .tile,
  .empty {
    padding: 12px;
  }

  .public-brand img {
    width: min(76%, 250px);
  }

  .public-brand p {
    font-size: 0.88rem;
  }

  .turnstile-field {
    transform-origin: left top;
  }

  .cf-turnstile {
    max-width: 100%;
  }

  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .message {
    max-width: 97%;
  }

  .message-meta {
    display: grid;
  }
}
