/* ============================================================
   Stale Contacts — design system
   ============================================================ */

:root {
  /* Bastiat Partners palette — sourced from bastiatpartners.com.
     Primary: deep teal-navy #08222b (used 11× on the firm site).
     Warm rose/beige neutrals + a gold accent for highlights. */
  --bg: #faf8f5;
  --bg-grad:
    radial-gradient(at 20% 0%, rgba(234, 211, 188, 0.45) 0%, transparent 45%),
    radial-gradient(at 100% 0%, rgba(167, 200, 207, 0.30) 0%, transparent 40%),
    #faf8f5;
  --surface: #ffffff;
  --surface-2: #f7f4ef;
  --border: #e7e1d6;
  --border-strong: #cfc7b8;
  --text: #08222b;
  --text-2: #2d4047;
  --muted: #7a8a8f;
  --accent: #08222b;
  --accent-2: #132030;
  --accent-soft: #e8eef0;
  --accent-soft-2: #d3dde0;
  --teal: #176782;
  --gold: #f9b806;
  --rose: rgb(185, 155, 155);
  --beige: #ead3bc;
  --warn-bg: #fdf3d8;
  --warn-border: #e8c98a;
  --warn-text: #7a5a17;
  --pill: #fbe7c5;
  --danger: #9b2222;
  --danger-soft: #f5dada;
  --danger-soft-2: #ecc5c5;
  --ok: #2d6a3a;
  --ok-soft: #e3eed9;

  /* type */
  --font-serif: "Instrument Serif", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;

  /* layout */
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(8, 34, 43, 0.04);
  --shadow: 0 1px 2px rgba(8, 34, 43, .05), 0 4px 14px rgba(8, 34, 43, .04);
  --shadow-lg: 0 4px 12px rgba(8, 34, 43, .06), 0 16px 40px rgba(8, 34, 43, .08);
  --gap: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--teal); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); text-decoration: underline; }

/* Editorial serif for display, Inter for body — matches bastiatpartners.com.
   Instrument Serif at weight 400 sits closer to a 300 weight visually, so we
   skip the lighter weights and lean into the serif's natural elegance. */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { letter-spacing: -0.005em; font-weight: 600; }

/* ============================================================
   Top bar
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  /* The logo JPEG has white fill; mix-blend strips the white so the rose
     glyph sits cleanly on any background. */
  mix-blend-mode: multiply;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--text);
  line-height: 1;
}
.brand-tag {
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--border);
  line-height: 1;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 32px;
}
.topbar nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all .15s;
}
.topbar nav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.topbar nav a.active { color: var(--accent); background: var(--accent-soft); }

.user-chip {
  margin-left: auto;
  background: rgba(185, 155, 155, 0.18);
  color: #6b4747;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
}
.logout-link {
  margin-left: 10px;
  font-size: 13px;
  color: var(--muted) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
}
.logout-link:hover { color: var(--text) !important; background: var(--accent-soft) !important; }

/* ============================================================
   Main layout — single column, with optional stat bar
   ============================================================ */

main {
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 24px;
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 {
  margin: 0 0 4px 0;
  font-size: 30px;
  font-weight: 400;
  font-family: var(--font-serif);
  letter-spacing: 0.005em;
}
.page-head .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stat bar — replaces the misplaced aside.counts */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 24px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.stat .value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.stat .value.warn { color: var(--warn-text); }
.stat .value.danger { color: var(--danger); }
.stat .value.ok { color: var(--ok); }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn-text); }
.small { font-size: 12px; }

.banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  margin-bottom: 18px;
  font-size: 13px;
}
.banner code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 13px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .04s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-soft-2); text-decoration: none; }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(8, 34, 43, 0.25); }
.btn.primary:hover { background: var(--accent-2); color: #fff; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft-2); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.tiny { padding: 4px 9px; font-size: 12px; }

/* ============================================================
   Tables
   ============================================================ */

table.rows {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.rows th, table.rows td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
table.rows tr:last-child td { border-bottom: 0; }
table.rows th {
  background: var(--surface-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
table.rows tbody tr { transition: background .12s; }
table.rows tbody tr:hover { background: #fbfcfe; }
table.rows td.empty {
  text-align: center;
  padding: 48px 12px;
  color: var(--muted);
}
table.rows tr.focus { background: #fff8e1; }
table.rows tr.focus:hover { background: #fff8e1; }
table.rows .checkbox-col { width: 36px; padding-right: 0; }

.person .name { font-weight: 600; font-size: 14px; }
.person .email { margin-top: 2px; }
.person .email a { color: var(--muted); font-size: 13px; }
.bio .org { font-weight: 500; }
.bio .title { color: var(--muted); font-size: 13px; margin-top: 2px; }
.last strong { font-size: 16px; font-weight: 700; }
.last .muted { font-size: 12px; margin-top: 2px; }

.actions-col { white-space: nowrap; min-width: 320px; }
.actions-col .btn { margin-right: 4px; margin-bottom: 4px; }
.actions-col .btn:last-child { margin-right: 0; }

/* snooze dropdown */
details.snooze-menu { display: inline-block; position: relative; }
details.snooze-menu summary { list-style: none; }
details.snooze-menu summary::-webkit-details-marker { display: none; }
details.snooze-menu .menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 170px;
}
details.snooze-menu .menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
}
details.snooze-menu .menu button:hover { background: var(--accent-soft); }
details.snooze-menu .menu .custom {
  display: block;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
details.snooze-menu .menu .custom input {
  margin-left: 6px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
}

/* ============================================================
   Section headers (between people / orgs)
   ============================================================ */

.section-title {
  margin: 28px 0 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title small {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted);
}
.section-title .count-pill {
  background: rgba(185, 155, 155, 0.20);
  color: #6b4747;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  font-family: var(--font-sans);
}

/* ============================================================
   Pills, tags, mobile-only meta
   ============================================================ */

.mobile-only { display: none; }
.meta-line { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--warn-text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.pill-danger { background: #ffe5e5; color: var(--danger); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tag-snooze, .tag-org_snooze { background: #fff1d6; color: #7a4a00; }
.tag-dismiss, .tag-org_dismiss { background: var(--danger-soft); color: var(--danger); }
.tag-undismiss, .tag-unsnooze { background: var(--ok-soft); color: var(--ok); }
.tag-contacted { background: #e7f0ff; color: var(--accent); }
.tag-draft { background: #f3e9ff; color: #6c2bd9; }
.tag-refresh { background: #f1f3f7; color: var(--muted); }
.tag-refresh_failed, .tag-org_refresh_failed { background: var(--danger-soft); color: var(--danger); }
.tag-digest_sent { background: #e7f0ff; color: var(--accent); }
.tag-config_save { background: #f1f3f7; color: var(--muted); }
.tag-org_refresh { background: #f1f3f7; color: var(--muted); }

/* ============================================================
   Org cards
   ============================================================ */

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.org-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.org-card[data-focus="1"] { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(8, 34, 43, .15), var(--shadow); }
.org-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.org-card-head .name { font-weight: 600; font-size: 15px; line-height: 1.3; }

.org-contacts {
  list-style: none;
  padding: 14px 0 0 0;
  margin: 14px 0 0 0;
  border-top: 1px solid var(--border);
}
.org-contacts li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.org-contacts li:last-child { border-bottom: 0; }
.org-contacts li strong { color: var(--text); }
.org-contacts li > div { margin-top: 2px; }
.org-contacts li a:not(.btn) { color: var(--muted); font-size: 12px; }

.org-card-actions {
  margin-top: 16px;
  display: flex;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.empty-card {
  padding: 48px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ============================================================
   Team page
   ============================================================ */

.team-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.team-intro p {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
  max-width: 580px;
  font-weight: 400;
}
.team-intro .team-meta {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .15s, box-shadow .15s;
}
.team-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.team-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #faf8f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(8, 34, 43, 0.18);
}
.team-card.partner .avatar { background: var(--accent); }
.team-card.director .avatar { background: var(--teal); }
.team-card.analyst .avatar { background: var(--rose); color: #fff; }
.team-card .name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}
.team-card .role {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================
   Activity timeline
   ============================================================ */

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.activity-list li {
  display: grid;
  grid-template-columns: 160px 110px 1fr 1fr;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list li:hover { background: #fbfcfe; }
.activity-list .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.activity-list .who { font-weight: 500; }
.activity-list .who a { color: var(--text); }
.activity-list .detail { color: var(--muted); font-size: 13px; }

/* ============================================================
   Footer
   ============================================================ */

footer {
  text-align: center;
  padding: 22px 24px 32px;
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   Action result page
   ============================================================ */

.action-result {
  max-width: 480px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.action-result h2 { margin: 0 0 12px 0; font-size: 22px; }
.action-result.ok h2 { color: var(--ok); }
.action-result.error h2 { color: var(--danger); }
.action-result p { color: var(--text-2); margin: 0 0 20px 0; }

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

/* ============================================================
   Login screen
   ============================================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(at 20% 0%, rgba(234, 211, 188, 0.55) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(167, 200, 207, 0.35) 0%, transparent 45%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 50%, var(--gold) 100%);
}
.login-card .login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.login-card .login-brand-mark {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  /* Strip the white JPEG background so only the rose monogram shows. */
  mix-blend-mode: multiply;
}
.login-card h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--text);
}
.login-card .login-tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-card input {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-card input:hover { background: #f6f7fb; }
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(8, 34, 43, 0.15);
}
.login-card .btn { padding: 12px 16px; margin-top: 6px; font-size: 14px; }
.login-card .banner { margin: 18px 0 0; padding: 11px 14px; font-size: 13px; background: var(--danger-soft); border-color: var(--danger-soft-2); color: var(--danger); }

/* ============================================================
   Config form
   ============================================================ */

.config-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.config-form fieldset { border: 0; padding: 0; margin: 0 0 32px 0; }
.config-form fieldset:last-of-type { margin-bottom: 18px; }
.config-form legend {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0 14px 0;
  font-weight: 700;
  width: 100%;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.config-form label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--text); font-weight: 500; }
.config-form label small { display: block; color: var(--muted); margin-top: 5px; font-size: 12px; font-weight: 400; }
.config-form label small .ok { color: var(--ok); font-weight: 600; }
.config-form label small .warn { color: var(--warn-text); font-weight: 600; }
.config-form input[type="text"],
.config-form input:not([type]),
.config-form input[type="password"],
.config-form input[type="number"],
.config-form select,
.config-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.config-form textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  resize: vertical;
  line-height: 1.5;
}
.config-form input:focus, .config-form select:focus, .config-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 87, 232, 0.12);
}
.config-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.config-form .grid-2 label { margin-bottom: 16px; }
.config-form .row-checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.config-form .row-checkbox input { width: auto; margin: 0; }
.config-form .form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.config-form .form-actions #save-status.ok { color: var(--ok); }
.config-form .form-actions #save-status.warn { color: var(--danger); }
.config-form code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.config-form p.muted.small { font-size: 12px; line-height: 1.6; margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  main { padding: 0 16px; margin: 18px auto; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar nav { margin-left: 0; flex-wrap: wrap; gap: 2px; }
  .user-chip { margin-left: auto; }
}

@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions { flex-wrap: wrap; }
  .page-head .actions .btn { flex: 1 1 auto; min-width: 120px; }

  /* Stack people table → cards */
  .people-rows thead { display: none; }
  .people-rows, .people-rows tbody, .people-rows tr, .people-rows td { display: block; width: 100%; }
  .people-rows tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: var(--shadow);
  }
  .people-rows td { border-bottom: 0; padding: 0; }
  .people-rows td.checkbox-col { float: right; padding: 0; width: auto; }
  .people-rows td.bio-col, .people-rows td.last-col { display: none; }
  .people-rows .mobile-only { display: block; }
  .people-rows .person { padding-right: 28px; }
  .people-rows .person .email { display: block; word-break: break-all; }
  .people-rows td.actions-col {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    white-space: normal;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .people-rows td.actions-col .btn,
  .people-rows td.actions-col details.snooze-menu {
    flex: 1 1 calc(50% - 3px);
    margin: 0;
  }
  .people-rows td.actions-col details.snooze-menu summary { width: 100%; }

  .org-grid { grid-template-columns: 1fr; }
  .config-form .grid-2 { grid-template-columns: 1fr; }

  .activity-list li { grid-template-columns: 1fr; gap: 4px; }
  .activity-list .when { font-size: 11px; }
}
