/* Monitoring tab + My account (public/js/pnp-monitoring.js).
   Uses the tokens defined in pnp-monitor.html. One loud element per screen:
   the status panel's "last check" line. Everything else is quiet and dense. */

.mtr-ic { display: block; flex: none; }
.mtr-fine { font-size: 12px; color: var(--ink-faint); line-height: 1.5; margin: 0; }
.mtr-sub { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; line-height: 1.4; }
.mtr-sub.warn { color: var(--amber); }
.mtr-sub.pos { color: var(--green); }
.mtr-sub.neg { color: var(--red); }
.mtr-state { font-size: 13px; color: var(--ink); }

.card.mtr-section { padding: 22px 24px; }
.mtr-section-head { margin-bottom: 14px; max-width: 70ch; }
.mtr-section-head h2 { font-size: 16px; margin: 0 0 4px; }
.mtr-section-head p { font-size: 13px; margin: 0; }

/* ---- Status panel ---- */
.card.mtr-status { padding: 22px 24px 20px; }
.mtr-status-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 28px; flex-wrap: wrap; }
.mtr-status-top > div:first-child { flex: 1 1 380px; min-width: 0; }
.mtr-status-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 6px; }
.mtr-status-title .pulse { width: 9px; height: 9px; }
.mtr-status-lede { font-size: 13.5px; color: var(--ink-soft); margin: 0; max-width: 62ch; }
.mtr-status-switch { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 0 1 260px; }

.mtr-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 18px 0 0; border-top: 1px solid var(--border); }
.mtr-facts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.mtr-facts > div { padding: 12px 14px 12px 0; }
.mtr-facts > div + div { padding-left: 14px; border-left: 1px solid var(--border); }
.mtr-facts dt { font-size: 12px; color: var(--ink-faint); margin: 0 0 3px; }
.mtr-facts dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.35; }
.mtr-programs-def { font-size: 12px; color: var(--ink-faint); line-height: 1.55; margin: 2px 0 14px; max-width: 90ch; }

.mtr-line { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--green-bg); color: #155c33; font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.mtr-line .mtr-ic { margin-top: 2px; color: var(--green); }
.mtr-line.attn { background: var(--amber-bg); color: #7a4a00; }
.mtr-line.attn .mtr-ic { color: var(--amber); }
.mtr-late { margin: 10px 0 0; }

/* ---- Switch (email alerts) ---- */
.mtr-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; background: none; border: none; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.mtr-switch:disabled { opacity: .6; cursor: progress; }
.mtr-switch-track { position: relative; width: 36px; height: 20px; border-radius: 100px; background: #cfced8; transition: background-color .15s ease; flex: none; }
.mtr-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20,19,26,.2); transition: transform .15s ease; }
.mtr-switch[aria-checked="true"] .mtr-switch-track { background: var(--green); }
.mtr-switch[aria-checked="true"] .mtr-switch-thumb { transform: translateX(16px); }
.mtr-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.mtr-switch-label strong { font-weight: 600; }

/* ---- Tabs (segmented, underline) ---- */
.mtr-seg { display: flex; flex-wrap: wrap; gap: 2px 18px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.mtr-seg-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 0 2px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.mtr-seg-btn:hover:not(:disabled) { color: var(--ink); }
.mtr-seg-btn[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pink); font-weight: 600; }
.mtr-seg-btn:disabled { color: #c3c2cc; cursor: default; }
.mtr-seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.mtr-seg-n { font-size: 11.5px; font-weight: 600; color: var(--ink-faint); background: var(--bg-soft); border-radius: 100px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.mtr-seg-btn[aria-selected="true"] .mtr-seg-n { color: var(--pink); background: #fff0f6; }
.mtr-group-note { font-size: 12.5px; color: var(--ink-faint); margin: 10px 0 4px; }

/* ---- Pathways table ---- */
.mtr-table-wrap { width: 100%; }
.mtr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtr-table thead th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-faint); padding: 10px 12px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mtr-table td, .mtr-table tbody th { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); font-weight: 400; }
.mtr-table tbody tr:last-child td, .mtr-table tbody tr:last-child th { border-bottom: none; }
.mtr-prog { min-width: 190px; max-width: 260px; }
.mtr-prov { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); margin-right: 6px; }
.mtr-name { font-weight: 600; color: var(--ink); line-height: 1.4; }
.mtr-src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; }
.mtr-src:hover { text-decoration: underline; }
.mtr-why { color: var(--ink-soft); max-width: 220px; line-height: 1.45; }
.mtr-table .badge { white-space: normal; }
.mtr-table--account th a { font-weight: 600; }

