/*
  Dashboard.css
  The look of the Clockwork Bots dashboard: the admin site's cream, ink, brass, pink and mint, its
  cartoon outlines, buttons, tables, dialogs, banner and motion (copied from
  C:\MW\Admin\Public\Styles\Admin.css so the two feel like one site), plus what only the bots
  need: bot and module cards, switches, pickers, the generated settings forms and the Discord
  message preview.

    1. Fonts and colour tokens
    2. Base elements
    3. Header and banner
    4. Page layout, cards, headings and notices
    5. Buttons, inputs, switches and badges
    6. Tiles and the health strip
    7. Bots, servers and modules
    8. Tables, tabs and pager
    9. Generated forms (fields, groups, rows, pickers, lists)
   10. Message editor and Discord preview
   11. Dialogs and the Add-a-bot wizard
   12. Phones, wide screens and reduced motion
   13. Sections, users and owners
   14. Motion

  Phone first: everything fits 390 px with 16 px gutters and no sideways page scroll; wide
  tables scroll inside their own box. No inline styles are needed (colours and widths are set
  through the CSSOM), so the admin site's strict content security policy works.
*/

/* ------------------------------------------------------------ 1. Fonts and colour tokens */

@font-face {
  font-family: 'Luckiest Guy';
  src: url('/Fonts/LuckiestGuy.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Fredoka';
  src: url('/Fonts/FredokaRegular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Fredoka';
  src: url('/Fonts/FredokaSemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --Cream: #FFF4DC;
  --CreamDeep: #FFE7B8;
  --Paper: #FFFDF7;
  --Ink: #2B1846;
  --InkSoft: #5A4778;
  --InkFaint: #8C7FA3;
  --Line: #E6DCC8;
  --Brass: #FFB627;
  --BrassLight: #FFD45E;
  --BrassPale: #FFE9B0;
  --BrassDark: #E07B00;
  --Pink: #FF6FA8;
  --PinkLight: #FF9CC6;
  --PinkPale: #FFD9E7;
  --PinkDark: #D93A7C;
  --Mint: #3ED6A6;
  --MintPale: #CFF5E7;
  --MintDark: #1A9E78;
  --Blue: #4A6FD8;
  --BluePale: #DCE4FF;
  --Error: #C4204B;
  --ErrorPale: #FFE1E8;

  --DisplayFont: 'Luckiest Guy', 'Arial Black', sans-serif;
  --BodyFont: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;

  --Outline: 3px solid var(--Ink);
  --ThinOutline: 2px solid var(--Ink);
  --Radius: 16px;
  --RadiusSmall: 10px;
  --CardShadow: 0 4px 0 var(--Ink);
  --PressShadow: 0 3px 0 var(--Ink);
  --ContentWidth: 1200px;
  --Gutter: 24px;

  /* Discord's dark theme, for the message preview. */
  --DiscordBackground: #313338;
  --DiscordEmbed: #2B2D31;
  --DiscordText: #DBDEE1;
  --DiscordMuted: #949BA4;
  --DiscordName: #F2F3F5;
  --DiscordBlurple: #5865F2;
}

/* ------------------------------------------------------------ 2. Base elements */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--Cream);
  color: var(--Ink);
  font-family: var(--BodyFont);
  font-size: 15px;
  line-height: 1.45;
}

h1,
h2,
h3 {
  font-family: var(--DisplayFont);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

p {
  margin: 0 0 0.6em;
}

a {
  color: var(--Ink);
  text-decoration-color: var(--PinkDark);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--PinkDark);
}

:focus-visible {
  outline: 3px solid var(--Blue);
  outline-offset: 2px;
}

strong {
  font-weight: 600;
}

time {
  white-space: nowrap;
}

code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.88em;
}

[hidden] {
  display: none !important;
}

.Muted {
  color: var(--InkSoft);
}

.VisuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.SkipLink {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
}

.SkipLink:focus {
  top: 8px;
}

/* ------------------------------------------------------------ 3. Header and banner */

.Header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--Paper);
  border-bottom: var(--Outline);
}

.HeaderInner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  max-width: var(--ContentWidth);
  margin: 0 auto;
  padding: 8px var(--Gutter);
}

.Brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}

.BrandIcon {
  width: 36px;
  height: 36px;
}

.BrandText {
  font-family: var(--DisplayFont);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-top: 3px;
}

.BrandAdmin {
  color: var(--PinkDark);
}

.BackLink {
  flex: none;
  padding: 4px 12px;
  border: 2px solid var(--Ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.BackLink:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.Account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.AccountName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--InkSoft);
  font-size: 0.9rem;
}

