:root {
  color-scheme: light;
  --display-font: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  --ink: #e6e0d2;
  --text-primary: #e6e0d2;
  --text-secondary: #bfb8a5;
  --text-heading: #f3d57a;
  --muted: #c4bda8;
  --line: #d9e2ec;
  --paper: #f5f7f9;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(251, 252, 253, 0.88);
  --input-bg: rgba(255, 255, 255, 0.96);
  --page-scrim: rgba(245, 247, 249, 0.58);
  --sidebar-bg: #172026;
  --sidebar-text: #eef5f3;
  --sidebar-muted: #b9c6c3;
  --sidebar-active: #243139;
  --sidebar-line: #3b4d56;
  --accent: #2f6f73;
  --accent-strong: #224f52;
  --gold: #b8860b;
  --rose: #a43d4f;
  --blue: #3767a6;
  --info-bg: #e7effa;
  --info-text: #244d80;
  --success-bg: #e9f6f2;
  --success-text: #1f6a50;
  --warning-bg: #fff3cd;
  --warning-text: #6b4a00;
  --danger-bg: #f8e8ec;
  --danger-text: #8f3043;
  --purple-bg: #f4edf7;
  --purple-text: #684174;
  --result-bg: #172026;
  --result-text: #ffffff;
  --result-muted: #b9c6c3;
  --drop-bg: #f7fbfc;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
  --page-background-image: url("assets/fantasy-split-background.png");
  --page-background-opacity: 0.9;
}

body[data-theme="night"] {
  color-scheme: dark;
  --ink: #edf4f2;
  --muted: #a7b8c2;
  --line: #32444d;
  --paper: #10171c;
  --panel: rgba(24, 34, 41, 0.9);
  --panel-soft: rgba(32, 44, 52, 0.88);
  --input-bg: rgba(18, 27, 33, 0.96);
  --page-scrim: rgba(5, 10, 14, 0.08);
  --sidebar-bg: #0b1116;
  --sidebar-text: #f0f7f5;
  --sidebar-muted: #9db0ad;
  --sidebar-active: #1c2a32;
  --sidebar-line: #34474f;
  --accent: #58a6a9;
  --accent-strong: #78c2c5;
  --gold: #d0a441;
  --rose: #c85b70;
  --blue: #82aee6;
  --info-bg: #1d3450;
  --info-text: #b8d7ff;
  --success-bg: #183a32;
  --success-text: #a9e8d4;
  --warning-bg: #43350e;
  --warning-text: #f4d47a;
  --danger-bg: #482230;
  --danger-text: #f2b3c1;
  --purple-bg: #352540;
  --purple-text: #dfc0ed;
  --result-bg: #080d11;
  --result-text: #ffffff;
  --result-muted: #a7b8c2;
  --drop-bg: #152129;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #080d11;
    background-image:
        linear-gradient(var(--page-scrim), var(--page-scrim)),
        url("assets/fantasy-split-background-v2.webp?v=3");

    background-repeat: no-repeat;

    background-size: 100% 100%;

    background-position: left center;
    background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  
}

.sidebar {
  background: transparent;
  color: var(--sidebar-text);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.2);
  height: 100vh;
  left: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  width: 340px;
  z-index: 30;
}

.brand-block,
.nav-list,
.sidebar-page-history,
.sidebar-visitor-counter {
  position: relative;
  z-index: 1;
}

.brand-block {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--sidebar-active);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand-block h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand-block h1,
.topbar h2,
.action-band h3,
.page-intro h3,
.panel h3,
.rules-copy h4 {
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 42%, #7a4a08 100%);
  background-clip: text;
  color: transparent;
  font-family: var(--display-font);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  -webkit-background-clip: text;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42), 0 0 12px rgba(216, 166, 45, 0.28);
}

.brand-block h1 {
  font-size: 1.26rem;
}

.brand-block p {
  margin: 4px 0 0;
  color: var(--sidebar-muted);
  line-height: 1.35;
  font-size: 0.92rem;
}

.sidebar-visitor-counter {
  color: var(--sidebar-muted);
  display: grid;
  gap: 4px;
  padding-top: 4px;
}

.sidebar-page-history {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  justify-items: center;
  margin-left: 0;
  margin-right: 0;
  margin-top: auto;
  padding-top: 8px;
}

.sidebar-history-button {
  border-color: var(--sidebar-line);
  color: var(--sidebar-text);
  font-size: 0.86rem;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  width: 100%;
}

.sidebar-visitor-counter span {
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-weight: 900;
}

.sidebar-visitor-counter strong {
  color: var(--sidebar-text);
  font-size: 1.35rem;
  line-height: 1;
}

.sidebar-banner {
  display: none;
}

.nav-list {
  display: grid;
  flex: 1 1 auto;
  gap: clamp(2px, 0.65vh, 7px);
  grid-auto-rows: minmax(30px, max-content);
  min-height: 0;
}

.mobile-nav-toggle {
  display: none;
}

.nav-link {
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  display: flex;
  font-family: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  font-weight: 900;
  font-size: clamp(0.9rem, 1.45vh, 1.02rem);
  justify-content: space-between;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: left;
  padding: clamp(5px, 0.72vh, 9px) 10px;
  border-radius: 8px;
}

.nav-link:hover {
  background: var(--sidebar-active);
  border-color: var(--sidebar-line);
}

.nav-link.active {
  color: var(--gold);
}

.main-panel {
  grid-column: 2;
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 800;
}

.topbar h2 {
  font-size: 2rem;
}

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

.topbar-account-button {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

.account-menu {
  position: relative;
}

.account-status {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 900;
  list-style: none;
  max-width: 260px;
  min-height: 42px;
  padding: 0 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.account-status #accountStatus {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-badge {
  align-items: center;
  background: #d92525;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(217, 37, 37, 0.2);
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 22px;
  min-width: 22px;
  padding: 2px 6px;
  text-shadow: none;
}

.nav-message-badge {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-left: 8px;
  min-height: 20px;
  min-width: 20px;
  padding: 2px 5px;
}

.account-status::-webkit-details-marker {
  display: none;
}

.account-status::after {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  content: "";
  margin-left: 10px;
}

.account-menu[open] .account-status {
  background: var(--input-bg);
  color: var(--ink);
}

.account-menu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
}

.account-menu-panel .ghost-button,
.account-menu-panel .file-button,
.account-menu-panel .role-badge {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  justify-content: center;
  width: 100%;
}

.account-menu-panel .role-badge {
  background: var(--input-bg);
  border-color: var(--line);
}

select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 10px;
  background: var(--input-bg);
}

.unclaimed-character-combo {
  margin: 6px 0;
  min-height: 36px;
}

.compact-select-label,
#claimCharacterField {
  position: relative;
}

.account-main-control {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 0.5fr) auto;
  margin-top: 6px;
}

.account-main-control select {
  min-width: 0;
  width: 100%;
}

.account-main-control button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.unclaimed-character-menu {
  background: var(--drop-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  left: 0;
  max-height: 260px;
  min-width: min(360px, 100%);
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% - 2px);
  z-index: 80;
}

.unclaimed-character-menu.open {
  display: grid;
  gap: 4px;
}

