:root {
  --accent: #0a5c46;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5b636e;
  --border: #e2e6eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --surface: #171b21; --text: #eceff3;
    --muted: #9aa3ad; --border: #262c34;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; }
p { margin: .4rem 0; }
a { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

.topbar { background: var(--accent); color: #fff; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35);
}
.nav a { color: #fff; text-decoration: none; font-weight: 600; opacity: .95; }
.nav a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.hero { padding: 1rem 0 .5rem; }
.lede { color: var(--muted); max-width: 60ch; }
.demo-note { font-size: .85rem; color: var(--muted); font-style: italic; }

.btn {
  display: inline-block; padding: .6rem 1rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; font-weight: 600; cursor: pointer; font-size: 1rem;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.tenant-list { list-style: none; padding: 0; display: grid; gap: .75rem; max-width: 640px; }
.tenant-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.tenant-name { font-weight: 700; font-size: 1.1rem; }
.tenant-links { display: flex; gap: .5rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 820px) {
  .grid, .dash-body { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow);
}
.map-panel { padding: .5rem; }
.map { width: 100%; height: 460px; border-radius: 10px; }
@media (max-width: 820px) { .map { height: 320px; } }

.field { margin: .85rem 0; }
label, .label-like { display: block; font-weight: 600; margin-bottom: .3rem; }
select, input[type=text], input[type=file], textarea {
  width: 100%; padding: .6rem .7rem; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
textarea { resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); }
.preview { margin-top: .6rem; max-width: 100%; max-height: 220px; border-radius: 10px; }

.banner { padding: .7rem .9rem; border-radius: 10px; margin: .6rem 0; font-weight: 600; }
.banner-ok { background: color-mix(in srgb, #16a34a 15%, var(--surface)); color: #14181f; }
.banner-err { background: color-mix(in srgb, #dc2626 15%, var(--surface)); color: #14181f; }
@media (prefers-color-scheme: dark) {
  .banner-ok, .banner-err { color: var(--text); }
}

.privacy { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.privacy summary { cursor: pointer; font-weight: 600; }

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; }
.count { color: var(--muted); font-size: .9rem; }

.list { display: grid; gap: .6rem; max-height: 520px; overflow-y: auto; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem;
  padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.row-cat { font-weight: 700; margin: 0; }
.row-desc { margin: .1rem 0; color: var(--text); }
.row-meta { margin: 0; font-size: .8rem; color: var(--muted); }
.row-status { width: auto; }
.chip { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.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;
}
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; }

/* Caseworker actions. The status dropdown alone gives the caseworker nothing to
   *do* -- these are the two things they actually do with a case. */
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.row { align-items: start; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.reply-form { margin-top: .5rem; }
.reply-form textarea {
  width: 100%; padding: .5rem .6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; resize: vertical;
}
.row-reply {
  margin: .4rem 0 0; padding: .45rem .6rem; font-size: .85rem;
  border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.row-reply b { display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
