/* Permissions & limits pages: the Perm 1..9 pyramid, the "can this member run it?"
   flow and the scenario role ladder. Colours follow the iHorizon logo ring
   (ihorizon.css --ih-logo-ring); works in light and dark schemes. */

/* ── Pyramid ─────────────────────────────────────────────────────────── */
.perm-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 1.6em auto;
  max-width: 720px;
  font-size: 0.72rem;
}
.perm-pyramid .pp-crown {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  margin-bottom: 6px;
  border-radius: 999px;
  border: 1.5px dashed #f5b942;
  color: var(--md-default-fg-color);
  background: color-mix(in srgb, #f5b942 12%, transparent);
  font-weight: 600;
  text-align: center;
}
.perm-pyramid .pp-tier {
  /* --w: width of the tier; --c: its colour */
  width: var(--w);
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 35%, transparent);
  text-align: center;
  line-height: 1.25;
}
.perm-pyramid .pp-tier b {
  font-size: 0.85rem;
  white-space: nowrap;
}
.perm-pyramid .pp-tier span {
  opacity: 0.92;
}
.perm-pyramid .pp-base {
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  text-align: center;
  color: var(--md-default-fg-color--light);
  background: var(--md-default-bg-color--light);
  border: 1px solid var(--md-default-fg-color--lightest);
}
.perm-pyramid .pp-arrow {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  color: var(--md-default-fg-color--lighter);
  font-size: 0.66rem;
  margin-top: 2px;
}

/* ── "Can this member run it?" flow ──────────────────────────────────── */
.perm-flow {
  counter-reset: step;
  display: grid;
  gap: 10px;
  margin: 1.4em 0;
}
.perm-flow .pf-step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--md-default-bg-color--light);
  border-inline-start: 4px solid var(--c, var(--md-primary-fg-color));
}
.perm-flow .pf-step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--c, var(--md-primary-fg-color));
}
.perm-flow .pf-step p {
  margin: 0;
}
.perm-flow .pf-step p + p {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
}

