/* frontend/css/redesign.css
   The current look of the page. Loaded after styles.css, which still holds the
   layout mechanics of the map popup and the mobile chart viewer.

   Rules of this design:
   - Status is shown with a small pill or dot and a soft tint. Never with a
     coloured stripe down one side of a box.
   - One hairline border and one soft shadow, used everywhere.
   - Colours come from the tokens below, in light and dark.
*/

/* ------------------------------------------------------------------ tokens */

:root {
  --font-family-base: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --color-background: #f3f5f1;
  --color-surface: #ffffff;
  --color-text: #15201a;
  --color-text-secondary: #5c6962;
  --color-primary: #1a6b49;
  --color-primary-hover: #15593c;
  --color-primary-active: #104730;
  --color-btn-primary-text: #ffffff;
  --color-border: rgba(21, 32, 26, 0.10);
  --color-card-border: rgba(21, 32, 26, 0.09);
  --color-card-border-inner: rgba(21, 32, 26, 0.07);
  --color-secondary: rgba(21, 32, 26, 0.05);
  --color-secondary-hover: rgba(21, 32, 26, 0.08);
  --color-secondary-active: rgba(21, 32, 26, 0.12);
  --color-success: #1a6b49;
  --color-warning: #a8590a;
  --color-error: #b3261e;
  --color-info: #5c6962;
  --color-focus-ring: rgba(26, 107, 73, 0.28);
  --color-success-rgb: 26, 107, 73;
  --color-warning-rgb: 168, 89, 10;
  --color-error-rgb: 179, 38, 30;

  --be-surface-2: #f7f8f5;
  --be-tint-ok: #e6f2eb;
  --be-tint-warn: #fbefdd;
  --be-tint-danger: #fbe9e7;
  --be-tint-neutral: #eceeeb;
  --be-ink-ok: #15593c;
  --be-ink-warn: #8a4707;
  --be-ink-danger: #9a1f18;
  --be-ink-neutral: #4d5953;

  --be-radius-lg: 18px;
  --be-radius: 14px;
  --be-radius-sm: 10px;
  --be-shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 10px 30px rgba(16, 24, 20, 0.07);
  --be-shadow-pop: 0 2px 6px rgba(16, 24, 20, 0.08), 0 18px 48px rgba(16, 24, 20, 0.16);

  /* the colours of the zones on the map, poorest to best */
  --zone-0: #e5352b;
  --zone-1: #f2c81b;
  --zone-2: #2fb344;
  --zone-3: #2456e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0e1311;
    --color-surface: #161c19;
    --color-text: #e7ede9;
    --color-text-secondary: #98a69e;
    --color-primary: #4ec48c;
    --color-primary-hover: #63d09b;
    --color-primary-active: #3fb07b;
    --color-btn-primary-text: #06120c;
    --color-border: rgba(255, 255, 255, 0.10);
    --color-card-border: rgba(255, 255, 255, 0.09);
    --color-card-border-inner: rgba(255, 255, 255, 0.07);
    --color-secondary: rgba(255, 255, 255, 0.06);
    --color-secondary-hover: rgba(255, 255, 255, 0.09);
    --color-secondary-active: rgba(255, 255, 255, 0.13);
    --color-success: #4ec48c;
    --color-warning: #f0a94b;
    --color-error: #f28b82;
    --color-info: #98a69e;
    --color-focus-ring: rgba(78, 196, 140, 0.35);
    --color-success-rgb: 78, 196, 140;
    --color-warning-rgb: 240, 169, 75;
    --color-error-rgb: 242, 139, 130;

    --be-surface-2: #1b221f;
    --be-tint-ok: rgba(78, 196, 140, 0.14);
    --be-tint-warn: rgba(240, 169, 75, 0.14);
    --be-tint-danger: rgba(242, 139, 130, 0.14);
    --be-tint-neutral: rgba(255, 255, 255, 0.07);
    --be-ink-ok: #7fdcae;
    --be-ink-warn: #f3bd76;
    --be-ink-danger: #f5a69f;
    --be-ink-neutral: #b4c0b9;
    --be-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    --be-shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

html, body {
  font-family: var(--font-family-base);
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.006em;
}

/* ------------------------------------------------------------------ shared pieces */

.eyebrow {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.muted {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.muted:empty { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--be-tint-neutral);
  color: var(--be-ink-neutral);
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-ok { background: var(--be-tint-ok); color: var(--be-ink-ok); }
.pill-warn { background: var(--be-tint-warn); color: var(--be-ink-warn); }
.pill-danger { background: var(--be-tint-danger); color: var(--be-ink-danger); }

.card {
  margin-top: 14px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-card-border);
  border-radius: var(--be-radius);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* A message about the state of things: tinted, with a dot. No stripe. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--be-radius-sm);
  font-size: 13px;
  line-height: 1.45;
  background: var(--be-tint-neutral);
  color: var(--be-ink-neutral);
}
.notice[hidden] { display: none; }
.notice::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: currentColor;
}
.notice-ok { background: var(--be-tint-ok); color: var(--be-ink-ok); }
.notice-warn { background: var(--be-tint-warn); color: var(--be-ink-warn); }

