:root {
  color-scheme: dark;
  --bg: #030504;
  --bg-soft: #07100a;
  --panel: #09100d;
  --panel-strong: #101a14;
  --line: #183522;
  --text: #edf7ec;
  --muted: #91a59a;
  --gold: #7cff2f;
  --gold-soft: #b8ff57;
  --red: #64ff5a;
  --blue: #38d96b;
  --green: #39ff14;
  --violet: #9dff5e;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #030504;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/ave-toxicity-bg.jpg") center center / cover no-repeat fixed;
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  min-width: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  border-right: 1px solid rgba(124, 255, 47, 0.16);
  background: rgba(3, 5, 4, 0.82);
  backdrop-filter: blur(20px);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(145deg, #b8ff57, #39ff14);
  color: #031006;
  font-weight: 900;
  box-shadow:
    0 0 28px rgba(57, 255, 20, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand h1,
.brand p,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 1.2rem;
}

.brand p,
.muted {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.discord-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 24px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 255, 47, 0.18);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.07);
  color: var(--gold-soft);
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.discord-sidebar-link svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: var(--green);
  filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.35));
}

.discord-sidebar-link:hover,
.discord-sidebar-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(124, 255, 47, 0.42);
  background: rgba(124, 255, 47, 0.13);
  color: #f5ffe6;
}

.nav-button,
.primary-action,
.ghost-action,
.icon-button,
.role-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.nav-button {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  text-align: left;
  background: transparent;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 750;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(124, 255, 47, 0.1);
  border-color: rgba(124, 255, 47, 0.28);
  color: var(--text);
}

