:root { --ink: #141414; --muted: #6b6b6b; --line: rgba(0,0,0,.1); --paper: #fafafa; --danger: #b42318; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
main { max-width: 420px; margin: 12vh auto; padding: 0 20px; }
h1 { font-size: 28px; margin: 0 0 20px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
/* 16px+ keeps iOS Safari from zooming in when a field is tapped. */
input, select { font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
main input { width: 100%; margin-bottom: 12px; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: none; color: var(--ink); text-decoration: underline; padding: 4px 6px; }
button.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
button.small { padding: 4px 10px; font-size: 13px; }
.muted { color: var(--muted); }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav button, header strong, #signout { white-space: nowrap; }
nav button { background: none; color: var(--ink); border-color: transparent; }
nav button.active { border-color: var(--ink); }
section { max-width: 860px; margin: 20px auto; padding: 0 20px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input { flex: 1; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.meta { color: var(--muted); font-size: 13px; }
.target { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 12px 0; }
.target h3 { margin: 4px 0; font-size: 16px; }
.content { white-space: pre-wrap; margin: 6px 0; max-height: 14em; overflow: auto; }
.quote { font-style: italic; margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #eee; color: var(--ink); margin-left: 6px; }
.badge.open { background: #fde7c5; } .badge.actioned { background: #d6f0dc; } .badge.dismissed { background: #eee; }
.row { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); margin-bottom: 6px; }
.row.static { padding: 10px 14px; border-radius: 8px; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile .value { font-size: 28px; font-weight: 700; }
.wide { grid-column: 1 / -1; }

/* Phones: the tabs get their own full-width row under the title, email, and Sign out. */
@media (max-width: 640px) {
  header { padding: 10px 14px; }
  nav { order: 3; flex-basis: 100%; }
  #who { margin-left: auto; font-size: 13px; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; white-space: nowrap; }
  section { padding: 0 12px; }
}

#person { scroll-margin-top: 120px; }
