:root {
  --paper: #f3f7fc;
  --paper-deep: #e7eef8;
  --surface: #fbfdff;
  --surface-strong: #ffffff;
  --ink: #102844;
  --ink-muted: #586c84;
  --forest: #0b2f63;
  --forest-bright: #155eae;
  --mint: #c6ddff;
  --blue: #176bc2;
  --blue-bright: #35a5ed;
  --orange: #d97935;
  --danger: #bd3f4a;
  --line: rgba(20, 62, 108, 0.12);
  --line-strong: rgba(20, 62, 108, 0.22);
  --shadow: 0 18px 55px rgba(14, 54, 104, 0.1);
  --radius: 20px;
  --font-ui: "Avenir Next", Avenir, "Hiragino Sans GB", "PingFang SC", sans-serif;
  --font-display: "Iowan Old Style", "Songti SC", serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(53, 165, 237, 0.1), transparent 26rem),
    radial-gradient(circle at 16% 92%, rgba(23, 107, 194, 0.07), transparent 30rem),
    var(--paper);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(22, 105, 193, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 105, 193, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 1000;
}

button,
input,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(23, 107, 194, 0.38);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--forest);
}

.skip-link:focus { transform: none; outline: 3px solid rgba(198, 221, 255, .95); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon { display: block; flex: none; }

.eyebrow,
.panel-kicker {
  color: var(--forest-bright);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  width: 246px;
  padding: 26px 18px 20px;
  color: rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(circle at 18% 0%, rgba(69, 164, 255, 0.22), transparent 19rem),
    linear-gradient(165deg, #103f7b 0%, #0a2c5b 64%, #061b3b 100%);
  background-color: #0a2c5b;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 26px;
  color: white;
  text-decoration: none;
}

.brand-mark,
.login-mark,
.boot-mark {
  display: grid;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 14px 7px 14px 7px;
  color: var(--forest);
  background: #e4f1ff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  place-items: center;
  box-shadow: inset 0 0 0 4px rgba(12, 58, 116, 0.08);
}

.brand strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: -2px; color: rgba(255,255,255,.42); font-size: 8px; font-weight: 800; letter-spacing: .2em; }

.org-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 15px;
  background: rgba(255,255,255,.055);
}

.org-avatar,
.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  color: var(--forest);
  background: var(--mint);
  font-weight: 800;
  place-items: center;
}

.org-chip strong,
.org-chip small { display: block; overflow: hidden; max-width: 145px; text-overflow: ellipsis; white-space: nowrap; }
.org-chip strong { color: white; font-size: 12px; }
.org-chip small { color: rgba(255,255,255,.42); font-size: 10px; }

.sidebar nav { display: grid; gap: 5px; }

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover { color: white; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { color: white; background: rgba(151, 205, 255, .17); box-shadow: inset 2px 0 #8ec9ff; }

.sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 26px; }

.privacy-promise {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 11px 8px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.privacy-promise strong,
.privacy-promise small { display: block; }
.privacy-promise strong { color: rgba(255,255,255,.82); font-size: 11px; }
.privacy-promise small { color: rgba(255,255,255,.38); font-size: 9px; }
.status-light { width: 8px; height: 8px; border-radius: 50%; background: #53d4ee; box-shadow: 0 0 0 5px rgba(83,212,238,.1), 0 0 14px rgba(83,212,238,.5); }
.logout-button { font-size: 12px; }

.main-content { min-height: 100vh; margin-left: 246px; padding: 0 42px 56px; }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -42px 30px;
  padding: 9px 42px;
  color: #4b2f0e;
  background: #f2c980;
  font-size: 12px;
}

.demo-banner strong { letter-spacing: .04em; }
.demo-banner a { margin-left: auto; font-weight: 750; }

.page-header {
  display: flex;
  max-width: 1500px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto;
  padding: 46px 0 28px;
}

.demo-banner + .page-header { padding-top: 0; }
.page-header h1 { margin: 4px 0 4px; font-family: var(--font-display); font-size: clamp(31px, 4vw, 44px); font-weight: 650; letter-spacing: -.04em; line-height: 1.05; }
.page-header p { max-width: 660px; margin: 0; color: var(--ink-muted); font-size: 13px; }

.range-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.52);
}

.range-controls label span { display: block; margin-left: 5px; color: var(--ink-muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.range-controls input { width: 126px; padding: 5px 6px; border: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 650; }
.range-separator { padding-bottom: 7px; color: var(--line-strong); }

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  place-items: center;
}

.icon-button:hover { border-color: var(--forest-bright); color: var(--forest-bright); }

.page-body { max-width: 1500px; margin: 0 auto; }
.page-body,
.overview-grid,
.overview-grid > *,
.two-column > *,
.settings-layout > * { min-width: 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.timezone-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(214, 107, 53, .2);
  border-radius: 13px;
  color: #72401f;
  background: rgba(239, 208, 183, .48);
  font-size: 10px;
}

.timezone-warning strong { flex: none; font-size: 9px; letter-spacing: .06em; }

.metric-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.metric-card {
  position: relative;
  min-height: 154px;
  padding: 21px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251,253,255,.9);
  box-shadow: 0 8px 32px rgba(19, 58, 104, .045);
  overflow: hidden;
}

