.dm-layout {
  display: grid;
  gap: 14px;
}

.dm-hub {
  display: grid;
  gap: 16px;
}

.dm-nav {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dm-nav__intro h3 {
  margin: 0;
  font-size: 1.35rem;
}

.dm-nav__intro .hint {
  margin-top: 8px;
}

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

.dm-stat-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(232, 210, 173, 0.12);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 4px;
}

.dm-stat-card span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dm-stat-card strong {
  font-size: 1.3rem;
  line-height: 1;
}

.dm-nav__buttons {
  display: grid;
  gap: 8px;
}

.dm-nav__button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 210, 173, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
}

.dm-nav__button.is-active {
  border-color: rgba(184, 138, 82, 0.32);
  background: linear-gradient(180deg, rgba(184, 138, 82, 0.2), rgba(184, 138, 82, 0.08));
  box-shadow: inset 0 0 0 1px rgba(184, 138, 82, 0.08);
}

.dm-stage {
  display: grid;
}

.dm-panel {
  display: none;
}

.dm-panel.is-active {
  display: block;
  animation: rise 0.25s ease;
}

.admin-section h3 {
  margin-bottom: 10px;
}

.admin-form {
  display: grid;
  gap: 10px;
}

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

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

.field-grid__wide {
  grid-column: 1 / -1;
}

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

.admin-item {
  padding: 12px;
  border: 1px solid rgba(232, 210, 173, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-item__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.admin-item__top strong {
  display: block;
}

.admin-item__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tiny-btn {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(232, 210, 173, 0.14);
  font-size: 0.76rem;
}

.tiny-btn--danger {
  border-color: rgba(240, 125, 125, 0.26);
  color: #f0b0b0;
}

.tiny-btn--accent {
  border-color: rgba(184, 138, 82, 0.28);
  background: rgba(184, 138, 82, 0.1);
}

.admin-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-empty--compact {
  margin-bottom: 12px;
}

.request-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  background:
    radial-gradient(circle at top right, rgba(184, 138, 82, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%),
    var(--panel);
}

.request-panel--pending {
  border-color: rgba(136, 168, 183, 0.26);
  box-shadow: 0 12px 30px rgba(14, 19, 30, 0.32);
}

.request-panel h3 {
  margin: 0;
}

.request-panel__text {
  margin: 0;
  color: var(--muted);
}

.request-form {
  gap: 12px;
}

.request-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.request-summary span,
.admin-request-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 210, 173, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.78rem;
}

.admin-item--request {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(255, 255, 255, 0.025);
}

.admin-request-badge {
  color: var(--accent);
  border-color: rgba(184, 138, 82, 0.26);
  background: rgba(184, 138, 82, 0.08);
  white-space: nowrap;
}

.admin-request__lead {
  margin: 0;
}

html.dm-desktop-mode .workspace,
body.dm-desktop-mode .workspace,
.dm-desktop-mode .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(560px, 760px);
  gap: 22px;
  align-items: start;
}

html.dm-desktop-mode .workspace > .screen,
body.dm-desktop-mode .workspace > .screen,
.dm-desktop-mode .workspace > .screen {
  display: block !important;
  margin: 0;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent), rgba(14, 14, 18, 0.96);
  border: 1px solid rgba(232, 210, 173, 0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}

html.dm-desktop-mode .workspace > .screen:not([data-view="dm"]),
body.dm-desktop-mode .workspace > .screen:not([data-view="dm"]),
.dm-desktop-mode .workspace > .screen:not([data-view="dm"]) {
  grid-column: 1;
}

html.dm-desktop-mode[data-active-view="lore"] .workspace,
body.dm-desktop-mode[data-active-view="lore"] .workspace,
.dm-desktop-mode[data-active-view="lore"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

html.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="dm"],
body.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="dm"],
.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="dm"] {
  display: none !important;
}

html.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="lore"],
body.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="lore"],
.dm-desktop-mode[data-active-view="lore"] .workspace > .screen[data-view="lore"] {
  grid-column: 1 / -1;
}

