:root {
  --bg: #f6f7f2;
  --surface: #fff;
  --ink: #183d37;
  --body: #354b45;
  --muted: #596a60;
  --line: #dde4dc;
  --primary: #20574b;
  --soft: #edf3ec;
  --gold: #e6c978;
  --danger: #9c352e;
  --shadow: 0 12px 40px #183d3718;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --type-page: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --type-display: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --type-section: 1.25rem;
  --type-card: 1.125rem;
  --type-subheading: 1rem;
  --type-body: 1rem;
  --type-label: 0.875rem;
  --type-meta: 0.8125rem;
  --type-eyebrow: 0.75rem;
  --type-stat: 2rem;
  --leading-body: 1.6;
  --leading-heading: 1.3;
  --radius-control: 8px;
  --radius-surface: 12px;
  --control-min-height: 44px;
  --mobile-nav-height: calc(
    var(--space-12) + var(--space-6) + env(safe-area-inset-bottom, 0px)
  );
  --mobile-header-height: 56px;
  --app-height: 100dvh;
  --undo-reserve: 0px;
  --control-border: #819589;
  --control-placeholder: #596a60;
  --focus-ring: #90621a;
  --on-primary: #fff;
  --primary-hover: #184b3f;
  --selection-bg: #d9e8dc;
  --warning-bg: #fff2d9;
  --warning-ink: #795409;
  --danger-bg: #fce9e7;
  --danger-ink: #9c352e;
  --danger-hover: #822f29;
  --on-danger: #fff;
  --disabled-bg: #edf0eb;
  --motion-fast: 160ms;
  --motion-standard: 220ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  line-height: var(--leading-body);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  min-width: var(--control-min-height);
  min-height: var(--control-min-height);
}
button:disabled {
  cursor: default;
  color: var(--muted);
  opacity: 1;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:not([aria-disabled="true"]):hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-size: var(--type-subheading);
}
h1 {
  font-size: var(--type-page);
  font-weight: 600;
}
h2 {
  font-size: var(--type-section);
  font-weight: 600;
}
h3 {
  font-size: var(--type-subheading);
  font-weight: 600;
}
p {
  margin-top: var(--space-2);
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: var(--type-meta);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  background: var(--surface);
  padding: var(--space-4);
}
.skip-link:focus {
  top: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-card);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.brand-mark span {
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.brand-mark span:after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.eyebrow {
  font-size: var(--type-eyebrow);
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--soft);
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--type-meta);
  font-weight: 600;
}
.badge.warn {
  background: var(--warning-bg);
  color: var(--warning-ink);
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: var(--space-8) var(--space-4);
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  overflow-y: auto;
}
.sidebar .brand {
  padding: 0 var(--space-2);
}
.chapter-label {
  padding: var(--space-3) var(--space-3);
  border-radius: 12px;
  background: var(--soft);
}
.chapter-label strong {
  display: block;
  font-size: var(--type-label);
  color: var(--ink);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 9px;
  font-size: var(--type-label);
  color: var(--muted);
  font-weight: 600;
  min-height: var(--control-min-height);
}
.nav a:not([aria-disabled="true"]):hover {
  background: var(--bg);
  text-decoration: none;
}
.nav a.active {
  color: var(--primary);
  background: var(--soft);
}
.nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.sidebar-footer .user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-label);
}
.signout {
  font-size: var(--type-label);
  background: none;
  border: 0;
  color: var(--muted);
  padding: var(--space-2) 0;
  min-height: var(--control-min-height);
}
.avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dfebe0;
  color: var(--primary);
  font-size: var(--type-label);
  font-weight: 700;
}
.avatar.large {
  width: 64px;
  height: 64px;
  font-size: var(--type-section);
}
.avatar.gold {
  background: #f3e6c6;
  color: #765523;
}
.content {
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-8);
  border-bottom: 1px solid var(--line);
  font-size: var(--type-meta);
  min-height: 72px;
  background: var(--surface);
}
.topbar .context {
  color: var(--muted);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-12);
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.page-heading p {
  font-size: var(--type-body);
  color: var(--muted);
  max-width: 640px;
}
.page-heading .eyebrow {
  margin-bottom: var(--space-2);
}
.actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--type-label);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-min-height);
  min-width: var(--control-min-height);
  max-width: 100%;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.button.danger {
  color: var(--danger);
}
.button.small {
  padding: var(--space-1) var(--space-3);
  min-height: var(--control-min-height);
  font-size: var(--type-label);
}
.button.ghost {
  background: transparent;
  border-color: transparent;
}
.button[aria-pressed="true"] {
  background: var(--soft);
  color: var(--primary);
  border-color: var(--primary);
}
.hero {
  background: #e8efe3;
  border: 1px solid #d5e2d0;
  border-radius: 15px;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-family: Georgia, serif;
  font-size: var(--type-display);
  font-weight: 400;
  max-width: 650px;
}
.hero p {
  max-width: 530px;
  color: #476251;
  font-size: var(--type-body);
}
.hero .eyebrow {
  color: #486a54;
  margin-bottom: var(--space-3);
}
.hero:after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid #98b18c;
  border-radius: 50%;
  right: -70px;
  top: -80px;
  box-shadow:
    0 0 0 24px #e8efe3,
    0 0 0 25px #afc39f,
    0 0 0 49px #e8efe3,
    0 0 0 50px #c2d2b6;
  opacity: 0.5;
  pointer-events: none;
}
.hero .pill {
  margin-top: var(--space-4);
  background: #f5f8ef;
}
.searchbar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.searchbar > input {
  flex: 1 1 12rem;
  min-width: 0;
}
.searchbar .button {
  height: auto;
}
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.filters summary {
  cursor: pointer;
  font-size: var(--type-label);
  font-weight: 600;
  color: var(--ink);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-4);
}
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-6) 0 var(--space-4);
  font-size: var(--type-label);
  gap: var(--space-3);
}
.results-bar strong {
  color: var(--ink);
}
.results-bar .actions {
  gap: var(--space-1);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-6);
  box-shadow: none;
  min-width: 0;
}
.person-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.person-top {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.person-card p {
  margin-top: var(--space-1);
  font-size: var(--type-body);
}
.person-card .meta {
  font-size: var(--type-meta);
  color: var(--muted);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.person-card .tags {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: auto;
}
.person-card .tags span {
  font-size: var(--type-meta);
  background: var(--bg);
  padding: var(--space-1) var(--space-2);
  border-radius: 5px;
  color: var(--muted);
}
.person-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  gap: var(--space-2);
}
.person-card .card-footer button {
  font-size: var(--type-meta);
}
.name-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  max-width: 100%;
}
.name-button:not(:disabled):not([aria-disabled="true"]):not(
    [aria-busy="true"]
  ):hover {
  text-decoration: underline;
}
.cards.list-view {
  grid-template-columns: 1fr;
}
.list-view .person-card {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
}
.list-view .card-footer {
  border: 0;
  padding: 0;
}
.empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.empty .empty-symbol {
  font-size: var(--type-stat);
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.empty p {
  max-width: 440px;
  margin: var(--space-2) auto var(--space-4);
  color: var(--muted);
  font-size: var(--type-label);
}
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-6) 0 var(--space-3);
}
.section-title h2 {
  font-size: var(--type-section);
}
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.tabs .button {
  background: transparent;
  border-color: transparent;
}
.tabs .button.active {
  background: var(--soft);
  color: var(--primary);
}
label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--ink);
  font-size: var(--type-label);
  font-weight: 600;
}
input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 7px;
  color: var(--body);
  padding: var(--space-2) var(--space-3);
  min-height: var(--control-min-height);
  width: 100%;
  font-weight: 400;
  min-width: 0;
  font-size: var(--type-body);
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--control-placeholder);
  opacity: 1;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