.metric-card::after { position: absolute; top: -27px; right: -27px; width: 82px; height: 82px; border: 18px solid currentColor; border-radius: 50%; content: ""; opacity: .08; }
.metric-card.accent-ink { color: var(--forest); }
.metric-card.accent-blue { color: var(--blue); }
.metric-card.accent-green { color: var(--forest-bright); }
.metric-card.accent-orange { color: var(--orange); }
.metric-label { color: var(--ink-muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.metric-card > strong { display: block; margin: 11px 0 5px; color: currentColor; font-family: var(--font-display); font-size: clamp(28px, 3vw, 39px); font-weight: 650; letter-spacing: -.04em; line-height: 1; }
.metric-card p { margin: 0; color: var(--ink-muted); font-size: 10px; line-height: 1.4; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
  gap: 16px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251,253,255,.92);
  box-shadow: 0 9px 34px rgba(19, 58, 104, .045);
}

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -.025em; }
.panel-head > a { display: flex; align-items: center; gap: 3px; color: var(--forest-bright); font-size: 11px; font-weight: 750; text-decoration: none; }
.trend-panel { min-height: 340px; }

.soft-badge,
.status-badge,
.device-health {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--forest-bright);
  background: rgba(21,94,174,.09);
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.chart-wrap { margin-top: 4px; }
.series-chart { display: block; width: 100%; max-height: 220px; overflow: visible; }
.chart-grid { stroke: rgba(20,62,108,.09); stroke-dasharray: 4 6; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--surface); stroke: var(--blue); stroke-width: 1.5; opacity: .12; transition: opacity .15s ease, r .15s ease; }
.series-chart:hover .chart-point { opacity: 1; }
.chart-point:hover { r: 5; fill: var(--blue-bright); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink-muted); font-size: 9px; font-weight: 650; }