.panel {
  background: linear-gradient(180deg, rgba(13, 22, 17, 0.92), rgba(6, 10, 8, 0.9));
  border: 1px solid rgba(124, 255, 47, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel.compact {
  padding: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--gold-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-row,
.section-head,
.calendar-head,
.topbar,
.event-hero,
.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-row {
  margin: 16px 0 8px;
  color: var(--muted);
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(124, 255, 47, 0.12);
  margin-bottom: 12px;
}

.meter span {
  display: block;
  width: 70%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.role-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.role-row {
  display: grid;
  grid-template-columns: 64px 1fr 44px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.role-row .meter {
  margin: 0;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar > div:first-child,
.section-head > div,
.calendar-head > div,
.event-hero > div,
.profile-summary > div:last-child {
  min-width: 0;
}

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid rgba(124, 255, 47, 0.16);
  border-radius: 999px;
  background: rgba(124, 255, 47, 0.08);
  color: var(--gold-soft);
  font-size: 0.84rem;
  font-weight: 850;
  padding: 6px 12px;
  overflow-wrap: anywhere;
  text-align: center;
  cursor: pointer;
}

.user-badge:hover {
  border-color: rgba(124, 255, 47, 0.38);
  color: #f5ffe6;
  background: rgba(124, 255, 47, 0.13);
}

.primary-action {
  min-height: 42px;
  background: linear-gradient(145deg, #b8ff57, #39ff14);
  color: #031006;
  font-weight: 850;
  padding: 10px 14px;
  box-shadow:
    0 0 24px rgba(57, 255, 20, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.ghost-action {
  min-height: 42px;
  background: rgba(124, 255, 47, 0.07);
  border-color: rgba(124, 255, 47, 0.2);
  padding: 10px 13px;
}

.danger-action {
  border-color: rgba(255, 92, 92, 0.32);
  color: #ffb5b5;
}

.icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: rgba(124, 255, 47, 0.07);
  border-color: rgba(124, 255, 47, 0.2);
  font-size: 1.3rem;
  line-height: 1;
}

.primary-action:hover,
.ghost-action:hover,
.icon-button:hover,
.role-button:hover {
  transform: translateY(-1px);
}

.primary-action:focus-visible,
.ghost-action:focus-visible,
.icon-button:focus-visible,
.role-button:focus-visible,
.tab-button:focus-visible,
.nav-button:focus-visible,
.table-sort:focus-visible {
  outline: 2px solid rgba(184, 255, 87, 0.92);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 20px;
  align-items: start;
}

.calendar-panel,
.event-desk .panel,
.roster-layout .panel,
.profile-layout .panel,
.discord-layout .panel {
  padding: 20px;
}

.calendar-panel {
  background: linear-gradient(180deg, rgba(13, 22, 17, 0.92), rgba(6, 10, 8, 0.9));
  border: 1px solid rgba(124, 255, 47, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calendar-head {
  margin-bottom: 18px;
}

.weekday-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday-grid {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.weekday-grid span {
  padding: 0 6px;
}

.day-cell {
  min-height: 118px;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  background: rgba(2, 7, 4, 0.58);
  padding: 9px;
  overflow: hidden;
}

.day-cell.muted-month {
  opacity: 0.44;
}

.day-cell.today {
  border-color: rgba(124, 255, 47, 0.72);
  box-shadow:
    0 0 22px rgba(57, 255, 20, 0.14),
    inset 0 0 0 1px rgba(124, 255, 47, 0.24);
}

.day-number {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.event-chip {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  background: rgba(124, 255, 47, 0.12);
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
  min-height: 48px;
}

.event-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.event-chip span {
  color: var(--muted);
  font-size: 0.76rem;
}

.event-chip.mythic {
  border-left-color: var(--blue);
  background: rgba(56, 217, 107, 0.12);
}

.event-chip.alt {
  border-left-color: var(--violet);
  background: rgba(157, 255, 94, 0.1);
}

.event-desk {
  display: grid;
  gap: 16px;
}

.event-hero {
  align-items: stretch;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.event-hero img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.event-hero h3,
.section-head h3 {
  margin-top: 3px;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

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

.signup-stat {
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(124, 255, 47, 0.055);
}

.signup-stat strong {
  display: block;
}

.signup-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.signup-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.role-button {
  min-height: 42px;
  padding: 9px 8px;
  font-weight: 850;
}

.role-button.tank {
  background: rgba(56, 217, 107, 0.16);
  border-color: rgba(56, 217, 107, 0.38);
}

.role-button.healer {
  background: rgba(124, 255, 47, 0.18);
  border-color: rgba(124, 255, 47, 0.42);
}

.role-button.dps {
  background: rgba(184, 255, 87, 0.15);
  border-color: rgba(184, 255, 87, 0.38);
}

.role-button.flex {
  background: rgba(157, 255, 94, 0.12);
  border-color: rgba(157, 255, 94, 0.34);
}

.roster,
.character-list,
.bot-flow,
.command-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.roster-layout,
.member-roster-layout {
  display: grid;
  gap: 20px;
}

.auth-layout,
.admin-layout,
.logs-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.auth-layout .panel,
.admin-layout .panel,
.logs-layout .panel {
  padding: 20px;
}

.logs-layout {
  grid-template-columns: 1fr;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.setup-layout .panel {
  padding: 20px;
}

.setup-copy {
  margin-top: 12px;
}

.rank-settings {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.32fr) minmax(0, 1fr) minmax(108px, auto);
  gap: 12px;
  align-items: end;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.045);
  padding: 12px;
}

.rank-number-input {
  max-width: 96px;
}

.admin-user-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.045);
  padding: 12px;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-toggle {
  align-self: end;
  min-height: 42px;
  padding-bottom: 4px;
}

.tab-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(124, 255, 47, 0.18);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.055);
  color: var(--muted);
  font-weight: 850;
  padding: 9px 13px;
}

.tab-button.active,
.tab-button:hover {
  border-color: rgba(124, 255, 47, 0.42);
  background: rgba(124, 255, 47, 0.14);
  color: var(--text);
}

.log-panel {
  display: none;
}

.log-panel.active {
  display: block;
}

.log-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.log-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.045);
  padding: 12px;
}

.log-item strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.guild-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.member-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.member-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(124, 255, 47, 0.13);
  border-radius: 8px;
  background: rgba(5, 12, 8, 0.82);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
  padding: 14px;
  min-width: 0;
}

.member-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.member-card-head h3 {
  font-size: 1rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.small-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1rem;
}

.member-main,
.member-alt-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(124, 255, 47, 0.11);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.045);
  padding: 10px;
}

.member-main .pill,
.member-alt-row > span {
  align-self: start;
  justify-self: start;
  white-space: nowrap;
}

.member-alt-list {
  display: grid;
  gap: 8px;
}

.member-character {
  min-width: 0;
}

.member-character strong {
  display: block;
  overflow-wrap: anywhere;
}

.member-character strong span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.member-empty-alts {
  padding: 0 2px;
}

.guild-tools {
  box-shadow: none;
}

.roster-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 220px;
  gap: 12px;
}

.guild-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.guild-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.guild-table th,
.guild-table td {
  border-bottom: 1px solid rgba(124, 255, 47, 0.1);
  padding: 12px 10px;
  text-align: left;
  min-width: 0;
}

.guild-table th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  min-height: 28px;
  padding: 2px 0;
  text-transform: inherit;
  white-space: nowrap;
}

.table-sort::after {
  content: "\2195";
  color: rgba(124, 255, 47, 0.48);
  font-size: 0.72rem;
  flex: 0 0 auto;
}

.table-sort.active {
  color: var(--gold-soft);
}

.table-sort.active::after {
  content: "\2193";
  color: var(--gold);
}

.table-sort.active.asc::after {
  content: "\2191";
}

.guild-table td {
  color: var(--text);
  vertical-align: middle;
}

.guild-table tr:hover td {
  background: rgba(124, 255, 47, 0.045);
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.class-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
}

.name-cell a {
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.name-cell a:hover {
  color: var(--gold-soft);
}

.subtle-cell {
  color: var(--muted);
  font-size: 0.84rem;
}

.roster-item,
.character-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(124, 255, 47, 0.045);
}

.roster-item strong,
.character-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.roster-item > div,
.character-item > div:first-child {
  min-width: 0;
}

.character-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(100%, 188px);
}

.roster-meta,
.character-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(124, 255, 47, 0.1);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(124, 255, 47, 0.18);
  border-radius: 8px;
  background: rgba(2, 7, 4, 0.72);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 255, 47, 0.8);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full {
  width: 100%;
}

