/* ============================================================================
   GSE Client Portal — styles.css
   Implemented from the Claude Design handoff ("GSE Client Portal.html").
   Restrained neutral UI; HTH GSE brand color lives in the nav. System fonts.
   Maps 1:1 to the FastHTML components in app/components.py.
   ========================================================================== */

:root {
  /* Neutral surfaces & ink */
  --bg:          #f4f6fa;
  --card:        #ffffff;
  --ink:         #19232f;
  --muted:       #5c6b7a;
  --faint:       #8696a6;
  --line:        #e4e9f0;
  --line-strong: #d2dae4;

  /* Recessed (read-only Salesforce) surface */
  --sf-bg:       #eef2f8;
  --sf-line:     #dbe3ee;

  /* Accent */
  --accent:      #1f6feb;
  --accent-ink:  #1556c4;
  --accent-wash: #eaf1fe;
  --focus:       #1f6feb;

  /* HTH GSE brand (from the logo) */
  --brand-blue:   #7ea6da;
  --brand-blue-d: #5e87bd;
  --brand-yellow: #f3cf3d;
  --brand-ink:    #15181c;

  /* Unsynced — quiet amber */
  --warn-bg:   #fff4e2;
  --warn-ink:  #8a5300;
  --warn-line: #f0d8a8;

  /* Success / synced */
  --ok-ink:  #1f7a4d;
  --ok-bg:   #e9f6ee;

  --radius:   10px;
  --radius-sm: 7px;
  --maxw:     960px;

  --shadow-1: 0 1px 2px rgba(20,30,45,.05), 0 1px 3px rgba(20,30,45,.04);
  --shadow-2: 0 4px 12px rgba(20,30,45,.07), 0 2px 4px rgba(20,30,45,.05);
  --shadow-pop: 0 10px 34px rgba(20,30,45,.14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-wash); }

/* --------------------------------------------------------------------- Nav  */
header.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  height: 60px;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
  /* brand presence: a thin HTH-blue hairline under the nav */
  box-shadow: inset 0 -3px 0 -2px var(--brand-blue);
}

header.nav a.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
}
header.nav a.brand .brand-logo {
  height: 30px;
  width: auto;
  display: block;
  flex: none;
}
header.nav a.brand .brand-divider {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
  flex: none;
}
header.nav a.brand .brand-name {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}

header.nav .nav-spacer { flex: 1; }

header.nav span.user {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--muted);
  font-size: 13.5px;
}
header.nav span.user .user-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
header.nav span.user .user-email .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  flex: none;
}
header.nav span.user .user-email .who {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 30ch;
}
header.nav span.user a.logout {
  color: var(--muted);
  font-weight: 550;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
}
header.nav span.user a.logout:hover { color: var(--ink); border-color: var(--line-strong); }

/* ------------------------------------------------------------- Containers   */
main.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 22px 80px;
}
.container--narrow { max-width: 720px; }

/* ============================================================ LOGIN PAGE === */
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(120% 80% at 50% -10%, #ffffff 0%, var(--bg) 60%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  padding: 36px 34px 30px;
  text-align: center;
}
.login-card .login-logo {
  width: 220px; max-width: 80%; height: auto; margin: 4px auto 22px;
  display: block;
}
.login-card h1 { font-size: 21px; }
.login-card .login-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 8px;
  text-wrap: pretty;
}
.btn-google {
  margin-top: 26px;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color .12s, box-shadow .12s, transform .04s;
}
.btn-google:hover { border-color: #b9c4d2; box-shadow: var(--shadow-2); }
.btn-google:active { transform: translateY(1px); }
.btn-google .g-mark {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center;
  font-weight: 800; font-size: 12px; color: var(--muted);
}
.login-foot {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--faint);
  display: inline-flex; align-items: center; gap: 7px;
}
.login-foot .lock { width: 13px; height: 13px; opacity: .7; }

/* ====================================================== SEARCH / HOME ====== */
.search-hero { margin-bottom: 8px; }
.search-hero h1 { font-size: 24px; }
.search-hero .lede { color: var(--muted); margin-top: 6px; font-size: 15px; }

