:root {
  color-scheme: dark;
  --bg: #111318;
  --surface: #1b1e25;
  --surface-2: #242832;
  --line: #343947;
  --text: #f3f5f9;
  --muted: #aeb6c8;
  --gold: #f1b84b;
  --gold-2: #ffd66b;
  --green: #32d17b;
  --red: #ff6b6b;
  --shadow: 0 20px 70px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(241, 184, 75, .14), transparent 32rem),
    linear-gradient(180deg, #151820 0%, var(--bg) 48rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(17, 19, 24, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions,
.hero-actions,
.save-group,
.inline-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(241, 184, 75, .55);
  border-radius: 8px;
  background: linear-gradient(145deg, #231b08, #0b0c10);
  color: var(--gold-2);
  font-size: 13px;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.button:disabled {
  cursor: default;
  opacity: .55;
}

.button.primary {
  background: linear-gradient(180deg, #ffcd5c, var(--gold));
  color: #14100a;
  font-weight: 800;
}

.button.secondary {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
}

.button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .12);
  color: var(--muted);
}

.button.danger {
  background: rgba(255, 107, 107, .12);
  border-color: rgba(255, 107, 107, .28);
  color: #ffd8d8;
}

.button.confirming {
  min-width: min(100%, 360px);
  border-color: rgba(255, 107, 107, .72);
  background: rgba(255, 107, 107, .22);
}

.button.large {
  min-height: 50px;
  padding: 0 22px;
}

main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 44px 0 70px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(52px, 9vw, 112px);
  line-height: .9;
}

.hero-text {
  max-width: 720px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-panel,
.panel,
.user-card,
.feature-band article,
.item-row,
.command-card,
.panel-lite {
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(27, 30, 37, .86);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.stat {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.stat strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-2);
  font-size: 22px;
}

.stat span,
.feature-band p,
.empty,
.save-status {
  color: var(--muted);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: -34px 0 54px;
}

.feature-band article,
.panel-lite {
  padding: 22px;
  border-radius: 8px;
}

.feature-band h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.feature-band p {
  margin: 0;
  line-height: 1.55;
}

.dashboard {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0 48px;
}

.mobile-dashboard-bar,
.mobile-sidebar-head,
.mobile-sidebar-backdrop {
  display: none;
}

.mobile-menu-button,
.mobile-menu-close {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  cursor: pointer;
}

.mobile-menu-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  font-weight: 800;
}

.mobile-menu-icon {
  color: var(--gold-2);
  font-size: 20px;
  line-height: 1;
}

.mobile-dashboard-context {
  min-width: 0;
  text-align: right;
}

.mobile-dashboard-context span,
.mobile-dashboard-context strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-dashboard-context span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-dashboard-context strong {
  color: var(--gold-2);
  font-size: 14px;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-2);
  font-weight: 800;
}

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

.user-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.select,
.field input,
.field select,
.field textarea,
.json-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  outline: none;
}

.select,
.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea,
.json-box {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.tabs {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.tab.active,
.tab:hover {
  background: rgba(241, 184, 75, .12);
  border-color: rgba(241, 184, 75, .24);
  color: var(--gold-2);
}

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.content,
.panel,
.item-layout,
.editor-panel,
.item-list,
.field,
.nested-item {
  min-width: 0;
}

.content-head h2 {
  font-size: 32px;
}

.global-search {
  position: relative;
  flex: 1 1 340px;
  max-width: 460px;
}

.global-search input,
.local-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.global-search input:focus,
.local-search input:focus {
  border-color: rgba(241, 184, 75, .55);
}

.search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #151820;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  border-color: rgba(241, 184, 75, .28);
  background: rgba(241, 184, 75, .1);
}

.search-result span,
.search-empty {
  color: var(--muted);
  font-size: 13px;
}

.search-empty {
  padding: 10px;
}

.local-search {
  margin-bottom: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel {
  min-height: 560px;
  padding: 22px;
  border-radius: 8px;
}

.accordion-panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(27, 30, 37, .86);
}

.accordion-panel summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  cursor: pointer;
  list-style-position: inside;
}

