/* ==========================================================================
   Wisdom Group — Student / Parent Portal Redesign ("Porcelain" indigo)
   Scoped to .wg-portal-redesign so it never leaks into the public site or
   the CMS / Academy shells. Reuses the admin theme tokens; one indigo accent,
   semantic tints only on status. Mobile-first.
   ========================================================================== */

/* Tokens are shared with the body-level modals (.wg-pr-overlay) and the
   topbar (.wg-pr-topbar): both live outside the redesign container, so
   without this every var() in them resolves to nothing (transparent). */
.wg-portal-redesign, .wg-pr-overlay, .wg-pr-topbar {
  --pr-canvas: #f4f6fb;
  --pr-surface: #ffffff;
  --pr-ink: #0f172a;
  --pr-body: #334155;
  --pr-muted: #64748b;
  --pr-faint: #94a3b8;
  --pr-line: #e2e8f0;
  --pr-primary: #4f46e5;
  --pr-primary-deep: #4338ca;
  --pr-tint: #eef2ff;
  --pr-ok: #059669;
  --pr-ok-tint: #ecfdf5;
  --pr-warn: #d97706;
  --pr-warn-tint: #fffbeb;
  --pr-bad: #e11d48;
  --pr-bad-tint: #fff1f2;
  --pr-info: #0284c7;
  --pr-info-tint: #f0f9ff;
  --pr-radius: 16px;
  --pr-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px -14px rgba(15, 23, 42, .14);
}
.wg-portal-redesign {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--pr-body);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 2px 28px;
}
.wg-portal-redesign *, .wg-portal-redesign *::before, .wg-portal-redesign *::after,
.wg-pr-overlay *, .wg-pr-overlay *::before, .wg-pr-overlay *::after { box-sizing: border-box; }
.wg-portal-redesign h1, .wg-portal-redesign h2, .wg-portal-redesign h3, .wg-portal-redesign h4,
.wg-pr-overlay h1, .wg-pr-overlay h2, .wg-pr-overlay h3, .wg-pr-overlay h4 { color: var(--pr-ink); margin: 0; }
.wg-portal-redesign p, .wg-pr-overlay p { margin: 0; }
.wg-portal-redesign button, .wg-pr-overlay button { font: inherit; cursor: pointer; }
.wg-portal-redesign .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- React-proof hiding of the bundle's old portal blocks ----------
   The override marks bundle nodes with data-wg-pr-hidden, but React resets
   their inline display on re-render. Enforce the marker via CSS so the old
   identity card / tab bar / tab content can never leak back in. */
[data-wg-pr-hidden="1"] { display: none !important; }

/* Structural guard: while the redesign portal view is active, hide every
   sibling of the redesign container (its immediate parent's other children),
   immune even to React replacing a node before the override re-marks it.
   Gated by html.wg-pr-portal-view so My Profile still shows the bundle form;
   the topbar is excluded so it stays visible. :has() degrades gracefully on
   older browsers (the attribute rule + JS still hide the blocks). */
html.wg-pr-portal-view div:has(> .wg-portal-redesign) > *:not(.wg-portal-redesign):not(.wg-pr-topbar) { display: none !important; }

/* The redesign container itself must always render in portal view, even if a
   stray hidden marker or inline display:none lands on it during a React
   transition. Inactive in My Profile (class removed) so it can hide there. */
html.wg-pr-portal-view .wg-portal-redesign { display: flex !important; }