.unclaimed-character-menu-option {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.unclaimed-character-menu-option:hover,
.unclaimed-character-menu-option:focus {
  background: var(--panel-soft);
  border-color: var(--line);
}

.unclaimed-character-menu-option strong {
  color: var(--gold);
  font-size: 0.9rem;
}

.unclaimed-character-menu-option span,
.unclaimed-character-menu-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.unclaimed-character-menu-empty {
  padding: 10px;
}

.role-badge,
.role-chip {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  white-space: nowrap;
}

.role-badge {
  background: var(--success-bg);
  color: var(--accent-strong);
}

.role-badge[data-role="guest"],
.role-chip[data-role="guest"] {
  background: var(--panel-soft);
  color: var(--muted);
}

.role-badge[data-role="member"],
.role-chip[data-role="member"] {
  background: var(--info-bg);
  color: var(--info-text);
}

.role-badge[data-role="administrator"],
.role-chip[data-role="administrator"] {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.action-band,
.page-intro {
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
}

.action-band h3,
.page-intro h3 {
  margin: 0;
  font-size: 1.25rem;
}

.action-band p,
.page-intro p {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 0;
  max-width: 760px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.dashboard-metrics {
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-actions .action-band {
  margin-bottom: 0;
}

.account-panel {
  display: grid;
  gap: 14px;
}

.presence-panel {
  align-content: start;
  display: grid;
}

.presence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.presence-meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.presence-meter span {
  color: var(--muted);
  font-weight: 800;
}

.presence-meter strong {
  font-size: 2rem;
}

.guest-meter {
  background: var(--panel-soft);
}

.member-meter {
  background: var(--info-bg);
}

.metric-card,
.panel {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.eq-frame,
.panel.eq-frame,
.panel.stone-panel {
  background: var(--panel);
  border-color: var(--line);
  box-sizing: border-box;
  overflow: hidden;
}

.eq-panel-button {
  --eq-button-x: clamp(22px, 1.8vw, 34px);
  --eq-button-y: clamp(15px, 1.2vw, 24px);
  background-color: transparent;
  background-image:
    url("assets/eq-panel-button-slices/top-left.png"),
    url("assets/eq-panel-button-slices/top-right.png"),
    url("assets/eq-panel-button-slices/bottom-left.png"),
    url("assets/eq-panel-button-slices/bottom-right.png"),
    url("assets/eq-panel-button-slices/top.png"),
    url("assets/eq-panel-button-slices/bottom.png"),
    url("assets/eq-panel-button-slices/left.png"),
    url("assets/eq-panel-button-slices/right.png"),
    url("assets/eq-panel-button-slices/center.png");
  background-position:
    left top,
    right top,
    left bottom,
    right bottom,
    var(--eq-button-x) top,
    var(--eq-button-x) bottom,
    left var(--eq-button-y),
    right var(--eq-button-y),
    var(--eq-button-x) var(--eq-button-y);
  background-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    repeat-x,
    repeat-x,
    repeat-y,
    repeat-y,
    no-repeat;
  background-size:
    var(--eq-button-x) var(--eq-button-y),
    var(--eq-button-x) var(--eq-button-y),
    var(--eq-button-x) var(--eq-button-y),
    var(--eq-button-x) var(--eq-button-y),
    auto var(--eq-button-y),
    auto var(--eq-button-y),
    var(--eq-button-x) auto,
    var(--eq-button-x) auto,
    calc(100% - (var(--eq-button-x) * 2)) calc(100% - (var(--eq-button-y) * 2));
  border-color: transparent;
  box-shadow: none;
  color: var(--ink);
  min-height: 48px;
  padding: calc(var(--eq-button-y) + 4px) calc(var(--eq-button-x) + 10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.88);
}

button.eq-panel-button,
a.eq-panel-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-align: center;
}

.eq-card,
.metric-card.eq-card {
  background: rgba(9, 14, 17, 0.5);
  border: 1px solid rgba(143, 169, 178, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
}

.dashboard-metrics .metric-card {
  background: rgba(9, 14, 17, 0.28);
  backdrop-filter: none;
  border-color: rgba(143, 169, 178, 0.16);
  box-shadow: none;
  min-height: 74px;
  padding: 8px 4px;
}

.metric-card span,
.panel-heading span,
.roll-result span,
.empty-state span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2.1rem;
}

.dashboard-metrics .metric-card span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-metrics .metric-card strong {
  font-size: 1.85rem;
  margin-top: 4px;
}

.content-grid,
.split-layout,
.auction-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

#dashboardView .content-grid {
  --dashboard-content-width: min(100%, 1440px);
  --dashboard-gap: 0px;
  align-items: stretch;
  gap: var(--dashboard-gap);
  grid-template-areas:
    "guild guild"
    "classes classes"
    "top luck"
    "activity activity";
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-left: auto;
  margin-right: auto;
  max-width: var(--dashboard-content-width);
}

#dashboardView .dashboard-metrics {
  --dashboard-content-width: min(100%, 1440px);
  gap: 0;
  margin: 0 auto 0;
  max-width: var(--dashboard-content-width);
}

#dashboardView .dashboard-metrics .metric-card {
  align-content: center;
  background-color: transparent;
  background-image: url("/dkp/assets/frame-v2.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-color: transparent;
  box-shadow: none;
  display: grid;
  justify-items: center;
  min-height: 112px;
  padding: 34px 44px;
  text-align: center;
}

.auction-layout {
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 0.75fr) minmax(320px, 1fr);
}

.auction-log-panel,
.in-game-auction-panel {
  margin-bottom: 18px;
}

.auction-log-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) minmax(118px, 150px) minmax(78px, 110px);
}

.auction-log-controls .ghost-button {
  font-size: 0.76rem;
  line-height: 1.08;
  min-height: 40px;
  padding: 8px 10px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

.in-game-auction-controls {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(104px, 132px) minmax(138px, 172px);
}

.in-game-auction-controls .compact-button {
  font-size: 0.76rem;
  line-height: 1.08;
  min-height: 40px;
  padding: 9px 12px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

.in-game-choice-toggle {
  align-self: stretch;
  line-height: 1.15;
  max-width: 160px;
  min-height: 40px;
  padding: 8px 10px;
  white-space: normal;
}

.in-game-choice-toggle input {
  flex: 0 0 auto;
}

.in-game-auction-results {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  margin-top: 12px;
}

.in-game-auction-results p {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  margin: 0;
  padding: 10px 12px;
}

.mini-result {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.mini-result span,
.mini-result small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mini-result strong {
  color: var(--text);
}

.auction-order-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.auction-steps-panel {
  margin-bottom: 0;
}

.auction-order-grid .auction-steps-panel {
  padding: 10px 12px;
}

.auction-order-grid .panel-heading {
  gap: 4px;
  margin-bottom: 8px;
}

.auction-order-grid .panel-heading h3 {
  font-size: 1rem;
}

.auction-order-grid .panel-heading span {
  font-size: 0.7rem;
}

.auction-steps-list {
  counter-reset: auction-step;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.auction-steps-list li {
  align-items: start;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  grid-template-columns: 28px 1fr;
  line-height: 1.35;
  padding: 9px;
}

.auction-steps-list li::before {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  content: counter(auction-step);
  counter-increment: auction-step;
  display: inline-flex;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.auction-order-grid .auction-steps-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auction-order-grid .auction-steps-list {
  gap: 5px;
}

.auction-order-grid .auction-steps-list li {
  border-radius: 6px;
  font-size: 0.78rem;
  gap: 5px;
  grid-template-columns: 20px 1fr;
  line-height: 1.18;
  padding: 5px 6px;
}

.auction-order-grid .auction-steps-list li::before {
  font-size: 0.72rem;
  height: 18px;
  width: 18px;
}

#rosterView .split-layout {
  grid-template-columns: minmax(0, 1fr);
}

#accountView > .split-layout {
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 0.9fr) minmax(260px, 1fr);
}

#dashboardView .guild-counts-panel {
  grid-area: guild;
}

#dashboardView .class-mains-panel {
  grid-area: classes;
}

#dashboardView .dashboard-top-dkp-panel {
  grid-area: top;
}

#dashboardView .dashboard-luckiest-panel {
  grid-area: luck;
}

#dashboardView .content-grid .panel:last-child {
  grid-area: activity;
}

.content-grid .class-mains-panel {
  grid-column: 1 / -1;
}

.guild-counts-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 0;
  min-width: 0;
}

.rules-panel {
  max-width: 980px;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.calendar-panel {
  min-height: calc(100vh - 150px);
}

.calendar-embed {
  min-height: 650px;
}

.calendar-embed iframe {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 650px;
  width: 100%;
}

.login-notes {
  margin-top: 0;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.login-actions {
  align-items: start;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  margin-top: 18px;
}

.login-account-column {
  align-items: start;
  display: grid;
  gap: 12px;
  min-width: 0;
}

#loginView .login-actions {
  grid-template-areas:
    "login guide"
    "account guide";
}

#loginView .login-account-column {
  display: contents;
}

#loginView #loginForm {
  grid-area: login;
}

#loginView #guestAccountForm {
  grid-area: account;
}

#loginView .setup-guide {
  align-self: start;
  grid-area: guide;
}

.login-actions .panel {
  padding: 14px;
}

#loginView .login-actions #guestAccountForm,
#loginView .login-actions #loginForm {
  gap: 8px;
  justify-self: start;
  padding: 10px;
  width: min(100%, 420px);
}

#loginView #guestAccountForm .panel-heading,
#loginView #loginForm .panel-heading {
  gap: 8px;
  margin-bottom: 6px;
}

#loginView #guestAccountForm label,
#loginView #loginForm label {
  gap: 3px;
}

