/* Code Graph — control panel.
   Builds on Renso tokens (styles.css) and cg-styles.css. Light variant default.
   Composition rules:
     – No touching borders. Every border is paired with breathing room.
     – Forms use generous vertical rhythm: 12px label-to-input, 22px field-to-field.
     – Tables have only horizontal hairlines, no vertical separators.
     – Cards have inner padding ≥ 28px; their contents never sit against the edge. */

:root {
  --pn-side-w: 240px;
  --pn-top-h: 72px;
  --pn-gutter: 48px;
  --pn-radius: 14px;
  --pn-radius-lg: 20px;
}

body.pn {
  background: var(--r-bg);
  color: var(--r-ink);
  margin: 0;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
}

/* ─── TOP BAR ─────────────────────────────────────────── */
.pn-top {
  height: var(--pn-top-h);
  border-bottom: 1px solid var(--r-line);
  background: var(--r-bg);
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--pn-gutter);
  gap: 24px;
}

.pn-top__center { justify-self: center; }
.pn-top__right { justify-self: end; display: flex; align-items: center; gap: 20px; }

.pn-orgsel,
.pn-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--r-line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font: inherit;
  font-size: 13px;
  color: var(--r-ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.pn-orgsel:hover,
.pn-user:hover { border-color: var(--r-line-2); background: var(--r-chip); }

.pn-orgsel .glyph,
.pn-user .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--r-ink);
  color: var(--r-bg);
  font-family: var(--r-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pn-orgsel .name,
.pn-user .name { font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; }

.pn-orgsel .caret,
.pn-user .caret { color: var(--r-ink-3); font-family: var(--r-mono); font-size: 11px; }

.pn-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.pn-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cg-graph-active);
  box-shadow: 0 0 0 4px rgba(21,128,61,0.10);
}

/* ─── SHELL ───────────────────────────────────────────── */
.pn-shell {
  display: grid;
  grid-template-columns: var(--pn-side-w) 1fr;
  min-height: calc(100vh - var(--pn-top-h));
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.pn-side {
  border-right: 1px solid var(--r-line);
  padding: 32px 16px;
  display: grid;
  align-content: start;
  gap: 8px;
  position: sticky;
  top: var(--pn-top-h);
  height: calc(100vh - var(--pn-top-h));
  align-self: start;
}

.pn-side nav { display: grid; gap: 2px; }

.pn-side__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--r-ink-2);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
  letter-spacing: -0.005em;
  position: relative;
}

.pn-side__link:hover { background: var(--r-chip); color: var(--r-ink); }

.pn-side__link.active {
  background: var(--r-ink);
  color: var(--r-bg);
}

.pn-side__link .ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-family: var(--r-mono);
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
}

.pn-side__link.active .ico { opacity: 1; }

.pn-side__count {
  margin-left: auto;
  font-family: var(--r-mono);
  font-size: 11px;
  color: inherit;
  opacity: 0.6;
  letter-spacing: 0.04em;
}

.pn-side__sep {
  height: 1px;
  background: var(--r-line);
  margin: 16px 14px;
}

.pn-side__foot {
  margin-top: auto;
  padding: 16px 14px 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--r-mono);
  font-size: 10.5px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--r-line);
}

/* ─── MAIN ────────────────────────────────────────────── */
.pn-main {
  padding: 48px var(--pn-gutter) 64px;
  display: block;
  min-width: 0;
}

.pn-screen { max-width: 1080px; }

.pn-header {
  display: grid;
  gap: 14px;
  margin-bottom: 48px;
  align-items: start;
}

.pn-header > .r-eyebrow { padding-bottom: 4px; }

.pn-header h1 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
}

.pn-header p {
  font-size: 15px;
  color: var(--r-ink-2);
  line-height: 1.55;
  margin: 0;
  max-width: 64ch;
  text-wrap: pretty;
}

/* members header has button on the right */
.pn-screen[data-screen="members"] .pn-header {
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.pn-screen[data-screen="members"] .pn-header > div { display: grid; gap: 14px; }

/* ─── STATS GRID (overview) ──────────────────────────── */
.pn-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--r-line);
  border-bottom: 1px solid var(--r-line);
  margin-bottom: 48px;
}

.pn-stat {
  padding: 24px 28px;
  border-right: 1px solid var(--r-line);
  display: grid;
  gap: 10px;
}

.pn-stat:first-child { padding-left: 0; }
.pn-stat:last-child { border-right: none; padding-right: 0; }