.list:empty { display: none; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  border-top: 1px solid var(--color-card-border-inner);
}
.list > .muted + .list-row,
.list > .list-row:first-child { border-top: none; }
#brain-maps { margin-top: 10px; }
.card[hidden] { display: none; }
#brain-link > .muted:first-child { margin: 0 0 4px; }

/* ------------------------------------------------------------------ controls */

select, input[type="date"], textarea, input[type="text"] {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--be-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select { width: 100%; height: 38px; padding: 0 34px 0 12px; }
input[type="date"] { height: 32px; padding: 0 8px; font-size: 12.5px; }
.select-sm { width: auto; height: 30px; padding: 0 28px 0 10px; font-size: 12.5px; }
select:hover, input[type="date"]:hover, textarea:hover { border-color: rgba(var(--color-success-rgb), 0.45); }
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.btn-primary, .btn-outline {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--be-radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  width: auto;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn-primary { background: var(--color-primary); color: var(--color-btn-primary-text); border: 1px solid transparent; }
.btn-primary:hover { background: var(--color-primary-hover); transform: none; box-shadow: none; }
.btn-outline { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-outline:hover { background: var(--color-secondary); border-color: var(--color-border); transform: none; }
.btn-primary:active, .btn-outline:active { transform: translateY(1px); }
.btn-primary:disabled, .btn-outline:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-text {
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.btn-text:hover { background: var(--color-secondary); color: var(--color-text); }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.inline-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}
.inline-form button { margin-left: auto; }

/* ------------------------------------------------------------------ frame */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: var(--color-background);
  border-bottom: none;
  backdrop-filter: none;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(145deg, #2a8f63, #15593c);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text); }
.brand-tag {
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-container {
  height: calc(100vh - 56px);
  gap: 12px;
  padding: 0 12px 12px;
  background: var(--color-background);
}
.map-section {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
}
.map-container {
  border-radius: var(--be-radius-lg);
  box-shadow: var(--be-shadow);
}
.agents-section {
  flex: 0 0 420px;
  min-width: 0;
  max-width: none;
  border: 1px solid var(--color-card-border);
  border-radius: var(--be-radius-lg);
  background: var(--be-surface-2);
  box-shadow: var(--be-shadow);
  overflow: hidden;
}

/* map controls and legend */
.ol-zoom { top: 14px; left: 14px; padding: 0; background: none; }
.ol-zoom .ol-zoom-in, .ol-zoom .ol-zoom-out {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--be-shadow);
}
.ol-zoom .ol-zoom-in { border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--color-border); }
.ol-zoom .ol-zoom-out { border-radius: 0 0 10px 10px; }
.ol-zoom button:hover, .ol-zoom button:focus { background: var(--be-surface-2); color: var(--color-text); outline: none; }
.ol-attribution { border-radius: 8px 0 0 0; }

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  width: 232px;
  padding: 13px 14px 11px;
  border-radius: var(--be-radius);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--be-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.map-legend[hidden] { display: none; }
.legend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.legend-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.legend-sub { margin: 2px 0 9px; font-size: 11.5px; color: var(--color-text-secondary); }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 12.5px; color: var(--color-text); }
.legend-name { flex: 1; }
.legend-value { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.legend-note { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-card-border-inner); font-size: 11px; color: var(--color-text-secondary); }

.zp-swatch { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--zone-0); }
.zp-rank-1 { background: var(--zone-1); }
.zp-rank-2 { background: var(--zone-2); }
.zp-rank-3 { background: var(--zone-3); }

/* ------------------------------------------------------------------ tabs */

.tab-headers {
  gap: 4px;
  margin: 12px 12px 0;
  padding: 4px;
  border: none;
  border-radius: 12px;
  background: var(--be-tint-neutral);
}
.tab-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.tab-btn:hover { background: transparent; color: var(--color-text); }
.tab-btn.active {
  border-bottom: none;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 20, 0.10);
}
.tab-content-container { background: transparent; }
.tab-content { padding: 0; scrollbar-width: thin; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.panel { padding: 14px 14px 28px; }
.field-picker { padding: 2px 2px 0; }

.agent-header h3 {
  margin: 0;
  padding: 18px 18px 10px;
  font-size: 15px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ field tab */

.chart-box { position: relative; height: 176px; }

.finding-list { display: grid; gap: 10px; }
.finding {
  padding: 13px 14px 10px;
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  background: var(--be-surface-2);
}
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finding-date { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.finding-title { margin: 9px 0 4px; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--color-text); }
.finding-detail { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--color-text-secondary); }
.finding-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.confidence { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--color-text-secondary); }
.confidence-dots { display: inline-flex; gap: 3px; }
.confidence-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-secondary-active); }
.confidence-dots i.on { background: var(--color-primary); }