.Banner {
  max-width: var(--ContentWidth);
  width: 100%;
  margin: 12px auto 0;
  padding: 0 var(--Gutter);
}

.BannerMessage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  box-shadow: var(--PressShadow);
}

.BannerError {
  background: var(--ErrorPale);
}

.BannerSuccess {
  background: var(--MintPale);
}

.BannerInformation {
  background: var(--BluePale);
}

.BannerText {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
  overflow-wrap: anywhere;
}

.BannerClose {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--Ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.BannerClose:hover {
  background: rgba(43, 24, 70, 0.1);
}

/* ------------------------------------------------------------ 4. Page layout, cards, headings and notices */

.Main {
  flex: 1;
  width: 100%;
  max-width: var(--ContentWidth);
  margin: 0 auto;
  padding: 16px var(--Gutter) 40px;
  outline: none;
}

.Page,
.Stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.Breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  min-width: 0;
}

.Breadcrumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.Breadcrumbs li + li::before {
  content: '›';
  margin-right: 6px;
  color: var(--InkFaint);
}

.Breadcrumbs [aria-current] {
  color: var(--InkSoft);
}

.PageHeading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.PageHeadingText {
  min-width: 0;
  flex: 1 1 18rem;
}

.PageHeading h1 {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.PageHeading p {
  margin: 0;
}

.PageActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.HeadingWithAvatar,
.HeadingWithIcon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.HeadingBadges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.HeadingSwitch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.Card {
  min-width: 0;
  padding: 16px;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Paper);
  box-shadow: var(--CardShadow);
}

.CardTitle {
  margin-bottom: 12px;
}

.CardWarning {
  background: #FFF6E0;
}

.Notice {
  padding: 10px 14px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  overflow-wrap: anywhere;
}

.Notice ul {
  margin: 6px 0 0;
  padding-left: 1.2em;
}

.NoticeInformation {
  background: var(--BluePale);
}

.NoticeWarning {
  background: var(--BrassPale);
}

.NoticeError {
  background: var(--ErrorPale);
  color: var(--Error);
}

.Loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 4px;
  color: var(--InkSoft);
}

.Spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--BrassPale);
  border-top-color: var(--BrassDark);
  border-radius: 50%;
  animation: Spin 0.8s linear infinite;
}

@keyframes Spin {
  to {
    transform: rotate(360deg);
  }
}

.Empty {
  margin: 0;
  padding: 20px 16px;
  border: 2px dashed var(--InkFaint);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  color: var(--InkSoft);
  text-align: center;
}

.Empty p {
  margin: 0;
}

.EmptyActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.Footer {
  padding: 16px var(--Gutter) 24px;
  color: var(--InkSoft);
  font-size: 0.82rem;
  text-align: center;
}

.ButtonRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.PortalSteps {
  margin: 0 0 12px;
  padding-left: 1.4em;
}

.PortalSteps li {
  margin-bottom: 6px;
}

/* ------------------------------------------------------------ 5. Buttons, inputs, switches and badges */

.Button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 16px;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
  box-shadow: var(--PressShadow);
  color: var(--Ink);
  font-family: var(--BodyFont);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.Button:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.Button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--Ink);
}