.pn-stat .k {
  font-family: var(--r-mono);
  font-size: 10.5px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pn-stat .v {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pn-stat .sub {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  letter-spacing: 0.04em;
}

/* ─── CARDS / COLS ───────────────────────────────────── */
.pn-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 28px;
}

.pn-cols--wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

.pn-card {
  border: 1px solid var(--r-line);
  border-radius: var(--pn-radius-lg);
  padding: 28px;
  background: var(--r-bg);
  display: grid;
  gap: 22px;
  align-content: start;
}

.pn-card--lg { padding: 36px; gap: 28px; }

.pn-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pn-card h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}

.pn-link {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--r-ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid var(--r-line-2);
  align-self: start;
  justify-self: start;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.pn-link:hover { border-color: var(--r-ink); }
.pn-link:disabled { color: var(--r-ink-3); border-color: transparent; cursor: default; }

/* trends list (overview) */
.pn-trends { list-style: none; padding: 0; margin: 0; display: grid; }

.pn-trends li {
  display: grid;
  grid-template-columns: 1fr auto 80px 64px;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--r-line);
  font-size: 13.5px;
}

.pn-trends li:first-child { padding-top: 0; }
.pn-trends li:last-child { border-bottom: none; padding-bottom: 0; }

.pn-trends .ws { font-family: var(--r-mono); font-size: 13px; color: var(--r-ink); }
.pn-trends .pct {
  font-family: var(--r-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: right;
}
.pn-trends .pct.up { color: var(--cg-graph-active); }
.pn-trends .pct.down { color: #c25151; }
.pn-trends .spark { height: 28px; }
.pn-trends .stat {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  text-align: right;
  letter-spacing: 0.04em;
}

/* recent activity (overview) */
.pn-activity { list-style: none; padding: 0; margin: 0; counter-reset: ai; display: grid; }

.pn-activity li {
  counter-increment: ai;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--r-line);
  font-size: 13.5px;
}

.pn-activity li:first-child { padding-top: 0; }
.pn-activity li:last-child { border-bottom: none; }

.pn-activity .when {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  letter-spacing: 0.04em;
}

.pn-activity .what { color: var(--r-ink); }
.pn-activity .what b { font-weight: 600; }
.pn-activity .who { font-family: var(--r-mono); font-size: 11px; color: var(--r-ink-3); }

/* ─── TABLES ─────────────────────────────────────────── */
.pn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pn-table th,
.pn-table td { text-align: left; }

.pn-table thead th {
  padding: 14px 12px;
  font-family: var(--r-mono);
  font-size: 10.5px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  border-bottom: 1px solid var(--r-line);
}

.pn-table thead th:first-child,
.pn-table tbody td:first-child { padding-left: 18px; }

.pn-table thead th:last-child,
.pn-table tbody td:last-child  { padding-right: 18px; }

.pn-table tbody td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--r-line);
  vertical-align: middle;
  color: var(--r-ink-2);
}

.pn-table tbody td:last-child  { text-align: right; }

.pn-table tbody tr:hover td { background: var(--r-chip); }

.pn-member {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.pn-member .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--r-ink);
  color: var(--r-bg);
  display: grid; place-items: center;
  font-family: var(--r-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pn-member .you {
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--r-chip);
  border-radius: 999px;
  font-family: var(--r-mono);
  font-size: 10px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.pn-member > span:not(.avatar):not(.you) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pn-role {
  background: transparent;
  border: 1px solid var(--r-line-2);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--r-ink);
  cursor: pointer;
  transition: border-color 160ms ease;
}

.pn-role:hover { border-color: var(--r-ink); }
.pn-role:disabled { color: var(--r-ink-3); border-color: var(--r-line); cursor: not-allowed; }

.pn-rowactions {
  display: inline-flex;
  gap: 14px;
  justify-content: flex-end;
}

.pn-rowactions button {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 13px;
  color: var(--r-ink-2);
  cursor: pointer;
  transition: color 160ms ease;
}

.pn-rowactions button:hover { color: var(--r-ink); }
.pn-rowactions button.danger:hover { color: #c25151; }
.pn-rowactions button:disabled { color: var(--r-ink-4); cursor: not-allowed; }

.pn-pending-link {
  font-family: var(--r-mono);
  font-size: 12px;
  color: var(--r-ink-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--r-line-2);
  letter-spacing: 0.02em;
}

.pn-pending-link:hover { color: var(--r-ink); border-bottom-color: var(--r-ink); }

.pn-empty {
  padding: 32px 0;
  font-size: 14px;
  color: var(--r-ink-3);
  text-align: center;
  font-family: var(--r-mono);
  letter-spacing: 0.04em;
}

/* ─── SECTIONS WITH HEADER ───────────────────────────── */
.pn-section {
  margin-bottom: 48px;
}

.pn-section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  gap: 20px;
  flex-wrap: wrap;
}