/* ---- What we watch ---- */
.mtr-watch { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.mtr-watch li { display: flex; gap: 12px; align-items: flex-start; }
.mtr-watch li .mtr-ic { color: var(--blue); margin-top: 1px; }
.mtr-watch strong { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.mtr-watch span { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.mtr-watch + .mtr-fine { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---- Change history ---- */
.mtr-log { list-style: none; margin: 0; padding: 0; }
.mtr-log-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mtr-log-item:last-child { border-bottom: none; }
.mtr-log-date { font-size: 12px; color: var(--ink-faint); padding-top: 2px; font-variant-numeric: tabular-nums; }
.mtr-log-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.mtr-log-top h3 { font-size: 13.5px; margin: 0; }
.mtr-kind { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.mtr-kind.program { background: #eaf5ff; color: #0b5fb0; }
.mtr-kind.profile { background: var(--bg-soft); color: var(--ink-soft); }
.mtr-log-dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.mtr-log-dl dt { font-size: 12px; color: var(--ink-faint); margin-bottom: 2px; }
.mtr-log-dl dd { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.5; }
.mtr-impact { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 100px; margin-right: 2px; }
.mtr-impact.positive { background: var(--green-bg); color: var(--green); }
.mtr-impact.negative { background: var(--red-bg); color: var(--red); }
.mtr-impact.neutral { background: var(--bg-soft); color: var(--ink-soft); }
.mtr-emailed { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-faint); margin-top: 8px; }
.mtr-empty { display: flex; align-items: flex-start; gap: 10px; padding: 16px 0 4px; color: var(--ink-soft); }
.mtr-empty .mtr-ic { color: var(--green); margin-top: 1px; }
.mtr-empty p { margin: 0; font-size: 13px; }

/* ---- Offer (one-time buyers) ---- */
.card.mtr-offer { display: grid; grid-template-columns: minmax(0, 1fr) 260px; padding: 0; overflow: hidden; }
.mtr-offer-main { padding: 24px 26px; }
.mtr-offer-kicker { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--pink); margin: 0 0 8px; }
.mtr-offer h2 { font-size: 18px; margin: 0 0 6px; }
.mtr-offer-lede { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; max-width: 62ch; }
.mtr-offer-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mtr-offer-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.mtr-offer-list .mtr-ic { color: var(--green); margin-top: 2px; }
.mtr-offer-aside { background: var(--bg-soft); border-left: 1px solid var(--border); padding: 24px 22px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.mtr-offer-price { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.mtr-offer-price strong { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.mtr-offer-aside .btn { min-height: 44px; }

/* ---- Account ---- */
.mtr-account { max-width: 900px; }
.mtr-account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.mtr-account-head h1 { font-size: 19px; margin: 0 0 2px; }
.mtr-lang { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.mtr-lang-btn { min-height: 38px; padding: 0 14px; background: none; border: none; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.mtr-lang-btn + .mtr-lang-btn { border-left: 1px solid var(--border); }
.mtr-lang-btn[aria-pressed="true"] { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.mtr-lang-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mtr-account-alerts { display: flex; align-items: center; flex-wrap: wrap; gap: 0 14px; margin: 0 0 10px; }
.mtr-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.mtr-actions .btn { min-height: 44px; }
.mtr-section > .mtr-fine + .btn { margin-top: 12px; }
.mtr-section .mtr-table-wrap + .mtr-fine { margin-top: 12px; }

/* ---- Loading ---- */
.card.mtr-loading { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.mtr-skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-soft) 0%, #ececf1 50%, var(--bg-soft) 100%); background-size: 200% 100%; animation: mtr-shimmer 1.2s linear infinite; }
.mtr-skel.w40 { width: 40%; height: 16px; } .mtr-skel.w70 { width: 70%; } .mtr-skel.w55 { width: 55%; }
@keyframes mtr-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .mtr-skel { animation: none; }
  .mtr-switch-track, .mtr-switch-thumb { transition: none; }
}

/* ---- Tablet ---- */
@media (max-width: 1100px) {
  .mtr-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mtr-facts > div:nth-child(4) { padding-left: 0; border-left: none; }
  .mtr-facts > div:nth-child(n+4) { border-top: 1px solid var(--border); }
}

/* ---- Phone ---- */
@media (max-width: 720px) {
  .card.mtr-section, .card.mtr-status { padding: 18px 16px; }
  .mtr-facts, .mtr-facts--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtr-facts > div, .mtr-facts > div + div { padding: 10px 10px 10px 0; border-left: none; border-top: 1px solid var(--border); }
  .mtr-facts > div:nth-child(-n+2) { border-top: none; }
  .mtr-facts > div:nth-child(4) { padding-left: 0; }
  .mtr-status-switch { flex: 1 1 100%; }
  .mtr-seg { gap: 0 16px; }
  .mtr-seg-btn { min-height: 44px; }

  .mtr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .mtr-table, .mtr-table tbody, .mtr-table tr, .mtr-table td, .mtr-table tbody th { display: block; width: 100%; }
  .mtr-table tr { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .mtr-table tbody tr:last-child { border-bottom: none; }
  .mtr-table td, .mtr-table tbody th { border: none; padding: 4px 0; max-width: none; min-width: 0; }
  .mtr-table tbody th { padding-bottom: 8px; }
  .mtr-table td[data-label] { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; }
  .mtr-table td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--ink-faint); padding-top: 1px; }
  .mtr-table td[data-label] > .badge { justify-self: start; }
  .mtr-table td[data-label] > .mtr-sub { grid-column: 2; margin-top: 0; }
  .mtr-src { min-height: 32px; }

  .mtr-watch { grid-template-columns: 1fr; gap: 14px; }
  .mtr-log-item { grid-template-columns: 1fr; gap: 4px; }
  .mtr-log-dl { grid-template-columns: 1fr; }
  .card.mtr-offer { grid-template-columns: 1fr; }
  .mtr-offer-main { padding: 20px 16px; }
  .mtr-offer-aside { border-left: none; border-top: 1px solid var(--border); padding: 18px 16px 20px; }
  .mtr-lang-btn { min-height: 44px; }
}
.mtr-line.wait { background: var(--bg-soft); color: var(--ink-soft); }
.mtr-line.wait .mtr-ic { color: var(--ink-faint); }
.mtr-acct-inactive { margin: 0 0 8px; }

/* Simple top bar (shared): keep it inside 390px when the QA badge is shown. */
@media (max-width: 480px) {
  header.top { flex-wrap: wrap; gap: 6px 12px; padding: 12px 16px; }
  header.top nav { gap: 14px; flex-wrap: wrap; }
}
