/* The server dashboard (/Dashboard). Uses the site's colours (--bs-*, --sigil-accent-*) so it follows the light and dark looks. The page's
   sidebar and boxes reuse the edit-profile classes (edit-shell, edit-sidebar, edit-section-box). */

.dash-home,
.dash-shell {
  max-width: 76rem;
  margin: 0 auto;
  padding-bottom: 5rem;
}

.dash-home-head {
  margin-bottom: 1.5rem;
}

.dash-card {
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(250, 204, 21, 0.25);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.05), transparent 35%), var(--bs-body-bg);
}

.dash-signin {
  max-width: 38rem;
}

/* ---------- pills ---------- */

.dash-pill {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.dash-pill-role { background: rgba(var(--sigil-accent-1-rgb), 0.12); border-color: rgba(var(--sigil-accent-1-rgb), 0.35); }
.dash-pill-ok { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.45); }
.dash-pill-warn { background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.5); }
.dash-pill-off { background: transparent; color: var(--bs-secondary-color); }

/* ---------- the list of servers ---------- */

.dash-filter {
  max-width: 24rem;
  margin-bottom: 1rem;
}

.dash-servers {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.dash-server {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-server[hidden] { display: none; }
.dash-server-absent { opacity: 0.85; }

.dash-server-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
}

.dash-server-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0;
  font-size: 0.85rem;
}

.dash-server-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(var(--sigil-accent-1-rgb), 0.18);
  font-weight: 700;
  font-size: 1.2rem;
}

.dash-server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-server-icon-lg {
  width: 4rem;
  height: 4rem;
}

.dash-foot { font-size: 0.9rem; }

@media (max-width: 575px) {
  .dash-server {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dash-server-action {
    grid-column: 1 / -1;
  }

  .dash-server-action .btn { width: 100%; }
}

/* ---------- one server ---------- */

.dash-head {
  margin-bottom: 1.25rem;
}

.dash-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.dash-head-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
}

.dash-alert { margin-bottom: 1rem; }

.dash-layout {
  margin-top: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .dash-layout { grid-template-columns: 12rem minmax(0, 1fr); }
}

.dash-split > *,
.dash-layout > * { min-width: 0; }

/* On a phone the preview comes first, so a look you pick is seen at once. */
@media (max-width: 1099px) {
  .dash-split-side { order: -1; }
}

.dash-layout .edit-sidebar-link { cursor: pointer; }

.dash-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.dash-content [hidden] { display: none !important; }

.dash-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--sigil-accent-1-rgb), 0.4);
  background: rgba(var(--sigil-accent-1-rgb), 0.1);
}

.dash-callout-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.12);
}

.dash-note {
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  font-size: 0.92rem;
}

.dash-problems {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.12);
}

.dash-problems ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.dash-allgood { margin-bottom: 1.25rem; }

.dash-features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-bottom: 1.5rem;
}

.dash-feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-feature header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.dash-feature h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.dash-feature p {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.92rem;
}

.dash-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.dash-change-what { font-weight: 600; }

.dash-also {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
}

/* ---------- forms ---------- */

.dash-subhead {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.dash-select-narrow { max-width: 18rem; }

.dash-switch { margin-bottom: 0.6rem; }

.dash-switch .form-text { margin-left: -2.5em; padding-left: 2.5em; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.dash-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-preset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dash-preset:hover:not(:disabled),
.dash-preset:focus-visible {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.6);
  background: rgba(var(--sigil-accent-1-rgb), 0.12);
}

.dash-preset:disabled { opacity: 0.55; cursor: not-allowed; }

.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.6rem 0 0.4rem;
}

.dash-chip {
  padding: 0.15rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-family: var(--bs-font-monospace);
  font-size: 0.8rem;
}

.dash-chip:hover:not(:disabled) {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.6);
  background: rgba(var(--sigil-accent-1-rgb), 0.12);
}

.dash-chip:disabled { opacity: 0.55; cursor: not-allowed; }

.dash-colour-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dash-colour-text { max-width: 14rem; font-family: var(--bs-font-monospace); }

.dash-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.dash-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--bs-body-bg);
  box-shadow: 0 0 0 1px var(--bs-border-color);
  padding: 0;
}