/* ---------- Identity hero (the single source of identity) ---------- */
.wg-pr-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--pr-surface);
  border: 1px solid var(--pr-line);
  border-radius: var(--pr-radius);
  box-shadow: var(--pr-shadow);
  padding: 22px 24px;
  overflow: hidden;
}
.wg-pr-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pr-primary), #7c6cf0);
}
.wg-pr-hero-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.wg-pr-avatar {
  width: 62px; height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--pr-primary), #7c6cf0);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .5);
}
.wg-pr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wg-pr-hero-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wg-pr-hero-name h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.wg-pr-rolebadge {
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pr-primary-deep); background: var(--pr-tint);
  border: 1px solid #dcd9fb; border-radius: 999px; padding: 3px 10px;
}
.wg-pr-hero-sub { margin-top: 4px; font-size: 12.5px; color: var(--pr-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.wg-pr-hero-sub .mono { color: var(--pr-body); font-weight: 700; }
.wg-pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wg-pr-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--pr-body);
  background: var(--pr-canvas); border: 1px solid var(--pr-line);
  border-radius: 999px; padding: 4px 11px;
}
.wg-pr-chip i { color: var(--pr-primary); font-size: 10px; }
.wg-pr-hero-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

/* Attendance / progress ring — the signature element */
.wg-pr-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.wg-pr-ring svg { transform: rotate(-90deg); display: block; width: 100%; height: 100%; }
.wg-pr-ring .track { stroke: var(--pr-tint); }
.wg-pr-ring .val { stroke: var(--pr-primary); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.wg-pr-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.wg-pr-ring-center strong { font-size: 19px; font-weight: 800; color: var(--pr-ink); letter-spacing: -.02em; }
.wg-pr-ring-center span { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pr-muted); }

/* ---------- Buttons ---------- */
.wg-pr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 700; padding: 9px 16px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.wg-pr-btn:active { transform: translateY(1px); }
.wg-pr-btn-primary { background: var(--pr-primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .6); }
.wg-pr-btn-primary:hover { background: var(--pr-primary-deep); }
.wg-pr-btn-ghost { background: var(--pr-surface); color: var(--pr-body); border-color: var(--pr-line); }
.wg-pr-btn-ghost:hover { background: var(--pr-canvas); color: var(--pr-ink); }
.wg-pr-btn-soft { background: var(--pr-tint); color: var(--pr-primary-deep); }
.wg-pr-btn-soft:hover { background: #e9e7fd; }
.wg-pr-btn-block { width: 100%; }
.wg-pr-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Stat strip ---------- */
.wg-pr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wg-pr-stat {
  background: var(--pr-surface); border: 1px solid var(--pr-line);
  border-radius: var(--pr-radius); box-shadow: var(--pr-shadow);
  padding: 15px 16px; display: flex; align-items: center; gap: 13px; min-width: 0;
}
.wg-pr-stat-ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.wg-pr-stat-ico.indigo { background: var(--pr-tint); color: var(--pr-primary); }
.wg-pr-stat-ico.ok { background: var(--pr-ok-tint); color: var(--pr-ok); }
.wg-pr-stat-ico.warn { background: var(--pr-warn-tint); color: var(--pr-warn); }
.wg-pr-stat-ico.info { background: var(--pr-info-tint); color: var(--pr-info); }
.wg-pr-stat-ico.bad { background: var(--pr-bad-tint); color: var(--pr-bad); }
.wg-pr-stat-txt { min-width: 0; }
.wg-pr-stat-txt span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pr-muted); }
.wg-pr-stat-txt strong { display: block; font-size: 17px; font-weight: 800; color: var(--pr-ink); letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-pr-stat-txt em { display: block; font-style: normal; font-size: 11px; color: var(--pr-faint); margin-top: 1px; }

/* ---------- Topbar — brand + Visit Website (sticky in the scroll area) ---------- */
.wg-pr-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 20px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pr-line);
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, .25);
  color: var(--pr-body);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.wg-pr-topbar *, .wg-pr-topbar *::before, .wg-pr-topbar *::after { box-sizing: border-box; }