#loginView #guestAccountForm input,
#loginView #loginForm input {
  min-height: 36px;
  padding: 8px 10px;
}

#loginView #guestAccountForm button,
#loginView #loginForm button {
  min-height: 36px;
  padding-left: 12px;
  padding-right: 12px;
}

#loginView #loginForm .field-help {
  margin: 2px 0 0;
}

.setup-guide .rules-copy {
  gap: 12px;
}

.setup-guide .account-setup-steps {
  display: grid;
  gap: 5px;
}

.setup-guide .account-setup-step {
  align-items: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 2px 0;
}

.setup-guide .account-setup-step p,
.setup-guide .account-setup-help-note p {
  margin: 0;
}

.setup-guide .account-setup-step-number {
  align-items: center;
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 48%, #7a4a08 100%);
  background-clip: text;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: transparent;
  display: inline-flex;
  font-family: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 900;
  height: 1.5em;
  justify-content: center;
  line-height: 1.5;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 9px rgba(216, 166, 45, 0.24);
  width: 18px;
  -webkit-background-clip: text;
}

.setup-guide .account-setup-help-note {
  background: rgba(4, 9, 12, 0.82);
  border: 1px solid rgba(94, 177, 184, 0.52);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin-top: 14px;
  padding: 12px 14px;
}

.setup-guide .account-setup-help-note strong {
  color: var(--gold);
}

.setup-step {
  display: grid;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr);
}

.setup-step::before {
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 42%, #7a4a08 100%);
  background-clip: text;
  color: transparent;
  content: "\25B6";
  font-family: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.45;
  -webkit-background-clip: text;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42), 0 0 12px rgba(216, 166, 45, 0.28);
}

.account-summary-combo,
.account-character {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.account-character {
  cursor: pointer;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 8px;
  width: 100%;
}

.account-character .avatar-shell {
  justify-self: start;
}

.account-character .dkp-pill {
  justify-self: end;
  white-space: nowrap;
}

.account-summary-combo {
  align-items: stretch;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

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

.account-card div,
.account-character > span:not(.avatar-shell):not(.dkp-pill) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-character > span:not(.avatar-shell):not(.dkp-pill) strong,
.account-character > span:not(.avatar-shell):not(.dkp-pill) small {
  overflow-wrap: anywhere;
}

.account-character-main-select {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.account-character-main-select select {
  min-height: 36px;
  padding: 7px 10px;
}

.account-main-picker {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.account-character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  max-width: 116px;
}

.account-character-actions .ghost-button,
.account-character-actions .danger-button {
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.05;
  min-height: 28px;
  padding: 5px 7px;
  width: 100%;
}

.account-card span,
.account-character small {
  color: var(--muted);
}

.readonly-profile-form > label,
.readonly-profile-form > .avatar-border-field,
.readonly-profile-form .avatar-preview,
.readonly-profile-form > button,
.readonly-profile-form > .field-help {
  display: none;
}

.readonly-profile-form .account-summary-combo {
  grid-template-columns: 1fr;
}

.account-character-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.account-character,
.account-auction,
.account-attendance {
  justify-content: space-between;
}

.account-auctions-panel,
.account-attendance-panel {
  margin-top: 18px;
}

.account-character-panel,
.member-accounts-panel {
  margin-top: 18px;
}

.member-accounts-panel {
  display: flex;
  flex-direction: column;
  max-height: 560px;
}

#guildForm {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
}

#accountView .account-character-panel {
  gap: 9px;
  margin-top: 0;
  overflow: hidden;
  width: 100%;
}

#accountView .account-character-panel > * {
  max-width: 100%;
  min-width: 0;
}

#accountView .account-character-panel .panel-heading {
  align-items: start;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 8px;
  min-width: 0;
}

#accountView .account-character-panel .panel-heading h3 {
  font-size: 1.05rem;
  min-width: 0;
}

#accountView .account-character-panel .panel-heading span {
  font-size: 0.72rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

#accountView .account-character-panel label {
  font-size: 0.78rem;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

#accountView .account-character-panel input,
#accountView .account-character-panel select {
  border-radius: 6px;
  font-size: 0.84rem;
  min-height: 34px;
  max-width: 100%;
  min-width: 0;
  padding: 7px 9px;
  width: 100%;
}

#accountView .account-character-panel .checkbox-line {
  align-items: center;
  display: flex;
  gap: 8px;
}

#accountView .account-character-panel .checkbox-line input {
  min-height: 0;
  width: auto;
}

#accountView .account-character-panel .primary-button,
#accountView .account-character-panel .ghost-button {
  font-size: 0.84rem;
  min-height: 34px;
  padding: 0 10px;
}

#accountView .account-character-panel .field-help {
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.account-auction-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.account-auction {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.account-attendance-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}

.account-attendance {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) minmax(92px, 0.45fr) minmax(92px, 0.45fr) auto;
  min-height: 52px;
  padding: 9px 12px;
}

.account-attendance span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-attendance strong,
.account-attendance small,
.account-attendance span {
  overflow-wrap: anywhere;
}

.account-attendance small {
  color: var(--muted);
}

.account-auction span:first-child {
  display: grid;
  gap: 3px;
}

.account-auction small {
  color: var(--muted);
}

.messages-panel {
  min-height: 420px;
}

.message-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
}

.message-item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.message-header,
.message-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.message-pill-group {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delivery-pill {
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}

.delivery-pill[data-delivery="sent"] {
  background: rgba(50, 185, 112, 0.18);
  border-color: rgba(74, 224, 139, 0.45);
  color: #8dffbd;
}

.delivery-pill[data-delivery="failed"] {
  background: rgba(217, 37, 37, 0.18);
  border-color: rgba(255, 106, 106, 0.55);
  color: #ffb0b0;
}

.message-item p {
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}

.message-thread-label {
  color: var(--gold);
  display: block;
  font-weight: 800;
  margin-top: 4px;
}

.message-board-post p {
  white-space: pre-wrap;
}

.tradeskill-layout {
  align-items: start;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1fr) minmax(320px, 1.15fr);
}

.tradeskill-results-panel,
.tradeskill-preview-panel {
  min-width: 0;
}

.construction-panel {
  align-items: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 18px;
  min-height: 220px;
  text-align: center;
}

.construction-panel strong,
.construction-panel span {
  animation: constructionFlash 1s steps(2, start) infinite;
  color: #ffe66d;
  font-family: var(--title-font);
  text-shadow: 0 0 12px rgba(255, 210, 48, 0.85), 0 2px 0 #3c2100;
}

