@font-face {
  font-family: Urbanist;
  src: url('./assets/fonts/Urbanist-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./assets/fonts/Urbanist-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./assets/fonts/Urbanist-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./assets/fonts/Urbanist-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./assets/fonts/Urbanist-ExtraBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-warm: #f7f8f9;
  --ink: #1f5d42;
  --muted: #6a707c;
  --border: #e8ecf4;
  --border-strong: #c6c6c8;
  --danger: #9d2f2f;
  --radius-control: 8px;
  --radius-card: 13px;
  --shadow-subtle: 0 2px 10px rgba(0, 0, 0, .06);
  font-family: Urbanist, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 780px; margin: auto; padding: 32px 24px 64px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 22px; line-height: 28px; font-weight: 700; }
h2 { margin-bottom: 8px; font-size: 20px; line-height: 26px; font-weight: 700; }
p { line-height: 1.5; }
button, input, textarea { font: inherit; }
button {
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--surface-warm); }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface-warm);
  font-weight: 500;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 112px; resize: vertical; }
label, .detail-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }

.page-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}
.eyebrow {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.login-panel {
  max-width: 440px;
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}
.login-panel h2 { font-size: 24px; line-height: 30px; font-weight: 800; }
.login-panel p { margin-bottom: 24px; color: var(--muted); font-size: 15px; }
.login-panel input { margin-bottom: 24px; }
.primary { width: 100%; margin-top: 8px; color: #ffffff; background: var(--ink); font-weight: 700; }
.primary:hover { color: #ffffff; background: #174b35; }
.quiet { border-color: var(--border); background: var(--surface); }
.outlined { margin: 8px 0 16px; border-color: var(--border); background: var(--surface-warm); }

.directory-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.directory-top p { margin-bottom: 8px; color: var(--muted); font-size: 14px; line-height: 20px; }
.count { padding-top: 4px; white-space: nowrap; color: var(--ink); font-size: 13px; line-height: 20px; font-weight: 700; }
.note { color: var(--muted); font-size: 13px; line-height: 20px; }
.segments { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: var(--radius-control); background: var(--surface-warm); }
.segments button { flex: 1; }
.segments button[aria-pressed=true] { color: #ffffff; background: var(--ink); font-weight: 700; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { border-color: var(--border); background: var(--surface-warm); }
.category-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
  border-color: var(--border);
  background: var(--surface-warm);
  text-align: left;
}
.results { display: grid; gap: 12px; }
.results:empty { display: none; }
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
  text-align: left;
}
.row-copy { min-width: 0; }
.row-name { display: block; font-size: 16px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
.row-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 18px; font-weight: 500; overflow-wrap: anywhere; }
#status { color: var(--muted); line-height: 24px; }
#status.error, #request-status.error { color: var(--danger); }
#request-status.success { color: var(--ink); }

/* The mobile directory deliberately uses a 28px drawer radius above its card tokens. */
dialog {
  width: min(640px, 100%);
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.handle { width: 42px; height: 4px; margin: 12px auto; border-radius: 4px; background: var(--border-strong); }
.drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 24px 24px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 800; overflow-wrap: anywhere; }
.drawer-header p:last-child:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.close { min-width: 44px; padding: 4px; font-size: 28px; line-height: 1; font-weight: 400; }
.drawer-content { padding: 24px 24px max(32px, env(safe-area-inset-bottom)); overflow-wrap: anywhere; }
.detail-card { margin-bottom: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.detail-card p:last-child { margin-bottom: 0; }
.detail-card a { display: block; margin-top: 8px; }
.business-title { margin-bottom: 8px; font-size: 18px; line-height: 24px; font-weight: 700; }
.detail-actions { display: grid; gap: 8px; margin-top: 24px; }
.detail-actions .outlined { margin: 0; }
.danger { border-color: #e7cccc; color: var(--danger); background: var(--surface); }
.category-option { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-control); text-align: left; }
.category-option[aria-pressed=true] { background: var(--surface-warm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.field-wide { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  main { padding: 24px 16px 48px; }
  .page-header { gap: 8px; }
  .page-header .quiet { padding: 8px 12px; }
  .login-panel { margin: 24px auto; padding: 24px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer-header { padding-inline: 16px; }
  .drawer-content { padding-inline: 16px; }
  .directory-top { gap: 8px; }
  .count { font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: drawer-in .18s ease-out; }
  @keyframes drawer-in {
    from { transform: translateY(24px); opacity: .5; }
    to { transform: translateY(0); opacity: 1; }
  }
}

/* Member Resources: isolated navigation and private document reading. */
.resource-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.resource-nav button {
  min-height: 52px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-warm);
  border-radius: var(--radius-card);
  font-weight: 700;
}
.resource-nav button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.document-info {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin: 16px 0;
}
.document-info p:last-child { margin-bottom: 0; }
.document-actions { display: flex; gap: 12px; margin: 18px 0; }
.document-download {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
}
.document-frame {
  display: block;
  width: 100%;
  height: min(78vh, 860px);
  min-height: 440px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
@media (max-width: 480px) {
  .resource-nav { gap: 8px; }
  .resource-nav button { padding: 10px 6px; font-size: 14px; }
  .document-frame { height: 68vh; min-height: 380px; }
}


.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.privacy-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; font-size: 14px; letter-spacing: 0; text-transform: none; }
.privacy-check input { width: 20px; min-height: 20px; margin: 0; flex: 0 0 20px; }
#privacy-body { white-space: pre-wrap; line-height: 1.6; }
#account-status { margin: 16px 0 0; white-space: pre-line; }
#account-status.error { color: var(--danger); }

.login-panel .login-help { font-size: 13px; color: var(--muted); font-style: italic; }
