:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #60706b;
  --line: #d9ded6;
  --paper: #f8f7f1;
  --panel: #ffffff;
  --nav: #12312c;
  --nav-soft: #1d493f;
  --gold: #c9912d;
  --rose: #c65a6b;
  --teal: #167f7b;
  --green: #5b8c54;
  --blue: #356f9f;
  --shadow: 0 18px 50px rgba(25, 35, 32, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  color: #f7fbf8;
  background:
    linear-gradient(160deg, rgba(255,255,255,.07), transparent 42%),
    var(--nav);
}

.brand {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 8px;
  background: #f2cf67;
  color: #17332e;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.15rem;
}

.brand small {
  margin-top: 2px;
  color: rgba(247,251,248,.7);
}

.main-nav {
  display: grid;
  gap: 6px;
}

.main-nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(247,251,248,.78);
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--nav-soft);
  color: #ffffff;
}

.policy-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.policy-panel h2 {
  margin: 0 0 8px;
  font-size: .95rem;
}

.policy-panel p {
  margin: 0;
  color: rgba(247,251,248,.76);
  font-size: .9rem;
  line-height: 1.5;
}

.workspace {
  display: grid;
  gap: 22px;
  align-content: start;
  padding: 28px;
}

.topbar,
.section-heading,
.feature-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1,
.section-heading h2,
.feature-band h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 3.8vw, 4rem);
  line-height: 1;
}

.section-heading h2,
.feature-band h2 {
  font-size: 1.2rem;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-heading.compact {
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.coin-count,
.user-pill,
.status-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
}

.coin-count {
  background: #fff2cc;
  color: #6e4810;
}

.user-pill,
.status-pill {
  background: #e8f3ef;
  color: #184b42;
}

.dashboard-grid,
.communication-grid,
.admin-panel {
  display: contents;
}

.app-page {
  display: none;
}

.app-page.active-page {
  display: grid;
  gap: 18px;
}

.world-panel,
.avatar-panel,
.chat-panel,
.admin-tab-panel,
.newest-panel,
.shop-panel,
.forum-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.world-panel,
.avatar-panel,
.chat-panel,
.admin-tab-panel,
.newest-panel,
.shop-panel,
.forum-panel {
  padding: 18px;
}

.admin-overview-heading,
.admin-tabs {
  display: none;
}

.map-stage {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #cfd8cd;
  border-radius: 8px;
  background: #d9f0ed;
}

.newest-grid,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.newest-item,
.shop-item,
.shop-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #e3e7e1;
  border-radius: 8px;
  padding: 9px;
  background: #fbfcf9;
}

.shop-card {
  grid-template-columns: 1fr;
  align-items: start;
}

.shop-card-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.shop-card p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.shop-card-items {
  display: grid;
  gap: 6px;
}

.shop-card-item,
.shop-card-empty {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: .76rem;
}

.shop-card-empty {
  grid-template-columns: 1fr;
}

.shop-card-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border: 1px solid #edf0eb;
  border-radius: 5px;
  background: #fff;
}

.shop-card-item span,
.shop-card-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card-item em {
  grid-column: 2;
  color: #6e4810;
  font-style: normal;
  font-weight: 800;
}

.newest-thumb,
.shop-thumb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0eb;
  border-radius: 6px;
  background: #ffffff;
}

.newest-thumb img,
.shop-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.newest-copy,
.shop-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shop-price {
  color: #6e4810;
  font-size: .78rem;
  font-weight: 900;
}

.newest-copy strong,
.newest-copy span,
.newest-copy time,
.shop-copy strong,
.shop-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.newest-copy strong,
.shop-copy strong {
  color: var(--ink);
  font-size: .84rem;
}

.newest-copy span,
.newest-copy time,
.shop-copy span {
  color: var(--muted);
  font-size: .73rem;
}

.map-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-node {
  cursor: pointer;
}

.map-node.unlocked {
  cursor: move;
}