/* ------------------------------------------------------------------ ask tab */

#chat-tab.active { display: flex; flex-direction: column; }
.chat-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 6px 16px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
}
.message { margin-bottom: 12px; }
.message-content {
  max-width: 88%;
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.55;
}
.message-content p { margin: 0 0 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message.assistant .message-content {
  background: var(--color-surface);
  border: 1px solid var(--color-card-border);
  border-radius: 16px 16px 16px 5px;
}
.message.user .message-content {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border-radius: 16px 16px 5px 16px;
}
.message-content ul.chat-list { margin: 6px 0; padding-left: 18px; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chat-quick-btn {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}
.chat-quick-btn:hover { background: var(--be-tint-ok); border-color: transparent; color: var(--be-ink-ok); }

.chat-input-container {
  gap: 8px;
  align-items: flex-end;
  margin: 0 12px 12px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
}
.chat-input-container:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.chat-input-container textarea {
  flex: 1;
  min-height: 40px;
  padding: 9px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  resize: none;
  box-shadow: none;
}
.chat-input-container textarea:focus { box-shadow: none; }
.chat-input-container .btn-primary { height: 36px; border-radius: 11px; }

.chat-action {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  background: var(--be-surface-2);
  font-size: 12.5px;
}
.chat-action-summary { margin-bottom: 9px; line-height: 1.5; color: var(--color-text-secondary); }

/* ------------------------------------------------------------------ health and pest tabs */

.upload-container { padding: 4px 18px 18px; }
.results-container, .loading-indicator, .image-preview { border-radius: var(--be-radius-sm); }

/* ------------------------------------------------------------------ zone popup */

.ol-popup {
  border: 1px solid var(--color-card-border);
  border-radius: var(--be-radius-lg);
  background: var(--color-surface);
  box-shadow: var(--be-shadow-pop);
  backdrop-filter: none;
}
.ol-popup hr { margin: 12px 0; border: none; border-top: 1px solid var(--color-card-border-inner); }

.zp-head { display: flex; align-items: flex-start; gap: 10px; }
.zp-head .zp-swatch { width: 14px; height: 14px; margin-top: 3px; }
.zp-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--color-text); }
.zp-meta { margin-top: 2px; font-size: 12px; color: var(--color-text-secondary); }
.zp-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--color-text-secondary); }
.zp-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.zp-index { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-card-border-inner); }
.zp-index-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.zp-index-desc { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--color-text-secondary); }
.zp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.zp-stat { padding: 7px 9px; border-radius: 9px; background: var(--be-surface-2); }
.zp-stat span { display: block; font-size: 10.5px; color: var(--color-text-secondary); }
.zp-stat strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text); }

.zp-details { margin-top: 8px; }
.ol-popup details summary {
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: var(--be-surface-2);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}
.ol-popup details summary:hover { background: var(--color-secondary-hover); }

