:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --ink: #172019;
  --muted: #5b675f;
  --faint: #7a8580;
  --line: #d7dfd9;
  --line-strong: #b8c5bd;
  --accent: #176b5d;
  --accent-soft: #e7f3ef;
  --blue: #245b8f;
  --blue-soft: #e7eff8;
  --amber: #a35b13;
  --amber-soft: #f8eee0;
  --red: #9b3430;
  --red-soft: #f7e8e6;
  --shadow: 0 10px 30px rgba(23, 32, 25, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
}

button {
  min-height: 34px;
  padding: 7px 11px;
  font-weight: 750;
  cursor: pointer;
}

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

button:hover {
  border-color: var(--line-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 107, 93, 0.25);
  outline-offset: 2px;
}

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

.app-shell {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.app-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.brand-block,
.info-strip,
.account-panel,
.control-band,
.feed-pane,
.detail-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.brand-block {
  min-width: 230px;
  padding: 14px 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.brand-tagline {
  max-width: 360px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
}

.brand-tagline a {
  white-space: nowrap;
  font-weight: 800;
  text-decoration: none;
}

.mobile-account-toggle,
.account-panel-head,
.filter-toggle,
.mobile-detail-bar {
  display: none;
}

.mobile-account-toggle {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 36px;
  padding: 7px 11px;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.account-toggle-main,
.account-toggle-sub {
  display: block;
  line-height: 1.05;
}

.account-toggle-sub {
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
  white-space: nowrap;
}

.info-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  background: var(--panel-soft);
}

.info-popover {
  position: relative;
  min-width: 0;
}

.info-popover summary {
  display: flex;
  align-items: center;
  min-height: 100%;
  padding: 13px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.info-popover summary::-webkit-details-marker {
  display: none;
}

.info-popover[open] summary,
.info-popover summary:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.info-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: min(430px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  text-transform: none;
  overflow-wrap: anywhere;
}

.info-popover:first-child .info-panel {
  right: auto;
  left: 0;
}

.info-panel h2 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.info-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}

.info-close {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.info-panel p {
  margin: 8px 0 0;
}

.info-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-note {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.public-link-form {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin-top: 10px;
}

.public-link-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.public-link-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.public-link-form input {
  min-width: 0;
  height: 36px;
  padding: 6px 9px;
}

.account-panel {
  display: none;
  position: absolute;
  z-index: 45;
  top: 0;
  right: 0;
  width: 310px;
  margin-left: auto;
  max-height: min(72vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  box-shadow: var(--shadow);
}

.account-panel.has-admin {
  width: min(520px, calc(100vw - 28px));
}

body.account-open .account-panel {
  display: block;
}

.account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.account-benefit {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.auth-state {
  display: grid;
  gap: 8px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.auth-mode-tab {
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-mode-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-button,
.save-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 7px 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.save-search {
  background: var(--panel);
  color: var(--accent);
}

.save-search.saved {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: default;
  opacity: 1;
}

.save-search-group {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 280px;
  margin-right: auto;
}

.saved-search-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.saved-search-status button {
  min-height: 28px;
  padding: 4px 8px;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.saved-search-status button.active {
  background: var(--accent);
  color: #fff;
}

.auth-form,
.email-login {
  display: grid;
  gap: 5px;
}

.auth-form {
  padding-top: 2px;
}

.auth-form label,
.email-login label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.email-login > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.auth-form input,
.email-login input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 9px;
}

.auth-form button {
  min-height: 36px;
  margin-top: 3px;
}

.account-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.auth-message,
.account-trustee-actions,
.saved-searches,
.saved-objects,
.admin-panel {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-message.error {
  color: var(--red);
}

.saved-searches,
.account-trustee-actions,
.saved-objects,
.admin-panel {
  display: grid;
  gap: 5px;
}

.account-trustee-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 6px 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.account-trustee-link:hover {
  color: #fff;
}

.account-section-title {
  padding-top: 6px;
  color: var(--ink);
  font-weight: 850;
}

.saved-search-note {
  padding: 6px 0 3px;
  color: var(--muted);
}

.saved-search-row,
.saved-object-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.saved-object-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.saved-search-open,
.saved-object-open {
  min-width: 0;
  border-color: transparent;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-search-open:hover,
.saved-object-open:hover {
  border-color: transparent;
  text-decoration: underline;
}

.saved-search-row button,
.saved-object-row button {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 12px;
}

.saved-object-kind {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.saved-search-mail {
  position: relative;
  border-color: var(--line);
  background: #eef1ef;
  color: var(--faint);
  cursor: help;
}

.saved-search-mail.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.saved-search-mail:hover {
  border-color: var(--line);
}

.saved-search-mail.active:hover {
  border-color: var(--accent);
}

.saved-search-mail::after {
  position: absolute;
  z-index: 80;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  width: min(260px, calc(100vw - 28px));
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow);
  content: attr(data-tooltip);
}

.saved-search-mail:hover::after,
.saved-search-mail:focus-visible::after {
  display: block;
}

.saved-search-expand {
  width: 100%;
  margin-top: 3px;
  color: var(--accent);
}

.admin-empty,
.admin-section-title {
  color: var(--muted);
}

.admin-section-title {
  padding-top: 6px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-review-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.admin-review-row strong,
.admin-review-row p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-review-row strong {
  color: var(--ink);
}

.admin-review-row p {
  margin: 0;
}

.admin-review-meta {
  overflow-wrap: anywhere;
}

.admin-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-review-actions button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.plain-button.danger {
  border-color: var(--red);
  color: var(--red);
}

.trustee-portal {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.information-portal {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.portal-head,
.portal-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.portal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 18px;
}

.portal-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.portal-head h1,
.portal-section h2 {
  margin: 0;
  line-height: 1.15;
}

.portal-head h1 {
  font-size: 28px;
  overflow-wrap: anywhere;
}

.portal-back {
  justify-self: start;
  text-decoration: none;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.info-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.info-page-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.info-page-nav a.active,
.info-page-nav a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.info-page {
  display: grid;
  gap: 12px;
}

.portal-section {
  min-width: 0;
  max-width: 100%;
  padding: 16px;
}

.portal-section h2 {
  font-size: 19px;
  overflow-wrap: anywhere;
}

.portal-section p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.info-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.embed-example {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-preview {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.embed-preview iframe {
  display: block;
  width: 100%;
  height: 390px;
  border: 0;
  background: var(--panel-soft);
}

.portal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
}

.portal-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-form label.wide,
.portal-form button {
  grid-column: 1 / -1;
}

.portal-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.portal-form input,
.portal-form textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.portal-form input[readonly] {
  background: var(--panel-soft);
  color: var(--muted);
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.portal-form textarea {
  resize: vertical;
}

.portal-form button {
  justify-self: start;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.hosted-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-form .hosted-form-actions .plain-button {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}

.hosted-listings {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.hosted-listing-row {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.hosted-listing-row strong {
  color: var(--ink);
}

.hosted-listing-row.selected {
  border-color: var(--accent);
  background: #eef6ff;
}

.hosted-listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hosted-listing-actions button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.hosted-document-manager {
  display: grid;
  gap: 8px;
}

.hosted-document-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  min-width: 0;
}

.hosted-document-row strong,
.hosted-document-row span {
  overflow-wrap: anywhere;
}

.hosted-document-name {
  display: grid;
  gap: 4px;
}

.hosted-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hosted-document-actions button,
.hosted-document-row > button {
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.inline-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 760;
}

.inline-confirm.destructive {
  border-color: var(--red);
}

.admin-document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-document-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel-soft);
  overflow-wrap: anywhere;
}

.trustee-embed-help {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.trustee-embed-help h3 {
  margin: 0;
  font-size: 15px;
}

.trustee-embed-help p,
.trustee-embed-help .embed-example {
  margin-top: 0;
}

.trustee-embed-help button {
  justify-self: start;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.workspace-heading div {
  min-width: 0;
}

.workspace-heading p {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.workspace-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.workspace-heading span {
  flex: 0 1 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-align: right;
}

.segments {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.segment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  background: var(--panel-soft);
}

.segment-label {
  line-height: 1.12;
}

.segment.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.segment-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(63, 74, 82, 0.1);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 850;
}

.segment.active .segment-count {
  background: rgba(190, 74, 35, 0.14);
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field span,
.field label,
.toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.field input,
.field select {
  min-width: 0;
  width: 100%;
  height: 36px;
  padding: 6px 9px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  white-space: nowrap;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  gap: 12px;
  align-items: start;
}

.feed-pane,
.detail-pane {
  min-width: 0;
}

.feed-pane {
  padding: 0;
  overflow: hidden;
}

.feed-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: end;
  min-height: 48px;
  padding: 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel);
}

.tab-scope-note {
  flex: 1 1 220px;
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.sort-field {
  width: min(100%, 190px);
}

.plain-button {
  background: var(--panel);
}

.clear-button {
  width: 100%;
  height: 32px;
}

.feed-list {
  display: grid;
}

.opportunity-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  text-align: left;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.opportunity-card:hover,
.opportunity-card.selected {
  background: #fbfcfb;
}

.opportunity-card.selected {
  background: #f7fbf9;
  box-shadow: inset 5px 0 0 var(--accent);
}

.opportunity-card.no-media {
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 112px;
}

.opportunity-card.no-media .thumb {
  width: 76px;
  height: 76px;
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  line-height: 1.15;
}

.thumb {
  position: relative;
  overflow: hidden;
  width: 128px;
  height: 108px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9eeec;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.loading img:not([src]) {
  display: none;
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.notice-thumb {
  background: var(--amber-soft);
  color: var(--amber);
}

.notice-card.no-media .thumb {
  background: var(--amber-soft);
  color: var(--amber);
}

.card-body {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.badge,
.flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}

.badge.source {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.status-open,
.badge.status-listed,
.badge.status-closing_soon {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.status-closed {
  background: var(--red-soft);
  color: var(--red);
}

.flag {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.kind {
  background: #edf0f2;
  color: #3f4a52;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 19px;
  line-height: 1.18;
  font-weight: 850;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row,
.money-row,
.company-row,
.company-facts-row,
.fact-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.company-facts-row {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.fact-row {
  gap: 6px;
}

.fact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border: 1px solid rgba(23, 107, 93, 0.2);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
  white-space: nowrap;
}

.fact-chip.warning {
  border-color: rgba(163, 91, 19, 0.24);
  background: var(--amber-soft);
  color: var(--amber);
}

.money-row {
  color: var(--ink);
  font-weight: 750;
}

.money-row .amount {
  font-size: 17px;
  font-weight: 850;
}

.load-more {
  width: calc(100% - 24px);
  margin: 12px;
  background: var(--panel-soft);
}

.load-more[hidden] {
  display: none;
}

.detail-pane {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-empty {
  color: var(--muted);
  min-height: 160px;
}

.detail-media {
  overflow: hidden;
  height: 230px;
  margin: -16px -16px 14px;
  border-bottom: 1px solid var(--line);
  background: #e9eeec;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-media.loading img:not([src]) {
  display: none;
}

.detail-media.placeholder {
  display: grid;
  place-items: center;
  height: 132px;
  color: var(--muted);
  font-weight: 850;
}

.detail-title {
  margin: 6px 0 12px;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: 0;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.source-link,
.save-object,
.copy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  padding: 7px 11px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.save-object {
  border-color: var(--accent);
  background: var(--accent);
}

.save-object.saved {
  background: var(--accent-soft);
  color: var(--accent);
  cursor: default;
  opacity: 1;
}

.copy-link {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}

.source-link-note {
  flex-basis: 100%;
  max-width: 520px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.detail-section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.detail-section h2 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.detail-section p {
  margin: 0;
  line-height: 1.5;
}

.snapshot-summary {
  max-width: 64ch;
  margin-bottom: 10px !important;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
}

.kv dt {
  color: var(--muted);
  font-weight: 750;
}

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

.company-list,
.event-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.mini-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.registry-kv {
  margin-top: 8px;
}

.registry-row .kv {
  font-size: 13px;
}

.snapshot-section .fact-row {
  margin-top: 10px;
}

.mini-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty-state,
.error-state {
  padding: 22px 16px;
  color: var(--muted);
}

.error-state {
  color: var(--red);
}

@media (max-width: 1120px) {
  .app-top,
  .content-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .info-strip {
    width: 100%;
  }

  .account-panel {
    width: auto;
  }

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

  .detail-pane {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  body.info-open {
    overflow: hidden;
  }

  .app-shell {
    width: min(100% - 18px, 1500px);
    padding-top: 10px;
  }

  .app-top {
    gap: 6px;
  }

  .app-top > * {
    min-width: 0;
  }

  .brand-block {
    min-width: 0;
    padding: 10px 12px;
  }

  .brand-row {
    justify-content: flex-start;
    align-items: center;
  }

  .brand {
    font-size: 25px;
  }

  .brand-tagline {
    max-width: none;
    margin-top: 6px;
    font-size: 11px;
  }

  .mobile-account-toggle {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 850;
  }

  .account-toggle-sub {
    font-size: 9px;
  }

  .info-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    max-width: 100%;
  }

  .info-popover {
    flex: 1 1 0;
    width: 100%;
  }

  .info-popover[open]::before {
    content: "";
    position: fixed;
    z-index: 55;
    inset: 0;
    background: rgba(23, 32, 25, 0.28);
  }

  .info-popover summary {
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .info-panel {
    position: fixed;
    z-index: 60;
    top: 10px;
    right: auto;
    bottom: auto;
    left: 10px;
    width: calc(100vw - 20px);
    max-width: none;
    max-height: calc(100dvh - 20px);
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .info-panel-head {
    position: sticky;
    z-index: 1;
    top: -14px;
    align-items: center;
    justify-content: flex-start;
    padding: 14px 0 10px;
    margin: -14px 0 8px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }

  .info-panel-head h2 {
    flex: 1 1 auto;
  }

  .info-close,
  .account-panel-head button,
  .auth-button,
  .auth-mode-tab,
  .auth-form input,
  .auth-form button,
  .email-login input,
  .email-login button,
  .public-link-form input,
  .public-link-form button,
  .saved-search-row button,
  .saved-object-row button,
  .admin-review-actions button,
  .saved-search-expand,
  .source-link,
  .save-object,
  .copy-link {
    min-height: 44px;
  }

  .info-close {
    order: -1;
    margin-right: 6px;
    margin-left: 0;
  }

  .saved-object-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .saved-object-kind {
    grid-column: 1 / -1;
    order: 4;
  }

  .public-link-form > div {
    grid-template-columns: 1fr;
  }

  .account-panel {
    display: none;
    position: fixed;
    z-index: 50;
    inset: 10px;
    width: auto;
    max-height: calc(100dvh - 20px);
    overflow: auto;
    padding: 14px;
    box-shadow: 0 18px 70px rgba(23, 32, 25, 0.24);
  }

  body.account-open .account-panel {
    display: block;
  }

  .account-panel-head {
    display: flex;
  }

  .control-band {
    gap: 7px;
    padding: 8px;
  }

  .workspace-heading {
    display: grid;
    gap: 5px;
  }

  .workspace-heading h1 {
    font-size: 18px;
  }

  .workspace-heading span {
    width: 100%;
    font-size: 12px;
    text-align: left;
  }

  .segments {
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding-right: 0;
    scroll-padding-inline: 8px;
    scrollbar-width: thin;
  }

  .segments::-webkit-scrollbar {
    height: 4px;
  }

  .segment {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    min-height: 48px;
    padding: 7px 8px;
    font-size: 13px;
    line-height: 1.12;
    text-align: center;
  }

  .segment-count {
    min-width: 20px;
    padding: 1px 6px;
    font-size: 10px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
    align-items: end;
    gap: 6px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .clear-button {
    justify-self: start;
    width: auto;
    height: 44px;
    padding-inline: 10px;
  }

  .filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    padding-inline: 12px;
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 850;
  }

  .filter-toggle::after {
    width: 7px;
    height: 7px;
    margin: -3px 0 0 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg);
  }

  body.filters-open .filter-toggle::after {
    margin-top: 3px;
    transform: rotate(225deg);
  }

  .filters .mobile-collapsible {
    display: none;
  }

  body.filters-open .filters .mobile-collapsible {
    display: grid;
    grid-column: auto;
  }

  body.filters-open .filters .toggle.mobile-collapsible {
    display: flex;
    grid-column: 1 / -1;
  }

  .field input,
  .field select,
  .toggle,
  .save-search,
  .filter-toggle {
    min-height: 44px;
    height: 44px;
  }

  .feed-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.72fr);
    align-items: end;
    gap: 6px;
    min-height: 0;
    padding: 7px 8px;
  }

  .tab-scope-note {
    grid-column: 1 / -1;
    max-width: none;
  }

  .sort-field {
    width: 100%;
  }

  .save-search-group {
    max-width: none;
  }

  .sort-field span {
    display: none;
  }

  .portal-head,
  .portal-grid,
  .portal-form {
    grid-template-columns: 1fr;
  }

  .info-page-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .info-page-nav a {
    justify-content: center;
    min-width: 0;
    text-align: center;
  }

  .portal-head {
    display: grid;
    padding: 14px;
  }

  .portal-head h1 {
    font-size: 22px;
  }

  .portal-form label.wide,
  .portal-form button {
    grid-column: auto;
  }

  .content-grid {
    display: block;
  }

  .detail-pane {
    display: none;
    position: static;
    max-height: none;
    padding: 12px;
    box-shadow: none;
  }

  body.mobile-detail-open .feed-pane,
  body.mobile-detail-open .control-band,
  body.mobile-detail-open .info-strip,
  body.mobile-detail-open .mobile-account-toggle {
    display: none !important;
  }

  body.mobile-detail-open .detail-pane {
    display: block;
  }

  body:not(.mobile-detail-open) .detail-pane {
    display: none;
  }

  .mobile-detail-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    min-height: 46px;
    margin: -12px -12px 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
  }

  .mobile-back-button {
    min-height: 44px;
    padding-inline: 12px;
  }

  .opportunity-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    min-height: 116px;
    padding: 10px;
  }

  .opportunity-card.no-media {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 104px;
  }

  .thumb {
    width: 92px;
    height: 92px;
  }

  .opportunity-card.no-media .thumb {
    width: 62px;
    height: 62px;
  }

  .card-title {
    font-size: 16px;
  }

  .badge,
  .flag,
  .fact-chip {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 10px;
  }

  .company-row,
  .company-facts-row {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .company-facts-row {
    -webkit-line-clamp: 3;
    width: auto;
  }

  .detail-media {
    height: 210px;
    margin: -12px -12px 12px;
  }

  .detail-media.placeholder {
    height: 108px;
  }

  .detail-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 22px;
  }

  .mobile-account-toggle {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .brand-tagline {
    font-size: 10.5px;
  }

  .embed-preview iframe {
    height: 430px;
  }

  .opportunity-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .thumb {
    width: 88px;
    height: 88px;
  }

  .feed-head {
    grid-template-columns: minmax(0, 1fr) minmax(108px, 0.72fr);
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 3px 0;
  }
}