.Button[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.ButtonPrimary {
  background: var(--Brass);
}

.ButtonPrimary:hover {
  background: var(--BrassLight);
}

.ButtonDanger {
  background: var(--Pink);
}

.ButtonDanger:hover {
  background: var(--PinkLight);
}

.ButtonDangerOutline {
  color: var(--PinkDark);
  border-color: var(--PinkDark);
  box-shadow: 0 3px 0 var(--PinkDark);
}

.ButtonDangerOutline:hover {
  background: var(--PinkPale);
}

.ButtonDangerText {
  color: var(--PinkDark);
}

.ButtonQuiet {
  box-shadow: none;
}

.ButtonQuiet:active {
  transform: none;
  box-shadow: none;
}

.ButtonSmall {
  min-height: 32px;
  padding: 3px 12px;
  font-size: 0.86rem;
}

.Input {
  min-height: 40px;
  padding: 6px 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  color: var(--Ink);
  font: inherit;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.Input[disabled] {
  background: #F4EEE2;
  color: var(--InkSoft);
}

select.Input {
  padding-right: 8px;
}

textarea.Input {
  resize: vertical;
  display: block;
}

.InputNumber {
  width: 8em;
  flex: none;
}

.InputColourText {
  width: 7.5em;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.ColourInput {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  cursor: pointer;
}

.ColourRow,
.NumberRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.NumberRow select.Input {
  width: auto;
}

.NumberRow .FieldHelp {
  flex-basis: 100%;
}

.Unit {
  color: var(--InkSoft);
  font-weight: 600;
}

/* The on/off switch: a real checkbox (role="switch") drawn as a track and a thumb. */
.Switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  cursor: pointer;
  font-weight: 600;
}

.SwitchInput {
  position: absolute;
  width: 46px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.SwitchTrack {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: #E9E1D2;
  transition: background-color 0.2s;
}

.SwitchThumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--Ink);
  border-radius: 50%;
  background: var(--Paper);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

.SwitchInput:checked + .SwitchTrack {
  background: var(--Mint);
}

.SwitchInput:checked + .SwitchTrack .SwitchThumb {
  transform: translateX(18px);
}

.SwitchInput:focus-visible + .SwitchTrack {
  outline: 3px solid var(--Blue);
  outline-offset: 2px;
}

.SwitchDisabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.SwitchInput:disabled {
  cursor: not-allowed;
}

.SwitchLabel {
  min-width: 0;
  overflow-wrap: anywhere;
}

.Badge {
  display: inline-block;
  padding: 0 7px;
  border: 1.5px solid var(--Ink);
  border-radius: 999px;
  font-family: var(--BodyFont);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}

.BadgeBrass {
  background: var(--BrassPale);
}

.BadgePink {
  background: var(--PinkPale);
}

.BadgeMint {
  background: var(--MintPale);
}

.BadgeBlue {
  background: var(--BluePale);
}

.BadgeInk {
  background: var(--Ink);
  color: var(--Paper);
}

.BadgeNeutral {
  background: #EFE8DB;
}

.StatusBadge::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--InkFaint);
  vertical-align: 1px;
}

.StatusOnline::before {
  background: var(--MintDark);
}

.StatusStarting::before,
.StatusReconnecting::before {
  background: var(--BrassDark);
  animation: Pulse 1.2s ease-in-out infinite;
}

.StatusError::before {
  background: var(--Error);
}

.WarningChip {
  display: inline-block;
  margin: 0;
  padding: 2px 10px;
  border: 1.5px solid var(--BrassDark);
  border-radius: 999px;
  background: var(--BrassPale);
  font-size: 0.82rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Avatars and server icons; the letter stands in when there is no picture or it cannot load. */
.Avatar {
  flex: none;
  display: inline-block;
  border: 2px solid var(--Ink);
  border-radius: 50%;
  background: var(--CreamDeep);
  object-fit: cover;
}

.AvatarLetter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--Ink);
  font-weight: 600;
  line-height: 1;
}

/* ------------------------------------------------------------ 6. Tiles and the health strip */