form.search {
  position: relative;
  margin: 20px 0 6px;
}
form.search .search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
form.search .search-icon {
  position: absolute; left: 16px; width: 19px; height: 19px;
  color: var(--faint); pointer-events: none;
}
form.search input[type="search"] {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 46px;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
}
form.search input[type="search"]::placeholder { color: var(--faint); }
form.search input[type="search"]:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
form.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* loading indicator (htmx-indicator pattern) */
span#search-indicator.htmx-indicator {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
/* htmx toggles .htmx-request on the indicator during the in-flight request */
span#search-indicator.htmx-indicator.htmx-request,
.htmx-request span#search-indicator.htmx-indicator { opacity: 1; }
span#search-indicator .spinner {
  width: 18px; height: 18px; display: block;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 2px 8px;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: .02em;
  text-transform: uppercase;
}

div#results { min-height: 60px; }

ul.results-list {
  list-style: none;
  margin: 0; padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
ul.results-list li { border-top: 1px solid var(--line); }
ul.results-list li:first-child { border-top: 0; }
ul.results-list li a {
  display: grid;
  grid-template-columns: 1fr 185px;
  grid-template-areas: "name aff" "mail aff";
  align-items: center;
  gap: 1px 18px;
  padding: 14px 16px;
  min-height: 56px;
  color: var(--ink);
  transition: background .1s;
}
ul.results-list li a:hover { background: var(--accent-wash); }
ul.results-list li a strong {
  grid-area: name;
  font-weight: 600; font-size: 15px;
}
ul.results-list li a small {
  grid-area: mail;
  color: var(--muted); font-size: 13px;
}
ul.results-list li a small.affiliation {
  grid-area: aff;
  text-align: right;
  color: var(--faint);
  font-size: 12.5px;
  justify-self: end;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  text-wrap: pretty;
}

/* empty state */
.empty-state {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 30px; height: 30px; margin: 0 auto 10px; color: var(--faint); opacity: .8;
}
.empty-state p { font-size: 14.5px; }
.empty-state .empty-hint { color: var(--faint); font-size: 13px; margin-top: 4px; }

/* =================================================== CONTACT DETAIL ======== */
.detail-top {
  margin-bottom: 18px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13.5px; font-weight: 550;
  padding: 6px 2px; cursor: pointer;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 15px; height: 15px; }

.detail-headline {
  display: flex; align-items: flex-start; gap: 16px;
  margin-top: 8px;
}
.detail-headline .avatar-lg {
  width: 52px; height: 52px; border-radius: 13px; flex: none;
  background: linear-gradient(150deg, var(--brand-blue), var(--brand-blue-d));
  color: #fff; display: grid; place-items: center;
  font-size: 19px; font-weight: 650; letter-spacing: .01em;
  box-shadow: var(--shadow-1);
}
.detail-headline .who-block { min-width: 0; }
.detail-headline h2 { font-size: 23px; line-height: 1.2; }
.detail-headline .who-sub {
  color: var(--muted); font-size: 14px; margin-top: 4px;
  display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center;
}
.detail-headline .who-sub .sub-item { display: inline-flex; align-items: center; }
.detail-headline .who-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); margin: 0 10px; }

/* Two-column split: Salesforce (read-only) | Workspace (notes) */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}