.map-node circle {
  fill: #fff9e8;
  stroke: #163c35;
  stroke-width: 5;
  transition: transform .18s ease, fill .18s ease;
  transform-origin: center;
}

.map-node text {
  fill: #17332e;
  font-size: 19px;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
}

.map-node:hover circle,
.map-node:focus-visible circle,
.map-node.active circle {
  fill: #f4c95d;
  transform: scale(1.08);
}

.map-node.locked circle {
  stroke-dasharray: 0;
}

.map-node.unlocked circle {
  stroke-dasharray: 8 5;
}

.world-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, .65fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.world-map-settings {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.world-area-list {
  display: grid;
  gap: 10px;
}

.world-area-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.world-area-row strong {
  color: var(--ink);
}

.world-area-row span,
.world-area-row em {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.avatar-stage {
  display: grid;
  min-height: 300px;
  margin-top: 10px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f0f8f6 0 48%, #dfecdf 48% 100%);
  border: 1px solid #d8e2dc;
}

.avatar-body {
  position: relative;
  width: 142px;
  height: 245px;
}

.avatar-body::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 34px;
  width: 68px;
  height: 76px;
  border-radius: 42% 42% 48% 48%;
  background: #d99f73;
  z-index: 4;
}

.avatar-hair {
  position: absolute;
  left: 25px;
  top: 14px;
  width: 92px;
  height: 88px;
  border-radius: 48% 48% 35% 35%;
  background: #6f4fa2;
  z-index: 5;
}

.avatar-hair::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 46px;
  width: 78px;
  height: 74px;
  border-radius: 18px 18px 48px 48px;
  background: inherit;
  z-index: -1;
}

.avatar-face {
  position: absolute;
  left: 54px;
  top: 66px;
  display: flex;
  gap: 20px;
  z-index: 6;
}

.avatar-face span {
  width: 7px;
  height: 10px;
  border-radius: 999px;
  background: #17211f;
}

.avatar-torso {
  position: absolute;
  left: 29px;
  top: 111px;
  width: 86px;
  height: 98px;
  border-radius: 25px 25px 18px 18px;
  background: #275d84;
  z-index: 3;
}

.avatar-torso::before,
.avatar-torso::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 25px;
  height: 84px;
  border-radius: 999px;
  background: #d99f73;
  z-index: -1;
}

.avatar-torso::before {
  left: -20px;
  transform: rotate(8deg);
}

.avatar-torso::after {
  right: -20px;
  transform: rotate(-8deg);
}

.avatar-cape {
  position: absolute;
  left: 18px;
  top: 111px;
  width: 107px;
  height: 112px;
  border-radius: 28px 28px 16px 16px;
  background: #693f7d;
  z-index: 1;
}

.avatar-boots {
  position: absolute;
  left: 41px;
  top: 205px;
  width: 60px;
  height: 34px;
  border-radius: 0 0 16px 16px;
  background: #2f2f36;
  z-index: 4;
}

.avatar-controls,
.filters {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.avatar-controls {
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.avatar-editor-panel {
  align-self: start;
}

.editor-status {
  margin-top: 14px;
  border: 1px solid #d7dfd8;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f6faf7;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.editor-preview-wrap {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.base-reference {
  display: grid;
  width: 210px;
  gap: 10px;
  justify-self: start;
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcf9;
}

.base-reference .control-row {
  grid-template-columns: 1fr;
}

.base-reference .base-visibility-actions {
  grid-template-columns: 1fr;
}

.mini-heading {
  display: grid;
  gap: 3px;
}

.mini-heading strong {
  font-size: .92rem;
}

.mini-heading span {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.avatar-canvas {
  position: relative;
  width: 150px;
  height: 300px;
  overflow: hidden;
  border: 1px solid #879a90;
  border-radius: 4px;
  background: #f9fbf8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  touch-action: none;
}

.canvas-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(23,33,31,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,33,31,.08) 1px, transparent 1px);
  background-size: 10px 10px;
  pointer-events: none;
}

.avatar-layer {
  position: absolute;
  max-width: none;
  user-select: none;
  cursor: grab;
}

.avatar-layer:active {
  cursor: grabbing;
}

.outfit-layer {
  cursor: move;
}

.avatar-layer.selected {
  outline: 1px dashed var(--rose);
  outline-offset: 2px;
}

.empty-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}

