/* RimWorld in-game UI chrome for guide posts (Architect paths, bills, item cards) */
.rwg {
  --rwg-panel: #1c1f25;
  --rwg-panel-2: #252830;
  --rwg-edge: #3a3e46;
  --rwg-edge-hi: #5a5e66;
  --rwg-tan: #9a8458;
  --rwg-gold: #c4a35a;
  --rwg-ink: #e4e0d8;
  --rwg-muted: #9a9588;
  --rwg-dim: #6e6a60;
  --rwg-ok: #6dbd4a;
  --rwg-warn: #d4b44a;
  --rwg-bad: #c45c4a;
  color: var(--rwg-ink);
  font-family: var(--font-sans, "Noto Sans", "Segoe UI", system-ui, sans-serif);
  line-height: 1.55;
  max-width: 920px;
  margin: 0 auto;
}

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

.rwg .rwg-kicker {
  margin: 0 0 0.4rem;
  color: var(--rwg-gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rwg .rwg-lead {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--rwg-panel);
  border: 1px solid var(--rwg-edge);
  box-shadow: var(--shadow-window, 0 8px 24px rgb(0 0 0 / 35%));
  border-radius: 3px;
}

.rwg .rwg-lead p {
  margin: 0;
}

.rwg .rwg-lead p + p {
  margin-top: 0.7rem;
}

.rwg h2 {
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rwg-edge);
  color: var(--rwg-gold);
  font-size: 1.35rem;
  font-weight: 700;
}

.rwg h3 {
  margin: 1.25rem 0 0.55rem;
  color: var(--rwg-tan);
  font-size: 1.05rem;
}

.rwg p,
.rwg li {
  color: var(--rwg-ink);
}

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

.rwg .rwg-cite {
  color: var(--rwg-dim);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Menu path: Architect → Production → … */
.rwg-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.75rem;
  background: #0c0d0f;
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgb(0 0 0 / 45%);
}

.rwg-path .rwg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  background: linear-gradient(180deg, #3a3428 0%, #2a251c 100%);
  border: 1px solid #5c4e32;
  box-shadow:
    inset 1px 1px 0 #c4b07a,
    inset -1px -1px 0 #5c4e32,
    0 0 0 1px #1a1814;
  border-radius: 2px;
  color: #f0e6c8;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  white-space: nowrap;
}

.rwg-path .rwg-btn.is-active {
  background: linear-gradient(180deg, #c4a35a 0%, #9a8458 100%);
  color: #1a1814;
  border-color: #d4b86e;
}

.rwg-path .rwg-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
}

.rwg-path .rwg-sep {
  color: var(--rwg-dim);
  font-size: 0.85rem;
  user-select: none;
}

.rwg-hotkey {
  margin-left: 0.15rem;
  padding: 0.05rem 0.28rem;
  border: 1px solid var(--rwg-edge-hi);
  border-radius: 2px;
  background: #15171b;
  color: var(--rwg-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Numbered how-to steps with game chrome */
.rwg-steps {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  counter-reset: rwgstep;
}

.rwg-steps > li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: var(--rwg-panel);
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
  counter-increment: rwgstep;
}

.rwg-steps > li::before {
  content: counter(rwgstep);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.1rem;
  background: var(--rwg-tan);
  color: #1a1814;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 #c4b07a, inset -1px -1px 0 #5c4e32;
}

.rwg-steps .rwg-step-body > :first-child {
  margin-top: 0;
}

.rwg-steps .rwg-step-body > :last-child {
  margin-bottom: 0;
}

.rwg-steps strong.rwg-ingame {
  color: var(--rwg-gold);
  font-weight: 700;
}

/* Item / building cards */
.rwg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
}

.rwg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem;
  text-align: center;
  background: var(--rwg-panel-2);
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgb(255 255 255 / 6%);
}

.rwg-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}

.rwg-card .rwg-card-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--rwg-ink);
  text-transform: lowercase;
}

.rwg-card .rwg-card-meta {
  font-size: 0.75rem;
  color: var(--rwg-muted);
  line-height: 1.35;
}

.rwg-card.is-highlight {
  border-color: var(--rwg-tan);
  box-shadow:
    inset 1px 1px 0 rgb(196 163 90 / 25%),
    0 0 0 1px rgb(154 132 88 / 35%);
}

/* Recipe strip: A + B + C → Out */
.rwg-recipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.85rem 0 1.15rem;
  padding: 0.85rem;
  background: #0c0d0f;
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
}

.rwg-recipe .rwg-ing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 72px;
  padding: 0.4rem 0.35rem;
  background: var(--rwg-panel);
  border: 1px solid var(--rwg-edge);
  border-radius: 2px;
}

.rwg-recipe .rwg-ing img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.rwg-recipe .rwg-ing span {
  font-size: 0.72rem;
  color: var(--rwg-muted);
  text-align: center;
  line-height: 1.25;
}

.rwg-recipe .rwg-ing strong {
  color: var(--rwg-ink);
  font-size: 0.78rem;
}

.rwg-recipe .rwg-op {
  color: var(--rwg-gold);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0 0.15rem;
}

/* Data tables */
.rwg-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.15rem;
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
}

.rwg table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rwg th,
.rwg td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--rwg-edge);
  text-align: left;
  vertical-align: top;
}

.rwg th {
  background: var(--rwg-panel-2);
  color: var(--rwg-gold);
  font-weight: 700;
  white-space: nowrap;
}

.rwg tbody tr:nth-child(even) {
  background: rgb(255 255 255 / 2%);
}

.rwg td.num,
.rwg th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rwg td .rwg-cell-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.rwg td .rwg-cell-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* Callouts */
.rwg-note {
  margin: 0.85rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--rwg-tan);
  background: var(--rwg-panel);
  border-radius: 0 3px 3px 0;
}

.rwg-note.warn {
  border-left-color: var(--rwg-warn);
}

.rwg-note.bad {
  border-left-color: var(--rwg-bad);
}

.rwg-note.ok {
  border-left-color: var(--rwg-ok);
}

.rwg-note p {
  margin: 0;
}

.rwg-note p + p {
  margin-top: 0.45rem;
}

/* Interactive widget */
.rwg-widget {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--rwg-panel);
  border: 1px solid var(--rwg-edge);
  border-radius: 3px;
  box-shadow: var(--shadow-window, 0 8px 24px rgb(0 0 0 / 35%));
}

.rwg-widget h2,
.rwg-widget h3 {
  margin-top: 0;
}

.rwg-widget label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--rwg-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.rwg-widget input[type="number"] {
  width: min(100%, 220px);
  padding: 0.45rem 0.55rem;
  background: #0c0d0f;
  border: 1px solid var(--rwg-edge-hi);
  border-radius: 2px;
  color: var(--rwg-ink);
  font-size: 1rem;
}

.rwg-widget .rwg-result {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: #0c0d0f;
  border: 1px solid var(--rwg-edge);
  border-radius: 2px;
  color: var(--rwg-gold);
  font-weight: 600;
  line-height: 1.45;
}

.rwg-foot {
  margin-top: 2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rwg-edge);
  color: var(--rwg-dim);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .rwg-recipe .rwg-op {
    width: 100%;
    text-align: center;
  }

  .rwg-steps > li {
    grid-template-columns: 1fr;
  }

  .rwg-steps > li::before {
    margin-top: 0;
  }
}