/* ---- Column section headers (the visual separation cue) ---- */
.col-head {
  display: flex; align-items: center; gap: 9px;
  margin: 0 2px 11px;
}
.col-head .col-title {
  font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--faint);
}
.source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px 3px 7px; border-radius: 999px;
}
.source-chip.sf { background: var(--sf-bg); color: #45617f; border: 1px solid var(--sf-line); }
.source-chip.sf svg { width: 13px; height: 13px; }
.source-chip.workspace { background: var(--accent-wash); color: var(--accent-ink); border: 1px solid #cfe0fd; }
.source-chip.workspace svg { width: 12px; height: 12px; }

/* =========================== SALESFORCE (read-only) panel ================= */
.sf-column { position: relative; }
.sf-panel {
  background: var(--sf-bg);
  border: 1px solid var(--sf-line);
  border-radius: var(--radius);
  padding: 4px;
}
.sf-panel > * + * { margin-top: 4px; }

article.contact-card,
.sf-panel section.events {
  background: var(--card);
  border: 1px solid var(--sf-line);
  border-radius: 8px;
  padding: 16px 18px;
}
article.contact-card h2 {
  /* full name already shown in headline; this h2 is the card label */
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 10px;
}
article.contact-card p {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 4px 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  align-items: baseline;
}
article.contact-card p:first-of-type { border-top: 0; padding-top: 2px; }
article.contact-card p .label {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
article.contact-card p .value { color: var(--ink); word-break: break-word; }
article.contact-card p .value.is-empty { color: var(--faint); }
article.contact-card p .value a { color: var(--accent); }

/* event history */
.sf-panel section.events h3,
.note-form h3, .notes h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 10px;
}
ul.event-list { list-style: none; margin: 0; padding: 0; }
ul.event-list li {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
ul.event-list li:first-child { border-top: 0; padding-top: 2px; }
ul.event-list li strong { font-weight: 600; font-size: 14px; }
ul.event-list li .ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
ul.event-list li small { color: var(--muted); font-size: 12.5px; }
ul.event-list li small.status {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-weight: 550;
}
ul.event-list li small.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong);
}
ul.event-list li small.status[data-status="Attended"]::before { background: var(--ok-ink); }
ul.event-list li small.status[data-status="Registered"]::before { background: var(--accent); }
ul.event-list li small.status[data-status="Invited"]::before { background: var(--brand-yellow); }

.events-scroll { max-height: 320px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.events-count {
  margin-left: auto; font-size: 11.5px; color: var(--faint);
  background: var(--sf-bg); border: 1px solid var(--sf-line);
  padding: 1px 8px; border-radius: 999px; font-weight: 600;
}

/* =========================== WORKSPACE (notes) ============================ */
.work-column { position: relative; }

form.note-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 18px 18px 16px;
  position: relative;
}
form.note-form::before {
  /* subtle accent edge marks this as the active workspace */
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
form.note-form > * { padding-left: 8px; }
form.note-form h3 { color: var(--accent-ink); }

.note-form label {
  display: block;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.note-form label.req::after { content: " *"; color: var(--accent); }

.note-form .field { margin-bottom: 14px; }

/* textarea editor */
.note-editor {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.note-editor:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px var(--accent-wash); }
.note-form textarea {
  display: block; width: 100%;
  min-height: 104px; resize: vertical;
  border: 0; outline: none;
  padding: 12px 13px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: transparent;
}
.note-form textarea::placeholder { color: var(--faint); }

/* record toolbar under the textarea */
.editor-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.editor-toolbar .toolbar-hint { color: var(--faint); font-size: 12px; margin-left: auto; }

.record-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 13px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.record-btn:hover { border-color: #b9c4d2; }
.record-btn:disabled { opacity: .65; cursor: default; }
.record-btn .rec-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #e0483d; flex: none;
  box-shadow: 0 0 0 0 rgba(224,72,61,.5);
}
.record-btn[data-recording="1"] {
  border-color: #f1b5b0; background: #fdeceb; color: #b3271b;
}
.record-btn[data-recording="1"] .rec-dot {
  border-radius: 3px;
  animation: recPulse 1.2s ease-out infinite;
}
@keyframes recPulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,72,61,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(224,72,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,72,61,0); }
}

/* live status caption (recording / transcribing) */
.dictation-live {
  display: none;
  margin-top: 6px; padding-left: 8px;
  font-size: 12.5px; color: var(--accent-ink);
}
.dictation-live.is-on { display: flex; align-items: center; gap: 7px; }
.dictation-live .live-pulse { width: 7px; height: 7px; border-radius: 50%; background: #e0483d; animation: recPulse 1.2s infinite; }

/* date input */
.note-form input[type="date"] {
  height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--card); outline: none; max-width: 220px;
}
.note-form input[type="date"]:focus { border-color: var(--focus); box-shadow: 0 0 0 4px var(--accent-wash); }

/* offerings */
fieldset.offerings {
  border: 0; margin: 0; padding: 0;
}
fieldset.offerings legend {
  padding: 0; margin-bottom: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
fieldset.offerings legend .legend-hint { color: var(--faint); font-weight: 500; margin-left: 6px; }
.offerings-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* chips treatment */
label.checkbox {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
label.checkbox:hover { border-color: #b9c4d2; color: var(--ink); }
label.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
label.checkbox .tick {
  width: 15px; height: 15px; flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
label.checkbox .tick svg { width: 10px; height: 10px; color: #fff; opacity: 0; transform: scale(.6); transition: .12s; }
label.checkbox input:checked + .tick { background: var(--accent); border-color: var(--accent); }
label.checkbox input:checked + .tick svg { opacity: 1; transform: scale(1); }
label.checkbox:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-ink);
}
label.checkbox input:focus-visible + .tick { box-shadow: 0 0 0 3px var(--accent-wash); }

/* form footer */
.note-form .form-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 18px;
}
.form-foot .foot-note { flex: 1; min-width: 160px; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: none; white-space: nowrap;
  min-height: 44px; padding: 0 20px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius);
  font-size: 14.5px; font-weight: 650; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background .12s, transform .04s, box-shadow .12s;
}
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #b8c6da; cursor: not-allowed; box-shadow: none; }
.btn-primary svg { width: 16px; height: 16px; }
.form-foot .foot-note { color: var(--faint); font-size: 12.5px; }
.form-foot .foot-note strong { color: var(--muted); font-weight: 600; }

/* =================================================== NOTES LIST ============ */
section#notes.notes { margin-top: 26px; }
.notes-head {
  display: flex; align-items: center; gap: 10px; margin: 0 2px 12px;
}
.notes-head h3 { margin: 0; }
.notes-head .notes-count {
  font-size: 11.5px; font-weight: 600; color: var(--faint);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px;
}

article.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 15px 16px;
  margin-bottom: 12px;
  animation: noteIn .25s ease both;
}
@keyframes noteIn { from { opacity: 0; transform: translateY(-5px); } }
article.note p { font-size: 14.5px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
article.note .note-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px;
}
span.tag {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--sf-bg); color: #45617f; border: 1px solid var(--sf-line);
}
article.note .note-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 12.5px;
}
article.note .note-meta .meta-author { color: var(--muted); font-weight: 600; }
article.note .note-meta .meta-sep { color: var(--line-strong); }
article.note .note-meta .badge { margin-left: auto; }