.construction-panel strong {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.construction-panel span {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

@keyframes constructionFlash {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.tradeskill-result-list {
  display: grid;
  gap: 9px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.tradeskill-result-button {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  width: 100%;
}

.tradeskill-result-button:hover,
.tradeskill-result-button:focus-visible {
  background: var(--panel);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tradeskill-result-button strong {
  color: var(--gold);
  font-family: var(--title-font);
  font-size: 1rem;
}

.tradeskill-result-button span {
  color: var(--muted);
  font-size: 0.82rem;
}

.recipe-combinations {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
}

.recipe-combinations h4 {
  color: var(--gold);
  font-family: var(--title-font);
  font-size: 1rem;
  margin: 0;
}

.recipe-card {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.recipe-card-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.recipe-card-heading strong {
  color: var(--text);
  font-size: 1rem;
}

.recipe-section {
  display: grid;
  gap: 4px;
}

.recipe-section span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recipe-section ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 18px;
}

.recipe-section p {
  margin: 0;
}

.message-item small,
.message-reply small {
  color: var(--muted);
}

.message-reply {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.gallery-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.gallery-upload-panel {
  align-self: start;
  display: grid;
  gap: 8px;
}

.gallery-upload-heading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  justify-content: space-between;
}

.gallery-upload-heading strong {
  color: var(--text);
  font-family: var(--title-font);
  font-size: 1rem;
  font-weight: 700;
}

.gallery-grid {
  column-count: 4;
  column-gap: 12px;
  min-height: 360px;
}

.gallery-upload-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 33%) minmax(90px, 11%);
  justify-content: start;
}

.gallery-upload-row .primary-button {
  min-height: 40px;
  white-space: nowrap;
}

.gallery-upload-combo {
  align-items: center;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 54px;
  padding-block: 7px;
}

.gallery-upload-combo span {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  max-width: 100%;
  opacity: 0.88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-file-input {
  display: none;
}

.gallery-upload-panel .field-help {
  margin: 0;
}

.gallery-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  break-inside: avoid;
  display: inline-block;
  height: fit-content;
  margin: 0 0 12px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.gallery-card[data-status="pending"] {
  border-color: var(--warning-text);
  box-shadow: inset 0 0 0 1px rgba(244, 201, 111, 0.28);
}

.gallery-image-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.gallery-card img,
.gallery-image-button img {
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.gallery-card-caption {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 8px 9px;
}

.gallery-card-title {
  color: #ffffff;
  display: block;
  font-family: var(--title-font);
  font-size: 0.95rem;
  line-height: 1.15;
  min-width: 0;
}

.gallery-card-meta {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
}

.gallery-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.gallery-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
}

.gallery-card-actions .ghost-button,
.gallery-card-actions .danger-button {
  border-radius: 6px;
  font-size: 0.72rem;
  min-height: 26px;
  padding: 4px 8px;
  text-shadow: none;
}

.gallery-card-actions .ghost-button {
  background: var(--input-bg);
  border-color: var(--line);
  color: var(--ink);
}

.gallery-lightbox {
  align-items: center;
  background: rgba(0, 0, 0, 0.86);
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  z-index: 80;
}

.gallery-lightbox:not([hidden]) {
  display: flex;
}

.gallery-lightbox img {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  max-height: 92vh;
  max-width: 92vw;
  object-fit: contain;
}

.gallery-lightbox-close {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.8rem;
  height: 42px;
  justify-content: center;
  line-height: 1;
  position: fixed;
  right: 22px;
  top: 18px;
  width: 42px;
}

.memorial-copy {
  color: var(--ink);
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  max-width: 1100px;
}

.memorial-copy h3 {
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 42%, #7a4a08 100%);
  background-clip: text;
  color: transparent;
  font-family: var(--display-font);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1.02;
  margin: 0;
  -webkit-background-clip: text;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42), 0 0 12px rgba(216, 166, 45, 0.28);
}

.memorial-copy p {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  margin: 0;
  max-width: 1050px;
}

.fallen-add-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.fallen-add-form label {
  max-width: 300px;
  width: min(300px, 100%);
}

.fallen-add-form .primary-button {
  min-height: 40px;
  padding-inline: 18px;
}

.fallen-add-form span {
  color: var(--muted);
  font-size: 0.88rem;
}

.fallen-name-list {
  align-items: start;
  display: grid;
  gap: 8px;
  margin: 10px 0 26px;
}

.fallen-name-link {
  color: var(--ink);
  display: inline-block;
  font-family: var(--display-font);
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  font-weight: 900;
  line-height: 1.08;
  text-decoration: none;
  width: fit-content;
}

.fallen-name-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.fallen-empty {
  color: var(--muted);
  font-size: 1.05rem;
}

.fallen-detail {
  display: grid;
  gap: 14px;
}

.fallen-detail-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fallen-detail-heading h3 {
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 42%, #7a4a08 100%);
  background-clip: text;
  color: transparent;
  font-family: var(--display-font);
  font-size: clamp(1.9rem, 3vw, 3rem);
  font-weight: 900;
  line-height: 1;
  margin: 0;
  -webkit-background-clip: text;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42), 0 0 12px rgba(216, 166, 45, 0.28);
}

.fallen-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.fallen-message-form {
  display: grid;
  gap: 12px;
}

.fallen-message-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 5px;
}

.fallen-message {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.fallen-message div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.fallen-message span {
  color: var(--muted);
  font-size: 0.82rem;
}

.fallen-message-edit,
.fallen-message-save,
.fallen-message-cancel {
  font-size: 0.75rem;
  min-height: 26px;
  padding: 4px 9px;
  width: auto;
}

.fallen-message p {
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}

.fallen-message-editor {
  background: rgba(6, 19, 25, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  min-height: 116px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.fallen-message-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.fallen-image-side {
  min-width: 0;
}

.fallen-image-upload {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.fallen-image-upload .primary-button {
  min-height: 40px;
  padding-inline: 18px;
}

.fallen-image-upload span,
.fallen-image-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.fallen-image-flow {
  column-count: 2;
  column-gap: 12px;
}

.fallen-image-item {
  break-inside: avoid;
  display: inline-block;
  margin: 0 0 12px;
  position: relative;
  width: 100%;
}

.fallen-image-item button[data-action="open-fallen-image"] {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.fallen-image-item img {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.fallen-image-delete {
  font-size: 0.76rem;
  min-height: 28px;
  padding: 5px 9px;
  position: absolute;
  right: 8px;
  top: 8px;
}

.member-account-list {
  display: grid;
  flex: 1;
  gap: 10px;
  max-height: 42vh;
  min-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.account-search-field {
  margin-bottom: 12px;
}

.admin-log-import {
  margin-top: 18px;
}

#adminView.active {
  display: grid;
  gap: 14px;
}

#adminView .page-intro {
  margin-bottom: 0;
}

#adminView .admin-log-import {
  margin-top: 0;
}

#adminView .admin-log-import .panel {
  min-height: 0;
}

#adminView .admin-log-import .form-panel {
  align-content: start;
  display: grid;
  gap: 8px;
}

#adminView .admin-log-import .form-panel label {
  gap: 4px;
}

.admin-control-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  margin-top: 0;
}

.admin-data-grid {
  margin-top: 18px;
}

#adminView .admin-control-grid .panel {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#adminView .admin-control-grid .form-panel {
  gap: 8px;
  padding: 12px;
}

#adminView .admin-control-grid label {
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

#adminView .admin-control-grid input:not([type="checkbox"]),
#adminView .admin-control-grid select {
  font-size: 0.82rem;
  min-height: 36px;
  min-width: 0;
  padding: 8px 9px;
  width: 100%;
}

#adminView .admin-control-grid input[type="checkbox"] {
  height: 16px;
  min-height: 0;
  width: 16px;
}

#adminView .admin-control-grid .button-row {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

#adminView .admin-control-grid .primary-button,
#adminView .admin-control-grid .ghost-button,
#adminView .admin-control-grid .danger-button,
#adminView .admin-control-grid .file-button {
  font-size: 0.74rem;
  line-height: 1.08;
  min-height: 30px;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

#adminView .admin-control-grid .panel-heading {
  gap: 6px;
  min-width: 0;
}

#adminView .admin-control-grid .panel-heading h3,
#adminView .admin-control-grid .panel-heading span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#adminView .admin-control-grid .locked-field,
#adminView .admin-control-grid .field-help {
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#adminView .member-accounts-panel {
  min-height: 0;
}

.compact-admin-actions {
  gap: 6px;
  margin-top: 4px;
}

.compact-admin-actions .ghost-button,
.compact-admin-actions .danger-button,
.compact-admin-actions .file-button {
  font-size: 0.72rem;
  min-height: 28px;
  padding: 0 8px;
}

.member-account-item {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.member-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.member-account-actions .ghost-button,
.member-account-actions .danger-button {
  font-size: 0.78rem;
  min-height: 30px;
  padding: 0 9px;
}

.compact-select-label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 4px;
  min-width: 210px;
}

.member-account-summary {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.member-account-summary .avatar-shell,
.member-account-summary .avatar {
  height: 44px;
  width: 44px;
}

.member-account-summary > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.member-account-summary strong,
.member-account-summary small,
.member-account-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-account-item small,
.member-account-item span {
  color: var(--muted);
}

.account-character .avatar,
.account-character .avatar-shell {
  height: 38px;
  width: 38px;
}

.avatar-preview {
  align-items: center;
  border-right: 1px solid var(--line);
  display: flex;
  gap: 14px;
  padding-right: 14px;
}

.avatar-preview-frame {
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 96px;
  position: relative;
  width: 96px;
}

.avatar-preview-frame .avatar-shell {
  height: 100%;
  width: 100%;
}

.avatar-preview span {
  color: var(--muted);
  font-weight: 800;
}

.avatar-border-field {
  display: grid;
  gap: 8px;
}

.avatar-border-field > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.avatar-border-dropdown {
  position: relative;
}

.avatar-border-dropdown summary {
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
}

.avatar-border-dropdown summary img,
.avatar-border-option img,
.avatar-border-none {
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.avatar-border-none {
  background: var(--panel-soft);
  display: inline-block;
}

.avatar-border-options {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  left: 0;
  margin-top: 6px;
  max-height: 254px;
  min-width: min(100%, 260px);
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  scrollbar-width: thin;
  top: 100%;
  z-index: 20;
}

.avatar-border-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 6px 8px;
  text-align: left;
}

.avatar-border-option:hover,
.avatar-border-option[aria-pressed="true"] {
  background: var(--panel-soft);
}

@media (max-width: 1200px) {
  .account-summary-combo {
    grid-template-columns: 1fr;
  }

  .avatar-preview {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    justify-content: flex-start;
    padding-bottom: 14px;
    padding-right: 0;
  }
}

.rules-copy {
  display: grid;
  gap: 14px;
}

.rules-copy p {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.rules-copy h4 {
  border-top: none;
  font-size: 1.05rem;
  margin: 8px 0 0;
  padding-top: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.auction-item-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.auction-item-row .ghost-button {
  white-space: nowrap;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--input-bg);
}

textarea {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 130px;
  padding: 11px 12px;
  resize: vertical;
  width: 100%;
}

input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}

select:disabled,
input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input:focus {
  outline: 3px solid rgba(47, 111, 115, 0.18);
  border-color: var(--accent);
}

.compact-input {
  max-width: 220px;
}

.compact-select {
  max-width: 92px;
}

.roster-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
  white-space: nowrap;
}