.wg-pr-topbar-menu {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--pr-line); border-radius: 11px;
  background: var(--pr-surface); color: var(--pr-ink);
  font-size: 14px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.wg-pr-topbar-menu:hover { background: var(--pr-tint); border-color: #c7c3f7; color: var(--pr-primary-deep); }
.wg-pr-topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wg-pr-topbar-brand img { height: 28px; width: auto; object-fit: contain; flex-shrink: 0; }
.wg-pr-topbar-name { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; color: var(--pr-ink); white-space: nowrap; }
.wg-pr-topbar-role {
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pr-primary-deep); background: var(--pr-tint);
  border: 1px solid #dcd9fb; border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.wg-pr-topbar-visit {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  color: var(--pr-primary-deep); background: var(--pr-tint);
  border: 1px solid #dcd9fb; border-radius: 11px; padding: 8px 14px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wg-pr-topbar-visit:hover {
  background: var(--pr-primary); border-color: var(--pr-primary); color: #fff;
  box-shadow: 0 8px 16px -10px rgba(79, 70, 229, .8);
}
.wg-pr-topbar-visit i { font-size: 11px; }
.wg-pr-topbar-menu:focus-visible, .wg-pr-topbar-visit:focus-visible {
  outline: 2px solid var(--pr-primary); outline-offset: 2px;
}