.pn-section__head h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
}

.pn-section__head .pn-count {
  font-family: var(--r-mono);
  font-size: 12px;
  color: var(--r-ink-3);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.pn-section__note {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  letter-spacing: 0.04em;
}

/* ─── PILLS ──────────────────────────────────────────── */
.pn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--r-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.pn-pill--ok {
  background: var(--cg-graph-active-fill);
  color: var(--cg-graph-active);
}

.pn-pill--warn {
  background: rgba(180,83,9,0.10);
  color: #b45309;
}

.pn-pill--neutral {
  background: var(--r-chip);
  color: var(--r-ink-2);
}

/* ─── BILLING (specific) ─────────────────────────────── */
.pn-bill-price {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.pn-bill-price .amt {
  font-size: clamp(56px, 6vw, 84px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.pn-bill-price .unit {
  font-family: var(--r-mono);
  font-size: 12px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pn-bill-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--r-line);
}

.pn-bill-grid li {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--r-line);
  font-size: 14px;
}

.pn-bill-grid li:last-child { border-bottom: none; }
.pn-bill-grid .k {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pn-bill-grid .v { color: var(--r-ink); }

.pn-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pn-actions .r-btn { height: 46px; padding: 0 20px; font-size: 14px; }

.pn-payment { display: grid; gap: 16px; }

.pn-payment__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--r-line);
  border-radius: 12px;
  font-family: var(--r-mono);
  font-size: 13px;
}

.pn-payment__row .brand {
  padding: 4px 10px;
  background: var(--r-ink);
  color: var(--r-bg);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pn-payment__row .num { color: var(--r-ink); }
.pn-payment__row .exp { margin-left: auto; color: var(--r-ink-3); }

/* ─── FORMS ──────────────────────────────────────────── */
.pn-form {
  display: grid;
  gap: 22px;
  max-width: 720px;
}

.pn-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  gap: 18px;
}

.pn-form fieldset:last-of-type { margin-bottom: 0; }

.pn-form legend {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--r-line);
  width: 100%;
}

.pn-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.pn-form label {
  display: grid;
  gap: 10px;
  font-family: var(--r-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--r-ink-3);
}

.pn-form input[type="text"],
.pn-form input[type="email"],
.pn-form input[type="password"],
.pn-form select {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--r-line-2);
  background: var(--r-bg);
  padding: 0 14px;
  font: inherit;
  color: var(--r-ink);
  font-size: 14.5px;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  text-transform: none;
}

.pn-form input::placeholder { color: var(--r-ink-4); font-family: var(--r-mono); font-size: 13px; letter-spacing: 0; text-transform: none; }
.pn-form input:hover, .pn-form select:hover { border-color: var(--r-ink-3); }
.pn-form input:focus, .pn-form select:focus { border-color: var(--r-ink); box-shadow: 0 0 0 3px var(--r-chip); }
.pn-form input[readonly] { background: var(--r-chip); color: var(--r-ink-2); }

.pn-hint {
  font-family: var(--r-sans);
  font-size: 12.5px;
  color: var(--r-ink-3);
  text-transform: none;
  letter-spacing: -0.005em;
  margin-top: 4px;
  line-height: 1.5;
}

.pn-hint a, .pn-hint b { color: var(--r-ink-2); }

.pn-form__cta {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pn-form__cta .r-btn { height: 46px; padding: 0 22px; font-size: 14px; }

/* uploader stub */
.pn-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--r-line-2);
  border-radius: 10px;
}

.pn-uploader .thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--r-ink);
  color: var(--r-bg);
  display: grid; place-items: center;
  font-family: var(--r-mono);
  font-size: 18px;
  font-weight: 600;
}

/* toggle */
.pn-toggle {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
}

.pn-toggle input[type="checkbox"] { display: none; }

.pn-toggle > label {
  width: 44px; height: 24px;
  background: var(--r-line);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 200ms ease;
  margin: 0;
  padding: 0;
}

.pn-toggle > label::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--r-bg);
  border-radius: 50%;
  transition: left 200ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.pn-toggle input:checked + label { background: var(--cg-graph-active); }