.empty-canvas strong,
.empty-canvas span {
  display: block;
}

.canvas-help {
  max-width: 180px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
  text-align: center;
}

.canvas-layer-label {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 12;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-size: .68rem;
  font-weight: 900;
  pointer-events: none;
}

.control-row,
.coordinate-grid,
.action-row,
.stat-grid {
  display: grid;
  gap: 10px;
}

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

.item-settings-panel,
.base-fit-panel,
.shop-creator,
.shop-editor,
.placement-editor,
.stat-editor,
.stat-total-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcf9;
}

.checkbox-field {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.checkbox-field input {
  width: auto;
  min-height: 0;
}

.compatible-base-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compatible-base-list span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef5f2;
  color: #24564d;
  font-size: .7rem;
  font-weight: 900;
}

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

.stat-total {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  padding: 8px;
  background: #eef5f2;
}

.stat-total strong {
  color: var(--ink);
  font-size: .95rem;
}

.stat-total span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.action-row {
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
}

.item-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e3e7e1;
  padding-top: 12px;
}

.asset-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border-top: 1px solid #e3e7e1;
  padding-top: 12px;
}

.selected-settings-column,
.item-browser-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.selected-settings-column {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding-right: 4px;
}

.item-browser-column {
  grid-column: 2;
  grid-row: 1;
}

.item-browser-header strong {
  font-size: .9rem;
}

.item-browser-header span {
  max-width: 52%;
  overflow: hidden;
  color: var(--muted);
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-browser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

.item-tile {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 174px;
  border: 1px solid #d9e1dc;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.item-tile:hover,
.item-tile.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 127, 123, .13);
}

.item-tile.selected {
  position: relative;
  background: #eef9f6;
  border-color: #167f7b;
  box-shadow: 0 0 0 3px rgba(22, 127, 123, .18), 0 10px 22px rgba(39, 69, 67, .12);
}

.item-tile.selected::after {
  content: "Selected";
  position: absolute;
  top: 7px;
  right: 7px;
  border-radius: 999px;
  padding: 3px 6px;
  background: #167f7b;
  color: #ffffff;
  font-size: .64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.thumb-box {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0eb;
  border-radius: 6px;
  background:
    linear-gradient(45deg, #f4f6f2 25%, transparent 25% 75%, #f4f6f2 75%),
    linear-gradient(45deg, #f4f6f2 25%, transparent 25% 75%, #f4f6f2 75%);
  background-color: #ffffff;
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

.thumb-box img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tile-name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 32px;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.tile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tile-chips em {
  border-radius: 999px;
  padding: 3px 6px;
  background: #eef5f2;
  color: #24564d;
  font-size: .64rem;
  font-style: normal;
  font-weight: 900;
}

.empty-browser,
.browser-overflow {
  border: 1px dashed #cfd8d3;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf9;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
}

.empty-browser {
  grid-column: 1 / -1;
  text-align: center;
}

.empty-browser strong,
.empty-browser span {
  display: block;
}

.browser-overflow {
  grid-column: 1 / -1;
}

.pagination-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(78px, 100px) auto auto;
  gap: 10px;
  align-items: center;
}

.pagination-row span {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
  text-align: center;
}

.page-jump {
  gap: 3px;
}

.page-jump input {
  min-height: 36px;
  padding: 6px 8px;
}

.outfit-user-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid #e3e7e1;
  padding-top: 12px;
}

.outfit-preview-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.outfit-canvas {
  width: 150px;
  height: 300px;
}

.outfit-actions {
  display: grid;
  gap: 8px;
}

.inventory-list,
.equipped-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.inventory-row,
.equipped-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  padding: 7px;
  background: #ffffff;
}

.inventory-thumb,
.equipped-thumb {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0eb;
  border-radius: 6px;
  background: #f7f9f6;
}

.inventory-thumb img,
.equipped-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.inventory-copy,
.equipped-copy {
  min-width: 0;
}

.inventory-copy strong,
.inventory-copy span,
.equipped-copy strong,
.equipped-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-copy strong,
.equipped-copy strong {
  color: var(--ink);
  font-size: .78rem;
}

.inventory-copy span,
.equipped-copy span {
  color: var(--muted);
  font-size: .72rem;
}

.inventory-buttons,
.stack-buttons {
  display: flex;
  gap: 4px;
}

.inventory-buttons button,
.stack-buttons button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  font-size: .72rem;
}