/* ── Scenario ladder (role → level → what it unlocks) ────────────────── */
.perm-ladder {
  display: grid;
  gap: 6px;
  margin: 1.4em 0;
}
.perm-ladder .pl-row {
  display: grid;
  grid-template-columns: 74px 170px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--md-default-bg-color--light);
  font-size: 0.7rem;
}
.perm-ladder .pl-level {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  background: var(--c);
  white-space: nowrap;
}
.perm-ladder .pl-role {
  font-weight: 600;
}
.perm-ladder .pl-what code {
  font-size: 0.66rem;
}
@media (max-width: 640px) {
  .perm-ladder .pl-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Lock / unlock pills used in the help explanations */
.perm-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.perm-lock.on {
  color: #ff6b70;
  background: color-mix(in srgb, #da373c 16%, transparent);
}
.perm-lock.off {
  color: #3fc67a;
  background: color-mix(in srgb, #248046 18%, transparent);
}

/* ── Warnings & sanctions section: lifetime of each warning ──────────── */
.warn-gantt {
  display: grid;
  gap: 6px;
  margin: 1.4em 0;
  font-size: 0.68rem;
}
.warn-gantt .wg-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}
.warn-gantt .wg-label {
  font-weight: 600;
}
.warn-gantt .wg-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: var(--md-default-bg-color--light);
  border: 1px solid var(--md-default-fg-color--lightest);
  overflow: hidden;
}
.warn-gantt .wg-bar {
  /* --s: start, --w: width (percent of the track); --c: colour */
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--s);
  width: var(--w);
  padding-inline: 6px;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(90deg, var(--c, #d9a400), color-mix(in srgb, var(--c, #d9a400) 70%, #000));
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.warn-gantt .wg-bar.expired {
  background: repeating-linear-gradient(135deg, #7d8597 0 6px, #6b7280 6px 12px);
  opacity: 0.75;
}
.warn-gantt .wg-axis {
  display: flex;
  justify-content: space-between;
  color: var(--md-default-fg-color--lighter);
  font-size: 0.62rem;
}
@media (max-width: 640px) {
  .warn-gantt .wg-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ── Server security guide (security-guide/): exemption pills ─────────── */
.sec-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}
.sec-pill.yes {
  color: #3fc67a;
  background: color-mix(in srgb, #248046 18%, transparent);
}
.sec-pill.no {
  color: #ff6b70;
  background: color-mix(in srgb, #da373c 16%, transparent);
}
.sec-pill.part {
  color: #e0a33a;
  background: color-mix(in srgb, #f5b942 16%, transparent);
}
.sec-pill.na {
  color: var(--md-default-fg-color--light);
  background: var(--md-default-bg-color--light);
}
.sec-matrix table th,
.sec-matrix table td {
  text-align: center;
  vertical-align: middle;
}
.sec-matrix table td:first-child,
.sec-matrix table th:first-child {
  text-align: start;
}
/* Matrix: 8 columns must fit the text column (Material otherwise scrolls the
   table sideways and the last column looks cut). */
.sec-matrix table th,
.sec-matrix table td {
  padding: 0.6em 0.45em !important;
  font-size: 0.62rem;
}
.sec-matrix table th {
  white-space: normal;
  line-height: 1.25;
}
.sec-matrix .sec-pill {
  padding: 1px 6px;
  font-size: 0.6rem;
}

/* ── Member arrival section (member-arrival/): what runs on join ─────────── */
.arr-fan {
  margin: 1.4em 0;
  display: grid;
  gap: 10px;
  font-size: 0.7rem;
}
.arr-fan .af-start,
.arr-fan .af-end {
  justify-self: center;
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}
.arr-fan .af-start {
  color: #fff;
  background: linear-gradient(135deg, #1677e0, #7d4aa8);
}
.arr-fan .af-end {
  font-weight: 500;
  color: var(--md-default-fg-color--light);
  border: 1.5px dashed var(--md-default-fg-color--lightest);
}
.arr-fan .af-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  position: relative;
  padding-top: 12px;
  border-top: 2px solid var(--md-default-fg-color--lightest);
}
.arr-fan .af-lane {
  /* --c: colour of the lane's kind */
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--md-default-bg-color--light);
  border-block-start: 4px solid var(--c, var(--md-primary-fg-color));
}
.arr-fan .af-lane b {
  font-size: 0.72rem;
}
.arr-fan .af-lane span {
  color: var(--md-default-fg-color--light);
  font-size: 0.64rem;
  line-height: 1.3;
}
.arr-fan .af-kind {
  justify-self: start;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 600;
  background: var(--c, var(--md-primary-fg-color));
}
.arr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: -0.4em 0 1.2em;
  font-size: 0.64rem;
  color: var(--md-default-fg-color--light);
}
.arr-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 5px;
  border-radius: 3px;
  vertical-align: -1px;
  background: var(--c);
}

/* ── Dashboard guide (dashboard-guide/): save bar, role chips, module rows ── */
.dash-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 1.2em 0 0.4em;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--md-default-bg-color--light);
  border: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.7rem;
}
.dash-bar .dash-grow {
  flex: 1 1 auto;
}
.dash-toast {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 10px;
  line-height: 1.35;
}
.dash-toast::before {
  font-weight: 700;
}
.dash-toast.ok {
  color: #2f9e5f;
  background: color-mix(in srgb, #248046 14%, transparent);
}
.dash-toast.ok::before {
  content: "✓";
}
.dash-toast.err {
  color: #e0484d;
  background: color-mix(in srgb, #da373c 14%, transparent);
}
.dash-toast.err::before {
  content: "!";
}
.dash-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--md-typeset-a-color);
}
.dash-btn.primary {
  color: #fff;
  background: var(--md-typeset-a-color);
}
.dash-caption {
  margin-top: 0;
  font-size: 0.66rem;
  color: var(--md-default-fg-color--light);
}
.dash-chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--c, #7d8597);
}
.dash-yes,
.dash-no,
.dash-part {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}
.dash-yes {
  color: #3fc67a;
  background: color-mix(in srgb, #248046 18%, transparent);
}
.dash-no {
  color: #ff6b70;
  background: color-mix(in srgb, #da373c 16%, transparent);
}
.dash-part {
  color: #e0a33a;
  background: color-mix(in srgb, #f5b942 16%, transparent);
}

/* ── Embeds guide (embeds-guide/): one code, several features ────────── */
.emb-hub {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 1.6em 0;
  font-size: 0.7rem;
}
.emb-hub .eh-code {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1.5px dashed var(--md-primary-fg-color);
  background: color-mix(in srgb, var(--md-primary-fg-color) 10%, transparent);
  text-align: center;
}
.emb-hub .eh-code b {
  font-family: var(--md-code-font-family);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.emb-hub .eh-code small {
  color: var(--md-default-fg-color--light);
}
.emb-hub .eh-uses {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  padding-top: 14px;
  border-top: 2px solid var(--md-default-fg-color--lightest);
}
.emb-hub .eh-use {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--md-default-bg-color--light);
  border-top: 4px solid var(--c);
}
.emb-hub .eh-use span {
  color: var(--md-default-fg-color--light);
}
@media (max-width: 640px) {
  .emb-hub .eh-uses {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Logs guide (logs-guide/): channel sidebar and activity journal ───── */
.lg-tree {
  display: grid;
  gap: 2px;
  max-width: 420px;
  margin: 1.4em 0;
  padding: 10px 8px;
  border-radius: 10px;
  background: #2b2d31;
  color: #949ba4;
  font-size: 0.72rem;
}
.lg-tree .lg-cat {
  margin: 8px 4px 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lg-tree .lg-cat:first-child {
  margin-top: 0;
}
.lg-tree .lg-chan {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 4px;
}
.lg-tree .lg-chan::before {
  content: "#";
  margin-inline-end: 6px;
  opacity: 0.7;
}
.lg-tree .lg-chan span:first-child {
  flex: 1;
  color: #dbdee1;
}
.lg-tree .lg-who {
  color: #949ba4;
  font-size: 0.64rem;
  white-space: nowrap;
}
.lg-journal {
  display: grid;
  gap: 6px;
  margin: 1.4em 0;
}
.lg-journal .lg-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--md-default-bg-color--light);
  border-inline-start: 4px solid var(--c, var(--md-primary-fg-color));
}
.lg-journal .lg-time {
  color: var(--md-default-fg-color--light);
  font-size: 0.66rem;
  white-space: nowrap;
}
.lg-journal .lg-what {
  font-size: 0.72rem;
}
.lg-journal .lg-detail {
  grid-column: 2 / -1;
  color: var(--md-default-fg-color--light);
  font-size: 0.66rem;
}
