/* TASK-11915 — the soft-tactile Notes surface (pill tabs, soft cards, desktop
   glass with a solid fallback). Shared by Team Notes (public/src/notes.js,
   loaded from index.html) and, from TASK-11913, Carrier Notes on
   compliance-manager-v2.html. DESIGN.md Decisions Log 2026-11-16: the
   deviation is scoped to these two surfaces; everything else stays on the
   system.

   Plain CSS linked by <link> — not a ?v= JS cross-import (Pitfall #1 does not
   apply). compliance-manager-v2.html does not load styles.css, so every token
   below falls back to the DESIGN.md hex when the app variable is missing.
   Classes only (prefix .ns-); Notes-only layout stays in notes.js. */

:root {
  --ns-ink: var(--text-primary, #0F172A);
  --ns-ink-2: var(--text-secondary, #475569);
  --ns-card: var(--bg-card, #FFFFFF);
  --ns-sunk: var(--bg-elevated, #F1F5F9);
  --ns-line: var(--border-light, #E2E8F0);
  /* Solid fills carrying white text use the dark brand blue (5.2:1 on white
     text; #3B82F6 is 3.7:1). */
  --ns-accent: var(--brand-blue-dark, #2563EB);
  --ns-focus: var(--brand-blue, #3B82F6);
  --ns-unread: #D97706;
  --ns-radius: 12px;
  --ns-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.06);
  --ns-shadow-hover: 0 6px 14px rgba(15, 23, 42, 0.10), 0 2px 4px rgba(15, 23, 42, 0.06);
  --ns-inset: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ---- Segmented pill control (tabs) ------------------------------------- */
.ns-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--ns-sunk);
  box-shadow: var(--ns-inset);
  max-width: 100%;
  overflow-x: auto;
}
.ns-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ns-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.ns-seg-btn:hover { background: rgba(15, 23, 42, 0.06); }
.ns-seg-btn.on,
.ns-seg-btn[aria-pressed="true"],
.ns-seg-btn[aria-selected="true"] {
  background: var(--ns-accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.30);
}
.ns-seg-btn:focus-visible { outline: 2px solid var(--ns-focus); outline-offset: 2px; }
/* Unread count chip. Amber on the plain pill, white-on-blue-ring inside the
   active one so it never disappears into the fill. */
.ns-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #B45309;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.ns-seg-btn.on .ns-count,
.ns-seg-btn[aria-pressed="true"] .ns-count,
.ns-seg-btn[aria-selected="true"] .ns-count { background: #FFFFFF; color: #1E3A8A; }

/* ---- Pill buttons -------------------------------------------------------- */
.ns-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--ns-line);
  background: var(--ns-card);
  color: var(--ns-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--ns-shadow);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.ns-pill .material-icons { font-size: 18px; color: inherit; }
.ns-pill:hover { transform: translateY(-1px); box-shadow: var(--ns-shadow-hover); }
.ns-pill:focus-visible { outline: 2px solid var(--ns-focus); outline-offset: 2px; }
.ns-pill-primary { background: var(--ns-accent); border-color: var(--ns-accent); color: #FFFFFF; }
.ns-pill-primary:hover { background: #1D4ED8; border-color: #1D4ED8; }
.ns-pill:disabled { opacity: .6; cursor: default; transform: none; }

/* ---- Soft cards ---------------------------------------------------------- */
.ns-card {
  background: var(--ns-card);
  color: var(--ns-ink);
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-radius);
  box-shadow: var(--ns-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ns-card-hover:hover { transform: translateY(-1px); box-shadow: var(--ns-shadow-hover); }
.ns-card-hover:focus-visible { outline: 2px solid var(--ns-focus); outline-offset: 2px; }
/* Unread: bold + a dot + a left accent bar — never glow alone. */
.ns-card.is-unread { box-shadow: inset 4px 0 0 var(--ns-unread), var(--ns-shadow); }
.ns-card.is-unread.ns-card-hover:hover { box-shadow: inset 4px 0 0 var(--ns-unread), var(--ns-shadow-hover); }
.ns-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ns-unread); }

/* ---- Avatar: colored initial circle, color stable per person ------------ */
.ns-av {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  background: #334155;
}
/* Every fill is ≥4.5:1 against the white initial. */
.ns-av-c0 { background: #1D4ED8; }
.ns-av-c1 { background: #047857; }
.ns-av-c2 { background: #7C3AED; }
.ns-av-c3 { background: #B45309; }
.ns-av-c4 { background: #BE123C; }
.ns-av-c5 { background: #0F766E; }
.ns-av-c6 { background: #4338CA; }
.ns-av-c7 { background: #9D174D; }
.ns-av-navy { background: #0F172A; }

/* ---- Fields: soft inset with a visible focus ring (not color only) ------ */
.ns-field {
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-radius);
  background: var(--ns-card);
  color: var(--ns-ink);
  box-shadow: var(--ns-inset);
}
.ns-field:focus,
.ns-field:focus-visible {
  outline: 2px solid var(--ns-focus);
  outline-offset: 2px;
  border-color: var(--ns-focus);
}

/* ---- Static loading skeleton (no shimmer) ------------------------------- */
.ns-skel { display: block; border-radius: 999px; background: var(--ns-sunk); height: 12px; }

/* ---- Panel glass: desktop only, solid by default ------------------------ */
/* Apply to the dialog CARD, never to the modal scrim: a backdrop-filter on an
   element makes it the containing block for position:fixed descendants (the
   Notes "Add person" picker would land in the wrong place). */
.ns-glass { background: var(--ns-card); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (min-width: 769px) {
    .ns-glass {
      background: rgba(255, 255, 255, 0.86);
      -webkit-backdrop-filter: blur(18px) saturate(140%);
      backdrop-filter: blur(18px) saturate(140%);
      border-color: rgba(255, 255, 255, 0.7);
    }
  }
}
@media (prefers-reduced-transparency: reduce) {
  .ns-glass { background: var(--ns-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ns-pill, .ns-card, .ns-seg-btn { transition: none; }
  .ns-pill:hover, .ns-card-hover:hover { transform: none; }
}