.roster-filter-controls {
  align-items: center;
  display: inline-flex;
  flex: 0 1 420px;
  gap: 8px;
  min-width: 260px;
  white-space: nowrap;
}

.roster-filter-controls .compact-input {
  flex: 1 1 260px;
  min-width: 190px;
}

.roster-filter-controls .compact-select {
  flex: 0 0 82px;
}

.roster-pager-buttons {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .roster-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .roster-filter-controls {
    flex: 1 1 100%;
    min-width: 0;
  }

  .roster-filter-controls .compact-input {
    min-width: 0;
  }
}

.roster-alpha-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: -8px 0 16px;
  min-width: 0;
}

.roster-alpha-filter {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  white-space: nowrap;
}

.roster-alpha-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  min-height: 24px;
  padding: 3px 2px;
}

.roster-alpha-button.active,
.roster-alpha-button:focus,
.roster-alpha-button:hover {
  color: var(--gold);
}

.roster-page-status {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 120px;
  text-align: right;
}

.primary-button,
.ghost-button,
.primary-link,
.ghost-link,
.danger-button,
.text-button {
  border-radius: 8px;
  border: 1px solid transparent;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-link {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button:hover,
.primary-link:hover {
  background: var(--accent-strong);
}

.ghost-button,
.ghost-link {
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--input-bg);
  border-color: var(--line);
  text-decoration: none;
  padding: 0 14px;
  white-space: nowrap;
}

.sidebar-history-button,
.eq-nav-button {
  aspect-ratio: auto;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 150% auto;
  border: 0;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  height: clamp(46px, 5.8vh, 64px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  text-shadow: none;
  width: 100%;
}

#pageBackButton {
  background-image: url("assets/page-back.png");
}

#pageBackButton:hover:not(:disabled),
#pageBackButton:active:not(:disabled) {
  background-image: url("assets/page-back-active.png");
}

#pageForwardButton {
  background-image: url("assets/page-forward.png");
}

#pageForwardButton:hover:not(:disabled),
#pageForwardButton:active:not(:disabled) {
  background-image: url("assets/page-forward-active.png");
}

.sidebar-history-button:disabled,
.eq-nav-button:disabled {
  background-color: transparent;
  border: 0;
  box-shadow: none;
  opacity: 0.4;
  pointer-events: none;
}

.danger-button {
  color: #fff;
  background: var(--rose);
}

.text-button {
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.file-button input,
.drop-zone input {
  display: none;
}

.drop-zone.valid-file {
  border-color: #34d399;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.45);
}

.drop-zone.invalid-file {
  border-color: #fb7185;
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.5);
}

.locked-field {
  background: rgba(5, 10, 14, 0.62);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin: 0;
  padding: 10px 12px;
}

.locked-field strong {
  color: var(--gold);
}

.table-wrap {
  overflow: auto;
}

.roster-panel {
  background: rgba(12, 20, 25, 0.28);
  max-height: none;
  overflow-y: visible;
}

.roster-panel .table-wrap {
  background: transparent;
  max-height: calc(100vh - 285px);
  overflow: auto;
}

table {
  background: transparent;
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.roster-panel thead th {
  background: #000;
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 3;
}

.roster-sort {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  gap: 5px;
  padding: 0;
  text-align: left;
}

.text-link-button,
.dashboard-filter-button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
}

.text-link-button:hover strong,
.text-link-button:focus-visible strong,
.dashboard-filter-button:hover span,
.dashboard-filter-button:focus-visible span {
  color: var(--gold);
}

.dashboard-filter-button {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.class-grid.dashboard-inline-roster-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inline-roster-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
}

.dashboard-inline-roster-list .stack-item {
  width: 100%;
}

.import-name-section {
  display: grid;
  gap: 8px;
}

.import-new-character {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(110px, 1fr) auto minmax(150px, 1fr) auto;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
}

.roster-sort:hover,
.roster-sort:focus-visible,
.roster-sort.active {
  color: var(--gold);
}

.roster-sort::after {
  color: var(--accent);
  content: "";
  font-size: 0.72rem;
}

.roster-sort[data-direction="asc"]::after {
  content: "A-Z";
}

.roster-sort[data-direction="desc"]::after {
  content: "Z-A";
}

.player-name {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.roster-profile-link {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.roster-profile-link strong {
  color: var(--text);
  transition: color 0.16s ease;
}

.roster-profile-link:hover strong,
.roster-profile-link:focus-visible strong {
  color: var(--gold);
}

.roster-profile-link:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.avatar-shell {
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  position: relative;
  width: 34px;
}

.avatar-crop {
  border: 1px solid var(--line);
  border-radius: 50%;
  box-sizing: border-box;
  display: inline-flex;
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.avatar {
  border: 0;
  border-radius: 0;
  flex: 0 0 auto;
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: cover;
  transform-origin: center;
  width: 100%;
}

.avatar-border {
  height: 136%;
  left: 50%;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 136%;
  z-index: 2;
}

.avatar-fallback {
  align-items: center;
  background: var(--panel-soft);
  color: var(--muted);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: center;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dkp-pill,
.class-pill,
.status-pill,
.link-pill {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: 800;
}

.dkp-pill {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.class-pill {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-pill[data-status="active"] {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-pill[data-status="inactive"] {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.account-link-status-pill {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  justify-content: center;
  min-width: 42px;
  padding: 4px 9px;
  white-space: nowrap;
}

.account-link-status-pill[data-linked="yes"] {
  background: var(--success-bg);
  border-color: rgba(93, 201, 137, 0.36);
  color: var(--success-text);
}

.account-link-status-pill[data-linked="no"] {
  background: var(--danger-bg);
  border-color: rgba(218, 93, 116, 0.36);
  color: var(--danger-text);
}

.link-pill {
  background: var(--purple-bg);
  color: var(--purple-text);
}

.luck-pill {
  background: linear-gradient(135deg, #39ff14, #00e5ff, #ff4fd8);
  border-radius: 999px;
  color: #000000 !important;
  text-shadow: none !important;
  font-weight: 900;
  padding: 6px 10px;
}

.item-preview-panel {
  align-self: start;
}

.item-preview {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.45;
  padding: 14px;
}

.item-preview .empty-state {
  grid-column: 1 / -1;
}

.item-preview-icon {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.item-preview-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.item-preview strong {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.15rem;
}

.item-preview a {
  color: var(--accent-strong);
  font-weight: 900;
}

.auction-loot-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auction-loot-results {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.loot-scan-window {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.loot-scan-window small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.loot-scan-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 70px;
}

.loot-scan-actions .text-button {
  justify-content: center;
  min-height: 26px;
  padding: 2px 4px;
  width: 100%;
}

.danger-link {
  color: #ff8a8a;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#auctionForm .button-row .ghost-button,
#auctionForm .button-row .primary-button {
  flex: 1 1 112px;
  line-height: 1.12;
  max-width: 100%;
  min-width: 0;
  padding: 8px 10px;
  text-align: center;
  white-space: normal;
}

#auctionForm .button-row .primary-button {
  flex-basis: 118px;
}

.ghost-button.bid-open-active,
.ghost-button.bid-open-active:disabled {
  background: #39ff14;
  border-color: #20bf00;
  color: #071b03;
  opacity: 1;
}

.ghost-button.bid-closed-active,
.ghost-button.bid-closed-active:disabled {
  background: #d92525;
  border-color: #a91515;
  color: #ffffff;
  opacity: 1;
}

.ghost-button.clear-auction-confirmed,
.ghost-button.clear-auction-confirmed:disabled {
  background: var(--success-text);
  border-color: var(--success-text);
  color: var(--paper);
  opacity: 1;
}

.ghost-button.lock-item-active,
.ghost-button.lock-item-active:disabled {
  background: #39ff14;
  border-color: #20bf00;
  color: #071b03;
  opacity: 1;
}

input.locked-input {
  border-color: #20bf00;
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.18);
  cursor: not-allowed;
}

.icon-button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 8px;
}

.tooltip-button {
  position: relative;
}

.tooltip-button::after {
  background: #111827;
  border-radius: 8px;
  bottom: calc(100% + 10px);
  box-shadow: var(--shadow);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: min(240px, calc(100vw - 28px));
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  width: max-content;
  z-index: 20;
}

.tooltip-button:hover::after,
.tooltip-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.stack-list,
.class-grid,
.activity-feed,
.ticket-ranges,
.history-list,
.log-results {
  display: grid;
  gap: 10px;
}

.number-assignment-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  max-height: calc(100vh - 150px);
  min-height: 560px;
}

.number-assignment-panel .ticket-ranges {
  flex: 1 1 auto;
  margin-top: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.assignment-participant-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  z-index: 4;
}

.mini-panel-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.mini-panel-heading strong {
  color: var(--text);
  font-size: 0.95rem;
}

.mini-panel-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assignment-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 96px;
  overflow-y: auto;
  padding-right: 4px;
}

.assignment-participant-list strong {
  background: var(--info-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--info-text);
  font-size: 0.78rem;
  padding: 5px 8px;
}

.assignment-participant-list small {
  color: var(--muted);
}

.assignment-copy-buttons {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
}

.assignment-copy-buttons small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: 100%;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
}

#topPlayers,
#luckiestWinners {
  overflow-y: auto;
  padding-right: 6px;
}

#topPlayers {
  grid-template-columns: minmax(0, 1fr);
}

#dashboardView .dashboard-top-dkp-panel,
#dashboardView .dashboard-luckiest-panel {
  align-self: stretch;
  width: 100%;
}

#dashboardView .dashboard-top-dkp-panel,
#dashboardView .dashboard-luckiest-panel {
  display: flex;
  flex-direction: column;
}

#dashboardView .dashboard-leaderboard-panel {
    height: 470px;
    overflow: hidden;
    padding: 18px 12px;
}