.explanation-section {
  margin-bottom: 12px;
  padding: 13px 14px;
  border: none;
  border-radius: 12px;
  background: var(--be-surface-2);
}
.explanation-section h4.zp-explain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.explanation-toggle-btn {
  height: 24px !important;
  padding: 0 9px !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 999px !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
.explanation-content { font-size: 13px; line-height: 1.6; color: var(--color-text); }
.analysis-section { padding: 0 !important; margin-bottom: 10px; }
.recommendations-section { padding: 0; background: transparent; }
.recommendation-card {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: none;
}
.recommendation-card:hover { transform: none; box-shadow: none; }
.rec-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rec-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--be-tint-ok);
  color: var(--be-ink-ok);
  font-size: 11px;
  font-weight: 700;
}
.rec-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.rec-description { font-size: 12.5px; line-height: 1.55; color: var(--color-text-secondary); }
.index-badge {
  padding: 1px 6px;
  border: none;
  border-radius: 6px;
  background: var(--be-tint-ok);
  color: var(--be-ink-ok);
  font-weight: 500;
}
.metric-value { color: var(--color-text); font-weight: 600; }
.mobile-chart-trigger {
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: none;
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 768px) {
  .app-header { height: 50px; padding: 0 14px; }
  .brand-tag { display: none; }
  .app-container { height: calc(100vh - 50px); gap: 8px; padding: 0 8px 8px; }
  .map-section { flex: none; height: 46vh; border: none; }
  .agents-section { flex: 1 1 auto; height: auto; min-height: 0; border: 1px solid var(--color-card-border); }
  .tab-content { height: 100%; padding: 0; }
  .chat-messages { max-height: none; padding: 6px 12px 10px; }
  .message-content { max-width: 92%; font-size: 13.5px; padding: 10px 13px; }
  .btn-primary, .btn-outline { padding: 0 14px; font-size: 13px; }
  .agent-header h3 { margin: 0; padding: 14px 14px 8px; font-size: 15px; }
  .map-legend { left: 10px; bottom: 10px; width: auto; padding: 9px 11px 8px; }
  .legend-sub { margin-bottom: 6px; }
  .legend-value, .legend-note { display: none; }
  .legend-row { padding: 2px 0; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ accounts */

.header-right { display: flex; align-items: center; gap: 10px; }
.user-menu[hidden] { display: none; }
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}
.user-btn:hover { background: var(--be-surface-2); }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--be-tint-ok);
  color: var(--be-ink-ok);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.person-text { min-width: 0; flex: 1; }
.person-name { font-size: 13.5px; font-weight: 500; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; }
.person-text .muted { margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

input[type="text"], input[type="email"] {
  height: 36px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--be-radius-sm);
}
input[type="text"]:disabled { background: var(--be-surface-2); color: var(--color-text-secondary); }
.inline-form input[type="text"], .inline-form input[type="email"] { flex: 1; min-width: 0; }
.inline-form-tight { margin-top: 0; }
.inline-form[hidden], .muted[hidden], .btn-outline[hidden] { display: none; }

/* the sign-in screen replaces the app until someone is signed in */
body.signed-out .app-container, body.signed-out .header-right { display: none; }
.signin {
  display: grid;
  place-items: center;
  height: calc(100vh - 56px);
  padding: 16px;
  background: var(--color-background);
}
.signin[hidden] { display: none; }
.signin-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 26px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--be-radius-lg);
  background: var(--color-surface);
  box-shadow: var(--be-shadow);
  text-align: center;
}
.brand-mark-lg { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; }
.brand-mark-lg svg { width: 28px; height: 28px; }
.signin-card h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text); }
.signin-tag { margin: 4px 0 22px; font-size: 14px; color: var(--color-text-secondary); }
.signin-card .notice { margin: 0 0 14px; text-align: left; }
.signin-action { display: flex; width: 100%; height: 42px; margin-top: 10px; text-decoration: none; }
.signin-action[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.signin-card .muted { margin-top: 18px; }

@media (max-width: 768px) {
  .user-name { display: none; }
  .user-btn { padding: 0 4px; }
  .header-right .pill { display: none; }
  .signin { height: calc(100vh - 50px); }
  .tab-btn { padding: 0 6px; font-size: 12.5px; }
}