.pn-toggle input:checked + label::after { left: 22px; }

.pn-toggle .pn-hint { grid-column: 2; margin: 0; }

/* sessions (profile) */
.pn-sessions { list-style: none; padding: 0; margin: 0; }

.pn-sessions li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--r-line);
  font-size: 14px;
}

.pn-sessions li:last-child { border-bottom: none; }
.pn-sessions li > div { color: var(--r-ink); }
.pn-sessions li > div b { font-weight: 600; }
.pn-sessions li > span {
  font-family: var(--r-mono);
  font-size: 11px;
  color: var(--r-ink-3);
  letter-spacing: 0.04em;
}

/* filters (audit) */
.pn-filters {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.pn-filters label {
  display: grid;
  gap: 10px;
  font-family: var(--r-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--r-ink-3);
}

.pn-filters select {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--r-line-2);
  background: var(--r-bg);
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--r-ink);
}

.pn-filters .r-btn { height: 40px; padding: 0 18px; font-size: 13px; }

.pn-table--audit td:first-child { font-family: var(--r-mono); font-size: 12px; color: var(--r-ink-3); width: 160px; letter-spacing: 0.04em; white-space: nowrap; }
.pn-table--audit td:nth-child(2) { font-family: var(--r-mono); font-size: 12.5px; color: var(--r-ink); width: 160px; }
.pn-table--audit td:nth-child(3) { color: var(--r-ink); }
.pn-table--audit td:nth-child(4) { font-family: var(--r-mono); font-size: 12.5px; color: var(--r-ink-2); }
.pn-table--audit td:last-child { width: 110px; }

/* ─── MODALS ─────────────────────────────────────────── */
.pn-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  place-items: start center;
  padding: 64px 24px;
  overflow-y: auto;
}

.pn-modal[data-open="true"] { display: grid; }

.pn-modal__sheet {
  width: min(440px, 100%);
  background: var(--r-bg);
  border: 1px solid var(--r-line-2);
  border-radius: var(--pn-radius-lg);
  padding: 32px;
  display: grid;
  gap: 24px;
  margin: auto;
  box-shadow: 0 30px 80px -20px rgba(10,10,10,0.45);
}

.pn-modal__sheet--sm { width: min(380px, 100%); }

.pn-modal__sheet header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.pn-modal__sheet header h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

.pn-modal__sheet .close {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--r-ink-3);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 160ms ease, color 160ms ease;
}

.pn-modal__sheet .close:hover { background: var(--r-chip); color: var(--r-ink); }

.pn-modal__lead {
  font-size: 13.5px;
  color: var(--r-ink-3);
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}

.pn-modal__summary {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  background: var(--r-chip);
  border-radius: 12px;
  font-size: 13px;
  color: var(--r-ink-2);
}

.pn-modal__summary .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  white-space: nowrap;
}

.pn-modal__summary .row:last-child {
  font-weight: 600;
  color: var(--r-ink);
  padding-top: 10px;
  border-top: 1px solid var(--r-line);
}

.pn-modal__success {
  text-align: center;
  display: grid;
  gap: 16px;
  padding: 8px 0;
}

.pn-modal__success .check {
  margin: 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cg-graph-active-fill);
  color: var(--cg-graph-active);
  font-size: 24px;
}

.pn-modal__success h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
  font-weight: 500;
  margin: 0;
}

.pn-modal__success p {
  font-size: 13.5px;
  color: var(--r-ink-2);
  margin: 0;
  line-height: 1.55;
}

.pn-invitelink {
  font-family: var(--r-mono);
  font-size: 12px;
  padding: 12px 14px;
  background: var(--r-chip);
  border-radius: 10px;
  word-break: break-all;
  text-align: left;
  color: var(--r-ink);
}