html.dm-desktop-mode[data-active-view="dm"] .workspace,
body.dm-desktop-mode[data-active-view="dm"] .workspace,
.dm-desktop-mode[data-active-view="dm"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

html.dm-desktop-mode[data-active-view="dm"] .workspace > .screen:not([data-view="dm"]),
body.dm-desktop-mode[data-active-view="dm"] .workspace > .screen:not([data-view="dm"]),
.dm-desktop-mode[data-active-view="dm"] .workspace > .screen:not([data-view="dm"]) {
  display: none !important;
}

html.dm-desktop-mode[data-active-view="dm"] .workspace > .screen[data-view="dm"],
body.dm-desktop-mode[data-active-view="dm"] .workspace > .screen[data-view="dm"],
.dm-desktop-mode[data-active-view="dm"] .workspace > .screen[data-view="dm"] {
  grid-column: 1 / -1;
  position: relative;
  top: auto;
  max-height: none;
}

html.dm-desktop-mode .workspace > .screen[data-view="dm"],
body.dm-desktop-mode .workspace > .screen[data-view="dm"],
.dm-desktop-mode .workspace > .screen[data-view="dm"] {
  grid-column: 2;
  grid-row: 1 / span 20;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding-bottom: 18px;
}

html.dm-desktop-mode .workspace > .screen.is-active,
body.dm-desktop-mode .workspace > .screen.is-active,
.dm-desktop-mode .workspace > .screen.is-active {
  outline: 1px solid rgba(184, 138, 82, 0.22);
  box-shadow:
    0 0 0 1px rgba(184, 138, 82, 0.08),
    0 18px 34px rgba(0, 0, 0, 0.26);
}

html.dm-desktop-mode .screen,
body.dm-desktop-mode .screen,
.dm-desktop-mode .screen {
  min-width: 0;
}

html.dm-desktop-mode .screen[data-view="dm"] .screen__badge,
body.dm-desktop-mode .screen[data-view="dm"] .screen__badge,
.dm-desktop-mode .screen[data-view="dm"] .screen__badge {
  white-space: nowrap;
}

html.dm-desktop-mode .bottom-nav,
body.dm-desktop-mode .bottom-nav,
.dm-desktop-mode .bottom-nav {
  display: none;
}

html.dm-desktop-mode .nav-item.dm-only,
body.dm-desktop-mode .nav-item.dm-only,
.dm-desktop-mode .nav-item.dm-only {
  display: none !important;
}

@media (min-width: 900px) {
  html.dm-desktop-mode body,
  body.dm-desktop-mode {
    display: block;
    padding: 18px;
  }

  html.dm-desktop-mode .app-shell,
  body.dm-desktop-mode .app-shell,
  .dm-desktop-mode .app-shell {
    width: min(100%, 1520px);
    min-height: calc(100vh - 36px);
    margin: 0 auto;
    border-radius: 36px;
  }

  html.dm-desktop-mode .hero,
  body.dm-desktop-mode .hero,
  .dm-desktop-mode .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 28px;
    align-items: end;
    padding: 32px 30px 24px;
  }

  html.dm-desktop-mode .hero .eyebrow,
  body.dm-desktop-mode .hero .eyebrow,
  .dm-desktop-mode .hero .eyebrow,
  html.dm-desktop-mode .hero h1,
  body.dm-desktop-mode .hero h1,
  .dm-desktop-mode .hero h1,
  html.dm-desktop-mode .hero .hero__lead,
  body.dm-desktop-mode .hero .hero__lead,
  .dm-desktop-mode .hero .hero__lead {
    grid-column: 1;
  }

  html.dm-desktop-mode .hero h1,
  body.dm-desktop-mode .hero h1,
  .dm-desktop-mode .hero h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    max-width: 9ch;
  }

  html.dm-desktop-mode .hero .hero__lead,
  body.dm-desktop-mode .hero .hero__lead,
  .dm-desktop-mode .hero .hero__lead {
    max-width: 44ch;
    font-size: 1.02rem;
  }

  html.dm-desktop-mode .hero__userbar,
  body.dm-desktop-mode .hero__userbar,
  .dm-desktop-mode .hero__userbar {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    min-width: 240px;
    margin-top: 0;
    padding: 14px 16px;
    border: 1px solid rgba(232, 210, 173, 0.12);
    border-radius: 24px;
    background: rgba(12, 11, 16, 0.34);
    backdrop-filter: blur(10px);
  }

  html.dm-desktop-mode .workspace,
  body.dm-desktop-mode .workspace,
  .dm-desktop-mode .workspace {
    padding: 24px 26px 30px;
  }

  .journal-update-toast {
    right: 26px;
    bottom: 26px;
  }

  html.dm-desktop-mode .screen__head h2,
  body.dm-desktop-mode .screen__head h2,
  .dm-desktop-mode .screen__head h2 {
    font-size: 1.8rem;
  }

  html.dm-desktop-mode .cards-grid,
  body.dm-desktop-mode .cards-grid,
  .dm-desktop-mode .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  html.dm-desktop-mode .dm-layout,
  body.dm-desktop-mode .dm-layout,
  .dm-desktop-mode .dm-layout {
    gap: 18px;
  }

  html.dm-desktop-mode .lore-panel,
  body.dm-desktop-mode .lore-panel,
  .dm-desktop-mode .lore-panel {
    gap: 18px;
  }

  html.dm-desktop-mode .lore-search,
  body.dm-desktop-mode .lore-search,
  .dm-desktop-mode .lore-search {
    max-width: 420px;
  }

  html.dm-desktop-mode .admin-section,
  body.dm-desktop-mode .admin-section,
  .dm-desktop-mode .admin-section {
    padding: 20px;
  }

  html.dm-desktop-mode .dm-hub,
  body.dm-desktop-mode .dm-hub,
  .dm-desktop-mode .dm-hub {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }

  html.dm-desktop-mode .dm-nav,
  body.dm-desktop-mode .dm-nav,
  .dm-desktop-mode .dm-nav {
    position: sticky;
    top: 0;
  }
}

@media (max-width: 899px) {
  .dm-nav__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid--stats {
    grid-template-columns: 1fr;
  }
}