.profile-layout,
.discord-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

.profile-layout > .profile-wide,
.discord-layout > .panel:first-child {
  grid-column: span 2;
}

.profile-card {
  overflow: hidden;
  padding: 0;
}

.profile-cover {
  height: 150px;
  overflow: hidden;
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary {
  justify-content: flex-start;
  padding: 18px 20px 8px;
}

.profile-summary .avatar {
  margin-top: -38px;
  width: 64px;
  height: 64px;
  border: 4px solid var(--panel);
  font-size: 1.4rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
}

.stat-box {
  background: rgba(124, 255, 47, 0.055);
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.stat-box strong {
  display: block;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.stat-box span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.capacity-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(124, 255, 47, 0.14);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.055);
  padding: 12px;
  min-width: 0;
}

.capacity-preview strong {
  color: var(--gold-soft);
}

.capacity-preview span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: right;
}

.sync-status {
  min-height: 22px;
  color: var(--gold-soft);
  font-size: 0.86rem;
  margin-top: 12px;
}

.admin-lock {
  border: 1px solid rgba(124, 255, 47, 0.14);
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.055);
  color: var(--muted);
  margin-top: 14px;
  padding: 12px;
}

.discord-preview {
  margin-top: 18px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #07100a;
  padding: 16px;
}

.discord-preview h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.discord-preview p {
  color: var(--muted);
  margin-top: 6px;
}

.discord-preview .register-link {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
  margin-top: 14px;
  border-radius: 6px;
  background: linear-gradient(145deg, #b8ff57, #39ff14);
  color: #031006;
  padding: 9px 12px;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.bot-flow div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 2px 12px;
  border: 1px solid rgba(124, 255, 47, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(124, 255, 47, 0.045);
}

.bot-flow span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(124, 255, 47, 0.16);
  color: var(--gold-soft);
  font-weight: 900;
}

.bot-flow p {
  color: var(--muted);
  font-size: 0.9rem;
}

.command-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.command-list code {
  border: 1px solid rgba(124, 255, 47, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.44);
  padding: 12px;
  color: var(--gold-soft);
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  border: 1px solid rgba(124, 255, 47, 0.18);
  border-radius: 8px;
  background: rgba(5, 10, 7, 0.96);
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .brand,
  .nav {
    grid-column: span 2;
  }

  .calendar-layout,
  .auth-layout,
  .setup-layout,
  .profile-layout,
  .discord-layout,
  .roster-controls {
    grid-template-columns: 1fr;
  }

  .guild-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
  }

  .profile-layout > .panel:last-child,
  .discord-layout > .panel:first-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .brand,
  .nav {
    grid-column: auto;
  }

  .topbar,
  .section-head,
  .capacity-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .topbar-actions .user-badge {
    grid-column: 1 / -1;
  }

  .topbar-actions .icon-button {
    justify-self: start;
  }

  .section-head > .primary-action,
  .section-head > .ghost-action,
  .section-head > button {
    width: 100%;
  }

  .calendar-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    width: 100%;
  }

  .calendar-head .icon-button:last-child {
    justify-self: end;
  }

  .weekday-grid {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: auto;
  }

  .signup-actions,
  .signup-strip,
  .character-item,
  .log-item,
  .profile-stats,
  .guild-stat-grid,
  .rank-row,
  .admin-user-row,
  .admin-user-actions,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .character-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .character-actions .ghost-action {
    flex: 1 1 120px;
  }

  .capacity-preview span {
    text-align: left;
  }

  .rank-number-input {
    max-width: none;
  }
}