.secondary-button {
  border: 1px solid #cfd8d3;
  background: #ffffff;
  color: var(--ink);
}

.secondary-button:hover {
  background: #eef5f2;
}

button:disabled {
  cursor: wait;
  opacity: .7;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.button-field {
  display: grid;
  gap: 6px;
  align-content: end;
}

.button-field span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.button-field .save-status {
  min-height: 1rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: none;
}

.save-status[data-tone="success"] {
  color: #167f7b;
}

.save-status[data-tone="warning"] {
  color: #9b6500;
}

.save-status[data-tone="pending"] {
  color: var(--muted);
}

.layer-detect-row {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: 10px;
  align-items: center;
}

.detect-status {
  min-height: 1rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.35;
}

.detect-status[data-tone="success"] {
  color: #167f7b;
}

.detect-status[data-tone="warning"] {
  color: #9b6500;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid #cfd8d3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 127, 123, .16);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.chat-feed,
.log-list {
  display: grid;
  gap: 10px;
  max-height: 380px;
  margin-top: 16px;
  overflow: auto;
  padding-right: 4px;
}

.message,
.log-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e3e7e1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcf9;
}

.message-body,
.log-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.message-meta,
.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .78rem;
}

.message strong,
.log-row strong {
  color: var(--ink);
}

.message p,
.log-row p {
  margin: 0;
  line-height: 1.45;
}

.comment-avatar {
  display: grid;
  place-items: start;
}

.comment-avatar-rendered {
  width: 48px;
}

.comment-avatar-frame {
  display: block;
  width: 40px;
  height: 80px;
  overflow: hidden;
  border: 1px solid #d8dfd8;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef5f9 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.comment-avatar-stage {
  position: relative;
  width: 150px;
  height: 300px;
  transform: scale(.2667);
  transform-origin: top left;
}