/* ─── responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .pn-stats { grid-template-columns: repeat(2, 1fr); }
  .pn-stat { border-right: none; padding: 24px 28px; border-bottom: 1px solid var(--r-line); }
  .pn-stat:nth-last-child(-n+2) { border-bottom: none; }
  .pn-stat:nth-child(odd) { border-right: 1px solid var(--r-line); padding-left: 0; }
  .pn-stat:nth-child(even) { padding-right: 0; }
  .pn-cols, .pn-cols--wide { grid-template-columns: 1fr; }
  .pn-bill-grid li { grid-template-columns: 160px 1fr; }
  .pn-form__row { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  :root { --pn-side-w: 0px; --pn-gutter: 28px; }
  .pn-side {
    position: sticky;
    top: var(--pn-top-h);
    z-index: 35;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--r-line);
    padding: 10px var(--pn-gutter);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    background: var(--r-bg);
    scrollbar-width: none;
  }
  .pn-side::-webkit-scrollbar { display: none; }
  .pn-side nav {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
  }
  .pn-side__link {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 13.5px;
    white-space: nowrap;
  }
  .pn-side__count { margin-left: 4px; }
  .pn-side__sep,
  .pn-side__foot { display: none; }
  .pn-shell { grid-template-columns: 1fr; }
  .pn-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .pn-top__center { display: none; }
  .pn-top__right { grid-column: 2; }
  .pn-user .name { display: none; }
  .pn-user { padding: 6px 10px 6px 6px; }
  .pn-status { display: none; }
  .pn-main { padding-top: 32px; }
  .pn-screen { max-width: 100%; min-width: 0; }
  .pn-screen[data-screen="members"] .pn-header { grid-template-columns: 1fr; }
}

.pn-promo {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--r-line);
  display: grid;
  gap: 10px;
}

.pn-promo > label {
  font-family: var(--r-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--r-ink-3);
}

.pn-promo__row { display: flex; gap: 10px; align-items: stretch; }

.pn-promo__row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--r-line-2);
  background: var(--r-bg);
  padding: 0 14px;
  font: inherit;
  color: var(--r-ink);
  font-size: 14.5px;
  letter-spacing: -0.005em;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pn-promo__row input::placeholder { color: var(--r-ink-4); font-family: var(--r-mono); font-size: 13px; letter-spacing: 0; }
.pn-promo__row input:hover { border-color: var(--r-ink-3); }
.pn-promo__row input:focus { border-color: var(--r-ink); box-shadow: 0 0 0 3px var(--r-chip); }
.pn-promo__row .r-btn { height: 46px; padding: 0 20px; font-size: 14px; white-space: nowrap; }

.pn-promo__hint {
  font-family: var(--r-sans);
  font-size: 12.5px;
  color: var(--r-ink-3);
  letter-spacing: -0.005em;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .pn-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    white-space: nowrap;
  }

  .pn-table th,
  .pn-table td {
    white-space: nowrap;
  }

  .pn-member > span:not(.avatar):not(.you) {
    max-width: 180px;
  }

  .pn-trends li,
  .pn-activity li,
  .pn-sessions li {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .pn-trends .pct,
  .pn-trends .stat,
  .pn-activity .who {
    text-align: left;
  }

  .pn-sessions li > span {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  :root {
    --pn-top-h: 64px;
    --pn-gutter: 20px;
  }

  .pn-top {
    height: var(--pn-top-h);
    padding-inline: var(--pn-gutter);
  }

  .pn-main {
    padding: 28px var(--pn-gutter) 48px;
  }

  .pn-side {
    padding: 9px var(--pn-gutter);
  }

  .pn-header {
    margin-bottom: 32px;
  }

  .pn-header h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .pn-stats {
    grid-template-columns: 1fr;
  }

  .pn-stat,
  .pn-stat:nth-child(odd),
  .pn-stat:nth-child(even) {
    border-right: 0;
    border-bottom: 1px solid var(--r-line);
    padding: 20px 0;
  }

  .pn-stat:last-child {
    border-bottom: 0;
  }

  .pn-card {
    padding: 20px;
    border-radius: 16px;
  }

  .pn-card--lg {
    padding: 22px;
  }

  .pn-bill-price {
    flex-wrap: wrap;
  }

  .pn-bill-grid li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pn-payment__row {
    flex-wrap: wrap;
  }

  .pn-payment__row .exp {
    margin-left: 0;
  }

  .pn-actions .r-btn,
  .pn-form__cta .r-btn,
  .pn-promo__row .r-btn {
    width: 100%;
    justify-content: center;
  }

  .pn-promo__row {
    flex-direction: column;
  }

  .pn-section__head {
    align-items: start;
  }

  .pn-section__head h2 {
    white-space: normal;
  }

  .pn-filters {
    align-items: stretch;
  }

  .pn-filters label,
  .pn-filters select,
  .pn-filters .r-btn {
    width: 100%;
  }

  .pn-modal {
    padding: 20px 16px;
  }

  .pn-modal__sheet {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .pn-modal__sheet header h3 {
    white-space: normal;
  }

  .pn-modal__summary .row {
    grid-template-columns: 1fr;
    gap: 4px;
    white-space: normal;
  }
}