#dashboardView .dashboard-leaderboard-panel .panel-heading,
#dashboardView .dashboard-leaderboard-panel .field-help {
  flex: 0 0 auto;
}

#dashboardView .dashboard-top-dkp-panel #topPlayers,
#dashboardView .dashboard-luckiest-panel #luckiestWinners {
  flex: 1;
  max-height: calc((64px * 5) + (10px * 4));
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#dashboardView .dashboard-top-dkp-panel #topPlayers {
  margin-top: 10px;
}

#dashboardView .dashboard-luckiest-panel #luckiestWinners {
  margin-top: 12px;
}

#dashboardView .dashboard-luckiest-panel .field-help {
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

#dashboardView .stack-item {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 64px;
    min-width: 0;
    padding: 10px 12px;
}
#dashboardView .class-mains-panel {
  align-self: start;
  width: 100%;
}

#dashboardView .guild-counts-panel,
#dashboardView .class-mains-panel,
#dashboardView .dashboard-top-dkp-panel,
#dashboardView .dashboard-luckiest-panel,
#dashboardView .dashboard-recent-panel {
  background-color: transparent;
  background-image: url("/dkp/assets/frame-v2.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-color: transparent;
  padding: clamp(28px, 2.5vw, 42px) clamp(70px, 5vw, 95px);
}

#dashboardView .guild-counts-panel {
  min-height: 0;
 padding: clamp(24px, 2.2vw, 36px) clamp(64px, 4.6vw, 88px);
}

#dashboardView .guild-counts-panel .panel-heading {
  margin-bottom: 14px;
}

#dashboardView .guild-counts-panel h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.8rem);
}

#dashboardView .guild-counts-panel .panel-heading span {
  font-size: 0.95rem;
}

#dashboardView #guildCounts.class-grid {
    gap: 6px;
    grid-template-columns: repeat(4, 180px);
    justify-content: center;
}

#dashboardView #guildCounts .dashboard-filter-button {
    min-height: 52px;
    padding: 6px 10px;
    font-size: 0.85rem;
}

#dashboardView .dashboard-leaderboard-panel {
    padding-left: clamp(42px, 3vw, 58px);
    padding-right: clamp(42px, 3vw, 58px);
}

#dashboardView .dashboard-recent-panel {
    padding-left: clamp(70px, 5vw, 95px);
    padding-right: clamp(70px, 5vw, 95px);
}


#dashboardView #guildCounts .guild-icon {
    width: 40px;
    height: 40px;
}

#dashboardView .dashboard-filter-button,
#dashboardView .panel .ghost-button:not(.sidebar-history-button),
#dashboardView .panel .ghost-link,
#dashboardView .panel .text-button {
    background-color: transparent;
    background-image: url("assets/button-v2.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;

    border: none;
    box-shadow: none;

    color: #ffffff;
    text-shadow: 0 2px 3px rgba(0,0,0,.85);
}

#dashboardView .dashboard-top-dkp-panel .stack-item,
#dashboardView .dashboard-luckiest-panel .stack-item {
    background: rgba(15, 15, 15, 0.60);
    background-image: none !important;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    box-shadow:
        inset 0 3px 4px rgba(255,255,255,0.08),
        inset 0 -8px 16px rgba(0,0,0,1),
        inset 8px 0 16px rgba(0,0,0,1),
        inset -8px 0 16px rgba(0,0,0,1);
    color: #ffffff;
    margin: 0 0 4px 0;
    width: 100%;
}

#dashboardView .activity-item {
    background: rgba(15, 15, 15, 0.60);
    background-image: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #ffffff;

    box-shadow:
        inset 0 3px 4px rgba(255,255,255,0.08),
        inset 0 -8px 16px rgba(0,0,0,1),
        inset 8px 0 16px rgba(0,0,0,1),
        inset -8px 0 16px rgba(0,0,0,1);

    margin-left: 0;
    margin-right: 0;
    width: 100%;
}


#dashboardView .class-count {
  background: transparent;
  border: 0;
  padding: 0;
}

#dashboardView .class-count .dashboard-filter-button {
  height: 100%;
  min-height: inherit;
  padding: 10px 14px;
}

#dashboardView .activity-item {
  align-content: center;
  min-height: 58px;
  padding: 10px 24px;
}

#dashboardView .stack-item span:first-child,
#dashboardView .stack-item strong,
#dashboardView .stack-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

#dashboardView #classMains.class-grid {
  align-items: stretch;
  gap: 0;
  grid-auto-rows: minmax(64px, 1fr);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#dashboardView #classMains .class-count {
  height: 100%;
  min-height: 64px;
  padding: 0;
}

#dashboardView #topPlayers,
#dashboardView #luckiestWinners,
#dashboardView #activityFeed,
#dashboardView .dashboard-inline-roster-list {
  gap: 0;
}

#dashboardView .dashboard-inline-roster-list .stack-item {
  margin: 0;
}

.inline-roster-pagination {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(88px, auto) 1fr minmax(88px, auto);
  margin-top: 10px;
}

.inline-roster-pagination span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.inline-roster-pagination button {
  min-height: 36px;
}

#dashboardView #classMains .class-count span {
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

#dashboardView #classMains .class-count strong {
  font-size: 1.08rem;
}

.activity-feed {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.class-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#guildCounts.class-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.class-count {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 12px;
}

.class-count span {
  color: var(--muted);
  font-weight: 800;
}

.class-count strong {
  font-size: 1.25rem;
}

.class-count.is-empty {
  opacity: 0.58;
}

.guild-badge {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  min-width: 0;
}