.accordion-panel summary strong {
  font-weight: 850;
}

.accordion-panel[open] {
  padding-bottom: 18px;
}

.accordion-panel[open] > summary {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, .025);
}

.accordion-panel > .form-grid,
.accordion-panel > .grid,
.accordion-panel > .stack,
.accordion-panel > .inline-row,
.accordion-panel > .field,
.accordion-panel > .muted {
  margin: 0 18px;
}

.accordion-panel > .inline-row {
  margin-top: 14px;
}

.accordion-panel.nested {
  background: rgba(255, 255, 255, .025);
  box-shadow: none;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 16px;
}

.section-title h3 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-grid article,
.bot-guild-row {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.summary-grid article {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.summary-grid strong {
  display: block;
  min-width: 0;
  color: var(--gold-2);
  font-size: 28px;
  overflow-wrap: anywhere;
}

.summary-grid span,
.bot-guild-row span {
  color: var(--muted);
}

.currency-amount {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: .3em;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.currency-amount span {
  min-width: 0;
  color: inherit;
  overflow-wrap: anywhere;
}

.currency-symbol {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  object-fit: contain;
}

.currency-symbol-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-grid strong .currency-amount,
.summary-grid strong .currency-amount span {
  color: inherit;
}

.bot-guild-list {
  display: grid;
  gap: 10px;
}

.bot-guild-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.card-control-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.card-control-row > div {
  min-width: 0;
}

.card-control-row .button {
  width: auto;
  min-width: 110px;
}

.control-feasibility {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, .035);
}

.control-feasibility strong,
.control-feasibility span {
  overflow-wrap: anywhere;
}

.control-feasibility span {
  color: var(--muted);
  line-height: 1.45;
}

.control-feasibility.possible {
  border-left-color: var(--green);
  background: rgba(50, 209, 123, .07);
}

.control-feasibility.possible strong {
  color: #86efac;
}

.control-feasibility.impossible {
  border-left-color: var(--red);
  background: rgba(255, 107, 107, .09);
}

.control-feasibility.impossible strong {
  color: #fda4af;
}

.control-feasibility.checking,
.control-feasibility.informative {
  border-left-color: var(--gold);
}

.control-feasibility.checking strong,
.control-feasibility.informative strong {
  color: var(--gold-2);
}

.bot-guild-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(241, 184, 75, .12);
  color: var(--gold-2);
  font-weight: 800;
}

.bot-guild-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.bot-guild-row strong,
.bot-guild-row span {
  display: block;
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 14px;
}

.item-layout {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.item-layout.compact {
  grid-template-columns: minmax(200px, 320px) minmax(0, 1fr);
}

.item-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.shop-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.item-row {
  position: relative;
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.item-row.active {
  border-color: rgba(241, 184, 75, .52);
  background: rgba(241, 184, 75, .1);
}

.item-row.delete-selectable {
  padding-left: 46px;
}

.item-row.delete-selectable:hover {
  border-color: rgba(255, 107, 107, .45);
  background: rgba(255, 107, 107, .07);
}

.item-row.delete-selected {
  border-color: rgba(255, 107, 107, .7);
  background:
    linear-gradient(90deg, rgba(255, 107, 107, .18), rgba(255, 107, 107, .06)),
    rgba(27, 30, 37, .94);
  box-shadow: inset 4px 0 0 var(--red), 0 0 0 1px rgba(255, 107, 107, .15);
}

.delete-mark {
  position: absolute;
  left: 14px;
  top: 50%;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 107, 107, .48);
  border-radius: 7px;
  color: #16191f !important;
  background: transparent;
  font-size: 13px !important;
  font-weight: 900;
}

.item-row.delete-selected .delete-mark {
  border-color: transparent;
  background: var(--red);
}

.item-row strong {
  display: inline;
  overflow-wrap: anywhere;
}

.item-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-size: 16px !important;
  font-weight: 800;
}

.emoji-img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
}