span.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px 3px 8px; border-radius: 999px;
}
span.badge .b-icon { width: 12px; height: 12px; }
span.badge.unsynced {
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line);
}
span.badge.synced {
  background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #c4e6d2;
}
article.note.note-unsynced { border-color: var(--warn-line); }

/* ============================================================ RESPONSIVE === */
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; gap: 26px; }
  .work-column { order: 2; }
}

@media (max-width: 620px) {
  main.container { padding: 20px 15px 64px; }
  header.nav { padding: 0 14px; gap: 10px; height: 56px; }
  header.nav a.brand .brand-divider,
  header.nav a.brand .brand-name { display: none; }
  header.nav a.brand .brand-logo { height: 26px; }
  header.nav span.user .user-email .who { display: none; }
  header.nav span.user { gap: 8px; }
  .search-hero h1 { font-size: 21px; }
  .detail-headline h2 { font-size: 20px; }
  form.search input[type="search"] { height: 50px; }
  ul.results-list li a { grid-template-columns: 1fr 130px; }
  ul.results-list li a small.affiliation { font-size: 12px; }
  article.contact-card p { grid-template-columns: 96px 1fr; }
  .login-card { padding: 28px 22px 24px; }
}

@media (max-width: 420px) {
  article.contact-card p {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0;
  }
  ul.results-list li a {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "mail" "aff";
    gap: 2px;
  }
  ul.results-list li a small.affiliation { text-align: left; max-width: 100%; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