/* ---------- Panels / cards ---------- */
.wg-pr-panel {
  background: var(--pr-surface); border: 1px solid var(--pr-line);
  border-radius: var(--pr-radius); box-shadow: var(--pr-shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.wg-pr-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wg-pr-panel-head h3 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.wg-pr-panel-head h3 i { color: var(--pr-primary); }
.wg-pr-panel-head p { font-size: 12px; color: var(--pr-muted); margin-top: 3px; }

.wg-pr-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Enrolled class / subject cards */
.wg-pr-class {
  border: 1px solid var(--pr-line); border-radius: 14px;
  background: var(--pr-canvas); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wg-pr-class:hover { border-color: #c7c3f7; box-shadow: var(--pr-shadow); }
.wg-pr-class-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wg-pr-class-top h4 { font-size: 15px; font-weight: 800; }
.wg-pr-class-meta { font-size: 12px; color: var(--pr-muted); display: flex; flex-direction: column; gap: 3px; }
.wg-pr-class-meta strong { color: var(--pr-body); font-weight: 700; }
.wg-pr-fee { font-size: 12px; font-weight: 800; color: var(--pr-ok); }

/* Progress bar */
.wg-pr-bar { height: 7px; border-radius: 999px; background: var(--pr-line); overflow: hidden; }
.wg-pr-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--pr-primary); transition: width .5s ease; }
.wg-pr-bar.ok > i { background: var(--pr-ok); }
.wg-pr-bar.warn > i { background: var(--pr-warn); }

/* ---------- Tables ---------- */
.wg-pr-tablewrap { overflow-x: auto; border: 1px solid var(--pr-line); border-radius: 14px; }
.wg-pr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.wg-pr-table thead th {
  text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--pr-muted); background: var(--pr-canvas);
  padding: 11px 14px; border-bottom: 1px solid var(--pr-line); white-space: nowrap;
}
.wg-pr-table tbody td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; color: var(--pr-body); vertical-align: middle; }
.wg-pr-table tbody tr:last-child td { border-bottom: none; }
.wg-pr-table tbody tr:hover { background: #fafbff; }
.wg-pr-table td.strong { color: var(--pr-ink); font-weight: 700; }
.wg-pr-table .num { text-align: right; }
.wg-pr-table .center { text-align: center; }

/* ---------- Badges / chips / filters ---------- */
.wg-pr-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.wg-pr-badge.ok { background: var(--pr-ok-tint); color: var(--pr-ok); }
.wg-pr-badge.warn { background: var(--pr-warn-tint); color: var(--pr-warn); }
.wg-pr-badge.bad { background: var(--pr-bad-tint); color: var(--pr-bad); }
.wg-pr-badge.info { background: var(--pr-info-tint); color: var(--pr-info); }
.wg-pr-badge.mute { background: var(--pr-canvas); color: var(--pr-muted); }
.wg-pr-badge.indigo { background: var(--pr-tint); color: var(--pr-primary-deep); }

.wg-pr-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.wg-pr-metric { border: 1px solid var(--pr-line); border-radius: 12px; background: var(--pr-canvas); padding: 11px; text-align: center; }
.wg-pr-metric span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pr-muted); }
.wg-pr-metric strong { display: block; font-size: 18px; font-weight: 800; color: var(--pr-ink); margin-top: 2px; }
.wg-pr-metric.ok { background: var(--pr-ok-tint); border-color: #bbe7d0; }
.wg-pr-metric.ok strong { color: var(--pr-ok); }
.wg-pr-metric.warn { background: var(--pr-warn-tint); border-color: #f2dfb6; }
.wg-pr-metric.warn strong { color: var(--pr-warn); }
.wg-pr-metric.bad { background: var(--pr-bad-tint); border-color: #f6c6d2; }
.wg-pr-metric.bad strong { color: var(--pr-bad); }
.wg-pr-metric.info { background: var(--pr-info-tint); border-color: #bfe0f5; }
.wg-pr-metric.info strong { color: var(--pr-info); }

.wg-pr-filters { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.wg-pr-filters::-webkit-scrollbar { display: none; }
.wg-pr-filters > span { font-size: 11px; font-weight: 700; color: var(--pr-faint); margin-right: 2px; }
.wg-pr-filter {
  border: none; border-radius: 9px; padding: 6px 13px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; background: var(--pr-canvas); color: var(--pr-muted);
}
.wg-pr-filter:hover { background: var(--pr-line); color: var(--pr-ink); }
.wg-pr-filter.active { background: var(--pr-primary); color: #fff; }

/* Child selector (dropdown) */
.wg-pr-childbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--pr-surface); border: 1px solid var(--pr-line);
  border-radius: 14px; padding: 10px 14px; box-shadow: var(--pr-shadow);
}
.wg-pr-childbar-label {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pr-muted);
}
.wg-pr-childbar-label i { color: var(--pr-primary); font-size: 12px; }
.wg-pr-selectwrap { position: relative; flex: 1 1 220px; min-width: 0; max-width: 440px; }
.wg-pr-selectwrap select {
  width: 100%; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--pr-ink);
  background: var(--pr-canvas); border: 1px solid var(--pr-line); border-radius: 11px;
  padding: 9px 38px 9px 14px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wg-pr-selectwrap select:hover { border-color: #c7c3f7; }
.wg-pr-selectwrap select:focus-visible { outline: none; border-color: var(--pr-primary); box-shadow: 0 0 0 3px var(--pr-tint); }
.wg-pr-selectwrap > i {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--pr-primary); pointer-events: none;
}

/* ---------- Empty / loading ---------- */
.wg-pr-empty { text-align: center; padding: 34px 18px; color: var(--pr-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wg-pr-empty i { font-size: 30px; color: var(--pr-faint); }
.wg-pr-empty strong { color: var(--pr-body); font-size: 13.5px; font-weight: 800; }
.wg-pr-empty p { font-size: 12px; max-width: 420px; }
.wg-pr-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--pr-muted); font-size: 13px; font-weight: 600; }
.wg-pr-loading i { color: var(--pr-primary); }

/* ---------- Modals (class hub + curriculum) ---------- */
.wg-pr-overlay {
  position: fixed; inset: 0; z-index: 100003;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  color: var(--pr-body);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
}
.wg-pr-modal {
  background: var(--pr-surface); border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .45);
  width: 100%; max-width: 860px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--pr-line);
}
.wg-pr-modal.narrow { max-width: 640px; }
.wg-pr-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-bottom: 1px solid var(--pr-line); flex-shrink: 0;
}
.wg-pr-modal-head .eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pr-primary); }
.wg-pr-modal-head h3 { font-size: 17px; font-weight: 800; margin-top: 2px; }
.wg-pr-modal-head p { font-size: 12px; color: var(--pr-muted); margin-top: 2px; }
.wg-pr-modal-close {
  border: none; background: var(--pr-canvas); color: var(--pr-muted);
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.wg-pr-modal-close:hover { background: var(--pr-line); color: var(--pr-ink); }
.wg-pr-modal-body { flex: 1; overflow-y: auto; padding: 20px 22px; background: var(--pr-canvas); }

/* Subject cards inside hub / learning */
.wg-pr-subject {
  display: flex; gap: 13px; background: var(--pr-surface);
  border: 1px solid var(--pr-line); border-radius: 14px; padding: 14px;
}
.wg-pr-subject-cover {
  width: 46px; height: 62px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  background: var(--pr-tint); border: 1px solid #dcd9fb;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.wg-pr-subject-cover img { width: 100%; height: 100%; object-fit: cover; }
.wg-pr-subject-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.wg-pr-subject-body h4 { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-pr-subject-body .code { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pr-faint); }
.wg-pr-subject-body .meta { font-size: 11px; color: var(--pr-muted); }

/* Curriculum outline */
.wg-pr-chapter { background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: 14px; padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.wg-pr-chapter + .wg-pr-chapter { margin-top: 12px; }
.wg-pr-chapter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wg-pr-chapter-head h4 { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.wg-pr-chapter-idx { width: 24px; height: 24px; border-radius: 8px; background: var(--pr-primary); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wg-pr-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--pr-canvas); border: 1px solid var(--pr-line); border-radius: 10px; padding: 9px 12px; }
.wg-pr-item + .wg-pr-item { margin-top: 6px; }
.wg-pr-item .t { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; color: var(--pr-body); min-width: 0; }
.wg-pr-item .t i { flex-shrink: 0; }

/* ---------- Scrollbars in the palette ---------- */
.wg-portal-redesign ::-webkit-scrollbar, .wg-pr-modal-body::-webkit-scrollbar, .wg-pr-tablewrap::-webkit-scrollbar { width: 8px; height: 8px; }
.wg-portal-redesign ::-webkit-scrollbar-track, .wg-pr-modal-body::-webkit-scrollbar-track, .wg-pr-tablewrap::-webkit-scrollbar-track { background: transparent; }
.wg-portal-redesign ::-webkit-scrollbar-thumb, .wg-pr-modal-body::-webkit-scrollbar-thumb, .wg-pr-tablewrap::-webkit-scrollbar-thumb { background: #cdd3e1; border-radius: 999px; }
.wg-portal-redesign ::-webkit-scrollbar-thumb:hover, .wg-pr-modal-body::-webkit-scrollbar-thumb:hover, .wg-pr-tablewrap::-webkit-scrollbar-thumb:hover { background: var(--pr-primary); }
.wg-portal-redesign, .wg-pr-modal-body, .wg-pr-tablewrap { scrollbar-width: thin; scrollbar-color: #cdd3e1 transparent; }

/* ---------- Focus & motion ---------- */
.wg-portal-redesign button:focus-visible, .wg-pr-modal button:focus-visible {
  outline: 2px solid var(--pr-primary); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .wg-portal-redesign *, .wg-pr-modal * { transition: none !important; animation: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .wg-pr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg-pr-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wg-pr-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wg-pr-topbar { padding: 8px 12px; gap: 9px; min-height: 54px; }
  .wg-pr-topbar-name { display: none; }
  .wg-pr-topbar-visit { padding: 8px 11px; font-size: 11.5px; }
  .wg-portal-redesign { gap: 14px; font-size: 13.5px; }
  .wg-pr-hero { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px; }
  .wg-pr-hero-right { justify-content: space-between; }
  .wg-pr-ring { width: 72px; height: 72px; }
  .wg-pr-hero-name h2 { font-size: 18px; }
  .wg-pr-stats { gap: 10px; }
  .wg-pr-stat { padding: 12px; gap: 10px; }
  .wg-pr-stat-ico { width: 34px; height: 34px; font-size: 14px; }
  .wg-pr-stat-txt strong { font-size: 15px; }
  .wg-pr-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg-pr-panel { padding: 15px; }
  .wg-pr-modal { max-height: 92vh; }
  .wg-pr-modal-body { padding: 15px; }
}