.Tiles,
.Health {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.Tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: var(--ThinOutline);
  border-left-width: 6px;
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

.TileBrass,
.TileMemory {
  border-left-color: var(--BrassDark);
}

.TilePink {
  border-left-color: var(--PinkDark);
}

.TileBlue {
  border-left-color: var(--Blue);
}

.TileLabel {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.TileValue {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.TileValueLarge {
  font-family: var(--DisplayFont);
  font-weight: 400;
  font-size: 2.4rem;
  letter-spacing: 0.02em;
}

.TileValueSmall {
  font-size: 1rem;
}

.TileUnit {
  font-family: var(--BodyFont);
  font-size: 1rem;
  font-weight: 600;
  color: var(--InkSoft);
}

.TileNote {
  font-size: 0.8rem;
  color: var(--InkSoft);
}

.Meter {
  display: block;
  height: 10px;
  margin: 6px 0 4px;
  border: 2px solid var(--Ink);
  border-radius: 999px;
  background: var(--Cream);
  overflow: hidden;
}

.MeterFill {
  display: block;
  height: 100%;
  background: var(--Mint);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.MeterWarning .MeterFill {
  background: var(--Brass);
}

.MeterDanger .MeterFill {
  background: var(--Pink);
}

/* ------------------------------------------------------------ 7. Bots, servers and modules */

.BotGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.BotCard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Paper);
  box-shadow: var(--CardShadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.BotCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--Ink);
}

.BotCardError {
  background: #FFF4F6;
}

.BotCardLink {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.BotCardNames,
.ServerNames {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.BotCardName {
  font-family: var(--DisplayFont);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.BotCardUsername {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.BotCardBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.BotCardDetail {
  margin: 0;
  font-size: 0.86rem;
  color: var(--Error);
  overflow-wrap: anywhere;
}

.BotFacts {
  display: flex;
  gap: 20px;
  margin: 0;
}

.BotFacts dt {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.BotFacts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ServerList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ServerLink {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  text-decoration: none;
  transition: background-color 0.15s;
}

.ServerLink:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.ServerNames {
  flex: 1;
}

.ServerName {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.Chevron {
  font-size: 1.5rem;
  color: var(--InkFaint);
}

.SearchBar {
  max-width: 28rem;
}

.ModuleCategory {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.CategoryTitle {
  font-size: 1.1rem;
  color: var(--InkSoft);
}

.ModuleGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ModuleCard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: var(--ThinOutline);
  border-left-width: 6px;
  border-left-color: var(--InkFaint);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  transition: border-color 0.2s, background-color 0.2s;
}

.ModuleOn {
  border-left-color: var(--MintDark);
  background: #F6FFFB;
}

.ModuleCardTop {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ModuleIcon {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
}

.ModuleTitle {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ModuleTitle:hover {
  text-decoration: underline;
}

.ModuleDescription {
  margin: 0;
  flex: 1;
  color: var(--InkSoft);
  font-size: 0.9rem;
}

.ModuleCardFoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.ModuleOpen {
  margin-left: auto;
  font-weight: 600;
}

.CommandList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.CommandList li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 12px;
  border: 1.5px solid var(--Line);
  border-radius: var(--RadiusSmall);
}

.CommandName {
  font-weight: 600;
  color: var(--Blue);
}

.CommandDescription {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ActionGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.ActionCard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  box-shadow: none;
  border-width: 2px;
}

.ActionCard p {
  flex: 1;
  margin: 0;
}

/* ------------------------------------------------------------ 8. Tables, tabs and pager */

.TableScroll {
  max-width: 100%;
  overflow-x: auto;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  -webkit-overflow-scrolling: touch;
}

.DataTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.DataTable th,
.DataTable td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--Line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.DataTable td.Wrap {
  white-space: normal;
  min-width: 12rem;
  overflow-wrap: anywhere;
}

.DataTable thead th {
  background: var(--CreamDeep);
  border-bottom: var(--ThinOutline);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.DataTable tbody tr:last-child > * {
  border-bottom: 0;
}

.DataTable tbody tr:nth-child(even) > * {
  background: #FFF8EA;
}

.DataTable tbody tr:hover > * {
  background: var(--BrassPale);
}

.DataTable .Numeric {
  text-align: right;
}

.MentionChip {
  display: inline-block;
  padding: 0 6px;
  border: 1.5px solid var(--Blue);
  border-radius: 6px;
  background: var(--BluePale);
  color: var(--Blue);
  font-weight: 600;
  white-space: nowrap;
}

.TableBlock {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.TableToolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.TableSearch {
  max-width: 22rem;
}

.Results {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.Results.Refreshing {
  opacity: 0.55;
  transition: opacity 0.2s;
}

.Pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.PagerText {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.PageTabsWrap {
  margin: -4px -4px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.PageTabsWrap::-webkit-scrollbar {
  display: none;
}

.PageTabs {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
  border-bottom: 1px solid var(--Line);
}

.PageTab {
  display: block;
  padding: 6px 14px 5px;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  color: var(--InkSoft);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.PageTab:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.PageTab[aria-current='page'] {
  border-bottom-color: var(--PinkDark);
  color: var(--Ink);
}

/* ------------------------------------------------------------ 9. Generated forms */

.GeneratedForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.FormFields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.FormField {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 40rem;
}

.FormFieldWide,
.FormFieldRows {
  max-width: none;
}

.FieldLabelRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.FieldLabel {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--InkSoft);
}

.FieldHelp {
  margin: 0;
  font-size: 0.84rem;
  color: var(--InkSoft);
}

.FieldWarning {
  margin: 0;
  font-size: 0.84rem;
  color: #8A4B00;
}

.ToggleRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.FormGroup {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: #FFFBF1;
}

.FormGroupTitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.FormGroup > .FieldHelp {
  margin: -4px 0 10px;
}

.RowsEditor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.RowCard {
  min-width: 0;
  padding: 12px;
  border: 2px dashed var(--InkFaint);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

/* Rows inside rows (a form's questions): a lighter card, indented a little. */
.RowCard .RowCard {
  padding: 10px;
  border-style: solid;
  border-width: 1.5px;
  background: #FFFBF1;
}

.RowCard .FormGroup {
  padding: 10px;
}

.RowCardHeader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

.RowCardButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.RowCardButtons .Button {
  min-width: 36px;
}

.RowsFooter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.RowsEmpty {
  margin: 0;
  color: var(--InkSoft);
  font-style: italic;
}

.FormProblems:empty {
  display: none;
}

.FormDisabled .FormGroup {
  background: #FAF6EE;
}

/* The bar that follows the page while there are unsaved changes. */
.SaveBar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
  padding: 10px 14px;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Ink);
  color: var(--Paper);
  box-shadow: 0 4px 0 var(--BrassDark);
  animation: RiseIn 0.25s ease-out both;
}

.SaveBarText {
  font-weight: 600;
}

.SaveBarButtons {
  display: flex;
  gap: 8px;
}

.SaveBar .ButtonQuiet {
  background: transparent;
  color: var(--Paper);
  border-color: var(--Paper);
}

.SaveBar .ButtonQuiet:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Pickers (channels, roles) and lists. */
.Picker,
.ListEditor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.PickerRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.PickerChips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.PickerNone {
  font-size: 0.88rem;
}

.Chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 4px 2px 10px;
  border: 1.5px solid var(--Ink);
  border-radius: 999px;
  background: var(--Cream);
  font-size: 0.88rem;
  font-weight: 600;
  animation: PopIn 0.2s ease-out both;
}

.ChipWarning {
  border-color: var(--BrassDark);
  background: var(--BrassPale);
}

.PickerText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ChipRemove {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--Ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.ChipRemove:hover {
  background: rgba(43, 24, 70, 0.12);
}

.ChipRemove:disabled {
  display: none;
}

.RoleDot {
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(43, 24, 70, 0.4);
  border-radius: 50%;
  background: #99AAB5;
}

.PickerWarning {
  flex: none;
  color: var(--BrassDark);
}

.PickerNotes:empty {
  display: none;
}

.PickerPanel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 28rem;
  padding: 8px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  box-shadow: var(--PressShadow);
  animation: SlideDown 0.18s ease-out both;
}

.PickerList {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.PickerGroup {
  padding: 8px 8px 2px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--InkFaint);
}

.PickerOption {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--Ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.PickerOption:hover:not(:disabled) {
  background: var(--BrassPale);
}

.PickerOption:disabled {
  opacity: 0.45;
  cursor: default;
}

.PickerChosen {
  background: var(--MintPale);
}

.PickerTick {
  flex: none;
  width: 1em;
  color: var(--MintDark);
  font-weight: 600;
}

.PickerEmpty {
  margin: 0;
  padding: 10px 8px;
  color: var(--InkSoft);
  font-size: 0.9rem;
}

.ListAddRow {
  display: flex;
  gap: 6px;
  max-width: 28rem;
}

/* ------------------------------------------------------------ 10. Message editor and Discord preview */

.MessageEditor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.MessageInputs,
.MessagePreviewColumn,
.EmbedFields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.EmbedFields {
  padding-left: 12px;
  border-left: 3px solid var(--Line);
}

.PlaceholderRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.PlaceholderChip {
  padding: 2px 8px;
  border: 1.5px solid var(--Blue);
  border-radius: 999px;
  background: var(--BluePale);
  color: var(--Blue);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}

.PlaceholderChip:hover:not(:disabled) {
  background: #C8D4FF;
}

.PlaceholderChip:active:not(:disabled) {
  transform: scale(0.95);
}

.PlaceholderChip:disabled {
  opacity: 0.5;
  cursor: default;
}

.CounterWrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.Counter {
  align-self: flex-end;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--InkFaint);
}

.CounterOver {
  color: var(--Error);
  font-weight: 600;
}

.DiscordPreview {
  padding: 14px 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--DiscordBackground);
  color: var(--DiscordText);
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.375;
  min-width: 0;
  overflow: hidden;
}

.DiscordMessage {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.DiscordMessage .Avatar {
  border: 0;
}

.DiscordBody {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.DiscordHeader {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}

.DiscordName {
  color: var(--DiscordName);
  font-weight: 600;
}

.DiscordAppTag {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--DiscordBlurple);
  color: #FFFFFF;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.5;
}

.DiscordTime {
  color: var(--DiscordMuted);
  font-size: 0.75rem;
}

.DiscordText {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.DiscordMention {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(88, 101, 242, 0.3);
  color: #C9CDFB;
  font-weight: 500;
}

.DiscordCode {
  padding: 0 3px;
  border-radius: 3px;
  background: #1E1F22;
  font-size: 0.85em;
}

.DiscordEmpty {
  margin: 0;
  color: var(--DiscordMuted);
  font-style: italic;
}

.DiscordEmbed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 432px;
  padding: 8px 14px 12px 12px;
  border-left: 4px solid var(--DiscordBlurple);
  border-radius: 4px;
  background: var(--DiscordEmbed);
  min-width: 0;
}

.EmbedTop {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.EmbedMain {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.EmbedTitle {
  color: var(--DiscordName);
  font-weight: 600;
}

.EmbedDescription {
  font-size: 0.875rem;
}

.EmbedThumbnail {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
}

.EmbedImage {
  max-width: 100%;
  border-radius: 4px;
}

.EmbedPicturePlaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 6px;
  border: 1.5px dashed var(--DiscordMuted);
  color: var(--DiscordMuted);
  font-size: 0.72rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.EmbedImage.EmbedPicturePlaceholder {
  min-height: 80px;
}

.EmbedFooter {
  color: var(--DiscordMuted);
  font-size: 0.75rem;
}

/* ------------------------------------------------------------ 11. Dialogs and the Add-a-bot wizard */

.Dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: var(--Outline);
  border-radius: var(--Radius);
  background: var(--Paper);
  box-shadow: 0 6px 0 var(--Ink);
  color: var(--Ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.Dialog:focus-visible {
  outline: none;
}

.Dialog::backdrop {
  background: rgba(43, 24, 70, 0.45);
}

.DialogForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.DialogTitle {
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.DialogBody {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.DialogBody p {
  margin: 0;
}

.DialogError {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--RadiusSmall);
  background: var(--ErrorPale);
  color: var(--Error);
  font-weight: 600;
}

.DialogButtons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.DialogWide {
  width: min(760px, calc(100% - 32px));
}

.DialogWide .DialogButtons {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 4px -20px -20px;
  padding: 12px 20px;
  border-top: 2px solid var(--Line);
  background: var(--Paper);
}

.Stepper {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.Stepper li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--Line);
  color: var(--InkFaint);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

.Stepper .StepCurrent {
  border-bottom-color: var(--PinkDark);
  color: var(--Ink);
}

.Stepper .StepDone {
  border-bottom-color: var(--MintDark);
  color: var(--InkSoft);
}

.StepNumber {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.76rem;
}

.StepCurrent .StepNumber {
  background: var(--Brass);
  border-color: var(--Ink);
}

.StepTitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.StepHeading {
  font-size: 1.15rem;
}

.TypeChooser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.TypeCard {
  position: relative;
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.TypeCard:hover {
  background: #FFF8E6;
}

.TypeCard:has(.TypeRadio:checked) {
  background: var(--BrassPale);
  box-shadow: var(--PressShadow);
}

.TypeCard:has(.TypeRadio:focus-visible) {
  outline: 3px solid var(--Blue);
  outline-offset: 2px;
}

.TypeRadio {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--BrassDark);
}

.TypeIcon {
  flex: none;
  font-size: 1.6rem;
  line-height: 1.1;
}

.TypeText {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-right: 18px;
}

.TypeTitle {
  font-weight: 600;
}

.TypeDescription {
  font-size: 0.86rem;
  color: var(--InkSoft);
}

.TypeModules {
  font-size: 0.78rem;
  color: var(--InkFaint);
}

/* ------------------------------------------------------------ 12. Phones, wide screens and reduced motion */

@media (min-width: 900px) {
  /* Wide screens: the message preview sits beside its editor. */
  .MessageEditor {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .MessagePreviewColumn {
    position: sticky;
    top: 80px;
    align-self: start;
  }
}

@media (max-width: 600px) {
  :root {
    --Gutter: 16px;
  }

  body {
    font-size: 14.5px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .BrandText {
    font-size: 1.1rem;
  }

  .BrandIcon {
    width: 30px;
    height: 30px;
  }

  .HeaderInner {
    gap: 6px 10px;
  }

  .BackLink {
    padding: 3px 10px;
    font-size: 0.84rem;
  }

  /* The account line takes its own row under the brand. */
  .Account {
    flex-basis: 100%;
    margin-left: 0;
    font-size: 0.85rem;
  }

  .Card {
    padding: 12px;
  }

  .Tiles,
  .Health {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .TileMemory {
    grid-column: 1 / -1;
  }

  .Tile {
    padding: 8px 10px;
  }

  .TileValue {
    font-size: 1.35rem;
  }

  .TileValueLarge {
    font-size: 2.1rem;
  }

  .BotGrid,
  .ModuleGrid,
  .ActionGrid,
  .TypeChooser {
    grid-template-columns: minmax(0, 1fr);
  }

  .PageActions {
    width: 100%;
  }

  .PageActions .Button {
    flex: 1 1 auto;
  }

  .DialogButtons .Button {
    flex: 1 1 auto;
  }

  .DialogWide,
  .Dialog {
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }

  .DialogForm {
    padding: 16px;
  }

  .DialogWide .DialogButtons {
    margin: 4px -16px -16px;
    padding: 10px 16px;
  }

  .FormGroup {
    padding: 10px;
  }

  .RowCard {
    padding: 10px;
  }

  .RowCard .RowCard {
    padding: 8px;
  }

  .EmbedFields {
    padding-left: 8px;
  }

  .SaveBar {
    bottom: 8px;
    padding: 8px 10px;
  }

  .SaveBarButtons {
    flex: 1 1 auto;
  }

  .SaveBarButtons .Button {
    flex: 1 1 auto;
  }

  .StepTitle {
    display: none;
  }

  .Stepper li {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------ 13. Sections, users and owners */

/* The header's two sections, as the admin site's menu pills. */
.SectionNav {
  order: 4;
  flex: 1 1 100%;
  display: flex;
  gap: 4px;
}

.SectionLink {
  display: block;
  padding: 5px 16px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s;
}

.SectionLink:hover {
  background: var(--BrassPale);
  color: var(--Ink);
}

.SectionLink[aria-current] {
  background: var(--Brass);
  border-color: var(--Ink);
}

.OwnerLine {
  font-size: 0.88rem;
  color: var(--InkSoft);
  overflow-wrap: anywhere;
}

.OwnerLine a {
  font-weight: 600;
}

.OwnerChip {
  padding-right: 10px;
}

.OwnerFixed {
  margin: 0;
}

.OwnerOptionText {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.OwnerOptionDetail {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.FilterBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
  border: var(--ThinOutline);
  border-radius: var(--Radius);
  background: var(--CreamDeep);
}

.FilterSearch {
  flex: 1 1 16rem;
  max-width: 26rem;
  min-width: 0;
}

.Segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  border: var(--ThinOutline);
  border-radius: 999px;
  background: var(--Paper);
  overflow: hidden;
}

.SegmentedButton {
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  border-right: var(--ThinOutline);
  background: transparent;
  color: var(--Ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.SegmentedButton:last-child {
  border-right: 0;
}

.SegmentedButton:hover {
  background: var(--BrassPale);
}

.SegmentedButton[aria-pressed='true'] {
  background: var(--Brass);
}

.RowMuted > * {
  color: var(--InkSoft);
}

.UsersTable tbody th {
  font-weight: 600;
}

.UserNameLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  text-decoration: none;
  vertical-align: middle;
}

.UserNameLink:hover .UserName {
  text-decoration: underline;
}

.UserEmail {
  overflow-wrap: anywhere;
}

.UserColumns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.PlanFacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.PlanUseText {
  font-size: 1.3rem;
  font-weight: 600;
}

.PlanLimits {
  margin: 0;
  padding-left: 1.2em;
  color: var(--InkSoft);
}

.PlanChange {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.PlanChange .FormField {
  flex: 1 1 16rem;
}

.ButtonRowTop {
  margin: 0 0 12px;
}

.LinkedServers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.LinkedServer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

.LinkedServerTop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.LinkedServerNames {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.LinkedServerId {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.LinkedServerNote {
  margin: 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--InkSoft);
  overflow-wrap: anywhere;
}

.ServerBots {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ServerBots li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding-top: 6px;
  border-top: 1px solid var(--Line);
}

.ServerBotName {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ServerBotPresent {
  text-decoration: none;
}

.InviteButton {
  max-width: 100%;
  white-space: normal;
}

/* The portal's sign-in page, ways to sign in, and the staff sign-ups switch. */
.SignInCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 34rem;
  width: 100%;
  margin: 12px auto;
  padding: 24px 20px;
  text-align: center;
}

.SignInCard p {
  margin: 0;
}

.SignInCard .Notice {
  width: 100%;
  text-align: left;
}

.SignInIcon {
  width: 72px;
  height: 72px;
}

.SignInSmall {
  font-size: 0.84rem;
}

.ProviderButtons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 20rem;
}

.ProviderButton {
  gap: 10px;
}

.ProviderDiscord {
  background: #5865F2;
  color: #FFFFFF;
}

.ProviderDiscord:hover {
  background: #7480F5;
  color: #FFFFFF;
}

.ProviderGoogle {
  background: var(--Paper);
}

.ProviderMark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--BodyFont);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
}

.ProviderMarkDiscord {
  background: #FFFFFF;
  color: #5865F2;
  border: 2px solid #5865F2;
}

.ProviderMarkDiscord::before {
  content: 'D';
}

.ProviderMarkGoogle {
  background: #FFFFFF;
  color: #4285F4;
  border: 2px solid #4285F4;
}

.ProviderMarkGoogle::before {
  content: 'G';
}

.SignInRows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.SignInRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border: var(--ThinOutline);
  border-radius: var(--RadiusSmall);
  background: var(--Paper);
}

.SignInText {
  display: flex;
  flex-direction: column;
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.SignInName {
  font-weight: 600;
}

.SignUpsCard {
  box-shadow: none;
  border-width: 2px;
}

.SignUpsTop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.SignUpsTop .CardTitle {
  margin: 0;
}

.SignUpsSwitch {
  margin-left: auto;
}

.SignUpsHelp {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.Footer a {
  color: var(--InkSoft);
}

@media (max-width: 600px) {
  .SectionNav {
    order: 3;
  }

  .SectionLink {
    padding: 4px 14px;
    font-size: 0.92rem;
  }

  .Segmented {
    display: flex;
    width: 100%;
  }

  .SegmentedButton {
    flex: 1 1 auto;
    padding: 4px 6px;
  }

  .FilterSearch {
    flex-basis: 100%;
    max-width: none;
  }

  .UserColumns,
  .LinkedServers {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On a phone the users table becomes a card per user, each value with its label. */
  .ResponsiveTableWrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .ResponsiveTable,
  .ResponsiveTable tbody,
  .ResponsiveTable tr,
  .ResponsiveTable th,
  .ResponsiveTable td {
    display: block;
  }

  .ResponsiveTable thead {
    display: none;
  }

  .ResponsiveTable tbody {
    display: grid;
    gap: 10px;
  }

  .ResponsiveTable tr {
    padding: 10px 12px;
    border: var(--ThinOutline);
    border-radius: var(--RadiusSmall);
    background: var(--Paper);
  }

  .ResponsiveTable tbody tr > *,
  .ResponsiveTable tbody tr:nth-child(even) > *,
  .ResponsiveTable tbody tr:hover > * {
    background: transparent;
  }

  .ResponsiveTable th,
  .ResponsiveTable td {
    padding: 2px 0;
    border: 0;
    white-space: normal;
  }

  .ResponsiveTable th {
    margin-bottom: 4px;
  }

  .ResponsiveTable td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
  }

  .ResponsiveTable td::before {
    content: attr(data-label);
    flex: none;
    color: var(--InkSoft);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .ResponsiveTable td > * {
    min-width: 0;
    text-align: right;
  }
}

/* ------------------------------------------------------------ 14. Motion
   Pages and their parts come in gently, rows one after another; switched off for reduced
   motion (section 12). */

@keyframes RiseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes FadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes PopIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes SlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes Shimmer {
  from {
    background-position: -200% 0;
  }

  to {
    background-position: 200% 0;
  }
}

@keyframes Pulse {
  50% {
    opacity: 0.35;
  }
}

.Page > *,
.Stack > * {
  animation: RiseIn 0.32s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.Page > :nth-child(2),
.Stack > :nth-child(2) {
  animation-delay: 0.05s;
}

.Page > :nth-child(3),
.Stack > :nth-child(3) {
  animation-delay: 0.1s;
}

.Page > :nth-child(n + 4),
.Stack > :nth-child(n + 4) {
  animation-delay: 0.15s;
}

.Tile,
.BotCard,
.ModuleCard {
  animation: PopIn 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}

.DataTable tbody tr {
  animation: RiseIn 0.28s ease-out both;
  animation-delay: calc(var(--Row, 0) * 18ms);
  transition: background-color 0.15s;
}

.LoadingArea {
  animation: FadeIn 0.2s both;
}

.Skeleton {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.SkeletonBar {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--CreamDeep) 25%, var(--Paper) 50%, var(--CreamDeep) 75%);
  background-size: 200% 100%;
  animation: Shimmer 1.4s linear infinite;
}

.SkeletonShort {
  width: 60%;
}

.BannerMessage {
  animation: SlideDown 0.25s ease-out both;
}

.Dialog[open] {
  animation: PopIn 0.2s cubic-bezier(0.2, 0.8, 0.3, 1.1) both;
}

.Dialog[open]::backdrop {
  animation: FadeIn 0.2s both;
}