.emoji-text {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
}

.editor-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.selection-counter {
  margin: 0;
  border: 1px solid rgba(255, 107, 107, .24);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffd8d8;
  background: rgba(255, 107, 107, .08);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  font-size: 12px;
  font-weight: 700;
}

.checkbox {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.checkbox.compact {
  min-height: 30px;
}

.option-list {
  display: grid;
  gap: 6px;
  align-content: start;
}

.picker {
  position: relative;
}

.picker-control {
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11141b;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.picker-control:hover,
.picker-control:focus {
  border-color: rgba(241, 184, 75, .55);
  outline: none;
}

.picker-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  max-height: 360px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #151820;
  box-shadow: var(--shadow);
}

.picker-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10131a;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.picker-search:focus {
  border-color: rgba(241, 184, 75, .55);
}

.picker-options {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.picker-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.picker-option:hover,
.picker-option.selected {
  border-color: rgba(241, 184, 75, .25);
  background: rgba(241, 184, 75, .1);
}

.picker-option.muted-option {
  color: var(--muted);
}

.picker-note {
  margin: 4px 2px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  contain: content;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: #171a22;
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.command-card {
  border-radius: 8px;
  padding: 16px;
}

.command-card strong {
  display: block;
  margin: 10px 0;
  color: var(--gold-2);
}

.command-card .variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.json-box {
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.nested-item {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.nested-item.compact-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.game-section {
  padding: 0;
  overflow: hidden;
}

.game-toggle,
.sub-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  padding: 0 18px;
  cursor: pointer;
  text-align: left;
}

.game-toggle span:first-child,
.sub-toggle span:first-child {
  font-weight: 850;
}

.game-toggle:hover,
.sub-toggle:hover {
  background: rgba(241, 184, 75, .1);
}

.collapsible {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.payout-group {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, .12);
}

.payout-group .collapsible {
  padding: 14px;
}

.slot-symbol-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.context-menu {
  position: fixed;
  z-index: 90;
  display: grid;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: #171a22;
  box-shadow: var(--shadow);
  padding: 6px;
}

.context-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
  text-align: left;
}

.context-menu button:hover {
  background: rgba(241, 184, 75, .12);
  color: var(--gold-2);
}

.slot-symbol-title .emoji-img {
  width: 28px;
  height: 28px;
}

.slot-symbol-title strong {
  overflow-wrap: anywhere;
}

.subheading {
  margin-top: 10px;
  color: var(--gold-2);
}

.audit-filters {
  margin: 18px 0;
}

.audit-entry {
  overflow: hidden;
}

.audit-entry .section-title {
  align-items: flex-start;
}

.audit-entry .section-title p {
  margin: 5px 0 0;
}

.audit-changes {
  display: grid;
  gap: 8px;
}

.audit-change {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-left: 3px solid rgba(241, 184, 75, .45);
  border-radius: 4px;
  background: rgba(255, 255, 255, .025);
  padding: 10px 12px;
}

.audit-change code,
.audit-entry code {
  overflow-wrap: anywhere;
  color: var(--gold-2);
}

.audit-change > div,
.audit-investment-values {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.audit-before,
.audit-after {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-before {
  color: #fda4af;
}

.audit-after,
.audit-up {
  color: #6ee7b7;
}

.audit-down {
  color: #fda4af;
}

.audit-arrow {
  flex: 0 0 auto;
  color: var(--muted);
}

.audit-investment-values {
  margin: 12px 0 8px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

[aria-invalid="true"] {
  border-color: var(--red) !important;
}

@media (max-width: 920px) {
  .hero,
  .feature-band,
  .item-layout,
  .grid,
  .grid.three,
  .command-grid {
    grid-template-columns: 1fr;
  }

  main {
    width: min(100% - 28px, 760px);
  }

  .dashboard {
    display: block;
    padding-top: 14px;
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .mobile-dashboard-bar {
    position: sticky;
    top: 82px;
    z-index: 18;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(21, 24, 32, .94);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .24);
    backdrop-filter: blur(14px);
  }

  .mobile-dashboard-context {
    flex: 1;
  }

  .sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    background: #13161d;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .45);
    transition: transform .2s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-sidebar-head {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .mobile-sidebar-head strong {
    color: var(--gold-2);
    font-size: 18px;
  }

  .mobile-menu-close {
    width: 44px;
    min-height: 44px;
    font-size: 26px;
    line-height: 1;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    z-index: 65;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, .66);
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .tabs {
    gap: 8px;
  }

  .tab,
  .select,
  .field input,
  .field select,
  .picker-control,
  .global-search input,
  .local-search input,
  .picker-search,
  .picker-option,
  .context-menu button,
  .button {
    min-height: 44px;
  }

  .content {
    width: 100%;
  }

  .content-head {
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(220px, 1fr);
    align-items: end;
  }

  .content-head h2 {
    font-size: clamp(25px, 5vw, 32px);
  }

  .global-search {
    width: 100%;
    max-width: none;
  }

  .save-group {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px max(14px, calc((100vw - 760px) / 2)) calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(17, 19, 24, .96);
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .35);
    backdrop-filter: blur(16px);
  }

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

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

  .panel,
  .panel-lite {
    padding: 18px;
  }

  .section-title,
  .inline-row {
    flex-wrap: wrap;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100dvh - 28px);
    overscroll-behavior: contain;
  }

  .picker-menu {
    max-height: min(50dvh, 360px);
  }

  .top-actions,
  .hero-actions {
    flex-wrap: wrap;
  }

  .bot-guild-row,
  .card-control-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .bot-guild-row > .button,
  .card-control-row > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .nested-item.compact-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
    font-size: 17px;
  }

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

  .top-actions {
    justify-content: flex-end;
    gap: 7px;
  }

  .top-actions .button {
    min-height: 40px;
    padding: 0 11px;
    font-size: 13px;
  }

  #inviteButton {
    display: none;
  }

  main {
    width: calc(100% - 20px);
  }

  .hero {
    min-height: auto;
    padding: 34px 0 60px;
  }

  h1 {
    font-size: clamp(52px, 21vw, 82px);
  }

  .hero-text {
    font-size: 17px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
  }

  .feature-band {
    margin-top: 0;
  }

  .mobile-dashboard-bar {
    top: 65px;
  }

  .content-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .content-head > div:first-child {
    display: none;
  }

  .panel,
  .panel-lite,
  .collapsible {
    padding: 14px;
  }

  .panel {
    min-height: 420px;
  }

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

  .section-title {
    align-items: stretch;
  }

  .section-title > .button,
  .section-title > .inline-row,
  .section-title > .inline-row .button {
    width: 100%;
  }

  .section-title > .inline-row {
    display: grid;
  }

  .save-group {
    grid-template-columns: 1fr 1fr;
    padding-right: 10px;
    padding-left: 10px;
  }

  .save-status {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 12px;
  }

  .save-group .button {
    width: 100%;
    padding: 0 10px;
  }

  .modal-backdrop {
    place-items: stretch;
    padding: 0;
  }

  .modal-panel {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 14px calc(90px + env(safe-area-inset-bottom));
  }

  .picker-menu {
    position: fixed;
    z-index: 95;
    top: auto;
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 8px;
    max-height: min(62dvh, 480px);
  }

  .search-results {
    position: fixed;
    z-index: 55;
    top: 126px;
    right: 10px;
    left: 10px;
    max-height: calc(100dvh - 220px);
  }

  .accordion-panel > .form-grid,
  .accordion-panel > .grid,
  .accordion-panel > .stack,
  .accordion-panel > .inline-row,
  .accordion-panel > .field,
  .accordion-panel > .muted {
    margin-right: 12px;
    margin-left: 12px;
  }
}