.guild-icon {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.guild-admin-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.guild-admin-item {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
}

.guild-admin-edit {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  text-align: left;
}

.guild-admin-edit .guild-badge {
  max-width: 100%;
}

.guild-admin-edit .guild-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-delete-button {
  min-height: 34px;
  min-width: 42px;
  padding: 6px 8px;
  white-space: nowrap;
}

.guild-admin-edit:hover,
.guild-admin-edit:focus-visible,
.guild-admin-edit[aria-current="true"] {
  background: rgba(244, 201, 111, 0.09);
  border-color: rgba(244, 201, 111, 0.42);
  outline: none;
}

.guild-banner-board {
  min-height: 220px;
}

.guild-banner-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.guild-banner-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 6px;
  text-align: center;
}

.guild-banner-card img {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: contain;
  width: 100%;
}

.guild-banner-card strong {
  background: linear-gradient(180deg, #ffe58a 0%, #d8a62d 42%, #7a4a08 100%);
  background-clip: text;
  color: transparent;
  font-family: var(--display-font);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  -webkit-background-clip: text;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42), 0 0 12px rgba(216, 166, 45, 0.28);
}

.stack-item,
.activity-item,
.range-item,
.history-item,
.log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.activity-item small,
.history-item small,
.log-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.loot-scan-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.loot-scan-item {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 10px;
}

.loot-scan-item strong {
  display: block;
}

.loot-scan-item > span:first-child {
  min-width: 0;
}

.bidder-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.bidder-list legend {
  color: var(--muted);
  font-weight: 800;
  padding: 0 6px;
}

.field-help {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

#bidderChecklist {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.checkbox-line,
.bidder-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
}

.checkbox-line input,
.bidder-option input {
  width: 18px;
  height: 18px;
}

.pinned-bidder {
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.range-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.range-item strong {
  color: var(--accent-strong);
}

.roll-result {
  align-content: start;
  display: grid;
  flex: 0 0 210px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin-top: 0;
  min-height: 0;
  padding: 16px 28px 18px;
  border-radius: 8px;
  background: var(--result-bg);
  color: var(--result-text);
  overflow: hidden;
  position: relative;
}

.roll-result strong {
  display: block;
  align-self: center;
  margin-top: 2px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  overflow-wrap: normal;
  min-width: 0;
}

.roll-result .countdown-number {
  color: #ff4f4f;
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 79, 79, 0.5);
}

