  /* ---------- Toasts ---------- */
  .toast-stack{position:fixed;right:16px;bottom:16px;display:flex;flex-direction:column;gap:8px;z-index:100}
  .toast{
    background:var(--ink);color:#fff;padding:10px 14px;border-radius:var(--radius);font-size:13px;
    box-shadow:0 4px 14px rgba(0,0,0,.18);min-width:220px;max-width:360px;
    animation:toast-in .18s ease-out;
  }
  .toast.error{background:var(--danger)}
  .toast.success{background:var(--accent-dark)}
  @keyframes toast-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

  /* ---------- Accordion transition (list quick-expand, kept modal-free) ---------- */
  .acc-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows .18s ease}
  .acc-wrap.open{grid-template-rows:1fr}
  .acc-inner{overflow:hidden}

  @media (max-width:820px){
    .field-grid{grid-template-columns:repeat(2,1fr)}
    .field.span-2,.field.span-4{grid-column:span 2}
    .topbar .search-wrap{width:160px}
  }

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

  /* ---------- Numbering hint ---------- */
  .numhint{
    display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--accent-tint);
    border:1px solid var(--line);border-radius:var(--radius);padding:8px 10px;font-size:12px;
  }
  .numhint .btn{font-family:var(--mono)}



/* Action toast (undo etc.) — shared with contract-copy */
.toast.toast-with-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toast-action-btn {
  border: 1px solid rgba(255,255,255,0.45);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.toast-action-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* B1 server mode: login, conflict, sync status */
.login-overlay,
.conflict-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg, #0f1419) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.login-card,
.conflict-card {
  background: var(--surface, #fff);
  color: var(--text, #111);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  min-width: min(360px, 92vw);
  max-width: 560px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.login-title { margin: 0 0 .5rem; font-size: 1.25rem; }
.login-hint { margin: 0 0 1rem; opacity: .8; font-size: .9rem; }
.login-label { display: block; margin-bottom: .75rem; font-size: .85rem; }
.login-input {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .5rem .6rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  background: var(--input-bg, #fff);
  color: inherit;
}
.login-error { color: var(--danger, #b00020); margin: .5rem 0; }
.conflict-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 1rem 0; }
.conflict-table th, .conflict-table td { border: 1px solid var(--border, #ddd); padding: .4rem; vertical-align: top; }
.conflict-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.sync-status {
  font-size: .8rem;
  padding: .2rem .5rem;
  border-radius: 4px;
  opacity: .9;
  white-space: nowrap;
}
.sync-status[data-status="synced"] { color: var(--ok, #1a7f37); }
.sync-status[data-status="pending"] { color: var(--warn, #9a6700); }
.sync-status[data-status="offline"] { color: var(--muted, #666); }
.sync-status[data-status="error"],
.sync-status[data-status="conflict"] { color: var(--danger, #b00020); }
.sync-status[data-status="syncing"] { color: var(--accent, #0969da); }

/* Outbox pressure: own row under the 52px top bar, so the sentence does not sit in that flex row. */
.outbox-banner {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  background: #F3E7CE;
  color: var(--amber, #9C6B15);
  border-bottom: 1px solid var(--amber, #9C6B15);
}
.outbox-banner[data-level="high"],
.outbox-banner[data-level="hard"],
.outbox-banner[data-level="persist"] {
  background: var(--danger-tint, #F6E9E6);
  color: var(--danger, #A3402F);
  border-bottom-color: var(--danger, #A3402F);
}

/* Portal document number: green = known id, grey = unknown. */
.badge.portal-sync-badge {
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}
.badge.portal-sync-badge.is-on-portal {
  color: #1b7f3a;
  border-color: #1b7f3a;
  background: #eef8f1;
}
.badge.portal-sync-badge.is-unknown {
  color: #5a6570;
  border-color: #c5cdd4;
  background: #f4f6f8;
}
.badge.portal-sync-badge.is-modified {
  color: #9a6700;
  border-color: #9a6700;
  background: #fbf6ea;
}
.badge.portal-sync-badge.is-error {
  color: #a40000;
  border-color: #a40000;
  background: #fdecec;
}
