*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font-lore, Georgia, "Times New Roman", serif);
  color: var(--ink, #1a1510);
  background: var(--wood, #3d2918);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background-color: var(--wood, #3d2918);
  background-image:
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(180deg, rgba(40, 28, 16, 0.35), rgba(10, 8, 6, 0.55)),
    var(--theme-wood),
    var(--grain);
  background-size: auto, auto, 320px 320px, auto;
  background-attachment: fixed;
}

.app-header__brand h1 {
  font-family: var(--font-pixel, monospace);
  letter-spacing: 0.04em;
  font-weight: 400;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  color: var(--torch-glow, #f7e26b);
  text-shadow: 0 0 12px rgba(255, 137, 51, 0.35);
}

.app-header__tagline {
  margin: 2px 0 0;
  font-family: var(--font-lore, Georgia, serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--parchment, #e4d4b8);
  opacity: 0.85;
}

.app-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 16px 8px;
  border-bottom: 3px solid var(--border, #3a2818);
  background:
    linear-gradient(180deg, rgba(90, 60, 30, 0.55), rgba(40, 28, 16, 0.85)),
    var(--theme-wood);
  background-size: auto, 280px 280px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.qa-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #8a6a20;
  background: #f3e6b8;
  color: #3a2e10;
  font-size: 0.85rem;
}

.qa-banner[hidden] {
  display: none !important;
}

.qa-banner strong {
  letter-spacing: 0.02em;
}

.app-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.app-header h1 {
  margin: 0;
}

html:not([data-layout='mobile']) body {
  overflow: hidden;
}

html:not([data-layout='mobile']) .app-body {
  overflow: hidden;
}

.app-header__hint {
  margin: 2px 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.boot-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 100;
  padding: 12px 14px;
  border: 1px solid var(--danger, #8b2e2e);
  background: #f4ecde;
  color: var(--ink, #1a1510);
  font-size: 0.95rem;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.boot-banner[hidden] {
  display: none !important;
}

.app-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-role {
  font-size: 0.85rem;
  opacity: 0.85;
}

.room-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.room-nav[hidden],
.map-hud[hidden] {
  display: none !important;
}

.map-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 0.85rem;
  width: 100%;
}

.map-hud span {
  white-space: nowrap;
}

.room-root {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding-bottom: 8px;
}

.room-root:has(.map-room--bleed) {
  overflow: hidden;
  padding-bottom: 0;
}

.app-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.guild-chat {
  flex: 0 0 var(--chat-width, 260px);
  width: var(--chat-width, 260px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft, #8a7a62);
  background: var(--panel, #ebe1d0);
  min-height: 0;
}

.guild-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft, #8a7a62);
  font-size: 0.9rem;
}

.guild-chat__speaker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.guild-chat__speaker-art {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border, #5a4a36);
  border-radius: 50%;
  background: var(--panel-soft, #f4ecde);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.7rem;
}

.guild-chat__speaker-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-chat__speaker-pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  opacity: 0.95;
}

.guild-chat__speaker-pick span {
  display: none;
}

.guild-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.guild-chat__feed {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guild-chat__empty,
.guild-chat__hint {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.guild-chat__msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.guild-chat__avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  overflow: hidden;
}

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

.guild-chat__name {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent, #a16a38);
}

.guild-chat__stamp {
  font-weight: 500;
  opacity: 0.7;
  font-size: 0.7rem;
}

.guild-chat__text {
  margin: 2px 0 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.guild-chat__composer {
  border-top: 1px solid var(--border-soft, #8a7a62);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guild-chat__select,
.guild-chat__input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  color: var(--ink, #1a1510);
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 8px;
}

.guild-chat__row {
  display: flex;
  gap: 6px;
}

.guild-chat__row .guild-chat__input {
  flex: 1 1 auto;
}

@media (max-width: 720px) {
  .app-body {
    flex-direction: column;
  }

  .guild-chat {
    flex: 0 0 auto;
    width: 100%;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft, #8a7a62);
  }
}

.map-room {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-room--bleed {
  position: relative;
}

.map-modes {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 0;
  background: transparent;
}

.map-modes--rail {
  position: relative;
  left: auto;
  top: auto;
  z-index: 8;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  padding: 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  border-bottom: 2px solid var(--border, #4a2c14);
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(232, 188, 122, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  background-size: auto, cover;
  box-shadow: var(--bevel-out), 0 6px 16px rgba(40, 24, 10, 0.35);
}

.map-chrome-left {
  position: absolute;
  left: 10px;
  top: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(148px, 30vw);
  pointer-events: none;
}

.map-chrome-left > * {
  pointer-events: auto;
}

.map-chrome-top {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
  pointer-events: none;
}

.map-chrome-top > * {
  pointer-events: auto;
}

.map-chrome-top .map-modes--rail {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  max-width: none;
  padding: 6px;
}

.map-chrome-top .map-modes--rail .mode-btn {
  width: auto;
}

.map-chrome-top__next {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: min(420px, 48%);
}

.map-chrome-top .schedule-strip-host {
  flex: 0 1 auto;
  max-width: min(280px, 40%);
}

.map-modes--rail .mode-btn {
  width: 100%;
  text-align: left;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-btn__icon {
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
}

.mode-btn__label {
  flex: 1 1 auto;
  min-width: 0;
}

.map-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  position: relative;
  --region-panel-width: 260px;
  gap: 0;
  padding: 0;
  align-items: stretch;
  overflow: hidden;
  background: var(--parchment, #f5d1a0);
}

.map-canvas {
  position: absolute;
  inset: 0;
  flex: none;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-color: var(--parchment, #f5d1a0);
  background-image: var(--theme-parchment);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.map-root {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background-color: var(--parchment, #f5d1a0);
  background-image: var(--theme-parchment);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-root svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  object-fit: cover;
  background: transparent;
}

.map-root path.province {
  cursor: pointer;
  transition: stroke-width 0.12s ease, stroke 0.12s ease, fill-opacity 0.12s ease;
  stroke: #130f0a;
  stroke-width: 2;
}

.map-root path.province.is-hover {
  stroke: #fff6e0;
  stroke-width: 5;
  filter: none;
  paint-order: stroke fill;
}

.map-root path.province.is-selected {
  stroke: #ffe8a8;
  stroke-width: 6;
  filter: brightness(1.06);
  paint-order: stroke fill;
}

.map-root path.province.is-selected.is-hover {
  stroke: #fff6e0;
  stroke-width: 6;
}

.region-panel {
  flex: 0 0 var(--region-panel-width);
  width: var(--region-panel-width);
  padding: 16px;
  border-left: 1px solid #8a7a62;
  background: #ebe1d0;
  overflow: auto;
}

.region-panel--overlay {
  position: absolute;
  top: 48px;
  right: 10px;
  bottom: auto;
  z-index: 8;
  flex: none;
  width: min(var(--region-panel-width, 260px), 42vw);
  max-height: calc(100% - 120px);
  padding: 12px;
  border: 2px solid var(--border, #4a2c14);
  border-left: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(250, 235, 200, 0.95), rgba(243, 223, 184, 0.92));
  box-shadow: var(--bevel-out), 0 6px 16px rgba(40, 24, 10, 0.35);
  color: var(--ink, #2b1a0e);
  overflow: auto;
}

.region-panel h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.region-panel p {
  margin: 0 0 8px;
  line-height: 1.35;
}

.region-panel__meta {
  font-size: 0.95rem;
}

.region-panel__empty,
.region-panel__error {
  margin: 0;
  opacity: 0.8;
}

.region-panel__error {
  color: #7a1f1f;
}

.region-panel__lore-label {
  display: block;
  margin: 8px 0;
  font-size: 0.9rem;
}

.region-panel__lore {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid #8a7a62;
  background: #f4ecde;
  font: inherit;
  resize: vertical;
}

.room-stub {
  padding: 24px 16px;
}

.room-stub h2 {
  margin: 0 0 8px;
}

.room-stub__lead {
  margin: 0 0 10px;
  opacity: 0.85;
}

.room-stub__list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.characters-ot-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.characters-ot-host .ot-hub {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.map-legend {
  position: absolute;
  right: calc(var(--region-panel-width, 280px) + 16px);
  bottom: 12px;
  z-index: 5;
  width: 210px;
  height: auto;
  max-height: none;
  box-sizing: border-box;
  padding: 10px;
  overflow: visible;
  background: #ebe1d0;
  border: 1px solid #5a4a36;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  font-size: 0.78rem;
}

.map-legend--overlay {
  top: auto;
  right: auto;
  bottom: 12px;
  left: 10px;
  z-index: 9;
  width: min(240px, 42vw);
  height: auto;
  max-height: 48%;
  overflow: visible;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(250, 235, 200, 0.95), rgba(243, 223, 184, 0.92));
  box-shadow: var(--bevel-out), 0 6px 16px rgba(40, 24, 10, 0.35);
  color: var(--ink, #2b1a0e);
  pointer-events: auto;
}

.region-panel--overlay {
  top: 12px;
  bottom: 12px;
  right: 10px;
  left: auto;
  width: min(380px, 42%);
  max-height: none;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.region-panel--overlay .region-panel__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.region-panel__details {
  margin: 4px 0;
  border: 1px solid rgba(74, 44, 20, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(244, 236, 222, 0.55);
}

.region-panel__details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
}

.region-panel__details > summary::-webkit-details-marker {
  display: none;
}

.hud-vault--map {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 8;
  width: min(148px, 30vw);
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(232, 188, 122, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  background-size: auto, cover;
  box-shadow: var(--bevel-out), 0 6px 16px rgba(40, 24, 10, 0.35);
  max-height: calc(100% - 120px - min(42%, 280px));
  overflow: auto;
  pointer-events: auto;
}

.hud-vault--map .hud-vault__item {
  padding: 5px 7px;
}

.schedule-strip-host--overlay {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  z-index: 10;
  width: 100%;
  max-width: none;
  pointer-events: auto;
}

.map-legend__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.88rem;
}

.map-legend__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-legend__row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.15;
}

.map-legend__swatch {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid #3a2a18;
}

.map-legend .res-icon {
  flex: 0 0 auto;
  display: block;
}

.map-legend__empty {
  margin: 0;
  opacity: 0.75;
}

.reports-list__item {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(90, 74, 54, 0.25);
}

.reports-modal {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 32px));
  max-height: 80vh;
  overflow: auto;
  margin: 8vh auto 0;
  padding: 16px;
  background: #ebe1d0;
  border: 1px solid #5a4a36;
}

.reports-modal h2,
.reports-modal h3 {
  margin: 0 0 8px;
}

.reports-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.reports-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.reports-form input,
.reports-form select,
.reports-form textarea {
  padding: 6px 8px;
  border: 1px solid #8a7a62;
  background: #f4ecde;
  font: inherit;
}

.reports-optional {
  font-size: 0.8rem;
  opacity: 0.7;
  font-weight: 400;
}

.reports-res {
  margin: 0;
  padding: 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: #f7ecd8;
}

.reports-res legend {
  padding: 0 6px;
  font-family: var(--font-pixel, monospace);
  font-size: 0.95rem;
}

.reports-res__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.reports-res__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.reports-advanced {
  font-size: 0.85rem;
}

.reports-advanced summary {
  cursor: pointer;
  margin-bottom: 6px;
}

.reports-narrative textarea {
  min-height: 88px;
}

.reports-list__note {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft, #4a3220);
  white-space: pre-wrap;
}

.reports-preview {
  margin: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid #8a7a62;
  font-size: 0.9rem;
  line-height: 1.35;
}

.reports-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reports-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.reports-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 8, 0.45);
}

.app-footer {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-top: 1px solid #8a7a62;
  background: #cfc0a6;
  font-size: 0.72rem;
  opacity: 0.65;
}

.app-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 12px 6px;
  border-top: 1px solid rgba(90, 72, 48, 0.35);
  background: #b9ab92;
  font-family: var(--font-pixel, 'VT323', monospace);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0.9;
  color: #2a2218;
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
}

.app-footer__links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.app-footer__links a:hover {
  opacity: 1;
  border-bottom-color: currentColor;
}

/* —— NPC room —— */
.npc-room {
  padding: 12px 14px 24px;
  min-height: 0;
}

.npc-room__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.npc-room__title {
  margin: 0;
  font-size: 1.25rem;
}

.npc-room__lead {
  margin: 4px 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.npc-room__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.npc-room__filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  opacity: 0.9;
}

.npc-room__filter select,
.npc-room__search {
  min-width: min(180px, 100%);
  padding: 6px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font: inherit;
}

.npc-room__search {
  min-width: min(200px, 100%);
}

.npc-room__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  align-items: start;
}

.npc-room__filter--check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.npc-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.npc-stack--open .npc-rumors {
  animation: npc-rumors-in 0.22s ease-out;
}

@keyframes npc-rumors-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.npc-card {
  position: relative;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.npc-card--open {
  border-color: var(--accent, #a16a38);
  box-shadow: none;
}

.npc-card__art {
  position: relative;
  width: min(100%, 160px);
  margin: 0 auto 10px;
  aspect-ratio: 1 / 1;
  max-height: none;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: var(--parchment, #d8cbb6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.npc-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.npc-card__ph {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent, #a16a38);
  opacity: 0.85;
}

.npc-card__body {
  padding: 10px 12px 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.npc-card__name {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent, #a16a38);
  line-height: 1.25;
  word-break: break-word;
}

.npc-card__badges {
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.npc-card__loc {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1.35;
  word-break: break-word;
}

.npc-card__details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(90, 74, 54, 0.35);
  display: grid;
  gap: 4px;
}

.npc-card__line {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--ink, #1a1510);
  opacity: 0.9;
  word-break: break-word;
  white-space: normal;
}

.npc-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid var(--border-soft, #8a7a62);
  padding: 8px 10px 10px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.npc-card__rumors-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: transparent;
  color: var(--ink, #1a1510);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.npc-card__rumors-btn:hover,
.npc-card__rumors-btn.is-active {
  background: var(--accent, #a16a38);
  border-color: var(--accent, #a16a38);
  color: #fff8ec;
}

.npc-card__edit-btn {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.guild-npc-modal {
  width: min(520px, calc(100% - 32px));
  max-height: min(90vh, 720px);
  overflow: auto;
}

.master-guild-npc-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.npc-rumors {
  border: 1px solid var(--accent, #a16a38);
  border-top: 0;
  background: rgba(255, 248, 236, 0.95);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
}

.npc-rumors__compose {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft, #8a7a62);
}

.npc-rumors__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.npc-rumors__title-row .npc-comments__title {
  margin: 0;
}

.npc-rumors__clear {
  flex: 0 0 auto;
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* —— Map province discussion —— */
.map-comments {
  margin: 12px 0;
}

.map-comments__toggle {
  width: 100%;
}

.map-comments__toggle.is-active {
  border-color: var(--accent, #a16a38);
}

.map-comments--open {
  border: 1px solid var(--border, #5a4a36);
  background: rgba(255, 248, 236, 0.95);
  padding: 10px 12px 12px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.06);
}

.map-comments__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.map-comments__clear {
  font-size: 0.8rem;
  padding: 4px 8px;
}

.map-comments__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.map-comments__item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(90, 74, 54, 0.15);
}

.map-comments__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
}

.map-comments__time {
  opacity: 0.65;
  font-size: 0.75rem;
}

.map-comments__text {
  margin: 4px 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.map-comments__actions {
  display: flex;
  gap: 10px;
}

.map-comments__link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  color: var(--accent, #a16a38);
  cursor: pointer;
  text-decoration: underline;
}

.map-comments__compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(90, 74, 54, 0.2);
}

.map-comments__speaker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

.map-comments__input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border, #5a4a36);
  background: #fff8ec;
  font: inherit;
  resize: vertical;
}

.map-comments__muted,
.map-comments__hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.75;
}

.region-panel__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 0.85rem;
}

.npc-comments__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}

.npc-comment {
  padding: 6px 0;
  border-bottom: 1px solid rgba(90, 74, 54, 0.15);
}

.npc-comment__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.npc-comment__av {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--parchment, #d8cbb6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

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

.npc-comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.npc-comment__meta strong {
  color: var(--accent, #a16a38);
}

.npc-comment__text {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.npc-comment__reply,
.npc-link {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #a16a38);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.npc-thread {
  margin-top: 6px;
  margin-left: 8px;
}

.npc-thread__sum {
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.75;
}

.npc-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.npc-speaker__art {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--parchment, #d8cbb6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

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

.npc-speaker__pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  opacity: 0.9;
}

.npc-speaker__select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #5a4a36);
  background: #fff8ec;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  padding: 5px 8px;
}

.npc-comments__compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.npc-comments__input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: #fff8ec;
  font: inherit;
  resize: vertical;
}

.npc-comments__hint {
  margin: 0 0 6px;
  font-size: 0.8rem;
  opacity: 0.8;
}

.npc-muted {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.btn,
.nav-btn,
.mode-btn {
  padding: 7px 14px;
  min-height: 36px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: var(--btn-radius, 6px);
  background:
    linear-gradient(180deg, #f0c878 0%, var(--accent, #d87a24) 42%, #8a4a18 100%);
  color: var(--ink, #2b1a0e);
  font-family: var(--font-pixel, monospace);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: var(--bevel-out);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.35);
  image-rendering: pixelated;
}

.btn:hover,
.nav-btn:hover,
.mode-btn:hover {
  filter: brightness(1.06);
}

.btn:active,
.nav-btn:active,
.mode-btn:active {
  box-shadow: var(--bevel-in);
  transform: translateY(1px);
}

.btn--primary,
.mode-btn--active,
.nav-btn--active {
  background:
    linear-gradient(180deg, #ffe08a 0%, var(--brass, #e0b040) 40%, #a86820 100%);
  color: var(--ink, #2b1a0e);
  border-color: var(--wood-dark, #3d2210);
  animation: none;
}

.btn--ghost {
  background: linear-gradient(180deg, #e8c898, #c89860);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-modal-host {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.auth-modal-host[hidden] {
  display: none !important;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 8, 0.45);
}

.auth-modal {
  position: relative;
  z-index: 1;
  width: min(400px, calc(100% - 32px));
  margin: 12vh auto 0;
  padding: 16px;
  background: #ebe1d0;
  border: 1px solid #5a4a36;
}

.auth-modal h2 {
  margin: 0 0 8px;
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.auth-field input {
  padding: 6px 8px;
  border: 1px solid #8a7a62;
  background: #f4ecde;
  font: inherit;
}

.auth-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.auth-forgot {
  color: inherit;
  font-size: 0.85rem;
}

.auth-modal__hint {
  color: #7a1f1f;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .map-stage {
    flex-direction: column;
    display: flex;
    --region-panel-width: 0px;
    overflow: auto;
  }

  .map-canvas {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 50vh;
    height: 50vh;
    flex: 0 0 auto;
  }

  .map-root {
    min-height: 0;
  }

  .map-modes--rail {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0;
  }

  .map-chrome-left {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 8px;
    flex-direction: column;
  }

  .map-modes--rail .mode-btn__label {
    display: none;
  }

  .map-modes--rail .mode-btn {
    width: auto;
    min-width: 44px;
    justify-content: center;
    padding: 8px 10px;
  }

  .hud-vault--map {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    max-height: none;
    margin: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .region-panel,
  .region-panel--overlay {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    flex: none;
    width: auto;
    max-height: none;
    margin: 8px;
    border-left: 2px solid var(--border, #4a2c14);
  }

  .map-legend,
  .map-legend--overlay {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    margin: 0 8px 8px;
  }

  .schedule-strip-host--overlay {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    max-width: none;
    margin: 8px;
  }
}

.nav-btn {
  position: relative;
}

.nav-btn__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 999px;
  background: #8b2e2e;
  color: #f5efe4;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.wh-room {
  padding: 12px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--ink, #2b1a0e);
}

.wh-section {
  padding: 12px 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(243, 223, 184, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  background-size: auto, cover;
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.wh-section h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--ink, #2b1a0e);
}

.wh-lead {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.wh-muted {
  margin: 4px 0;
  font-size: 0.82rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.wh-vault {
  display: grid;
  gap: 6px;
  max-width: none;
}

.wh-vault__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
}

.wh-votes,
.wh-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.wh-vote,
.wh-loc-card,
.wh-branch-open {
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  padding: 10px 12px;
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.wh-vote h4,
.wh-loc-card h4 {
  margin: 0 0 6px;
  color: var(--accent, #a16a38);
}

.wh-vote__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.wh-duchy-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 320px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.wh-duchy-pick select,
.wh-duchy-pick input {
  padding: 6px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font: inherit;
}

/* —— Warehouse floorplan —— */
.wh-floor-section {
  margin-top: 4px;
  min-height: 140px;
}

.wh-floor-section--empty .wh-floor-empty {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 2px dashed var(--border, #4a2c14);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.55);
}

.wh-floor-empty__lead {
  margin: 0;
  font-weight: 600;
  color: var(--ink, #2b1a0e);
}

.wh-floor {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 10px 0 14px;
  border: 1px solid var(--border, #5a4a36);
  background: #f3ead8;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
  aspect-ratio: 100 / 70;
}

.wh-floor__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.wh-floor__zones {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.wh-zone {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
  text-align: center;
  border: 1.5px dashed transparent;
  box-sizing: border-box;
  cursor: default;
  pointer-events: auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.wh-zone__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink, #2b1a0e);
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(255, 248, 232, 0.85);
}

.wh-zone__hint {
  font-size: 0.7rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.wh-zone--empty {
  background: rgba(90, 74, 54, 0.08);
  border-color: rgba(90, 74, 54, 0.35);
  cursor: pointer;
}

.wh-zone--empty:hover,
.wh-zone--over {
  background: rgba(161, 106, 56, 0.18);
  border-color: var(--accent, #a16a38);
}

.wh-zone--filled {
  background: rgba(250, 236, 200, 0.96);
  border-style: solid;
  border-color: var(--border, #4a2c14);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.7);
}

.wh-zone--pending {
  background: rgba(196, 150, 80, 0.32);
  border-style: solid;
  border-color: #a16a38;
  animation: wh-zone-pulse 1.6s ease-in-out infinite;
}

.wh-zone--decor {
  background: rgba(232, 220, 196, 0.55);
  border-style: dashed;
  border-color: rgba(90, 74, 54, 0.25);
  pointer-events: none;
}

.wh-buildings {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink, #2b1a0e);
  font-size: 0.9rem;
}

@keyframes wh-zone-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.wh-floor__palette-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--accent, #a16a38);
}

.wh-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.wh-palette__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 140px;
  max-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font: inherit;
  text-align: left;
  cursor: grab;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.05);
}

.wh-palette__card:active {
  cursor: grabbing;
}

.wh-palette__card.is-selected,
.wh-palette__card.is-dragging {
  border-color: var(--accent, #a16a38);
  background: #fff8ec;
}

.wh-palette__card[data-wh-unaffordable] {
  opacity: 0.55;
  cursor: not-allowed;
}

.region-panel__guild-home {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--accent, #a16a38);
  background: rgba(161, 106, 56, 0.12);
  font-size: 0.9rem;
}

/* —— Library —— */
.lib-room {
  padding: 12px 14px 28px;
  color: var(--ink, #2b1a0e);
}

.lib-room__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.lib-room__title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink, #2b1a0e);
}

.lib-lead {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
}

.lib-filters label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--ink, #2b1a0e);
}

.lib-filters input {
  min-width: 140px;
  padding: 6px 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
  font: inherit;
  box-shadow: var(--bevel-in);
}

.lib-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.lib-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(243, 223, 184, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  background-size: auto, cover;
  padding: 12px 14px;
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.lib-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--ink, #2b1a0e);
}

.lib-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib-muted {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.lib-empty {
  margin: 0;
  padding: 18px 16px;
  border: 2px dashed rgba(74, 44, 20, 0.35);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
  text-align: center;
}

.lib-empty__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--ink, #2b1a0e);
}

.lib-empty__hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft, #4a3220);
}

.lib-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.7rem;
  border: 1px solid var(--border, #5a4a36);
  opacity: 0.8;
  font-weight: 500;
  color: inherit;
  vertical-align: middle;
}

.lib-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--accent, #a16a38);
  background: rgba(255, 248, 236, 0.95);
  max-width: 520px;
}

.lib-editor h3 {
  margin: 0 0 4px;
}

.lib-editor label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.lib-editor input,
.lib-editor select {
  padding: 6px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: #fff8ec;
  font: inherit;
}

.lib-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.lib-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* —— Master workshop —— */
.master-room {
  padding: 10px 12px 20px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.master-room__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.master-room__title {
  margin: 0;
  font-size: 1.25rem;
}

.master-lead {
  margin: 4px 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.master-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent, #a16a38);
  min-height: 1.2em;
}

.master-section {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #5a4a36);
}

.master-section:last-child {
  border-bottom: 0;
}

.master-section h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--accent, #a16a38);
}

.master-muted {
  margin: 0 0 10px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.master-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.master-form label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  min-width: 180px;
}

.master-form input,
.master-roles-table select {
  padding: 6px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font: inherit;
}

.master-section__actions,
.master-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.master-roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.master-roles-table th,
.master-roles-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(90, 74, 54, 0.25);
  vertical-align: middle;
}

.master-uid {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  opacity: 0.85;
}

.master-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  border: 1px solid var(--border, #5a4a36);
  opacity: 0.8;
}

.master-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(90, 74, 54, 0.25);
  font-size: 0.85rem;
}

.master-toc a {
  color: var(--accent, #a16a38);
  text-decoration: none;
}

.master-toc a:hover {
  text-decoration: underline;
}

.master-form__wide {
  flex: 1 1 100%;
  min-width: 220px;
}

.master-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.master-catalog-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(90, 74, 54, 0.25);
  background: var(--panel-soft, #f4ecde);
}

.master-form--editor {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(90, 74, 54, 0.3);
}

/* —— Weekly work —— */
.work-room {
  padding: 12px 14px 28px;
  max-width: 720px;
}

.work-lead {
  margin: 4px 0 14px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.work-section {
  margin-bottom: 18px;
}

.work-section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--accent, #a16a38);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.work-card {
  padding: 10px 12px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
}

.work-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.work-muted {
  margin: 0 0 8px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.work-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #8a3a2a;
  background: #f6e4de;
  font-size: 0.9rem;
}

.work-form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.work-form label {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.work-form select {
  padding: 6px 8px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
  font: inherit;
}

.work-preview {
  margin: 0;
  font-size: 0.9rem;
}

.work-result {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
}

.work-result h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.work-result--fail {
  border-color: #8a5a3a;
  background: #f5ebe0;
}

.work-result--ok {
  border-color: #5a7a4a;
  background: #eef5e8;
}

.work-result--great {
  border-color: #a16a38;
  background: #f7efe4;
}

.work-rumors,
.work-npc-flags,
.master-work-npc-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.9rem;
}

.work-rumors li,
.work-npc-flags li,
.master-work-npc-list li {
  margin-bottom: 6px;
}

.work-log {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.9rem;
}

.work-log li {
  margin-bottom: 4px;
}

.npc-card__work-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  border: 1px solid var(--accent, #a16a38);
  color: var(--accent, #a16a38);
  vertical-align: middle;
}

.npc-card__can-work {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn--danger {
  border-color: #8a3a2a;
  color: #6e2a1e;
  background: #f6e4de;
}

.btn--danger:hover {
  background: #efd2c8;
}

/* —— Tickets —— */
.tickets-room {
  padding: 12px 14px 28px;
  max-width: 960px;
}

.tickets-lead {
  margin: 4px 0 14px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.tickets-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font-size: 0.9rem;
}

.tickets-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 720px) {
  .tickets-layout {
    grid-template-columns: 1fr;
  }
}

.tickets-queue__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tickets-queue__bar h3,
.tickets-thread__head h3,
.tickets-create h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--accent, #a16a38);
}

.tickets-queue__bar select,
.tickets-create select,
.tickets-create input,
.tickets-create textarea,
.tickets-status-ctrl select,
.tickets-reply textarea {
  padding: 6px 8px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.tickets-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.tickets-list__item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.tickets-list__item.is-active {
  border-color: var(--accent, #a16a38);
  background: #fffaf2;
}

.tickets-list__subject {
  font-weight: 600;
  font-size: 0.95rem;
}

.tickets-list__meta {
  font-size: 0.75rem;
  opacity: 0.75;
}

.tickets-badge {
  display: inline-block;
  width: fit-content;
  padding: 1px 7px;
  font-size: 0.72rem;
  border: 1px solid var(--border, #5a4a36);
}

.tickets-badge--open {
  border-color: #5a7a4a;
  color: #3d5a32;
}

.tickets-badge--needs_clarification {
  border-color: #a16a38;
  color: #7a4a20;
}

.tickets-badge--closed {
  border-color: #6a5a4a;
  color: #5a4a36;
  opacity: 0.85;
}

.tickets-muted {
  margin: 0 0 8px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.tickets-create {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(90, 74, 54, 0.35);
}

.tickets-create label,
.tickets-status-ctrl {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.tickets-thread {
  padding: 10px 12px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
  min-height: 200px;
}

.tickets-thread__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tickets-status-ctrl {
  margin: 8px 0 12px;
  max-width: 280px;
}

.tickets-messages {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tickets-msg {
  padding: 8px 10px;
  border: 1px solid rgba(90, 74, 54, 0.25);
  background: var(--panel-soft, #f4ecde);
}

.tickets-msg--master {
  border-color: rgba(161, 106, 56, 0.45);
  background: #f7efe4;
}

.tickets-msg__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
  margin-bottom: 4px;
  opacity: 0.85;
}

.tickets-msg__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.92rem;
}

.tickets-reply {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(90, 74, 54, 0.35);
}

/* —— Рогатые сплетни / News —— */
.news-room {
  padding: 12px 14px 28px;
  max-width: 1200px;
}

.gossip-hero {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .gossip-hero {
    grid-template-columns: 1fr;
  }
}

.gossip-hero__art img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  border: 1px solid var(--border, #5a4a36);
  background: #1a2a18;
}

.gossip-hero__eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

.gossip-hero__copy h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  color: var(--accent, #a16a38);
}

.gossip-lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.gossip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.gossip-muted {
  margin: 0 0 8px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.gossip-status {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
  font-size: 0.9rem;
}

.gossip-learned {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--accent, #a16a38);
  background: #f7efe4;
}

.gossip-learned h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--accent, #a16a38);
}

.gossip-share,
.gossip-inbox,
.gossip-feed,
.gossip-mine {
  margin-bottom: 18px;
}

.gossip-share h3,
.gossip-inbox h3,
.gossip-feed h3,
.gossip-mine h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--accent, #a16a38);
}

.gossip-form,
.gossip-card {
  display: grid;
  gap: 8px;
}

.gossip-form label,
.gossip-card label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.gossip-form select,
.gossip-form textarea,
.gossip-card textarea {
  padding: 6px 8px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.gossip-card {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #5a4a36);
  background: var(--panel-soft, #f4ecde);
}

.gossip-card__raw {
  margin: 0;
  font-size: 0.9rem;
}

.gossip-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gossip-feed__list,
.gossip-mine__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.gossip-feed__item {
  padding: 10px 12px;
  border: 1px solid var(--border, #5a4a36);
  background: #fffaf2;
}

.gossip-feed__item p {
  margin: 0 0 6px;
}

.gossip-pill {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  font-size: 0.72rem;
  border: 1px solid var(--border, #5a4a36);
}

.gossip-pill--pending {
  border-color: #a16a38;
  color: #7a4a20;
}

.gossip-pill--published {
  border-color: #5a7a4a;
  color: #3d5a32;
}

.gossip-pill--rejected {
  opacity: 0.7;
}

.npc-guild-form {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed rgba(90, 74, 54, 0.45);
  background: #fffaf2;
}

.npc-guild-form h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent, #a16a38);
}

.npc-guild-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.npc-guild-form__grid label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.npc-guild-form__wide {
  grid-column: 1 / -1;
}

.npc-guild-form input[type='text'],
.npc-guild-form select,
.npc-guild-form textarea {
  padding: 6px 8px;
  border: 1px solid var(--border, #5a4a36);
  background: #fff;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.npc-guild-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.npc-card__notes {
  font-size: 0.8rem;
  opacity: 0.85;
}

.npc-card__local-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.master-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
}

/* —— Schedule compact (map) —— */
.schedule-strip-host {
  padding: 0 0 6px;
}

.schedule-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 6px 10px;
  border: 1px solid rgba(90, 74, 54, 0.28);
  background: rgba(247, 240, 228, 0.92);
}

a.schedule-compact--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.schedule-compact--link:hover {
  border-color: rgba(90, 74, 54, 0.5);
  background: rgba(255, 248, 236, 0.98);
}

a.schedule-compact--link:focus-visible {
  outline: 2px solid rgba(90, 74, 54, 0.55);
  outline-offset: 2px;
}

.schedule-compact__toggle {
  flex: 1 1 220px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.schedule-compact__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.schedule-compact__summary {
  font-size: 0.9rem;
}

.schedule-compact__chev {
  margin-left: auto;
  opacity: 0.6;
}

.schedule-compact__channel {
  font-size: 0.82rem;
  white-space: nowrap;
}

.schedule-compact__panel {
  flex: 1 1 100%;
  padding-top: 6px;
  border-top: 1px dashed rgba(90, 74, 54, 0.25);
}

.schedule-compact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.schedule-compact__empty {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

.master-schedule-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* —— Nav overflow + onboarding —— */
.nav-more {
  position: relative;
  display: inline-flex;
}

.nav-more__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border-soft, #8a7a62);
  background: var(--panel, #ebe1d0);
  box-shadow: 0 8px 20px rgba(40, 30, 20, 0.18);
}

.nav-more__panel[hidden] {
  display: none !important;
}

.map-hud__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
}

.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  border: 1px solid rgba(139, 69, 24, 0.35);
  background: linear-gradient(90deg, rgba(255, 248, 230, 0.95), rgba(236, 220, 190, 0.85));
  animation: next-step-in 0.45s ease-out;
}

@keyframes next-step-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.next-step__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.next-step__text {
  flex: 1 1 200px;
  font-size: 0.92rem;
}

.gate-hint {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px dashed rgba(90, 74, 54, 0.4);
  background: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

.gate-hint__cta {
  margin-left: 8px;
}

.master-toc__group {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}

.master-queues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.master-queues li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(90, 74, 54, 0.25);
  background: var(--panel-soft, #f4ecde);
}

.map-room {
  animation: map-fade 0.5s ease;
}

@keyframes map-fade {
  from {
    opacity: 0.85;
  }
  to {
    opacity: 1;
  }
}

/* —— Glossary —— */
.gloss-room {
  padding: 12px 14px 28px;
  max-width: none;
  color: var(--ink, #2b1a0e);
}

.gloss-room__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.gloss-room__title {
  margin: 0;
  color: var(--ink, #2b1a0e);
}

.gloss-lead {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.gloss-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
}

.gloss-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
  font-family: var(--font-pixel, monospace);
  color: var(--ink, #2b1a0e);
}

.gloss-filters input,
.gloss-filters select {
  min-width: 160px;
  padding: 7px 9px;
  font: inherit;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
  box-shadow: var(--bevel-in);
}

.gloss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gloss-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  height: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.gloss-card__details {
  margin: 0;
  flex: 1 1 auto;
}

.gloss-card__summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink, #2b1a0e);
}

.gloss-card__summary::-webkit-details-marker {
  display: none;
}

.gloss-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.gloss-card__head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink, #2b1a0e);
}

.gloss-card__excerpt {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--ink-soft, #4a3220);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gloss-card__more {
  font-family: var(--font-pixel, monospace);
  font-size: 0.9rem;
  color: var(--link, #8a4a18);
}

.gloss-card__details[open] .gloss-card__excerpt,
.gloss-card__details[open] .gloss-card__more {
  display: none;
}

.gloss-card__body {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink, #2b1a0e);
}

.gloss-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.gloss-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border: 1px solid rgba(90, 74, 54, 0.3);
  background: rgba(255, 255, 255, 0.55);
}

.gloss-muted {
  color: var(--ink-soft, #4a3220);
  opacity: 1;
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.gloss-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px dashed rgba(90, 74, 54, 0.35);
  background: rgba(255, 255, 255, 0.45);
}

.gloss-editor h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.gloss-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.gloss-editor__wide {
  grid-column: 1 / -1;
}

.gloss-editor input,
.gloss-editor select,
.gloss-editor textarea {
  padding: 6px 8px;
  font: inherit;
  border: 1px solid rgba(90, 74, 54, 0.35);
  background: #fff;
}

.gloss-editor__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* —— Achievements —— */
.ach-room {
  padding: 10px 12px 18px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  color: var(--ink, #2b1a0e);
  overflow-x: hidden;
}

.ach-room__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
}

.ach-room__title {
  margin: 0;
  color: var(--ink, #2b1a0e);
}

.ach-lead {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.ach-section {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(243, 223, 184, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  background-size: auto, cover;
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.ach-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--ink, #2b1a0e);
}

.ach-table-wrap {
  overflow-x: auto;
}

.ach-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ach-table th,
.ach-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(90, 74, 54, 0.22);
  color: var(--ink, #2b1a0e);
}

.ach-table th {
  font-size: 0.8rem;
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.ach-table__actions {
  white-space: nowrap;
}

.ach-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.ach-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.72);
  color: var(--ink, #2b1a0e);
}

.ach-card__media {
  aspect-ratio: 4 / 3;
  width: 100%;
  max-height: 120px;
  border: 1px solid rgba(74, 44, 20, 0.28);
  border-radius: 6px;
  background: #efe0c0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ach-thumb,
.ach-card__media img,
.ach-editor__preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ach-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid rgba(74, 44, 20, 0.28);
  background: #efe0c0;
}

.ach-card__ph {
  font-size: 2rem;
  color: var(--accent, #a16a38);
}

.ach-card__body h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--ink, #2b1a0e);
}

.ach-card__body p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--ink-soft, #4a3220);
}

.ach-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ach-editor__preview-wrap {
  min-height: 72px;
}

.ach-editor__preview {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid rgba(74, 44, 20, 0.28);
}

.ach-claim__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ach-editor,
.ach-claim-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8e8, #f5e6c4);
  box-shadow: var(--bevel-in);
  color: var(--ink, #2b1a0e);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.ach-claim-form > .btn,
.ach-claim-form > button[type='submit'] {
  grid-column: 1 / -1;
  justify-self: start;
  max-width: 100%;
}

.ach-editor h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink, #2b1a0e);
}

.ach-editor label,
.ach-claim-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-family: var(--font-pixel, monospace);
  color: var(--ink, #2b1a0e);
}

.ach-editor__wide,
.ach-claim-form__wide {
  grid-column: 1 / -1;
}

.ach-editor input,
.ach-editor textarea,
.ach-claim-form select,
.ach-claim-form textarea,
.ach-claim-form input {
  padding: 8px 10px;
  font: inherit;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
  box-shadow: var(--bevel-in);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.ach-editor__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.ach-claims {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ach-claim {
  padding: 10px 12px;
  border: 1px solid rgba(90, 74, 54, 0.25);
  background: var(--panel-soft, #f4ecde);
}

.ach-claim p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.ach-claim__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ach-claim--approved {
  border-color: rgba(46, 110, 60, 0.45);
}

.ach-claim--rejected {
  opacity: 0.75;
}

.ach-badge {
  font-size: 0.75rem;
  padding: 1px 6px;
  border: 1px solid rgba(90, 74, 54, 0.3);
}

.ach-muted {
  opacity: 1;
  font-size: 0.9rem;
  color: var(--ink-soft, #4a3220);
}

.ach-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .gloss-editor,
  .ach-editor,
  .ach-claim-form {
    grid-template-columns: 1fr;
  }
}

html[data-layout='mobile'] .ach-room,
html[data-layout='mobile'] .ach-section,
html[data-layout='mobile'] .ach-catalog,
html[data-layout='mobile'] .ach-claim-form,
html[data-layout='mobile'] .ach-editor {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

html[data-layout='mobile'] .ach-editor,
html[data-layout='mobile'] .ach-claim-form {
  grid-template-columns: 1fr;
}

html[data-layout='mobile'] .ach-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

html[data-layout='mobile'] .ach-catalog {
  grid-template-columns: 1fr;
}

html[data-layout='mobile'] .ach-claim__row {
  flex-wrap: wrap;
  max-width: 100%;
}

/* —— Tavern design pass —— */
.room-root {
  background: rgba(20, 14, 10, 0.25);
}

.guild-chat {
  background:
    linear-gradient(180deg, rgba(235, 225, 208, 0.92), rgba(212, 196, 168, 0.95)),
    var(--theme-parchment) center / cover;
  border-right: 3px solid var(--border, #3a2818);
  color: var(--ink, #1a1510);
}

.guild-chat__head {
  font-family: var(--font-pixel, monospace);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.app-role {
  font-family: var(--font-clerk, monospace);
  font-size: 0.75rem;
  color: var(--parchment, #e4d4b8);
}

.btn--layout {
  min-width: 5.5rem;
}

.room-nav .nav-btn {
  image-rendering: pixelated;
}

.map-hud {
  font-family: var(--font-clerk, monospace);
  color: var(--parchment, #e4d4b8);
}

.map-hud .next-step__label,
.room-title,
.npc-room__title,
.work-room h2,
.news-room h2,
.gossip-hero__copy h2,
.gloss-room__title {
  font-family: var(--font-pixel, monospace);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.gossip-lead,
.gossip-sheet__text,
.work-lead,
.npc-room__lead,
.gossip-learned p {
  font-family: var(--font-lore, Georgia, serif);
}

.work-result__stats,
.work-slot__meta,
.wh-stat,
[data-wh-players] {
  font-family: var(--font-clerk, monospace);
}

/* News — Tavern Wall */
.news-room--tavern-wall {
  padding: 12px 14px 28px;
  background:
    linear-gradient(180deg, rgba(20, 16, 24, 0.55), rgba(20, 16, 24, 0.72)),
    var(--theme-noticeboard) center / cover no-repeat;
  min-height: 100%;
  color: var(--parchment, #e4d4b8);
}

.news-room--tavern-wall .gossip-hero {
  background: rgba(20, 14, 10, 0.45);
  border: 2px solid var(--border, #3a2818);
  padding: 12px;
}

.news-room--tavern-wall .gossip-muted {
  color: rgba(228, 212, 184, 0.75);
}

.gossip-feed__list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gossip-sheet {
  width: 100%;
  min-height: 160px;
  padding: 14px 12px 18px;
  background:
    linear-gradient(180deg, rgba(244, 236, 222, 0.94), rgba(228, 212, 184, 0.96)),
    var(--theme-parchment) center / cover;
  color: var(--ink, #1a1510);
  border: 1px solid #5a4030;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.2s ease;
}

.gossip-sheet:hover {
  transform: rotate(0deg) scale(1.02);
  z-index: 1;
}

.gossip-sticker {
  display: inline-block;
  max-width: 260px;
  padding: 10px 12px;
  margin: 6px 4px;
  background: #f2e6c8;
  color: var(--ink, #1a1510);
  border: 1px dashed #8a6a40;
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(var(--tilt, -1deg));
  font-family: var(--font-lore, Georgia, serif);
  font-size: 0.92rem;
}

.gossip-feed__title,
.news-room--tavern-wall h3 {
  font-family: var(--font-pixel, monospace);
  letter-spacing: 0.04em;
  color: var(--torch-glow, #f7e26b);
}

/* Work — Clerk's Desk */
.work-room--clerk {
  padding: 12px 14px 28px;
  max-width: 920px;
  color: var(--parchment, #e4d4b8);
}

.work-room--clerk h2,
.work-room--clerk h3 {
  font-family: var(--font-pixel, monospace);
  letter-spacing: 0.04em;
  color: var(--torch-glow, #f7e26b);
}

.work-section--desk {
  padding: 12px;
  border: 3px solid var(--border, #3a2818);
  background:
    linear-gradient(180deg, rgba(60, 40, 24, 0.75), rgba(30, 20, 12, 0.85)),
    var(--theme-wood);
  background-size: auto, 200px 200px;
}

.work-pigeonholes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.work-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 88px;
  padding: 10px;
  text-align: left;
  border: 2px solid #1a1008;
  border-radius: 2px;
  background: linear-gradient(180deg, #5a3d24, #3a2514);
  color: var(--parchment, #e4d4b8);
  font-family: var(--font-lore, Georgia, serif);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.25), 0 3px 0 #1a1008;
}

.work-slot:hover {
  filter: brightness(1.1);
}

.work-slot--active {
  outline: 2px solid var(--brass, #c9a227);
  background: linear-gradient(180deg, #7a5232, #4a3018);
}

.work-slot__label {
  font-size: 0.92rem;
  line-height: 1.25;
}

.work-slot__meta {
  font-size: 0.72rem;
  opacity: 0.85;
  color: var(--torch-glow, #f7e26b);
}

.work-contract {
  margin: 10px 0;
  padding: 14px 16px;
  border: 2px solid #5a4030;
  background:
    linear-gradient(180deg, rgba(244, 236, 222, 0.96), rgba(228, 212, 184, 0.98));
  color: var(--ink, #1a1510);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  animation: contract-slide 0.35s ease;
}

@keyframes contract-slide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.work-contract__flavor {
  font-family: var(--font-lore, Georgia, serif);
  font-style: italic;
  margin: 0.4rem 0 0;
}

.work-result__stats {
  font-size: 0.85rem;
}

/* NPC dossier */
.npc-room--dossier {
  padding: 12px 14px 24px;
  color: var(--parchment, #e4d4b8);
}

.npc-dossier {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 14px;
  align-items: start;
  min-height: 420px;
}

.npc-dossier--cards-only {
  display: block;
  grid-template-columns: none;
  min-height: 0;
}

.npc-dossier__filters--toolbar {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 0 0 12px;
}

.npc-dossier__filters--toolbar .npc-room__search {
  flex: 1 1 160px;
  min-width: 140px;
}

.npc-dossier__tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
  padding: 4px;
}

.npc-tag {
  padding: 8px 10px;
  text-align: left;
  border: 1px solid #6a4a30;
  background:
    linear-gradient(180deg, #f0e4c8, #dcc9a4);
  color: var(--ink, #1a1510);
  font-family: var(--font-lore, Georgia, serif);
  font-size: 0.92rem;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.3);
}

.npc-tag:hover,
.npc-tag--active {
  transform: rotate(0deg);
  outline: 2px solid var(--brass, #c9a227);
  background: #f7efd8;
}

.npc-dossier__blank {
  position: relative;
  min-height: 360px;
  padding: 16px;
  border: 3px solid #2a1a10;
  background:
    linear-gradient(180deg, rgba(244, 236, 222, 0.94), rgba(228, 212, 184, 0.96)),
    var(--theme-parchment) center / cover;
  color: var(--ink, #1a1510);
  box-shadow: inset 0 0 40px rgba(90, 60, 30, 0.12), 0 6px 0 rgba(0, 0, 0, 0.3);
}

.npc-dossier__watermark {
  position: absolute;
  right: 16px;
  top: 12px;
  margin: 0;
  font-family: var(--font-clerk, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  opacity: 0.35;
  pointer-events: none;
}

.npc-dossier__hint {
  margin: 48px 12px;
  text-align: center;
}

.npc-dossier__filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  color: var(--ink, #2b1a0e);
  box-shadow: var(--bevel-out);
}

.npc-dossier__filters .npc-room__filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-pixel, monospace);
  font-size: 0.95rem;
  color: var(--ink, #2b1a0e);
}

.npc-dossier__filters .npc-room__filter--check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.npc-dossier__filters select {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
  font: inherit;
  font-size: 0.85rem;
  padding: 5px 6px;
}

.npc-dossier__filters .npc-room__search {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fff8e8, #f4e6c8),
    var(--theme-parchment, #f5d1a0);
  color: var(--ink, #2b1a0e);
  font: inherit;
  font-size: 0.95rem;
  padding: 8px 10px;
  box-shadow: var(--bevel-in);
}

.npc-room__grid--dossier {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.npc-room__grid--dossier .npc-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.92), rgba(244, 230, 200, 0.88));
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  box-shadow: var(--bevel-out);
  max-width: 100%;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.npc-room__grid--dossier .npc-card:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.npc-room__grid--dossier .npc-card__art {
  width: min(100%, 200px);
  max-width: 100%;
}

@media (max-width: 1100px) {
  .npc-room__grid--dossier {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .npc-room__grid--dossier {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .npc-room__grid--dossier {
    grid-template-columns: 1fr;
  }
}

html[data-layout='mobile'] .npc-room__grid--dossier {
  grid-template-columns: 1fr;
}

html[data-layout='mobile'] .npc-room__grid--dossier .npc-card__art {
  width: 100%;
  max-width: none;
}

.npc-card__fav {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(74, 44, 20, 0.35);
  border-radius: 4px;
  background: rgba(255, 248, 232, 0.92);
  color: var(--ink-soft, #4a3220);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
}

.npc-card__fav.is-on {
  color: #a16a38;
  background: #fff4d8;
  border-color: #a16a38;
}

.npc-card__fav:hover {
  border-color: var(--accent, #a16a38);
}

.npc-card__teaser {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-soft, #4a3220);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.npc-card__teaser + .npc-card__teaser {
  margin-top: 4px;
}

.npc-room__title {
  color: var(--torch-glow, #f7e26b);
}

/* Characters leather folder */
.characters-dossier {
  position: relative;
  display: flex;
  min-height: 100%;
  margin: 8px;
  border: 3px solid var(--border, #4a2c14);
  background:
    linear-gradient(180deg, rgba(60, 40, 24, 0.55), rgba(40, 28, 16, 0.65)),
    var(--theme-wood, #3a2818);
  box-shadow: var(--bevel-out, 2px 2px 0 rgba(0, 0, 0, 0.25));
  overflow: hidden;
}

.characters-dossier__spine {
  flex: 0 0 14px;
  background: repeating-linear-gradient(
    180deg,
    #2a1a10 0 6px,
    #4a3220 6px 12px
  );
  border-right: 2px solid #1a1008;
}

.characters-dossier__panel {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  margin: 10px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(232, 188, 122, 0.94)),
    var(--theme-parchment, var(--parchment, #f5d1a0));
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  box-shadow: var(--bevel-in);
}

.characters-dossier__watermark {
  margin: 0 0 8px;
  font-family: var(--font-clerk, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
}

.characters-ot-host {
  min-height: 480px;
}

.guild-seal {
  position: absolute;
  right: 28px;
  bottom: 36px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid #6b1a1a;
  background: radial-gradient(circle at 35% 30%, #c04040, #6b1212 70%);
  color: #f5e6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.guild-seal__mark {
  font-family: var(--font-pixel, monospace);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.guild-seal--stamp {
  animation: seal-stamp 0.55s cubic-bezier(0.2, 1.4, 0.3, 1) forwards;
}

@keyframes seal-stamp {
  0% {
    opacity: 0;
    transform: scale(1.6) rotate(-18deg);
  }
  55% {
    opacity: 1;
    transform: scale(0.95) rotate(4deg);
  }
  100% {
    opacity: 0.92;
    transform: scale(1) rotate(-6deg);
  }
}

/* Forced mobile preview — only when override=Mobile on a wide viewport */
html[data-layout-preview='1'] body {
  max-width: 390px;
  margin: 0 auto;
  border-left: 2px solid #1a1008;
  border-right: 2px solid #1a1008;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

html[data-layout='mobile'] .app-body {
  flex-direction: column;
}

html[data-layout='mobile'] .guild-chat {
  flex: 0 0 auto;
  width: 100%;
  max-height: 32vh;
  max-height: 32dvh;
  border-right: 0;
  border-bottom: 2px solid var(--border, #3a2818);
}

html[data-layout='mobile'] .map-stage {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

html[data-layout='mobile'] .map-canvas {
  position: relative;
  inset: auto;
  width: 100%;
  height: 62vh;
  height: 62dvh;
  min-height: 260px;
  max-height: 62vh;
  max-height: 62dvh;
  aspect-ratio: auto;
  overflow: hidden;
  flex: 0 0 auto;
}

html[data-layout='mobile'] .map-canvas .map-root,
html[data-layout='mobile'] .map-canvas .map-root svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}

html[data-layout='mobile'] .map-modes--rail {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  flex-direction: row;
  flex-wrap: wrap;
  margin: 0;
}

html[data-layout='mobile'] .map-chrome-left {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  margin: 8px;
  flex-direction: column;
}

html[data-layout='mobile'] .map-modes--rail .mode-btn__label {
  display: inline;
  font-size: 0.72rem;
}

html[data-layout='mobile'] .map-modes--rail .mode-btn {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 8px 10px;
}

html[data-layout='mobile'] .hud-vault--map {
  position: relative;
  top: auto;
  right: auto;
  width: auto;
  max-height: none;
  margin: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-layout='mobile'] .region-panel--overlay,
html[data-layout='mobile'] .map-legend--overlay {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  width: auto;
  max-height: none;
  margin: 8px;
}

html[data-layout='mobile'] .schedule-strip-host--overlay {
  position: relative;
  left: auto;
  transform: none;
  width: auto;
  max-width: none;
  margin: 8px;
}

html[data-layout='mobile'] .map-hud__board {
  max-width: 100%;
}

html[data-layout='mobile'] .npc-dossier {
  grid-template-columns: 1fr;
}

html[data-layout='mobile'] .npc-dossier__tags {
  flex-direction: row;
  flex-wrap: wrap;
  max-height: none;
}

@media (max-width: 720px) {
  .map-canvas {
    width: 100%;
    aspect-ratio: auto;
    max-height: none;
  }

  .npc-dossier {
    grid-template-columns: 1fr;
  }

  .npc-dossier__tags {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
}

/* —— Stardew + classic RPG polish —— */
a {
  color: var(--link, #8a4a18);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover, #5a3010);
}

a:focus-visible,
.btn:focus-visible,
.nav-btn:focus-visible {
  outline: 2px solid var(--brass, #e0b040);
  outline-offset: 2px;
}

/* Never default browser blue for in-app / abyss links */
a[href*="bp_nri"],
a[href*="t.me"],
.schedule-compact__channel,
.app-footer__links a {
  color: var(--ink, #2b1a0e);
  text-decoration: none;
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
  padding: 4px 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: var(--btn-radius, 6px);
  background: linear-gradient(180deg, #f5d1a0, #e0b878);
  box-shadow: var(--bevel-out);
  display: inline-block;
}

a[href*="bp_nri"]:hover,
.schedule-compact__channel:hover,
.app-footer__links a:hover {
  color: var(--ink, #2b1a0e);
  filter: brightness(1.05);
}

.rpg-frame {
  border: 3px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: var(--panel, #f3dfb8);
  color: var(--ink, #2b1a0e);
  box-shadow: var(--bevel-out), inset 0 0 0 1px rgba(240, 216, 120, 0.35);
}

.rpg-plaque {
  display: inline-block;
  padding: 6px 14px 8px;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #f0c878, #d89040);
  box-shadow: var(--bevel-out);
}

.rpg-plaque h1,
.app-header__brand h1 {
  color: var(--ink, #2b1a0e) !important;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}

.app-header__tagline {
  color: var(--ink-soft, #4a3220) !important;
  opacity: 1;
}

.app-role {
  color: var(--gold-ui, #f0d878);
  background: rgba(30, 18, 8, 0.45);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(240, 216, 120, 0.35);
}

.header-tools {
  align-items: center;
}

.header-tools__primary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Scrollbars — wood/gold */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--wood-mid, #8a5228) var(--parchment-deep, #e8bc7a);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--parchment-deep, #e8bc7a);
  border: 1px solid var(--border-soft, #7a4a28);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brass, #e0b040), var(--wood, #6b3c1a));
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.1);
}

/* HUD threat + vault */
.map-hud {
  color: var(--ink, #2b1a0e);
  gap: 8px;
  align-items: stretch;
  flex-wrap: nowrap;
}

.map-hud__next {
  display: none;
}

.map-hud__board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 10px;
  width: auto;
  max-width: min(920px, 100%);
  margin-right: 0;
}

.map-hud__board--threats,
.map-hud__board--strip {
  max-width: min(920px, 100%);
}

.hud-threats {
  display: grid;
  gap: 8px;
}

.hud-threats--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}

.hud-threats--inline .hud-threat {
  min-width: 120px;
  flex: 0 1 140px;
}

.hud-vault--row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.hud-vault--row .hud-vault__item {
  min-width: 64px;
  padding: 4px 6px;
}

.hud-threat__head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
  color: var(--ink, #2b1a0e);
}

.hud-threat__track {
  height: 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #3a2818;
  overflow: hidden;
  box-shadow: var(--bevel-in);
}

.hud-threat__fill {
  height: 100%;
  transition: width 0.35s ease;
}

.hud-threat--green .hud-threat__fill {
  background: var(--threat-green);
}
.hud-threat--yellow .hud-threat__fill {
  background: var(--threat-yellow);
}
.hud-threat--orange .hud-threat__fill {
  background: var(--threat-orange);
}
.hud-threat--red .hud-threat__fill {
  background: var(--threat-red);
}
.hud-threat--burgundy .hud-threat__fill {
  background: var(--threat-burgundy);
}

.hud-threat__band {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-family: var(--font-clerk, monospace);
  color: var(--ink-soft, #4a3220);
}

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

.hud-vault__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border: 2px solid var(--border-soft, #7a4a28);
  border-radius: 6px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hud-vault__k {
  font-family: var(--font-pixel, monospace);
  font-size: 0.95rem;
  color: var(--ink-soft, #4a3220);
}

.hud-vault__v {
  font-family: var(--font-clerk, monospace);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink, #2b1a0e);
}

.next-step {
  background: linear-gradient(90deg, #faebc8, #f0d8a0);
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  color: var(--ink, #2b1a0e);
  box-shadow: var(--bevel-out);
}

.next-step__label {
  color: var(--accent, #d87a24);
}

.next-step__text {
  color: var(--ink, #2b1a0e);
  opacity: 1;
}

.schedule-compact {
  background: var(--panel, #f3dfb8);
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  color: var(--ink, #2b1a0e);
}

.schedule-compact__toggle,
.schedule-compact__label,
.schedule-compact__summary {
  color: var(--ink, #2b1a0e);
}

.region-panel,
.map-legend {
  background: var(--panel, #f3dfb8);
  color: var(--ink, #2b1a0e);
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
}

.guild-chat {
  background: var(--panel, #f3dfb8) !important;
  color: var(--ink, #2b1a0e);
  border-right: 3px solid var(--border, #4a2c14);
}

.guild-chat__head {
  color: var(--ink, #2b1a0e);
  background: linear-gradient(180deg, #f0c878, #d89040);
  border-bottom: 2px solid var(--border, #4a2c14);
}

.guild-chat__name,
.guild-chat__text,
.guild-chat__hint,
.guild-chat__empty {
  color: var(--ink, #2b1a0e);
  opacity: 1;
}

.guild-chat--collapsed {
  max-height: 44px !important;
  overflow: hidden;
}

.guild-chat--collapsed .guild-chat__body {
  display: none;
}

/* Rooms: ink on parchment, not light-on-light */
.news-room--tavern-wall {
  color: var(--parchment, #f5d1a0);
}

.news-room--tavern-wall .gossip-hero__copy h2,
.news-room--tavern-wall .gossip-feed__title,
.news-room--tavern-wall h3 {
  color: var(--torch-glow, #ffe08a);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.news-room--tavern-wall .gossip-lead,
.news-room--tavern-wall .gossip-muted {
  color: #f5e6c8;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.gossip-sheet,
.gossip-sticker,
.gossip-learned.gossip-sticker {
  color: var(--ink, #2b1a0e);
}

.work-room--clerk {
  color: var(--ink, #2b1a0e);
}

.work-room--clerk h2,
.work-room--clerk h3 {
  color: var(--ink, #2b1a0e);
  text-shadow: none;
  background: linear-gradient(180deg, #f0c878, #e0a848);
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  box-shadow: var(--bevel-out);
}

.work-lead,
.work-muted,
.work-preview {
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.work-section--desk {
  color: var(--parchment, #f5d1a0);
}

.work-section--desk .work-muted,
.work-section--desk label {
  color: var(--parchment, #f5d1a0);
}

.npc-room--dossier {
  color: var(--ink, #2b1a0e);
}

.npc-room__title {
  color: var(--ink, #2b1a0e) !important;
  background: linear-gradient(180deg, #f0c878, #e0a848);
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
}

.npc-room__lead,
.npc-muted {
  color: var(--ink-soft, #4a3220);
  opacity: 1;
}

.npc-dossier__blank {
  color: var(--ink, #2b1a0e);
}

.work-slot {
  border-radius: 8px;
}

.work-contract {
  border-radius: 8px;
}

/* Mobile / forced mobile layout */
body,
.app-body {
  overflow-x: hidden;
  max-width: 100vw;
}

.header-tools__more {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-tools__more-toggle {
  list-style: none;
  cursor: pointer;
}

.header-tools__more-toggle::-webkit-details-marker {
  display: none;
}

.header-tools__more-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

html:not([data-layout='mobile']) .header-tools__more {
  display: inline-flex;
  align-items: center;
}

html:not([data-layout='mobile']) .header-tools__more-toggle {
  display: none;
}

html:not([data-layout='mobile']) .header-tools__more-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

@media (max-width: 720px) {
  html:not([data-layout='desktop']) .header-tools__more-toggle {
    display: inline-flex;
  }

  html:not([data-layout='desktop']) .header-tools__more:not([open]) .header-tools__more-panel {
    display: none;
  }

  html:not([data-layout='desktop']) .header-tools__more[open] .header-tools__more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 160px;
    padding: 8px;
    border: 2px solid var(--border, #4a2c14);
    border-radius: 6px;
    background: linear-gradient(180deg, #faebc8, #f0d8a0);
    box-shadow: var(--bevel-out);
  }
}

html[data-layout='mobile'] .header-tools__more-toggle {
  display: inline-flex;
}

html[data-layout='mobile'] .header-tools__more:not([open]) .header-tools__more-panel {
  display: none;
}

html[data-layout='mobile'] .header-tools__more[open] .header-tools__more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 160px;
  padding: 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
}

@media (max-width: 720px) {
  .app-header__actions .header-tools__primary .btn {
    min-height: 40px;
  }

  .map-hud__board {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

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

  .room-nav .nav-btn,
  .btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .app-header__row {
    flex-direction: column;
    align-items: stretch;
  }

  .header-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #chat-toggle-btn:not([hidden]) {
    display: inline-flex;
  }

  .guild-chat:not(.guild-chat--collapsed) {
    max-height: 36vh;
  }
}

html[data-layout='mobile'] .map-hud__board {
  grid-template-columns: 1fr;
}

html[data-layout='mobile'] .hud-vault {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Mobile chrome: brand | Chat | Войти; nav 4-up one row; scroll to map */
html[data-layout='mobile'] .app-header__row {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html[data-layout='mobile'] .app-header__brand {
  flex: 1 1 auto;
  min-width: 0;
}

html[data-layout='mobile'] .app-header__brand h1 {
  font-size: clamp(0.85rem, 3.6vw, 1.05rem);
  line-height: 1.15;
}

html[data-layout='mobile'] .app-header__actions.header-tools {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

html[data-layout='mobile'] #app-role {
  display: none !important;
}

html[data-layout='mobile'] #layout-toggle-btn {
  display: inline-flex !important;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.85rem;
  z-index: 40;
  position: relative;
}

html[data-layout='mobile'] .header-tools__primary:not(:has(.btn:not([hidden]))) {
  display: none;
}

html[data-layout='mobile'] .header-tools__more:not(:has(.header-tools__more-panel .btn:not([hidden]))) {
  display: none;
}

html[data-layout='mobile'] #chat-toggle-btn:not([hidden]) {
  display: inline-flex;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

html[data-layout='mobile'] #auth-btn {
  display: inline-flex;
  min-height: 36px;
  padding: 6px 12px;
  white-space: nowrap;
}

html[data-layout='mobile'] #room-nav.room-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  align-items: stretch;
}

html[data-layout='mobile'] #room-nav > .nav-btn,
html[data-layout='mobile'] #room-nav > .nav-more {
  min-width: 0;
  width: 100%;
}

html[data-layout='mobile'] #room-nav .nav-btn {
  min-height: 40px;
  padding: 6px 4px;
  font-size: clamp(0.72rem, 2.8vw, 0.88rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
}

html[data-layout='mobile'] #room-nav .nav-more {
  display: block;
  position: relative;
}

html[data-layout='mobile'] #room-nav .nav-more__toggle {
  width: 100%;
}

html[data-layout='mobile'] #room-nav .nav-more__panel {
  left: auto;
  right: 0;
  min-width: min(200px, 70vw);
}

html[data-layout='mobile'] .room-nav .nav-btn,
html[data-layout='mobile'] .btn {
  min-height: 40px;
}

html[data-layout='mobile'] body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
}

html[data-layout='mobile'] .app-body {
  overflow-x: hidden;
  overflow-y: visible;
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
}

html[data-layout='mobile'] .room-root:has(.map-room--bleed) {
  overflow: visible;
  height: auto;
  min-height: 0;
}

html[data-layout='mobile'] .map-room,
html[data-layout='mobile'] .map-room--bleed,
html[data-layout='mobile'] .map-stage {
  overflow: visible;
  height: auto;
  max-height: none;
  min-height: 0;
}

html[data-layout='mobile'] .guild-chat:not(.guild-chat--collapsed) {
  max-height: 36vh;
  max-height: 36dvh;
}

.nav-btn--deep {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* —— UX overhaul: news paper, stardew chat, muted HUD —— */
.news-room--paper {
  padding: 12px 14px 28px;
  color: var(--ink, #2b1a0e);
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.news-paper {
  padding: 16px 18px;
  border: 3px solid var(--border, #4a2c14);
  background:
    linear-gradient(180deg, #f7efd8, #efe0c0),
    var(--theme-parchment, #f5d1a0);
  box-shadow: var(--bevel-out);
}

.news-paper__masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px double var(--border, #4a2c14);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.news-paper__eyebrow {
  margin: 0;
  width: 100%;
  font-family: var(--font-clerk, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-paper__title {
  margin: 0;
  font-family: var(--font-pixel, monospace);
  font-size: 1.8rem;
  color: var(--ink, #2b1a0e);
}

.news-column {
  padding: 10px 0;
  border-bottom: 1px solid rgba(74, 44, 20, 0.25);
}

.news-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-rail__card {
  padding: 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: linear-gradient(180deg, #faebc8, #f0d8a0);
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
}

.news-rail__card h3 {
  margin: 0 0 8px;
  color: var(--ink, #2b1a0e);
}

@media (max-width: 900px) {
  .news-layout {
    grid-template-columns: 1fr;
  }
}

.guild-chat__bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 4px 6px;
  padding: 6px 8px;
  border: 2px solid #3a2818;
  border-radius: 10px 10px 10px 4px;
  background: linear-gradient(180deg, #fff4d8, #f0d8a8);
  box-shadow: 1px 1px 0 #1a1008;
  color: var(--ink, #2b1a0e);
}

.guild-chat__nameplate {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guild-chat__bubble .guild-chat__avatar {
  width: 28px;
  height: 28px;
  border: 2px solid #3a2818;
  border-radius: 2px;
  overflow: hidden;
  background: #d8c4a0;
  flex: 0 0 auto;
}

.guild-chat__bubble .guild-chat__name {
  margin: 0;
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
}

.guild-chat__bubble .guild-chat__text {
  margin: 0;
  padding-left: 36px;
  line-height: 1.35;
}

.map-hud__board--threats {
  background: linear-gradient(180deg, rgba(232, 200, 140, 0.92), rgba(200, 160, 100, 0.9));
  border-color: var(--border, #4a2c14);
}

.hud-vault--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.hud-vault--compact .hud-vault__item {
  padding: 4px 6px;
}

.master-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-family: var(--font-pixel, monospace);
  color: var(--ink, #2b1a0e);
}

.master-search input {
  padding: 6px 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
}

.lib-editor input[type='file'] {
  padding: 6px;
  border: 2px dashed var(--border, #4a2c14);
  background: #fff8e8;
}

.map-hud__board {
  max-width: min(960px, 100%);
}

/* —— UX overhaul: shared modal language (work / tickets / invest) —— */
.work-modal,
.tickets-modal,
.reports-modal.invest-modal,
.reports-modal--wide {
  width: min(720px, calc(100% - 24px));
  max-height: 88vh;
  padding: 16px 18px 20px;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #f7efd8, #efe0c0),
    var(--theme-parchment, #f5d1a0);
  box-shadow: var(--bevel-out, 3px 3px 0 #2b1a0e);
  color: var(--ink, #2b1a0e);
  font-family: var(--font-pixel, 'VT323', monospace);
}

.work-modal__close,
.tickets-modal__close {
  float: right;
  margin-bottom: 8px;
}

.work-modal__body .work-room,
.tickets-modal__body .tickets-room {
  color: var(--ink, #2b1a0e);
}

.work-modal select,
.work-modal input,
.work-modal textarea,
.tickets-modal select,
.tickets-modal input,
.tickets-modal textarea,
.news-rail__card select,
.news-rail__card input,
.news-rail__card textarea {
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e);
  padding: 6px 8px;
}

.work-modal select:focus,
.work-modal input:focus,
.work-modal textarea:focus,
.tickets-modal select:focus,
.tickets-modal input:focus,
.tickets-modal textarea:focus {
  outline: 2px solid #8b5a2b;
  outline-offset: 1px;
}

/* —— Polish pass 2 —— */
.master-toc--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f7efd8, #efe0c0),
    var(--theme-parchment, #f5d1a0);
}

.master-toc__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: #fff8e8;
  color: var(--ink, #2b1a0e) !important;
  text-decoration: none;
  font-family: var(--font-pixel, monospace);
  font-size: 0.95rem;
  box-shadow: var(--bevel-out);
  cursor: pointer;
}

button.master-toc__chip {
  font: inherit;
}

.master-toc__chip.is-active {
  background: #ffe6b8;
  box-shadow: inset 0 0 0 1px rgba(74, 44, 20, 0.35);
  font-weight: 700;
}

.master-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: 8px;
}

.master-room__bar {
  flex: 0 0 auto;
}

.master-toc--rail {
  position: sticky;
  top: 0;
  z-index: 6;
  flex: 0 0 auto;
  margin: 0;
  align-self: stretch;
}

.master-room__stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.master-room__stage .master-section[hidden] {
  display: none !important;
}

.master-room__stage .master-section.is-active {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.master-room,
.master-room .master-lead,
.master-room .master-muted,
.master-room .master-status,
.master-room h2,
.master-room h3,
.master-room label {
  color: var(--ink, #2b1a0e);
}

.master-section {
  background:
    linear-gradient(180deg, rgba(250, 235, 200, 0.96), rgba(232, 188, 122, 0.9)),
    var(--theme-parchment, #f5d1a0);
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: var(--ink, #2b1a0e);
}

.master-details > summary {
  cursor: pointer;
  list-style: none;
}

.master-details > summary::-webkit-details-marker {
  display: none;
}

.master-details > summary h3 {
  display: inline;
  margin: 0;
}

.master-toc--chips {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(245, 209, 160, 0.92);
  padding: 6px 0;
}

.master-section h3,
.master-section .master-muted,
.master-section label {
  color: var(--ink, #2b1a0e);
  opacity: 1;
}

.reports-modal__actions--pair {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.reports-players {
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(74, 44, 20, 0.35);
  padding: 8px;
  margin: 8px 0 12px;
  background: rgba(255, 248, 230, 0.55);
}

.reports-players__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
  font-size: 0.92rem;
}

.master-legend-row,
.master-games-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(64px, 0.6fr)) auto;
  gap: 6px 8px;
  align-items: center;
  margin: 6px 0;
  font-size: 0.85rem;
}

.master-games-row {
  grid-template-columns: minmax(0, 1.6fr) minmax(72px, 0.5fr) minmax(56px, 0.4fr) auto auto;
}

@media (max-width: 900px) {
  .master-legend-row,
  .master-games-row {
    grid-template-columns: 1fr 1fr;
  }
}

.reports-attention {
  margin: 16px 0;
  padding: 12px;
  border: 2px dashed var(--border, #4a2c14);
  border-radius: 8px;
  background: #fff4e0;
  color: var(--ink, #2b1a0e);
}

.reports-attention--focus {
  outline: 3px solid #a16a38;
}

.news-paper__masthead--charm {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.news-paper__velma {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 8px;
  box-shadow: var(--bevel-out);
}

.gossip-feed__list--cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.news-card,
.gossip-sheet.news-card {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #fffaf0;
  box-shadow: 2px 2px 0 rgba(40, 24, 10, 0.2);
}

.news-card--stub {
  opacity: 0.85;
  font-style: italic;
}

.next-step--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.next-step--compact .next-step__text {
  flex: 1 1 140px;
  min-width: 0;
}

/* —— chrome v3 —— */
.map-root svg {
  object-fit: contain;
}

.map-stage {
  max-height: none;
}

.map-chrome-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(148px, 30vw);
}

.map-chrome-left .map-modes--rail {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.region-panel--overlay {
  top: 12px;
  bottom: 12px;
  right: 10px;
  left: auto;
  width: min(380px, 42%);
  max-height: none;
  overflow: hidden;
}

.map-legend--overlay {
  top: auto;
  right: auto;
  bottom: 12px;
  left: 10px;
  height: auto;
  max-height: 48%;
  overflow: visible;
}

.map-chrome-left {
  bottom: auto;
  max-height: calc(100% - 12px - min(48%, 280px) - 16px);
  overflow: auto;
}

.map-hud__board--v3 {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 8px 10px;
  padding: 8px 10px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.map-hud__board--v3 .hud-mid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 148px) minmax(0, 1.05fr) minmax(240px, 1.55fr) minmax(0, 1.05fr) minmax(110px, 148px);
  gap: 8px 10px;
  align-items: stretch;
}

.map-hud__board--v3 .hud-mid__aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow: hidden;
}

.map-hud__board--v3 .map-hud__row--footer {
  display: none;
}

.map-hud__board--v3 .map-hud__next,
.map-hud__board--v3 .schedule-strip-host {
  min-width: 0;
}

.map-hud__next {
  display: block;
}

.hud-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  align-content: start;
  width: 100%;
}

.hud-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, #faebc8, #e8bc7a);
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
  font-family: var(--font-pixel, monospace);
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  box-sizing: border-box;
}

.hud-nav__btn.nav-btn--active {
  filter: brightness(1.06);
  box-shadow: var(--bevel-in);
}

.map-hud__board--v3 .hud-threats--inline,
.map-hud__board--v3 .hud-vault--row {
  display: grid;
  gap: 6px;
  align-items: stretch;
}

.map-hud__board--v3 .hud-threats--inline {
  grid-template-columns: 1fr;
}

.map-hud__board--v3 .hud-vault--row,
.map-hud__board--v3 .hud-vault--grid23,
.map-hud__board--v3 .hud-vault--row6,
.map-hud__board--v3 .hud-vault--wing {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  justify-self: stretch;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  gap: 6px;
  display: grid;
  align-items: stretch;
}

.map-hud__board--v3 .hud-vault--wing .hud-vault__item,
.map-hud__board--v3 .hud-vault--row6 .hud-vault__item,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault--wing .hud-vault__item {
  min-width: 0;
  min-height: 0 !important;
  max-height: none !important;
  height: 100%;
  padding: 5px 6px;
  justify-content: center;
  text-align: center;
  align-self: stretch;
}

.map-hud__board--v3 .hud-vault--wing .hud-vault__k,
.map-hud__board--v3 .hud-vault--row6 .hud-vault__k {
  font-size: 0.8rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.map-hud__board--v3 .hud-vault--wing .hud-vault__v,
.map-hud__board--v3 .hud-vault--row6 .hud-vault__v {
  font-size: 1.08rem;
}

.map-hud__board--v3 .hud-mid--winged > .hud-threat {
  min-width: 0;
  width: 100%;
  height: 100%;
}

.map-hud__board--v3 .hud-vault__item,
.map-hud__board--v3 .hud-threat {
  min-height: 52px;
  padding: 8px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(250, 235, 200, 0.95), rgba(232, 188, 122, 0.88));
  box-shadow: var(--bevel-out);
}

.map-hud__board--v3 .hud-vault__k,
.map-hud__board--v3 .hud-threat__label {
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  font-weight: 600;
}

.map-hud__board--v3 .hud-vault__v {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: normal;
}

.news-layout--velma {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.news-col--velma {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.news-col--velma .news-paper__velma {
  align-self: center;
}

.news-col--velma .news-paper__title {
  margin: 0;
}

.news-col--paper {
  min-width: 0;
}

.news-paper__velma {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 8px;
  box-shadow: var(--bevel-out);
}

.guild-chat__speaker--compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.guild-chat__speaker--compact .guild-chat__speaker-art {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border, #4a2c14);
  background: var(--panel-soft, #f4ecde);
}

.guild-chat__speaker--compact .guild-chat__speaker-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.guild-chat__speaker--compact .guild-chat__speaker-pick {
  flex: 1 1 auto;
  min-width: 0;
}

.guild-chat__speaker--compact .guild-chat__select {
  width: 100%;
}

@media (max-width: 900px) {
  .news-layout--velma {
    grid-template-columns: 1fr;
  }

  .map-hud__board--v3 .hud-mid,
  .map-hud__board--v3 .hud-mid--winged {
    grid-template-columns: 1fr;
  }

  .map-hud__board--v3 .hud-vault--row,
  .map-hud__board--v3 .hud-vault--grid23,
  .map-hud__board--v3 .hud-vault--row6,
  .map-hud__board--v3 .hud-vault--wing {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
  }
}

html[data-layout='mobile'] body {
  overflow-x: hidden;
}

html[data-layout='mobile'] .app-body {
  overflow-x: hidden;
}

html[data-layout='mobile'] .map-stage {
  min-height: 0;
  max-height: none;
}

html[data-layout='mobile'] .map-hud__board--v3 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  max-width: 100%;
}

html[data-layout='mobile'] .map-hud__board--v3 .hud-mid,
html[data-layout='mobile'] .map-hud__board--v3 .hud-mid--winged {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 8px;
}

html[data-layout='mobile'] .map-hud__board--v3 .hud-vault--wing {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-layout='mobile'] .hud-nav:not(#room-nav) {
  grid-template-columns: 1fr 1fr;
}

html[data-layout='mobile'] .guild-chat.guild-chat--collapsed {
  max-height: 2.75rem;
  overflow: hidden;
}

html[data-layout='mobile'] .guild-chat:not(.guild-chat--collapsed) {
  max-height: 36vh;
  max-height: 36dvh;
}

html[data-layout='mobile'] .map-chrome-left {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  margin: 8px;
  flex-direction: row;
  flex-wrap: wrap;
  order: -1;
}

html[data-layout='mobile'] .map-stage {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

html[data-layout='mobile'] .map-canvas {
  order: 0;
}

html[data-layout='mobile'] .map-modes--rail {
  position: relative;
  left: auto;
  top: auto;
  flex-direction: row;
  flex-wrap: wrap;
  width: auto;
}

html[data-layout='mobile'] .map-modes--rail .mode-btn__label {
  display: none;
}

html[data-layout='mobile'] .map-modes--rail .mode-btn {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 8px 10px;
}

html[data-layout='mobile'] .region-panel,
html[data-layout='mobile'] .region-panel--overlay,
html[data-layout='mobile'] .map-legend,
html[data-layout='mobile'] .map-legend--overlay {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 8px;
  flex: none;
}

html[data-layout='mobile'] .auth-modal-host .auth-modal,
html[data-layout='mobile'] .auth-modal-host [role='dialog'],
html[data-layout='mobile'] .auth-modal-host form.auth-form {
  width: min(100vw - 16px, 420px);
  max-width: calc(100vw - 16px);
  max-height: min(90vh, 90dvh);
  overflow: auto;
  box-sizing: border-box;
}

html[data-layout='mobile'] .app-header__brand h1 {
  font-size: clamp(0.95rem, 4.2vw, 1.2rem);
}

html[data-layout='mobile'] .app-header {
  position: static;
  top: auto;
  z-index: auto;
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
}

html[data-layout='mobile'] .map-hud,
html[data-layout='mobile'] #map-hud {
  position: static;
}

html[data-layout='mobile'] .app-body {
  padding-bottom: env(safe-area-inset-bottom);
}

/* —— Desktop density pass —— */
html:not([data-layout='mobile']) {
  height: 100%;
}

html:not([data-layout='mobile']) .map-room,
html:not([data-layout='mobile']) .map-room--bleed {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

html:not([data-layout='mobile']) .map-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  position: relative;
}

html:not([data-layout='mobile']) .map-root {
  background-color: #3a2a1a;
  background-image:
    radial-gradient(ellipse at center, transparent 55%, rgba(20, 12, 6, 0.55) 100%),
    var(--theme-parchment);
  background-size: auto, cover;
}

html:not([data-layout='mobile']) .map-canvas {
  background-color: #3a2a1a;
}

html:not([data-layout='mobile']) .app-header {
  padding: 6px 14px 4px;
}

html:not([data-layout='mobile']) .app-header__brand h1 {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

html:not([data-layout='mobile']) .hud-nav__btn {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 0.88rem;
}

html:not([data-layout='mobile']) .map-hud__board--v3 {
  gap: 6px;
  padding: 6px 8px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid {
  grid-template-columns: minmax(110px, 148px) minmax(0, 1.05fr) minmax(240px, 1.55fr) minmax(0, 1.05fr) minmax(110px, 148px);
  gap: 6px 10px;
  align-items: stretch;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threats--inline {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__item,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat {
  min-height: 0;
  padding: 4px 6px;
  gap: 2px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__k,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat__label {
  font-family: var(--font-pixel, monospace);
  font-size: var(--type-chrome-sm, 0.95rem);
  font-weight: 400;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__v,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat__pct {
  font-family: var(--font-clerk, monospace);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

html:not([data-layout='mobile']) .hud-threat__band {
  display: none;
}

html:not([data-layout='mobile']) .hud-threat__track {
  height: 8px;
}

html:not([data-layout='mobile']) .region-panel--overlay.region-panel--empty {
  top: 10px;
  bottom: auto;
  right: 10px;
  width: auto;
  max-width: min(280px, 40%);
  height: auto;
  padding: 6px 10px;
  overflow: visible;
}

html:not([data-layout='mobile']) .region-panel--overlay.region-panel--filled {
  top: 10px;
  bottom: 10px;
  max-height: none;
  overflow: hidden;
}

html:not([data-layout='mobile']) .region-panel__empty--chip {
  margin: 0;
  font-family: var(--font-pixel, monospace);
  font-size: var(--type-chrome-sm, 0.95rem);
  opacity: 0.9;
  white-space: nowrap;
}

html[data-room='map'] .app-footer,
html[data-room='map'] .app-header__tagline {
  display: none !important;
}

html:not([data-layout='mobile']) .news-layout--velma {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

html:not([data-layout='mobile']) .news-room,
html:not([data-layout='mobile']) .news-room--paper {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

html:not([data-layout='mobile']) .gossip-sheet.news-card,
html:not([data-layout='mobile']) .news-card {
  width: 100%;
  max-width: none;
}

html:not([data-layout='mobile']) .npc-room__grid--selected {
  grid-template-columns: 1fr;
}

html:not([data-layout='mobile']) .npc-room__grid--selected .npc-card--open {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: start;
  width: 100%;
}

html:not([data-layout='mobile']) .npc-room__grid--selected .npc-card__art {
  flex: 0 0 min(240px, 28%);
  width: min(240px, 28%);
  max-width: none;
  margin: 0;
}

html:not([data-layout='mobile']) .npc-room__grid--selected .npc-card__body {
  flex: 1 1 280px;
  min-width: 0;
}

html:not([data-layout='mobile']) .wh-room--split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.75fr);
  gap: 14px 18px;
  align-items: start;
  padding: 10px 14px 20px;
}

html:not([data-layout='mobile']) .wh-split__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 8px;
}

html:not([data-layout='mobile']) .master-toc--sticky,
html:not([data-layout='mobile']) .master-toc--chips,
html:not([data-layout='mobile']) .master-toc--rail {
  position: sticky;
  top: 0;
  z-index: 6;
}

html:not([data-layout='mobile']) .master-room {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

html:not([data-layout='mobile']) .master-room__bar,
html:not([data-layout='mobile']) .master-toc,
html:not([data-layout='mobile']) .master-room__stage {
  grid-column: unset;
  width: 100%;
}

html:not([data-layout='mobile']) .ach-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--type-lore-sm, 0.85rem);
  line-height: 1.35;
}

html:not([data-layout='mobile']) .ach-recent {
  list-style: none;
  margin: 0 0 12px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.65);
}

html:not([data-layout='mobile']) .ach-recent__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--type-lore-sm, 0.85rem);
}

html:not([data-layout='mobile']) .gloss-card:has(.gloss-card__details[open]) {
  grid-column: auto;
}

html:not([data-layout='mobile']) .guild-chat__empty {
  margin: 24px 12px;
  padding: 16px 12px;
  text-align: center;
  font-family: var(--font-lore, Georgia, serif);
  font-size: var(--type-lore, 0.88rem);
  font-style: italic;
  color: var(--ink-soft, #4a3220);
  opacity: 0.9;
  border: 1px dashed rgba(74, 44, 20, 0.35);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.45);
}

@media (max-width: 900px) {
  html:not([data-layout='mobile']) .wh-room--split {
    display: block;
  }

  html:not([data-layout='mobile']) .master-room {
    display: block;
  }

  html:not([data-layout='mobile']) .npc-room__grid--selected .npc-card--open {
    display: block;
  }
}

/* —— File polish: HUD / chrome / news / glossary —— */
#invest-btn[hidden] {
  display: none !important;
}

.map-hud span {
  white-space: normal;
}

.room-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
  align-content: start;
}

.room-nav .hud-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 88px;
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, #faebc8, #e8bc7a);
  box-shadow: var(--bevel-out);
  color: var(--ink, #2b1a0e);
  font-family: var(--font-pixel, monospace);
  font-size: 0.9rem;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
}

.room-nav .hud-nav__btn.nav-btn--active {
  filter: brightness(1.06);
  box-shadow: var(--bevel-in);
}

.room-nav .hud-nav__btn:hover {
  filter: brightness(1.04);
}

.map-hud__board--mid-only {
  grid-template-rows: auto;
}

html:not([data-layout='mobile']) .app-header {
  flex: 0 0 auto;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__item,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid__aside .next-step,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid__aside .schedule-compact {
  min-height: 44px;
  padding: 5px 7px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__v {
  font-size: 1.15rem;
}

html:not([data-layout='mobile']) .room-nav .hud-nav__btn {
  min-height: 28px;
  padding: 3px 6px;
  font-size: 0.88rem;
  min-width: 80px;
}

.map-legend--overlay {
  width: min(320px, 48vw) !important;
  max-height: 56%;
  font-size: 0.95rem;
  padding: 12px 14px;
  overflow: auto;
}

.map-legend--overlay .map-legend__title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.map-legend--overlay .map-legend__row {
  gap: 8px;
  margin: 4px 0;
  font-size: 0.92rem;
}

.map-legend--overlay .map-legend__swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.map-hud__board--v3 .hud-vault__item,
.map-hud__board--v3 .hud-threat,
.map-hud__board--v3 .hud-mid__aside .next-step,
.map-hud__board--v3 .hud-mid__aside .schedule-compact {
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  box-sizing: border-box;
}

.map-hud__board--v3 .hud-vault__item {
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 10px;
}

.map-hud__board--v3 .hud-vault__k {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: normal;
}

.map-hud__board--v3 .hud-vault__v {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-clerk, monospace);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
}

.map-hud__board--v3 .hud-threat {
  min-height: 52px;
  padding: 8px 10px;
  justify-content: center;
}

.map-hud__board--v3 .hud-threat__head {
  font-size: 1.05rem;
  gap: 6px;
}

.map-hud__board--v3 .hud-threat__label {
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
  font-weight: 400;
}

.map-hud__board--v3 .hud-threat__pct {
  font-family: var(--font-clerk, monospace);
  font-size: 1.05rem;
  font-weight: 700;
}

.map-hud__board--v3 .hud-threat__track {
  height: 11px;
}

.map-hud__board--v3 .hud-mid__aside {
  gap: 6px;
  justify-content: flex-start;
  max-height: none;
  overflow: hidden;
}

.map-hud__board--v3 .hud-mid__aside .next-step,
.map-hud__board--v3 .hud-mid__aside .schedule-compact {
  flex: 0 0 auto;
  min-height: 44px;
  max-height: 56px;
  overflow: hidden;
  padding: 6px 8px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(250, 235, 200, 0.95), rgba(232, 188, 122, 0.88));
  box-shadow: var(--bevel-out);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
}

.map-hud__board--v3 .hud-vault,
.map-hud__board--v3 .hud-threats {
  align-self: stretch;
}

.map-hud__board--v3 .hud-mid--winged .hud-vault--wing,
.map-hud__board--v3 .hud-mid--winged .hud-vault {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.map-hud__board--v3 .hud-vault__item {
  min-height: 44px !important;
  max-height: 56px;
  overflow: hidden;
}

.map-hud__board--v3 .hud-mid--winged .hud-vault--wing .hud-vault__item {
  min-height: 0 !important;
  max-height: none !important;
  height: 100%;
  overflow: hidden;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__item,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat {
  min-height: 52px;
  padding: 8px 10px;
  gap: 4px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid--winged .hud-vault--wing .hud-vault__item {
  min-height: 0 !important;
  max-height: none !important;
  height: 100%;
  padding: 5px 6px;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__k {
  font-size: 0.95rem;
  text-align: center;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__v {
  font-size: 1.22rem;
  text-align: center;
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat__label,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat__pct {
  font-size: 1.02rem;
}

html:not([data-layout='mobile']) .room-nav .hud-nav__btn {
  min-height: 34px;
  padding: 5px 6px;
  font-size: 0.92rem;
}

.news-layout--velma {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

html:not([data-layout='mobile']) .news-layout--velma {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(0, 1fr);
}

.news-col--paper-scroll {
  min-width: 0;
  padding: 12px 10px;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(247, 239, 216, 0.96), rgba(239, 224, 192, 0.94)),
    var(--theme-parchment, #f5d1a0);
  box-shadow: var(--bevel-out);
  transform: rotate(var(--col-tilt, 0deg));
}

.news-col--paper-scroll:nth-of-type(2) {
  --col-tilt: -0.6deg;
}

.news-col--paper-scroll:nth-of-type(3) {
  --col-tilt: 0.7deg;
}

.news-col--paper-scroll .gossip-feed__title {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
}

.gossip-feed__list--cards .gossip-sheet.news-card {
  width: 100%;
  max-width: none;
  background:
    linear-gradient(180deg, rgba(244, 236, 222, 0.96), rgba(228, 212, 184, 0.96)),
    var(--theme-parchment) center / cover;
  transform: rotate(var(--tilt, 0deg));
}

.gossip-feed__list--cards .gossip-sheet.news-card:nth-child(odd) {
  --tilt: -2deg;
}

.gossip-feed__list--cards .gossip-sheet.news-card:nth-child(even) {
  --tilt: 1.8deg;
}

.news-col--velma {
  height: 100%;
}

@media (max-width: 900px) {
  .news-layout--velma,
  html:not([data-layout='mobile']) .news-layout--velma {
    grid-template-columns: 1fr;
  }

  .news-col--paper-scroll {
    transform: none;
  }
}

@media (max-width: 1100px) {
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__v {
    font-size: 1.1rem;
  }

  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault__item,
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat {
    padding: 6px 7px;
  }
}

.gloss-card {
  cursor: pointer;
}

.gloss-card__open-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.gloss-modal-host:not([hidden]) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 80;
}

.gloss-modal .reports-modal__head,
.gloss-modal-host .reports-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gloss-modal .gloss-card__body {
  margin-top: 12px;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* —— Map / HUD / news polish (feedback 1–6) —— */
.map-modes--rail .mode-btn {
  white-space: normal;
  overflow: hidden;
  align-items: flex-start;
  padding: 6px 8px;
  min-height: 0;
  font-size: 0.98rem;
  line-height: 1.15;
}

.map-modes--rail .mode-btn__label {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.map-modes--rail .mode-btn__icon {
  margin-top: 1px;
}

.app-header__tagline {
  display: none !important;
}

.app-header__brand.rpg-plaque,
.app-header__brand {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.app-header__row {
  min-height: 3rem;
  align-items: center;
}

.app-header__brand h1 {
  margin: 0;
  line-height: 1.15;
}

/* —— HUD fixup: map size, vertical threats, news fill, schedule —— */
.map-fit {
  display: contents;
}

.map-root {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 3%;
  box-sizing: border-box;
}

.map-root svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain !important;
  overflow: hidden;
  background: transparent;
}

.map-hud__board--v3 .hud-mid {
  align-items: stretch;
  grid-template-columns: minmax(110px, 148px) minmax(0, 1.05fr) minmax(240px, 1.55fr) minmax(0, 1.05fr) minmax(110px, 148px);
}

html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid {
  grid-template-columns: minmax(110px, 148px) minmax(0, 1.05fr) minmax(240px, 1.55fr) minmax(0, 1.05fr) minmax(110px, 148px);
  align-items: stretch;
}

.map-hud__board--v3 .hud-threats--inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: stretch;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  max-width: 100%;
}

.map-hud__board--v3 .hud-threat,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 3px 6px;
  height: 100%;
  max-height: 100%;
  min-height: 0 !important;
  padding: 4px 5px !important;
  justify-content: stretch !important;
  align-content: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

.map-hud__board--v3 .hud-threat__meter {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 2.1em;
  min-width: 2.1em;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

.map-hud__board--v3 .hud-threat__label {
  grid-column: 1 / -1;
  grid-row: 1;
  font-family: var(--font-pixel, monospace);
  font-size: 0.95rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-hud__board--v3 .hud-threat__track,
html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threat__track,
html:not([data-layout='mobile']) .hud-threat__track {
  position: relative;
  flex: 1 1 auto;
  width: 10px !important;
  min-width: 10px;
  max-width: 10px;
  min-height: 0 !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-self: center;
  overflow: hidden;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 4px;
  background: #3a2818;
  box-shadow: var(--bevel-in);
}

.map-hud__board--v3 .hud-threat__fill {
  position: relative;
  z-index: 1;
  width: 100% !important;
  min-height: 2px;
  border-radius: 0;
  transition: height 0.35s ease;
}

.map-hud__board--v3 .hud-threat__pct {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-clerk, monospace);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -0.03em;
}

.map-hud__board--v3 .hud-threat__face {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  justify-self: stretch;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0;
  margin-top: -2px;
  overflow: hidden;
  color: var(--ink, #2b1a0e);
}

.map-hud__board--v3 .hud-threat--lorent .hud-threat__face {
  color: #3a2214;
}

.map-hud__board--v3 .hud-threat--gawed .hud-threat__face {
  color: #2a3340;
}

.map-hud__board--v3 .hud-threat--green .hud-threat__face,
.map-hud__board--v3 .hud-threat--yellow .hud-threat__face,
.map-hud__board--v3 .hud-threat--orange .hud-threat__face,
.map-hud__board--v3 .hud-threat--red .hud-threat__face,
.map-hud__board--v3 .hud-threat--burgundy .hud-threat__face {
  color: inherit;
}

.map-hud__board--v3 .hud-threat--lorent.hud-threat--green .hud-threat__face,
.map-hud__board--v3 .hud-threat--lorent.hud-threat--yellow .hud-threat__face,
.map-hud__board--v3 .hud-threat--lorent.hud-threat--orange .hud-threat__face,
.map-hud__board--v3 .hud-threat--lorent.hud-threat--red .hud-threat__face,
.map-hud__board--v3 .hud-threat--lorent.hud-threat--burgundy .hud-threat__face {
  color: #3a2214;
}

.map-hud__board--v3 .hud-threat--gawed.hud-threat--green .hud-threat__face,
.map-hud__board--v3 .hud-threat--gawed.hud-threat--yellow .hud-threat__face,
.map-hud__board--v3 .hud-threat--gawed.hud-threat--orange .hud-threat__face,
.map-hud__board--v3 .hud-threat--gawed.hud-threat--red .hud-threat__face,
.map-hud__board--v3 .hud-threat--gawed.hud-threat--burgundy .hud-threat__face {
  color: #2a3340;
}

.map-hud__board--v3 .hud-threat__face svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin-top: 0;
  align-self: stretch;
}

/* Compact / mobile: faces and meters stay readable */
html[data-layout='mobile'] .map-hud__board--v3 .hud-threats--inline {
  min-height: 96px;
}

html[data-layout='mobile'] .map-hud__board--v3 .hud-threat {
  min-height: 88px !important;
  grid-template-rows: auto minmax(64px, 1fr);
}

html[data-layout='mobile'] .map-hud__board--v3 .hud-threat__face {
  min-height: 64px;
  max-height: 88px;
  overflow: visible;
}

html[data-layout='mobile'] .map-hud__board--v3 .hud-threat__face svg {
  max-height: 80px;
  width: auto;
  margin-inline: auto;
}

@media (max-width: 1279px), (max-height: 799px) {
  .map-hud__board--v3 .hud-threats--inline {
    min-height: 96px;
  }

  .map-hud__board--v3 .hud-threat {
    min-height: 88px !important;
    grid-template-rows: auto minmax(64px, 1fr);
  }

  .map-hud__board--v3 .hud-threat__face {
    min-height: 64px;
    max-height: 88px;
    overflow: visible;
  }

  .map-hud__board--v3 .hud-threat__face svg {
    max-height: 80px;
    width: auto;
    margin-inline: auto;
  }
}

.map-hud__board--v3 .hud-mid--winged .aside-chip__text,
.map-hud__board--v3 .hud-mid--winged .next-step__text,
.map-hud__board--v3 .hud-mid--winged .schedule-compact__summary {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-hud__board--v3 .hud-mid__aside {
  max-height: none;
  overflow: hidden;
  gap: 6px;
  padding: 4px;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(248, 232, 198, 0.55), rgba(232, 188, 122, 0.35));
  box-shadow: var(--bevel-out);
  align-self: stretch;
  min-width: 0;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

.map-hud__board--v3 .hud-mid__aside .map-hud__next,
.map-hud__board--v3 .hud-mid__aside .schedule-strip-host,
.map-hud__board--v3 .hud-mid__aside #schedule-strip-host {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.map-hud__board--v3 .hud-mid__aside .aside-chip,
.map-hud__board--v3 .hud-mid__aside .next-step,
.map-hud__board--v3 .hud-mid__aside .schedule-compact {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--border, #4a2c14);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(250, 235, 200, 0.95), rgba(232, 188, 122, 0.88));
  box-shadow: var(--bevel-out);
  display: grid;
  grid-template-columns: minmax(6.75rem, 8.25rem) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}

.map-hud__board--v3 .aside-chip--split .aside-chip__title,
.map-hud__board--v3 .aside-chip__title,
.map-hud__board--v3 .next-step__label,
.map-hud__board--v3 .schedule-compact__label {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  height: 100%;
  text-align: center;
  margin: 0;
  padding: 6px 8px;
  border-right: 2px solid rgba(74, 44, 20, 0.45);
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: none;
  opacity: 1;
  color: var(--ink, #2b1a0e);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.map-hud__board--v3 .aside-chip--split .aside-chip__info,
.map-hud__board--v3 .aside-chip__info {
  display: flex;
  align-items: center;
  align-self: stretch;
  height: 100%;
  min-width: 0;
  padding: 6px 10px;
  box-sizing: border-box;
}

.map-hud__board--v3 .aside-chip__label,
.map-hud__board--v3 .aside-chip__body {
  display: none;
}

.map-hud__board--v3 .aside-chip__text,
.map-hud__board--v3 .next-step__text,
.map-hud__board--v3 .schedule-compact__summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-family: var(--font-clerk, Georgia, serif);
  font-size: 0.98rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink, #2b1a0e);
  opacity: 1;
}

.map-hud__board--v3 .hud-mid__aside .next-step__label,
.map-hud__board--v3 .hud-mid__aside .schedule-compact__label {
  color: var(--ink, #2b1a0e);
  text-transform: none;
  opacity: 1;
}

.map-hud__board--v3 .aside-chip__link,
.map-hud__board--v3 .schedule-compact__channel,
.map-hud__board--v3 a.schedule-compact__channel {
  display: none !important;
}

.map-hud__board--v3 .next-step--action {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 0;
  background: transparent;
}

.map-hud__board--v3 .next-step__cta {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
}

.room-root:has(.news-room--paper) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-root:has(.master-room) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.room-root:has(.master-room) > .master-room {
  flex: 1 1 auto;
  min-height: 0;
}

.news-room--paper {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-bottom: 12px;
}

.news-layout--velma.news-layout--paper-sheet,
html:not([data-layout='mobile']) .news-layout--velma.news-layout--paper-sheet {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.news-col--velma {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.news-col--velma .news-paper__velma,
.news-paper__velma {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 3px solid var(--border, #4a2c14);
  box-shadow: var(--bevel-out);
  flex: 0 0 auto;
}

.news-paper-sheet {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 14px 16px 18px;
  border: 3px solid var(--border, #4a2c14);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(250, 244, 228, 0.98), rgba(236, 220, 188, 0.96)),
    var(--theme-parchment, #f5d1a0);
  box-shadow: var(--bevel-out);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.news-article {
  min-width: 0;
  min-height: 0;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
}

.news-article__title {
  margin: 0 0 8px;
  font-family: var(--font-pixel, monospace);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--ink, #2b1a0e);
  flex: 0 0 auto;
}

.news-article__body {
  flex: 1 1 auto;
  min-height: 8rem;
  height: 100%;
  column-count: 4;
  column-gap: 14px;
  column-fill: auto;
  column-rule: 1px solid rgba(74, 44, 20, 0.28);
}

.news-article__text {
  margin: 0 0 0.55em;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: justify;
  hyphens: auto;
  columns: unset;
}

.news-article__byline {
  flex: 0 0 auto;
  margin-top: 6px;
}

.news-article--lead {
  flex: 1.15 1 0;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border, #4a2c14);
  margin-bottom: 0;
  min-height: 0;
}

.news-article--lead .news-article__body {
  column-count: 4;
  min-height: 12rem;
}

.news-paper-sheet__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
}

.news-article--half {
  padding-top: 14px;
  height: 100%;
  min-height: 0;
}

.news-article--half .news-article__body {
  column-count: 2;
  column-gap: 12px;
  min-height: 10rem;
}

.news-article--left {
  border-right: 2px solid var(--border, #4a2c14);
  padding-right: 12px;
}

.news-article--right {
  padding-left: 12px;
}

.news-article--stub {
  opacity: 0.92;
}

@media (max-width: 900px) {
  .news-layout--velma.news-layout--paper-sheet,
  html:not([data-layout='mobile']) .news-layout--velma.news-layout--paper-sheet {
    grid-template-columns: 1fr;
    height: auto;
  }

  .news-paper-sheet {
    height: auto;
  }

  .news-article__body,
  .news-article--lead .news-article__body,
  .news-article--half .news-article__body {
    column-count: 1;
    min-height: 0;
    height: auto;
  }

  .news-paper-sheet__row {
    grid-template-columns: 1fr;
  }

  .news-article--left {
    border-right: 0;
    border-bottom: 2px solid var(--border, #4a2c14);
    padding-right: 8px;
  }

  .news-article--right {
    padding-left: 8px;
  }
}

/* —— Mid-band / short desktop: compact HUD + in-flow map chrome —— */
@media (max-width: 1279px), (max-height: 799px) {
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid,
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid--winged {
    display: flex;
    flex-direction: column;
    grid-template-columns: none !important;
    gap: 8px;
    align-items: stretch;
  }

  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-threats--inline,
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid--winged > .hud-threat {
    width: 100%;
  }

  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-vault--wing {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  html:not([data-layout='mobile']) .map-stage {
    display: flex;
    flex-direction: column;
    overflow: auto;
    max-height: none;
  }

  html:not([data-layout='mobile']) .map-canvas {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: min(50vh, 420px);
    height: min(52vh, 520px);
    flex: 0 0 auto;
  }

  html:not([data-layout='mobile']) .map-chrome-left,
  html:not([data-layout='mobile']) .map-modes--rail,
  html:not([data-layout='mobile']) .region-panel,
  html:not([data-layout='mobile']) .region-panel--overlay,
  html:not([data-layout='mobile']) .map-legend,
  html:not([data-layout='mobile']) .map-legend--overlay,
  html:not([data-layout='mobile']) .schedule-strip-host--overlay,
  html:not([data-layout='mobile']) .hud-vault--map {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 8px;
  }

  html:not([data-layout='mobile']) .map-modes--rail {
    flex-direction: row;
    flex-wrap: wrap;
  }

  html:not([data-layout='mobile']) .map-modes--rail .mode-btn {
    min-width: 44px;
    min-height: 44px;
  }

  html:not([data-layout='mobile']) .map-chrome-left {
    order: -1;
  }

  html:not([data-layout='mobile']) body,
  html:not([data-layout='mobile']) .app-body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  html:not([data-layout='mobile']) .room-root:has(.map-room--bleed) {
    overflow: visible;
    height: auto;
  }
}

/* Wide + tall desktop restores winged HUD (wins over mid-band when both would apply — this block is more specific via min queries) */
@media (min-width: 1280px) and (min-height: 800px) {
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid,
  html:not([data-layout='mobile']) .map-hud__board--v3 .hud-mid--winged {
    display: grid;
    grid-template-columns: minmax(110px, 148px) minmax(0, 1.05fr) minmax(240px, 1.55fr) minmax(0, 1.05fr) minmax(110px, 148px) !important;
    gap: 6px 10px;
    align-items: stretch;
  }

  html:not([data-layout='mobile']) .map-modes--rail .mode-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