.comment-avatar-layer {
  position: absolute;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

.avatar-portrait {
  position: relative;
  width: 48px;
  height: 56px;
  overflow: hidden;
  border: 1px solid #d8dfd8;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--avatar-bg) 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.avatar-body-shape,
.avatar-hair-back,
.avatar-head-shape,
.avatar-eye-shape,
.avatar-mouth-shape,
.avatar-hair-front,
.avatar-badge {
  position: absolute;
}

.avatar-body-shape {
  left: 8px;
  bottom: -8px;
  width: 32px;
  height: 26px;
  border-radius: 16px 16px 6px 6px;
  background: var(--avatar-accent);
}

.avatar-hair-back {
  left: 9px;
  top: 8px;
  width: 30px;
  height: 24px;
  border-radius: 14px 14px 12px 12px;
  background: var(--avatar-hair);
}

.avatar-head-shape {
  left: 12px;
  top: 10px;
  width: 24px;
  height: 26px;
  border-radius: 12px 12px 11px 11px;
  background: var(--avatar-skin);
}

.avatar-eye-shape {
  top: 20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--avatar-eye);
}

.avatar-eye-left {
  left: 18px;
}

.avatar-eye-right {
  right: 18px;
}

.avatar-mouth-shape {
  left: 20px;
  top: 28px;
  width: 8px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: rgba(123, 67, 72, .55);
}

.avatar-hair-front {
  left: 11px;
  top: 8px;
  width: 26px;
  height: 12px;
  border-radius: 12px 12px 7px 7px;
  background: var(--avatar-hair);
  box-shadow: 8px 6px 0 -4px var(--avatar-hair);
}

.avatar-badge {
  right: 5px;
  bottom: 5px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: rgba(18, 49, 44, .86);
  color: #ffffff;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.forum-shell,
.forum-content-grid {
  display: grid;
  gap: 14px;
}

.forum-shell {
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  margin-top: 16px;
}

.forum-content-grid {
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
}

.forum-sidebar,
.forum-main,
.forum-compose,
.forum-thread-view {
  display: grid;
  gap: 12px;
}

.forum-compose,
.forum-thread-view {
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf9;
}

.forum-category-list,
.forum-thread-list,
.forum-post-list {
  display: grid;
  gap: 10px;
}

.forum-category,
.forum-thread-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e1dc;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.forum-category:hover,
.forum-thread-card:hover,
.forum-category.active,
.forum-thread-card.active {
  background: #ffffff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 127, 123, .12);
}

.forum-category.active,
.forum-thread-card.active {
  background: #eef9f6;
}

.forum-category {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.forum-category-copy {
  display: grid;
  gap: 4px;
}

.forum-category strong,
.forum-thread-head strong,
.forum-post strong {
  color: var(--ink);
}

.forum-category small,
.forum-thread-subline,
.forum-thread-stats,
.forum-thread-meta,
.forum-post-meta {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.forum-category em,
.forum-thread-head em,
.forum-post-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f3ef;
  color: #184b42;
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.forum-thread-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.forum-thread-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.forum-thread-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.forum-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
}

.forum-thread-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.forum-thread-meta {
  margin: 0;
}

.forum-post {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e3e7e1;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.forum-post-body {
  display: grid;
  gap: 6px;
}

.forum-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.forum-post-content {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.forum-post-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.forum-compose-form,
.forum-reply-form {
  display: grid;
  gap: 10px;
}

.front-page-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 12px;
}

.front-page-blocks[data-background="sky"] {
  background: #e9f5fb;
}

.front-page-blocks[data-background="forest"] {
  background: #eaf4ec;
}

.front-page-blocks[data-background="night"] {
  background: #20293a;
}

.front-page-blocks[data-background="paper"] {
  background: #fbfcf9;
}

.front-page-blocks.app-page:not(.active-page) {
  display: none;
}

.front-page-blocks.app-page.active-page {
  display: grid;
}

.front-block {
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid #dde5df;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.front-block small {
  color: var(--teal);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.front-block strong {
  color: var(--ink);
}

.front-block span {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.front-shell-block {
  border-style: dashed;
  background: #f7faf8;
}

.page-designer-canvas {
  display: grid;
  gap: 12px;
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.page-markup-editor {
  display: grid;
  gap: 12px;
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.page-markup-editor textarea {
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .86rem;
  line-height: 1.5;
  text-transform: none;
}

.page-builder-palette {
  display: grid;
  gap: 12px;
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.builder-element-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-element-list button {
  border: 1px solid #cfd8d3;
  background: #ffffff;
  color: var(--ink);
}

.builder-element-list button:hover {
  background: #eef5f2;
}

.page-block-list.is-drop-target,
.front-page-blocks.is-drop-target {
  outline: 3px solid rgba(22, 127, 123, .22);
  outline-offset: 4px;
}

.admin-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.admin-tab {
  border: 1px solid #cfd8d3;
  background: #ffffff;
  color: var(--ink);
}

.admin-tab.active {
  border-color: var(--teal);
  background: #e9f5f1;
  color: var(--teal);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active-page {
  display: grid;
  gap: 14px;
}

.moderation-tools {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  border-top: 1px solid #e3e7e1;
  padding-top: 10px;
}

.admin-action-list,
.forum-category-editor-list,
.avatar-review-list,
.page-block-list {
  display: grid;
  gap: 10px;
}

.admin-action-record,
.admin-category-row,
.avatar-review-card,
.page-block-row,
.admin-summary-card {
  border: 1px solid #e1e7e2;
  border-radius: 8px;
  background: #fbfcf9;
  padding: 12px;
}

.admin-action-record,
.admin-category-row,
.page-block-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-action-record {
  grid-template-columns: minmax(0, 1fr);
}

.admin-action-record strong,
.admin-category-row strong,
.avatar-review-card strong,
.page-block-row strong,
.admin-summary-card strong {
  color: var(--ink);
}

.admin-action-record span,
.admin-category-row span,
.admin-category-row em,
.avatar-review-card span,
.avatar-review-card p,
.page-block-row span,
.page-block-row p,
.admin-summary-card span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.admin-category-row.is-subcategory {
  margin-left: 18px;
  border-left: 4px solid #8ab7d4;
}

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

.admin-editor-form label:nth-child(2),
.admin-editor-form label:nth-child(3),
.admin-editor-form button {
  grid-column: span 2;
}

.avatar-review-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
}

.page-block-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.page-block-row[draggable="true"] {
  cursor: grab;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 48px;
  border: 1px dashed #b8c5bd;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.page-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-jump-link {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: #0f6c68;
}

.feature-band {
  align-items: flex-start;
  padding: 24px;
  border: 1px solid #d6dcd3;
  border-radius: 8px;
  background: #fffaf0;
}

.feature-band h2 {
  max-width: 720px;
  line-height: 1.3;
}

.system-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 430px;
}

.system-list span {
  border: 1px solid #e5d9ba;
  border-radius: 999px;
  padding: 8px 10px;
  background: #ffffff;
  color: #5e4a22;
  font-size: .85rem;
  font-weight: 800;
}

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

body.hair-ember .avatar-hair {
  background: #b95a35;
}

body.hair-seafoam .avatar-hair {
  background: #55a59e;
}

body.outfit-ranger .avatar-torso {
  background: #507b40;
}

body.outfit-ranger .avatar-cape {
  background: #846b39;
}

body.outfit-starlight .avatar-torso {
  background: #5b547e;
}

body.outfit-starlight .avatar-cape {
  background: #b85068;
}

@media (max-width: 1120px) {
  .dashboard-grid,
  .communication-grid {
    grid-template-columns: 1fr;
  }

  .forum-shell,
  .forum-content-grid,
  .world-editor-grid {
    grid-template-columns: 1fr;
  }

  .front-page-blocks {
    grid-template-columns: 1fr 1fr;
  }

  .avatar-editor {
    grid-template-columns: auto minmax(260px, 1fr);
  }

  .asset-workbench {
    grid-template-columns: 1fr;
  }

  .selected-settings-column,
  .item-browser-column {
    grid-column: 1;
    grid-row: auto;
  }

  .selected-settings-column {
    position: static;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .feature-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .forum-toolbar {
    grid-template-columns: 1fr;
  }

  .front-page-blocks,
  .admin-editor-form,
  .admin-action-record,
  .admin-category-row,
  .world-area-row,
  .page-block-row {
    grid-template-columns: 1fr;
  }

  .admin-editor-form label:nth-child(2),
  .admin-editor-form label:nth-child(3),
  .admin-editor-form button {
    grid-column: auto;
  }

  .user-strip,
  .system-list {
    justify-content: flex-start;
  }

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

  .avatar-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding: 14px;
  }

  .world-panel,
  .avatar-panel,
  .chat-panel,
  .admin-panel,
  .forum-panel,
  .feature-band {
    padding: 14px;
  }

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

  .control-row,
  .coordinate-grid,
  .action-row,
  .layer-detect-row {
    grid-template-columns: 1fr;
  }
}