.dash-swatch:hover:not(:disabled),
.dash-swatch:focus-visible { box-shadow: 0 0 0 2px rgba(var(--sigil-accent-1-rgb), 0.9); }

.dash-swatch:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- lists of roles ---------- */

.dash-roles {
  display: grid;
  gap: 0.25rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.7rem;
  background: var(--bs-tertiary-bg);
}

.dash-role {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.dash-role:hover { background: rgba(var(--sigil-accent-1-rgb), 0.08); }

.dash-role-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-role-name { font-weight: 600; overflow-wrap: anywhere; }

.dash-role-why {
  flex-basis: 100%;
  margin-left: 2.35rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.dash-role-blocked { opacity: 0.6; cursor: not-allowed; }
.dash-role-warn .dash-role-why { color: #d97706; }
.dash-role-count { margin-top: 0.4rem; }

/* ---------- colour palettes ---------- */

.dash-packs {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.dash-pack {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  cursor: pointer;
}

.dash-pack:has(input:checked) {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.6);
  background: rgba(var(--sigil-accent-1-rgb), 0.1);
}

.dash-pack-body { display: grid; gap: 0.25rem; min-width: 0; }
.dash-pack-name { font-weight: 700; }
.dash-pack-blurb { font-size: 0.82rem; }

.dash-pack-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 0.15rem;
}

.dash-pack-dots span {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
}

/* ---------- the live preview ---------- */

.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1100px) {
  .dash-split { grid-template-columns: minmax(0, 1fr) 24rem; }

  .dash-split-side {
    position: sticky;
    top: 1rem;
  }
}

.dash-preview {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-preview-label {
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.dash-preview-label span {
  font-weight: 400;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  margin-left: 0.4rem;
}

/* It looks like Discord's dark look on purpose: that is where most people will see it. */
.dp {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 0.6rem;
  background: #313338;
  color: #dbdee1;
  font-family: "gg sans", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dp-avatar {
  flex: 0 0 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffe066, #ff5a1f);
  color: #1b1130;
  font-weight: 800;
}

.dp-body { min-width: 0; flex: 1 1 auto; }

.dp-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; }
.dp-name { font-weight: 600; color: #f2f3f5; }
.dp-app { font-size: 0.6rem; font-weight: 700; padding: 0 0.3rem; border-radius: 0.25rem; background: #5865f2; color: #fff; line-height: 1.3rem; }
.dp-time { font-size: 0.72rem; color: #949ba4; }

.dp-text { white-space: pre-wrap; }
.dp-text:empty { display: none; }

.dp-mention {
  padding: 0 0.15rem;
  border-radius: 0.2rem;
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  font-weight: 500;
}

.dp-channel {
  padding: 0 0.15rem;
  border-radius: 0.2rem;
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
}

.dp-embed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-top: 0.4rem;
  max-width: 28rem;
  padding: 0.6rem 0.8rem 0.7rem 0.75rem;
  border-radius: 0.25rem;
  border-left: 4px solid var(--dp-colour, #7db9f5);
  background: #2b2d31;
}

.dp-embed[hidden] { display: none; }

.dp-embed-body { min-width: 0; display: grid; gap: 0.25rem; align-content: start; }
.dp-author { font-size: 0.82rem; font-weight: 600; color: #f2f3f5; }
.dp-title { font-weight: 700; color: #f2f3f5; }
.dp-desc { white-space: pre-wrap; font-size: 0.88rem; }
.dp-footer { font-size: 0.72rem; color: #b5bac1; }
.dp-author:empty, .dp-title:empty, .dp-desc:empty, .dp-footer:empty { display: none; }

.dp-image {
  display: grid;
  place-items: center;
  margin-top: 0.3rem;
  min-height: 5rem;
  border-radius: 0.3rem;
  border: 1px dashed #4e5058;
  color: #949ba4;
  font-size: 0.78rem;
}

.dp-image[hidden] { display: none; }

.dp-thumb {
  width: 4rem;
  height: 4rem;
  border-radius: 0.4rem;
  background: #4e5058;
  display: grid;
  place-items: center;
  color: #dbdee1;
  font-weight: 700;
  font-size: 1.4rem;
}

.dp-thumb[hidden] { display: none; }

/* A picture uploaded in the builder is shown for real in the preview. */
.dp-has-picture {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.dp-image.dp-has-picture { min-height: 9rem; border-style: solid; }

.dp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.dp-buttons:empty { display: none; }

.dp-button {
  padding: 0.25rem 0.8rem;
  border-radius: 0.3rem;
  background: #4e5058;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
}

.dp-button-wave { background: #248046; }
.dp-button-link::after { content: " \2197"; }

.dash-test {
  padding: 0 0.25rem;
}

.dash-request-result { margin-left: 0.4rem; }

/* ---------- unsaved changes ---------- */

.dash-savebar {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1040;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  width: min(44rem, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--sigil-accent-1-rgb), 0.55);
  background: var(--bs-body-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-weight: 600;
}

.dash-savebar[hidden] { display: none; }

.dash-savebar-actions { display: inline-flex; gap: 0.5rem; }

@media (prefers-reduced-motion: no-preference) {
  .dash-savebar { animation: dash-rise 0.18s ease-out; }
}

@keyframes dash-rise {
  from { opacity: 0; transform: translate(-50%, 0.6rem); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- sidebar group labels ---------- */

.dash-nav-label {
  display: none;
  margin: 0.9rem 0 0.1rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

@media (min-width: 768px) {
  .dash-nav-label { display: block; }
}

/* ---------- empty states and confirm-style forms ---------- */

.dash-empty {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  border: 1px dashed var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-empty h3 { margin-bottom: 0.4rem; }

/* ---------- analytics ---------- */

.dash-analytics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-analytics-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.dash-ranges {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-range {
  padding: 0.3rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bs-body-color);
  font-weight: 600;
  font-size: 0.88rem;
}

.dash-range[aria-pressed="true"] {
  background: rgba(var(--sigil-accent-1-rgb), 0.22);
  color: var(--bs-body-color);
}

.dash-analytics-tz {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-analytics-tz select { width: auto; }

.dash-analytics-since { margin-bottom: 0.75rem; }

.dash-analytics-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.dash-kpis {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin-bottom: 1.5rem;
}

.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  min-width: 0;
}

.dash-kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.dash-kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
}

.dash-kpi-change { font-size: 0.78rem; font-weight: 600; }
.dash-up { color: #16a34a; }
.dash-down { color: #dc2626; }
.dash-flat { color: var(--bs-secondary-color); }

.ch-spark {
  width: 100%;
  height: 1.7rem;
  margin-top: 0.25rem;
}

.dash-kpis-compact { margin-bottom: 0.5rem; }

.dash-insights ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.dash-chart-card .dash-chart + .dash-chart { margin-top: 1.25rem; }

.dash-chart { margin: 0; }

.dash-chart figcaption {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

svg.ch {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ch-grid { stroke: var(--bs-border-color); stroke-width: 1; stroke-dasharray: 3 4; }
.ch-zero { stroke: var(--bs-secondary-color); stroke-width: 1; }
.ch-label { fill: var(--bs-secondary-color); font-size: 11px; }
.ch-line { fill: none; stroke: #0ea5e9; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: rgba(14, 165, 233, 0.16); stroke: none; }
.ch-bar { fill: #0ea5e9; }
.ch-bar-alt { fill: #8b5cf6; }
.ch-bar-join { fill: #22c55e; }
.ch-bar-leave { fill: #ef4444; }
.ch-avg { fill: none; stroke: #f97316; stroke-width: 2.2; stroke-linejoin: round; }
.ch-heat { fill: #0ea5e9; }
.ch-hit { fill: transparent; }
.ch-hit:hover { fill: rgba(var(--sigil-accent-1-rgb), 0.12); }

.dash-legend {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin: 0 0.15rem 0 0.1rem;
  border-radius: 2px;
  vertical-align: middle;
}

.dash-legend-join { background: #22c55e; }
.dash-legend-leave { background: #ef4444; }
.dash-legend-avg { background: #f97316; }

.dash-two {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.dash-two > * { min-width: 0; }

.dash-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dash-bars li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.dash-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.dash-bar-track {
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(var(--sigil-accent-1-rgb), 0.12);
  overflow: hidden;
}

.dash-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0ea5e9;
}

.dash-bar-count { font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); }

.dash-stack {
  display: flex;
  height: 1.1rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bs-border-color);
}

.dash-stack-part { display: block; min-width: 4px; }
.dash-stack-0 { background: #ef4444; }
.dash-stack-1 { background: #f59e0b; }
.dash-stack-2 { background: #0ea5e9; }
.dash-stack-3 { background: #22c55e; }
.dash-stack-4 { background: #94a3b8; }

.dash-stack-legend {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.dash-stack-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.45rem;
  border-radius: 50%;
}

.dash-tiles {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.dash-tile {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-tile strong { font-size: 1.4rem; font-weight: 800; }
.dash-tile span { font-size: 0.8rem; color: var(--bs-secondary-color); }

/* ---------- the schedule tab ---------- */

.dash-sched-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.dash-sched-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dash-sched {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  align-items: start;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-sched-broken { border-color: rgba(245, 158, 11, 0.6); }

.dash-sched-when { display: flex; flex-direction: column; gap: 0.1rem; }

.dash-sched-text {
  margin: 0 0 0.45rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dash-sched-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0;
}

.dash-sched-actions { display: flex; gap: 0.5rem; align-items: center; }

.dash-sched-editor { margin-top: 0.5rem; }

@media (max-width: 767px) {
  .dash-sched { grid-template-columns: minmax(0, 1fr); }
  .dash-bars li { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) auto; }
}

/* ---------- role menus ---------- */

.dash-rm-back { margin-bottom: 0.9rem; font-size: 0.92rem; }

.dash-rm-list { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }

.dash-rm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  align-items: start;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-rm-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.4rem; overflow-wrap: anywhere; }

.dash-rm-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.dash-rm-chip {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: rgba(var(--sigil-accent-1-rgb), 0.12);
  font-size: 0.8rem;
  font-weight: 600;
}

.dash-rm-add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.dash-rm-add select { max-width: 24rem; }

.dash-rm-rows { display: grid; gap: 0.6rem; margin-top: 0.6rem; }

.dash-rm-row {
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.dash-rm-row-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.dash-rm-role-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rm-row-tools { display: inline-flex; gap: 0.3rem; flex-shrink: 0; }

.dash-rm-row-grid {
  display: grid;
  gap: 0.5rem 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.dash-rm-row-grid label { display: grid; gap: 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--bs-secondary-color); }
.dash-rm-row-grid label[hidden] { display: none; }
.dash-rm-row-problem { margin: 0.5rem 0 0; font-size: 0.85rem; color: #d97706; }

.dash-rm-layouts {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.dash-rm-layout {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  cursor: pointer;
}

.dash-rm-layout:has(input:checked) {
  border-color: rgba(var(--sigil-accent-1-rgb), 0.65);
  background: rgba(var(--sigil-accent-1-rgb), 0.1);
}

.dash-rm-layout input { margin-top: 0.25rem; }
.dash-rm-layout-body { display: grid; gap: 0.15rem; font-size: 0.85rem; }

.dash-rm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }

[data-rm-when-style][hidden],
[data-dash-when-eq][hidden] { display: none !important; }

/* the parts of the preview only role menus use */

.dp-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.4rem 0.75rem;
  margin-top: 0.25rem;
}

.dp-fields:empty { display: none; }
.dp-field { grid-column: 1 / -1; min-width: 0; font-size: 0.85rem; }
.dp-field-inline { grid-column: span 1; }
.dp-field-name { font-weight: 700; color: #f2f3f5; font-size: 0.85rem; }

.dp-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  max-width: 24rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.3rem;
  background: #1e1f22;
  color: #b5bac1;
  font-size: 0.88rem;
}

.dp-select[hidden] { display: none; }
.dp-button-primary { background: #5865f2; }

@media (max-width: 767px) {
  .dash-rm { grid-template-columns: minmax(0, 1fr); }
  .dash-rm-row-head { flex-wrap: wrap; }
}