.roll-result .rainbow-winner {
  animation: rainbow-shift 2.5s linear infinite;
  background: linear-gradient(90deg, #ff1744, #ff9100, #ffee00, #39ff14, #00e5ff, #7c4dff, #ff4fd8, #ff1744);
  background-size: 300% 100%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 1.02;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
  text-overflow: clip;
  white-space: nowrap;
  z-index: 1;
}

.roll-result .rainbow-winner::before,
.roll-result .rainbow-winner::after {
  animation: confetti-burst 1.4s ease-out infinite;
  background-image:
    radial-gradient(circle at 50% 18%, #ff1744 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #ff1744 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #ff1744 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #ff1744 0 3px, transparent 4px),
    radial-gradient(circle at 50% 18%, #ff9100 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #ff9100 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #ff9100 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #ff9100 0 3px, transparent 4px),
    radial-gradient(circle at 50% 18%, #ffee00 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #ffee00 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #ffee00 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #ffee00 0 3px, transparent 4px),
    radial-gradient(circle at 50% 18%, #39ff14 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #39ff14 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #39ff14 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #39ff14 0 3px, transparent 4px),
    radial-gradient(circle at 50% 18%, #00e5ff 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #00e5ff 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #00e5ff 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #00e5ff 0 3px, transparent 4px),
    radial-gradient(circle at 50% 18%, #7c4dff 0 3px, transparent 4px),
    radial-gradient(circle at 82% 50%, #7c4dff 0 3px, transparent 4px),
    radial-gradient(circle at 50% 82%, #7c4dff 0 3px, transparent 4px),
    radial-gradient(circle at 18% 50%, #7c4dff 0 3px, transparent 4px);
  background-position: 8% 72%, 16% 24%, 24% 58%, 33% 14%, 40% 76%, 48% 32%, 56% 62%, 65% 18%, 73% 74%, 82% 38%, 90% 66%, 96% 22%, 12% 42%, 28% 84%, 45% 8%, 60% 88%, 76% 10%, 88% 52%, 6% 16%, 36% 48%, 52% 20%, 70% 46%, 84% 86%, 98% 72%;
  background-repeat: no-repeat;
  background-size: 16px 16px, 14px 14px, 18px 18px, 15px 15px, 17px 17px, 16px 16px, 14px 14px, 18px 18px, 15px 15px, 17px 17px, 16px 16px, 14px 14px, 18px 18px, 15px 15px, 17px 17px, 16px 16px, 14px 14px, 18px 18px, 15px 15px, 17px 17px, 16px 16px, 14px 14px, 18px 18px, 15px 15px;
  content: "";
  inset: -40px -22px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
  opacity: 0.85;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.roll-result .rainbow-winner::after {
  animation-delay: 0.35s;
  background-position: 6% 18%, 14% 68%, 22% 36%, 31% 88%, 39% 28%, 47% 78%, 55% 12%, 64% 58%, 72% 24%, 81% 82%, 89% 44%, 97% 14%, 10% 86%, 26% 10%, 43% 68%, 58% 38%, 74% 92%, 86% 6%, 4% 52%, 34% 22%, 50% 84%, 68% 8%, 82% 64%, 94% 48%;
}

@keyframes rainbow-shift {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 300% 50%;
  }
}

@keyframes confetti-burst {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(18px);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.25) translateY(-26px);
  }
}

.roll-result p {
  color: var(--result-muted);
  line-height: 1.25;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.history-panel {
  margin-top: 18px;
}

.discord-command-grid {
  display: grid;
  gap: 12px;
}

.discord-results {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.discord-result {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.drop-zone {
  border: 2px dashed #9cb4bd;
  border-radius: 8px;
  padding: 22px;
  background: var(--drop-bg);
  color: var(--ink);
}

.drop-zone span {
  color: var(--muted);
  font-weight: 500;
}

.compact-drop-zone {
  padding: 14px;
}

.danger-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 128px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 20px;
}

@media (max-width: 980px) {
  body::before {
    left: 0;
    background-position-x: center;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 14px;
    height: auto;
    left: auto;
    max-height: none;
    overflow: hidden;
    position: static;
    top: auto;
    width: auto;
  }

  .sidebar-banner {
    height: 100%;
    inset: 0;
    max-height: none;
    width: 100%;
  }

  .mobile-nav-toggle {
    align-items: center;
    background: var(--sidebar-active);
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    color: var(--sidebar-text);
    display: flex;
    font-family: var(--display-font);
    font-weight: 900;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 12px;
    position: relative;
    text-align: left;
    width: 100%;
    z-index: 2;
  }

  .mobile-nav-toggle::after {
    content: "▾";
    font-size: 0.9rem;
    margin-left: 12px;
  }

  .sidebar.mobile-nav-open .mobile-nav-toggle::after {
    content: "▴";
  }

  .nav-list {
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid var(--sidebar-line);
    border-radius: 8px;
    display: none;
    gap: 6px;
    margin: -6px 0 0;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
    position: relative;
    scrollbar-width: thin;
    z-index: 2;
  }

  .sidebar.mobile-nav-open .nav-list {
    display: grid;
  }

  .nav-link {
    min-height: 38px;
    padding: 9px 10px;
    text-align: left;
  }

  .metrics-grid,
  .dashboard-actions,
  .content-grid,
  .split-layout,
  .gallery-layout,
  .fallen-detail-grid,
  .auction-layout {
    grid-template-columns: 1fr;
  }

  .fallen-image-flow {
    column-count: 2;
  }

  #dashboardView .content-grid {
    grid-template-areas:
      "guild"
      "classes"
      "top"
      "luck"
      "activity";
    grid-template-columns: 1fr;
  }

  #dashboardView #classMains.class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardView #guildCounts.class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardView .dashboard-top-dkp-panel,
  #dashboardView .dashboard-luckiest-panel {
    height: 430px;
    max-height: none;
  }

  #dashboardView .dashboard-top-dkp-panel #topPlayers,
  #dashboardView .dashboard-luckiest-panel #luckiestWinners {
    flex: 1;
    max-height: calc((58px * 5) + (10px * 4));
    overflow-y: auto;
  }

  .admin-control-grid {
    grid-template-columns: 1fr;
  }

  .auction-log-controls,
  .in-game-auction-controls,
  .in-game-auction-results {
    grid-template-columns: 1fr;
  }

  .in-game-choice-toggle {
    max-width: none;
  }

  .auction-order-grid,
  .auction-steps-list,
  .auction-order-grid .auction-steps-list {
    grid-template-columns: 1fr;
  }

  #guildCounts.class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .number-assignment-panel {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .gallery-upload-row {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    column-count: 3;
  }

  .number-assignment-panel .ticket-ranges {
    flex: none;
    max-height: 420px;
  }
}

@media (max-width: 680px) {
  body {
    background-attachment: scroll;
  }

  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .main-panel {
    padding-top: 16px;
  }

  .gallery-grid {
    column-count: 1;
  }

  .brand-block {
    grid-template-columns: 46px 1fr;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .sidebar-banner {
    height: 100%;
    inset: 0;
    max-height: none;
    width: 100%;
  }

  .topbar,
  .action-band,
  .page-intro,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 18px;
  }

  .topbar h2 {
    font-size: 1.45rem;
  }

  .topbar-actions,
  .account-menu,
  .account-status {
    width: 100%;
  }

  .account-menu-panel {
    left: 0;
    right: auto;
    width: min(100%, 260px);
  }

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

  #dashboardView .dashboard-metrics {
    gap: 12px;
  }

  .metric-card,
  .panel {
    padding: 0;
  }

  .metric-card strong {
    font-size: 1.55rem;
  }

  #dashboardView .dashboard-top-dkp-panel,
  #dashboardView .dashboard-luckiest-panel {
    height: 390px;
    max-height: none;
  }

  #dashboardView .dashboard-top-dkp-panel #topPlayers,
  #dashboardView .dashboard-luckiest-panel #luckiestWinners {
    max-height: calc((54px * 5) + (10px * 4));
    padding-right: 6px;
  }

  .dashboard-actions,
  .content-grid,
  .split-layout,
  .auction-layout,
  .fallen-detail-grid,
  .login-actions,
  #accountView > .split-layout {
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .fallen-image-flow {
    column-count: 1;
  }

  .login-actions .panel {
    padding: 14px;
  }

  #loginView .login-actions {
    grid-template-areas:
      "login"
      "account"
      "guide";
  }

  .setup-step {
    grid-template-columns: 20px minmax(0, 1fr);
  }

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

  .action-band {
    gap: 14px;
  }

  .primary-link,
  .primary-button,
  .ghost-button,
  .danger-button,
  .file-button {
    min-height: 42px;
    width: 100%;
  }

  .panel-actions,
  .member-account-actions,
  .form-row {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .member-account-actions .ghost-button,
  .member-account-actions .danger-button {
    min-height: 36px;
    width: 100%;
  }

  .member-account-item,
  .account-character,
  .account-auction,
  .account-attendance,
  .history-item,
  .activity-item,
  .range-item {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-character {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .account-summary-combo {
    gap: 10px;
    grid-template-columns: 78px minmax(0, 1fr);
    min-width: 0;
  }

  .account-card {
    min-width: 0;
    width: 100%;
  }

  .account-card div,
  .account-card strong,
  .account-card span,
  .account-card small,
  .account-character > span:not(.avatar-shell):not(.dkp-pill),
  .account-character > span:not(.avatar-shell):not(.dkp-pill) strong,
  .account-character > span:not(.avatar-shell):not(.dkp-pill) small {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
  }

  .account-character {
    column-gap: 10px;
    overflow: hidden;
  }

  .account-character .dkp-pill,
  .account-character-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
  }

  .account-character-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-character-actions .ghost-button,
  .account-character-actions .danger-button {
    width: auto;
  }

  .account-attendance {
    grid-template-columns: 1fr;
  }

  .avatar-preview {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding-bottom: 12px;
    padding-right: 0;
  }

  .avatar-preview-frame {
    height: 76px;
    width: 76px;
  }

  .roster-panel {
    max-height: none;
    overflow: visible;
  }

  .roster-panel .table-wrap,
  .table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    max-height: 62vh;
    overflow: auto;
  }

  table {
    min-width: 920px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .roll-result {
    flex-basis: 170px;
    padding: 22px 18px;
  }

  .roll-result strong {
    font-size: clamp(1.9rem, 9vw, 2.7rem);
  }

  .roll-result .rainbow-winner {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  #bidderChecklist,
  .ticket-ranges,
  .activity-feed,
  .stack-list,
  .account-character-list,
  .account-auction-list,
  .member-account-list,
  .message-list {
    max-height: 340px;
  }

  .calendar-panel {
    min-height: auto;
  }

  .calendar-embed,
  .calendar-embed iframe {
    height: 520px;
    min-height: 520px;
  }
}

@media (max-width: 430px) {
  .main-panel,
  .sidebar {
    padding: 14px;
  }

  .brand-block {
    grid-template-columns: 42px 1fr;
  }

  .brand-mark {
    height: 42px;
    width: 42px;
  }

  .brand-block h1 {
    font-size: 1rem;
  }

  .brand-block p {
    font-size: 0.8rem;
  }

  .account-summary-combo {
    grid-template-columns: 1fr;
  }

  .account-summary-combo .avatar-preview {
    justify-self: start;
  }

  .sidebar-banner {
    height: 100%;
    inset: 0;
    max-height: none;
    width: 100%;
  }

  .nav-link {
    padding: 9px 10px;
  }

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

  #guildCounts.class-grid {
    grid-template-columns: 1fr;
  }

  #dashboardView #classMains.class-grid {
    grid-template-columns: 1fr;
  }

  #dashboardView #guildCounts.class-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    gap: 8px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}
/* Restore standard panels everywhere EXCEPT the Dashboard */
.view.active:not(#dashboardView) .panel,
.view.active:not(#dashboardView) .metric-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

/* EverQuest text colors */

.panel,
.metric-card,
.panel label,
.panel span,
.panel p,
.panel td,
.panel th,
.panel li,
.panel small {
    color: var(--text-primary);
}

/* Stretch Guild Counts buttons to fill the frame */
#dashboardView #guildCounts.class-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  width: 100%;
}

#dashboardView #guildCounts .dashboard-filter-button {
  width: 100%;
  min-height: 52px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

#dashboardView .class-main-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

#dashboardView .class-main-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;

    padding: 5px;

    background:
        linear-gradient(180deg,#5b5b5b 0%,#2e2e2e 55%,#161616 100%);

    border: 1px solid #8d8d8d;
    border-radius: 4px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.18),
        inset 0 -3px 5px rgba(0,0,0,.95),
        0 0 6px rgba(0,0,0,.55);

    object-fit: contain;
    flex-shrink: 0;
}

.character-link-wizard {
  margin: 0 auto;
  max-width: 860px;
}

.character-link-wizard-progress {
  align-items: baseline;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.character-link-wizard-progress strong {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 1.35rem;
}

.character-link-wizard-progress span,
.character-link-wizard-character small,
.character-link-wizard-result span {
  color: var(--muted);
}

.character-link-wizard-results,
.character-link-wizard-family {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 440px;
  overflow-y: auto;
}

.character-link-wizard-result,
.character-link-wizard-character {
  align-items: center;
  background: rgba(8, 17, 22, 0.88);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-primary);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
  width: 100%;
}

.character-link-wizard-result:hover,
.character-link-wizard-result:focus-visible,
.character-link-wizard-character.is-selectable:hover {
  border-color: var(--gold);
}

.character-link-wizard-result span,
.character-link-wizard-character span:first-of-type {
  display: grid;
  gap: 3px;
}

.character-link-wizard-character.is-selectable {
  grid-template-columns: auto minmax(0, 1fr) auto;
  cursor: pointer;
}

.character-link-wizard-character input[type="radio"] {
  margin: 0;
}

.character-link-wizard-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.character-link-wizard-review-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(208, 178, 107, 0.45);
}

.character-link-wizard-review-card legend {
  padding: 0 0.4rem;
  color: var(--gold, #d0b26b);
  font-weight: 700;
}

@media (max-width: 600px) {
  .character-link-wizard-character,
  .character-link-wizard-character.is-selectable {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .character-link-wizard-character .role-pill {
    grid-column: 2;
    justify-self: start;
  }

  .character-link-wizard-actions {
    flex-direction: column;
  }
}

/* Hide the global title area on Hall of Heroes */
body:has(#fallen-comradesView.active) .topbar > div:first-child {
  display: none;
}

body:has(#fallen-comradesView.active) .topbar {
  justify-content: flex-end;
}