.distribution { display: grid; gap: 14px; }
.distribution-row { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(70px, 1fr) 70px; align-items: center; gap: 11px; }
.distribution-row > div:first-child { display: flex; min-width: 0; align-items: center; gap: 7px; }
.distribution-row strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.distribution-row small { min-width: 0; overflow: hidden; color: var(--ink-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.distribution-row > b { color: var(--ink); font-family: var(--font-display); font-size: 12px; font-weight: 650; text-align: right; }
.rank-number { color: var(--ink-muted); font-family: var(--font-display); font-size: 10px; }
.bar-track { height: 5px; border-radius: 99px; background: rgba(20,62,108,.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; }
.bar-blue { background: linear-gradient(90deg, var(--blue), var(--blue-bright)); }
.bar-green { background: linear-gradient(90deg, #155eae, #45b8ed); }

.people-panel,
.device-panel { min-height: 292px; }
.people-panel { grid-column: 1; overflow: hidden; }
.device-panel { grid-column: 2; grid-row: 2; }

.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; contain: inline-size paint; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid rgba(20,62,108,.08); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.56); }
td > small { display: block; color: var(--ink-muted); font-size: 9px; }
.person-cell { display: flex; min-width: 0; align-items: center; gap: 9px; text-decoration: none; }
.person-cell > span:last-child { min-width: 0; }
.person-cell strong,.person-cell small { display: block; }
.person-cell strong,.person-cell small { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell strong { font-size: 11px; }
.person-cell small { color: var(--ink-muted); font-size: 8px; }
.member-state { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 99px; color: var(--danger); background: rgba(181,63,54,.08); font-size: 7px; font-style: normal; font-weight: 800; vertical-align: 1px; }
.usage-ranking { min-width: 940px; }
.usage-ranking-compact { min-width: 590px; }
.usage-signature { display: block; min-width: 0; }
.usage-signature strong,.usage-signature small,.usage-amount strong,.usage-amount small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-signature strong,.usage-amount strong { color: var(--ink); font-size: 10px; }
.usage-signature small,.usage-amount small { margin-top: 2px; color: var(--ink-muted); font-size: 8px; }
.usage-ranking td:first-child { width: 34px; }
.usage-ranking td:first-child .rank-number { font-size: 12px; }
.ranking-note { margin: 9px 10px 2px; color: var(--ink-muted); font-size: 8px; line-height: 1.5; }
.avatar { width: 30px; height: 30px; font-size: 11px; }
.avatar.large { width: 58px; height: 58px; font-family: var(--font-display); font-size: 24px; }
.row-link { display: grid; width: 28px; height: 28px; border-radius: 8px; color: var(--forest-bright); text-decoration: none; place-items: center; }
.row-link:hover { background: rgba(21,94,174,.09); }

.device-list { display: grid; gap: 8px; }
.device-row { display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 5px; border-bottom: 1px solid rgba(20,62,108,.075); }
.device-row:last-child { border-bottom: 0; }
.device-icon { display: grid; width: 34px; height: 34px; border-radius: 11px; color: var(--blue); background: rgba(23,107,194,.09); place-items: center; }
.device-icon.large { width: 44px; height: 44px; border-radius: 14px; }
.device-row strong,.device-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-row strong { font-size: 11px; }
.device-row small { color: var(--ink-muted); font-size: 9px; }
.device-health { color: var(--forest-bright); background: rgba(21,94,174,.09); }
.device-health::before { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #2b9fdb; content: ""; vertical-align: 1px; }
.device-health.disabled { color: var(--danger); background: rgba(181,63,54,.08); }
.device-health.disabled::before { background: var(--danger); }

.section-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-action-buttons { display: flex; align-items: center; gap: 8px; }
.section-count { display: flex; align-items: baseline; gap: 8px; }
.section-count strong { font-family: var(--font-display); font-size: 30px; }
.section-count span { color: var(--ink-muted); font-size: 11px; }
.full-panel { width: 100%; overflow: hidden; }

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.primary-button { color: white; background: var(--forest); box-shadow: 0 8px 18px rgba(11,47,99,.18); }
.primary-button:hover { background: var(--forest-bright); transform: translateY(-1px); }
.primary-button.small,.secondary-button.small,.danger-button.small { min-height: 35px; padding: 0 13px; font-size: 11px; }
.secondary-button { border-color: var(--line-strong); color: var(--forest); background: var(--surface); }
.danger-button { border-color: rgba(181,63,54,.2); color: var(--danger); background: rgba(181,63,54,.06); }
.text-button { color: var(--ink-muted); background: transparent; }
.full { width: 100%; }
button:disabled { opacity: .5; cursor: progress; }

.person-hero { display: flex; align-items: center; gap: 15px; margin-bottom: 17px; padding: 4px 3px 14px; }
.person-hero h2 { margin: 0; font-family: var(--font-display); font-size: 28px; }
.person-hero p { margin: 0; color: var(--ink-muted); }
.person-status-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.person-hero .status-badge { margin-left: 0; }
.status-disabled { color: var(--danger); background: rgba(181,63,54,.08); }
.back-link { display: inline-block; margin-bottom: 15px; color: var(--forest-bright); font-size: 11px; font-weight: 750; text-decoration: none; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.device-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 14px; }
.device-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(251,253,255,.93); }
.device-card.is-disabled { opacity: .66; }
.device-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.device-card h2 { margin: 18px 0 2px; overflow: hidden; font-family: var(--font-display); font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.device-card > p { margin: 0; color: var(--ink-muted); font-size: 10px; }
.device-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 20px 0; }
.device-card dl div { padding: 9px 10px; border-radius: 10px; background: rgba(20,62,108,.045); }
.device-card dt { color: var(--ink-muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.device-card dd { margin: 3px 0 0; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.device-card code { color: var(--blue); font-size: 10px; }

.history-list { display: grid; gap: 10px; }
.history-day { border: 1px solid var(--line); border-radius: 17px; background: rgba(251,253,255,.91); overflow: hidden; }
.history-day summary { display: grid; grid-template-columns: 190px minmax(160px, 1fr) 100px 20px; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.history-day summary::-webkit-details-marker { display: none; }
.history-day[open] summary { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.36); }
.day-date strong,.day-date small { display: block; }
.day-date strong { font-family: var(--font-display); font-size: 17px; }
.day-date small { color: var(--ink-muted); font-size: 8px; }
.tool-pills { display: flex; gap: 5px; overflow: hidden; }
.tool-pills i { padding: 4px 7px; border-radius: 999px; color: var(--forest-bright); background: rgba(21,94,174,.08); font-size: 8px; font-style: normal; font-weight: 700; white-space: nowrap; }
.day-total { font-family: var(--font-display); font-size: 17px; font-weight: 650; text-align: right; }
.disclosure { color: var(--ink-muted); font-size: 20px; text-align: center; transition: transform .2s ease; }
.history-day[open] .disclosure { transform: rotate(180deg); }
.history-table { padding: 5px 11px 10px; }

.breakdown-columns { align-items: start; }
.explain-card { display: grid; grid-template-columns: 45px minmax(0,1fr) 45px minmax(0,1fr); gap: 17px; margin-top: 16px; padding: 24px; border-radius: var(--radius); color: rgba(255,255,255,.72); background: var(--forest); }
.explain-card h2 { margin: 0 0 5px; color: white; font-family: var(--font-display); font-size: 18px; }
.explain-card p { margin: 0; font-size: 10px; line-height: 1.65; }
.explain-number { color: rgba(198,221,255,.58); font-family: var(--font-display); font-size: 28px; }

.cost-ledger { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.cost-card { position: relative; min-height: 225px; padding: 24px; border-radius: var(--radius); overflow: hidden; }
.cost-card::after { position: absolute; right: -35px; bottom: -50px; width: 150px; height: 150px; border: 24px solid currentColor; border-radius: 50%; content: ""; opacity: .08; }
.cost-card > span { font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.cost-card h2 { margin: 30px 0 4px; font-family: var(--font-display); font-size: 42px; font-weight: 600; letter-spacing: -.045em; }
.cost-card strong { display: block; }
.cost-card p { max-width: 250px; margin: 12px 0 0; font-size: 10px; line-height: 1.55; opacity: .7; }
.cost-card.estimate { color: white; background: var(--forest); }
.cost-card.actual { color: #0b4477; background: #c9eaff; }
.cost-card.fixed { color: #294768; background: #e2eaf5; }
.pricing-editor { margin-bottom: 16px; }
.pricing-editor form { display: grid; gap: 14px; }
.pricing-identity-grid { display: grid; grid-template-columns: 1fr 1.4fr .55fr .8fr; gap: 12px; }
.pricing-rate-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.pricing-editor .primary-button { justify-self: start; }

.settings-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(290px,.75fr); gap: 16px; align-items: start; }
.settings-layout > div,.settings-layout > aside { display: grid; gap: 16px; }
.settings-card form { display: grid; gap: 14px; }
label { color: var(--ink-muted); font-size: 10px; font-weight: 700; }
input,select { width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: rgba(255,255,255,.6); }
input:disabled,select:disabled { opacity: .65; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { color: var(--ink-muted); font-size: 10px; }
.boundary-card { display: flex; gap: 14px; padding: 16px; border: 1px dashed rgba(23,107,194,.3); border-radius: 15px; background: rgba(23,107,194,.05); }
.boundary-icon { display: grid; width: 36px; height: 36px; flex: none; border-radius: 50%; color: white; background: var(--blue); font-size: 18px; place-items: center; }
.boundary-card strong { display: block; margin-bottom: 5px; }
.boundary-card p { margin: 0; color: var(--ink-muted); font-size: 10px; line-height: 1.6; }
.privacy-manifesto { padding: 26px; border-radius: var(--radius); color: rgba(255,255,255,.74); background: linear-gradient(155deg,#10427e,#071d42); box-shadow: var(--shadow); }
.privacy-manifesto .panel-kicker { color: var(--mint); }
.privacy-manifesto h2 { margin: 10px 0 22px; color: white; font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.2; }
.privacy-manifesto em { color: var(--mint); font-weight: 500; }
.privacy-manifesto ul { display: grid; gap: 15px; padding: 0; margin: 0; list-style: none; }
.privacy-manifesto li { font-size: 10px; line-height: 1.6; }
.privacy-manifesto li span { display: block; color: var(--mint); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.key-card p { color: var(--ink-muted); font-size: 10px; }

.empty-inline { display: grid; min-height: 150px; color: var(--ink-muted); place-items: center; align-content: center; }
.empty-inline span { font-family: var(--font-display); font-size: 28px; opacity: .45; }
.empty-inline p { margin: 5px 0 0; font-size: 10px; }

.state-card { display: grid; min-height: 360px; padding: 50px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); place-items: center; align-content: center; text-align: center; }
.state-card h2 { margin: 10px 0 4px; font-family: var(--font-display); font-size: 28px; }
.state-card p { max-width: 500px; margin: 0; color: var(--ink-muted); }
.state-code { color: var(--danger); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.state-actions { display: flex; gap: 8px; margin-top: 20px; }

.skeleton-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.skeleton { min-height: 180px; border-radius: var(--radius); background: linear-gradient(105deg,rgba(255,255,255,.3) 20%,rgba(255,255,255,.75) 40%,rgba(255,255,255,.3) 60%); background-size: 220% 100%; animation: shimmer 1.25s infinite; }
.skeleton.tall { min-height: 330px; }
.skeleton.wide { grid-column: 1/-1; }
@keyframes shimmer { to { background-position-x: -220%; } }

.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(320px, 1fr) minmax(420px, .88fr); }
.login-art { position: relative; display: flex; min-height: 100vh; padding: 56px; color: white; background: radial-gradient(circle at 65% 35%,rgba(64,165,244,.3),transparent 20rem),linear-gradient(145deg,#104987,#061b3a 72%); flex-direction: column; justify-content: flex-end; overflow: hidden; }
.login-mark { position: absolute; top: 45px; left: 52px; width: 52px; height: 52px; }
.login-art p { position: relative; z-index: 2; margin: 0 0 12px; font-family: var(--font-display); font-size: clamp(43px,6vw,82px); font-weight: 500; letter-spacing: -.045em; line-height: .95; }
.login-art p em { color: var(--mint); font-weight: 400; }
.login-art small { color: rgba(255,255,255,.48); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.orbit { position: absolute; border: 1px solid rgba(198,221,255,.24); border-radius: 50%; }
.orbit::before { position: absolute; top: 50%; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); content: ""; box-shadow: 0 0 24px var(--mint); }
.orbit-one { top: -18vw; right: -12vw; width: 54vw; height: 54vw; animation: rotate 30s linear infinite; }
.orbit-two { top: 8vw; right: 5vw; width: 29vw; height: 29vw; opacity: .7; animation: rotate 23s linear reverse infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.login-panel { display: flex; max-width: 580px; padding: 60px clamp(35px,7vw,100px); justify-content: center; flex-direction: column; }
.login-panel h1 { margin: 9px 0 12px; font-family: var(--font-display); font-size: clamp(35px,4vw,52px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.login-copy { max-width: 480px; margin: 0 0 28px; color: var(--ink-muted); font-size: 12px; }
.login-form { display: grid; gap: 15px; }
.secret-input { display: flex; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(255,255,255,.62); overflow: hidden; }
.secret-input input { margin: 0; border: 0; border-radius: 0; background: transparent; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
.secret-input button { padding: 0 13px; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.login-form .primary-button { width: 100%; margin-top: 2px; }
.demo-link { margin-top: 18px; color: var(--blue); font-size: 10px; font-weight: 700; text-align: center; }
.privacy-strip { display: flex; gap: 9px; margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 9px; }
.inline-alert { margin-bottom: 17px; padding: 11px 13px; border: 1px solid rgba(181,63,54,.18); border-radius: 11px; color: var(--danger); background: rgba(181,63,54,.05); font-size: 10px; }
.boot-screen { display: grid; min-height: 100vh; color: var(--ink-muted); place-items: center; align-content: center; }
.boot-screen .boot-mark { color: var(--forest); border-color: rgba(11,47,99,.22); animation: breathe 1.4s ease-in-out infinite; }
.boot-screen p { font-size: 10px; font-weight: 700; letter-spacing: .08em; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .68; } }

dialog { width: min(520px,calc(100vw - 28px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 35px 100px rgba(7,31,68,.3); }
dialog::backdrop { background: rgba(5,23,51,.6); backdrop-filter: blur(5px); }
.dialog-card { display: grid; gap: 16px; padding: 25px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-size: 25px; }
.dialog-card > p { margin: 0; color: var(--ink-muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.token-copy { display: flex; gap: 8px; padding: 11px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--paper); }
.token-copy code { min-width: 0; align-self: center; flex: 1; overflow: hidden; color: var(--forest); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.toast-region { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 200; }
.toast { min-width: 230px; max-width: 390px; padding: 12px 15px; border-radius: 12px; color: white; background: var(--forest); box-shadow: var(--shadow); font-size: 11px; font-weight: 700; animation: toast-in .2s ease-out; }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .device-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cost-ledger { grid-template-columns: 1fr; }
  .cost-card { min-height: 180px; }
  .overview-grid { grid-template-columns: 1fr; }
  .people-panel,.device-panel { grid-column: auto; grid-row: auto; }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: 10px 14px; overflow-x: auto; flex-direction: row; align-items: center; }
  .brand { margin: 0 10px 0 0; }
  .brand-mark { width: 35px; height: 35px; }
  .brand > span:last-child,.org-chip,.sidebar-foot { display: none; }
  .sidebar nav { display: flex; gap: 3px; }
  .nav-item { width: auto; padding: 9px 10px; }
  .nav-item span { display: none; }
  .main-content { margin-left: 0; padding: 0 20px 40px; }
  .demo-banner { margin: 0 -20px 23px; padding: 9px 20px; }
  .page-header { align-items: flex-start; padding-top: 28px; flex-direction: column; }
  .range-controls { width: 100%; }
  .range-controls label { flex: 1; }
  .range-controls input { width: 100%; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; margin: auto; }
  .history-day summary { grid-template-columns: 1fr auto 20px; }
  .tool-pills { display: none; }
  .pricing-identity-grid,.pricing-rate-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .page-header h1 { font-size: 34px; }
  .metric-grid,.metric-grid.three,.two-column,.device-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; }
  .section-actions { align-items: flex-start; gap: 12px; flex-direction: column; }
  .section-action-buttons { width: 100%; align-items: stretch; flex-direction: column; }
  .section-actions .primary-button,.section-actions .secondary-button { width: 100%; }
  .person-hero { align-items: flex-start; flex-wrap: wrap; }
  .person-status-actions { width: 100%; margin-left: 73px; }
  .explain-card { grid-template-columns: 35px 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .pricing-identity-grid,.pricing-rate-grid { grid-template-columns: 1fr; }
  .history-day summary { grid-template-columns: 1fr 85px 18px; padding: 13px; }
  .distribution-row { grid-template-columns: minmax(100px,1fr) 55px; }
  .distribution-row .bar-track { display: none; }
  .usage-ranking-compact { min-width: 0; }
  .usage-ranking-compact thead { display: none; }
  .usage-ranking-compact tbody { display: grid; }
  .usage-ranking-compact tr {
    display: grid;
    grid-template-columns: 26px minmax(0,1fr) minmax(72px,auto) 28px;
    grid-template-areas: "rank person usage action" "rank signature cost action";
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(20,62,108,.08);
    column-gap: 6px;
  }
  .usage-ranking-compact tr:last-child { border-bottom: 0; }
  .usage-ranking-compact td { padding: 3px 2px; border: 0; }
  .usage-ranking-compact td:nth-child(1) { grid-area: rank; align-self: start; width: auto; padding-top: 9px; }
  .usage-ranking-compact td:nth-child(2) { grid-area: person; }
  .usage-ranking-compact td:nth-child(3) { grid-area: signature; padding-left: 39px; }
  .usage-ranking-compact td:nth-child(4) { grid-area: usage; text-align: right; }
  .usage-ranking-compact td:nth-child(5) { grid-area: cost; color: var(--ink-muted); font-size: 10px; text-align: right; }
  .usage-ranking-compact td:nth-child(6) { grid-area: action; }
  .usage-ranking-compact .person-cell { gap: 7px; }
  .usage-ranking-compact .avatar { width: 32px; height: 32px; }
  .usage-ranking-compact .usage-signature strong,.usage-ranking-compact .usage-signature small { max-width: 105px; }
  .usage-ranking-compact .usage-signature small,.usage-ranking-compact .usage-amount small { font-size: 10px; }
  .usage-ranking-compact .ranking-note { white-space: normal; }
  .demo-banner span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  body::before,.sidebar,.demo-banner,.range-controls,.section-actions button { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .panel,.metric-card,.history-day { break-inside: avoid; box-shadow: none; }
}

/* Anonymous community leaderboard and secure join landing. */
.switch-control {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
}
.switch-control > span { position: relative; width: 34px; height: 19px; flex: none; border-radius: 999px; background: #c9d4e1; transition: background .18s ease; }
.switch-control > span::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(7,31,68,.28); content: ""; transition: transform .18s ease; }
.switch-control[aria-checked="true"] > span { background: var(--blue); }
.switch-control[aria-checked="true"] > span::after { transform: translateX(15px); }
.switch-control b { font-size: 9px; white-space: nowrap; }
.consent-check { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(23,107,194,.035); cursor: pointer; }
.consent-check > input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.consent-check strong,.consent-check small { display: block; }
.consent-check strong { color: var(--ink); font-size: 11px; }
.consent-check small { margin-top: 3px; font-weight: 500; line-height: 1.5; }
.muted-label { color: var(--ink-muted); font-size: 10px; }

.community-mode { background: #edf4fc; }
.community-mode::before { opacity: .55; }
.community-demo-banner { position: sticky; top: 0; z-index: 30; padding: 11px 16px; border: 1px solid #e5b54d; color: #4a3100; background: #ffe4a3; box-shadow: 0 8px 24px rgba(91,61,0,.12); font-size: 11px; font-weight: 800; letter-spacing: .02em; text-align: center; }
.community-shell { width: min(1420px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 38px 40px; }
.community-header { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.community-header nav { display: flex; align-items: center; gap: 22px; }
.community-header nav a { color: var(--ink-muted); font-size: 11px; font-weight: 750; text-decoration: none; }
.community-header nav a:hover { color: var(--blue); }
.community-brand { display: grid; grid-template-columns: 42px auto; grid-template-rows: auto auto; align-items: center; gap: 0 11px; color: var(--ink); text-decoration: none; }
.community-brand > span { display: grid; width: 42px; height: 42px; grid-row: 1 / 3; border: 1px solid rgba(23,107,194,.2); border-radius: 14px 7px 14px 7px; color: var(--forest); background: #dceeff; font-family: var(--font-display); font-size: 17px; font-weight: 800; place-items: center; }
.community-brand strong { align-self: end; font-size: 17px; line-height: 1.1; }
.community-brand small { align-self: start; color: var(--ink-muted); font-size: 7px; font-weight: 800; letter-spacing: .18em; }
.community-brand.dark { justify-self: start; }

.community-hero { position: relative; padding: clamp(58px, 8vw, 100px) 0 48px; overflow: hidden; }
.community-hero::after { position: absolute; top: 14px; right: 3%; width: 320px; height: 320px; border: 58px solid rgba(23,107,194,.065); border-radius: 50%; content: ""; }
.community-hero h1 { position: relative; max-width: 930px; margin: 9px 0 14px; font-family: var(--font-display); font-size: clamp(43px, 5.6vw, 74px); font-weight: 600; letter-spacing: -.055em; line-height: .98; z-index: 1; }
.community-hero p { position: relative; max-width: 670px; margin: 0; color: var(--ink-muted); font-size: 14px; z-index: 1; }
.community-filters { display: grid; grid-template-columns: .8fr .9fr 1.2fr 1.5fr auto; align-items: end; gap: 10px; margin-bottom: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.74); box-shadow: 0 10px 35px rgba(14,54,104,.05); }
.community-filters input,.community-filters select { min-height: 42px; margin-top: 4px; background: white; }
.community-filters button { min-height: 42px; }
.community-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: stretch; gap: 10px; margin-bottom: 15px; }
.community-summary > div { padding: 17px 19px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.69); }
.community-summary span,.community-summary strong { display: block; }
.community-summary span { color: var(--ink-muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.community-summary strong { margin-top: 4px; font-family: var(--font-display); font-size: 21px; }
.community-summary > button { height: 100%; min-height: 70px; padding-inline: 22px; }
.community-timezone-notice { display: flex; align-items: baseline; gap: 11px; margin: -2px 0 15px; padding: 10px 14px; border: 1px solid rgba(23,107,194,.12); border-radius: 12px; color: var(--ink-muted); background: rgba(229,240,251,.72); }
.community-timezone-notice strong { flex: none; color: var(--blue); font-size: 9px; letter-spacing: .05em; }
.community-timezone-notice p { margin: 0; font-size: 9px; line-height: 1.55; }

.community-board,.community-total-panel,.community-detail-grid > article { border: 1px solid var(--line); border-radius: 22px; background: rgba(252,254,255,.9); box-shadow: 0 13px 45px rgba(14,54,104,.06); }
.community-board { padding: 24px; }
.community-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.community-board-head h2 { margin: 3px 0 0; font-family: var(--font-display); font-size: 25px; font-weight: 650; }
.community-board-head > small { color: var(--ink-muted); font-size: 9px; }
.community-rank-row { display: grid; grid-template-columns: 54px minmax(175px,1.15fr) minmax(380px,1.8fr) minmax(112px,.65fr) 128px; align-items: center; gap: 14px; padding: 14px 8px; border-top: 1px solid rgba(20,62,108,.085); }
.community-rank { color: var(--ink-muted); font-family: var(--font-display); font-size: 22px; text-align: center; }
.community-rank.is-top { color: var(--blue); font-size: 29px; }
.community-person { display: flex; min-width: 0; align-items: center; gap: 10px; text-decoration: none; }
.community-person > span:last-child { min-width: 0; }
.community-person strong,.community-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-person strong { font-size: 12px; }
.community-person small { margin-top: 2px; color: var(--ink-muted); font-size: 9px; }
.community-token-grid { display: grid; min-width: 0; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 0; }
.community-token-grid > div { min-width: 0; padding: 8px; border-radius: 10px; background: rgba(20,62,108,.045); }
.community-token-grid dt,.community-token-grid dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-token-grid dt { color: var(--ink-muted); font-size: 8px; }
.community-token-grid dd { margin: 2px 0 0; font-size: 10px; font-weight: 750; }
.community-primary { min-width: 0; text-align: right; }
.community-primary span,.community-primary strong,.community-primary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-primary span { color: var(--ink-muted); font-size: 8px; }
.community-primary strong { margin: 2px 0; color: var(--forest); font-family: var(--font-display); font-size: 18px; }
.community-primary small { color: var(--ink-muted); font-size: 8px; }
.community-privacy { display: flex; align-items: flex-start; gap: 18px; margin-top: 15px; padding: 17px 20px; border: 1px dashed rgba(23,107,194,.25); border-radius: 17px; background: rgba(23,107,194,.045); }
.community-privacy strong { flex: none; color: var(--forest-bright); font-size: 10px; letter-spacing: .08em; }
.community-privacy p { margin: 0; color: var(--ink-muted); font-size: 10px; line-height: 1.65; }
.community-footer { padding: 28px 0 6px; color: var(--ink-muted); font-size: 9px; text-align: center; }
.community-empty { display: grid; min-height: 290px; align-content: center; justify-items: center; color: var(--ink-muted); text-align: center; }
.community-empty > span { color: var(--blue); font-family: var(--font-display); font-size: 44px; }
.community-empty h2 { margin: 4px 0; color: var(--ink); font-family: var(--font-display); }
.community-empty p { margin: 3px 0 15px; }
.community-empty.compact { min-height: 180px; }
.community-empty.error { margin-top: 20px; border: 1px solid var(--line); border-radius: 22px; background: white; }
.community-loading { display: grid; min-height: 100vh; place-content: center; justify-items: center; }
.community-loading span { display: grid; width: 58px; height: 58px; border-radius: 19px 9px 19px 9px; color: white; background: var(--forest); font-family: var(--font-display); font-size: 20px; place-items: center; animation: breathe 1.7s ease-in-out infinite; }
.community-loading p { color: var(--ink-muted); font-size: 10px; }

.community-back { display: inline-block; margin: 36px 0 18px; color: var(--forest-bright); font-size: 11px; font-weight: 750; text-decoration: none; }
.community-profile-hero { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 20px; margin-bottom: 18px; padding: 27px; border-radius: 24px; color: white; background: linear-gradient(145deg,#104480,#082752); box-shadow: var(--shadow); }
.community-profile-rank { display: grid; width: 72px; height: 72px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: #bfe1ff; font-family: var(--font-display); font-size: 23px; place-items: center; }
.community-profile-hero h1 { max-width: 650px; margin: 4px 0 2px; overflow: hidden; font-family: var(--font-display); font-size: clamp(31px,4vw,49px); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.community-profile-hero p { margin: 0; color: rgba(255,255,255,.58); font-size: 10px; }
.community-profile-hero > div:nth-of-type(2) { text-align: right; }
.community-profile-hero > div:nth-of-type(2) strong,.community-profile-hero > div:nth-of-type(2) span { display: block; }
.community-profile-hero > div:nth-of-type(2) strong { font-family: var(--font-display); font-size: 26px; }
.community-profile-hero > div:nth-of-type(2) span { color: rgba(255,255,255,.54); font-size: 9px; }
.community-profile-hero .secondary-button { border-color: rgba(255,255,255,.22); color: white; background: rgba(255,255,255,.08); }
.community-total-panel { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(380px,1.5fr) minmax(270px,1fr); align-items: center; gap: 22px; margin-bottom: 16px; padding: 23px; }
.community-total-title h2 { margin: 3px 0; font-family: var(--font-display); font-size: 24px; }
.community-extra-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0; }
.community-extra-totals > div { min-width: 0; padding: 11px; border-left: 2px solid rgba(23,107,194,.2); }
.community-extra-totals dt { color: var(--ink-muted); font-size: 8px; }
.community-extra-totals dd { margin: 4px 0 0; overflow: hidden; font-family: var(--font-display); font-size: 16px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.community-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.community-detail-grid > article { min-width: 0; padding: 22px; }
.community-detail-grid > .wide { grid-column: 1 / -1; }
.community-distribution { display: grid; gap: 8px; }
.community-distribution > div { display: grid; grid-template-columns: 26px minmax(90px,1fr) minmax(80px,1.2fr) auto; align-items: center; gap: 8px; min-width: 0; }
.community-distribution span { color: var(--ink-muted); font-family: var(--font-display); }
.community-distribution strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.community-distribution small { display: none; }
.community-distribution i { height: 6px; border-radius: 999px; background: rgba(23,107,194,.08); overflow: hidden; }
.community-distribution i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),var(--blue-bright)); }
.community-distribution i.is-unpriced,.community-distribution i.is-not-comparable { display: grid; height: 18px; place-items: center; border: 1px dashed rgba(20,62,108,.2); background: repeating-linear-gradient(135deg,rgba(20,62,108,.04) 0 5px,rgba(20,62,108,.1) 5px 10px); color: var(--ink-muted); font-size: 8px; font-style: normal; line-height: 1; }
.community-distribution i.is-unpriced span,.community-distribution i.is-not-comparable span { display: block; }
.community-distribution em { min-width: 64px; font-size: 10px; font-style: normal; font-weight: 750; text-align: right; }
.community-cost-comparison-note,.community-trend-unavailable { margin: 0 0 12px; padding: 12px 14px; border: 1px solid rgba(20,62,108,.12); border-radius: 14px; background: rgba(23,107,194,.05); color: var(--ink-muted); font-size: 10px; line-height: 1.6; }
.community-trend-unavailable strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }
.community-trend-unavailable p { margin: 0; }
.community-trend svg { display: block; width: 100%; }
.community-trend svg line { stroke: rgba(20,62,108,.1); }
.community-trend svg polyline { fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; }
.community-trend svg circle { fill: white; stroke: var(--blue); stroke-width: 3; }
.community-trend > div { display: flex; justify-content: space-between; color: var(--ink-muted); font-size: 9px; }
.community-rank-note { padding: 12px 15px; border-radius: 12px; color: #74461e; background: rgba(242,200,140,.34); font-size: 10px; }
.community-toast { position: fixed; right: 20px; bottom: 20px; z-index: 300; }
.community-toast > div { max-width: min(390px,calc(100vw - 40px)); padding: 13px 16px; border-radius: 12px; color: white; background: var(--forest); box-shadow: var(--shadow); font-size: 11px; font-weight: 750; }
.community-toast > .is-error { background: var(--danger); }

.join-shell { display: grid; min-height: 100vh; padding: 42px 20px; place-items: center; }
.join-card { display: grid; width: min(760px,100%); gap: 22px; padding: clamp(24px,5vw,48px); border: 1px solid var(--line); border-radius: 28px; background: rgba(252,254,255,.95); box-shadow: 0 30px 100px rgba(10,43,88,.13); }
.join-card > header h1 { margin: 7px 0 8px; font-family: var(--font-display); font-size: clamp(34px,6vw,52px); font-weight: 600; letter-spacing: -.045em; line-height: 1.04; }
.join-card > header p,.join-status p,.join-steps p,.join-disclosure p,.join-expiry { color: var(--ink-muted); font-size: 11px; line-height: 1.65; }
.join-status { display: flex; gap: 12px; padding: 14px; border: 1px solid rgba(23,107,194,.2); border-radius: 15px; background: rgba(23,107,194,.06); }
.join-status > span { display: grid; width: 30px; height: 30px; flex: none; border-radius: 50%; color: white; background: var(--blue); font-weight: 800; place-items: center; }
.join-status strong { display: block; font-size: 11px; }
.join-status p { margin: 2px 0 0; }
.join-status.is-error { border-color: rgba(189,63,74,.2); background: rgba(189,63,74,.055); }
.join-status.is-error > span { background: var(--danger); }
.join-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.join-steps li { display: grid; grid-template-columns: 45px minmax(0,1fr); gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.join-steps li > span { color: var(--blue); font-family: var(--font-display); font-size: 23px; }
.join-steps strong { display: block; }
.join-steps p { margin: 3px 0 10px; }
.join-disclosure { padding: 18px; border-radius: 17px; color: rgba(255,255,255,.77); background: var(--forest); }
.join-disclosure h2 { margin: 0 0 7px; color: white; font-family: var(--font-display); font-size: 21px; }
.join-disclosure p { margin: 6px 0; color: rgba(255,255,255,.68); }
.join-expiry { margin: -5px 0 0; }

@media (max-width: 1120px) {
  .community-rank-row { grid-template-columns: 48px minmax(165px,1fr) minmax(330px,1.7fr) 110px; }
  .community-rank-row > .secondary-button { grid-column: 2 / -1; justify-self: end; min-height: 30px; }
  .community-total-panel { grid-template-columns: 1fr 2fr; }
  .community-extra-totals { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .community-shell { padding: 0 20px 34px; }
  .community-header { min-height: 72px; }
  .community-brand > span { width: 36px; height: 36px; }
  .community-header nav { gap: 12px; }
  .community-hero { padding: 48px 0 32px; }
  .community-hero::after { width: 230px; height: 230px; }
  .community-filters { grid-template-columns: 1fr 1fr; }
  .community-filters button { grid-column: 1 / -1; }
  .community-rank-row { grid-template-columns: 42px minmax(0,1fr) minmax(105px,.45fr); }
  .community-rank-row .community-token-grid { grid-column: 2 / -1; }
  .community-rank-row > .secondary-button { grid-column: 2 / -1; }
  .community-primary { grid-column: 3; grid-row: 1; }
  .community-summary { grid-template-columns: repeat(3,1fr); }
  .community-summary > button { grid-column: 1 / -1; min-height: 42px; }
  .community-profile-hero { grid-template-columns: auto minmax(0,1fr) auto; }
  .community-profile-hero > div:nth-of-type(2) { grid-column: 2; text-align: left; }
  .community-profile-hero > button { grid-column: 3; grid-row: 1 / 3; }
  .community-total-panel { grid-template-columns: 1fr; }
  .community-extra-totals { grid-column: auto; }
}

@media (max-width: 520px) {
  .community-shell { padding-inline: 13px; }
  .community-header nav a:last-child { display: none; }
  .community-brand strong { font-size: 15px; }
  .community-hero h1 { font-size: 43px; }
  .community-filters { grid-template-columns: 1fr; }
  .community-filters button { grid-column: auto; }
  .community-summary { grid-template-columns: 1fr 1fr; }
  .community-summary > div:first-child { grid-column: 1 / -1; }
  .community-board { padding: 15px 12px; }
  .community-board-head { align-items: flex-start; flex-direction: column; }
  .community-rank-row { grid-template-columns: 36px minmax(0,1fr) 94px; gap: 7px; padding: 13px 2px; }
  .community-rank { font-size: 18px; }
  .community-rank.is-top { font-size: 23px; }
  .community-person .avatar { display: none; }
  .community-person strong { max-width: 155px; }
  .community-person small { display: none; }
  .community-token-grid { grid-template-columns: 1fr 1fr; }
  .community-rank-row > .secondary-button { width: 100%; }
  .community-privacy { flex-direction: column; gap: 6px; }
  .community-profile-hero { grid-template-columns: auto minmax(0,1fr); padding: 20px; }
  .community-profile-rank { width: 55px; height: 55px; }
  .community-profile-hero h1 { font-size: 32px; }
  .community-profile-hero > div:nth-of-type(2) { grid-column: 1 / -1; }
  .community-profile-hero > button { grid-column: 1 / -1; grid-row: auto; }
  .community-total-panel .community-token-grid,.community-extra-totals { grid-template-columns: 1fr 1fr; }
  .community-detail-grid { grid-template-columns: 1fr; }
  .community-detail-grid > .wide { grid-column: auto; }
  .community-distribution > div { grid-template-columns: 24px minmax(85px,1fr) auto; }
  .community-distribution i { display: none; }
  .community-trend > div strong { display: none; }
  .join-shell { padding: 12px; align-items: start; }
  .join-card { padding: 22px 18px; border-radius: 20px; }
  .join-steps li { grid-template-columns: 35px minmax(0,1fr); padding: 13px; }
}