input[type="checkbox"] {
  min-height: auto;
  width: 20px;
  height: 20px;
  padding: 0;
  accent-color: var(--primary);
}
.check-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-min-height);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  max-width: 960px;
}
.form-section h2 {
  font-size: var(--type-section);
  margin-bottom: var(--space-2);
}
.form-section > p {
  color: var(--muted);
  font-size: var(--type-label);
  margin-bottom: var(--space-6);
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-6);
}
.form-error {
  color: var(--danger);
  font-size: var(--type-label);
  margin-top: var(--space-3);
}
.note {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--type-body);
  color: var(--primary);
  margin: var(--space-4) 0;
}
.group-card,
.opportunity-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.group-card .group-symbol {
  background: var(--soft);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  font-weight: 700;
}
.group-card p,
.opportunity-card p {
  font-size: var(--type-body);
  margin: 0;
  color: var(--muted);
}
.group-card .actions,
.opportunity-card .actions {
  margin-top: auto;
}
.opportunity-card .company {
  font-size: var(--type-label);
  color: var(--primary);
}
.opportunity-card .description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr);
  gap: var(--space-6);
}
.saved-card {
  margin-bottom: var(--space-3);
}
.saved-card .person-top {
  margin-bottom: var(--space-3);
}
.saved-card .saved-note {
  border-left: 2px solid var(--line);
  padding-left: var(--space-3);
  margin: var(--space-3) 0;
  font-size: var(--type-body);
  white-space: pre-wrap;
}
.list-card {
  margin-bottom: var(--space-3);
  padding: var(--space-4);
}
.list-card p {
  font-size: var(--type-body);
  color: var(--muted);
}
.list-card .actions {
  margin-top: var(--space-3);
}
.request-card {
  margin-bottom: var(--space-3);
}
.request-card .request-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.request-card p {
  font-size: var(--type-body);
}
.history {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.history span {
  font-size: var(--type-meta);
  background: var(--bg);
  padding: var(--space-1) var(--space-2);
  border-radius: 5px;
}
.request-card .actions {
  margin-top: var(--space-4);
}
.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  min-height: 480px;
  height: min(720px, calc(var(--app-height) - 240px));
  max-height: none;
}
.room-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: var(--space-3);
}
.room-button {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) var(--space-3);
  width: 100%;
  text-align: left;
  color: var(--ink);
  border-radius: 6px;
  min-height: var(--control-min-height);
  overflow-wrap: anywhere;
}
.room-button.active {
  background: var(--soft);
}
.room-button strong {
  display: block;
  font-size: var(--type-label);
}
.room-button small {
  display: block;
  font-size: var(--type-meta);
  margin-top: var(--space-1);
}
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.chat-heading {
  border-bottom: 1px solid var(--line);
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.chat-heading :is(h1, h2) {
  font-size: var(--type-card);
}
.message-history {
  flex: 1;
  overflow: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.message {
  max-width: 85%;
  align-self: flex-start;
}
.message.mine {
  align-self: flex-end;
}
.message .bubble {
  background: var(--soft);
  padding: var(--space-3) var(--space-4);
  border-radius: 10px 10px 10px 0;
  font-size: var(--type-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.mine .bubble {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 10px 10px 0 10px;
}
.message small {
  font-size: var(--type-meta);
  display: block;
  margin-top: var(--space-1);
}
.message .message-actions {
  display: flex;
  gap: var(--space-2);
}
.message-actions button {
  font-size: var(--type-label);
  background: none;
  border: 0;
  color: var(--muted);
  padding: var(--space-2);
  min-height: var(--control-min-height);
  min-width: var(--control-min-height);
}
.message-actions button:not(:disabled):not([aria-busy="true"]):hover {
  text-decoration: underline;
}
.message-form {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  align-items: flex-end;
}
.message-form textarea {
  min-height: 48px;
  max-height: 120px;
  height: 48px;
  flex: 1 1 0;
  min-width: 0;
}
.message-form .button {
  align-self: flex-end;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: var(--space-6);
  background: var(--soft);
  border-radius: var(--radius-surface);
  overflow: hidden;
}
.metric {
  padding: var(--space-6);
  background: transparent;
  border: 0;
  border-radius: 0;
  border-inline-end: 1px solid var(--line);
  min-width: 0;
}
.metric .metric-value {
  font-size: var(--type-stat);
  letter-spacing: -0.04em;
  color: var(--ink);
  display: block;
  font-weight: 600;
  margin: var(--space-2) 0;
  font-variant-numeric: tabular-nums;
}
.metric p {
  font-size: var(--type-meta);
  margin: 0;
  color: var(--muted);
}
.admin-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-6);
}
.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 108px) minmax(0, 1fr) 32px;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
  font-size: var(--type-meta);
}
progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 10px;
  appearance: none;
}
progress::-webkit-progress-bar {
  background: var(--soft);
  border-radius: 10px;
}
progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 10px;
}
progress::-moz-progress-bar {
  background: var(--primary);
  border-radius: 10px;
}
.admin-row {
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 0;
  border-radius: 0;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-row .row-main {
  min-width: 0;
}
.admin-row p {
  font-size: var(--type-body);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-row .actions {
  flex-shrink: 1;
  flex: 0 1 auto;
}
.admin-search {
  margin-bottom: var(--space-4);
}
/* Reported text and reporter names are literal, potentially unbroken strings. */
body[data-page="admin"] .admin-record .note,
body[data-page="admin"] .admin-record small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.activity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
}
.activity-row .reason {
  color: var(--body);
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-story {
  background: var(--ink);
  color: #e4ecdf;
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.auth-story .brand {
  color: #fff;
}
.auth-story h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  color: #fff;
  font-size: var(--type-display);
  line-height: 1.1;
  margin-top: auto;
  max-width: 450px;
}
.auth-story p {
  color: #ceddcb;
  max-width: 400px;
  font-size: var(--type-body);
  line-height: 1.8;
}
.auth-story .story-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid #547466;
  display: flex;
  gap: var(--space-6);
  color: #d4e4d1;
  font-size: var(--type-meta);
}
.auth-story .story-main {
  padding: var(--space-12) 0 var(--space-6);
  margin-top: auto;
  margin-bottom: auto;
  position: relative;
  z-index: 1;
}
.auth-story .eyebrow {
  color: var(--gold);
  margin-bottom: var(--space-6);
}
.auth-story:after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border: 1px solid #729b7e;
  border-radius: 50%;
  right: -220px;
  bottom: -10px;
  box-shadow:
    0 0 0 50px var(--ink),
    0 0 0 51px #527c66,
    0 0 0 100px var(--ink),
    0 0 0 101px #39684f;
  opacity: 0.7;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: var(--space-8);
  min-width: 0;
}
.auth-box {
  width: 100%;
  max-width: 390px;
}
.auth-box h2 {
  font-size: var(--type-stat);
}
.auth-box > p {
  color: var(--muted);
  font-size: var(--type-label);
  margin-bottom: var(--space-6);
}
.auth-box form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.auth-box form .button {
  width: 100%;
  margin-top: var(--space-1);
}
.auth-switch {
  font-size: var(--type-label);
  text-align: center;
  margin-top: var(--space-6);
}
.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  padding: 0 var(--space-1);
}
.auth-note {
  font-size: var(--type-meta);
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  margin-top: var(--space-6);
}
.loading {
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--muted);
}
dialog {
  background: var(--surface);
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 0;
  width: calc(100% - 2 * var(--space-4));
  max-width: 640px;
  max-height: min(90dvh, var(--app-height));
  overflow: hidden;
}
dialog::backdrop {
  background: #132c2780;
  backdrop-filter: blur(3px);
}
.dialog-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
}
.dialog-header h2 {
  font-size: var(--type-section);
}
.dialog-body {
  padding: var(--space-6);
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.dialog-body form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.dialog-body .form-grid {
  gap: var(--space-4);
}
.dialog-body .form-footer {
  margin-top: var(--space-2);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.detail-grid dt {
  font-size: var(--type-meta);
  color: var(--muted);
}
.detail-grid dd {
  margin: var(--space-1) 0 0;
  font-size: var(--type-label);
  color: var(--ink);
}
.dialog-close {
  border: 0;
  background: var(--soft);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: var(--ink);
  font-size: var(--type-section);
  flex-shrink: 0;
  cursor: pointer;
}
.dialog-body .bio {
  white-space: pre-wrap;
  font-size: var(--type-label);
}
.notice {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid #ffffff30;
  box-shadow: var(--shadow);
  padding: var(--space-3) var(--space-6);
  border-radius: 10px;
  max-width: min(640px, calc(100% - 2 * var(--space-4)));
  font-size: var(--type-body);
}
.notice.error {
  background: var(--danger);
  color: var(--on-danger);
}
.undo-status {
  position: fixed;
  top: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  z-index: 98;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  width: min(720px, calc(100% - 2 * var(--space-4)));
  max-height: 64px;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow);
  font-size: var(--type-label);
}
.undo-status > span {
  flex: 1 1 160px;
  min-width: 0;
}
body:has(#undo-status:not([hidden]):not(:empty)) {
  --undo-reserve: calc(var(--space-12) + var(--space-8));
  padding-top: var(--undo-reserve);
}
body:has(dialog[open]) .undo-status {
  display: none;
}
:root[data-theme="dark"] {
  --bg: #10231f;
  --surface: #18312b;
  --ink: #ecf2e9;
  --body: #d4dfd5;
  --muted: #a1b5a6;
  --line: #355045;
  --primary: #96c5a8;
  --soft: #263e32;
  --danger: #ffb5aa;
  color-scheme: dark;
  --control-border: #7e998a;
  --control-placeholder: #a1b5a6;
  --focus-ring: #e6c978;
  --on-primary: #10231f;
  --primary-hover: #b1dbbf;
  --selection-bg: #355843;
  --warning-bg: #4a3919;
  --warning-ink: #f1d38e;
  --danger-bg: #4f2927;
  --danger-ink: #ffb5aa;
  --danger-hover: #ffd0c8;
  --on-danger: #10231f;
  --disabled-bg: #263e32;
}
:root[data-theme="dark"] .button.primary,
:root[data-theme="dark"] .message.mine .bubble {
  color: var(--on-primary);
}
:root[data-theme="dark"] .hero {
  background: #233c2a;
  border-color: #486347;
}
:root[data-theme="dark"] .hero p,
:root[data-theme="dark"] .hero .eyebrow {
  color: #b9cdb3;
}
:root[data-theme="dark"] .hero:after {
  display: none;
}
:root[data-theme="dark"] .hero .pill {
  background: #263e32;
}
:root[data-theme="dark"] .avatar {
  background: #365243;
  color: #d4ead9;
}
:root[data-theme="dark"] .auth-story {
  background: #183d37;
}
:root[data-theme="dark"] .auth-story:after {
  display: none;
}
:root[data-theme="dark"] .notice {
  color: var(--on-primary);
}
:root[data-theme="dark"] .notice.error {
  color: var(--on-primary);
}
:root[data-text="large"] {
  font-size: 112.5%;
}

h1,
h2,
h3,
p,
.name-button {
  overflow-wrap: anywhere;
}
.card,
.person-top > div {
  min-width: 0;
}

.filter-grid select[multiple] {
  min-height: 6.5rem;
  padding: var(--space-1);
}
.filter-grid select[multiple] option {
  padding: var(--space-1) var(--space-2);
}
.filter-chips {
  margin: var(--space-4) 0;
}
.searchbar label {
  min-width: min(100%, 12rem);
  flex: 1 1 12rem;
}
.searchbar label input,
.searchbar label select {
  width: 100%;
}
.notice button {
  margin-left: var(--space-3);
  border: 1px solid currentColor;
  padding: var(--space-1) var(--space-3);
  border-radius: 0.4rem;
  color: inherit;
  background: transparent;
}
.metric {
  color: inherit;
  text-align: left;
  text-decoration: none;
}
html[data-admin-hand="left"] body[data-page="admin"] .admin-row > .actions {
  order: -1;
}
html[data-admin-hand="left"] body[data-page="admin"] .form-footer {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.pwa-controls {
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 30;
  max-width: min(640px, calc(100% - 2 * var(--space-4)));
}
#connection-status:not([hidden]) {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: var(--space-3);
  border-radius: 0.5rem;
}
.pwa-controls [hidden] {
  display: none !important;
}
.request-progress {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-left: var(--space-4);
}
.request-progress [aria-current="step"] {
  font-weight: 700;
}
.room-button > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
[aria-invalid="true"] {
  outline: 2px solid var(--danger, #b42318);
  outline-offset: 2px;
}

/* Shared roles: entity boundaries, divided collections, and reading/form groups. */
[hidden] {
  display: none !important;
}
html {
  scroll-padding-block: var(--space-6);
}
html:has(form[data-form="profile"] > .form-footer) {
  scroll-padding-block-end: calc(var(--space-12) * 2 + var(--space-4));
}
form[data-form="profile"] input,
form[data-form="profile"] select,
form[data-form="profile"] textarea {
  scroll-margin-block: var(--space-4);
}
.mobile-more > summary {
  cursor: pointer;
  list-style: none;
}
.mobile-more > summary::-webkit-details-marker {
  display: none;
}
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
#main:focus {
  outline: none;
}
#main:focus-visible {
  outline: none;
}
::selection {
  color: var(--ink);
  background: var(--selection-bg);
}
body,
.content,
.page,
.card,
.admin-row,
.person-top,
.person-top > div,
.actions > *,
.admin-row > *,
.searchbar > *,
.form-grid > *,
.chat-heading > div,
.detail-grid > *,
.room-button,
.group-card,
.opportunity-card,
.saved-card,
.request-card {
  min-width: 0;
}
button,
strong,
span,
dt,
dd,
summary,
.meta,
.tags,
.user-name {
  overflow-wrap: anywhere;
}
.person-card .meta > *,
.tags > *,
.admin-row > *,
.admin-row button {
  max-width: 100%;
}
label small {
  font-size: var(--type-meta);
  font-weight: 400;
  line-height: 1.5;
}
.card h2,
.admin-row h2 {
  font-size: var(--type-card);
  line-height: 1.35;
}
.card > h2:first-child,
.form-section > h2,
.empty h2 {
  font-size: var(--type-section);
}
.person-card h2,
.saved-card h2,
.group-card h2,
.opportunity-card h2,
.request-card h2,
.list-card h2 {
  font-size: var(--type-card);
}
.person-card .bio,
.opportunity-card .description,
.saved-note {
  color: var(--body);
  line-height: var(--leading-body);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.section-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.page > section + section,
.page > .admin-grid + section,
.page > .card + .metrics,
.page > .metrics + .actions,
.page > .cards + .actions {
  margin-top: var(--space-6);
}
.card > h2 + h3,
.card > .actions + h3,
.card > progress + .actions,
.card > .actions + details,
.card > h2 + .admin-row,
.card > h2 + .request-card {
  margin-top: var(--space-3);
}
.card > .admin-row,
.dialog-body .admin-row,
.card > .request-card {
  padding-inline: 0;
  border-radius: 0;
  box-shadow: none;
}
.card > .request-card {
  border: 0;
  border-bottom: 1px solid var(--line);
}
.workspace-grid aside .list-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding-inline: 0;
}
.cards.list-view {
  gap: 0;
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.cards.list-view .person-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
form[data-form="profile"] {
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
}
form[data-form="profile"] .form-section {
  border: 0;
  border-radius: 0;
  margin: 0;
}
form[data-form="profile"] .form-section + .form-section {
  border-top: 1px solid var(--line);
}
form[data-form="profile"] > .form-footer {
  position: sticky;
  bottom: var(--space-4);
  z-index: 3;
  margin: 0;
  padding: var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
body:has(form[data-form="profile"] > .form-footer) .notice,
body:has(form[data-form="profile"] > .form-footer) .pwa-controls {
  bottom: calc(var(--space-12) * 2 + var(--space-4));
}
.prose,
body[data-page="help"] .page {
  line-height: var(--leading-body);
}
.prose h2,
.prose h3,
body[data-page="help"] section h2 {
  margin-block: var(--space-6) var(--space-2);
}
ul,
ol {
  padding-inline-start: var(--space-6);
}
li + li {
  margin-top: var(--space-2);
}
blockquote {
  margin: var(--space-4) 0;
  padding-inline-start: var(--space-4);
  border-inline-start: 2px solid var(--line);
  overflow-wrap: anywhere;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-meta);
  table-layout: fixed;
}
caption {
  text-align: left;
  margin-block: var(--space-3);
  font-weight: 600;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-2);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
progress,
.results-bar strong,
.chart-row strong {
  font-variant-numeric: tabular-nums;
}
input:disabled,
select:disabled,
textarea:disabled {
  color: var(--muted);
  background: var(--disabled-bg);
  cursor: default;
  opacity: 1;
}
.button:disabled,
.button[aria-disabled="true"] {
  background: var(--disabled-bg);
  border-color: var(--control-border);
  color: var(--muted);
  cursor: default;
}
.button.primary.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-danger);
}
.button.primary.danger:disabled,
.button.primary.danger[aria-disabled="true"] {
  background: var(--disabled-bg);
  color: var(--muted);
  border-color: var(--control-border);
}
.badge.danger {
  color: var(--danger-ink);
}
button[aria-busy="true"],
.button[aria-busy="true"] {
  cursor: wait;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.nav-group + .nav-group {
  margin-top: var(--space-4);
}
.nav-group-label,
.nav-group > h2 {
  font-size: var(--type-eyebrow);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-inline: var(--space-3);
  margin-bottom: var(--space-1);
}
.mobile-nav {
  display: none;
}
.thread-back {
  display: none;
}
.dialog-body > form {
  min-height: 0;
}
.dialog-body .form-footer {
  position: sticky;
  bottom: calc(-1 * var(--space-6));
  background: var(--surface);
  padding-block: var(--space-3);
  z-index: 2;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog[data-kind="detail"] {
  margin: 0 0 0 auto;
  height: var(--app-height);
  max-height: var(--app-height);
  max-width: 600px;
  width: min(600px, calc(100% - var(--space-8)));
  border-radius: var(--radius-surface) 0 0 var(--radius-surface);
}
dialog[data-kind="detail"] .dialog-body {
  flex: 1;
}
dialog[data-kind="form"] .dialog-body {
  flex: 1;
}
dialog[data-kind="form"] {
  height: min(90dvh, var(--app-height));
}
dialog[data-kind="confirm"] {
  max-width: 480px;
}
.notice button {
  min-width: 44px;
  min-height: 44px;
  font-size: var(--type-label);
}
#connection-status:not([hidden]) {
  margin: 0;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.filter-chips .button {
  justify-content: space-between;
}
.filter-panel .filter-grid {
  padding-top: 0;
}
.filter-panel .form-footer {
  flex-shrink: 0;
}
.dialog-body:has(> .filter-panel) {
  flex: 1;
  overflow: hidden;
  padding: 0;
}
.dialog-body > .filter-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
}
.filter-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}
.filter-panel-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.filter-panel-footer #directory-draft-count {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--type-meta);
}
.directory-header,
.directory-tools,
.search-help {
  margin-bottom: var(--space-4);
}
.directory-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.directory-announcement {
  max-width: 72ch;
  color: var(--muted);
}
.search-help > section + section {
  margin-top: var(--space-4);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.chat-back-link {
  display: none;
}
.chat-updates {
  flex-shrink: 0;
  padding-inline: var(--space-3);
  font-size: var(--type-meta);
}
#chat-connection-status:not(:empty) {
  padding-block: var(--space-2);
  color: var(--muted);
}
.earlier-message-history {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block: var(--space-4);
}
.loading-skeleton {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.loading-skeleton-row {
  height: 48px;
  background: var(--line);
  border-radius: var(--radius-control);
}
.loading-skeleton-row:last-child {
  width: 70%;
}
.page-load-status {
  padding-block: var(--space-2);
  font-size: var(--type-meta);
  color: var(--muted);
}
.page-load-error {
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  color: var(--danger-ink);
  background: var(--danger-bg);
  border-radius: var(--radius-control);
}
.page-load-error .actions {
  margin-top: var(--space-3);
}
.search-suggestions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.search-suggestions .button {
  justify-content: flex-start;
  text-align: left;
}
mark {
  color: var(--ink);
  background: var(--selection-bg);
  border-radius: 2px;
}
.loading {
  font-size: var(--type-body);
}
.skeleton {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.skeleton-line {
  height: 16px;
  border-radius: 4px;
  background: var(--line);
  max-width: 100%;
}
.skeleton-line.short {
  width: 45%;
}
.skeleton-card {
  min-height: 160px;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface);
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

/* State feedback changes color, never the geometry of the task. */
.button,
.nav a,
.room-button,
.dialog-close,
.name-button,
.signout,
.auth-switch button,
.notice button,
.mobile-nav a,
.mobile-nav button,
.message-actions button,
input,
select,
textarea {
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}
.button:not(:disabled):not([aria-disabled="true"]):not(
    [aria-busy="true"]
  ):active,
.room-button:not(:disabled):active,
.dialog-close:active {
  background: var(--selection-bg);
  color: var(--ink);
  border-color: var(--primary);
}
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):not([aria-disabled="true"]):not(
      [aria-busy="true"]
    ):hover {
    background: var(--soft);
  }
  .button.primary:not(:disabled):not([aria-disabled="true"]):not(
      [aria-busy="true"]
    ):hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
  }
  .button.primary.danger:not(:disabled):not([aria-disabled="true"]):not(
      [aria-busy="true"]
    ):hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
  }

  .room-button:not(:disabled):hover,
  .dialog-close:hover,
  .notice button:not(:disabled):hover,
  .message-actions button:not(:disabled):hover {
    background: var(--soft);
    color: var(--ink);
  }
}
@media (min-width: 1024px) {
  body[data-page="admin"] .admin-row > :first-child {
    flex: 1 1 240px;
  }
  html[data-admin-density="compact"] body[data-page="admin"] .admin-row,
  html[data-admin-density="compact"] body[data-page="admin"] .request-card {
    padding-block: var(--space-2);
  }
  html[data-admin-density="compact"]
    body[data-page="admin"]
    .request-card
    .history,
  html[data-admin-density="compact"]
    body[data-page="admin"]
    .request-card
    .actions,
  html[data-admin-density="compact"] body[data-page="admin"] .request-progress {
    margin-top: var(--space-2);
    gap: var(--space-2);
  }
}
@media (min-width: 1440px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1800px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 768px) and (max-width: 1439px) {
  .cards,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page {
    padding: var(--space-6);
  }
  .topbar {
    padding-inline: var(--space-6);
  }
  .workspace-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .list-view .person-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .list-view .tags {
    display: none;
  }
  .auth-story {
    padding: var(--space-8);
  }
}
@media (max-width: 1023px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    min-height: var(--mobile-header-height);
    padding: var(--space-2) var(--space-4);
  }
  .topbar .context {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .pill,
  .topbar .badge,
  .topbar-right .avatar {
    display: none;
  }
  .mobile-signout {
    min-width: 44px;
  }
  .page {
    padding-bottom: calc(var(--mobile-nav-height) + var(--space-6));
  }
  form[data-form="profile"] > .form-footer {
    bottom: calc(var(--mobile-nav-height) + var(--space-2));
  }
  html:has(form[data-form="profile"] > .form-footer) {
    scroll-padding-block-end: calc(
      var(--mobile-nav-height) + var(--space-12) * 2 + var(--space-4)
    );
  }
  body:has(form[data-form="profile"] > .form-footer) .notice,
  body:has(form[data-form="profile"] > .form-footer) .pwa-controls {
    bottom: calc(
      var(--mobile-nav-height) + var(--space-12) * 2 + var(--space-4)
    );
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    height: var(--mobile-nav-height);
    padding: var(--space-1) var(--space-2) env(safe-area-inset-bottom, 0px);
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .mobile-nav > a,
  .mobile-nav > button,
  .mobile-nav > details > summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 44px;
    min-width: 44px;
    padding: var(--space-1);
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted);
    font-size: var(--type-meta);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    text-decoration: none;
  }
  .mobile-nav [aria-current="page"],
  .mobile-nav summary.active,
  .mobile-nav > button[aria-expanded="true"] {
    color: var(--primary);
    background: var(--soft);
  }
  .mobile-nav svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
  }
  .mobile-nav > details,
  .mobile-nav > details > summary {
    height: 100%;
  }
  .mobile-nav .mobile-more-panel,
  .mobile-nav .more-menu,
  .mobile-nav .mobile-more-menu,
  .mobile-nav > details > div,
  .mobile-nav [role="menu"] {
    position: absolute;
    bottom: calc(var(--mobile-nav-height) + var(--space-2));
    inset-inline: var(--space-4);
    display: grid;
    gap: var(--space-1);
    max-height: calc(
      var(--app-height) - var(--mobile-nav-height) - var(--space-8)
    );
    overflow-y: auto;
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow);
  }
  .mobile-nav .mobile-more-panel a,
  .mobile-nav .mobile-more-panel button,
  .mobile-nav .more-menu a,
  .mobile-nav .mobile-more-menu a,
  .mobile-nav [role="menu"] a,
  .mobile-nav [role="menu"] button {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-3);
    gap: var(--space-3);
    color: var(--ink);
    font-size: var(--type-label);
    text-align: left;
    border: 0;
    background: transparent;
  }
  .notice {
    bottom: calc(var(--mobile-nav-height) + var(--space-4));
  }
  .undo-status {
    max-height: 112px;
  }
  body:has(#undo-status:not([hidden]):not(:empty)) {
    --undo-reserve: calc(var(--space-12) * 2 + var(--space-8));
  }
  body[data-page="chats"][data-thread="true"][data-short-viewport="true"]:has(
      #undo-status:not([hidden]):not(:empty)
    ) {
    --undo-reserve: 0px;
    padding-top: 0;
  }
  body[data-page="chats"][data-thread="true"][data-short-viewport="true"]
    .undo-status {
    display: none;
  }
  .pwa-controls {
    bottom: calc(var(--mobile-nav-height) + var(--space-4));
  }
  body[data-page="chats"][data-thread="true"] .notice,
  body[data-page="chats"][data-thread="true"] .pwa-controls {
    bottom: calc(
      var(--mobile-nav-height) + var(--space-12) * 3 + var(--space-4)
    );
  }
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .room-list {
    border: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow-x: hidden;
  }
  .room-button {
    width: 100%;
    text-align: left;
  }
  .chat-layout:not(:has(.message-form)) .conversation {
    min-height: 160px;
  }
  .thread-back {
    display: inline-flex;
  }
  .chat-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: var(--space-2);
    font-size: var(--type-label);
  }
  .chat-heading :is(h1, h2) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  body[data-page="chats"][data-thread="true"] .page-heading,
  body[data-page="chats"][data-thread="true"] .page > .actions,
  body[data-page="chats"][data-thread="true"] .page > .searchbar,
  body[data-page="chats"][data-thread="true"] .room-list,
  body[data-page="chats"][data-thread="true"] .collection-heading,
  body[data-page="chats"][data-thread="true"] .collection-filter {
    display: none;
  }
  body[data-page="chats"][data-thread="true"] .page {
    padding: var(--space-2) var(--space-3) 0;
    height: calc(
      var(--app-height) - var(--mobile-header-height) -
        var(--mobile-nav-height) - var(--undo-reserve)
    );
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body[data-page="chats"][data-thread="true"] .chat-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
    border-radius: var(--radius-control);
  }
  body[data-page="chats"][data-thread="true"] .conversation {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .conversation > .muted.small,
  #composer-state {
    margin: 0;
    padding: 0 var(--space-3) var(--space-1);
    font-size: var(--type-meta);
    flex-shrink: 0;
  }
  #composer-state:empty {
    display: none;
  }
  .chat-heading {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-3);
    max-height: 45%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .chat-heading .actions {
    gap: var(--space-1);
  }
  .chat-heading > div:first-child {
    flex: 1 1 160px;
  }
  .message-form {
    padding: var(--space-2) var(--space-3);
  }
  .message-form .button {
    min-height: 48px;
  }
  .admin-row {
    align-items: flex-start;
    flex-direction: column;
    padding: var(--space-4);
  }
  .admin-row .actions {
    width: 100%;
  }
  dialog[data-kind="detail"] {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    height: min(88dvh, var(--app-height));
    max-height: var(--app-height);
    border-radius: var(--radius-surface) var(--radius-surface) 0 0;
  }
  dialog[data-kind="form"] {
    margin: 0;
    width: 100%;
    max-width: none;
    height: var(--app-height);
    max-height: var(--app-height);
    border-radius: 0;
  }
  dialog[data-kind="form"] .dialog-header,
  dialog[data-kind="detail"] .dialog-header {
    padding: var(--space-4);
  }
  dialog[data-kind="form"] .dialog-body,
  dialog[data-kind="detail"] .dialog-body {
    padding: var(--space-4);
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
  }
  .dialog-body .form-footer {
    bottom: calc(-1 * var(--space-4));
  }
  dialog .dialog-body:has(> .filter-panel) {
    padding: 0;
  }
  .filter-panel-body {
    padding: var(--space-4);
  }
}
@media (max-width: 767px) {
  .page {
    padding: var(--space-6) var(--space-4)
      calc(var(--mobile-nav-height) + var(--space-6));
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-4);
  }
  .page-heading p {
    font-size: var(--type-body);
  }
  .cards,
  .skeleton-grid,
  .filter-grid,
  .form-grid,
  .detail-grid,
  .workspace-grid,
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .list-view .person-card {
    display: flex;
  }
  .card,
  .form-section {
    padding: var(--space-4);
  }
  .searchbar {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  .searchbar > label,
  .searchbar > input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .searchbar > .button.primary,
  .button.primary[type="submit"] {
    min-height: 48px;
  }
  .searchbar > .button.primary {
    flex-basis: 100%;
  }
  .searchbar label input,
  .searchbar label select {
    min-width: 0;
  }
  .results-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding: var(--space-4);
  }
  .metric .metric-value {
    font-size: 1.75rem;
  }
  .chart-row {
    grid-template-columns: minmax(0, 100px) minmax(0, 1fr) 24px;
  }
  .activity-row {
    grid-template-columns: 1fr;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-story {
    padding: var(--space-6);
  }
  .auth-story .story-main {
    padding: var(--space-6) 0 0;
    margin: 0;
  }
  .auth-story h1 {
    font-size: 2rem;
    max-width: 480px;
  }
  .auth-story p {
    line-height: 1.5;
  }
  .auth-story .story-footer {
    display: none;
  }
  .auth-main {
    padding: var(--space-8) var(--space-6);
  }
  .auth-box h2 {
    font-size: var(--type-section);
  }
  .auth-switch button {
    min-height: 44px;
    padding: var(--space-2);
  }
  .empty {
    padding: var(--space-8) var(--space-4);
  }
  .dialog-header,
  .dialog-body {
    padding: var(--space-4);
  }
  .message {
    max-width: 95%;
  }
  .message .message-actions {
    flex-wrap: wrap;
  }
  .request-header {
    flex-wrap: wrap;
  }
}
.metric .eyebrow {
  font-size: var(--type-meta);
  letter-spacing: 0.04em;
}
@media (max-width: 359px) {
  .page {
    padding-inline: var(--space-3);
  }
  .mobile-nav {
    padding-inline: var(--space-1);
  }
  .mobile-nav > a,
  .mobile-nav > button {
    font-size: var(--type-meta);
  }
  .topbar .context {
    font-size: var(--type-meta);
  }
  .card,
  .form-section {
    padding: var(--space-3);
  }
  .dialog-body,
  .dialog-header {
    padding: var(--space-3);
  }
  .form-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .form-footer > .button {
    flex: 1 1 auto;
  }
  .chat-heading {
    gap: var(--space-1);
  }
  .chat-heading .actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 1023px) and (max-height: 480px) {
  body[data-page="chats"][data-thread="true"]:has(
      #undo-status:not([hidden]):not(:empty)
    ) {
    --undo-reserve: 0px;
    padding-top: 0;
  }
  body[data-page="chats"][data-thread="true"] .undo-status {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  transition: none !important;
  animation: none !important;
}
